From cae5b07f3785ed6cdb745d6c70b0cd02e11e3f5d Mon Sep 17 00:00:00 2001
From: yvan.ni <765199919@qq.com>
Date: Wed, 25 Sep 2019 18:07:24 +0800
Subject: [PATCH] 评价列表
---
pages/user/comment/comment.js | 72 ++++++++++++++++++++++++++++++++++++++----------------------------------
pages/user/comment/comment.wxml | 18 +++++++-----------
pages/user/comment/comment.wxss | 8 ++++----
3 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/pages/user/comment/comment.js b/pages/user/comment/comment.js
index b7dac5c..1c9e378 100644
--- a/pages/user/comment/comment.js
+++ b/pages/user/comment/comment.js
@@ -1,4 +1,4 @@
-var ut= require("../../../utils/util.js");
+var ut = require("../../../utils/util.js");
var t = function(t) {
return t && t.__esModule ? t : {
default: t
@@ -29,7 +29,7 @@ Page({
activeStatus: 0,
comments: null,
currentPage: 1,
- isloaded:0,
+ isloaded: 0,
},
onLoad: function(t) {
var e = void 0 === t.status ? this.data.activeStatus : t.status;
@@ -41,8 +41,8 @@ Page({
},
changeTab: function(t) {
var e = this;
- if (this.data.activeStatus==t.currentTarget.dataset.status)
- return false;
+ if (this.data.activeStatus == t.currentTarget.dataset.status)
+ return false;
this.resetData(), this.requestComments(t.currentTarget.dataset.status);
},
requestComments: function(t) {
@@ -54,23 +54,20 @@ Page({
});
if (t == 2) {
a.request(n, function(t) {
-
- console.log("111111111111111111111111111111111111111");
- console.log(t);
-
e.data.currentPage++;
var da = th.data.comments;
- da.forEach(function(em, ind) {
-
- if (em.img != undefined && em.img != null && ut.isString(em.img))
- da[ind].img = ut.unserialize(em.img);
- var str = da[ind].weapp_img;
+ da.forEach(function(em, ind) {
+
+ if (em.img != undefined && em.img != null && ut.isString(em.img))
+ da[ind].img = ut.unserialize(em.img);
+ var str = da[ind].weapp_img;
if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str);
-
+
})
th.setData({
- comments: da, isloaded: 1,
+ comments: da,
+ isloaded: 1,
})
@@ -81,23 +78,22 @@ Page({
wx.stopPullDownRefresh();
} else {
a.request(n, function(t) {
-
- console.log("222222222222222222222222222222");
e.data.currentPage++;
var da = th.data.comments;
-
- da.forEach(function(em, ind) {
-
+
+ da.forEach(function(em, ind) {
+
if (em.img != undefined && em.img != null && ut.isString(em.img))
- da[ind].img = ut.unserialize(em.img);
- var str = da[ind].weapp_img;
- if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str);
-
-
+ da[ind].img = ut.unserialize(em.img);
+ var str = da[ind].weapp_img;
+ if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str);
+
+
});
th.setData({
- comments: da, isloaded:1,
+ comments: da,
+ isloaded: 1,
})
@@ -124,7 +120,7 @@ Page({
/*-----评论-----*/
comment: function(t) {
for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++);
- if (!(s >= a.length)) {
+ if (!(s >= a.length)) {
var n = "?order_id=" + a[s].order_id;
n += "&goods_id=" + a[s].goods_id, n += "&goods_name=" + a[s].goods_name, n += "&price=" + a[s].goods_price,
n += "&img=" + a[s].original_img,
@@ -138,21 +134,29 @@ Page({
bind_bnerr2: function(e) {
var _errImg = e.currentTarget.dataset.errorimg;
var _errObj = {};
- _errObj[_errImg] = os.imghost+ "/public/images/default_goods_image_240.gif";
+ _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif";
//this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
},
//预览图片
- previewImg: function (e) {
- console.log(e.currentTarget.dataset.index);
+ previewImg: function(e) {
var index = e.currentTarget.dataset.index;
- var imgArr = this.data.imgArr;
+ var sindex = e.currentTarget.dataset.sindex;
+ var name = e.currentTarget.dataset.name;
+ var imgArr = this.data.comments;
+ var image = null;
+ if (name == "img") {
+ image = imgArr[index].img[sindex];
+ } else {
+ image = imgArr[index].weapp_img[sindex];
+ }
wx.previewImage({
- current: imgArr[index], //当前图片地址
- urls: imgArr, //所有要预览的图片的地址集合 数组形式
+ current: image,
+ //当前图片地址
+ urls: imgArr[index].weapp_img, //所有要预览的图片的地址集合 数组形式
})
},
//跳到首页
- goto: function (ee) {
+ goto: function(ee) {
wx.switchTab({
url: '/pages/index/index/index',
})
diff --git a/pages/user/comment/comment.wxml b/pages/user/comment/comment.wxml
index 270cd12..9024494 100644
--- a/pages/user/comment/comment.wxml
+++ b/pages/user/comment/comment.wxml
@@ -23,7 +23,7 @@
-
+
订单编号:{{item.order_sn}}
@@ -52,16 +52,16 @@
¥
- {{filter.toFix(item.goods_price,2)}}
+ {{filter.toFix(item.goods_price,2)}}
- x{{item.goods_num}}
+ x{{item.goods_num}}
-
diff --git a/pages/user/comment/comment.wxss b/pages/user/comment/comment.wxss
index 86b41e6..a35e598 100644
--- a/pages/user/comment/comment.wxss
+++ b/pages/user/comment/comment.wxss
@@ -146,7 +146,6 @@
}
.Commodity_evaluation .Comment_content {
- text-indent: 2em;
color: rgb(153, 153, 153);
letter-spacing: 1rpx;
}
@@ -169,11 +168,12 @@
}
.Commodity_evaluation .Comment_images image {
- width: 93rpx;
- height: 93rpx;
+ width: 100rpx;
+ height: 100rpx;
margin-right: 8rpx;
margin-top: 18rpx;
- border-radius: 4rpx;
+ border-radius: 6rpx;
+ border: 3rpx solid rgb(245, 245, 245);
}
.commodity_evaluate .View_evaluation{
border:2rpx solid rgb(179, 179, 179);
--
libgit2 0.21.4