From c5c6436c39df9f155bc631605cac9ff0849011c0 Mon Sep 17 00:00:00 2001 From: fanfan Date: Wed, 17 Apr 2024 14:54:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E7=89=A9=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 6 ++++++ pages/order/detail.vue | 30 ++++++++++++++++++++------ pages/order/index.vue | 48 +++++++++++++++++++++++++++--------------- 3 files changed, 60 insertions(+), 24 deletions(-) diff --git a/pages.json b/pages.json index 4030922..b7ff968 100644 --- a/pages.json +++ b/pages.json @@ -887,6 +887,12 @@ "style": { "navigationBarTitleText": "订单评价" } + }, + { + "path": "express/webView", + "style": { + "navigationBarTitleText": "订单跟踪" + } } ] }, diff --git a/pages/order/detail.vue b/pages/order/detail.vue index 8be0c1a..9a96af7 100644 --- a/pages/order/detail.vue +++ b/pages/order/detail.vue @@ -298,7 +298,7 @@ v-if="order.pay_status == PayStatusEnum.SUCCESS.value && order.delivery_type == DeliveryTypeEnum.EXTRACT.value"> 核销码 - 查看物流 @@ -560,12 +560,28 @@ shopId }) }, - + containsLetterMix(str, mix) { + return new RegExp(mix.split('').join('\\w*')).test(str) + }, + // // 跳转到物流跟踪页面 - handleTargetExpress() { - this.$navTo('pages/order/express/index', { - orderId: this.orderId - }) + handleTargetExpress(orderId, item) { + if (item.delivery) { + let url =item.delivery[0].express_no + if (this.containsLetterMix(url, 'jd.com')&&item.delivery.length>0) { + uni.navigateTo({ + url: '/pages/order/express/webView?src=' + encodeURIComponent(url) //url是h5的展示地址pageB + }) + } else { + this.$navTo('pages/order/express/index', { + orderId + }) + } + } else { + this.$navTo('pages/order/express/index', { + orderId + }) + } }, // 跳转到商品详情页面 @@ -581,7 +597,7 @@ }) }, // 点击去开票 - onInvoicing(orderId,order) { + onInvoicing(orderId, order) { uni.setStorageSync("orderInfor", order); uni.navigateTo({ url: '/pages/invoice/edit?orderId=' + orderId diff --git a/pages/order/index.vue b/pages/order/index.vue index 198a1b0..44686c0 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -83,7 +83,7 @@ @click="onPay(item.order_id)">立即支付 查看物流 + @click="onLogistics(item.order_id,item)">查看物流 修改地址 --> - + @@ -411,6 +411,7 @@ app.showQRCodePopup = true }) }, + // 跳转到订单评价页 handleTargetComment(orderId) { this.$navTo('pages/order/comment/index', { @@ -436,11 +437,28 @@ orderId }) }, + containsLetterMix(str, mix) { + return new RegExp(mix.split('').join('\\w*')).test(str) + }, + // // 点击去物流 - onLogistics(orderId) { - this.$navTo('pages/order/express/index', { - orderId - }) + onLogistics(orderId, item) { + if (item.delivery) { + let url = item.delivery.express_no + if (this.containsLetterMix(url, 'jd.com')) { + uni.navigateTo({ + url: '/pages/order/express/webView?src=' + encodeURIComponent(url) //url是h5的展示地址pageB + }) + } else { + this.$navTo('pages/order/express/index', { + orderId + }) + } + } else { + this.$navTo('pages/order/express/index', { + orderId + }) + } }, // 点击去支付 onPay(orderId) { @@ -471,12 +489,6 @@ goodsId }) }, - // 跳转到订单评价页 - handleTargetComment(orderId) { - this.$navTo('pages/order/comment/index', { - orderId - }) - } }, @@ -685,7 +697,7 @@ display: flex; align-items: flex-start; overflow: hidden; - margin-bottom: 30rpx; + margin-bottom: 15rpx; .pic { width: 162rpx; @@ -752,13 +764,15 @@ display: flex; align-items: center; justify-content: space-between; - padding: 30rpx 0; + margin-top: 15rpx; + padding: 20rpx 0; overflow: hidden; + border-top: 2rpx dashed #F2F2F2; .a { font-size: 28rpx; font-weight: 400; - color: #A59E9E; + color: #666; } .b { @@ -775,9 +789,9 @@ border-radius: 56rpx; opacity: 1; border: 1px solid #DFDFDF; - margin-left: 6rpx; + margin-left: 15rpx; text-align: center; - font-size: 24rpx; + font-size: 26rpx; font-weight: 400; color: #1E1E1E;