|
|
@@ -52,17 +52,25 @@
|
|
|
<view class="num_bx">
|
|
|
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
|
- <input v-model="customData.bigCount" type="number" @focus="customData.bigCount = null" placeholder="扎数" />
|
|
|
+ <input v-model="customData.bigCount" type="number" v-if="globalUnitType == 0" @focus="customData.bigCount = null" placeholder="扎数" />
|
|
|
+ <input v-model="customData.smallCount" type="number" v-else @focus="customData.smallCount = null" placeholder="支数" />
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
- <input v-model="customData.bigCount" type="number" @focus="customData.bigCount = null" :focus="isAddInputFocus" placeholder="扎数" />
|
|
|
+ <input v-model="customData.bigCount" type="number" v-if="globalUnitType == 0" @focus="customData.bigCount = null" :focus="isAddInputFocus" placeholder="扎数" />
|
|
|
+ <input v-model="customData.smallCount" type="number" v-else @focus="customData.smallCount = null" :focus="isAddInputFocus" placeholder="支数" />
|
|
|
<!-- #endif -->
|
|
|
|
|
|
<input v-model="customData.userPrice" @focus="customData.userPrice = null" type="digit" placeholder="单价" />
|
|
|
|
|
|
- <text>¥{{customData.userPrice && customData.bigCount ? parseFloat((customData.userPrice*customData.bigCount).toFixed(2)):0}}</text>
|
|
|
+ <text v-if="Number(customData.bigCount)>0">¥{{customData.userPrice && customData.bigCount ? parseFloat((customData.userPrice*customData.bigCount).toFixed(2)):0}}</text>
|
|
|
+ <text v-else>¥{{customData.userPrice && customData.smallCount ? parseFloat((customData.userPrice*customData.smallCount).toFixed(2)):0}}</text>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <image @click="switchGlobalUnitType" :src="`${constant.imgUrl}/icon/switch/switch128.png`" mode="widthFix"
|
|
|
+ style="width:58upx;height:58upx;position:absolute;top:35upx;left:30upx;" ></image>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
</modal-module>
|
|
|
@@ -126,7 +134,11 @@ export default {
|
|
|
let price = 0;
|
|
|
if (this.selectList) {
|
|
|
for (const item of this.selectList) {
|
|
|
- price += Number(item.userPrice)*Number(item.bigCount)
|
|
|
+ if(Number(item.bigCount)>0){
|
|
|
+ price += Number(item.userPrice)*Number(item.bigCount)
|
|
|
+ }else{
|
|
|
+ price += Number(item.userPrice)*Number(item.smallCount)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return Math.round(price * 100) / 100;
|