From f96397903fbb36735bca8d88a7d655302cfe7eb7 Mon Sep 17 00:00:00 2001 From: usgeek <940208412@qq.com> Date: Thu, 19 Jul 2018 02:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8A=A0=E5=85=A5=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litemall-wx/pages/goods/goods.js | 52 +- litemall-wx/pages/goods/goods.wxml | 199 ++--- litemall-wx/pages/goods/goods.wxss | 1090 +++++++++++++++------------- 3 files changed, 715 insertions(+), 626 deletions(-) diff --git a/litemall-wx/pages/goods/goods.js b/litemall-wx/pages/goods/goods.js index e4fa61ce..8db99aad 100644 --- a/litemall-wx/pages/goods/goods.js +++ b/litemall-wx/pages/goods/goods.js @@ -42,7 +42,7 @@ Page({ // 这里检测一下 let _productPrice = res.data.productList[0].price; let _goodsPrice = res.data.info.retailPrice; - if (_productPrice != _goodsPrice){ + if (_productPrice != _goodsPrice) { console.error('商品数量价格和货品不一致'); } @@ -206,21 +206,21 @@ Page({ } let checkedProduct = checkedProductArray[0]; - if (checkedProduct.number > 0){ + if (checkedProduct.number > 0) { this.setData({ checkedSpecPrice: checkedProduct.price, soldout: false }); } - else{ + else { this.setData({ checkedSpecPrice: this.data.goods.retailPrice, soldout: true - }); + }); } - + } - else{ + else { this.setData({ checkedSpecText: '规格数量选择', checkedSpecPrice: this.data.goods.retailPrice, @@ -276,28 +276,33 @@ Page({ }); } }, - closeAttrOrCollect: function () { + closeAttr: function () { + this.setData({ + openAttr: false, + }); + }, + addCollectOrNot: function () { let that = this; - if (this.data.openAttr) { - this.setData({ - openAttr: false, - }); - if (that.data.userHasCollect == 1) { - that.setData({ - collectBackImage: that.data.hasCollectImage - }); - } else { - that.setData({ - collectBackImage: that.data.noCollectImage - }); - } - } else { + // if (this.data.openAttr) { + // this.setData({ + // openAttr: false, + // }); + // if (that.data.userHasCollect == 1) { + // that.setData({ + // collectBackImage: that.data.hasCollectImage + // }); + // } else { + // that.setData({ + // collectBackImage: that.data.noCollectImage + // }); + // } + // } else { //添加或是取消收藏 util.request(api.CollectAddOrDelete, { type: 0, valueId: this.data.id }, "POST") .then(function (res) { let _res = res; if (_res.errno == 0) { - if ( _res.data.type == 'add') { + if (_res.data.type == 'add') { that.setData({ collectBackImage: that.data.hasCollectImage }); @@ -316,7 +321,6 @@ Page({ } }); - } }, openCartPage: function () { @@ -394,7 +398,7 @@ Page({ //打开规格选择窗口 this.setData({ openAttr: !this.data.openAttr, - collectBackImage: '/static/images/detail_back.png' + // collectBackImage: '/static/images/detail_back.png' }); } else { diff --git a/litemall-wx/pages/goods/goods.wxml b/litemall-wx/pages/goods/goods.wxml index 69728868..940bad35 100644 --- a/litemall-wx/pages/goods/goods.wxml +++ b/litemall-wx/pages/goods/goods.wxml @@ -1,112 +1,117 @@ - - - - - - - - - 30天无忧退货 - 48小时快速退款 - 满88元免邮费 - - - - {{goods.name}} - {{goods.goodsBrief}} - ¥{{checkedSpecPrice}} - - - {{brand.name}} - - - - - - {{checkedSpecText}} - - - - - - 评价({{comment.count > 999 ? '999+' : comment.count}}) - 查看全部 + + + + + + + + 30天无忧退货 + 48小时快速退款 + 满88元免邮费 + + + + {{goods.name}} + {{goods.goodsBrief}} + ¥{{checkedSpecPrice}} + + + {{brand.name}} - - - - - - {{item.nickname}} - - {{item.addTime}} - - - {{item.content}} - - - + + + + {{checkedSpecText}} + + + + + + 评价({{comment.count > 999 ? '999+' : comment.count}}) + 查看全部 + + + + + + + + {{item.nickname}} + {{item.addTime}} - - - - 商品参数 - - - {{item.attribute}} - {{item.value}} + + {{item.content}} - - - - - -