Browse Source

上传

master
前端-胡立永 3 months ago
parent
commit
24af590d3a
4 changed files with 134 additions and 26 deletions
  1. +39
    -5
      components/user/cartSubmitSelect.vue
  2. +38
    -3
      pages/index/cart.vue
  3. +23
    -15
      pages_order/components/product/submitUnitSelect.vue
  4. +34
    -3
      pages_order/order/createWash.vue

+ 39
- 5
components/user/cartSubmitSelect.vue View File

@ -42,12 +42,36 @@
<view>
应付款{{ price }}
</view>
<view v-if="depositPrice">
押金{{ depositPrice.toFixed(2) }}
<!-- <view v-if="depositPrice">
押金{{ depositPrice }}
</view> -->
<view
:key="index"
v-for="(depositItem, index) in depositPriceList">
<view class="">
押金{{ depositItem.price }}
</view>
<view class="">
x{{ depositItem.num }}
</view>
</view>
<view v-if="washPrice">
<!-- <view v-if="washPrice">
水洗费{{ washPrice.toFixed(2) }}
</view> -->
<view
:key="index"
v-for="(washItem, index) in washPriceList">
<view class="">
水洗费{{ washItem.price }}
</view>
<view class="">
x{{ washItem.num }}
</view>
</view>
<view v-if="rentPrice">
租金{{ rentPrice }}
</view>
@ -143,15 +167,21 @@
depositPrice: {//
default: 0
},
depositPriceList : {//
default: []
},
washPrice: {//
default: 0
},
washPriceList : {//
default: []
},
rentPrice: {//
default: 0
},
},
computed(){
// ...mapState(['configList']),
computed : {
...mapState(['configList']),
},
data() {
return {
@ -309,6 +339,10 @@
margin: 10rpx 0;
padding: 10rpx 20rpx;
line-height: 50rpx;
&>view{
display: flex;
justify-content: space-between;
}
}
.coupon{
text-align: center;


+ 38
- 3
pages/index/cart.vue View File

@ -21,8 +21,10 @@
<view class="info">
<view class="title">
<view class="text-ellipsis">{{ item.name }}</view>
<view>
<view class="text-ellipsis"
style="width: 220rpx;"
>{{ item.name }}</view>
<view style="flex-shrink: 0;">
<uv-number-box v-model="item.num"
@change="e => valChange(item, e)"></uv-number-box>
</view>
@ -90,6 +92,7 @@
@submit="ordersPay"
:price="totalPrice"
:depositPrice="totalPrice"
:depositPriceList="depositPriceList"
ref="cartSubmitSelect"/>
<tabber select="3" />
@ -133,7 +136,6 @@
}
},
computed: {
totalPrice() {
if (!this.checkboxValue.length) {
return 0
@ -144,8 +146,39 @@
price += n.depositPrice * n.num
}
})
return price.toFixed(2)
},
depositPriceList(){
if (!this.checkboxValue.length) {
return []
}
let list = []
this.list.records.forEach(n => {
if (this.checkboxValue.includes(n.id)) {
// price += n.depositPrice * n.num
let len = list.length
for(let i = 0;i < len;i++){
let item = list[i]
if(item.price == n.depositPrice){
item.num += n.num
return
}
}
list.push({
price : n.depositPrice,
num : n.num,
})
}
})
return list
},
},
onShow() {
this.getData()
@ -331,6 +364,8 @@
display: flex;
justify-content: center;
align-items: center;
padding: 0 10rpx;
flex-shrink: 0;
}
.image {


+ 23
- 15
pages_order/components/product/submitUnitSelect.vue View File

@ -44,6 +44,18 @@
</view>
</view>
</view> -->
<view class="payInfoMessage"
v-if="buyIndex == 0">
下单说明
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
</view>
<view class="">
押金将按照面积计算每平方厘米1
</view>
</view>
<!-- 商品信息和数量 -->
<view v-if="typeIndex == 0">
@ -129,17 +141,6 @@
实付款{{ (price - coupon.couponPrice).toFixed(2) }}
</view>
</view>
<view class="payInfoMessage"
v-if="buyIndex == 0">
下单说明
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
</view>
<view class="">
押金将按照面积计算每平方厘米1
</view>
</view>
<uv-cell
icon="coupon"
@ -429,6 +430,15 @@
margin-left: auto;
}
}
.payInfoMessage{
line-height: 50rpx;
background-color: #fff;
padding: 20rpx;
margin: 10rpx 0;
font-size: 26rpx;
}
.submit-info {
background-color: #fff;
@ -476,6 +486,8 @@
}
}
}
.submit-unit {
padding: 30rpx;
@ -534,10 +546,6 @@
text-align: center;
color: #5c5;
}
.payInfoMessage{
line-height: 50rpx;
}
}
.submit{


+ 34
- 3
pages_order/order/createWash.vue View File

@ -109,6 +109,7 @@
:price="price"
:washPrice="washPrice"
:rentPrice="rentPrice"
:washPriceList="washPriceList"
submiitTitle="立即水洗"
ref="cartSubmitSelect"/>
@ -162,7 +163,7 @@
}
return 0
},
washPrice(){
washPrice(){//
// if(this.checkboxValue.length == 0){
// return 0
// }
@ -179,7 +180,37 @@
})
return price
},
zujin(){
washPriceList(){
let checkboxValue = [this.radiovalue]
if (!checkboxValue.length) {
return []
}
let list = []
this.list.forEach(n => {
if (checkboxValue.includes(n.id)) {
let len = list.length
for(let i = 0;i < len;i++){
let item = list[i]
if(item.price == n.washUnitPrice){
item.num += n.num
return
}
}
list.push({
price : n.washUnitPrice,
num : n.num,
})
}
})
return list
},
zujin(){//
// if(this.checkboxValue.length == 0){
// return 0
// }
@ -333,7 +364,7 @@
getRentPrice(){
this.$api('getRentPrice', res => {
if(res.code == 200){
this.rentPrice = res.result
this.rentPrice = res.result || 0
}
})
},


Loading…
Cancel
Save