uniapp【修复】:服务商品详情去掉商品参数评价

This commit is contained in:
花城
2024-11-21 21:21:42 +08:00
parent fd7ce72a77
commit e2d5fc576b
2 changed files with 16 additions and 6 deletions

View File

@@ -35,7 +35,7 @@
:agentProductsList="props.agentProductsList"></GoodsDetailAgent>
<!-- 商品评价 -->
<GoodsDetailEvaluate :id="props.goodsId" :commentsCount="state.commentsCount"
<GoodsDetailEvaluate v-if="state.commentsList.length > 0" :id="props.goodsId" :commentsCount="state.commentsCount"
:commentsList="state.commentsList">
</GoodsDetailEvaluate>
@@ -79,6 +79,8 @@
spesDesc : string,
isCustomService : boolean,
shareType : ShareEnum,
isShowGoodsComment:boolean,
isShowGoodsParams:boolean,
}>(), {
isActivityGoods: false, /** 是否是活动商品 */
goodsId: 0, /** 商品id */
@@ -91,6 +93,8 @@
spesDesc: '', /** 商品规格 */
isCustomService: false, /** 是否自定义商品服务模块 */
shareType: ShareEnum.index, /** 分享类型 - 默认分享首页 */
isShowGoodsComment:true, /** 是否显示评价 */
isShowGoodsParams:true, /** 是否显示商品参数 */
});
const emits = defineEmits(['hanldeShowGoodSku', 'handleToggleGoodsCollection']);
@@ -113,10 +117,16 @@
watch(() => props.goodsId, (newVal : number) => {
if (newVal) {
/** 获取商品评价 */
getGoodsComment();
/** 获取商品参数 */
getGoodsParams();
/** 获取商品评价 */
if(props.isShowGoodsComment){
getGoodsComment();
}
/** 获取商品参数 */
if(props.isShowGoodsParams){
getGoodsParams();
}
/** 如果用户登录,添加商品足迹 */
if (uni.getStorageSync(UserToken)) {
handleGoodsBrowsing();

View File

@@ -4,7 +4,7 @@
<view class="layout-goods-detail">
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
:swiperBanner="state.swiperBanner" :goodsDetailContent="state.goodsDetailContent"
:isCustomService="true" :isActivityGoods="true" :shareType=ShareEnum.serviceGoods>
:isCustomService="true" :isActivityGoods="true" :isShowGoodsComment="false" :isShowGoodsParams="false" :shareType=ShareEnum.serviceGoods>
<template #countDown>
<view class="time-box"
v-if="(state.goodsDetailData.openStatus == ServiceGoodsOpenEnum.start || state.goodsDetailData.openStatus == ServiceGoodsOpenEnum.noStart) && state.goodsDetailData.timestamp > 0">