Browse Source

上传

master
前端-胡立永 3 months ago
parent
commit
04ea1e5b8a
15 changed files with 403 additions and 72 deletions
  1. +6
    -0
      api/api.js
  2. +68
    -0
      components/user/buyMenu.vue
  3. +21
    -3
      components/user/cartSubmitSelect.vue
  4. +3
    -2
      mixins/order.js
  5. +8
    -2
      pages/index/cart.vue
  6. +7
    -2
      pages/index/center.vue
  7. +5
    -3
      pages/index/index.vue
  8. +21
    -5
      pages/index/order.vue
  9. +78
    -4
      pages_order/components/product/addLease.vue
  10. +3
    -2
      pages_order/components/product/addLeaseForm.vue
  11. +58
    -8
      pages_order/components/product/submitUnitSelect.vue
  12. +80
    -27
      pages_order/order/createWash.vue
  13. +41
    -10
      pages_order/order/orderDetail.vue
  14. +2
    -2
      pages_order/product/productDetail.vue
  15. +2
    -2
      store/store.js

+ 6
- 0
api/api.js View File

@ -197,6 +197,12 @@ const config = {
method: 'POST',
showLoading: true,
},
// 获取我的租金
getRentPrice : {
url : '/user/lease/all/deposit/price',
method: 'GET',
auth: true,
},
// 申请成为水洗店
applyShopHotel: {
url: '/shop/apply',


+ 68
- 0
components/user/buyMenu.vue View File

@ -0,0 +1,68 @@
<template>
<view class="menu">
<!-- <view class="menu-item">
我要租赁
</view>
<view class="menu-item">
我要购买
</view>
<view class="menu-item">
我要水洗
</view> -->
<uv-tabs :list="tabs"
:activeStyle="{color : '#FD5100', fontWeight : 600}"
lineColor="#FD5100"
lineHeight="8rpx"
lineWidth="50rpx"
:current="current"
:scrollable="false"
@click="clickTabs"></uv-tabs>
</view>
</template>
<script>
export default {
data() {
return {
tabs: [
{
name: '我要租赁'
},
{
name: '我要购买'
},
{
name: '我要水洗'
},
],
current : 0,
}
},
methods: {
clickTabs({index}){
this.current = index
if(index == 2){
this.$nextTick(() => this.current = 0)
uni.navigateTo({
url: '/pages_order/order/createWash'
})
}
},
}
}
</script>
<style scoped lang="scss">
.menu{
margin: 0 20rpx;
// &-item{
// padding: 20rpx;
// background-color: #fff;
// text-align: center;
// border-radius: 20rpx;
// margin: 20rpx;
// }
}
</style>

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

@ -8,7 +8,7 @@
<!-- 地址 -->
<view class="address" @click="openAddress">
<image src="/static/image/address/selectIcon.png" mode=""></image>
<view class="">
<view>
{{ address.name }}
</view>
<view class="">
@ -43,10 +43,10 @@
应付款{{ price }}
</view>
<view v-if="depositPrice">
押金{{ depositPrice }}
押金{{ depositPrice.toFixed(2) }}
</view>
<view v-if="washPrice">
水洗费{{ washPrice }}
水洗费{{ washPrice.toFixed(2) }}
</view>
<view v-if="rentPrice">
租金{{ rentPrice }}
@ -84,6 +84,16 @@
</view>
</template>
</uv-cell>
<view class="payInfoMessage">
下单说明
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
</view>
<view class="">
押金将按照面积计算每平方厘米1
</view>
</view>
</view>
<!-- 提交按钮 -->
@ -116,6 +126,7 @@
<script>
import addressList from '@/components/address/addressList.vue'
import couponList from './couponList.vue'
import { mapState } from 'vuex'
export default {
components: {
addressList,
@ -139,6 +150,9 @@
default: 0
},
},
computed(){
// ...mapState(['configList']),
},
data() {
return {
address: {
@ -300,6 +314,10 @@
text-align: center;
color: #5c5;
}
.payInfoMessage{
line-height: 50rpx;
}
}
.submit-btn {


+ 3
- 2
mixins/order.js View File

@ -72,10 +72,11 @@ export default {
})
},
// 水洗店确认接单
orderConfirmAccept(item){
orderConfirmAccept(item, args = {}){
let self = this
this.$api('orderConfirmAccept', {
id: item.id
id: item.id,
...args,
}, res => {
if (res.code == 200) {
uni.showToast({


+ 8
- 2
pages/index/cart.vue View File

@ -21,7 +21,7 @@
<view class="info">
<view class="title">
<view>{{ item.name }}</view>
<view class="text-ellipsis">{{ item.name }}</view>
<view>
<uv-number-box v-model="item.num"
@change="e => valChange(item, e)"></uv-number-box>
@ -337,6 +337,7 @@
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
flex-shrink: 0;
}
.info {
@ -346,7 +347,12 @@
display: flex;
padding: 10rpx 20rpx;
justify-content: space-between;
.text-ellipsis{
width: 280rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
}
.unit {


+ 7
- 2
pages/index/center.vue View File

@ -57,7 +57,7 @@
</uv-grid>
</view>
<view class="userList">
<!-- <view class="userList">
<view class="title">
我的用户
</view>
@ -72,7 +72,7 @@
</view>
</view>
</view>
</view>
</view> -->
</view>
<!-- 酒店 -->
@ -146,6 +146,11 @@
<text class="grid-text">申请成为水洗店</text>
</uv-grid-item>
<uv-grid-item @click="$utils.navigateTo('/pages_order/order/applyLaundryStore')">
<image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">申请成为供应商</text>
</uv-grid-item>
<uv-grid-item @click="logout">
<image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">退出登录</text>


+ 5
- 3
pages/index/index.vue View File

@ -111,7 +111,9 @@
</view>
</view> -->
<shopMain />
<!-- <shopMain /> -->
<buyMenu />
<view class="productList">
<productList :productList="productList.records"/>
@ -132,14 +134,14 @@
import tabber from '@/components/base/tabbar.vue'
import productList from '@/components/user/productList.vue'
import { mapGetters, mapState } from 'vuex'
import shopMain from '@/components/user/shopMain.vue'
import buyMenu from '@/components/user/buyMenu.vue'
// import selectArea from '../../components/selectArea.vue';
export default {
components : {
tabber,
productList,
PrivacyAgreementPoup,
shopMain,
buyMenu,
},
data() {
return {


+ 21
- 5
pages/index/order.vue View File

@ -81,21 +81,31 @@
<view class="pay">
<view
v-if="item.washPay && item.type == 1">
水洗费用{{ item.washPay }}
v-if="item.shopCoin && item.type == 1">
佣金{{ item.shopCoin }}
</view>
</view>
<!-- 水洗订单水洗店选择收货方式 -->
<template v-if="item.status == 4">
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 0})" class="b2">
快递取货
</view>
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 1})" class="b1">
自行配送
</view>
</template>
<!-- 待接单 -->
<view
v-if="[4, 18, 19].includes(item.status)"
v-if="[18, 19].includes(item.status)"
@click.stop="orderConfirmAccept(item)" class="b2">
确认接单
</view>
<!-- 待收货 -->
<template v-if="item.status == 2">
<template v-if="[2].includes(item.status)">
<view @click.stop="confirmReceiveGoods(item)" class="b2">
确认收货
</view>
@ -185,7 +195,7 @@
</view>
<!-- 待收货 -->
<template v-if="item.status == 2">
<template v-if="[2].includes(item.status)">
<view @click.stop="confirmReceiveGoods(item)" class="b2">
确认收货
</view>
@ -193,6 +203,12 @@
查看物流
</view>
</template>
<view
v-if="[20].includes(item.status)"
@click.stop="orderId = item.id;$refs.deliverGoods.open()" class="b2">
发货填写单号
</view>
</view>


+ 78
- 4
pages_order/components/product/addLease.vue View File

@ -1,6 +1,24 @@
<template>
<uv-popup ref="addPopup" :round="30">
<!-- 地址 -->
<view class="address" @click="openAddress">
<image src="/static/image/address/selectIcon.png" mode=""></image>
<view class="">
{{ address.name }}
</view>
<view class="">
{{ address.addressDetail }}
</view>
<view class="icon">
<uv-icon size="30rpx" name="arrow-right"></uv-icon>
</view>
</view>
<uv-popup ref="addressPopup" :round="30">
<addressList ref="addressList" height="60vh" @select="selectAddress" />
</uv-popup>
<addLeaseForm ref="addLeaseForm"/>
<view class="btn" @click="submit">
@ -11,21 +29,46 @@
<script>
import addLeaseForm from './addLeaseForm.vue'
import addressList from '@/components/address/addressList.vue'
export default {
components : {
addLeaseForm,
addressList,
},
data() {
return {
address: {
name: '请选择联系人',
addressDetail: '',
},
addressTotal: 0,
}
},
methods: {
//
openAddress() {
if (this.addressTotal == 0) {
this.$refs.popup.close()
return uni.navigateTo({
url: '/pages_order/mine/address?type=back'
})
}
this.$refs.addressPopup.open('bottom')
},
//
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
},
submit() {
if(!this.address.id){
return uni.showToast({
title: '请选择地址'
})
}
this.$refs.addLeaseForm.submit(form => {
form.addressId = this.address.id, //id
this.$api('tablecloth', form, res => {
this.fileList = []
if (res.code == 200) {
this.$emit('submit')
this.$refs.addPopup.close()
@ -35,15 +78,46 @@
},
open() {
console.log(this.$refs);
this.$refs.addLeaseForm.closeForm()
this.$refs.addPopup.open('bottom')
//
this.$refs.addressList.getAddressList().then(res => {
this.addressTotal = res.total
if (this.addressTotal != 0) {
this.address = res.records[0]
}
})
},
}
}
</script>
<style scoped lang="scss">
.address {
display: flex;
padding: 20rpx;
background-color: #fff;
border-bottom: 20rpx solid #f3f3f3;
image {
width: 30rpx;
height: 30rpx;
margin: 20rpx;
}
view {
margin: 20rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
.icon {
margin-left: auto;
}
}
.btn {
display: flex;
justify-content: center;


+ 3
- 2
pages_order/components/product/addLeaseForm.vue View File

@ -12,8 +12,9 @@
<view class="shopName">
<view>物品照片</view>
<view>
<uv-upload :fileList="fileList" multiple :maxCount="1" width="180rpx" height="180rpx" multiple
@afterRead="afterRead" @delete="deleteImage">
<uv-upload :fileList="fileList" :maxCount="1" width="180rpx"
height="180rpx" multiple
@afterRead="afterRead" @delete="deleteImage">
<image src="../../static/help/uploading.png" mode="aspectFill"
style="width: 180rpx;height: 180rpx;" />
</uv-upload>


+ 58
- 8
pages_order/components/product/submitUnitSelect.vue View File

@ -18,7 +18,8 @@
</view>
</view>
<view class="submit-unit"
<!-- 是否有桌布 -->
<!-- <view class="submit-unit"
style="margin-top: 20rpx;">
<view class="title">
您有{{ detail.categoryName }}
@ -29,7 +30,20 @@
{{ item }}{{ detail.categoryName }}
</view>
</view>
</view>
</view> -->
<!-- 我要购买租赁 -->
<!-- <view class="submit-unit"
style="margin-top: 20rpx;">
<view class="list">
<view :class="{act : buyIndex == index}"
v-for="(item, index) in buyType"
@click="buyIndex = index"
:key="index">
{{ item }}
</view>
</view>
</view> -->
<!-- 商品信息和数量 -->
<view v-if="typeIndex == 0">
@ -42,10 +56,12 @@
<view class="info">
<view class="price">
<!-- 租金<text>{{ unit.price }}</text> -->
租金<text>{{ unit.price }}</text>/
</view>
<view class="price">
押金<text>{{ detail.depositPrice }}</text>
<view class="price"
style="font-size: 22rpx;">
押金<text
style="font-size: 22rpx;">{{ detail.depositPrice }}</text>
</view>
<view class="unit">
请选择规格
@ -97,7 +113,12 @@
应付款{{ price }}
</view>
<view>
押金{{ price }}
<view class="">
押金{{ detail.depositPrice }}
</view>
<view class="">
x{{ num }}
</view>
</view>
<view v-if="coupon.couponCondition <= price
&& coupon.couponFlag">
@ -108,6 +129,18 @@
实付款{{ (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"
title="押金优惠"
@ -158,6 +191,7 @@
import addressList from '@/components/address/addressList.vue'
import couponList from '@/components/user/couponList.vue'
import addLeaseForm from './addLeaseForm.vue'
import { mapState } from 'vuex'
export default {
components: {
addressList,
@ -174,6 +208,7 @@
},
},
computed : {
...mapState(['configList']),
price(){
return (this.detail.depositPrice * this.num).toFixed(2)
},
@ -192,8 +227,10 @@
price : 0,
},
couponText : '请选择',
typeIndex : 0,
type : ['没有', '我有'],
typeIndex : 0,//
type : ['没有', '我有'],//
buyIndex : 0,//
buyType : ['我要租赁', '我要购买'],//
}
},
methods: {
@ -273,6 +310,11 @@
},
//
submitAddLease() {
if(!this.address.id){
return uni.showToast({
title: '请选择地址'
})
}
this.$refs.addLeaseForm.submit(form => {
form.addressId = this.address.id, //id
this.$api('tablecloth', form, res => {
@ -483,11 +525,19 @@
margin: 10rpx 0;
padding: 10rpx 20rpx;
line-height: 50rpx;
view{
display: flex;
justify-content: space-between;
}
}
.coupon{
text-align: center;
color: #5c5;
}
.payInfoMessage{
line-height: 50rpx;
}
}
.submit{


+ 80
- 27
pages_order/order/createWash.vue View File

@ -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>

+ 41
- 10
pages_order/order/orderDetail.vue View File

@ -19,6 +19,17 @@
:detail="order"></orderTypeBtn> -->
<view class="btns">
<!-- 水洗订单水洗店选择收货方式 -->
<template v-if="item.status == 4">
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 0})" class="b2">
快递取货
</view>
<view @click.stop="orderConfirmAccept(item, {logisticsFlag : 1})" class="b1">
自行配送
</view>
</template>
<view
v-if="[4, 18, 19].includes(order.status)"
@click.stop="orderConfirmAccept(order)">
@ -225,7 +236,7 @@
</view>
</view>
<view class="min_tips" v-if="order.washPay">
<view class="min_tips" v-if="!userShop && order.washPay">
<view class="">
水洗费用
</view>
@ -233,6 +244,16 @@
{{ order.washPay}}
</view>
</view>
<!-- 水洗店佣金 -->
<view class="min_tips" v-if="userShop && order.shopCoin">
<view class="">
佣金
</view>
<view class="">
{{ order.shopCoin }}
</view>
</view>
<!-- <view class="min_tips">
<view class="">
押金
@ -242,7 +263,7 @@
</view>
</view> -->
<view class="min_tips" v-if="order.discountPrice">
<view class="min_tips" v-if="!userShop && order.discountPrice">
<view class="">
已优惠
</view>
@ -278,31 +299,41 @@
</view>
<!-- 下单须知 -->
<view class="line">
<!-- <view class="t min_tips">
<view class="t min_tips">
<view class="">
下单须知
</view>
</view>
<view class="min_tips" style="line-height: 40rpx;">
{{msgShop.projectExplain}}
</view> -->
<view class="btns">
<view class="">
<view class="">
租金从物品确认收货开始计算{{ configList.depositPrice }}/
</view>
<view class="">
押金将按照面积计算每平方厘米1
</view>
</view>
<!-- {{msgShop.projectExplain}} -->
</view>
<!-- <view class="btns">
<view
v-if="!userShop"
@click="$utils.navigateTo('/pages_order/order/createWash')"
class="btnS">
我要水洗
</view>
</view>
</view> -->
<view class="btns">
<view @click="$refs.customerServicePopup.open()" class="btn">
联系平台客服
</view>
<view
<!-- <view
v-if="userShop"
@click="$refs.customerServicePopup.open(order.userPhone, '客户')" class="btn">
联系客户
@ -312,7 +343,7 @@
v-else
@click="$refs.customerServicePopup.open(bindShop.phone, '水洗店')" class="btn">
联系水洗店
</view>
</view> -->
</view>
</view>
@ -345,7 +376,7 @@
mixins : [mixinOrder],
computed: {
...mapGetters(['userShop']),
...mapState(['bindShop']),
...mapState(['bindShop', 'configList']),
},
data() {
return {


+ 2
- 2
pages_order/product/productDetail.vue View File

@ -42,12 +42,12 @@
</view>
<view class="info-unit">
<uv-cell :title="`您有${detail.categoryName}吗?`" isLink
<!-- <uv-cell :title="`您有${detail.categoryName}吗?`" isLink
@click="$refs.submitUnitSelect.open('bottom')">
<template #icon>
<text class="text">{{ detail.categoryName }}</text>
</template>
</uv-cell>
</uv-cell> -->
<uv-cell title="请选择规格" isLink
@click="$refs.submitUnitSelect.open('bottom')">


+ 2
- 2
store/store.js View File

@ -9,7 +9,7 @@ import Position from '@/utils/position.js'
//Vuex.Store 构造器选项
const store = new Vuex.Store({
state: {
configList: [], //配置列表
configList: {}, //配置列表
shop : false,
position : {//定位信息
latitude : 0,
@ -35,7 +35,7 @@ const store = new Vuex.Store({
// }
// })
let config = ['privacyXieYi']
let config = ['privacyXieYi', 'depositPrice']
config.forEach(k => {
api('getConfigOne', {
name : k


Loading…
Cancel
Save