新功能开发2

This commit is contained in:
zzyuan 2026-01-14 18:04:29 +08:00
parent 13d065abcd
commit 8ff6c9ad70
24 changed files with 105 additions and 47 deletions

View File

@ -357,46 +357,48 @@ export default {
if(res.rows&&res.rows.length>0){
this.menuList = res.rows;
this.menuList.forEach(item => {
item.typeList.forEach(detail => {
detail.dishesList.forEach(food => {
this.$set(food, 'mealtimeType', item.mealtimeType)
this.$set(food, 'quantity', 0)
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, 'restrictNum', food.dishesDetailList[0].restrictNum)
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";
let currentTime = new Date().getTime();
let inputTime = new Date(str.replace(/-/g,'/')).getTime();
if (currentTime < inputTime) {
console.log("可以预定");
this.$set(this.dashesData, 'ifReserve', true)
} else {
console.log("不可预定");
}
}else{
if(food.startTime&&food.endTime){
let startStr = this.formatDate(new Date())+" "+food.startTime;
let endStr = this.formatDate(new Date())+" "+food.endTime;
let currentTime = new Date().getTime();
let startTime = new Date(startStr.replace(/-/g,'/')).getTime();
let endTime = new Date(endStr.replace(/-/g,'/')).getTime();
if (currentTime>startTime&&currentTime<endTime) {
console.log("可以预定");
this.$set(this.dashesData, 'ifReserve', true)
} else {
console.log("不可预定");
if(item.mealtimeType==this.menuData.mealtimeType){
item.typeList.forEach(detail => {
detail.dishesList.forEach(food => {
this.$set(food, 'mealtimeType', item.mealtimeType)
this.$set(food, 'quantity', 0)
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, 'restrictNum', food.dishesDetailList[0].restrictNum)
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";
let currentTime = new Date().getTime();
let inputTime = new Date(str.replace(/-/g,'/')).getTime();
if (currentTime < inputTime) {
console.log("可以预定");
this.$set(this.dashesData, 'ifReserve', true)
} else {
console.log("不可预定");
}
}else{
if(food.startTime&&food.endTime){
let startStr = this.formatDate(new Date())+" "+food.startTime;
let endStr = this.formatDate(new Date())+" "+food.endTime;
let currentTime = new Date().getTime();
let startTime = new Date(startStr.replace(/-/g,'/')).getTime();
let endTime = new Date(endStr.replace(/-/g,'/')).getTime();
if (currentTime>startTime&&currentTime<endTime) {
console.log("可以预定");
this.$set(this.dashesData, 'ifReserve', true)
} else {
console.log("不可预定");
}
}
}
}
}
})
})
})
})
}
})
//
this.getShoppingCartList()

View File

@ -123,6 +123,7 @@ export default {
stallId:"",
stallName:"",
totalPrice:0,
totalPrice2:0,
orderDate:"",
shoppingCartList:[],
//
@ -164,7 +165,13 @@ export default {
this.canteenName = options.canteenName
this.stallId = options.stallId
this.stallName = options.stallName
this.totalPrice = Number(options.totalPrice).toFixed(2)
if(this.stallId=='525115050604630016'){
this.totalPrice = 8.00;
// this.totalPrice2 = Number(options.totalPrice).toFixed(2)
}else{
this.totalPrice = Number(options.totalPrice).toFixed(2)
// this.totalPrice2 = Number(options.totalPrice).toFixed(2)
}
this.orderDate = options.orderDate;
this.shoppingCartList=JSON.parse(options.carList)
console.log(this.shoppingCartList)

View File

@ -20,7 +20,7 @@
<view class="main_menu_name">{{ item.name }}</view>
</view>
</view>
<view class="codeBtn" v-if="!isShowBtn" @click="isShowBtn=true">
<view class="codeBtn" v-if="!isShowBtn" @click="openCode">
<view style="font-size: 36rpx;font-weight: 600;">出示二维码支付</view>
</view>
<view class="card-box" v-if="isShowBtn">
@ -28,7 +28,7 @@
<view class="title">
<view style="font-size: 44rpx;color: #333;font-weight: 600;">出示二维码支付</view>
<!-- <view @click="isShowBtn=false" style="position: absolute;right: 30rpx;">X</view> -->
<view @click="isShowBtn=false" style="position: absolute;right: 40rpx;top: 10rpx;">
<view @click="isShowBtn=false" style="position: absolute;right: 40rpx;top: 6rpx;">
<image src="../static/images/arrow2.png" style="width: 60rpx;height: 60rpx;"></image>
</view>
</view>
@ -90,7 +90,7 @@ export default {
}
},
onShow() {
this.getUserInfo()
this.getUserInfo()
},
mounted() {
uni.getSystemInfo({
@ -149,13 +149,16 @@ export default {
this.$router.push({ path: '/pages/index' })
}
},
openCode(){
this.refreshQrCode()
this.isShowBtn=true
},
//
async getOrderQRCodeData() {
const res = await getOrderQRCodeAPI({ "custId":uni.getStorageSync('custId') })
uni.setStorageSync("codeTime",res);
this.qrCodeUrl = `xnzn{\"s\":1,\"y\":3,\"p\":\"${uni.getStorageSync('custId')}\",\"t\":\"${uni.getStorageSync('codeTime')}\"}`
// console.log(res, '--')
// console.log(res, '--')
},
refreshQrCode() {
//

View File

@ -192,7 +192,7 @@ export default {
//
discountAmount: '0.7',
//
realAmount: '9.3',
realAmount: '0',
//
qrCode: '',
//

View File

@ -1,3 +1,3 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>智慧后勤</title><script src=https://res.wx.qq.com/open/js/jweixin-1.1.0.js></script><script>document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})</script><link rel=stylesheet href=./static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.0f4c3ff6.js></script><script src=./static/js/index.fe1d844a.js></script></body></html>
})</script><link rel=stylesheet href=./static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.0f4c3ff6.js></script><script src=./static/js/index.54b63ecd.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long