Commit 37b7d03d authored by Junling Bu's avatar Junling Bu
Browse files

fix[litemall-wx]:...

fix[litemall-wx]: 原代码中如果规格没有选择完毕,那么商品页面会出现不完全的规格文本。现在checkedSpecText显示完整的规格文本,而tmpSpecText显示用户点击时部分规格文本。
parent de256ee1
...@@ -18,7 +18,8 @@ Page({ ...@@ -18,7 +18,8 @@ Page({
cartGoodsCount: 0, cartGoodsCount: 0,
userHasCollect: 0, userHasCollect: 0,
number: 1, number: 1,
checkedSpecText: '请选择规格数量', checkedSpecText: '规格数量',
tmpSpecText: '请选择规格数量',
openAttr: false, openAttr: false,
noCollectImage: '/static/images/icon_collect.png', noCollectImage: '/static/images/icon_collect.png',
hasCollectImage: '/static/images/icon_collect_checked.png', hasCollectImage: '/static/images/icon_collect_checked.png',
...@@ -35,7 +36,8 @@ Page({ ...@@ -35,7 +36,8 @@ Page({
if (_specificationList[0].valueList.length == 1) { if (_specificationList[0].valueList.length == 1) {
_specificationList[0].valueList[0].checked = true _specificationList[0].valueList[0].checked = true
that.setData({ that.setData({
checkedSpecText: '已选择:' + _specificationList[0].valueList[0].value checkedSpecText: _specificationList[0].valueList[0].value,
tmpSpecText: '已选择:' + _specificationList[0].valueList[0].value
}); });
} }
} }
...@@ -105,7 +107,7 @@ Page({ ...@@ -105,7 +107,7 @@ Page({
} }
} }
this.setData({ this.setData({
specificationList: _specificationList specificationList: _specificationList,
}); });
//重新计算spec改变后的信息 //重新计算spec改变后的信息
this.changeSpecInfo(); this.changeSpecInfo();
...@@ -132,7 +134,6 @@ Page({ ...@@ -132,7 +134,6 @@ Page({
} }
return checkedValues; return checkedValues;
}, },
//根据已选的值,计算其它值的状态 //根据已选的值,计算其它值的状态
setSpecValueStatus: function () { setSpecValueStatus: function () {
...@@ -168,11 +169,23 @@ Page({ ...@@ -168,11 +169,23 @@ Page({
}); });
if (checkedValue.length > 0) { if (checkedValue.length > 0) {
this.setData({ this.setData({
checkedSpecText: checkedValue.join(' ') tmpSpecText: checkedValue.join(' ')
}); });
} else { } else {
this.setData({ this.setData({
checkedSpecText: '请选择规格数量' tmpSpecText: '请选择规格数量'
});
}
if (this.isCheckedAllSpec()) {
this.setData({
checkedSpecText: this.data.tmpSpecText
});
}
else{
this.setData({
checkedSpecText: '规格数量'
}); });
} }
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<view class="info"> <view class="info">
<view class="c"> <view class="c">
<view class="p">价格:¥{{goods.retailPrice}}</view> <view class="p">价格:¥{{goods.retailPrice}}</view>
<view class="a">{{checkedSpecText}}</view> <view class="a">{{tmpSpecText}}</view>
</view> </view>
</view> </view>
</view> </view>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment