作者 韩昌

修改评论

... ... @@ -27,7 +27,7 @@
<!-- 1=普通商品,2=特价商品,3=积分商品 -->
<view v-if="shopType == 1">
<view class="commentNmu flexJ">
<text>评论({{ commentList.length }})</text>
<text>评论({{ commentNum }})</text>
<view class="see flexA" v-if="commentList.length > 0" @click="seeAll">
查看全部
<image src="/static/indexIc/orangeRight.png" mode=""></image>
... ... @@ -49,10 +49,13 @@
<!-- <rich-text :nodes="detaileList.content"></rich-text> -->
</view>
</view>
<view class="lineBox flexC" v-if="shopType == 3">
<view class="lines"></view>
<text>商品详情</text>
<view class="lines"></view>
<view class="lineBox" v-if="shopType == 3">
<view class="flexC">
<view class="lines"></view>
<text>商品详情</text>
<view class="lines"></view>
</view>
<u-parse :content="detaileList.content"></u-parse>
</view>
<view class="" style="height: 300rpx"></view>
<!-- 底部按钮 -->
... ... @@ -130,6 +133,7 @@ let detaileList = ref({}) //商品详情
let specList = ref({}) //默认规格第一项
let swiperList = ref([]) //轮播图
let commentList = ref([]) //评论
const commentNum = ref(0) // 评论数量
let moreSpec = ref({}) //多规格
let shopType = ref(1) //商品类型
const allCommentList = ref('')
... ... @@ -141,6 +145,7 @@ const getShopDetailes = async id => {
specList.value = res.detail.spec[0] //默认规格第一项
swiperList.value = res.detail.images //轮播图
allCommentList.value = JSON.stringify(res.pinglun) // 跳转显示全部评论
commentNum.value = res.pinglun.length
commentList.value = res.pinglun.splice(0, 1) //评论
moreSpec.value = res.specData //多规格
shopType.value = res.detail.goodstatus //商品类型
... ...
"use strict";const e=require("../../common/vendor.js"),C=require("../../api/index.js");require("../../utils/request.js");if(!Array){const v=e.resolveComponent("u-navbar"),i=e.resolveComponent("u-swiper"),p=e.resolveComponent("u-parse"),c=e.resolveComponent("u-badge");(v+i+p+c)()}const L=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js",j=()=>"../../uni_modules/uview-plus/components/u-swiper/u-swiper.js",D=()=>"../../uni_modules/uview-plus/components/u-parse/u-parse.js",S=()=>"../../uni_modules/uview-plus/components/u-badge/u-badge.js";Math||(L+j+T+P+D+S+I)();const T=()=>"../../componets/shopInfo.js",P=()=>"../../componets/comment.js",I=()=>"../../componets/popPay.js",$={__name:"shopDetaile",setup(v){e.onLoad(s=>{console.log("商品id",s.id),y(s.id)}),e.onHide(()=>{r.value=!1});const i=e.ref(0);e.reactive(["https://cdn.uviewui.com/uview/swiper/swiper2.png","https://cdn.uviewui.com/uview/swiper/swiper3.png","https://cdn.uviewui.com/uview/swiper/swiper1.png"]);const p=e.reactive([{id:1,name:"店铺",icon:"/static/indexIc/shopIc.png"},{id:2,name:"客服",icon:"/static/indexIc/service.png"},{id:3,name:"购物车",icon:"/static/tabbarsIc/shopCar.png"}]),c=e.ref("1"),h=()=>{e.index.navigateTo({url:`/pages/index/allComment?allCommentList=${d.value}`})};let g=e.ref(0),r=e.ref(!1);const f=s=>{g.value=s,r.value=!0},w=s=>{switch(s){case 0:console.log("店铺"),e.index.switchTab({url:"/pages/index/index"});break;case 2:console.log("购物车"),e.index.switchTab({url:"/pages/shopCar/shopCar"});break}};let l=e.ref({}),b=e.ref({}),m=e.ref([]),a=e.ref([]),_=e.ref({}),n=e.ref(1);const d=e.ref(""),y=async s=>{try{const o=await C.getShopDetaile(s);l.value=o.detail,b.value=o.detail.spec[0],m.value=o.detail.images,d.value=JSON.stringify(o.pinglun),a.value=o.pinglun.splice(0,1),_.value=o.specData,n.value=o.detail.goodstatus,c.value=o.cartNum}catch(o){e.index.showToast({title:o,icon:"none"}),console.log("",o)}};return(s,o)=>e.e({a:e.p({bgColor:"transparent",autoBack:!0}),b:e.unref(n)!=3},e.unref(n)!=3?{c:e.t(i.value+1),d:e.t(e.unref(m).length)}:{},{e:e.o(t=>i.value=t.current),f:e.p({height:"375",list:e.unref(m),autoplay:!1,indicatorStyle:"right: 20px"}),g:e.p({info:e.unref(l)}),h:e.unref(n)==1},e.unref(n)==1?e.e({i:e.t(e.unref(a).length),j:e.unref(a).length>0},e.unref(a).length>0?{k:e.o(h)}:{},{l:e.unref(a).length},e.unref(a).length?{m:e.p({commentList:e.unref(a)})}:{}):{},{n:e.unref(n)!==3},e.unref(n)!==3?{o:e.p({content:e.unref(l).content})}:{},{p:e.unref(n)==3},e.unref(n)==3?{}:{},{q:e.f(p,(t,u,x)=>e.e({a:t.icon,b:u==2},u==2?{c:"1a35f0c9-5-"+x,d:e.p({absolute:!0,offset:[-6,-6],color:"#fff",bgColor:"#F63D3A",max:"99",value:c.value})}:{},{e:e.t(t.name),f:u===1},u===1?{}:{},{g:t.id,h:e.o(q=>w(u),t.id)})),r:e.unref(n)!=3},e.unref(n)!=3?{s:e.o(t=>f(0)),t:e.o(t=>f(1))}:{v:e.o(t=>f(3))},{w:e.o(t=>e.isRef(r)?r.value=!1:r=!1),x:e.p({moreSpec:e.unref(_),shopDetail:e.unref(l),shopType:e.unref(n),btnType:e.unref(g),payPopShow:e.unref(r)})})}},k=e._export_sfc($,[["__file","D:/vue/大健康商城/healthMall/pages/index/shopDetaile.vue"]]);wx.createPage(k);
"use strict";const e=require("../../common/vendor.js"),C=require("../../api/index.js");require("../../utils/request.js");if(!Array){const v=e.resolveComponent("u-navbar"),i=e.resolveComponent("u-swiper"),l=e.resolveComponent("u-parse"),p=e.resolveComponent("u-badge");(v+i+l+p)()}const L=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js",j=()=>"../../uni_modules/uview-plus/components/u-swiper/u-swiper.js",D=()=>"../../uni_modules/uview-plus/components/u-parse/u-parse.js",S=()=>"../../uni_modules/uview-plus/components/u-badge/u-badge.js";Math||(L+j+T+P+D+S+I)();const T=()=>"../../componets/shopInfo.js",P=()=>"../../componets/comment.js",I=()=>"../../componets/popPay.js",$={__name:"shopDetaile",setup(v){e.onLoad(s=>{console.log("商品id",s.id),y(s.id)}),e.onHide(()=>{r.value=!1});const i=e.ref(0);e.reactive(["https://cdn.uviewui.com/uview/swiper/swiper2.png","https://cdn.uviewui.com/uview/swiper/swiper3.png","https://cdn.uviewui.com/uview/swiper/swiper1.png"]);const l=e.reactive([{id:1,name:"店铺",icon:"/static/indexIc/shopIc.png"},{id:2,name:"客服",icon:"/static/indexIc/service.png"},{id:3,name:"购物车",icon:"/static/tabbarsIc/shopCar.png"}]),p=e.ref("1"),h=()=>{e.index.navigateTo({url:`/pages/index/allComment?allCommentList=${d.value}`})};let g=e.ref(0),r=e.ref(!1);const f=s=>{g.value=s,r.value=!0},w=s=>{switch(s){case 0:console.log("店铺"),e.index.switchTab({url:"/pages/index/index"});break;case 2:console.log("购物车"),e.index.switchTab({url:"/pages/shopCar/shopCar"});break}};let u=e.ref({}),b=e.ref({}),m=e.ref([]),a=e.ref([]),_=e.ref({}),n=e.ref(1);const d=e.ref(""),y=async s=>{try{const o=await C.getShopDetaile(s);u.value=o.detail,b.value=o.detail.spec[0],m.value=o.detail.images,d.value=JSON.stringify(o.pinglun),a.value=o.pinglun.splice(0,1),_.value=o.specData,n.value=o.detail.goodstatus,p.value=o.cartNum}catch(o){e.index.showToast({title:o,icon:"none"}),console.log("",o)}};return(s,o)=>e.e({a:e.p({bgColor:"transparent",autoBack:!0}),b:e.unref(n)!=3},e.unref(n)!=3?{c:e.t(i.value+1),d:e.t(e.unref(m).length)}:{},{e:e.o(t=>i.value=t.current),f:e.p({height:"375",list:e.unref(m),autoplay:!1,indicatorStyle:"right: 20px"}),g:e.p({info:e.unref(u)}),h:e.unref(n)==1},e.unref(n)==1?e.e({i:e.t(e.unref(a).length),j:e.unref(a).length>0},e.unref(a).length>0?{k:e.o(h)}:{},{l:e.unref(a).length},e.unref(a).length?{m:e.p({commentList:e.unref(a)})}:{}):{},{n:e.unref(n)!==3},e.unref(n)!==3?{o:e.p({content:e.unref(u).content})}:{},{p:e.unref(n)==3},e.unref(n)==3?{q:e.p({content:e.unref(u).content})}:{},{r:e.f(l,(t,c,x)=>e.e({a:t.icon,b:c==2},c==2?{c:"1a35f0c9-6-"+x,d:e.p({absolute:!0,offset:[-6,-6],color:"#fff",bgColor:"#F63D3A",max:"99",value:p.value})}:{},{e:e.t(t.name),f:c===1},c===1?{}:{},{g:t.id,h:e.o(q=>w(c),t.id)})),s:e.unref(n)!=3},e.unref(n)!=3?{t:e.o(t=>f(0)),v:e.o(t=>f(1))}:{w:e.o(t=>f(3))},{x:e.o(t=>e.isRef(r)?r.value=!1:r=!1),y:e.p({moreSpec:e.unref(_),shopDetail:e.unref(u),shopType:e.unref(n),btnType:e.unref(g),payPopShow:e.unref(r)})})}},k=e._export_sfc($,[["__file","D:/vue/大健康商城/healthMall/pages/index/shopDetaile.vue"]]);wx.createPage(k);
... ...
<view><u-navbar wx:if="{{a}}" u-s="{{['left']}}" u-i="1a35f0c9-0" bind:__l="__l" u-p="{{a}}"><view class="u-nav-slot" slot="left"><image src="/static/indexIc/back.png" mode=""></image></view></u-navbar><view class="swiperBox"><u-swiper wx:if="{{f}}" u-s="{{['indicator']}}" bindchange="{{e}}" u-i="1a35f0c9-1" bind:__l="__l" u-p="{{f}}"><view slot="indicator"><view wx:if="{{b}}" class="indicator-num"><text class="indicator-num__text">{{c}}/{{d}}</text></view></view></u-swiper></view><view class="info"><shop-info wx:if="{{g}}" u-i="1a35f0c9-2" bind:__l="__l" u-p="{{g}}"></shop-info></view><view class="line"></view><view class="mainBox"><view wx:if="{{h}}"><view class="commentNmu flexJ"><text>评论({{i}})</text><view wx:if="{{j}}" class="see flexA" bindtap="{{k}}"> 查看全部 <image src="/static/indexIc/orangeRight.png" mode=""></image></view></view><view wx:if="{{l}}"><comment wx:if="{{m}}" u-i="1a35f0c9-3" bind:__l="__l" u-p="{{m}}"></comment></view><view wx:else class="commentNull flexV"><image src="/static/indexIc/cpmmentNull.png" mode=""></image> 暂无评论 </view></view><view wx:if="{{n}}"><view class="line"></view><view class="titles">商品详情</view><u-parse wx:if="{{o}}" u-i="1a35f0c9-4" bind:__l="__l" u-p="{{o}}"></u-parse></view></view><view wx:if="{{p}}" class="lineBox flexC"><view class="lines"></view><text>商品详情</text><view class="lines"></view></view><view class="" style="height:300rpx"></view><view class="btnBox iosAuto flexJ"><view class="left flexA"><view wx:for="{{q}}" wx:for-item="item" wx:key="g" class="leftIc flexV" bindtap="{{item.h}}"><view class="images"><image src="{{item.a}}" mode=""></image><u-badge wx:if="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></u-badge></view><text>{{item.e}}</text><button wx:if="{{item.f}}" open-type="contact"></button></view></view><view wx:if="{{r}}" class="flexA"><view class="add flexC" bindtap="{{s}}">加入购物车</view><view class="buy flexC" bindtap="{{t}}">立即购买</view></view><view wx:else class="exchange flexC" bindtap="{{v}}">我要兑换</view></view><pop-pay wx:if="{{x}}" bindclose="{{w}}" u-i="1a35f0c9-6" bind:__l="__l" u-p="{{x}}"></pop-pay></view>
\ No newline at end of file
<view><u-navbar wx:if="{{a}}" u-s="{{['left']}}" u-i="1a35f0c9-0" bind:__l="__l" u-p="{{a}}"><view class="u-nav-slot" slot="left"><image src="/static/indexIc/back.png" mode=""></image></view></u-navbar><view class="swiperBox"><u-swiper wx:if="{{f}}" u-s="{{['indicator']}}" bindchange="{{e}}" u-i="1a35f0c9-1" bind:__l="__l" u-p="{{f}}"><view slot="indicator"><view wx:if="{{b}}" class="indicator-num"><text class="indicator-num__text">{{c}}/{{d}}</text></view></view></u-swiper></view><view class="info"><shop-info wx:if="{{g}}" u-i="1a35f0c9-2" bind:__l="__l" u-p="{{g}}"></shop-info></view><view class="line"></view><view class="mainBox"><view wx:if="{{h}}"><view class="commentNmu flexJ"><text>评论({{i}})</text><view wx:if="{{j}}" class="see flexA" bindtap="{{k}}"> 查看全部 <image src="/static/indexIc/orangeRight.png" mode=""></image></view></view><view wx:if="{{l}}"><comment wx:if="{{m}}" u-i="1a35f0c9-3" bind:__l="__l" u-p="{{m}}"></comment></view><view wx:else class="commentNull flexV"><image src="/static/indexIc/cpmmentNull.png" mode=""></image> 暂无评论 </view></view><view wx:if="{{n}}"><view class="line"></view><view class="titles">商品详情</view><u-parse wx:if="{{o}}" u-i="1a35f0c9-4" bind:__l="__l" u-p="{{o}}"></u-parse></view></view><view wx:if="{{p}}" class="lineBox"><view class="flexC"><view class="lines"></view><text>商品详情</text><view class="lines"></view></view><u-parse wx:if="{{q}}" u-i="1a35f0c9-5" bind:__l="__l" u-p="{{q}}"></u-parse></view><view class="" style="height:300rpx"></view><view class="btnBox iosAuto flexJ"><view class="left flexA"><view wx:for="{{r}}" wx:for-item="item" wx:key="g" class="leftIc flexV" bindtap="{{item.h}}"><view class="images"><image src="{{item.a}}" mode=""></image><u-badge wx:if="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></u-badge></view><text>{{item.e}}</text><button wx:if="{{item.f}}" open-type="contact"></button></view></view><view wx:if="{{s}}" class="flexA"><view class="add flexC" bindtap="{{t}}">加入购物车</view><view class="buy flexC" bindtap="{{v}}">立即购买</view></view><view wx:else class="exchange flexC" bindtap="{{w}}">我要兑换</view></view><pop-pay wx:if="{{y}}" bindclose="{{x}}" u-i="1a35f0c9-7" bind:__l="__l" u-p="{{y}}"></pop-pay></view>
\ No newline at end of file
... ...