Commit 2f0aad02d08c7370dd808183e6a06ece65172320

Authored by yvan.ni
1 parent 4e986993

购物车,商品详情,评价

pages/cart/cart2/cart2.wxss
@@ -201,7 +201,9 @@ @@ -201,7 +201,9 @@
201 .btn-wrap { 201 .btn-wrap {
202 height: 100rpx; width: 100%; 202 height: 100rpx; width: 100%;
203 background-color: #fff; 203 background-color: #fff;
204 - position: fixed; bottom: 0;left: 0 204 + position: fixed; bottom: 0;left: 0;
  205 + border-top:1rpx solid #dee
  206 +
205 } 207 }
206 208
207 .tips-btn { 209 .tips-btn {
pages/goods/goodsInfo/goodsInfo.js
@@ -377,7 +377,8 @@ Page({ @@ -377,7 +377,8 @@ Page({
377 goods_id: gid, 377 goods_id: gid,
378 pageSize: 3, 378 pageSize: 3,
379 parent_id: 0, 379 parent_id: 0,
380 - page:1 380 + page:1,
  381 + is_show:1,
381 }, 382 },
382 }).then(res => { 383 }).then(res => {
383 fir_com=res.data.data.pageData; 384 fir_com=res.data.data.pageData;
@@ -1343,6 +1344,7 @@ Page({ @@ -1343,6 +1344,7 @@ Page({
1343 parent_id: 0, 1344 parent_id: 0,
1344 goods_id: th.data.gid, 1345 goods_id: th.data.gid,
1345 commenttype: tp, 1346 commenttype: tp,
  1347 + is_show:1,
1346 } 1348 }
1347 if(getApp().globalData.userInfo){ 1349 if(getApp().globalData.userInfo){
1348 req_where.userId=getApp().globalData.userInfo.user_id; 1350 req_where.userId=getApp().globalData.userInfo.user_id;
pages/user/comment/comment.js
@@ -10,6 +10,7 @@ var t = function(t) { @@ -10,6 +10,7 @@ var t = function(t) {
10 s = require("../../../utils/util.js"), 10 s = require("../../../utils/util.js"),
11 oo = e.globalData, 11 oo = e.globalData,
12 os = e.globalData.setting; 12 os = e.globalData.setting;
  13 +var regeneratorRuntime = require('../../../utils/runtime.js');
13 14
14 Page({ 15 Page({
15 data: { 16 data: {
@@ -30,9 +31,12 @@ Page({ @@ -30,9 +31,12 @@ Page({
30 comments: null, 31 comments: null,
31 currentPage: 1, 32 currentPage: 1,
32 isloaded: 0, 33 isloaded: 0,
  34 + order_id:0,
33 }, 35 },
34 onLoad: function(t) { 36 onLoad: function(t) {
35 var e = void 0 === t.status ? this.data.activeStatus : t.status; 37 var e = void 0 === t.status ? this.data.activeStatus : t.status;
  38 + this.data.order_id=t.order_id;
  39 +
36 a.init(this, "", "comments"), this.requestComments(e); 40 a.init(this, "", "comments"), this.requestComments(e);
37 }, 41 },
38 onShow: function() { 42 onShow: function() {
@@ -52,16 +56,26 @@ Page({ @@ -52,16 +56,26 @@ Page({
52 this.setData({ 56 this.setData({
53 activeStatus: t 57 activeStatus: t
54 }); 58 });
  59 +
  60 + if(e.data.order_id) n+="&order_id="+e.data.order_id;
  61 +
55 if (t == 2) { 62 if (t == 2) {
56 a.request(n, function(t) { 63 a.request(n, function(t) {
57 e.data.currentPage++; 64 e.data.currentPage++;
58 var da = th.data.comments; 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,14 +95,22 @@ Page({
81 e.data.currentPage++; 95 e.data.currentPage++;
82 var da = th.data.comments; 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 if (em.img != undefined && em.img != null && ut.isString(em.img)) 109 if (em.img != undefined && em.img != null && ut.isString(em.img))
87 da[ind].img = ut.unserialize(em.img); 110 da[ind].img = ut.unserialize(em.img);
88 var str = da[ind].weapp_img; 111 var str = da[ind].weapp_img;
89 if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); 112 if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str);
90 113
91 -  
92 }); 114 });
93 115
94 th.setData({ 116 th.setData({
@@ -107,6 +129,7 @@ Page({ @@ -107,6 +129,7 @@ Page({
107 129
108 }, 130 },
109 onReachBottom: function() { 131 onReachBottom: function() {
  132 + if(a.data.goodsLoadFinishFlag) return false;
110 a.canloadMore() && this.requestComments(this.data.activeStatus); 133 a.canloadMore() && this.requestComments(this.data.activeStatus);
111 }, 134 },
112 135
pages/user/comment/comment.wxml
@@ -75,6 +75,17 @@ @@ -75,6 +75,17 @@
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> 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 </view> 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 <view class="fs24 xc-ash comment_addtime flex-vertical">{{item.comment_addtime}}</view> 90 <view class="fs24 xc-ash comment_addtime flex-vertical">{{item.comment_addtime}}</view>
80 </view> 91 </view>
pages/user/comment/comment.wxss
@@ -183,4 +183,6 @@ @@ -183,4 +183,6 @@
183 .comment_addtime{ 183 .comment_addtime{
184 height: 50rpx; 184 height: 50rpx;
185 } 185 }
186 -.title_width{ width: 146rpx; text-align:center }  
187 \ No newline at end of file 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 \ No newline at end of file 190 \ No newline at end of file