From 219ff8a170df974227658a8fc2c13bc6862fd242 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Thu, 2 Mar 2023 10:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E7=AC=AC=E5=95=86=E5=93=81=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order_details/index.vue | 48 +++++++++++++++++-------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/pages/order_details/index.vue b/src/pages/order_details/index.vue index 12ef15a..a295dea 100644 --- a/src/pages/order_details/index.vue +++ b/src/pages/order_details/index.vue @@ -2,8 +2,8 @@ - - + + @@ -82,7 +82,7 @@ ¥{{ item.sell_price }} - + ¥{{ item.vip_price }} @@ -92,7 +92,7 @@ - + { - if(!this.isLogin){ + setTimeout(() => { + if (!this.isLogin) { this.$u.route({ - type:'redirectTo', - url:`/pages/login/index?redirec=${encodeURIComponent(`/pages/order_details/index?id=${id}`)}` - }) - }else{ - this.getDetail(); + type: 'redirectTo', + url: `/pages/login/index?redirec=${encodeURIComponent(`/pages/order_details/index?id=${id}`)}`, + }); + } else { + this.getDetail(); } - },300) + }, 300); }, onShow() { - if(this.isLogin){ - this.getDetail(); + if (this.isLogin) { + this.getDetail(); } }, computed: { @@ -256,15 +259,15 @@ export default { }, methods: { //判断是否有页面栈,如果没有返回首页,否则返回上一页 - goJump(){ - const pages = getCurrentPages() - const prevPage = pages[pages.length - 2] - if(prevPage){ - uni.navigateBack({}) - }else{ + goJump() { + const pages = getCurrentPages(); + const prevPage = pages[pages.length - 2]; + if (prevPage) { + uni.navigateBack({}); + } else { uni.switchTab({ - url:'/pages/index/index' - }) + url: '/pages/index/index', + }); } }, //复制 @@ -285,6 +288,7 @@ export default { async getDetail() { const resData = await this.$api.get(`/v1/order/orders/${this.id}`); this.detail = resData; + this.enableService = !this.detail.store_id this.isFirstLoading = false; }, //取消订单