|
|
@ -3,7 +3,7 @@ |
|
|
|
<navbar title="我要水洗" leftClick @leftClick="$utils.navigateBack" /> |
|
|
|
|
|
|
|
|
|
|
|
<view class="tabs"> |
|
|
|
<!-- <view class="tabs"> |
|
|
|
<uv-tabs :list="tabs" |
|
|
|
:activeStyle="{color : '#FD5100', fontWeight : 600}" |
|
|
|
lineColor="#FD5100" lineHeight="8rpx" |
|
|
@ -11,21 +11,24 @@ |
|
|
|
:current="current" |
|
|
|
:scrollable="false" |
|
|
|
@click="clickTabs"></uv-tabs> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<!-- 选择租赁物品 --> |
|
|
|
<view class="box d"> |
|
|
|
<uv-checkbox-group shape="circle" v-model="checkboxValue" |
|
|
|
> |
|
|
|
|
|
|
|
<uv-radio-group shape="circle" v-model="radiovalue"> |
|
|
|
|
|
|
|
<!-- <uv-checkbox-group shape="circle" v-model="checkboxValue" |
|
|
|
> --> |
|
|
|
<view v-for="(item, index) in list" :key="index" class="item"> |
|
|
|
<view class="checkbox"> |
|
|
|
|
|
|
|
<uv-checkbox |
|
|
|
<uv-radio |
|
|
|
:name="item.id" |
|
|
|
:disabled="!!item.statusInfo" |
|
|
|
activeColor="#FA5A0A" |
|
|
|
size="40rpx" |
|
|
|
icon-size="35rpx"></uv-checkbox> |
|
|
|
icon-size="35rpx"></uv-radio> |
|
|
|
</view> |
|
|
|
|
|
|
|
<image class="image" :src="item.goodsPic || 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg'" |
|
|
@ -71,7 +74,8 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uv-checkbox-group> |
|
|
|
<!-- </uv-checkbox-group> --> |
|
|
|
</uv-radio-group> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="btn" @click="submit"> |
|
|
@ -93,7 +97,7 @@ |
|
|
|
</view> |
|
|
|
<view class="text"> |
|
|
|
<!-- 共{{ checkboxValue.length }}件,已享受更低优惠 --> |
|
|
|
含租金{{ zujin && zujin.toFixed(2) }}¥, |
|
|
|
含租金{{ rentPrice && rentPrice.toFixed(2) }}¥, |
|
|
|
水洗费{{ washPrice && washPrice.toFixed(2) }}¥ |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -104,10 +108,21 @@ |
|
|
|
@submit="ordersPay" |
|
|
|
:price="price" |
|
|
|
:washPrice="washPrice" |
|
|
|
:rentPrice="zujin" |
|
|
|
:rentPrice="rentPrice" |
|
|
|
submiitTitle="立即水洗" |
|
|
|
ref="cartSubmitSelect"/> |
|
|
|
|
|
|
|
<view |
|
|
|
@click="$refs.addLease.open()" |
|
|
|
class="plus-create"> |
|
|
|
<uv-icon |
|
|
|
name="plus" |
|
|
|
color="#fff" |
|
|
|
size="40rpx" |
|
|
|
></uv-icon> |
|
|
|
</view> |
|
|
|
|
|
|
|
<addLease ref="addLease" @submit="getData"/> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -115,14 +130,17 @@ |
|
|
|
import cartSubmitSelect from '@/components/user/cartSubmitSelect.vue' |
|
|
|
import mixinsList from '@/mixins/list.js' |
|
|
|
import mixinLease from '@/mixins/lease.js' |
|
|
|
import addLease from '../components/product/addLease.vue' |
|
|
|
export default { |
|
|
|
mixins : [mixinsList, mixinLease], |
|
|
|
components: { |
|
|
|
cartSubmitSelect, |
|
|
|
addLease, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
checkboxValue : [], |
|
|
|
radiovalue : 0, |
|
|
|
// statusText : ['正常', '换货中', '退货中'], |
|
|
|
tabs: [{ |
|
|
|
name: '选择租赁物品' |
|
|
@ -133,25 +151,29 @@ |
|
|
|
], |
|
|
|
current : 0,//当前选中的标签页 |
|
|
|
mixinsListApi : 'getLeasePage', |
|
|
|
rentPrice : 0,//需要支付的租金 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed : { |
|
|
|
price(){ |
|
|
|
let price = parseFloat(this.washPrice) + parseFloat(this.zujin) |
|
|
|
let price = parseFloat(this.washPrice) + parseFloat(this.rentPrice) |
|
|
|
if(price){ |
|
|
|
return (this.washPrice + this.zujin).toFixed(2) |
|
|
|
return (this.washPrice + this.rentPrice).toFixed(2) |
|
|
|
} |
|
|
|
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)){ |
|
|
|
// if(this.checkboxValue.includes(n.id)){ |
|
|
|
// price += (n.washUnitPrice || 0) * n.selectNum |
|
|
|
// } |
|
|
|
if(this.radiovalue == n.id){ |
|
|
|
price += (n.washUnitPrice || 0) * n.selectNum |
|
|
|
} |
|
|
|
}) |
|
|
@ -183,6 +205,7 @@ |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.getData() |
|
|
|
this.getRentPrice() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//点击tab栏 |
|
|
@ -200,7 +223,7 @@ |
|
|
|
beforeGetData(){ |
|
|
|
let data = {} |
|
|
|
|
|
|
|
data.leaseFlag = this.current ? 0 : 1; |
|
|
|
// data.leaseFlag = this.current ? 0 : 1; |
|
|
|
|
|
|
|
return data |
|
|
|
}, |
|
|
@ -214,7 +237,15 @@ |
|
|
|
|
|
|
|
// 去结算按钮 |
|
|
|
goCleaning() { |
|
|
|
if (this.checkboxValue.length < 1) { |
|
|
|
// if (this.checkboxValue.length < 1) { |
|
|
|
// uni.showToast({ |
|
|
|
// title: "请勾选商品", |
|
|
|
// icon: 'none' |
|
|
|
// }) |
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
if (this.radiovalue == 0) { |
|
|
|
uni.showToast({ |
|
|
|
title: "请勾选商品", |
|
|
|
icon: 'none' |
|
|
@ -232,7 +263,16 @@ |
|
|
|
let data = [] |
|
|
|
let records = this.list |
|
|
|
for (var i = 0; i < records.length; i++) { |
|
|
|
if (this.checkboxValue.includes(records[i].id)) { |
|
|
|
// 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) { |
|
|
|
data.push({ |
|
|
|
leaseId: records[i].id, //租赁id |
|
|
|
addressId, //地址id |
|
|
@ -254,15 +294,6 @@ |
|
|
|
form.couponId = couponId |
|
|
|
} |
|
|
|
|
|
|
|
// 不管有没有支付,都要清除购物车数据 |
|
|
|
// self.$api('cartDel', { |
|
|
|
// id: deleteCartIds |
|
|
|
// }, res => { |
|
|
|
// if (res.code == 200) { |
|
|
|
// self.getData() |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
this.$api('orderPay', form, res => { |
|
|
|
if (res.code == 200) { |
|
|
@ -298,6 +329,14 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取需要支付的租金 |
|
|
|
getRentPrice(){ |
|
|
|
this.$api('getRentPrice', res => { |
|
|
|
if(res.code == 200){ |
|
|
|
this.rentPrice = res.result |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
@ -468,5 +507,19 @@ |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.plus-create{ |
|
|
|
position: fixed; |
|
|
|
right: 50rpx; |
|
|
|
bottom: 30vh; |
|
|
|
background-color: $uni-color; |
|
|
|
color: #FFF; |
|
|
|
width: 100rpx; |
|
|
|
height: 100rpx; |
|
|
|
border-radius: 50%; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |