|
|
@@ -2,10 +2,12 @@
|
|
|
<view class="boardset-flowert">
|
|
|
<view class="flower-input_box">
|
|
|
<view class="flower-title">{{customData.name}}</view>
|
|
|
- <view class="flower-ratio">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</view>
|
|
|
+ <view class="flower-ratio" v-if="customData.property && customData.property==1">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</view>
|
|
|
+
|
|
|
<view class="flower-open_box">
|
|
|
<view>
|
|
|
- <view class="desc">{{Number(unitType) == 0 ? customData.bigUnit : customData.smallUnit}}数</view>
|
|
|
+ <view class="desc" v-if="customData.property && customData.property==1">{{Number(unitType) == 0 ? customData.bigUnit : customData.smallUnit}}数</view>
|
|
|
+ <view class="desc" v-else>数量</view>
|
|
|
<div class="flower-unit_box" @tap="checkCurrent(0)">
|
|
|
<text :class="{selected:checkType == 0}">{{buyNum}}</text>
|
|
|
</div>
|
|
|
@@ -17,14 +19,18 @@
|
|
|
</div>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="set-residue_box">
|
|
|
+
|
|
|
+ <view class="set-residue_box" v-if="customData.property && customData.property==1">
|
|
|
还剩
|
|
|
<text v-if="bigStockNum>0">{{bigStockNum}}{{customData.bigUnit}}</text>
|
|
|
<text v-if="smallStockNum>0">{{smallStockNum}}{{customData.smallUnit}}</text>
|
|
|
- </view>
|
|
|
- <view class="switch-button">
|
|
|
+ </view>
|
|
|
+ <view class="set-residue_box" v-else> 还剩 <text>{{customData.stock}}</text> </view>
|
|
|
+
|
|
|
+ <view class="switch-button" v-if="customData.property && customData.property==1">
|
|
|
<image @tap="changeUnitType" class="change-unit" :src="`${constant.imgUrl}/icon/switch/switch128.png`"></image>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="keyboard-body_box">
|
|
|
<VKeyboard ref="keyboard" :pointIsShow="true" :digital="true" :disorderly="false" @typing="typing" @enter="enter" @cancel="cancel"> </VKeyboard>
|
|
|
@@ -57,15 +63,18 @@ export default {
|
|
|
},
|
|
|
watch:{
|
|
|
customData:{
|
|
|
- handler(){
|
|
|
- this.buyNum = this.customData.buyNum ? parseFloat(this.customData.buyNum) : 1
|
|
|
- this.unitPrice = this.customData.bigPrice ? parseFloat(this.customData.bigPrice) : 0
|
|
|
-
|
|
|
- this.bigStockNum = Math.floor(this.customData.stock)
|
|
|
- let smallCount = this.customData.stock - this.bigStockNum
|
|
|
- let smallStockNum = smallCount*this.customData.ratio
|
|
|
- this.smallStockNum = smallStockNum.toFixed(2)
|
|
|
- this.smallStockNum = parseFloat(this.smallStockNum)
|
|
|
+ handler(newData){
|
|
|
+ this.buyNum = newData.buyNum ? parseFloat(newData.buyNum) : 1
|
|
|
+ if(newData.property && newData.property == 1){
|
|
|
+ this.bigStockNum = Math.floor(newData.stock)
|
|
|
+ let smallCount = newData.stock - this.bigStockNum
|
|
|
+ let smallStockNum = smallCount*newData.ratio
|
|
|
+ this.smallStockNum = smallStockNum.toFixed(2)
|
|
|
+ this.smallStockNum = parseFloat(this.smallStockNum)
|
|
|
+ this.unitPrice = newData.bigPrice ? parseFloat(newData.bigPrice) : 0
|
|
|
+ }else{
|
|
|
+ this.unitPrice = newData.price ? parseFloat(newData.price) : 0
|
|
|
+ }
|
|
|
},
|
|
|
deep:true,
|
|
|
immediate:true
|