diff --git a/app.js b/app.js
index cb87236b..957901d6 100644
--- a/app.js
+++ b/app.js
@@ -1,7 +1,6 @@
//app.js
App({
onLaunch: function () {
- console.log('test');
var that = this;
// 获取商城名称
wx.request({
@@ -10,7 +9,11 @@ App({
key: 'mallName'
},
success: function(res) {
- wx.setStorageSync('mallName', res.data.data.value);
+ if (res.data.code == 0) {
+ wx.setStorageSync('mallName', res.data.data.value);
+ } else {
+ wx.setStorageSync('mallName', "系统参数 mallName 未设置");
+ }
}
})
this.login();
@@ -88,6 +91,6 @@ App({
globalData:{
userInfo:null,
subDomain: "mall",
- version: "1.4.0"
+ version: "1.5.0"
}
})
diff --git a/pages/goods-details/index.js b/pages/goods-details/index.js
index fea2058c..823a562c 100644
--- a/pages/goods-details/index.js
+++ b/pages/goods-details/index.js
@@ -34,13 +34,11 @@ Page({
})
},
onLoad: function (e) {
- console.log('onLoad');
var that = this;
// 获取购物车数据
wx.getStorage({
key: 'shopCarInfo',
success: function(res) {
- console.log(res.data)
that.setData({
shopCarInfo:res.data,
shopNum:res.data.shopNum
@@ -74,7 +72,7 @@ Page({
WxParse.wxParse('article', 'html', res.data.data.content, that, 5);
}
})
-
+ this.reputation(e.id);
},
goShopCar: function () {
wx.reLaunch({
@@ -394,5 +392,22 @@ Page({
// 转发失败
}
}
+ },
+ reputation: function (goodsId) {
+ var that = this;
+ wx.request({
+ url: 'https://api.it120.cc/' + app.globalData.subDomain + '/shop/goods/reputation',
+ data: {
+ goodsId: goodsId
+ },
+ success: function (res) {
+ if (res.data.code == 0) {
+ console.log(res.data.data);
+ that.setData({
+ reputation: res.data.data
+ });
+ }
+ }
+ })
}
})
diff --git a/pages/goods-details/index.wxml b/pages/goods-details/index.wxml
index 673df9e6..fa8c5104 100644
--- a/pages/goods-details/index.wxml
+++ b/pages/goods-details/index.wxml
@@ -3,7 +3,7 @@
-
+
@@ -17,7 +17,9 @@
{{goodsDetail.basicInfo.name}}
- ¥ {{selectSizePrice}}
+ ¥ {{selectSizePrice}}
+ 购买{{goodsDetail.basicInfo.numberOrders}}次
+ 共收到 {{goodsDetail.basicInfo.numberGoodReputation}} 次好评
{{selectSize}}
@@ -28,6 +30,19 @@
+
+ 大家评价({{reputation.length}})
+
+
+
+ {{item.goods.goodReputationStr}}
+
+
+ {{item.goods.goodReputationRemark}}
+ {{item.goods.dateReputation}} {{item.goods.property}}
+
+
+
\ No newline at end of file
diff --git a/pages/order-list/index.js b/pages/order-list/index.js
index f429be97..22b5f59a 100644
--- a/pages/order-list/index.js
+++ b/pages/order-list/index.js
@@ -2,15 +2,15 @@ var wxpay = require('../../utils/pay.js')
var app = getApp()
Page({
data:{
- statusType:["全部","待付款","待发货","待收货","已完成"],
- currentTpye:0,
+ statusType: ["待付款", "待发货", "待收货", "待评价", "已完成"],
+ currentType:0,
tabClass: ["", "", "", "", ""]
},
statusTap:function(e){
var curType = e.currentTarget.dataset.index;
- this.data.currentTpye = curType
+ this.data.currentType = curType
this.setData({
- currentTpye:curType
+ currentType:curType
});
this.onShow();
},
@@ -69,16 +69,29 @@ Page({
if (res.data.code == 0) {
var tabClass = that.data.tabClass;
if (res.data.data.count_id_no_pay > 0) {
- tabClass[1] = "red-dot"
+ tabClass[0] = "red-dot"
+ } else {
+ tabClass[0] = ""
}
if (res.data.data.count_id_no_transfer > 0) {
- tabClass[2] = "red-dot"
+ tabClass[1] = "red-dot"
+ } else {
+ tabClass[1] = ""
}
if (res.data.data.count_id_no_confirm > 0) {
+ tabClass[2] = "red-dot"
+ } else {
+ tabClass[2] = ""
+ }
+ if (res.data.data.count_id_no_reputation > 0) {
tabClass[3] = "red-dot"
+ } else {
+ tabClass[3] = ""
}
if (res.data.data.count_id_success > 0) {
- tabClass[4] = "red-dot"
+ //tabClass[4] = "red-dot"
+ } else {
+ //tabClass[4] = ""
}
that.setData({
@@ -95,18 +108,7 @@ Page({
var postData = {
token: app.globalData.token
};
- if (that.data.currentTpye == 1) {
- postData.status = 0
- }
- if (that.data.currentTpye == 2) {
- postData.status = 1
- }
- if (that.data.currentTpye == 3) {
- postData.status = 2
- }
- if (that.data.currentTpye == 4) {
- postData.status = 4
- }
+ postData.status = that.data.currentType;
this.getOrderStatistics();
wx.request({
url: 'https://api.it120.cc/' + app.globalData.subDomain + '/order/list',
diff --git a/pages/order-list/index.wxml b/pages/order-list/index.wxml
index ebb08761..72267248 100644
--- a/pages/order-list/index.wxml
+++ b/pages/order-list/index.wxml
@@ -1,8 +1,8 @@
-
+
{{item}}
-
+
diff --git a/wxParse/wxParse.js b/wxParse/wxParse.js
index 379f2f6c..498990c8 100755
--- a/wxParse/wxParse.js
+++ b/wxParse/wxParse.js
@@ -33,12 +33,12 @@ function wxParse(bindName = 'wxParseData', type='html', data='