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]]