From ce5fc2355b4fd60ece07faf204665ab42ca8117e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Sat, 7 Feb 2026 23:22:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=92=8C=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E8=B4=AD=E8=8D=AF=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPackages/my/my-drug/drug-info.vue | 27 ++- subPackages/my/record-pay.vue | 344 +++++++++++++++------------ 2 files changed, 221 insertions(+), 150 deletions(-) diff --git a/subPackages/my/my-drug/drug-info.vue b/subPackages/my/my-drug/drug-info.vue index dc7dcb7..0aba101 100644 --- a/subPackages/my/my-drug/drug-info.vue +++ b/subPackages/my/my-drug/drug-info.vue @@ -96,7 +96,7 @@ - 商品总价 + 商品总价(包含服务费) ¥{{orderInfo.ProductOrder.items_price}} @@ -383,8 +383,12 @@ export default { } }) }, - // 门店信息 + // 门店信息(仅在需要时调用,不会覆盖处方来源诊所信息) getStoreInfo() { + // 如果已经有处方来源诊所信息,不覆盖 + if (this.infoList && this.infoList.store && this.infoList.store.id) { + return + } storeInfo({ method: "post", data: { @@ -392,7 +396,10 @@ export default { } }).then((res) => { if (res.data.errcode == 0) { - this.infoList = res.data.data + // 只有在没有处方来源诊所信息时才设置 + if (!this.infoList || !this.infoList.store || !this.infoList.store.id) { + this.infoList = res.data.data + } } }) }, @@ -416,6 +423,18 @@ export default { uni.setStorageSync('userWay_order_id', res.data.data.ProductOrder.id) uni.setStorageSync('delivery_method', res.data.data.ProductOrder.delivery_method) + // 使用API返回的处方来源诊所信息(优先使用处方来源诊所) + if (res.data.data.store && res.data.data.store.store) { + this.infoList = { + store: res.data.data.store.store + } + } else { + // 如果没有处方来源诊所信息,使用当前诊所信息作为后备 + if (!this.infoList || !this.infoList.store) { + this.getStoreInfo() + } + } + // 检查 is_online 字段,动态控制 list 数组 if (res.data.data.ProductOrder && res.data.data.ProductOrder.is_online !== undefined) { this.is_online = res.data.data.ProductOrder.is_online @@ -625,7 +644,7 @@ export default { } }, mounted() { - this.getStoreInfo() + // 不在mounted中调用getStoreInfo,等getInfo返回后再决定是否调用 const order_id = uni.getStorageSync('userWay_order_id') const delivery_method = uni.getStorageSync('delivery_method') if (delivery_method == 1) { diff --git a/subPackages/my/record-pay.vue b/subPackages/my/record-pay.vue index c34f9a0..1ac7be4 100644 --- a/subPackages/my/record-pay.vue +++ b/subPackages/my/record-pay.vue @@ -1,8 +1,16 @@