From 38b2438ff784ea367f8df5d14dd142ddb30155c7 Mon Sep 17 00:00:00 2001 From: donqi Date: Mon, 27 Jun 2022 10:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=BA=97=E9=93=BA=E5=8F=8A=E5=BA=97=E9=93=BA=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=93=BE=E6=8E=A5=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/request.js | 8 ++++++++ pages/product/product-detail.vue | 19 ++++++++++++------- pages/product/shop-detail.vue | 13 ++++++++----- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/common/js/request.js b/common/js/request.js index eced635..dfdcf54 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -419,5 +419,13 @@ export default { data: params }) return res[1].data; + }, + async getWorkerAllDetailById(params = {}) { + let res = await uni.request({ + url: '/worker/getDetailById', + method: 'POST', + data: params + }) + return res[1].data; }, } diff --git a/pages/product/product-detail.vue b/pages/product/product-detail.vue index b261ccb..db45c3c 100644 --- a/pages/product/product-detail.vue +++ b/pages/product/product-detail.vue @@ -131,18 +131,19 @@ 商品评价 - 好评率95% - - + + + 开发中,敬请期待 + - + - {{shopInfo.shopName}} - + {{shopInfo.name}} + 店铺查看 @@ -246,11 +247,15 @@ this.detailPicList.forEach((picItem) => { this.picUrls.push(picItem.imgUrl); }) + let res = await this.$request.getWorkerAllDetailById({ + workerId: this.productDetail.workerId + }) + this.shopInfo = res.data; this.guaranteeList = productDetailMock.guaranteeList; this.productInfo = productDetailMock.productInfo; this.reviewers = productDetailMock.reviewers; - this.shopInfo = productDetailMock.shopInfo; + // this.shopInfo = productDetailMock.shopInfo; }, bindEvent() { uni.$on('product-detail_add2Cart', this.add2Cart); diff --git a/pages/product/shop-detail.vue b/pages/product/shop-detail.vue index 89caf6a..5204ecd 100644 --- a/pages/product/shop-detail.vue +++ b/pages/product/shop-detail.vue @@ -55,8 +55,7 @@ 附加服务: @@ -133,12 +132,16 @@ } }, onLoad(option) { - this.shopInfo = JSON.parse(decodeURIComponent(option.shopInfo)); - this.loadData(); + const params = JSON.parse(decodeURIComponent(option.shopInfo)); + this.loadData(params); }, methods: { - async loadData() { + async loadData(params) { // this.shopInfo = await this.$api.data('shopInfo'); + let res = await this.$request.getWorkerAllDetailById({ + workerId: params.workerId + }) + this.shopInfo = res.data; this.loadCategoryList(); await this.loadRegionList(); this.searchInfo.area = [this.areaList[0][0], this.areaList[1][0], this.areaList[2][0]]