diff --git a/pages/shop/refund.vue b/pages/shop/refund.vue index 765c7f3..3fca826 100644 --- a/pages/shop/refund.vue +++ b/pages/shop/refund.vue @@ -61,7 +61,8 @@ ¥ - + @@ -153,24 +154,23 @@ closeRefund_remark() { this.refund_remarkShow = false }, + // 处理退款金额失焦 + onRefundPriceBlur() { + // 使用 formatPrice 格式化输入的金额 + this.requestRefund_price = this.formatPrice(this.requestRefund_price) + + // 检查金额是否超过订单总金额 + if (Number(this.requestRefund_price) > Number(this.fullPrice)) { + this.requestRefund_price = Number(this.fullPrice) + } + }, }, filters: { parseTime, //日期 格式化 formatPrice, //价格 格式化 truncate }, - watch: { - requestRefund_price: { - handler(val) { - let refund_price = this.formatPrice(Number(val)) - if (refund_price > this.fullPrice) { //限制退款金额 上限为订单的总金额 - this.requestRefund_price = this.fullPrice - }else{ - this.requestRefund_price = refund_price - } - } - } - }, + watch: {}, computed: { //未付款订单 order() {