feat: 商品管理长度宽度单位改为mm,面积改为m²,最多5位数字
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -65,17 +65,17 @@
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-row">
|
||||
<view class="form-row size-row">
|
||||
<view class="form-item half">
|
||||
<text class="label">长度</text>
|
||||
<input class="input" type="digit" v-model="form.length" placeholder="非必须" />
|
||||
<text class="label">长度(mm)</text>
|
||||
<input class="input" type="digit" v-model="form.length" placeholder="非必须" maxlength="5" />
|
||||
</view>
|
||||
<view class="form-item half">
|
||||
<text class="label">宽度</text>
|
||||
<input class="input" type="digit" v-model="form.width" placeholder="非必须" />
|
||||
<text class="label">宽度(mm)</text>
|
||||
<input class="input" type="digit" v-model="form.width" placeholder="非必须" maxlength="5" />
|
||||
</view>
|
||||
<view class="form-item half">
|
||||
<text class="label">面积</text>
|
||||
<text class="label">面积(m²)</text>
|
||||
<input class="input" type="digit" v-model="form.area" placeholder="自动计算" disabled />
|
||||
</view>
|
||||
</view>
|
||||
@@ -151,9 +151,9 @@ export default {
|
||||
computedArea() {
|
||||
const l = parseFloat(this.form.length)
|
||||
const w = parseFloat(this.form.width)
|
||||
// 长度(cm) × 宽度(cm) ÷ 10000 = 面积(m²)
|
||||
// 长度(mm) × 宽度(mm) ÷ 1000000 = 面积(m²)
|
||||
if (!isNaN(l) && !isNaN(w) && l > 0 && w > 0) {
|
||||
return (l * w / 10000).toFixed(2)
|
||||
return (l * w / 1000000).toFixed(4)
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user