Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
c98bdc6f
Commit
c98bdc6f
authored
Apr 12, 2018
by
Junling Bu
Browse files
update[litemall-wx]: 商品没有货时,显示“商品已售空”。
parent
fca65981
Changes
3
Hide whitespace changes
Inline
Side-by-side
litemall-wx/pages/goods/goods.js
View file @
c98bdc6f
...
...
@@ -24,7 +24,8 @@ Page({
openAttr
:
false
,
noCollectImage
:
'
/static/images/icon_collect.png
'
,
hasCollectImage
:
'
/static/images/icon_collect_checked.png
'
,
collectBackImage
:
'
/static/images/icon_collect.png
'
collectBackImage
:
'
/static/images/icon_collect.png
'
,
soldout
:
false
},
getGoodsInfo
:
function
()
{
let
that
=
this
;
...
...
@@ -197,6 +198,9 @@ Page({
// 规格所对应的货品选择以后
let
checkedProductArray
=
this
.
getCheckedProductItem
(
this
.
getCheckedSpecKey
());
if
(
!
checkedProductArray
||
checkedProductArray
.
length
<=
0
)
{
this
.
setData
({
soldout
:
true
});
console
.
error
(
'
规格所对应货品不存在
'
);
return
;
}
...
...
@@ -204,21 +208,23 @@ Page({
let
checkedProduct
=
checkedProductArray
[
0
];
if
(
checkedProduct
.
goodsNumber
>
0
){
this
.
setData
({
checkedSpecPrice
:
checkedProduct
.
retailPrice
checkedSpecPrice
:
checkedProduct
.
retailPrice
,
soldout
:
false
});
}
else
{
this
.
setData
({
checkedSpecPrice
:
this
.
data
.
goods
.
retailPrice
checkedSpecPrice
:
this
.
data
.
goods
.
retailPrice
,
soldout
:
true
});
}
}
else
{
this
.
setData
({
checkedSpecText
:
'
规格数量选择
'
,
checkedSpecPrice
:
this
.
data
.
goods
.
retailPrice
checkedSpecPrice
:
this
.
data
.
goods
.
retailPrice
,
soldout
:
false
});
}
...
...
litemall-wx/pages/goods/goods.wxml
View file @
c98bdc6f
...
...
@@ -138,10 +138,10 @@
<view class="box">
<text class="cart-count">{{cartGoodsCount}}</text>
<image bindtap="openCartPage" class="icon" src="/static/images/ic_menu_shoping_nor.png"></image>
</view>
</view>
<view class="c" bindtap="addFast">立即购买</view>
<view class="r" bindtap="addToCart">加入购物车</view>
<view class="c" bindtap="addFast" wx:if="{{!soldout}}">立即购买</view>
<view class="r" bindtap="addToCart" wx:if="{{!soldout}}">加入购物车</view>
<view class="n" wx:if="{{soldout}}">商品已售空</view>
</view>
</scroll-view>
\ No newline at end of file
litemall-wx/pages/goods/goods.wxss
View file @
c98bdc6f
...
...
@@ -590,6 +590,17 @@
text-align: center;
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";
.attr-pop{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment