Browse Source

Merge branch 'develop' of http://git.chelingzhu.com/chelingzhu-web/zxyj-mini-html into develop

lilei 4 years ago
parent
commit
69c4f1a309
2 changed files with 20 additions and 6 deletions
  1. 16 2
      pages/order/order.vue
  2. 4 4
      pages/order/orderDetail.vue

+ 16 - 2
pages/order/order.vue

@@ -128,6 +128,7 @@
 	import {
 	import {
 		getOrderList, signPay, existPayPwd
 		getOrderList, signPay, existPayPwd
 	} from '@/api/order.js'
 	} from '@/api/order.js'
+	import moment from 'moment'
 	export default {
 	export default {
 		components: {},
 		components: {},
 		data() {
 		data() {
@@ -194,6 +195,15 @@
 		onUnload() {
 		onUnload() {
 			uni.$off('refresh', this.handleRefresh)
 			uni.$off('refresh', this.handleRefresh)
 		},
 		},
+		// 下拉刷新
+		onPullDownRefresh() {
+			console.log('refresh')
+			this.pageNo = 1
+			this.getRow()
+			setTimeout(function () {
+				uni.stopPullDownRefresh()
+			}, 200)
+		},
 		methods: {
 		methods: {
 			pageInit() {
 			pageInit() {
 				this.sortIndex = 1
 				this.sortIndex = 1
@@ -267,10 +277,14 @@
 						} else {
 						} else {
 							this.list = res.data.list || []
 							this.list = res.data.list || []
 						}
 						}
-						let nowT = new Date().valueOf() // 现在时间戳
+						// let nowT = new Date().valueOf() // 现在时间戳
+						console.log(new Date(),'----当前时间')
+						let nowT = moment(new Date()).unix() // 当前时间戳
 						this.list.map(item=>{
 						this.list.map(item=>{
-							let orderT = new Date(item.orderTime).valueOf() // 下单时间戳
+							// let orderT = new Date(item.orderTime).valueOf() // 下单时间戳
+							let orderT = moment(item.orderTime).unix() // 下单时间戳
 							let tt = ((1800 * 1000) - (nowT - orderT))/1000  // 距离30分钟支付 相差时间戳  
 							let tt = ((1800 * 1000) - (nowT - orderT))/1000  // 距离30分钟支付 相差时间戳  
+							console.log(tt,'-------------tt')
 							item.leftTimeT = tt > 0 ? tt : 0
 							item.leftTimeT = tt > 0 ? tt : 0
 						})
 						})
 						this.total = res.data.count || 0
 						this.total = res.data.count || 0

+ 4 - 4
pages/order/orderDetail.vue

@@ -124,6 +124,7 @@
 	import {
 	import {
 		getLookUpDatas
 		getLookUpDatas
 	} from '@/api/data.js'
 	} from '@/api/data.js'
+	import moment from 'moment'
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -153,10 +154,9 @@
 		methods: {
 		methods: {
 			// 支付剩余时间
 			// 支付剩余时间
 			leftTimeFun() {
 			leftTimeFun() {
-				let nowT = new Date().valueOf() // 现在时间戳
-				let orderT = new Date(this.orderInfo.orderTime).valueOf() // 下单时间戳
-				let tt = (1800 * 1000) - (nowT - orderT)   // 距离30分钟支付 相差时间戳  
-				console.log(tt,'tttttt')
+				let nowT = moment(new Date()).unix() // 当前时间戳
+				let orderT = moment(this.orderInfo.orderTime).unix() // 下单时间戳
+				let tt = (1800 * 1000) - (nowT - orderT)   // 距离30分钟支付 相差时间戳
 				if (tt >0) {
 				if (tt >0) {
 					this.leftTime =  parseInt(tt/(60*1000))
 					this.leftTime =  parseInt(tt/(60*1000))
 				} else {
 				} else {