diff --git a/components/ProductWindow.vue b/components/ProductWindow.vue index 5800a60..8e53443 100644 --- a/components/ProductWindow.vue +++ b/components/ProductWindow.vue @@ -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))) diff --git a/pkg_user/views/gift/gift.vue b/pkg_user/views/gift/gift.vue index af4b2ef..d781d6a 100644 --- a/pkg_user/views/gift/gift.vue +++ b/pkg_user/views/gift/gift.vue @@ -54,7 +54,6 @@ {{ payPrice }} -