Browse Source

上传

master
前端-胡立永 2 months ago
parent
commit
ebf08168c5
7 changed files with 95 additions and 63 deletions
  1. +10
    -1
      api/api.js
  2. +8
    -3
      components/user/cartSubmitSelect.vue
  3. +1
    -1
      pages/index/index.vue
  4. +16
    -15
      pages_order/components/product/addLease.vue
  5. +2
    -2
      pages_order/components/product/submitUnitSelect.vue
  6. +56
    -39
      pages_order/order/createWash.vue
  7. +2
    -2
      pages_order/order/orderDetail.vue

+ 10
- 1
api/api.js View File

@ -357,7 +357,16 @@ const config = {
url: '/order/shop/wash/receipt',
method: 'POST',
auth: true,
}
},
// 酒店修改我的物品信息
editLeaseNum : {
url: '/order/edit/lease/num',
method: 'POST',
auth: true,
debounce: 500,
},
}


+ 8
- 3
components/user/cartSubmitSelect.vue View File

@ -38,11 +38,16 @@
<view style="font-weight: 900;">
下单说明
</view>
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
<view class=""
v-if="washPrice">
水洗费水洗费用按每张桌布10元来计算
</view>
<view class="">
押金将按照面积计算每平方厘米1
租金物品确认收货后每张桌布每天租金{{ configList.depositPrice }}
</view>
<view class=""
v-if="depositPrice">
押金按桌布最低成本价收取订单结束后全额退还
</view>
</view>


+ 1
- 1
pages/index/index.vue View File

@ -159,7 +159,7 @@
},
statisticsKey : [
{
key : 'user',
key : 'num',
title : '桌布库存',
},
{


+ 16
- 15
pages_order/components/product/addLease.vue View File

@ -6,7 +6,7 @@
</view>
<!-- 地址 -->
<view class="address" @click="openAddress">
<!-- <view class="address" @click="openAddress">
<image src="/static/image/address/selectIcon.png" mode=""></image>
<view class="">
{{ address.name }}
@ -17,7 +17,7 @@
<view class="icon">
<uv-icon size="30rpx" name="arrow-right"></uv-icon>
</view>
</view>
</view> -->
<uv-popup ref="addressPopup" :round="30">
<addressList ref="addressList" height="60vh" @select="selectAddress" />
@ -65,13 +65,13 @@
this.$refs.addressPopup.close()
},
submit() {
if(!this.address.id){
return uni.showToast({
title: '请选择地址'
})
}
// if(!this.address.id){
// return uni.showToast({
// title: ''
// })
// }
this.$refs.addLeaseForm.submit(form => {
form.addressId = this.address.id, //id
// form.addressId = this.address.id, //id
this.$api('tablecloth', form, res => {
if (res.code == 200) {
this.$emit('submit')
@ -86,12 +86,12 @@
this.$refs.addPopup.open('bottom')
//
this.$refs.addressList.getAddressList().then(res => {
this.addressTotal = res.total
if (this.addressTotal != 0) {
this.address = res.records[0]
}
})
// this.$refs.addressList.getAddressList().then(res => {
// this.addressTotal = res.total
// if (this.addressTotal != 0) {
// this.address = res.records[0]
// }
// })
},
}
}
@ -101,9 +101,10 @@
.title{
background-color: #fff;
padding: 20rpx;
padding: 30rpx;
text-align: center;
font-weight: 900;
font-size: 34rpx;
}
.address {


+ 2
- 2
pages_order/components/product/submitUnitSelect.vue View File

@ -52,10 +52,10 @@
下单说明
</view>
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
租金物品确认收货后每张桌布每天租金{{ configList.depositPrice }}
</view>
<view class="">
押金将按照面积计算每平方厘米1
押金按桌布最低成本价收取订单结束后全额退还
</view>
</view>


+ 56
- 39
pages_order/order/createWash.vue View File

@ -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', {


+ 2
- 2
pages_order/order/orderDetail.vue View File

@ -329,10 +329,10 @@
style="line-height: 40rpx;">
<view class="">
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
租金物品确认收货后每张桌布每天租金{{ configList.depositPrice }}
</view>
<view class="">
押金将按照面积计算每平方厘米1
押金按桌布最低成本价收取订单结束后全额退还
</view>
</view>


Loading…
Cancel
Save