diff --git a/pages/order/visitorder.vue b/pages/order/visitorder.vue index 638f1e2..99f4cf9 100644 --- a/pages/order/visitorder.vue +++ b/pages/order/visitorder.vue @@ -18,7 +18,7 @@ - 订单信息:{{$u.timeFormat(new Date(item.date), 'mm月dd日')}}{{item.time}}丨{{item.details_count}} 位观众 + 订单信息:{{timeFormat(item.date, 'MM月DD日')}}{{item.time}}丨{{item.details_count}} 位观众 @@ -72,6 +72,9 @@ this.loadOrder(); }, methods: { + timeFormat(date, format) { + return this.$moment(date).format(format); + }, handleChange(e) { this.current = e.index; this.loadOrder(); diff --git a/pages/success/success.vue b/pages/success/success.vue index 036e1ec..f578ab0 100644 --- a/pages/success/success.vue +++ b/pages/success/success.vue @@ -4,7 +4,7 @@ 您已经预约成功 - 即将跳转到{{tips}} + 即将跳转到{{tips}} {{time}} s 返回首页 @@ -14,10 +14,11 @@ export default { data() { return { - tips: "参观预约" + tips: "参观预约", + time: 3 } }, - onLoad(options) { + onLoad(options) { let that = this; if (options.from) { var url = ""; @@ -37,15 +38,25 @@ if (url == "") { + var t = setInterval(function() { + if (that.time > 1) + that.time = that.time - 1; + }, 1000) setTimeout(function() { that.goHome(); - }, 5000) + clearInterval(t); + }, 3000) } else { + var t = setInterval(function() { + if (that.time > 0) + that.time = that.time - 1; + }, 1000) setTimeout(function() { - uni.navigateTo({ + uni.reLaunch({ url: url }) - }, 5000) + clearInterval(t); + }, 3000) } }