|
|
@ -16,23 +16,23 @@ |
|
|
|
<!-- 选择租赁物品 --> |
|
|
|
<view class="box d"> |
|
|
|
|
|
|
|
<uv-radio-group shape="circle" v-model="radiovalue"> |
|
|
|
<!-- <uv-radio-group shape="circle" v-model="radiovalue"> --> |
|
|
|
|
|
|
|
<!-- <uv-checkbox-group shape="circle" v-model="checkboxValue" |
|
|
|
> --> |
|
|
|
<uv-checkbox-group shape="circle" v-model="checkboxValue" |
|
|
|
> |
|
|
|
<view |
|
|
|
v-for="(item, index) in list" |
|
|
|
:key="index" |
|
|
|
@click="selectItem(item)" |
|
|
|
class="item"> |
|
|
|
<view class="checkbox"> |
|
|
|
<uv-radio |
|
|
|
<uv-checkbox |
|
|
|
:name="item.id" |
|
|
|
:disabled="!!item.statusInfo" |
|
|
|
activeColor="#FA5A0A" |
|
|
|
size="40rpx" |
|
|
|
@click.stop |
|
|
|
icon-size="35rpx"></uv-radio> |
|
|
|
icon-size="35rpx"></uv-checkbox> |
|
|
|
</view> |
|
|
|
|
|
|
|
<image class="image" :src="item.goodsPic || 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg'" |
|
|
@ -41,7 +41,8 @@ |
|
|
|
<view class="info"> |
|
|
|
<view class="title"> |
|
|
|
<view class="text-ellipsis">{{ item.goodsName }}</view> |
|
|
|
<view style="flex-shrink: 0;"> |
|
|
|
<view style="flex-shrink: 0;" |
|
|
|
v-if="item.leaseFlag == 1"> |
|
|
|
数量:{{ item.num }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -72,14 +73,21 @@ |
|
|
|
<view class="unit"> |
|
|
|
<uv-number-box |
|
|
|
v-model="item.selectNum" |
|
|
|
v-if="item.leaseFlag == 1" |
|
|
|
:max="item.num" |
|
|
|
> |
|
|
|
</uv-number-box> |
|
|
|
></uv-number-box> |
|
|
|
|
|
|
|
|
|
|
|
<uv-number-box |
|
|
|
v-model="item.selectNum" |
|
|
|
@change="e => valChange(item, e)" |
|
|
|
v-else |
|
|
|
></uv-number-box> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- </uv-checkbox-group> --> |
|
|
|
</uv-radio-group> |
|
|
|
</uv-checkbox-group> |
|
|
|
<!-- </uv-radio-group> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="btn" @click="submit"> |
|
|
@ -168,24 +176,24 @@ |
|
|
|
return 0 |
|
|
|
}, |
|
|
|
washPrice(){//计算总水洗费 |
|
|
|
// if(this.checkboxValue.length == 0){ |
|
|
|
// return 0 |
|
|
|
// } |
|
|
|
if(this.checkboxValue.length == 0){ |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
let price = 0 |
|
|
|
|
|
|
|
this.list.forEach(n => { |
|
|
|
// if(this.checkboxValue.includes(n.id)){ |
|
|
|
// price += (n.washUnitPrice || 0) * n.selectNum |
|
|
|
// } |
|
|
|
if(this.radiovalue == n.id){ |
|
|
|
if(this.checkboxValue.includes(n.id)){ |
|
|
|
price += (n.washUnitPrice || 0) * n.selectNum |
|
|
|
} |
|
|
|
// if(this.radiovalue == n.id){ |
|
|
|
// price += (n.washUnitPrice || 0) * n.selectNum |
|
|
|
// } |
|
|
|
}) |
|
|
|
return price |
|
|
|
}, |
|
|
|
washPriceList(){ |
|
|
|
let checkboxValue = [this.radiovalue] |
|
|
|
let checkboxValue = this.checkboxValue |
|
|
|
if (!checkboxValue.length) { |
|
|
|
return [] |
|
|
|
} |
|
|
@ -200,14 +208,14 @@ |
|
|
|
for(let i = 0;i < len;i++){ |
|
|
|
let item = list[i] |
|
|
|
if(item.price == n.washUnitPrice){ |
|
|
|
item.num += n.num |
|
|
|
item.num += n.selectNum |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
list.push({ |
|
|
|
price : n.washUnitPrice, |
|
|
|
num : n.num, |
|
|
|
num : n.selectNum, |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
@ -243,6 +251,15 @@ |
|
|
|
this.getRentPrice() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
valChange(item, e) { |
|
|
|
if(item.leaseFlag != 0){ |
|
|
|
return |
|
|
|
} |
|
|
|
this.$api('editLeaseNum', { |
|
|
|
id: item.id, |
|
|
|
num: e.value, |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 选择物品 |
|
|
|
selectItem(item){ |
|
|
|
if(this.radiovalue == item.id){ |
|
|
@ -280,15 +297,7 @@ |
|
|
|
|
|
|
|
// 去结算按钮 |
|
|
|
goCleaning() { |
|
|
|
// if (this.checkboxValue.length < 1) { |
|
|
|
// uni.showToast({ |
|
|
|
// title: "请勾选商品", |
|
|
|
// icon: 'none' |
|
|
|
// }) |
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
if (this.radiovalue == 0) { |
|
|
|
if (this.checkboxValue.length < 1) { |
|
|
|
uni.showToast({ |
|
|
|
title: "请勾选商品", |
|
|
|
icon: 'none' |
|
|
@ -296,6 +305,14 @@ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// if (this.radiovalue == 0) { |
|
|
|
// uni.showToast({ |
|
|
|
// title: "请勾选商品", |
|
|
|
// icon: 'none' |
|
|
|
// }) |
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
this.$refs.cartSubmitSelect.open('bottom') |
|
|
|
}, |
|
|
|
//商品下单 |
|
|
@ -306,16 +323,7 @@ |
|
|
|
let data = [] |
|
|
|
let records = this.list |
|
|
|
for (var i = 0; i < records.length; i++) { |
|
|
|
// if (this.checkboxValue.includes(records[i].id)) { |
|
|
|
// data.push({ |
|
|
|
// leaseId: records[i].id, //租赁id |
|
|
|
// addressId, //地址id |
|
|
|
// type : 1, |
|
|
|
// num : records[i].selectNum |
|
|
|
// }) |
|
|
|
// } |
|
|
|
|
|
|
|
if (this.radiovalue == records[i].id) { |
|
|
|
if (this.checkboxValue.includes(records[i].id)) { |
|
|
|
data.push({ |
|
|
|
leaseId: records[i].id, //租赁id |
|
|
|
addressId, //地址id |
|
|
@ -323,6 +331,15 @@ |
|
|
|
num : records[i].selectNum |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// if (this.radiovalue == records[i].id) { |
|
|
|
// data.push({ |
|
|
|
// leaseId: records[i].id, //租赁id |
|
|
|
// addressId, //地址id |
|
|
|
// type : 1, |
|
|
|
// num : records[i].selectNum |
|
|
|
// }) |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
this.$api('orderCreate', { |
|
|
|