Commit c98bdc6f authored by Junling Bu's avatar Junling Bu
Browse files

update[litemall-wx]: 商品没有货时,显示“商品已售空”。

parent fca65981
...@@ -24,7 +24,8 @@ Page({ ...@@ -24,7 +24,8 @@ Page({
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',
collectBackImage: '/static/images/icon_collect.png' collectBackImage: '/static/images/icon_collect.png',
soldout: false
}, },
getGoodsInfo: function () { getGoodsInfo: function () {
let that = this; let that = this;
...@@ -197,6 +198,9 @@ Page({ ...@@ -197,6 +198,9 @@ Page({
// 规格所对应的货品选择以后 // 规格所对应的货品选择以后
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey()); let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
if (!checkedProductArray || checkedProductArray.length <= 0) { if (!checkedProductArray || checkedProductArray.length <= 0) {
this.setData({
soldout: true
});
console.error('规格所对应货品不存在'); console.error('规格所对应货品不存在');
return; return;
} }
...@@ -204,21 +208,23 @@ Page({ ...@@ -204,21 +208,23 @@ Page({
let checkedProduct = checkedProductArray[0]; let checkedProduct = checkedProductArray[0];
if (checkedProduct.goodsNumber > 0){ if (checkedProduct.goodsNumber > 0){
this.setData({ this.setData({
checkedSpecPrice: checkedProduct.retailPrice checkedSpecPrice: checkedProduct.retailPrice,
soldout: false
}); });
} }
else{ else{
this.setData({ this.setData({
checkedSpecPrice: this.data.goods.retailPrice checkedSpecPrice: this.data.goods.retailPrice,
soldout: true
}); });
} }
} }
else{ else{
this.setData({ this.setData({
checkedSpecText: '规格数量选择', checkedSpecText: '规格数量选择',
checkedSpecPrice: this.data.goods.retailPrice checkedSpecPrice: this.data.goods.retailPrice,
soldout: false
}); });
} }
......
...@@ -138,10 +138,10 @@ ...@@ -138,10 +138,10 @@
<view class="box"> <view class="box">
<text class="cart-count">{{cartGoodsCount}}</text> <text class="cart-count">{{cartGoodsCount}}</text>
<image bindtap="openCartPage" class="icon" src="/static/images/ic_menu_shoping_nor.png"></image> <image bindtap="openCartPage" class="icon" src="/static/images/ic_menu_shoping_nor.png"></image>
</view> </view>
</view> </view>
<view class="c" bindtap="addFast">立即购买</view> <view class="c" bindtap="addFast" wx:if="{{!soldout}}">立即购买</view>
<view class="r" bindtap="addToCart">加入购物车</view> <view class="r" bindtap="addToCart" wx:if="{{!soldout}}">加入购物车</view>
<view class="n" wx:if="{{soldout}}">商品已售空</view>
</view> </view>
</scroll-view> </scroll-view>
\ No newline at end of file
...@@ -590,6 +590,17 @@ ...@@ -590,6 +590,17 @@
text-align: center; text-align: center;
color: #fff; color: #fff;
} }
.bottom-btn .n{
border:1px solid #f4f4f4;
background: #f4f4f4;
float: left;
height: 100rpx;
line-height: 96rpx;
flex: 1;
text-align: center;
}
@import "../../lib/wxParse/wxParse.wxss"; @import "../../lib/wxParse/wxParse.wxss";
.attr-pop{ .attr-pop{
......
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