Commit a296b2d2 authored by youjie's avatar youjie

no message

parent 7543a385
......@@ -200,7 +200,7 @@
})
this.g = this.g.concat(res.data.pageData);
console.log("res.data.pageData",res.data.pageData);
// console.log("res.data.pageData",res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
......
......@@ -122,31 +122,32 @@
orders: {
handler(newVal, oldVal) {
this.g = JSON.parse(JSON.stringify(newVal))
// this.g.forEach(x => {
// let goodsTypeHotel = 0
// // #ifdef MP-DI
// goodsTypeHotel = x.goodsType==9?1:0
// // #endif
// // #ifdef MP-AG
// goodsTypeHotel = x.goodsType==7?1:0
// // #endif
// if(x.orderStatus!=1) x.isExpired = true
// if (x.orderStatus==1&&goodsTypeHotel>0) {
// const now = Date.now();
// // const customStr = '2025-05-12 14:43:00'
// const customStr = x.createTimeStr
// const [date, time] = customStr.split(' ')
// const [year, month, day] = date.split('-')
// const [hours, minutes, seconds] = time.split(':')
// const parsedDate = new Date(year, month-1, day, hours, minutes, seconds)
// x.orderTime = parsedDate.getTime()
// const diff = x.orderTime + 5 * 60 * 1000 - now; // 5分钟倒计时
// let remainingSeconds = Math.max(diff, 0); // 确保不出现负数
// x.remainingSeconds = Math.floor(remainingSeconds/1000)
// // console.log("支付倒计时",x.remainingSeconds)
// if(x.remainingSeconds) this.initCountdown(x)
// }
// });
this.g.forEach(x => {
let goodsTypeHotel = 0
// #ifdef MP-DI
goodsTypeHotel = x.goodsType==9?1:0
// #endif
// #ifdef MP-AG
goodsTypeHotel = x.goodsType==7?1:0
// #endif
if(x.orderStatus!=1) x.isExpired = true
if (x.orderStatus==1&&goodsTypeHotel>0) {
const now = Date.now();
// const customStr = '2025-05-12 14:43:00'
const customStr = x.createTimeStr
const [date, time] = customStr.split(' ')
const [year, month, day] = date.split('-')
const [hours, minutes, seconds] = time.split(':')
const parsedDate = new Date(year, month-1, day, hours, minutes, seconds)
x.orderTime = parsedDate.getTime()
const diff = x.orderTime + 5 * 60 * 1000 - now; // 5分钟倒计时
let remainingSeconds = Math.max(diff, 0); // 确保不出现负数
x.remainingSeconds = Math.floor(remainingSeconds/1000)
if(x.remainingSeconds<=0) x.orderStatus = 4
// console.log("支付倒计时",x.remainingSeconds)
// if(x.remainingSeconds) this.initCountdown(x)
}
});
},
deep: true,
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment