【类 型】:feat
【原 因】:防止客户 填入过大的退款金额 前端过滤 【过 程】:申请退款金额的 cell 失焦 自动格式化(保留小鼠后两位) 超过订单总金额 自动设生成总金额 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
814066dffc
commit
fed1d496ed
@ -61,7 +61,8 @@
|
||||
<!-- form -->
|
||||
<view class="ofa m-t-24 m-b-12 flex mub borderBDas" style="max-height: 60vh;">
|
||||
<view class="fb fz32">¥</view>
|
||||
<u-input placeholder="请输入金额" v-model="requestRefund_price" type="digit" border="false" />
|
||||
<u-input placeholder="请输入金额" v-model="requestRefund_price" @blur="onRefundPriceBlur" type="digit"
|
||||
border="false" />
|
||||
</view>
|
||||
<!-- 占位 -->
|
||||
<view class="extra-space1"></view>
|
||||
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user