This commit is contained in:
2025-08-08 17:28:01 +08:00
parent 631502f610
commit c352af0bcc
2 changed files with 7 additions and 4 deletions

View File

@@ -26,7 +26,7 @@
</view>
<view class="zd-col-12">
<!-- <search-box v-model="code" @handleChange="handleChange1" @handleDel="handleDel1" /> -->
<input type="number" class="filter_input" v-model="val3" @blur="handleBlur(e)">
<input type="number" class="filter_input" v-model="val3" @blur="handleBlur()">
</view>
<button class="mini-btn" type="primary" size="mini" @tap="_getWeight">获取重量</button>
</view>
@@ -145,7 +145,7 @@
this._regionList()
},
methods: {
handleBlur (e) {
handleBlur () {
if (this.val3) {
if (this.val3 < 0) {
this.val3 = 0
@@ -165,6 +165,9 @@
// 处理0.xxx的情况去掉整数部分多余的0
this.val3 = '0.' + this.val3.replace(/^0+\./, '');
}
if (Number(this.val3) === 0) {
this.val3 = 0
}
}
} else {
// uni.showToast({