|
@@ -277,14 +277,11 @@
|
|
|
} else {
|
|
|
this.list = res.data.list || []
|
|
|
}
|
|
|
- // let nowT = new Date().valueOf() // 现在时间戳
|
|
|
- console.log(new Date(),'----当前时间')
|
|
|
- let nowT = moment(new Date()).unix() // 当前时间戳
|
|
|
- this.list.map(item=>{
|
|
|
- // let orderT = new Date(item.orderTime).valueOf() // 下单时间戳
|
|
|
- let orderT = moment(item.orderTime).unix() // 下单时间戳
|
|
|
- let tt = ((1800 * 1000) - (nowT - orderT))/1000 // 距离30分钟支付 相差时间戳
|
|
|
- console.log(tt,'-------------tt')
|
|
|
+ const date1 = moment().toArray() // 当前时间 数组形式
|
|
|
+ this.list.map(item=>{
|
|
|
+ const date2 = moment(item.orderTime).toDate() // 下单时间 日期格式
|
|
|
+ const date3 = moment(date2).toArray() // 下单时间 数组形式
|
|
|
+ const tt = 1800 - moment(date1).diff(moment(date3), 'seconds')// 距离30分钟支付 当前剩余秒数 = 1800秒 - 计算相差的秒数(当前时间-支付时间)
|
|
|
item.leftTimeT = tt > 0 ? tt : 0
|
|
|
})
|
|
|
this.total = res.data.count || 0
|