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 @@