新功能开发2
This commit is contained in:
parent
13d065abcd
commit
8ff6c9ad70
|
|
@ -357,46 +357,48 @@ export default {
|
||||||
if(res.rows&&res.rows.length>0){
|
if(res.rows&&res.rows.length>0){
|
||||||
this.menuList = res.rows;
|
this.menuList = res.rows;
|
||||||
this.menuList.forEach(item => {
|
this.menuList.forEach(item => {
|
||||||
item.typeList.forEach(detail => {
|
if(item.mealtimeType==this.menuData.mealtimeType){
|
||||||
detail.dishesList.forEach(food => {
|
item.typeList.forEach(detail => {
|
||||||
this.$set(food, 'mealtimeType', item.mealtimeType)
|
detail.dishesList.forEach(food => {
|
||||||
this.$set(food, 'quantity', 0)
|
this.$set(food, 'mealtimeType', item.mealtimeType)
|
||||||
this.$set(food, 'monthlySales', food.dishesDetailList[0].monthlySales)
|
this.$set(food, 'quantity', 0)
|
||||||
this.$set(food, 'goodProbability', food.dishesDetailList[0].goodProbability)
|
this.$set(food, 'monthlySales', food.dishesDetailList[0].monthlySales)
|
||||||
this.$set(food, 'surplusNum', food.dishesDetailList[0].surplusNum)
|
this.$set(food, 'goodProbability', food.dishesDetailList[0].goodProbability)
|
||||||
this.$set(food, 'restrictNum', food.dishesDetailList[0].restrictNum)
|
this.$set(food, 'surplusNum', food.dishesDetailList[0].surplusNum)
|
||||||
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
|
this.$set(food, 'restrictNum', food.dishesDetailList[0].restrictNum)
|
||||||
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
|
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
|
||||||
this.$set(food, 'dishesId', food.dishesDetailList[0].dishesId)
|
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
|
||||||
let currentDate = this.formatDate(new Date()); // 获取当前时间
|
this.$set(food, 'dishesId', food.dishesDetailList[0].dishesId)
|
||||||
if(currentDate!=this.newDate2){
|
let currentDate = this.formatDate(new Date()); // 获取当前时间
|
||||||
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
|
if(currentDate!=this.newDate2){
|
||||||
// let str = this.formatDate(new Date())+" 14:00:00";
|
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
|
||||||
let currentTime = new Date().getTime();
|
// let str = this.formatDate(new Date())+" 14:00:00";
|
||||||
let inputTime = new Date(str.replace(/-/g,'/')).getTime();
|
let currentTime = new Date().getTime();
|
||||||
if (currentTime < inputTime) {
|
let inputTime = new Date(str.replace(/-/g,'/')).getTime();
|
||||||
console.log("可以预定");
|
if (currentTime < inputTime) {
|
||||||
this.$set(this.dashesData, 'ifReserve', true)
|
console.log("可以预定");
|
||||||
} else {
|
this.$set(this.dashesData, 'ifReserve', true)
|
||||||
console.log("不可预定");
|
} else {
|
||||||
}
|
console.log("不可预定");
|
||||||
}else{
|
}
|
||||||
if(food.startTime&&food.endTime){
|
}else{
|
||||||
let startStr = this.formatDate(new Date())+" "+food.startTime;
|
if(food.startTime&&food.endTime){
|
||||||
let endStr = this.formatDate(new Date())+" "+food.endTime;
|
let startStr = this.formatDate(new Date())+" "+food.startTime;
|
||||||
let currentTime = new Date().getTime();
|
let endStr = this.formatDate(new Date())+" "+food.endTime;
|
||||||
let startTime = new Date(startStr.replace(/-/g,'/')).getTime();
|
let currentTime = new Date().getTime();
|
||||||
let endTime = new Date(endStr.replace(/-/g,'/')).getTime();
|
let startTime = new Date(startStr.replace(/-/g,'/')).getTime();
|
||||||
if (currentTime>startTime&¤tTime<endTime) {
|
let endTime = new Date(endStr.replace(/-/g,'/')).getTime();
|
||||||
console.log("可以预定");
|
if (currentTime>startTime&¤tTime<endTime) {
|
||||||
this.$set(this.dashesData, 'ifReserve', true)
|
console.log("可以预定");
|
||||||
} else {
|
this.$set(this.dashesData, 'ifReserve', true)
|
||||||
console.log("不可预定");
|
} else {
|
||||||
|
console.log("不可预定");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
})
|
|
||||||
})
|
})
|
||||||
//获取购物车
|
//获取购物车
|
||||||
this.getShoppingCartList()
|
this.getShoppingCartList()
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ export default {
|
||||||
stallId:"",
|
stallId:"",
|
||||||
stallName:"",
|
stallName:"",
|
||||||
totalPrice:0,
|
totalPrice:0,
|
||||||
|
totalPrice2:0,
|
||||||
orderDate:"",
|
orderDate:"",
|
||||||
shoppingCartList:[],
|
shoppingCartList:[],
|
||||||
// 详情页数据
|
// 详情页数据
|
||||||
|
|
@ -164,7 +165,13 @@ 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.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.orderDate = options.orderDate;
|
||||||
this.shoppingCartList=JSON.parse(options.carList)
|
this.shoppingCartList=JSON.parse(options.carList)
|
||||||
console.log(this.shoppingCartList)
|
console.log(this.shoppingCartList)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
<view class="main_menu_name">{{ item.name }}</view>
|
<view class="main_menu_name">{{ item.name }}</view>
|
||||||
</view>
|
</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 style="font-size: 36rpx;font-weight: 600;">出示二维码支付</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-box" v-if="isShowBtn">
|
<view class="card-box" v-if="isShowBtn">
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view style="font-size: 44rpx;color: #333;font-weight: 600;">出示二维码支付</view>
|
<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: 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>
|
<image src="../static/images/arrow2.png" style="width: 60rpx;height: 60rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -90,7 +90,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
|
|
@ -149,13 +149,16 @@ export default {
|
||||||
this.$router.push({ path: '/pages/index' })
|
this.$router.push({ path: '/pages/index' })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
openCode(){
|
||||||
|
this.refreshQrCode()
|
||||||
|
this.isShowBtn=true
|
||||||
|
},
|
||||||
// 获取二维码
|
// 获取二维码
|
||||||
async getOrderQRCodeData() {
|
async getOrderQRCodeData() {
|
||||||
const res = await getOrderQRCodeAPI({ "custId":uni.getStorageSync('custId') })
|
const res = await getOrderQRCodeAPI({ "custId":uni.getStorageSync('custId') })
|
||||||
uni.setStorageSync("codeTime",res);
|
uni.setStorageSync("codeTime",res);
|
||||||
this.qrCodeUrl = `xnzn{\"s\":1,\"y\":3,\"p\":\"${uni.getStorageSync('custId')}\",\"t\":\"${uni.getStorageSync('codeTime')}\"}`
|
this.qrCodeUrl = `xnzn{\"s\":1,\"y\":3,\"p\":\"${uni.getStorageSync('custId')}\",\"t\":\"${uni.getStorageSync('codeTime')}\"}`
|
||||||
// console.log(res, '二维码信息--')
|
// console.log(res, '二维码信息--')
|
||||||
|
|
||||||
},
|
},
|
||||||
refreshQrCode() {
|
refreshQrCode() {
|
||||||
// 模拟刷新二维码
|
// 模拟刷新二维码
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ export default {
|
||||||
// 优惠金额
|
// 优惠金额
|
||||||
discountAmount: '0.7',
|
discountAmount: '0.7',
|
||||||
// 实付金额
|
// 实付金额
|
||||||
realAmount: '9.3',
|
realAmount: '0',
|
||||||
// 订单二维码
|
// 订单二维码
|
||||||
qrCode: '',
|
qrCode: '',
|
||||||
// 流水号
|
// 流水号
|
||||||
|
|
|
||||||
|
|
@ -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() {
|
<!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'
|
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
Loading…
Reference in New Issue