|
|
@@ -3,6 +3,7 @@
|
|
|
height: calc(100vh - 30rpx * 2);
|
|
|
padding: 30rpx;
|
|
|
background: #FFFFFF;
|
|
|
+ font-size: 30rpx;
|
|
|
.radioBtn{
|
|
|
width: 30rpx;
|
|
|
height: 30rpx;
|
|
|
@@ -94,13 +95,14 @@
|
|
|
<view class="refund-label"><text>*</text>选择商品:</view>
|
|
|
<view>
|
|
|
<view class="list" v-for="(res,i) in product" :key="i">
|
|
|
- <view class="flex list-title" @tap="selectProduct(i)">
|
|
|
- <view class="flex-center radioBtn" :class="res.isActive?'active':''"></view>
|
|
|
+ <!--<view class="flex list-title" @tap="selectProduct(i)">-->
|
|
|
+ <view class="flex list-title" >
|
|
|
+ <!--<view class="flex-center radioBtn" :class="res.isActive?'active':''"></view>-->
|
|
|
{{res.name}} {{ `${res.bigNum}/${res.smallNum}` }} {{`¥${res.price}`}}
|
|
|
</view>
|
|
|
<view class="flex list-val">
|
|
|
- <input type="number" @focus="isMonitor = true" @blur="inputFun" v-model="res.big"><text>扎</text>
|
|
|
- <input type="number" @focus="isMonitor = true" @blur="inputFun" v-model="res.small"><text>支</text>
|
|
|
+ <input type="number" @blur="inputFun" v-model="res.big"><text>扎</text>
|
|
|
+ <input type="number" @blur="inputFun" v-model="res.small"><text>支</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -113,7 +115,7 @@
|
|
|
|
|
|
<view class="flex refund-item">
|
|
|
<view class="refund-label"><text>*</text>退款金额:</view>
|
|
|
- <input type="digit" @focus="isMonitor = false" v-model="refundMoney">
|
|
|
+ <input type="digit" v-model="refundMoney">
|
|
|
</view>
|
|
|
|
|
|
|
|
|
@@ -162,26 +164,18 @@ export default {
|
|
|
},
|
|
|
computed:{
|
|
|
refundMoneyFun(){
|
|
|
- if(!this.isMonitor){return;}
|
|
|
+ // if(!this.isMonitor){return;}
|
|
|
this.refundMoney = null;
|
|
|
if(!this.$util.isEmpty(this.product)){
|
|
|
this.product.forEach(ele=>{
|
|
|
- // if(Number(ele.big)>Number(ele.bigNum)){
|
|
|
- // uni.showToast({title:'不能大于商品数量',icon:'none'})
|
|
|
- // ele.big = null;
|
|
|
- // }
|
|
|
- // if(Number(ele.small)>Number(ele.smallNum)){
|
|
|
- // uni.showToast({title:'不能大于商品数量',icon:'none'})
|
|
|
- // ele.small = null;
|
|
|
- // }
|
|
|
let unitPrice = ele.unitPrice; //单价
|
|
|
let big = ele.big * unitPrice; //输入的扎
|
|
|
let ratio = ele.ratio==0?1:ele.ratio; //比例
|
|
|
let small = (ele.small/ratio * unitPrice).toFixed(2); //输入的支
|
|
|
|
|
|
- if(ele.isActive){
|
|
|
+ // if(ele.isActive){}
|
|
|
this.refundMoney = (Number(this.refundMoney) + big + Number(small)).toFixed(2);
|
|
|
- }
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -221,7 +215,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
inputFun(e){
|
|
|
- this.isMonitor = false
|
|
|
+ // this.isMonitor = false
|
|
|
this.product.forEach(ele=>{
|
|
|
if(Number(ele.big)>Number(ele.bigNum)){
|
|
|
uni.showToast({title:'不能大于商品数量',icon:'none'})
|
|
|
@@ -236,7 +230,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
selectProduct(index){
|
|
|
- this.isMonitor = true
|
|
|
+ // this.isMonitor = true
|
|
|
this.product[index].isActive = !this.product[index].isActive;
|
|
|
},
|
|
|
async init() {
|