正在显示
3 个修改的文件
包含
12 行增加
和
7 行删除
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | <!-- 1=普通商品,2=特价商品,3=积分商品 --> | 27 | <!-- 1=普通商品,2=特价商品,3=积分商品 --> |
28 | <view v-if="shopType == 1"> | 28 | <view v-if="shopType == 1"> |
29 | <view class="commentNmu flexJ"> | 29 | <view class="commentNmu flexJ"> |
30 | - <text>评论({{ commentList.length }})</text> | 30 | + <text>评论({{ commentNum }})</text> |
31 | <view class="see flexA" v-if="commentList.length > 0" @click="seeAll"> | 31 | <view class="see flexA" v-if="commentList.length > 0" @click="seeAll"> |
32 | 查看全部 | 32 | 查看全部 |
33 | <image src="/static/indexIc/orangeRight.png" mode=""></image> | 33 | <image src="/static/indexIc/orangeRight.png" mode=""></image> |
@@ -49,10 +49,13 @@ | @@ -49,10 +49,13 @@ | ||
49 | <!-- <rich-text :nodes="detaileList.content"></rich-text> --> | 49 | <!-- <rich-text :nodes="detaileList.content"></rich-text> --> |
50 | </view> | 50 | </view> |
51 | </view> | 51 | </view> |
52 | - <view class="lineBox flexC" v-if="shopType == 3"> | ||
53 | - <view class="lines"></view> | ||
54 | - <text>商品详情</text> | ||
55 | - <view class="lines"></view> | 52 | + <view class="lineBox" v-if="shopType == 3"> |
53 | + <view class="flexC"> | ||
54 | + <view class="lines"></view> | ||
55 | + <text>商品详情</text> | ||
56 | + <view class="lines"></view> | ||
57 | + </view> | ||
58 | + <u-parse :content="detaileList.content"></u-parse> | ||
56 | </view> | 59 | </view> |
57 | <view class="" style="height: 300rpx"></view> | 60 | <view class="" style="height: 300rpx"></view> |
58 | <!-- 底部按钮 --> | 61 | <!-- 底部按钮 --> |
@@ -130,6 +133,7 @@ let detaileList = ref({}) //商品详情 | @@ -130,6 +133,7 @@ let detaileList = ref({}) //商品详情 | ||
130 | let specList = ref({}) //默认规格第一项 | 133 | let specList = ref({}) //默认规格第一项 |
131 | let swiperList = ref([]) //轮播图 | 134 | let swiperList = ref([]) //轮播图 |
132 | let commentList = ref([]) //评论 | 135 | let commentList = ref([]) //评论 |
136 | +const commentNum = ref(0) // 评论数量 | ||
133 | let moreSpec = ref({}) //多规格 | 137 | let moreSpec = ref({}) //多规格 |
134 | let shopType = ref(1) //商品类型 | 138 | let shopType = ref(1) //商品类型 |
135 | const allCommentList = ref('') | 139 | const allCommentList = ref('') |
@@ -141,6 +145,7 @@ const getShopDetailes = async id => { | @@ -141,6 +145,7 @@ const getShopDetailes = async id => { | ||
141 | specList.value = res.detail.spec[0] //默认规格第一项 | 145 | specList.value = res.detail.spec[0] //默认规格第一项 |
142 | swiperList.value = res.detail.images //轮播图 | 146 | swiperList.value = res.detail.images //轮播图 |
143 | allCommentList.value = JSON.stringify(res.pinglun) // 跳转显示全部评论 | 147 | allCommentList.value = JSON.stringify(res.pinglun) // 跳转显示全部评论 |
148 | + commentNum.value = res.pinglun.length | ||
144 | commentList.value = res.pinglun.splice(0, 1) //评论 | 149 | commentList.value = res.pinglun.splice(0, 1) //评论 |
145 | moreSpec.value = res.specData //多规格 | 150 | moreSpec.value = res.specData //多规格 |
146 | shopType.value = res.detail.goodstatus //商品类型 | 151 | shopType.value = res.detail.goodstatus //商品类型 |
1 | -"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); | 1 | +"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); |
1 | -<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> | ||
1 | +<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> |
-
请 注册 或 登录 后发表评论