Browse Source

上传

master
前端-胡立永 6 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', url: '/order/shop/wash/receipt',
method: 'POST', method: 'POST',
auth: true, 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 style="font-weight: 900;">
下单说明 下单说明
</view> </view>
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
<view class=""
v-if="washPrice">
水洗费水洗费用按每张桌布10元来计算
</view> </view>
<view class=""> <view class="">
押金将按照面积计算每平方厘米1
租金物品确认收货后每张桌布每天租金{{ configList.depositPrice }}
</view>
<view class=""
v-if="depositPrice">
押金按桌布最低成本价收取订单结束后全额退还
</view> </view>
</view> </view>


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

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


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

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


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

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


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

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


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

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


Loading…
Cancel
Save