商品数量调整
This commit is contained in:
@@ -285,7 +285,7 @@
|
|||||||
@click="shopAdd(specifications,specifications.indexa,specifications.indexb,'-',specifications.tagSnap == null ? '单规格':'')">
|
@click="shopAdd(specifications,specifications.indexa,specifications.indexb,'-',specifications.tagSnap == null ? '单规格':'')">
|
||||||
<u-icon name="minus-circle-fill" color="#E9AB7A" size="40"></u-icon>
|
<u-icon name="minus-circle-fill" color="#E9AB7A" size="40"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<text class="num">{{amountcartNumber}}</text>
|
<text class="num">{{specifications.cartNumber}}</text>
|
||||||
<view class="btn"
|
<view class="btn"
|
||||||
@click="shopAdd(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')">
|
@click="shopAdd(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')">
|
||||||
<u-icon name="plus-circle-fill" color="#E9AB7A" size="40"></u-icon>
|
<u-icon name="plus-circle-fill" color="#E9AB7A" size="40"></u-icon>
|
||||||
@@ -295,7 +295,7 @@
|
|||||||
<view class="shop_skuselect flex-start" v-if="specifications.tagSnap">
|
<view class="shop_skuselect flex-start" v-if="specifications.tagSnap">
|
||||||
<view class="shop_skuselectname">{{skuidname.toString()}}</view>
|
<view class="shop_skuselectname">{{skuidname.toString()}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="addShopping" :class="amountcartNumber>0?'active':''" @click="addShopping(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')">添加到购物车</view>
|
<view class="addShopping" :class="specifications.cartNumber>0?'active':''" @click="addShopping(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')">添加到购物车</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@@ -512,10 +512,10 @@
|
|||||||
*/
|
*/
|
||||||
shopAdd (item, index, index1, a, b) {
|
shopAdd (item, index, index1, a, b) {
|
||||||
if ( a == "+" ){
|
if ( a == "+" ){
|
||||||
this.amountcartNumber++;
|
item.cartNumber++;
|
||||||
} else {
|
} else {
|
||||||
if ( this.amountcartNumber > 0 ) {
|
if ( item.cartNumber > 0 ) {
|
||||||
this.amountcartNumber--
|
item.cartNumber--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -524,12 +524,12 @@
|
|||||||
* 添加购物车
|
* 添加购物车
|
||||||
*/
|
*/
|
||||||
addShopping ( item, index, index1, a, b ) {
|
addShopping ( item, index, index1, a, b ) {
|
||||||
if ( this.amountcartNumber <= 0 ) {
|
if ( item.cartNumber <= 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let params = {
|
let params = {
|
||||||
"skuId": this.skuId,
|
"skuId": this.skuId,
|
||||||
"num": item.cartNumber + this.amountcartNumber, //数量
|
"num": item.cartNumber, //数量
|
||||||
"type": a == '+' ? 1 : 0,
|
"type": a == '+' ? 1 : 0,
|
||||||
"productId": item.id, //商品id
|
"productId": item.id, //商品id
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopUser'),
|
||||||
@@ -636,6 +636,7 @@
|
|||||||
* @param {Object} index1
|
* @param {Object} index1
|
||||||
*/
|
*/
|
||||||
clickspecifications(item1, index, index1,type) {
|
clickspecifications(item1, index, index1,type) {
|
||||||
|
console.log(item1)
|
||||||
this.skuidname = []
|
this.skuidname = []
|
||||||
this.specifications = item1
|
this.specifications = item1
|
||||||
this.specifications.indexa = index
|
this.specifications.indexa = index
|
||||||
|
|||||||
Reference in New Issue
Block a user