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; }, //取消订单