去除goods_type的样式

This commit is contained in:
shengliang 2019-12-01 14:57:59 +08:00
parent 1a114ff060
commit d55719eec2
4 changed files with 20 additions and 27 deletions

View File

@ -76,8 +76,7 @@ Page({
imageUrl: image
}
},
onUnload: function() {
},
onUnload: function() {},
handleTap: function(event) { //阻止冒泡
},
getGoodsInfo: function() {
@ -89,7 +88,6 @@ Page({
id: that.data.id
}).then(function(res) {
if (res.errno === 0) {
let goods_type = res.data.info.goods_type;
let _specificationList = res.data.specificationList;
// 如果仅仅存在一种货品那么商品页面初始化时默认checked
if (_specificationList.valueList.length == 1) {
@ -392,7 +390,6 @@ Page({
});
return false;
}
let type = that.data.goods.goods_type;
util.request(api.CartAdd, {
addType: 0,
goodsId: this.data.id,
@ -402,11 +399,6 @@ Page({
.then(function(res) {
let _res = res;
if (_res.errno == 0) {
if (type == 2) {
wx.switchTab({
url: '/pages/cart/cart',
});
} else {
wx.showToast({
title: '添加成功',
});
@ -420,8 +412,6 @@ Page({
cartGoodsCount: _res.data.cartTotal.goodsCount
});
}
}
} else {
wx.showToast({
image: '/images/icon/icon_error.png',
@ -477,7 +467,6 @@ Page({
});
return false;
}
let type = that.data.goods.goods_type;
//添加到购物车
util.request(api.CartAdd, {
addType: 1, // 0正常加入购物车1:立即购买2:再来一单

View File

@ -91,11 +91,8 @@
<view class="spec-con">
<view class='spec-item'>
<view class='name'>{{specificationList.name}}</view>
<view wx:if="{{goods.goods_type == 2}}" class="values">
<view class="value {{item.checked ? 'selected' : ''}}" wx:for="{{specificationList.valueList}}" wx:key="{{item.id}}" data-value-id="{{item.id}}" data-name-id="{{item.specification_id}}">{{item.value}}</view>
</view>
<view wx:else class="values">
<view class="value {{item.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{specificationList.valueList}}" wx:key="{{item.id}}" data-value-id="{{item.id}}" data-index="{{index}}" data-name-id="{{item.specification_id}}">{{item.value}}</view>
<view class="values">
<view class="value {{item.checked ? 'selected' : ''}} {{item.goods_number <=0?'out-stock':''}}" bindtap="{{item.goods_number <=0?'':'clickSkuValue'}}" wx:for="{{specificationList.valueList}}" wx:key="{{item.id}}" data-value-id="{{item.id}}" data-index="{{index}}" data-name-id="{{item.specification_id}}">{{item.value}}</view>
</view>
</view>
<view class="number-item">

View File

@ -835,6 +835,13 @@
color: #ff3456;
}
.spec-con .value.out-stock {
border: 1px solid #a3a3a3;
color: #696969;
background: #dbdbdb;
}
.number-item .selnum {
width: 280rpx;
height: 62rpx;

View File

@ -199,7 +199,7 @@
.catalog-wrap .icon-navi {
width: 100rpx;
height: 160rpx;
/* height: 160rpx; */
display: flex;
flex-direction: column;
align-items: center;