Browse Source

上传

master
前端-胡立永 11 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> <view>
应付款{{ price }} 应付款{{ price }}
</view> </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>
<view v-if="washPrice">
<!-- <view v-if="washPrice">
水洗费{{ washPrice.toFixed(2) }} 水洗费{{ 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>
<view v-if="rentPrice"> <view v-if="rentPrice">
租金{{ rentPrice }} 租金{{ rentPrice }}
</view> </view>
@ -143,15 +167,21 @@
depositPrice: {// depositPrice: {//
default: 0 default: 0
}, },
depositPriceList : {//
default: []
},
washPrice: {// washPrice: {//
default: 0 default: 0
}, },
washPriceList : {//
default: []
},
rentPrice: {// rentPrice: {//
default: 0 default: 0
}, },
}, },
computed(){
// ...mapState(['configList']),
computed : {
...mapState(['configList']),
}, },
data() { data() {
return { return {
@ -309,6 +339,10 @@
margin: 10rpx 0; margin: 10rpx 0;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
line-height: 50rpx; line-height: 50rpx;
&>view{
display: flex;
justify-content: space-between;
}
} }
.coupon{ .coupon{
text-align: center; text-align: center;


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

@ -21,8 +21,10 @@
<view class="info"> <view class="info">
<view class="title"> <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" <uv-number-box v-model="item.num"
@change="e => valChange(item, e)"></uv-number-box> @change="e => valChange(item, e)"></uv-number-box>
</view> </view>
@ -90,6 +92,7 @@
@submit="ordersPay" @submit="ordersPay"
:price="totalPrice" :price="totalPrice"
:depositPrice="totalPrice" :depositPrice="totalPrice"
:depositPriceList="depositPriceList"
ref="cartSubmitSelect"/> ref="cartSubmitSelect"/>
<tabber select="3" /> <tabber select="3" />
@ -133,7 +136,6 @@
} }
}, },
computed: { computed: {
totalPrice() { totalPrice() {
if (!this.checkboxValue.length) { if (!this.checkboxValue.length) {
return 0 return 0
@ -144,8 +146,39 @@
price += n.depositPrice * n.num price += n.depositPrice * n.num
} }
}) })
return price.toFixed(2) 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() { onShow() {
this.getData() this.getData()
@ -331,6 +364,8 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 0 10rpx;
flex-shrink: 0;
} }
.image { .image {


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

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


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

@ -109,6 +109,7 @@
:price="price" :price="price"
:washPrice="washPrice" :washPrice="washPrice"
:rentPrice="rentPrice" :rentPrice="rentPrice"
:washPriceList="washPriceList"
submiitTitle="立即水洗" submiitTitle="立即水洗"
ref="cartSubmitSelect"/> ref="cartSubmitSelect"/>
@ -162,7 +163,7 @@
} }
return 0 return 0
}, },
washPrice(){
washPrice(){//
// if(this.checkboxValue.length == 0){ // if(this.checkboxValue.length == 0){
// return 0 // return 0
// } // }
@ -179,7 +180,37 @@
}) })
return price 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){ // if(this.checkboxValue.length == 0){
// return 0 // return 0
// } // }
@ -333,7 +364,7 @@
getRentPrice(){ getRentPrice(){
this.$api('getRentPrice', res => { this.$api('getRentPrice', res => {
if(res.code == 200){ if(res.code == 200){
this.rentPrice = res.result
this.rentPrice = res.result || 0
} }
}) })
}, },


Loading…
Cancel
Save