Commit cae5b07f3785ed6cdb745d6c70b0cd02e11e3f5d
1 parent
8f4d6a17
评价列表
Showing
3 changed files
with
49 additions
and
49 deletions
pages/user/comment/comment.js
1 | -var ut= require("../../../utils/util.js"); | 1 | +var ut = require("../../../utils/util.js"); |
2 | var t = function(t) { | 2 | var t = function(t) { |
3 | return t && t.__esModule ? t : { | 3 | return t && t.__esModule ? t : { |
4 | default: t | 4 | default: t |
@@ -29,7 +29,7 @@ Page({ | @@ -29,7 +29,7 @@ Page({ | ||
29 | activeStatus: 0, | 29 | activeStatus: 0, |
30 | comments: null, | 30 | comments: null, |
31 | currentPage: 1, | 31 | currentPage: 1, |
32 | - isloaded:0, | 32 | + isloaded: 0, |
33 | }, | 33 | }, |
34 | onLoad: function(t) { | 34 | onLoad: function(t) { |
35 | var e = void 0 === t.status ? this.data.activeStatus : t.status; | 35 | var e = void 0 === t.status ? this.data.activeStatus : t.status; |
@@ -41,8 +41,8 @@ Page({ | @@ -41,8 +41,8 @@ Page({ | ||
41 | }, | 41 | }, |
42 | changeTab: function(t) { | 42 | changeTab: function(t) { |
43 | var e = this; | 43 | var e = this; |
44 | - if (this.data.activeStatus==t.currentTarget.dataset.status) | ||
45 | - return false; | 44 | + if (this.data.activeStatus == t.currentTarget.dataset.status) |
45 | + return false; | ||
46 | this.resetData(), this.requestComments(t.currentTarget.dataset.status); | 46 | this.resetData(), this.requestComments(t.currentTarget.dataset.status); |
47 | }, | 47 | }, |
48 | requestComments: function(t) { | 48 | requestComments: function(t) { |
@@ -54,23 +54,20 @@ Page({ | @@ -54,23 +54,20 @@ Page({ | ||
54 | }); | 54 | }); |
55 | if (t == 2) { | 55 | if (t == 2) { |
56 | a.request(n, function(t) { | 56 | a.request(n, function(t) { |
57 | - | ||
58 | - console.log("111111111111111111111111111111111111111"); | ||
59 | - console.log(t); | ||
60 | - | ||
61 | e.data.currentPage++; | 57 | e.data.currentPage++; |
62 | var da = th.data.comments; | 58 | var da = th.data.comments; |
63 | - da.forEach(function(em, ind) { | ||
64 | - | ||
65 | - if (em.img != undefined && em.img != null && ut.isString(em.img)) | ||
66 | - da[ind].img = ut.unserialize(em.img); | ||
67 | - var str = da[ind].weapp_img; | 59 | + da.forEach(function(em, ind) { |
60 | + | ||
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; | ||
68 | if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); | 64 | if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); |
69 | - | 65 | + |
70 | }) | 66 | }) |
71 | 67 | ||
72 | th.setData({ | 68 | th.setData({ |
73 | - comments: da, isloaded: 1, | 69 | + comments: da, |
70 | + isloaded: 1, | ||
74 | }) | 71 | }) |
75 | 72 | ||
76 | 73 | ||
@@ -81,23 +78,22 @@ Page({ | @@ -81,23 +78,22 @@ Page({ | ||
81 | wx.stopPullDownRefresh(); | 78 | wx.stopPullDownRefresh(); |
82 | } else { | 79 | } else { |
83 | a.request(n, function(t) { | 80 | a.request(n, function(t) { |
84 | - | ||
85 | - console.log("222222222222222222222222222222"); | ||
86 | e.data.currentPage++; | 81 | e.data.currentPage++; |
87 | var da = th.data.comments; | 82 | var da = th.data.comments; |
88 | - | ||
89 | - da.forEach(function(em, ind) { | ||
90 | - | 83 | + |
84 | + da.forEach(function(em, ind) { | ||
85 | + | ||
91 | if (em.img != undefined && em.img != null && ut.isString(em.img)) | 86 | if (em.img != undefined && em.img != null && ut.isString(em.img)) |
92 | - da[ind].img = ut.unserialize(em.img); | ||
93 | - var str = da[ind].weapp_img; | ||
94 | - if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); | ||
95 | - | ||
96 | - | 87 | + da[ind].img = ut.unserialize(em.img); |
88 | + var str = da[ind].weapp_img; | ||
89 | + if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str); | ||
90 | + | ||
91 | + | ||
97 | }); | 92 | }); |
98 | 93 | ||
99 | th.setData({ | 94 | th.setData({ |
100 | - comments: da, isloaded:1, | 95 | + comments: da, |
96 | + isloaded: 1, | ||
101 | }) | 97 | }) |
102 | 98 | ||
103 | 99 | ||
@@ -124,7 +120,7 @@ Page({ | @@ -124,7 +120,7 @@ Page({ | ||
124 | /*-----评论-----*/ | 120 | /*-----评论-----*/ |
125 | comment: function(t) { | 121 | comment: function(t) { |
126 | for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++); | 122 | for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++); |
127 | - if (!(s >= a.length)) { | 123 | + if (!(s >= a.length)) { |
128 | var n = "?order_id=" + a[s].order_id; | 124 | var n = "?order_id=" + a[s].order_id; |
129 | n += "&goods_id=" + a[s].goods_id, n += "&goods_name=" + a[s].goods_name, n += "&price=" + a[s].goods_price, | 125 | n += "&goods_id=" + a[s].goods_id, n += "&goods_name=" + a[s].goods_name, n += "&price=" + a[s].goods_price, |
130 | n += "&img=" + a[s].original_img, | 126 | n += "&img=" + a[s].original_img, |
@@ -138,21 +134,29 @@ Page({ | @@ -138,21 +134,29 @@ Page({ | ||
138 | bind_bnerr2: function(e) { | 134 | bind_bnerr2: function(e) { |
139 | var _errImg = e.currentTarget.dataset.errorimg; | 135 | var _errImg = e.currentTarget.dataset.errorimg; |
140 | var _errObj = {}; | 136 | var _errObj = {}; |
141 | - _errObj[_errImg] = os.imghost+ "/public/images/default_goods_image_240.gif"; | 137 | + _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif"; |
142 | //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 138 | //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
143 | }, | 139 | }, |
144 | //预览图片 | 140 | //预览图片 |
145 | - previewImg: function (e) { | ||
146 | - console.log(e.currentTarget.dataset.index); | 141 | + previewImg: function(e) { |
147 | var index = e.currentTarget.dataset.index; | 142 | var index = e.currentTarget.dataset.index; |
148 | - var imgArr = this.data.imgArr; | 143 | + var sindex = e.currentTarget.dataset.sindex; |
144 | + var name = e.currentTarget.dataset.name; | ||
145 | + var imgArr = this.data.comments; | ||
146 | + var image = null; | ||
147 | + if (name == "img") { | ||
148 | + image = imgArr[index].img[sindex]; | ||
149 | + } else { | ||
150 | + image = imgArr[index].weapp_img[sindex]; | ||
151 | + } | ||
149 | wx.previewImage({ | 152 | wx.previewImage({ |
150 | - current: imgArr[index], //当前图片地址 | ||
151 | - urls: imgArr, //所有要预览的图片的地址集合 数组形式 | 153 | + current: image, |
154 | + //当前图片地址 | ||
155 | + urls: imgArr[index].weapp_img, //所有要预览的图片的地址集合 数组形式 | ||
152 | }) | 156 | }) |
153 | }, | 157 | }, |
154 | //跳到首页 | 158 | //跳到首页 |
155 | - goto: function (ee) { | 159 | + goto: function(ee) { |
156 | wx.switchTab({ | 160 | wx.switchTab({ |
157 | url: '/pages/index/index/index', | 161 | url: '/pages/index/index/index', |
158 | }) | 162 | }) |
pages/user/comment/comment.wxml
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}"> | 23 | <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}"> |
24 | 24 | ||
25 | <!-- 商品编号和状态 --> | 25 | <!-- 商品编号和状态 --> |
26 | - <view class="Commodity_number flex-vertical-between fs20 padding border_bottom"> | 26 | + <view class="Commodity_number flex-vertical-between fs26 padding border_bottom"> |
27 | <!--商品编号 --> | 27 | <!--商品编号 --> |
28 | <view>订单编号:{{item.order_sn}}</view> | 28 | <view>订单编号:{{item.order_sn}}</view> |
29 | <!-- 商品评价状态 --> | 29 | <!-- 商品评价状态 --> |
@@ -52,16 +52,16 @@ | @@ -52,16 +52,16 @@ | ||
52 | <!-- 商品价格 --> | 52 | <!-- 商品价格 --> |
53 | <view class="flex-vertical xc-wc baseline"> | 53 | <view class="flex-vertical xc-wc baseline"> |
54 | <view class="fs20">¥</view> | 54 | <view class="fs20">¥</view> |
55 | - <view class="fs28">{{filter.toFix(item.goods_price,2)}}</view> | 55 | + <view class="fs30">{{filter.toFix(item.goods_price,2)}}</view> |
56 | </view> | 56 | </view> |
57 | - <view class="fs20">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 | </view> |
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 | <!-- 评价星级 --> |
64 | - <view class="starss flex fs24"> | 64 | + <view class="starss flex fs26"> |
65 | <view class="commen">评价:</view> | 65 | <view class="commen">评价:</view> |
66 | <view class="stars"> | 66 | <view class="stars"> |
67 | <image | 67 | <image |
@@ -69,10 +69,10 @@ | @@ -69,10 +69,10 @@ | ||
69 | </view> | 69 | </view> |
70 | </view> | 70 | </view> |
71 | <!-- 评价内容 --> | 71 | <!-- 评价内容 --> |
72 | - <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论,那么他为什么不评价呢,为什么不评价呢,为什么呢,我也不知道,你自己去问,去吧我也不知道,去吧,去吧'}}</view> | 72 | + <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论'}}</view> |
73 | <view class="Comment_images flex"> | 73 | <view class="Comment_images flex"> |
74 | - <image wx:if="{{item.source_type==0 && aitem.length>10}}" data-d="{{aitem}}" src="{{aitem}}" wx:for="{{item.img}}" wx:for-item="aitem"></image> | ||
75 | - <image wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{aitem}}" data-d="{{aitem}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem"></image> | 74 | + <image bindtap="previewImg" wx:if="{{item.source_type==0 && aitem.length>10}}" data-index="{{index}}" src="{{aitem}}" wx:for="{{item.img}}" wx:for-item="aitem" wx:for-index="i" data-sindex="{{i}}" data-name="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 | <!-- 评价时间 --> | 78 | <!-- 评价时间 --> |
@@ -102,10 +102,6 @@ | @@ -102,10 +102,6 @@ | ||
102 | 102 | ||
103 | </view> | 103 | </view> |
104 | 104 | ||
105 | - | ||
106 | - | ||
107 | - | ||
108 | - | ||
109 | </view> | 105 | </view> |
110 | 106 | ||
111 | 107 |
pages/user/comment/comment.wxss
@@ -146,7 +146,6 @@ | @@ -146,7 +146,6 @@ | ||
146 | } | 146 | } |
147 | 147 | ||
148 | .Commodity_evaluation .Comment_content { | 148 | .Commodity_evaluation .Comment_content { |
149 | - text-indent: 2em; | ||
150 | color: rgb(153, 153, 153); | 149 | color: rgb(153, 153, 153); |
151 | letter-spacing: 1rpx; | 150 | letter-spacing: 1rpx; |
152 | } | 151 | } |
@@ -169,11 +168,12 @@ | @@ -169,11 +168,12 @@ | ||
169 | } | 168 | } |
170 | 169 | ||
171 | .Commodity_evaluation .Comment_images image { | 170 | .Commodity_evaluation .Comment_images image { |
172 | - width: 93rpx; | ||
173 | - height: 93rpx; | 171 | + width: 100rpx; |
172 | + height: 100rpx; | ||
174 | margin-right: 8rpx; | 173 | margin-right: 8rpx; |
175 | margin-top: 18rpx; | 174 | margin-top: 18rpx; |
176 | - border-radius: 4rpx; | 175 | + border-radius: 6rpx; |
176 | + border: 3rpx solid rgb(245, 245, 245); | ||
177 | } | 177 | } |
178 | .commodity_evaluate .View_evaluation{ | 178 | .commodity_evaluate .View_evaluation{ |
179 | border:2rpx solid rgb(179, 179, 179); | 179 | border:2rpx solid rgb(179, 179, 179); |