Commit 9608876b2eb34f0c88f759e9f26aee89a6d77e7a

Authored by yvan.ni
1 parent c449590c

商品详情页评价图片,添加评价,评价列表

pages/goods/goodsInfo/goodsInfo.js
@@ -385,8 +385,9 @@ Page({ @@ -385,8 +385,9 @@ Page({
385 385
386 if(fir_com){ 386 if(fir_com){
387 for(var ind in fir_com){ 387 for(var ind in fir_com){
388 - if(fir_com[ind].head_pic=="") fir_com[ind].head_pic= ee.data.iurl+"/miniapp/images/hui_hear_pic.png";  
389 - if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img); 388 + if(fir_com[ind].head_pic=="") fir_com[ind].head_pic= ee.data.iurl+"/miniapp/images/hui_hear_pic.png";
  389 + if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
  390 + if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);
390 } 391 }
391 } 392 }
392 393
@@ -774,6 +775,7 @@ Page({ @@ -774,6 +775,7 @@ Page({
774 data: updata, 775 data: updata,
775 success: function(t) { 776 success: function(t) {
776 getApp().my_warnning('加入购物车成功', 1, th,450); 777 getApp().my_warnning('加入购物车成功', 1, th,450);
  778 + th.closeSpecModal();
777 } 779 }
778 }); 780 });
779 } else { 781 } else {
@@ -781,6 +783,7 @@ Page({ @@ -781,6 +783,7 @@ Page({
781 data: newd, 783 data: newd,
782 success: function(t) { 784 success: function(t) {
783 getApp().my_warnning('加入购物车成功', 1, th,450); 785 getApp().my_warnning('加入购物车成功', 1, th,450);
  786 + th.closeSpecModal();
784 } 787 }
785 }); 788 });
786 } 789 }
@@ -1349,6 +1352,9 @@ Page({ @@ -1349,6 +1352,9 @@ Page({
1349 if(res.data.data.pageData && res.data.data.pageData.length>0){ 1352 if(res.data.data.pageData && res.data.data.pageData.length>0){
1350 cda[ind].replay_list=res.data.data.pageData; 1353 cda[ind].replay_list=res.data.data.pageData;
1351 } 1354 }
  1355 + if(ep.weapp_img!="" && ut.isString(ep.weapp_img)){
  1356 + cda[ind].weapp_img=JSON.parse(ep.weapp_img);
  1357 + }
1352 }) 1358 })
1353 } 1359 }
1354 } 1360 }
@@ -2712,7 +2718,7 @@ Page({ @@ -2712,7 +2718,7 @@ Page({
2712 // 选择门店 2718 // 选择门店
2713 choice_store:function(ee){ 2719 choice_store:function(ee){
2714 var th=this; 2720 var th=this;
2715 - var ind=ee.currentTarget.dataset.ind; 2721 + //var ind=ee.currentTarget.dataset.ind;
2716 var bconfig = th.data.bconfig; 2722 var bconfig = th.data.bconfig;
2717 2723
2718 if (bconfig.is_sort_storage){ 2724 if (bconfig.is_sort_storage){
@@ -2744,7 +2750,7 @@ Page({ @@ -2744,7 +2750,7 @@ Page({
2744 }) 2750 })
2745 } 2751 }
2746 this.setData({ 2752 this.setData({
2747 - open_ind_store: ind, 2753 + //open_ind_store: ind,
2748 store:1, 2754 store:1,
2749 openSpecModal: !1, 2755 openSpecModal: !1,
2750 openSpecModal_pt: !1 2756 openSpecModal_pt: !1
pages/goods/goodsInfo/goodsInfo.wxml
@@ -387,7 +387,8 @@ @@ -387,7 +387,8 @@
387 </view> 387 </view>
388 </view> 388 </view>
389 <view class="xc_goods-img-frame"> 389 <view class="xc_goods-img-frame">
390 - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> 390 + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>
  391 + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>
391 <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image> 392 <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>
392 </view> 393 </view>
393 </view> 394 </view>
@@ -621,8 +622,13 @@ @@ -621,8 +622,13 @@
621 </view> 622 </view>
622 </view> 623 </view>
623 624
624 - <view class="iddle-goods-img">  
625 - <image bindtap="previewCommentImgs" class="goods-img" wx:for="{{item.img}}" wx:key="{{index}}" data-cidx="{{cIdx}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image> 625 + <view class="iddle-goods-img" wx:if="{{item.source_type==0}}">
  626 + <image bindtap="previewCommentImgs" class="goods-img" wx:for="{{item.img}}" data-cidx="{{cIdx}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image>
  627 + </view>
  628 + <view class="iddle-goods-img" wx:else>
  629 + <image bindtap="previewCommentImgs" class="goods-img"
  630 + wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}"
  631 + wx:for-item="aitem" data-cidx="{{cIdx}}" data-id="{{index}}" src="{{aitem}}"></image>
626 </view> 632 </view>
627 633
628 <view class="z_parameter"> 634 <view class="z_parameter">
pages/user/add_comment/add_comment.wxml
1 -<!-- <view class="goods-mes pd-bg-fff">  
2 - <view class="goods-img">  
3 - <image class="wh100" src="{{options.img}}" binderror="bind_bnerr2" data-errorimg="options.img"></image>  
4 - </view>  
5 - <view class="goods-des">  
6 - <view class="goods-name ellipsis-1">{{options.goods_name}}</view>  
7 - <view class="goods-package ellipsis-1">¥{{options.price}}</view>  
8 - </view>  
9 -</view>  
10 -<view class="evaluation">  
11 - <textarea bindinput="keyUpChangeNum" class="word-box" maxlength="500" placeholder="写下购买体会和使用感受来帮助其他小伙伴吧~"></textarea>  
12 - <view class="words-num">{{maxWord}}/500</view>  
13 -</view>  
14 -  
15 -<!------  
16 -<view class="pic-list pd-bg-fff">  
17 - <view class="share-pic" wx:for="{{5}}" wx:key="{{index}}">  
18 - <image bindlongtap="removePhoto" bindtap="selectPhotos" class="wh100" data-idx="{{index}}" src="{{filePaths[index]?filePaths[index]:defaultPhoto}}"></image>  
19 - </view>  
20 -</view>------->  
21 -  
22 -<!-- <view class="anonymous">  
23 - <icon bindtap="checkAnonymous" color="{{is_anonymous?'red':'gray'}}" size="20" type="success"></icon> 匿名评价  
24 -</view> -->  
25 -<!-- <view class="score-list pd-bg-fff">  
26 - <view class="score-title">  
27 - <view>评分</view>  
28 - <view>满意请给5分哦</view>  
29 - </view>  
30 - <view class="score-item">  
31 - <view>商品符合度</view>  
32 - <view class="stars">  
33 - <image bindtap="checkGoodsRank" data-i="{{index}}" src="{{index<goods_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image>  
34 - </view>  
35 - </view>  
36 - <view class="score-item">  
37 - <view>店家服务态度</view>  
38 - <view class="stars">  
39 - <image bindtap="checkServiceRank" data-i="{{index}}" src="{{index<service_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image>  
40 - </view>  
41 - </view>  
42 - <view class="score-item">  
43 - <view>物流发货速度</view>  
44 - <view class="stars">  
45 - <image bindtap="checkDeliverRank" data-i="{{index}}" src="{{index<deliver_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image>  
46 - </view>  
47 - </view>  
48 -</view>  
49 -<view class="btn-wrap">  
50 - <view bindtap="submitComment" class="submit-btn">提 交</view>  
51 -</view> -->  
52 -<view> 1 +<view class="commoditymax">
53 <!-- 商品评价 --> 2 <!-- 商品评价 -->
54 <view class='commodity'> 3 <view class='commodity'>
55 <!-- 商品信息 --> 4 <!-- 商品信息 -->
56 - <view class='information flex-vertical'>  
57 - <image src="{{options.img}}" binderror="bind_bnerr2" data-errorimg="options.img"></image> 5 + <navigator class='information flex-vertical' url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+options.goods_id}}">
  6 + <image src="{{options.img}}" binderror="bind_bnerr2" data-errorimg="options.img"></image>
58 <view class="goods_name xc-black"> 7 <view class="goods_name xc-black">
59 <!-- 商品名称 --> 8 <!-- 商品名称 -->
60 - <view class='ellipsis-2 fs32'>{{options.goods_name}}我弄饭v的v哦女v绝我弄饭v的v哦女v绝望愤怒冻死我弄饭v的v哦女v绝望愤怒冻死望愤怒冻死</view> 9 + <view class='ellipsis-2 fs32'>{{options.goods_name}}</view>
61 <!-- 商品价格,数量 --> 10 <!-- 商品价格,数量 -->
62 <view class='flex jc_sb balin'> 11 <view class='flex jc_sb balin'>
63 <!-- 价格 --> 12 <!-- 价格 -->
@@ -76,14 +25,12 @@ @@ -76,14 +25,12 @@
76 25
77 </view> 26 </view>
78 27
79 - </view> 28 + </navigator>
80 29
81 30
82 <!-- 商品评价信息 --> 31 <!-- 商品评价信息 -->
83 <view class="addComment"> 32 <view class="addComment">
84 - <textarea class="fs24" placeholder="已经收到商品,快跟大家分享一下宝贝吧!"  
85 - bindinput="txtInpt"  
86 - placeholder-class="fs24" maxlength="500" value="{{content}}"></textarea> 33 + <textarea class="fs24" placeholder="已经收到商品,快跟大家分享一下宝贝吧!" bindinput="txtInpt" placeholder-class="fs24" maxlength="500" value="{{content}}"></textarea>
87 <view class="flex addimages"> 34 <view class="flex addimages">
88 <!-- 评论图片集合 --> 35 <!-- 评论图片集合 -->
89 <view class="images"> 36 <view class="images">
@@ -122,23 +69,26 @@ @@ -122,23 +69,26 @@
122 <view class="score-item flex-vertical"> 69 <view class="score-item flex-vertical">
123 <view class="fs24">描述相符</view> 70 <view class="fs24">描述相符</view>
124 <view class="stars flex-vertical"> 71 <view class="stars flex-vertical">
125 - <image data-i="{{index}}" src="{{index<goods_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"  
126 - wx:for="{{5}}" wx:key="{{index}}" bindtap="checkGoodsRank"></image> 72 + <view class="flex-vertical" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}" bindtap="checkGoodsRank">
  73 + <image src="{{index<goods_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image>
  74 + </view>
127 </view> 75 </view>
128 </view> 76 </view>
129 77
130 <view class="score-item flex-vertical"> 78 <view class="score-item flex-vertical">
131 <view class="fs24">物流服务</view> 79 <view class="fs24">物流服务</view>
132 <view class="stars flex-vertical"> 80 <view class="stars flex-vertical">
133 - <image bindtap="checkDeliverRank" data-i="{{index}}" src="{{index<deliver_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"  
134 - wx:for="{{5}}" wx:key="{{index}}"></image> 81 + <view class="flex-vertical" bindtap="checkDeliverRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}">
  82 + <image src="{{index<deliver_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image>
  83 + </view>
135 </view> 84 </view>
136 </view> 85 </view>
137 <view class="score-item flex-vertical"> 86 <view class="score-item flex-vertical">
138 <view class="fs24">服务态度</view> 87 <view class="fs24">服务态度</view>
139 <view class="stars flex-vertical"> 88 <view class="stars flex-vertical">
140 - <image src="{{index<service_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"  
141 - bindtap="checkServiceRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}"></image> 89 + <view class="flex-vertical" bindtap="checkServiceRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}">
  90 + <image src="{{index<service_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image>
  91 + </view>
142 </view> 92 </view>
143 93
144 </view> 94 </view>
@@ -152,7 +102,7 @@ @@ -152,7 +102,7 @@
152 <view class=" Whether "> 102 <view class=" Whether ">
153 <!-- 选择是否匿名 --> 103 <!-- 选择是否匿名 -->
154 <view class="allClick flex-right-vertical" bindtap="checkAnonymous"> 104 <view class="allClick flex-right-vertical" bindtap="checkAnonymous">
155 - <icon class="radio" size="15" type="success" color="{{is_anonymous?'red':'gainsboro'}}"></icon> 105 + <icon class="radio" size="15" type="success" color="{{is_anonymous?'red':'gainsboro'}}"></icon>
156 <view class="fs24 ">匿名评价</view> 106 <view class="fs24 ">匿名评价</view>
157 </view> 107 </view>
158 108
pages/user/add_comment/add_comment.wxss
1 -/* .goods-mes {  
2 - height: 100rpx;  
3 - display: flex;  
4 - padding: 30rpx;  
5 - justify-content: space-between; 1 +page{
  2 + overflow-x: hidden;
  3 + overflow-y: hidden;
6 } 4 }
7 -  
8 -.goods-img {  
9 - width: 100rpx;  
10 - height: 100rpx;  
11 - overflow: hidden;  
12 -}  
13 -  
14 -.goods-des {  
15 - width: 560rpx;  
16 -}  
17 -  
18 -.goods-des>view {  
19 - width: 100%;  
20 - height: 32rpx;  
21 - line-height: 1;  
22 - font-size: 32rpx;  
23 - color: #444;  
24 -}  
25 -  
26 -.goods-package {  
27 - margin-top: 36rpx;  
28 -}  
29 -  
30 -.evaluation {  
31 - padding: 30rpx 30rpx;  
32 - position: relative;  
33 - font-size: 28rpx;  
34 -}  
35 -  
36 -.word-box {  
37 - color: #444;  
38 - line-height: 40rpx;  
39 - width: 100%;  
40 - height: 200rpx;  
41 -}  
42 -  
43 -.words-num {  
44 - position: absolute;  
45 - right: 30rpx;  
46 - bottom: 30rpx;  
47 - color: #777;  
48 -}  
49 -  
50 -.pic-list {  
51 - padding: 40rpx 20rpx 20rpx;  
52 - display: flex;  
53 - justify-content: space-around;  
54 -}  
55 -  
56 -.share-pic {  
57 - width: 126rpx;  
58 - height: 126rpx;  
59 - border: 1px solid #ddd;  
60 - overflow: hidden;  
61 -}  
62 -  
63 -.anonymous {  
64 - height: 60rpx;  
65 - padding: 0 20rpx 20rpx;  
66 - background-color: #fff;  
67 - display: flex;  
68 - align-items: center;  
69 - font-size: 30rpx;  
70 - color: #777;  
71 -}  
72 -  
73 -.anonymous>icon {  
74 - margin-right: 20rpx;  
75 -}  
76 -  
77 -.score-list {  
78 - margin-top: 20rpx;  
79 -}  
80 -  
81 -.score-list>view {  
82 - display: flex;  
83 - justify-content: space-between;  
84 - font-size: 30rpx;  
85 - color: #444;  
86 -}  
87 -  
88 -.score-title {  
89 - height: 90rpx;  
90 - line-height: 90rpx;  
91 - border-bottom: 1px solid #eee;  
92 -}  
93 -  
94 -.score-item {  
95 - align-items: center;  
96 - height: 80rpx;  
97 -}  
98 -  
99 -.stars {  
100 - display: flex;  
101 -}  
102 -  
103 -.stars image {  
104 - width: 44rpx;  
105 - height: 40rpx;  
106 -}  
107 -  
108 -.btn-wrap {  
109 - padding: 20rpx 0;  
110 - background-color: #fff;  
111 - border-top: 1px solid #eee;  
112 -}  
113 -  
114 -.submit-btn {  
115 - width: 320rpx;  
116 - height: 80rpx;  
117 - line-height: 80rpx;  
118 - text-align: center;  
119 - background-color: #f15353;  
120 - color: #fff;  
121 - margin: auto;  
122 -} */  
123 -  
124 /* 商品详情和评价 */ 5 /* 商品详情和评价 */
125 - 6 +.commoditymax{
  7 + overflow: hidden;
  8 +}
126 .commodity { 9 .commodity {
127 height: 715rpx; 10 height: 715rpx;
128 border-top: 6rpx solid rgb(245, 245, 245); 11 border-top: 6rpx solid rgb(245, 245, 245);
@@ -245,16 +128,20 @@ @@ -245,16 +128,20 @@
245 .Grade .score-item .stars { 128 .Grade .score-item .stars {
246 margin-left: 83rpx; 129 margin-left: 83rpx;
247 } 130 }
  131 +.Grade .score-item .stars view{
  132 + width: 60rpx;
  133 + height: 55rpx;
  134 +}
248 135
249 .Grade .score-item .stars image { 136 .Grade .score-item .stars image {
250 width: 35rpx; 137 width: 35rpx;
251 height: 35rpx; 138 height: 35rpx;
252 - margin-right: 28rpx;  
253 } 139 }
254 - 140 +.Whether {
  141 + padding:0rpx 31rpx;
  142 +}
255 .Whether .flex-right-vertical { 143 .Whether .flex-right-vertical {
256 height: 67rpx; 144 height: 67rpx;
257 - padding-right: 31rpx;  
258 } 145 }
259 146
260 .Whether .flex-right-vertical .radio { 147 .Whether .flex-right-vertical .radio {
pages/user/comment/comment.wxml
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 <view class="detail_commoditys"> 34 <view class="detail_commoditys">
35 <!-- 单个商品 --> 35 <!-- 单个商品 -->
36 <view> 36 <view>
37 - <view class="detail_commodity flex-vertical padding border_bottom"> 37 + <navigator class="detail_commodity flex-vertical padding border_bottom" url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}">
38 <!-- 商品图片 --> 38 <!-- 商品图片 -->
39 <image src="{{item.original_img}}" binderror="bind_bnerr2" data-errorimg="comments[{{index}}].original_img"></image> 39 <image src="{{item.original_img}}" binderror="bind_bnerr2" data-errorimg="comments[{{index}}].original_img"></image>
40 <!-- 商品内容 --> 40 <!-- 商品内容 -->
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 <view class="fs26">x{{item.goods_num}}</view> 57 <view class="fs26">x{{item.goods_num}}</view>
58 </view> 58 </view>
59 </view> 59 </view>
60 - </view> 60 + </navigator>
61 <!-- 评论信息 --> 61 <!-- 评论信息 -->
62 <view class="Commodity_evaluation padding border_bottom" wx:if="{{item.comment_id>0}}"> 62 <view class="Commodity_evaluation padding border_bottom" wx:if="{{item.comment_id>0}}">
63 <!-- 评价星级 --> 63 <!-- 评价星级 -->