客户问题修改2

This commit is contained in:
zzyuan 2025-08-13 15:49:46 +08:00
parent 0719279d50
commit c75a5314f9
2 changed files with 72 additions and 12 deletions

View File

@ -11,7 +11,7 @@
{{(menuData.dishesDetailList[0].prefPrice/100).toFixed(2)}}
</view>
<view style="display: flex;align-items: center;" v-if="dashesData.surplusNum>0">
<view style="display: flex;align-items: center;" v-if="dashesData.surplusNum>0&&dashesData.ifReserve">
<u-icon
v-if="dashesData.quantity>0"
name="../../static/images/delete.png"
@ -143,7 +143,7 @@
</span>
</view>
<view>
<view v-if="dashesData.ifReserve">
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">结算</u-button>
</view>
</view>
@ -193,7 +193,7 @@
{{ (food.prefPrice/100).toFixed(2) }}
</view>
</view>
<view class="right-cont">
<view class="right-cont" v-if="dashesData.ifReserve">
<view class="num-wrap" v-if="food.isDfficacy==1">
<view style="width: 40rpx;" @click="handleFoodNum(1, food)">
<u-icon
@ -261,7 +261,7 @@ export default {
}
}],
canteenType: '自取',
isHandle:false
isHandle:false,
}
},
onLoad(options) {
@ -269,10 +269,11 @@ export default {
console.log(options)
this.menuData = options
this.newDate2 = this.menuData.orderDate
this.getMenuListData()
this.getMenudishesDetail()
this.getMenuEvaluaorderList()
this.getMenuEvaluaCount()
this.getMenuListData()
},
methods: {
//
@ -307,6 +308,7 @@ export default {
this.$set(this.dashesData, 'dishesPrice', this.dashesData.dishesDetailList[0].dishesPrice)
this.$set(this.dashesData, 'prefPrice', this.dashesData.dishesDetailList[0].prefPrice)
this.$set(this.dashesData, 'dishesId', this.dashesData.dishesDetailList[0].dishesId)
this.$set(this.dashesData, 'ifReserve', true)
this.$forceUpdate()
}
console.log(res,'获取菜品详情')
@ -366,6 +368,20 @@ export default {
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
this.$set(food, 'dishesId', food.dishesDetailList[0].dishesId)
let currentDate = this.formatDate(new Date()); //
if(currentDate!=this.newDate2){
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
// let str = this.formatDate(new Date())+" 14:00:00";
console.log(str)
let currentTime = new Date().getTime();
let inputTime = new Date(str).getTime();
if (currentTime < inputTime) {
console.log("可以预定");
} else {
console.log("不可预定");
this.$set(this.dashesData, 'ifReserve', false)
}
}
})
})
})
@ -446,6 +462,7 @@ export default {
this.$set(cartItem, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(cartItem, 'prefPrice', food.dishesDetailList[0].prefPrice)
if(cartItem.orderDate == this.newDate2){//
// this.$set(food, 'quantity', cartItem.quantity)
this.$set(cartItem,'isDfficacy', 1) //
@ -626,7 +643,15 @@ export default {
url: `/pages/advanceOrder/orderDetails?carList=${JSON.stringify(arr)}&canteenId=${this.menuData.canteenId}&stallId=${this.menuData.stallId}&canteenName=${this.menuData.canteenName}&stallName=${this.menuData.stallName}&totalPrice=${this.totalPrice}&orderDate=${this.newDate2}`
})
},
//
formatDate(date) {
// YYYY-MM-DD
date = new Date(date)
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
}
}
</script>

View File

@ -51,7 +51,7 @@
<span style="font-size: 20rpx;color: #666;font-weight: 400;text-decoration: line-through;margin-left: 10rpx;">{{ (item.dishesDetailList[0].dishesPrice/100).toFixed(2) }}</span>
</view>
</view>
<view class="right-cont" v-if="item.surplusNum!=0">
<view class="right-cont" v-if="item.surplusNum!=0&&item.ifReserve">
<u-icon v-if="item.quantity > 0"
name="../../static/images/delete.png"
size="18"
@ -87,7 +87,7 @@
</span>
</view>
<view>
<view v-if="ifReserve">
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">结算</u-button>
</view>
</view>
@ -136,7 +136,7 @@
{{ (food.prefPrice/100).toFixed(2) }}
</view>
</view>
<view class="right-cont">
<view class="right-cont" v-if="food.ifReserve">
<view class="num-wrap" v-if="food.isDfficacy==1">
<view style="width: 40rpx;" @click="handleFoodNum(1, food)">
<u-icon
@ -217,7 +217,8 @@ export default {
active: 1, // 1 2
// canteenName: '/',
canteenType: '自取', // 1 2
isHandle:false
isHandle:false,//
ifReserve:true//
}
},
onLoad(options) {
@ -262,7 +263,6 @@ export default {
this.newDate2 = this.daysList[index].paramDate
this.getMenuListData()
},
//
getNowFormatDate(data) {
let date = new Date(data)
let year = date.getFullYear()
@ -303,6 +303,22 @@ export default {
this.$set(food, 'monthlySales', food.dishesDetailList[0].monthlySales)
this.$set(food, 'goodProbability', food.dishesDetailList[0].goodProbability)
this.$set(food, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(food, 'ifReserve', true)
let currentDate = this.formatDate(new Date()); //
if(currentDate!=this.newDate2){
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
// let str = this.formatDate(new Date())+" 14:00:00";
console.log(str)
let currentTime = new Date().getTime();
let inputTime = new Date(str).getTime();
if (currentTime < inputTime) {
console.log("可以预定");
} else {
console.log("不可预定");
this.$set(food, 'ifReserve', false)
this.$set(this, 'ifReserve', false)
}
}
this.$set(food, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
@ -456,6 +472,17 @@ export default {
this.$set(cartItem, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(cartItem, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(cartItem, 'prefPrice', food.dishesDetailList[0].prefPrice)
this.$set(cartItem, 'ifReserve', true)
let currentDate = this.formatDate(new Date()); //
if(currentDate!=this.newDate2){
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
// let str = this.formatDate(new Date())+" 14:00:00";
let currentTime = new Date().getTime();
let inputTime = new Date(str).getTime();
if (currentTime < inputTime) {} else {
this.$set(cartItem, 'ifReserve', false)
}
}
if(cartItem.orderDate == this.newDate2){//
this.$set(food, 'quantity', cartItem.quantity)
@ -630,7 +657,15 @@ export default {
url: `/pages/advanceOrder/orderDetails?carList=${JSON.stringify(arr)}&canteenId=${this.canteenId}&stallId=${this.stallId}&canteenName=${this.canteenName}&stallName=${this.stallName}&totalPrice=${this.totalPrice}&orderDate=${this.newDate2}`
})
},
//
formatDate(date) {
// YYYY-MM-DD
date = new Date(date)
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
//
scrollToDetail(index) {
console.log('?? ~ scrollToDetail ~ index', index)