Fix:3416 【礼品功能】送礼页面手动删除数量后,该数量框显示空白,删除数量后,默认为1
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
type="number"
|
||||
:min="1"
|
||||
:max="attrObj.productSelect.stock"
|
||||
@input="inputNumer"
|
||||
@blur="inputNumer(cartNumber)"
|
||||
v-model="cartNumber"
|
||||
style="height: 55rpx !important; width:80rpx !important"
|
||||
class="item v12-font-36 v12-font-bold v12-dark-text cart-btn" />
|
||||
@@ -139,16 +139,8 @@ export default {
|
||||
},
|
||||
cartNumber(val) {
|
||||
console.log(+val <= 1 || val === '', 'cartNumber');
|
||||
if(+val <= 1 || val === '') {
|
||||
this.cartNumber = 1
|
||||
this.$forceUpdate()
|
||||
this.$emit('input', 1)
|
||||
this.$emit("changeFun", { action: "ChangeCartNum", value: 1 })
|
||||
return
|
||||
} else {
|
||||
this.$emit('input', +val)
|
||||
this.$emit("changeFun", { action: "ChangeCartNum", value: +val })
|
||||
}
|
||||
this.$emit('input', +val)
|
||||
this.$emit("changeFun", { action: "ChangeCartNum", value: +val })
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -157,7 +149,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
inputNumer(e) {
|
||||
|
||||
console.log(e);
|
||||
if(e === '') {
|
||||
this.cartNumber = 1
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
reRender(data) {
|
||||
this.$set(this, 'attrObj', JSON.parse(JSON.stringify(data)))
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
<text class="v12-primary-text v12-font-bold v12-font-30">{{ payPrice }}</text>
|
||||
</view>
|
||||
<view>
|
||||
|
||||
<u-number-box
|
||||
v-if="!isPayOk"
|
||||
v-model="goodsInfo.cartNum"
|
||||
@@ -63,6 +62,7 @@
|
||||
iconStyle="color: #fff"
|
||||
class="num-step"
|
||||
@change="numberChange"
|
||||
@blur="numberBlur(goodsInfo.cartNum)"
|
||||
|
||||
>
|
||||
<template v-slot:minus>
|
||||
@@ -230,6 +230,14 @@ export default {
|
||||
numberChange(e) {
|
||||
this.computedPrice(e.value)
|
||||
},
|
||||
numberBlur(e) {
|
||||
console.log(e);
|
||||
this.isPayOk = true
|
||||
setTimeout(() => {
|
||||
this.isPayOk = false
|
||||
},10)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
computedPrice(num) {
|
||||
const params = {
|
||||
cartId: this.cartId,
|
||||
|
||||
Reference in New Issue
Block a user