预定餐1
This commit is contained in:
parent
aa45cb917b
commit
64c739bfb5
|
|
@ -1,17 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<div class="top-wrap">
|
<view class="top-wrap">
|
||||||
<div class="top-cont flex justify-between align-center">
|
<view class="top-cont flex justify-between align-center">
|
||||||
<div class="flex align-center">
|
<view class="flex align-center">
|
||||||
<u-icon name="../../static/images/time.png" size="16"></u-icon>
|
<u-icon name="../../static/images/time.png" size="16"></u-icon>
|
||||||
<span style="margin-left: 5px">{{ newDate }}</span>
|
<span style="margin-left: 5px">{{ newDate }}</span>
|
||||||
</div>
|
</view>
|
||||||
<!-- <div class="top-right-cont">
|
<!-- <view class="top-right-cont">
|
||||||
<span class="right-item" :class="{ active: active == 1 }" @click="active = 1">自取</span>
|
<span class="right-item" :class="{ active: active == 1 }" @click="active = 1">自取</span>
|
||||||
<span class="right-item" :class="{ active: active == 2 }" @click="active = 2">外卖</span>
|
<span class="right-item" :class="{ active: active == 2 }" @click="active = 2">外卖</span>
|
||||||
</div> -->
|
</view> -->
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<view class="tab-navigation">
|
<view class="tab-navigation">
|
||||||
<Tabs :tabList="tabList" @changeTab="changeTab" />
|
<Tabs :tabList="tabList" @changeTab="changeTab" />
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -26,11 +26,11 @@
|
||||||
<scroll-view class="content-right" scroll-y="true">
|
<scroll-view class="content-right" scroll-y="true">
|
||||||
<view class="scroll-right-item" v-for="(item,index) in dishesList" :key="index">
|
<view class="scroll-right-item" v-for="(item,index) in dishesList" :key="index">
|
||||||
<view style="width: 100%;display: flex;align-items: center;">
|
<view style="width: 100%;display: flex;align-items: center;">
|
||||||
<view style="width: 30%;height: 100%;">
|
<view style="width: 30%;height: 100%;" @click="goMenuDetail(item)">
|
||||||
<image class="image" :src="item.dishesImgUrl"></image>
|
<image class="image" :src="item.dishesImgUrl"></image>
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 65%;height: 100%; display: flex;position: relative;">
|
<view style="width: 65%;height: 100%; display: flex;position: relative;">
|
||||||
<view class="center-cont">
|
<view class="center-cont" @click="goMenuDetail(item)">
|
||||||
<view class="meal-name" style="margin-bottom: 10rpx;font-weight: bold;">{{ item.dishesName }}</view>
|
<view class="meal-name" style="margin-bottom: 10rpx;font-weight: bold;">{{ item.dishesName }}</view>
|
||||||
<view class="sale-num" style="margin-bottom: 10rpx;">月销 {{ item.monthlySales||0 }}</view>
|
<view class="sale-num" style="margin-bottom: 10rpx;">月销 {{ item.monthlySales||0 }}</view>
|
||||||
<view class="num-cont" style="margin-bottom: 10rpx;">
|
<view class="num-cont" style="margin-bottom: 10rpx;">
|
||||||
|
|
@ -64,81 +64,84 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 购物车 -->
|
<!-- 购物车 -->
|
||||||
<div style="height: 60px"></div>
|
<view style="height: 60px"></view>
|
||||||
<div class="shop-car">
|
<view class="shop-car">
|
||||||
<div class="car-cont">
|
<view class="car-cont">
|
||||||
<div class="flex align-center" @click="openCar">
|
<view class="flex align-center" @click="openCar">
|
||||||
<u-icon name="../../static/images/shop-car.png" size="25"></u-icon>
|
<u-icon name="../../static/images/shop-car.png" size="25"></u-icon>
|
||||||
<span class="money">
|
<span class="money">
|
||||||
<span style="font-size: 11px">¥</span>
|
<span style="font-size: 11px">¥</span>
|
||||||
{{ totalPrice }}
|
{{ totalPrice }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</view>
|
||||||
|
|
||||||
<div>
|
<view>
|
||||||
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">结算</u-button>
|
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">结算</u-button>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
|
|
||||||
<!-- 购物车-pop -->
|
<!-- 购物车-pop -->
|
||||||
<u-popup :show="showCar" position="bottom" :round="12" @close="showCar = false">
|
<u-popup :show="showCar" position="bottom" :round="12" @close="showCar = false">
|
||||||
<div class="popup-cont">
|
<view class="popup-cont">
|
||||||
<div class="flex justify-between align-center">
|
<view class="flex justify-between align-center">
|
||||||
<div style="font-weight: 500; font-size: 14px">已加购菜品</div>
|
<view style="font-weight: 500; font-size: 14px">已加购菜品</view>
|
||||||
<div style="font-weight: 400; font-size: 12px; color: #ff6816" @click="showModal = true">清空</div>
|
<view style="font-weight: 400; font-size: 12px; color: #ff6816" @click="showModal = true">清空</view>
|
||||||
</div>
|
</view>
|
||||||
|
|
||||||
<div class="flex justify-between align-center" style="margin: 20.5px 0 12.5px">
|
<view class="flex justify-between align-center" style="margin: 20.5px 0 12.5px">
|
||||||
<div class="flex align-center">
|
<view class="flex align-center">
|
||||||
{{ canteenName }}/{{stallName}}
|
{{ canteenName }}/{{stallName}}
|
||||||
<span class="name-type">{{ canteenType }}</span>
|
<span class="name-type">{{ canteenType }}</span>
|
||||||
</div>
|
</view>
|
||||||
|
<view>
|
||||||
<div>
|
|
||||||
{{ newDate2 }}
|
{{ newDate2 }}
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
|
|
||||||
<div class="list-wrap">
|
<view class="list-wrap">
|
||||||
<div class="cont-list" v-for="(food, foodIndex) in addFood">
|
<view class="cont-list" v-for="(food, foodIndex) in addFood">
|
||||||
<div>
|
<u-swipe-action>
|
||||||
<u-image :src="food.dishesImgUrl" showLoading width="80px" height="80px" />
|
<u-swipe-action-item :options="options" @click="delFood($event, food)">
|
||||||
</div>
|
<view style="width: 100%;display: flex;height: auto;">
|
||||||
|
<view>
|
||||||
<div class="center-cont">
|
<u-image :src="food.dishesImgUrl" showLoading width="80px" height="80px" />
|
||||||
<div class="meal-name">{{ food.dishesName }}</div>
|
</view>
|
||||||
<div class="sale-num">月销 {{ food.monthlySales||0 }}</div>
|
<view class="center-cont">
|
||||||
<div class="num-cont">
|
<view class="meal-name">{{ food.dishesName }}</view>
|
||||||
<span style="margin-right: 5px">{{ '库存' + food.dishesDetailList[0].surplusNum }}</span>
|
<view class="sale-num">月销 {{ food.monthlySales||0 }}</view>
|
||||||
<span>{{ '限购' + food.dishesDetailList[0].restrictNum }}</span>
|
<view class="num-cont">
|
||||||
</div>
|
<span style="margin-right: 5px">{{ '库存' + food.dishesDetailList[0].surplusNum }}</span>
|
||||||
<div class="sale-price">
|
<span>{{ '限购' + food.dishesDetailList[0].restrictNum }}</span>
|
||||||
<span style="font-size: 11px">¥</span>
|
</view>
|
||||||
{{ (food.dishesDetailList[0].prefPrice/100).toFixed(2) }}
|
<view class="sale-price">
|
||||||
</div>
|
<span style="font-size: 11px">¥</span>
|
||||||
</div>
|
{{ (food.dishesDetailList[0].prefPrice/100).toFixed(2) }}
|
||||||
|
</view>
|
||||||
<div class="right-cont">
|
</view>
|
||||||
<div class="num-wrap">
|
<view class="right-cont">
|
||||||
<u-icon
|
<view class="num-wrap">
|
||||||
v-if="food.num > 0"
|
<u-icon
|
||||||
name="../../static/images/del.png"
|
v-if="food.num > 0"
|
||||||
size="16"
|
name="../../static/images/del.png"
|
||||||
@click="handleFoodNum(1, food)"
|
size="16"
|
||||||
/>
|
@click="handleFoodNum(1, food)"
|
||||||
<span class="cont-num">{{ food.num || 0 }}</span>
|
/>
|
||||||
<u-icon
|
<span class="cont-num">{{ food.num || 0 }}</span>
|
||||||
:disabled="food.num < food.restrictNum"
|
<u-icon
|
||||||
name="../../static/images/add2.png"
|
:disabled="food.num < food.restrictNum"
|
||||||
size="16"
|
name="../../static/images/add2.png"
|
||||||
@click="handleFoodNum(2, food)"
|
size="16"
|
||||||
/>
|
@click="handleFoodNum(2, food)"
|
||||||
</div>
|
/>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</u-swipe-action-item>
|
||||||
|
</u-swipe-action>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
<u-modal :show="showModal" showCancelButton title="提示" @cancel="showModal = false" @confirm="clearCar">
|
<u-modal :show="showModal" showCancelButton title="提示" @cancel="showModal = false" @confirm="clearCar">
|
||||||
|
|
@ -150,7 +153,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getlistReserveDateAPI,getAdvanceDetailListAPI,addAdvancehoppingCartAPI,updateAdvancehoppingCartAPI,getShoppingCartListAPI } from '@/api/advanceOrder/index.js'
|
import { getlistReserveDateAPI,getAdvanceDetailListAPI,addAdvancehoppingCartAPI,updateAdvancehoppingCartAPI,clearAdvancehoppingCartAPI,getShoppingCartListAPI } from '@/api/advanceOrder/index.js'
|
||||||
import Tabs from '@/pages/components/Tabs.vue'
|
import Tabs from '@/pages/components/Tabs.vue'
|
||||||
export default {
|
export default {
|
||||||
components: { Tabs },
|
components: { Tabs },
|
||||||
|
|
@ -176,6 +179,13 @@ export default {
|
||||||
showModal: false, // 清空购物车
|
showModal: false, // 清空购物车
|
||||||
// 添加的菜品
|
// 添加的菜品
|
||||||
addFood: [],
|
addFood: [],
|
||||||
|
options: [{
|
||||||
|
text: '删除',
|
||||||
|
style: {
|
||||||
|
backgroundColor: '#f56c6c'
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
|
||||||
|
|
||||||
current: 0,
|
current: 0,
|
||||||
active: 1, // 1 自取 2 外卖
|
active: 1, // 1 自取 2 外卖
|
||||||
|
|
@ -330,8 +340,10 @@ export default {
|
||||||
this.recipeId=options.recipeId;
|
this.recipeId=options.recipeId;
|
||||||
//获取预定日期
|
//获取预定日期
|
||||||
this.getReserveDate()
|
this.getReserveDate()
|
||||||
//获取预定餐菜谱
|
setTimeout(()=>{
|
||||||
this.getMenuListData()
|
//获取预定餐菜谱
|
||||||
|
this.getMenuListData()
|
||||||
|
},1000)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取预定日期
|
//获取预定日期
|
||||||
|
|
@ -368,7 +380,7 @@ export default {
|
||||||
async getMenuListData() {
|
async getMenuListData() {
|
||||||
let param = {
|
let param = {
|
||||||
"recipeId":this.recipeId,
|
"recipeId":this.recipeId,
|
||||||
// "applyDate":this.newDate2
|
// "applyDate":this.newDate2,
|
||||||
"applyDate":"2024-11-11"
|
"applyDate":"2024-11-11"
|
||||||
}
|
}
|
||||||
const res = await getAdvanceDetailListAPI(param)
|
const res = await getAdvanceDetailListAPI(param)
|
||||||
|
|
@ -441,6 +453,11 @@ export default {
|
||||||
return '夜宵'
|
return '夜宵'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
goMenuDetail(item){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/weeklyMenu/menuDetail?params=${JSON.stringify(item)}`
|
||||||
|
})
|
||||||
|
},
|
||||||
//获取预定购物车(订单)
|
//获取预定购物车(订单)
|
||||||
async getShoppingCartList(){
|
async getShoppingCartList(){
|
||||||
let param = {
|
let param = {
|
||||||
|
|
@ -463,6 +480,42 @@ export default {
|
||||||
if(food.baseDishesId==cartItem.goodsDishesId){
|
if(food.baseDishesId==cartItem.goodsDishesId){
|
||||||
// food.num = food.num+1
|
// food.num = food.num+1
|
||||||
this.$set(food, 'num', cartItem.quantity)
|
this.$set(food, 'num', cartItem.quantity)
|
||||||
|
let obj = {
|
||||||
|
"canteenId":this.canteenId,
|
||||||
|
"canteenName":this.canteenName,
|
||||||
|
"costModelList":food.costModelList,
|
||||||
|
"custId": uni.getStorageSync('custId'),
|
||||||
|
"detailType": food.detailType,
|
||||||
|
"extParam": null,
|
||||||
|
"goodsDishesId": cartItem.goodsDishesId,
|
||||||
|
"goodsDishesImgUrl": food.dishesImgUrl,
|
||||||
|
"goodsDishesName": cartItem.goodsDishesName,
|
||||||
|
"ifExpired": cartItem.ifExpired,
|
||||||
|
"inventoryId": cartItem.inventoryId,
|
||||||
|
"mealtimeName": cartItem.mealtimeName,
|
||||||
|
"mealtimeType": cartItem.mealtimeType,
|
||||||
|
"menuDetailId": cartItem.menuDetailId,
|
||||||
|
"menuId": cartItem.menuId,
|
||||||
|
// "orderDate": cartItem.orderDate,
|
||||||
|
"orderDate": this.newDate2,
|
||||||
|
"orderType": cartItem.orderType,
|
||||||
|
"dishesDetailList":food.dishesDetailList,
|
||||||
|
"prefPrice": food.dishesDetailList[0].prefPrice,
|
||||||
|
"quantity": cartItem.quantity,
|
||||||
|
"restrictNum": cartItem.restrictNum,
|
||||||
|
"salePrice": cartItem.salePrice,
|
||||||
|
"salesMode": cartItem.salesMode,
|
||||||
|
"shoppingCartId": cartItem.shoppingCartId,
|
||||||
|
"sizeJson": cartItem.sizeJson,
|
||||||
|
"sizeName": cartItem.sizeName,
|
||||||
|
"sizeType": cartItem.sizeType,
|
||||||
|
"stallId": this.stallId,
|
||||||
|
"stallName": this.stallName,
|
||||||
|
"surplusNum": cartItem.surplusNum,
|
||||||
|
"unitName": null,
|
||||||
|
"weightUnit": null
|
||||||
|
}
|
||||||
|
this.$set(cartItem, 'orderDetailList', [obj])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -494,12 +547,43 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
//删除按钮
|
||||||
|
async delFood(e,item){
|
||||||
|
console.log(e)
|
||||||
|
console.log(item)
|
||||||
|
console.log(this.shoppingCartList)
|
||||||
|
let param = {
|
||||||
|
"custId":uni.getStorageSync('custId'),
|
||||||
|
"shoppingCartId":"",
|
||||||
|
"quantity":0
|
||||||
|
}
|
||||||
|
this.shoppingCartList.forEach(cartItem=>{
|
||||||
|
if(item.baseDishesId==cartItem.goodsDishesId){
|
||||||
|
param.shoppingCartId=cartItem.shoppingCartId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.menuData.forEach(menuItem => {
|
||||||
|
menuItem.typeList.forEach(detail => {
|
||||||
|
detail.dishesList.forEach(food => {
|
||||||
|
if(food.baseDishesId==item.baseDishesId){
|
||||||
|
this.$set(food, 'num', 0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(param)
|
||||||
|
const res = await updateAdvancehoppingCartAPI(param)
|
||||||
|
if(res.code==200){
|
||||||
|
this.getShoppingCartList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
async addShopCart(item){
|
async addShopCart(item){
|
||||||
console.log(item)
|
console.log(item)
|
||||||
let param = {
|
let param = {
|
||||||
"orderType": 2,
|
"orderType": 2,
|
||||||
// "orderDate":this.newDate2
|
"orderDate":this.newDate2,
|
||||||
"orderDate":"2024-11-11",
|
// "orderDate":"2024-11-11",
|
||||||
"mealtimeType":item.mealtimeType,
|
"mealtimeType":item.mealtimeType,
|
||||||
"custId":uni.getStorageSync('custId'),
|
"custId":uni.getStorageSync('custId'),
|
||||||
"menuId":this.recipeId,
|
"menuId":this.recipeId,
|
||||||
|
|
@ -508,6 +592,7 @@ export default {
|
||||||
"goodsDishesId":item.baseDishesId,
|
"goodsDishesId":item.baseDishesId,
|
||||||
"goodsDishesName":item.dishesName,
|
"goodsDishesName":item.dishesName,
|
||||||
"quantity":1,
|
"quantity":1,
|
||||||
|
"prefPrice":item.prefPrice
|
||||||
}
|
}
|
||||||
const res = await addAdvancehoppingCartAPI(param)
|
const res = await addAdvancehoppingCartAPI(param)
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
|
|
@ -542,7 +627,42 @@ export default {
|
||||||
this.getShoppingCartList()
|
this.getShoppingCartList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 打开购物车
|
//购物车-清空按钮
|
||||||
|
clearCar(){
|
||||||
|
let arr = []
|
||||||
|
this.shoppingCartList.forEach(cartItem=>{
|
||||||
|
arr.push(cartItem.shoppingCartId)
|
||||||
|
})
|
||||||
|
try {
|
||||||
|
let param = {
|
||||||
|
"custId":uni.getStorageSync('custId'),
|
||||||
|
"shoppingCartIds":arr,
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
|
clearAdvancehoppingCartAPI(param).then(res => {
|
||||||
|
if(res.code==200){
|
||||||
|
console.log(res)
|
||||||
|
this.menuData.forEach(menuItem => {
|
||||||
|
menuItem.typeList.forEach(detail => {
|
||||||
|
detail.dishesList.forEach(food => {
|
||||||
|
this.$set(food, 'num', 0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.getShoppingCartList()
|
||||||
|
this.showModal = false
|
||||||
|
}else{
|
||||||
|
this.getShoppingCartList()
|
||||||
|
this.showModal = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 打开购物车
|
||||||
openCar() {
|
openCar() {
|
||||||
if (this.totalPrice == 0) return
|
if (this.totalPrice == 0) return
|
||||||
this.showCar = true
|
this.showCar = true
|
||||||
|
|
@ -561,42 +681,13 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.totalPrice = total.toFixed(1)
|
this.totalPrice = total.toFixed(2)
|
||||||
this.addFood = addFood
|
this.addFood = addFood
|
||||||
if (this.addFood.length == 0) this.showCar = false
|
if (this.addFood.length == 0) this.showCar = false
|
||||||
console.log('🚀 ~ handleTotalPrice ~ total', this.totalPrice)
|
console.log('🚀 ~ handleTotalPrice ~ total', this.totalPrice)
|
||||||
console.log('🚀 ~ handleTotalPrice ~ addFood', this.addFood)
|
console.log('🚀 ~ handleTotalPrice ~ addFood', this.addFood)
|
||||||
},
|
},
|
||||||
//购物车-清空按钮
|
|
||||||
clearCar(){
|
|
||||||
this.shoppingCartList.forEach(cartItem=>{
|
|
||||||
try {
|
|
||||||
let param = {
|
|
||||||
"custId":uni.getStorageSync('custId'),
|
|
||||||
"shoppingCartId":cartItem.shoppingCartId,
|
|
||||||
"quantity":0
|
|
||||||
}
|
|
||||||
console.log(param)
|
|
||||||
updateAdvancehoppingCartAPI(param).then(res => {
|
|
||||||
if(res.code==200){
|
|
||||||
console.log(res)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
this.menuData.forEach(menuItem => {
|
|
||||||
menuItem.typeList.forEach(detail => {
|
|
||||||
detail.dishesList.forEach(food => {
|
|
||||||
this.$set(food, 'num', 0)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.getShoppingCartList()
|
|
||||||
this.showModal = false
|
|
||||||
},
|
|
||||||
// 订单结算
|
// 订单结算
|
||||||
handleOrder() {
|
handleOrder() {
|
||||||
console.log('结算')
|
console.log('结算')
|
||||||
|
|
@ -609,7 +700,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/advanceOrder/orderDetails?canteenId=${this.canteenId}&stallId=${this.stallId}&canteenName=${this.canteenName}&stallName=${this.stallName}`
|
url: `/pages/advanceOrder/orderDetails?carList=${JSON.stringify(this.shoppingCartList)}&canteenId=${this.canteenId}&stallId=${this.stallId}&canteenName=${this.canteenName}&stallName=${this.stallName}&totalPrice=${this.totalPrice}&orderDate=${this.newDate2}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//垂直定位锚点
|
//垂直定位锚点
|
||||||
|
|
@ -787,9 +878,9 @@ page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cont-list {
|
.cont-list {
|
||||||
display: flex;
|
// display: flex;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
position: relative;
|
// position: relative;
|
||||||
/* border-bottom: 1px solid #f0f0f0; */
|
/* border-bottom: 1px solid #f0f0f0; */
|
||||||
}
|
}
|
||||||
.center-cont {
|
.center-cont {
|
||||||
|
|
|
||||||
|
|
@ -22,22 +22,22 @@
|
||||||
<div class="img-cont m-8">
|
<div class="img-cont m-8">
|
||||||
<div class="img-list m-8" v-for="(item, index) in shoppingCartList" :key="index">
|
<div class="img-list m-8" v-for="(item, index) in shoppingCartList" :key="index">
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<u-image :src="item.goodsDishesImgUrl" width="80px" height="80px" />
|
<u-image :src="item.orderDetailList[0].goodsDishesImgUrl" width="80px" height="80px" />
|
||||||
<div class="name-num">
|
<div class="name-num">
|
||||||
<div style="margin-bottom: 10px">{{ item.goodsDishesName }}</div>
|
<div style="margin-bottom: 10px">{{ item.goodsDishesName }}</div>
|
||||||
<div>x{{ item.quantity }}</div>
|
<div>x{{ item.quantity }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>¥{{ (item.salePrice/100).toFixed(2) }}</div>
|
<div>¥{{ (item.orderDetailList[0].dishesDetailList[0].prefPrice/100).toFixed(2) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between m-8 bt">
|
<div class="flex justify-between m-8 bt">
|
||||||
配送费
|
配送费
|
||||||
<div>{{ detailData.deliveryFee }}</div>
|
<div>{{ detailData.deliveryFee||"免配送费" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between m-8 bt">
|
<div class="flex justify-between m-8 bt">
|
||||||
包装费
|
包装费
|
||||||
<div>{{ detailData.packingFee }}</div>
|
<div>{{ detailData.packingFee||"免包装费" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between align-center m-8 bt">
|
<div class="flex justify-between align-center m-8 bt">
|
||||||
备注
|
备注
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
<u-line />
|
<u-line />
|
||||||
<div class="flex justify-between m-8 realAmount">
|
<div class="flex justify-between m-8 realAmount">
|
||||||
小计
|
小计
|
||||||
<div>¥{{ detailData.realAmount || 12 }}</div>
|
<div>¥{{ totalPrice }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="order">
|
<div class="order">
|
||||||
|
|
@ -69,12 +69,12 @@
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<span class="money">
|
<span class="money">
|
||||||
<span style="font-size: 13px">实付款¥</span>
|
<span style="font-size: 13px">实付款¥</span>
|
||||||
{{ detailData.totalPrice }}
|
{{ totalPrice }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">
|
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder(1)">
|
||||||
结算
|
结算
|
||||||
</u-button>
|
</u-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getShoppingCartListAPI } from '@/api/advanceOrder/index.js'
|
import { getListElectronMobileUsableAPI,addReserveMealApi } from '@/api/advanceOrder/index.js'
|
||||||
export default {
|
export default {
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -101,6 +101,8 @@ export default {
|
||||||
canteenName:"",
|
canteenName:"",
|
||||||
stallId:"",
|
stallId:"",
|
||||||
stallName:"",
|
stallName:"",
|
||||||
|
totalPrice:0,
|
||||||
|
orderDate:"",
|
||||||
shoppingCartList:[],
|
shoppingCartList:[],
|
||||||
// 详情页数据
|
// 详情页数据
|
||||||
detailData: {
|
detailData: {
|
||||||
|
|
@ -141,30 +143,267 @@ export default {
|
||||||
this.canteenName = options.canteenName
|
this.canteenName = options.canteenName
|
||||||
this.stallId = options.stallId
|
this.stallId = options.stallId
|
||||||
this.stallName = options.stallName
|
this.stallName = options.stallName
|
||||||
this.getShoppingCartList()
|
this.totalPrice = Number(options.totalPrice).toFixed(2)
|
||||||
|
this.orderDate = options.orderDate;
|
||||||
|
this.shoppingCartList=JSON.parse(options.carList)
|
||||||
|
console.log(this.shoppingCartList)
|
||||||
|
this.getListElectronMobileUsable()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取预定购物车(订单)
|
//(获取餐卷)
|
||||||
async getShoppingCartList(){
|
async getListElectronMobileUsable(){
|
||||||
let param = {
|
let param = {
|
||||||
"custId":uni.getStorageSync('custId'),
|
"custId":uni.getStorageSync('custId'),
|
||||||
"canteenId":this.canteenId,
|
"canteenIdSet":[this.canteenId],
|
||||||
"stallId":this.stallId,
|
"shopstallIdSet":[this.stallId],
|
||||||
}
|
"intervalIdSet":[this.shoppingCartList[0].mealtimeType]
|
||||||
const res = await getShoppingCartListAPI(param)
|
|
||||||
console.log(res, '预订餐预定')
|
|
||||||
if(res.code==200){
|
|
||||||
this.shoppingCartList = res.data;
|
|
||||||
console.log(this.shoppingCartList)
|
|
||||||
}else{
|
|
||||||
this.shoppingCartList = []
|
|
||||||
}
|
}
|
||||||
|
const res = await getListElectronMobileUsableAPI(param)
|
||||||
|
console.log(res, '获取餐卷')
|
||||||
|
|
||||||
},
|
},
|
||||||
confirm(e) {
|
confirm(e) {
|
||||||
console.log('🚀 ~ confirm ~ value:', e)
|
console.log('🚀 ~ confirm ~ value:', e)
|
||||||
this.showPicker = false
|
this.showPicker = false
|
||||||
this.detailData.orderState = e.value[0].label
|
this.detailData.orderState = e.value[0].label
|
||||||
},
|
},
|
||||||
|
getNowFormatDate() {
|
||||||
|
let date = new Date()
|
||||||
|
let year = date.getFullYear()
|
||||||
|
let month = (date.getMonth() + 1).toString().padStart(2, '0')
|
||||||
|
let day = date.getDate().toString().padStart(2, '0')
|
||||||
|
let hours = date.getHours().toString().padStart(2, '0');
|
||||||
|
let minutes = date.getMinutes().toString().padStart(2, '0');
|
||||||
|
let seconds = date.getSeconds().toString().padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
},
|
||||||
|
async handleOrder(){
|
||||||
|
let orderDetailList = []
|
||||||
|
console.log(this.shoppingCartList)
|
||||||
|
this.shoppingCartList.forEach(item=>{
|
||||||
|
orderDetailList.push(item.orderDetailList[0])
|
||||||
|
})
|
||||||
|
let param={
|
||||||
|
"amount": this.totalPrice*100,
|
||||||
|
"couponId": "",
|
||||||
|
"custId": uni.getStorageSync('custId'),
|
||||||
|
"ifTrial": 1,
|
||||||
|
"ordTime": this.getNowFormatDate(),
|
||||||
|
// "ordTime": "2025-02-20 13:57:21",
|
||||||
|
"payType": 1,
|
||||||
|
"reserveMealList":[
|
||||||
|
{
|
||||||
|
"canteenId": this.canteenId,
|
||||||
|
"canteenName": this.canteenName,
|
||||||
|
"stallId": this.stallId,
|
||||||
|
"stallName": this.stallName,
|
||||||
|
"consigneeMobile": "yyvwjetYVxeP1VW3vTv7nQ==",
|
||||||
|
"consigneeName": "dsf ",
|
||||||
|
"costModelList": [
|
||||||
|
{
|
||||||
|
"deliveryAmount": null,
|
||||||
|
"deliveryName": "自取堂食",
|
||||||
|
"deliveryType": 1,
|
||||||
|
"packingFee": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"counterId": "",
|
||||||
|
"deliveryAddr": "自取堂食",
|
||||||
|
"deliveryCosts": null,
|
||||||
|
"deliveryFee": 0,
|
||||||
|
"deliveryType": 1,
|
||||||
|
"mealtimeName": this.shoppingCartList[0].mealtimeName,
|
||||||
|
"mealtimeType": this.shoppingCartList[0].mealtimeType,
|
||||||
|
"orderDate": this.orderDate,
|
||||||
|
"orderDetailList": orderDetailList,
|
||||||
|
"packingFee": null,
|
||||||
|
"payableAmount": this.totalPrice*100,
|
||||||
|
"payType": 1,
|
||||||
|
"placeOrdMobile": "",
|
||||||
|
"placeOrdName": "",
|
||||||
|
"remark": this.detailData.remark,
|
||||||
|
"sxresult":[],
|
||||||
|
"takeList":[],
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
|
const res = await addReserveMealApi(param)
|
||||||
|
console.log(res)
|
||||||
|
if(res.code==200){
|
||||||
|
if(res.data.code==10000){
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
// this.handleOrder2()
|
||||||
|
},500)
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/advanceOrder/payResult?result=${JSON.stringify(res.data)}`
|
||||||
|
// })
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleOrder2(){
|
||||||
|
let orderDetailList = []
|
||||||
|
console.log(this.shoppingCartList)
|
||||||
|
this.shoppingCartList.forEach(item=>{
|
||||||
|
orderDetailList.push(item.orderDetailList[0])
|
||||||
|
})
|
||||||
|
let param={
|
||||||
|
"amount": this.totalPrice*100,
|
||||||
|
"couponId": "",
|
||||||
|
"custId": uni.getStorageSync('custId'),
|
||||||
|
"ifTrial": 1,
|
||||||
|
"ordTime": this.getNowFormatDate(),
|
||||||
|
// "ordTime": "2025-02-20 13:57:21",
|
||||||
|
"payType": 1,
|
||||||
|
"reserveMealList":[
|
||||||
|
{
|
||||||
|
"canteenId": this.canteenId,
|
||||||
|
"canteenName": this.canteenName,
|
||||||
|
"stallId": this.stallId,
|
||||||
|
"stallName": this.stallName,
|
||||||
|
"consigneeMobile": "yyvwjetYVxeP1VW3vTv7nQ==",
|
||||||
|
"consigneeName": "dsf ",
|
||||||
|
"costModelList": [
|
||||||
|
{
|
||||||
|
"deliveryAmount": null,
|
||||||
|
"deliveryName": "自取堂食",
|
||||||
|
"deliveryType": 1,
|
||||||
|
"packingFee": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"counterId": "",
|
||||||
|
"deliveryAddr": "自取堂食",
|
||||||
|
"deliveryCosts": null,
|
||||||
|
"deliveryFee": 0,
|
||||||
|
"deliveryType": 1,
|
||||||
|
"mealtimeName": this.shoppingCartList[0].mealtimeName,
|
||||||
|
"mealtimeType": this.shoppingCartList[0].mealtimeType,
|
||||||
|
"orderDate": this.orderDate,
|
||||||
|
"orderDetailList": orderDetailList,
|
||||||
|
"packingFee": null,
|
||||||
|
"payableAmount": this.totalPrice*100,
|
||||||
|
"payType": 1,
|
||||||
|
"placeOrdMobile": "",
|
||||||
|
"placeOrdName": "",
|
||||||
|
"remark": this.detailData.remark,
|
||||||
|
"sxresult":[],
|
||||||
|
"takeList":[],
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
|
const res = await addReserveMealApi(param)
|
||||||
|
console.log(res)
|
||||||
|
if(res.code==200){
|
||||||
|
if(res.data.code==10000){
|
||||||
|
setTimeout(()=>{
|
||||||
|
// this.handleOrder3()
|
||||||
|
},500)
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/advanceOrder/payResult?result=${JSON.stringify(res.data)}`
|
||||||
|
// })
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
async handleOrder3(){
|
||||||
|
let orderDetailList = []
|
||||||
|
console.log(this.shoppingCartList)
|
||||||
|
this.shoppingCartList.forEach(item=>{
|
||||||
|
orderDetailList.push(item.orderDetailList[0])
|
||||||
|
})
|
||||||
|
let param={
|
||||||
|
"amount": this.totalPrice*100,
|
||||||
|
"couponId": "",
|
||||||
|
"custId": uni.getStorageSync('custId'),
|
||||||
|
"ifTrial": 2,
|
||||||
|
"ordTime": this.getNowFormatDate(),
|
||||||
|
// "ordTime": "2025-02-20 13:57:21",
|
||||||
|
"payType": 1,
|
||||||
|
"reserveMealList":[
|
||||||
|
{
|
||||||
|
"canteenId": this.canteenId,
|
||||||
|
"canteenName": this.canteenName,
|
||||||
|
"stallId": this.stallId,
|
||||||
|
"stallName": this.stallName,
|
||||||
|
"consigneeMobile": "yyvwjetYVxeP1VW3vTv7nQ==",
|
||||||
|
"consigneeName": "dsf ",
|
||||||
|
"costModelList": [
|
||||||
|
{
|
||||||
|
"deliveryAmount": null,
|
||||||
|
"deliveryName": "自取堂食",
|
||||||
|
"deliveryType": 1,
|
||||||
|
"packingFee": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"counterId": "",
|
||||||
|
"deliveryAddr": "自取堂食",
|
||||||
|
"deliveryCosts": null,
|
||||||
|
"deliveryFee": 0,
|
||||||
|
"deliveryType": 1,
|
||||||
|
"mealtimeName": this.shoppingCartList[0].mealtimeName,
|
||||||
|
"mealtimeType": this.shoppingCartList[0].mealtimeType,
|
||||||
|
"orderDate": this.orderDate,
|
||||||
|
"orderDetailList": orderDetailList,
|
||||||
|
"packingFee": null,
|
||||||
|
"payableAmount": this.totalPrice*100,
|
||||||
|
"payType": 1,
|
||||||
|
"placeOrdMobile": "",
|
||||||
|
"placeOrdName": "",
|
||||||
|
"remark": this.detailData.remark,
|
||||||
|
"sxresult":[],
|
||||||
|
"takeList":[],
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
|
const res = await addReserveMealApi(param)
|
||||||
|
console.log(res)
|
||||||
|
if(res.code==200){
|
||||||
|
if(res.data.code==10000){
|
||||||
|
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/advanceOrder/payResult?result=${JSON.stringify(res.data)}`
|
||||||
|
// })
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,171 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<div class="body"></div>
|
||||||
|
<view style="width: 100%;height: 50vh;display: flex;flex-direction: column;align-items: center;">
|
||||||
|
|
||||||
|
<view style="margin-top: 20vh;display: flex;flex-direction: column;align-items: center;width: 100%;">
|
||||||
|
<u-icon name="checkmark-circle-fill" size="64" color="#00aa00"></u-icon>
|
||||||
|
<view style="color: 00aa00;font-size: 18px;margin-top: 40rpx;color: #00aa00;">支付成功</view>
|
||||||
|
|
||||||
|
<view style="font-size: 24px;width: 100%;text-align: center;margin: 20rpx;font-weight: bold;">¥{{(resultData.payAmount/100).toFixed(2)}}</view>
|
||||||
|
|
||||||
|
<view style="width: 80%;display: flex; justify-content: space-between;margin: 20rpx auto;">
|
||||||
|
<view class="search-btn" @click="goIndex">返回首页</view>
|
||||||
|
<view class="back-btn" @click="goDetail">查看订单</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view style="margin-top: 20vh;display: flex;flex-direction: column;align-items: center;width: 100%;" v-else>
|
||||||
|
<u-icon name="error-circle-fill" size="64" color="#ff007f"></u-icon>
|
||||||
|
<view style="color: 00aa00;font-size: 18px;margin-top: 40rpx;">支付失败</view>
|
||||||
|
<view style="width: 80%;display: flex; justify-content: space-between;margin: 20rpx auto;">
|
||||||
|
<view class="search-btn" @click="goBack">返回</view>
|
||||||
|
<view class="back-btn" @click="goIndex">取消</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import { getRechargeResultApi,getRechargeQueryResultApi } from '../../api/index/index'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
resultData:{},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.resultData = JSON.parse(option.result)
|
||||||
|
this.$forceUpdate()
|
||||||
|
console.log(this.resultData)
|
||||||
|
console.log(this.resultData.orderList[0])
|
||||||
|
|
||||||
|
// this.resultData = {
|
||||||
|
// "accBal": 1267,
|
||||||
|
// "code": 10000,
|
||||||
|
// "expireTime": null,
|
||||||
|
// "extParam": null,
|
||||||
|
// "goodIdSet": null,
|
||||||
|
// "lessAmountForDelivery": 0,
|
||||||
|
// "msg": "成功",
|
||||||
|
// "orderAmountChangeList": [
|
||||||
|
// ],
|
||||||
|
// "orderList": [
|
||||||
|
// {
|
||||||
|
// "canteenId": "378928463446282240",
|
||||||
|
// "canteenName": "宏源工业园",
|
||||||
|
// "checkState": null,
|
||||||
|
// "commentState": 2,
|
||||||
|
// "couponAmount": 0,
|
||||||
|
// "deductionType": 1,
|
||||||
|
// "deliveryAmount": 0,
|
||||||
|
// "discountsAmount": 0,
|
||||||
|
// "dishesState": 1,
|
||||||
|
// "expireTime": null,
|
||||||
|
// "imgUrl": null,
|
||||||
|
// "lessAmountForDelivery": null,
|
||||||
|
// "machineName": null,
|
||||||
|
// "machineNum": null,
|
||||||
|
// "machineSn": null,
|
||||||
|
// "macOrderId": "416036469958774785",
|
||||||
|
// "mealCode": null,
|
||||||
|
// "mealtimeName": "下午茶",
|
||||||
|
// "mealtimeType": "3",
|
||||||
|
// "needPayAmount": 70,
|
||||||
|
// "orderDate": "2025-02-20",
|
||||||
|
// "orderDetailList": [
|
||||||
|
// {
|
||||||
|
// "calcTotalAmount": 70,
|
||||||
|
// "checkState": null,
|
||||||
|
// "detailId": "416036470088798208",
|
||||||
|
// "detailState": 1,
|
||||||
|
// "detailType": 1,
|
||||||
|
// "goodsDishesId": "385949065063436288",
|
||||||
|
// "goodsDishesImgUrl": "http://sgwpdm.ah.sgcc.com.cn/canteen/lnyst/378915229716713472/dishes/8e3978b0f293495d91c12666633744a3.jpg",
|
||||||
|
// "goodsDishesName": "萝卜包",
|
||||||
|
// "goodsDishesTypeName": null,
|
||||||
|
// "goodsRefundNum": 0,
|
||||||
|
// "imageUrl": "http://sgwpdm.ah.sgcc.com.cn/canteen/lnyst/378915229716713472/dishes/8e3978b0f293495d91c12666633744a3.jpg",
|
||||||
|
// "menuDetailId": "413945018588336132",
|
||||||
|
// "orderId": "416036469958774786",
|
||||||
|
// "prefPrice": 70,
|
||||||
|
// "price": 70,
|
||||||
|
// "quantity": 1,
|
||||||
|
// "realAmount": 0,
|
||||||
|
// "realPrice": 0.0,
|
||||||
|
// "refundAmount": 0,
|
||||||
|
// "salePrice": 70,
|
||||||
|
// "salesMode": 1,
|
||||||
|
// "shoppingCartId": "416036442989400064",
|
||||||
|
// "tasteName": null,
|
||||||
|
// "totalAmount": 70,
|
||||||
|
// "unitName": null,
|
||||||
|
// "weightUnit": 100
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "orderDetailSum": 1,
|
||||||
|
// "orderId": "416036469958774786",
|
||||||
|
// "orderRefundState": 1,
|
||||||
|
// "orderState": 4,
|
||||||
|
// "orderStateMixMobile": 22,
|
||||||
|
// "orderTime": "2025-02-19 10:02:24",
|
||||||
|
// "orderType": 2,
|
||||||
|
// "packingAmount": 0,
|
||||||
|
// "payableAmount": 70,
|
||||||
|
// "payState": 1,
|
||||||
|
// "payTime": null,
|
||||||
|
// "payType": 1,
|
||||||
|
// "plateNum": null,
|
||||||
|
// "plateSerialNum": null,
|
||||||
|
// "realAmount": 0,
|
||||||
|
// "refundAmount": 0,
|
||||||
|
// "refundTime": null,
|
||||||
|
// "sourceType": 7,
|
||||||
|
// "stallId": "379068538876334080",
|
||||||
|
// "stallName": "外卖(提前一天预定,下午16:00截止订单;第二天下午16:30取货)"
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// "payAmount": 70,
|
||||||
|
// "payParamStr": null,
|
||||||
|
// "redEnvelope": 0,
|
||||||
|
// "subsidyBal": 0,
|
||||||
|
// "tradeId": "416036469958774784",
|
||||||
|
// "unpaidBalance": 0,
|
||||||
|
// "walletBal": 1267,
|
||||||
|
// }
|
||||||
|
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
goIndex(){
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack(){
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
goDetail(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/work/details?params=${JSON.stringify(this.resultData.orderList[0])}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.search-btn{
|
||||||
|
width: 40%;background: #fff;
|
||||||
|
height: 40px;line-height: 40px;
|
||||||
|
text-align: center;color: #000;
|
||||||
|
border-radius: 10rpx;margin-top: 40rpx;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.back-btn{
|
||||||
|
width: 40%;background: #ff6633;height: 40px;line-height: 40px;text-align: center;color: #fff;border-radius: 10rpx;margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -31,41 +31,26 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getAdvanceOrderStallApi } from '@/api/advanceOrder/index.js'
|
import { getAdvanceOrderStallApi,getlistReserveDateAPI } from '@/api/advanceOrder/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
orderDate:"",
|
||||||
canteenId:"",
|
canteenId:"",
|
||||||
canteenName:"",
|
canteenName:"",
|
||||||
merchantList: [
|
merchantList: [
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '宏雷大厨外卖',
|
|
||||||
avatar: '/static/logo.png',
|
|
||||||
monthlySales: 1984,
|
|
||||||
businessHours: '00:00-23:59',
|
|
||||||
isOpen: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: '年货预订',
|
|
||||||
avatar: '/static/logo.png',
|
|
||||||
monthlySales: 2,
|
|
||||||
businessHours: '00:00-14:59',
|
|
||||||
isOpen: false
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getAdvanceOrderStallList()
|
this.getAdvanceOrderStallList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getAdvanceOrderStallList() {
|
async getAdvanceOrderStallList() {
|
||||||
try {
|
try {
|
||||||
let param = {
|
let param = {
|
||||||
"custId":uni.getStorageSync('custId'),
|
"custId":uni.getStorageSync('custId'),
|
||||||
"applyDate":"2024-11-09"
|
"applyDate":"2024-11-11"
|
||||||
}
|
}
|
||||||
const res = await getAdvanceOrderStallApi(param)
|
const res = await getAdvanceOrderStallApi(param)
|
||||||
console.log('🚀 ~ getList ~ res:', res)
|
console.log('🚀 ~ getList ~ res:', res)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue