商品详情中的店铺及店铺详情链接开发

This commit is contained in:
donqi 2022-06-27 10:25:57 +08:00
parent a87b95dc0c
commit 38b2438ff7
3 changed files with 28 additions and 12 deletions

View File

@ -420,4 +420,12 @@ export default {
})
return res[1].data;
},
async getWorkerAllDetailById(params = {}) {
let res = await uni.request({
url: '/worker/getDetailById',
method: 'POST',
data: params
})
return res[1].data;
},
}

View File

@ -131,18 +131,19 @@
<view id="pageAnchor1" class="margin-lr-sm margin-top-sm bg-white">
<view class="flex justify-between align-end padding">
<view class="text-black text-lg">商品评价</view>
<view class="text-red text-sm">好评率95%<text class="text-bold text-gray cuIcon-right"></text></view>
<!-- <view class="text-red text-sm">好评率95%<text class="text-bold text-gray cuIcon-right"></text></view> -->
</view>
<comments-card :reviewers="reviewers"></comments-card>
<view class="text-center padding-bottom">开发中敬请期待</view>
<!-- <comments-card :reviewers="reviewers"></comments-card> -->
</view>
<!-- 店家链接 -->
<view class="margin-lr-sm margin-top-sm padding bg-white">
<view class="flex justify-between align-center">
<view class="flex justify-start align-center">
<view class="cu-avatar round" :style="'background-image:url(' + shopInfo.avatarUrl + ');'"></view>
<view class="cu-avatar round" :style="'background-image:url(' + shopInfo.workerLogoUrl + ');'"></view>
<view class="content flex-sub margin-lr-sm">
<view class="text-black">{{shopInfo.shopName}}</view>
<uni-rate :size="15" :readonly="true" allow-half :value="shopInfo.totalScore" />
<view class="text-black">{{shopInfo.name}}</view>
<uni-rate :size="15" :readonly="true" allow-half :value="5" />
</view>
</view>
<view class="text-sm" @click="showShopDetail(shopInfo)">店铺查看<text class="text-bold text-gray cuIcon-right"></text></view>
@ -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);

View File

@ -55,8 +55,7 @@
<text>附加服务</text>
<radio-group @change="changeAdditionalServId">
<label class="radio margin-right-sm" v-for="(item, index) in additionalServ">
<radio style="transform:scale(0.7)" class="main-color" :value="item.id"
checked disabled/>
<radio style="transform:scale(0.7)" class="main-color" :value="item.id" disabled/>
<text class="margin-left-xs">{{item.name}}</text>
</label>
</radio-group>
@ -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]]