From b07f3613ebfae2322fa8bc04b3c620eeab32f004 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E7=BF=94=E5=AE=87-=E6=97=85=E7=AE=A1=E5=AE=B6?=
<153298343@qq.com>
Date: Mon, 30 May 2022 10:15:12 +0800
Subject: [PATCH] up
---
pages/order/visitorder.vue | 5 ++++-
pages/success/success.vue | 23 +++++++++++++++++------
2 files changed, 21 insertions(+), 7 deletions(-)
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)
}
}