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