Commit 2f0aad02d08c7370dd808183e6a06ece65172320
1 parent
4e986993
购物车,商品详情,评价
Showing
5 changed files
with
50 additions
and
10 deletions
pages/cart/cart2/cart2.wxss
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -377,7 +377,8 @@ Page({ |
377 | 377 | goods_id: gid, |
378 | 378 | pageSize: 3, |
379 | 379 | parent_id: 0, |
380 | - page:1 | |
380 | + page:1, | |
381 | + is_show:1, | |
381 | 382 | }, |
382 | 383 | }).then(res => { |
383 | 384 | fir_com=res.data.data.pageData; |
... | ... | @@ -1343,6 +1344,7 @@ Page({ |
1343 | 1344 | parent_id: 0, |
1344 | 1345 | goods_id: th.data.gid, |
1345 | 1346 | commenttype: tp, |
1347 | + is_show:1, | |
1346 | 1348 | } |
1347 | 1349 | if(getApp().globalData.userInfo){ |
1348 | 1350 | req_where.userId=getApp().globalData.userInfo.user_id; | ... | ... |
pages/user/comment/comment.js
... | ... | @@ -10,6 +10,7 @@ var t = function(t) { |
10 | 10 | s = require("../../../utils/util.js"), |
11 | 11 | oo = e.globalData, |
12 | 12 | os = e.globalData.setting; |
13 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | |
13 | 14 | |
14 | 15 | Page({ |
15 | 16 | data: { |
... | ... | @@ -30,9 +31,12 @@ Page({ |
30 | 31 | comments: null, |
31 | 32 | currentPage: 1, |
32 | 33 | isloaded: 0, |
34 | + order_id:0, | |
33 | 35 | }, |
34 | 36 | onLoad: function(t) { |
35 | 37 | var e = void 0 === t.status ? this.data.activeStatus : t.status; |
38 | + this.data.order_id=t.order_id; | |
39 | + | |
36 | 40 | a.init(this, "", "comments"), this.requestComments(e); |
37 | 41 | }, |
38 | 42 | onShow: function() { |
... | ... | @@ -52,16 +56,26 @@ Page({ |
52 | 56 | this.setData({ |
53 | 57 | activeStatus: t |
54 | 58 | }); |
59 | + | |
60 | + if(e.data.order_id) n+="&order_id="+e.data.order_id; | |
61 | + | |
55 | 62 | if (t == 2) { |
56 | 63 | a.request(n, function(t) { |
57 | 64 | e.data.currentPage++; |
58 | 65 | var da = th.data.comments; |
59 | - da.forEach(function(em, ind) { | |
66 | + da.forEach( function(em, ind) { | |
60 | 67 | |
61 | - if (em.img != undefined && em.img != null && ut.isString(em.img)) | |
62 | - da[ind].img = ut.unserialize(em.img); | |
63 | - var str = da[ind].weapp_img; | |
64 | - if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); | |
68 | + getApp().request.promiseGet("/api/weshop/comment/pageComment", { | |
69 | + data:{ store_id: os.stoid, goods_id: em.goods_id, | |
70 | + pageSize: 3, parent_id: em.comment_id, page:1} | |
71 | + }).then(res=>{ | |
72 | + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) | |
73 | + da[ind].replay_list=res.data.data.pageData; | |
74 | + }) | |
75 | + | |
76 | + if (em.img != undefined && em.img != null && ut.isString(em.img)) da[ind].img = ut.unserialize(em.img); | |
77 | + var str = da[ind].weapp_img; | |
78 | + if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); | |
65 | 79 | |
66 | 80 | }) |
67 | 81 | |
... | ... | @@ -81,14 +95,22 @@ Page({ |
81 | 95 | e.data.currentPage++; |
82 | 96 | var da = th.data.comments; |
83 | 97 | |
84 | - da.forEach(function(em, ind) { | |
98 | + da.forEach( function(em, ind) { | |
99 | + | |
100 | + | |
101 | + getApp().request.promiseGet("/api/weshop/comment/pageComment", { | |
102 | + data:{ store_id: os.stoid, goods_id: em.goods_id, | |
103 | + pageSize: 3, parent_id: em.comment_id, page:1} | |
104 | + }).then(res=>{ | |
105 | + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) | |
106 | + da[ind].replay_list=res.data.data.pageData; | |
107 | + }) | |
85 | 108 | |
86 | 109 | if (em.img != undefined && em.img != null && ut.isString(em.img)) |
87 | 110 | da[ind].img = ut.unserialize(em.img); |
88 | 111 | var str = da[ind].weapp_img; |
89 | 112 | if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); |
90 | 113 | |
91 | - | |
92 | 114 | }); |
93 | 115 | |
94 | 116 | th.setData({ |
... | ... | @@ -107,6 +129,7 @@ Page({ |
107 | 129 | |
108 | 130 | }, |
109 | 131 | onReachBottom: function() { |
132 | + if(a.data.goodsLoadFinishFlag) return false; | |
110 | 133 | a.canloadMore() && this.requestComments(this.data.activeStatus); |
111 | 134 | }, |
112 | 135 | ... | ... |
pages/user/comment/comment.wxml
... | ... | @@ -75,6 +75,17 @@ |
75 | 75 | <image bindtap="previewImg" wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image> |
76 | 76 | |
77 | 77 | </view> |
78 | + | |
79 | + <!-- 商家回复 --> | |
80 | + <view class="reply rel" wx:if="{{item.replay_list}}"> | |
81 | + <view class="line_bulge"></view> | |
82 | + <view class="shop-reply fs26">店家回复: </view> | |
83 | + <view class="shop-font fs24" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}"> | |
84 | + {{r_item.content}} | |
85 | + </view> | |
86 | + </view> | |
87 | + | |
88 | + | |
78 | 89 | <!-- 评价时间 --> |
79 | 90 | <view class="fs24 xc-ash comment_addtime flex-vertical">{{item.comment_addtime}}</view> |
80 | 91 | </view> | ... | ... |
pages/user/comment/comment.wxss
... | ... | @@ -183,4 +183,6 @@ |
183 | 183 | .comment_addtime{ |
184 | 184 | height: 50rpx; |
185 | 185 | } |
186 | -.title_width{ width: 146rpx; text-align:center } | |
187 | 186 | \ No newline at end of file |
187 | +.title_width{ width: 146rpx; text-align:center } | |
188 | +.shop-font{ color: rgb(153, 153, 153);} | |
189 | +.reply{ margin-top: 10rpx} | |
188 | 190 | \ No newline at end of file | ... | ... |