Explorar o código

修改订单列表倒计时显示bug

1004749546@qq.com %!s(int64=4) %!d(string=hai) anos
pai
achega
56dffdc993
Modificáronse 1 ficheiros con 7 adicións e 10 borrados
  1. 7 10
      pages/order/order.vue

+ 7 - 10
pages/order/order.vue

@@ -43,7 +43,7 @@
 										</text>
 										<u-count-down @end="getRow" 
 										style="margin-right: 20upx;" separator ="zh" 
-										:timestamp="filterTime(item.orderTime)" :show-days="false" :show-hours="false"></u-count-down>
+										:timestamp="item.leftTimeT" :show-days="false" :show-hours="false"></u-count-down>
 									<u-button :custom-style="btnStyle" @click="toPay(item)"  shape="circle" type="error" size="medium">去支付</u-button>
 								</view>
 								<view v-if="item.orderState=='WAIT_SEND'||item.orderState=='SEND_PART'" class="text-right">
@@ -252,6 +252,12 @@
 						} else {
 							this.list = res.data.list || []
 						}
+						let nowT = new Date().valueOf() // 现在时间戳
+						this.list.map(item=>{
+							let orderT = new Date(item.orderTime).valueOf() // 下单时间戳
+							let tt = ((1800 * 1000) - (nowT - orderT))/1000  // 距离30分钟支付 相差时间戳  
+							item.leftTimeT = tt > 0 ? tt : 0
+						})
 						this.total = res.data.count || 0
 					} else {
 						this.list = []
@@ -279,15 +285,6 @@
 				this.searchParams = params
 				this.getRow(1)
 			},
-			// 支付剩余时间
-			filterTime (time) {
-				console.log(time,'tttttt')
-				let nowT = new Date().valueOf() // 现在时间戳
-				let orderT = new Date(time).valueOf() // 下单时间戳
-				let tt = (1800 * 1000) - (nowT - orderT)   // 距离30分钟支付 相差时间戳  
-				console.log(tt,'tttttt')
-				return  tt
-			},
 			
 			// 跳转到设置支付密码页
 			toSetPwd () {