Browse Source

上传

master
前端-胡立永 6 months ago
parent
commit
5a912325c5
14 changed files with 473 additions and 283 deletions
  1. +0
    -1
      api/api.js
  2. +2
    -2
      components/config/PrivacyAgreementPoup.vue
  3. +1
    -1
      components/user/cartSubmitSelect.vue
  4. +1
    -1
      config.js
  5. +23
    -0
      mixins/lease.js
  6. +5
    -1
      pages/index/order.vue
  7. +1
    -1
      pages_order/auth/wxLogin.vue
  8. +65
    -0
      pages_order/components/product/addLease.vue
  9. +168
    -0
      pages_order/components/product/addLeaseForm.vue
  10. +159
    -104
      pages_order/components/product/submitUnitSelect.vue
  11. +6
    -163
      pages_order/mine/lease.vue
  12. +20
    -7
      pages_order/order/createWash.vue
  13. +4
    -0
      pages_order/order/orderDetail.vue
  14. +18
    -2
      pages_order/product/productDetail.vue

+ 0
- 1
api/api.js View File

@ -324,7 +324,6 @@ const config = {
confCoupon: {
url: '/conf/coupon',
method: 'GET',
auth: true,
},
}


+ 2
- 2
components/config/PrivacyAgreementPoup.vue View File

@ -10,7 +10,7 @@
</view>
<view class="content_pri">
<view class="text">
欢迎来到布周!我们根据最新的法律法规监管政策要求更新了用户协议隐私政策,请您认真阅读
欢迎来到布周!我们根据最新的法律法规监管政策要求更新了用户协议隐私政策,请您认真阅读
</view>
</view>
<view class="config">
@ -18,7 +18,7 @@
<view class="content">
<view style="display: flex;">
<!-- <uv-checkbox size="30rpx" :name="1"></uv-checkbox> -->
同意<text @click="goToPrivacy">布周隐私政策</text>
同意<text @click="goToPrivacy">布周隐私政策</text>
</view>
<view class="">
以及<text @click="goToPrivacy">用户协议</text>


+ 1
- 1
components/user/cartSubmitSelect.vue View File

@ -108,7 +108,7 @@
},
props: {
submiitTitle: {
default: '立即租赁',
default: '立即下单',
type: String,
},
price : {//


+ 1
- 1
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置


+ 23
- 0
mixins/lease.js View File

@ -0,0 +1,23 @@
export default {
methods: {
isLeaseStatus(item){
if(!item.startTime
&& item.leaseFlag
&& item.status == 0){
return '待收货'
}
if(item.status != 0){
return ['正常', '换货中', '退货中'][item.status]
}
if(item.isWash){
return '水洗中'
}
}
}
}

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

@ -165,7 +165,7 @@
@click.stop="payOrder(item.orderLogId,
item.id, item.status == 10)" class="b2"
v-if="[0, 3, 10].includes(item.status)">
{{ item.status == 10 ? '支付平台损失' : '立即付款' }}
{{ item.status == 10 ? '支付费用' : '立即付款' }}
</view>
</view>
@ -271,6 +271,10 @@
},
onShow() {
this.getData()
if(this.userShop){
this.tabs[1].name = '租赁订单'
this.$forceUpdate()
}
},
onPullDownRefresh() {
this.getData()


+ 1
- 1
pages_order/auth/wxLogin.vue View File

@ -4,7 +4,7 @@
<!-- <image src="/static/image/login/logo.png" mode=""></image> -->
</view>
<view class="title">
欢迎使用布周
欢迎使用布周
</view>
<view class="btn mt"
@click="wxLogin">


+ 65
- 0
pages_order/components/product/addLease.vue View File

@ -0,0 +1,65 @@
<template>
<uv-popup ref="addPopup" :round="30">
<addLeaseForm ref="addLeaseForm"/>
<view class="btn" @click="submit">
<button class="a">添加</button>
</view>
</uv-popup>
</template>
<script>
import addLeaseForm from './addLeaseForm.vue'
export default {
components : {
addLeaseForm,
},
data() {
return {
}
},
methods: {
submit() {
this.$refs.addLeaseForm.submit(form => {
this.$api('tablecloth', form, res => {
this.fileList = []
if (res.code == 200) {
this.$emit('submit')
this.$refs.addPopup.close()
}
})
})
},
open() {
console.log(this.$refs);
this.$refs.addLeaseForm.closeForm()
this.$refs.addPopup.open('bottom')
},
}
}
</script>
<style scoped lang="scss">
.btn {
display: flex;
justify-content: center;
width: 100%;
.a {
display: flex;
justify-content: center;
align-items: center;
width: 90%;
height: 100rpx;
color: #FFF;
background-color: $uni-color;
border: 1px solid red;
border-radius: 100rpx;
font-size: 30rpx;
}
}
</style>

+ 168
- 0
pages_order/components/product/addLeaseForm.vue View File

@ -0,0 +1,168 @@
<template>
<view class="form">
<view class="shopName">
<view>物品分类</view>
<view class="list">
<view :class="{act : form.categoryId == item.id}" @click="form.categoryId = item.id" :key="index"
v-for="(item, index) in category">
{{ item.name }}
</view>
</view>
</view>
<view class="shopName">
<view>物品照片</view>
<view>
<uv-upload :fileList="fileList" multiple :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>
</view>
</view>
<view class="shopName">
<view>物品名称</view>
<view>
<input v-model="form.name" placeholder="请输入物品名称" clearable></input>
</view>
</view>
<view class="shopName">
<view>物品长度CM</view>
<view>
<input v-model="form.length" type="number" placeholder="请输入物品长度" clearable></input>
</view>
</view>
<view class="shopName">
<view>物品宽度CM</view>
<view>
<input v-model="form.wide" type="number" placeholder="请输入物品宽度" clearable></input>
</view>
</view>
<view class="shopName">
<view>物品数量</view>
<view>
<uv-number-box v-model="form.num" :min="1"></uv-number-box>
</view>
</view>
</view>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
form: {
categoryId: 0,
name: '',
num: 1,
length: '',
wide: '',
},
fileList: [],
}
},
computed: {
...mapState(['category']),
},
mounted() {
this.closeForm()
},
methods: {
submit(fn) {
this.form.pic = this.fileList.map((item) => item.url).join(",")
let form = {
...this.form
}
if (this.$utils.verificationAll(form, {
pic: '请上传物品照片',
name: '请输入物品名称',
length: '请输入物品长度',
wide: '请输入物品宽度',
})) {
return
}
fn && fn(form)
},
closeForm() {
this.form = {
categoryId: 0,
name: '',
num: 1,
length: '',
wide: '',
}
this.fileList = []
if (this.category.length) {
this.form.categoryId = this.category[0].id
}
},
deleteImage(e) {
this.fileList.splice(e.index, 1)
},
afterRead(e) {
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
}
}
</script>
<style scoped lang="scss">
.form {
padding: 20rpx 0;
.shopName {
display: flex;
align-items: center;
background-color: #FFF;
margin: 10rpx 0 0 0;
padding: 10rpx 20rpx;
>view:nth-of-type(1) {
width: 30%;
// font-weight: 700;
}
>view:nth-of-type(2) {
width: 70%;
// padding: 0 20rpx 0 0;
border-radius: 10rpx;
overflow: hidden;
input {
background-color: #f5f5f5;
// color: #a4a4a4;
font-size: 28rpx;
padding: 8rpx 8rpx 8rpx 15rpx;
}
}
}
}
.list {
display: flex;
flex-wrap: wrap;
font-size: 22rpx;
.act {
color: $uni-color;
border: 1px solid $uni-color;
background-color: #F9E7DE;
}
view {
border-radius: 15rpx;
background-color: #F3F3F3;
border: 1px solid #F3F3F3;
margin: 10rpx;
display: flex;
justify-content: center;
padding: 10rpx 20rpx;
}
}
</style>

+ 159
- 104
pages_order/components/product/submitUnitSelect.vue View File

@ -17,98 +17,118 @@
<uv-icon size="30rpx" name="arrow-right"></uv-icon>
</view>
</view>
<!-- 商品信息和数量 -->
<view class="submit-info">
<view class="title">
桌布租赁
</view>
<view class="box">
<image class="image" :src="unit.pic" mode=""></image>
<view class="info">
<view class="price">
<text>{{ detail.depositPrice }}</text>
</view>
<view class="unit">
请选择规格
</view>
<view class="">
<uv-number-box
@change="valChange"
v-model="num"></uv-number-box>
</view>
</view>
</view>
</view>
<!-- 规格 -->
<view class="submit-unit">
<view class="submit-unit"
style="margin-top: 20rpx;">
<view class="title">
规格选择
您有桌布吗
</view>
<view class="list">
<view :class="{act : unitIndex == index}" v-for="(item, index) in detail.hotelGoodsSkuList"
@click="selectUnit(item, index)" :key="index">
{{ item.title }}
<view :class="{act : typeIndex == index}" v-for="(item, index) in type"
@click="typeIndex = index" :key="index">
{{ item }}
</view>
</view>
</view>
<!-- 优惠劵 -->
<!-- <view style="padding: 0 20rpx;">
<uv-cell
icon="coupon"
title="优惠劵"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;"
:value="couponText"
@click="$refs.couponPopup.open('bottom')"
isLink>
</uv-cell>
</view> -->
<!-- 费用明细 -->
<view class="expense-detail">
<view class="title">
费用明细
</view>
<view class="detail" v-if="detail.depositPrice">
<view>
应付款{{ price }}
<!-- 商品信息和数量 -->
<view v-if="typeIndex == 0">
<view class="submit-info">
<view class="title">
桌布租赁
</view>
<view>
押金{{ price }}
<view class="box">
<image class="image" :src="unit.pic" mode=""></image>
<view class="info">
<view class="price">
<text>{{ detail.depositPrice }}</text>
</view>
<view class="unit">
请选择规格
</view>
<view class="">
<uv-number-box
@change="valChange"
v-model="num"></uv-number-box>
</view>
</view>
</view>
<view v-if="coupon.couponCondition <= price">
优惠-{{ coupon.couponPrice }}
</view>
<!-- 规格 -->
<view class="submit-unit">
<view class="title">
规格选择
</view>
<view v-if="coupon.couponCondition <= price">
实付款{{ (price - coupon.couponPrice).toFixed(2) }}
<view class="list">
<view :class="{act : unitIndex == index}" v-for="(item, index) in detail.hotelGoodsSkuList"
@click="selectUnit(item, index)" :key="index">
{{ item.title }}
</view>
</view>
</view>
<uv-cell
icon="coupon"
title="优惠"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;">
<template #value>
<view class="coupon">
{{ coupon.couponCondition }}立减{{ coupon.couponPrice }}
<!-- 优惠劵 -->
<!-- <view style="padding: 0 20rpx;">
<uv-cell
icon="coupon"
title="优惠劵"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;"
:value="couponText"
@click="$refs.couponPopup.open('bottom')"
isLink>
</uv-cell>
</view> -->
<!-- 费用明细 -->
<view class="expense-detail">
<view class="title">
费用明细
</view>
<view class="detail" v-if="detail.depositPrice">
<view>
应付款{{ price }}
</view>
<view>
押金{{ price }}
</view>
<view v-if="coupon.couponCondition <= price">
优惠-{{ coupon.couponPrice }}
</view>
<view v-if="coupon.couponCondition <= price">
实付款{{ (price - coupon.couponPrice).toFixed(2) }}
</view>
</template>
</uv-cell>
</view>
<uv-cell
icon="coupon"
title="优惠"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;">
<template #value>
<view class="coupon">
{{ coupon.couponCondition }}立减{{ coupon.couponPrice }}
</view>
</template>
</uv-cell>
</view>
</view>
<addLeaseForm ref="addLeaseForm" v-if="typeIndex == 1"/>
<!-- 提交按钮 -->
<view class="submit-btn">
<view class="l" @click="addCart">
加入租赁车
</view>
<view class="r" @click="orderPay">
{{ submiitTitle }}
<view class="submit">
<view class="submit-btn">
<view class="l" @click="addCart" v-if="typeIndex == 0">
加入租赁车
</view>
<view class="r" @click="orderPay">
{{ submiitTitle }}
</view>
</view>
</view>
@ -131,14 +151,16 @@
<script>
import addressList from '@/components/address/addressList.vue'
import couponList from '@/components/user/couponList.vue'
import addLeaseForm from './addLeaseForm.vue'
export default {
components: {
addressList,
couponList,
addLeaseForm,
},
props: {
submiitTitle: {
default: '立即租赁',
default: '立即下单',
type: String,
},
detail: {
@ -164,6 +186,8 @@
price : 0,
},
couponText : '请选择',
typeIndex : 0,
type : ['没有桌布', '我有桌布'],
}
},
methods: {
@ -241,7 +265,29 @@
}
})
},
//
submitAddLease() {
this.$refs.addLeaseForm.submit(form => {
form.addressId = this.address.id, //id
this.$api('tablecloth', form, res => {
if (res.code == 200) {
uni.redirectTo({
url: '/pages/index/order'
})
}
})
})
},
orderPay() {
//
if(this.typeIndex == 1){
return this.submitAddLease()
}
//
let data = [
{
@ -308,9 +354,10 @@
<style scoped lang="scss">
.content {
max-height: 80vh;
max-height: 70vh;
overflow: hidden;
overflow-y: auto;
padding-bottom: 120rpx;
.address {
display: flex;
@ -436,35 +483,43 @@
color: #5c5;
}
}
.submit-btn {
width: 600rpx;
height: 80rpx;
color: #fff;
border-radius: 40rpx;
font-size: 28rpx;
margin: 20rpx auto;
display: flex;
justify-content: center;
align-items: center;
border: 1rpx solid $uni-color;
overflow: hidden;
.l {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
color: $uni-color;
}
.r {
background: $uni-color;
flex: 1;
height: 100%;
.submit{
background-color: #fff;
position: fixed;
left: 0;
bottom: 0;
padding-bottom: env(safe-area-inset-bottom);
width: 100%;
.submit-btn {
width: 600rpx;
height: 80rpx;
color: #fff;
border-radius: 40rpx;
font-size: 28rpx;
margin: 20rpx auto;
display: flex;
justify-content: center;
align-items: center;
border: 1rpx solid $uni-color;
overflow: hidden;
.l {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
color: $uni-color;
}
.r {
background: $uni-color;
flex: 1;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
}
}
}

+ 6
- 163
pages_order/mine/lease.vue View File

@ -9,74 +9,23 @@
<commoditySelect ref="commoditySelect"/>
<view class="btn fixed" @click="open">
<!-- <view class="btn fixed" @click="$refs.addLease.open()">
<button class="a">添加物品</button>
</view>
</view> -->
<uv-popup ref="addPopup" :round="30">
<view class="form">
<view class="shopName">
<view>物品分类</view>
<view class="list">
<view :class="{act : form.categoryId == item.id}"
@click="form.categoryId = item.id"
:key="index"
v-for="(item, index) in category">
{{ item.name }}
</view>
</view>
</view>
<view class="shopName">
<view>物品照片</view>
<view>
<uv-upload :fileList="fileList" multiple :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>
</view>
</view>
<view class="shopName">
<view>物品名称</view>
<view>
<input v-model="form.name" placeholder="请输入物品名称" clearable></input>
</view>
</view>
<view class="shopName">
<view>物品长度CM</view>
<view>
<input v-model="form.length" type="number" placeholder="请输入物品长度" clearable></input>
</view>
</view>
<view class="shopName">
<view>物品宽度CM</view>
<view>
<input v-model="form.wide" type="number" placeholder="请输入物品宽度" clearable></input>
</view>
</view>
<view class="shopName">
<view>物品数量</view>
<view>
<uv-number-box v-model="form.num" :min="1"></uv-number-box>
</view>
</view>
</view>
<view class="btn" @click="submit">
<button class="a">添加</button>
</view>
</uv-popup>
<addLease ref="addLease" @submit="$refs.commoditySelect.getList()"/>
</view>
</template>
<script>
import commoditySelect from "../components/commodity/commoditySelect.vue"
import addLease from '../components/product/addLease.vue'
import { mapState } from 'vuex'
export default {
components : {
commoditySelect,
addLease,
},
data() {
return {
@ -87,24 +36,13 @@
name: '选择我的物品'
},
],
form : {
categoryId : 0,
name : '',
num : 1,
length : '',
wide : '',
},
fileList: [],
type : '',
}
},
computed : {
...mapState(['category']),
},
onLoad(args) {
this.type = args.type
if(this.type == 'add'){
this.$refs.addPopup.open('bottom')
this.$refs.addLease.open()
}
},
onShow() {
@ -121,52 +59,6 @@
// this.checkboxValue = []
// this.mixinsListApi = ['orderPage', 'orderPage'][index]
},
submit(){
this.form.pic = this.fileList.map((item) => item.url).join(",")
if (this.$utils.verificationAll(this.form, {
pic : '请上传物品照片',
name : '请输入物品名称',
length : '请输入物品长度',
wide : '请输入物品宽度',
})) {
return
}
this.$api('tablecloth', this.form, res => {
if(res.code == 200){
this.$refs.commoditySelect.getList()
this.$refs.addPopup.close()
}
})
},
open(){
this.form = {
categoryId : 0,
name : '',
num : 1,
length : '',
wide : '',
}
if(this.category.length){
this.form.categoryId = this.category[0].id
}
this.$refs.addPopup.open('bottom')
},
deleteImage(e){
this.fileList.splice(e.index, 1)
},
afterRead(e){
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
}
}
</script>
@ -202,55 +94,6 @@
font-size: 30rpx;
}
}
.list {
display: flex;
flex-wrap: wrap;
font-size: 22rpx;
.act {
color: $uni-color;
border: 1px solid $uni-color;
background-color: #F9E7DE;
}
view {
border-radius: 15rpx;
background-color: #F3F3F3;
border: 1px solid #F3F3F3;
margin: 10rpx;
display: flex;
justify-content: center;
padding: 10rpx 20rpx;
}
}
.form{
padding: 20rpx 0;
.shopName {
display: flex;
align-items: center;
background-color: #FFF;
margin: 10rpx 0 0 0;
padding: 10rpx 20rpx;
>view:nth-of-type(1) {
width: 30%;
// font-weight: 700;
}
>view:nth-of-type(2) {
width: 70%;
// padding: 0 20rpx 0 0;
border-radius: 10rpx;
overflow: hidden;
input {
background-color: #f5f5f5;
// color: #a4a4a4;
font-size: 28rpx;
padding: 8rpx 8rpx 8rpx 15rpx;
}
}
}
}
}
</style>

+ 20
- 7
pages_order/order/createWash.vue View File

@ -14,17 +14,23 @@
>
<view v-for="(item, index) in list" :key="index" class="item">
<view class="checkbox">
<uv-checkbox
<!-- <uv-checkbox
:name="item.id"
:disabled="item.status != 0
|| !item.startTime && item.leaseFlag
|| item.isWash"
activeColor="#FA5A0A"
size="40rpx"
icon-size="35rpx"></uv-checkbox> -->
<uv-checkbox
:name="item.id"
:disabled="!!item.statusInfo"
activeColor="#FA5A0A"
size="40rpx"
icon-size="35rpx"></uv-checkbox>
</view>
<image class="image" :src="item.pic || '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'"
mode=""></image>
<view class="info">
@ -39,7 +45,7 @@
规格{{ item.sku }}
<!-- <uv-icon name="arrow-down"></uv-icon> -->
</view>
<view class="wan"
<!-- <view class="wan"
v-if="!item.startTime
&& item.leaseFlag
&& item.status == 0">
@ -50,6 +56,9 @@
</view>
<view class="wan" v-else-if="item.isWash">
水洗中
</view> -->
<view class="wan" v-if="item.statusInfo">
{{ item.statusInfo }}
</view>
<view class="price" v-else>
<view class="" v-if="item.zujin">
@ -107,8 +116,9 @@
<script>
import cartSubmitSelect from '@/components/user/cartSubmitSelect.vue'
import mixinsList from '@/mixins/list.js'
import mixinLease from '@/mixins/lease.js'
export default {
mixins : [mixinsList],
mixins : [mixinsList, mixinLease],
components: {
cartSubmitSelect,
},
@ -183,9 +193,12 @@
return data
},
// getDataThen(list){
// list[0] && list[0].d = true
// },
getDataThen(list){
// list[0] && list[0].d = true
list.forEach(n => {
n.statusInfo = this.isLeaseStatus(n)
})
},
//
goCleaning() {


+ 4
- 0
pages_order/order/orderDetail.vue View File

@ -376,6 +376,10 @@
},
onShow() {
this.getData()
if(this.userShop){
this.typeText[0].name = '租赁订单'
this.$forceUpdate()
}
},
onPullDownRefresh() {
this.getData()


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

@ -37,7 +37,7 @@
</view>
<view class="info-unit">
<uv-cell title="有桌布" isLink
<uv-cell title="是否有桌布" isLink
@click="$utils.navigateTo('/pages_order/mine/lease?type=add')">
<template #icon>
<text class="text">桌布</text>
@ -71,6 +71,7 @@
<image
v-for="(item,index) in detail.detail && detail.detail.split(',')"
:src="item"
:key="index"
style="width: 100%;"
mode="widthFix"></image>
</view>
@ -84,16 +85,20 @@
<submitUnitSelect ref="submitUnitSelect"
v-if="detail.id"
:detail="detail"/>
<!-- <addLease ref="addLease" @submit=""/> -->
</view>
</template>
<script>
import addLease from '../components/product/addLease.vue'
import submit from '../components/product/submit.vue'
import submitUnitSelect from '../components/product/submitUnitSelect.vue'
export default {
components : {
submit,
submitUnitSelect
submitUnitSelect,
addLease,
},
data() {
return {
@ -123,6 +128,17 @@
},
handleSubmit(){
this.$refs.submitUnitSelect.open()
// uni.showModal({
// title: '',
// cancelText: '',
// confirmText: '',
// success(r) {
// if(r.confirm){
// }else{
// }
// }
// })
},
getData(){
this.$api('goodsOne', {


Loading…
Cancel
Save