chenkun 5 months ago
parent
commit
31d7f0b1d8
6 changed files with 380 additions and 326 deletions
  1. +17
    -1
      api/api.js
  2. +18
    -5
      components/userShop/seleteJobTime.vue
  3. +5
    -1
      pages/index/cart.vue
  4. +6
    -9
      pages/index/center.vue
  5. +230
    -219
      pages_order/components/product/submitUnitSelect.vue
  6. +104
    -91
      pages_order/order/orderDetail.vue

+ 17
- 1
api/api.js View File

@ -228,8 +228,16 @@ const config = {
// showLoading : true,
auth: true,
},
// 商品租赁下订单
orderCreate: {
url: '/order/create',
method: 'POST',
showLoading : true,
limit: 500,
auth: true,
},
// 商品租赁下单
// 商品租赁订单支付
orderPay: {
url: '/order/pay',
method: 'POST',
@ -237,6 +245,14 @@ const config = {
limit: 500,
auth: true,
},
// 确认收货
orderConfirm: {
url: '/order/confirm',
method: 'POST',
showLoading : true,
limit: 500,
auth: true,
},
}


+ 18
- 5
components/userShop/seleteJobTime.vue View File

@ -5,8 +5,8 @@
<view class="rect" @tap.stop>
<view class="title">修改营业时间</view>
<view class="center">
<view style="display: flex;justify-content: center;gap: 20rpx;">
<view>上班时间</view>
<view style="display: flex;justify-content: space-around;">
<view>上班时间</view>
<view @click="startDateOpen()">
{{ startTime }}
<uv-datetime-picker ref="startDateRef" v-model="startTime" mode="time"
@ -14,8 +14,8 @@
</view>
</view>
<view style="display: flex;justify-content: center;gap: 20rpx;">
<view>下班时间</view>
<view style="display: flex;justify-content: space-around;">
<view>下班时间</view>
<view @click="endDateOpen()">
{{ endTime }}
<uv-datetime-picker style="z-index: 999;" ref="endDateRef" v-model="endTime" mode="time"
@ -39,6 +39,10 @@
</template>
<script>
import {
mapGetters,
mapState,
} from 'vuex'
import dayjs from '../../uni_modules/uv-ui-tools/libs/util/dayjs';
export default {
data() {
@ -49,6 +53,8 @@
}
},
computed: {
...mapGetters(['userShop']),
...mapState(['userInfo']),
customStyle1() {
return {
height: '60rpx',
@ -79,12 +85,15 @@
}
}
},
onShow() {
this.$store.commit('getUserInfo')
},
methods: {
startDateChange(val) {
this.$nextTick(() => {
this.startTime = val.value
});
},
startDateOpen() {
@ -102,6 +111,8 @@
open() {
this.show = true
this.startTime = this.userInfo.shop.jobTime.split("-")[0]
this.endTime = this.userInfo.shop.jobTime.split("-")[1]
},
close() {
this.show = false
@ -113,6 +124,7 @@
time: this.startTime + '-' + this.endTime
}, res => {
if (res.code == 200) {
this.$store.commit('getUserInfo')
uni.showToast({
icon: 'success',
title: '修改营业时间成功',
@ -163,6 +175,7 @@
// justify-content: center;
// align-items: center;
font-size: 36rpx;
padding: 20rpx 50rpx 0 50rpx;
}
.bottom {


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

@ -72,7 +72,7 @@
{{ checkboxValue.length }}已享受更低优惠
</view>
</view>
<view class="btn">
<view class="btn" @click="goCleaning">
去结算
</view>
</view>
@ -138,6 +138,10 @@
id : item.id,
num : e.value,
})
},
//
goCleaning(){
},
//
getData(){


+ 6
- 9
pages/index/center.vue View File

@ -11,17 +11,14 @@
<view class="name">
{{ userInfo.nickName || '微信用户' }}
</view>
<!-- 营业时间写这个view里面 -->
<view v-if="userShop">
<view class="jobTime"
@click="$refs.seleteJobTimePopup.open()">
请设置营业时间
<view class="jobTime" @click="$refs.seleteJobTimePopup.open()">
{{ userInfo && userInfo.shop && userInfo.shop.jobTime ? '营业时间:'+userInfo.shop.jobTime : "请设置营业时间" }}
</view>
<!-- 往这里写 -->
</view>
<!-- <view class="vip">
VIP1
@ -178,7 +175,6 @@
},
onShow() {
this.$store.commit('getUserInfo')
//
if (this.userShop) {
this.getUserPage()
@ -208,6 +204,7 @@
},
//
getUserPage() {
console.log(this.userInfo.nickName);
this.$api('getMyUserPage', this.queryParams, res => {
uni.stopPullDownRefresh()
if (res.code == 200) {
@ -219,7 +216,7 @@
},
//
setJobTime() {
},
}
}


+ 230
- 219
pages_order/components/product/submitUnitSelect.vue View File

@ -1,12 +1,9 @@
<template>
<uv-popup ref="popup"
:round="30"
bgColor="#f7f7f7">
<uv-popup ref="popup" :round="30" bgColor="#f7f7f7">
<view class="content">
<!-- 地址 -->
<view class="address"
@click="openAddress">
<view class="address" @click="openAddress">
<image src="../../static/address/selectIcon.png" mode=""></image>
<view class="">
{{ address.name }}
@ -15,23 +12,18 @@
{{ address.addressDetail }}
</view>
<view class="icon">
<uv-icon
size="30rpx"
name="arrow-right"></uv-icon>
<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>
<image class="image" :src="unit.pic" mode=""></image>
<view class="info">
<view class="price">
<text>{{ unit.depositPrice }}</text>
@ -45,24 +37,22 @@
</view>
</view>
</view>
<!-- 规格 -->
<view class="submit-unit">
<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">
<view :class="{act : unitIndex == index}" v-for="(item, index) in detail.hotelGoodsSkuList"
@click="selectUnit(item, index)" :key="index">
{{ item.title }}
</view>
</view>
</view>
<!-- 费用明细 -->
<view class="expense-detail">
<view class="title">
@ -72,27 +62,21 @@
押金{{ unit.depositPrice }}
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn">
<view class="l"
@click="addCart">
<view class="l" @click="addCart">
加入租赁车
</view>
<view class="r"
@click="orderPay">
<view class="r" @click="orderPay">
{{ submiitTitle }}
</view>
</view>
</view>
<uv-popup ref="addressPopup" :round="30">
<addressList
ref="addressList"
height="60vh"
@select="selectAddress"
/>
<addressList ref="addressList" height="60vh" @select="selectAddress" />
</uv-popup>
</uv-popup>
</template>
@ -100,52 +84,52 @@
<script>
import addressList from '../address/addressList.vue'
export default {
components : {
components: {
addressList,
},
props : {
submiitTitle : {
default : '立即租赁',
type : String,
props: {
submiitTitle: {
default: '立即租赁',
type: String,
},
detail : {
default : {}
detail: {
default: {}
}
},
data() {
return {
unitIndex : 0,
address : {
name : '请选择联系人',
addressDetail : '',
unitIndex: 0,
address: {
name: '请选择联系人',
addressDetail: '',
},
num : 1,
unit : {},
addressTotal : 0,
num: 1,
unit: {},
addressTotal: 0,
}
},
methods: {
//
open(){
open() {
this.$refs.popup.open('bottom')
if(!this.unit.id){
if (!this.unit.id) {
this.selectUnit(this.detail.hotelGoodsSkuList[0], 0)
}
//
this.$refs.addressList.getAddressList().then(res => {
this.addressTotal = res.total
if(this.addressTotal != 0){
if (this.addressTotal != 0) {
this.address = res.records[0]
}
})
},
//
close(){
close() {
this.$refs.popup.close()
},
//
openAddress(){
openAddress() {
if (this.addressTotal == 0) {
return uni.navigateTo({
url: '/pages_order/mine/address'
@ -154,21 +138,21 @@
this.$refs.addressPopup.open('bottom')
},
//
selectAddress(e){
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
},
//
selectUnit(item, index){
selectUnit(item, index) {
this.unit = item
this.unitIndex = index
},
addCart(){
addCart() {
this.$api('cartAdd', {
id : this.detail.id,
skuId : this.unit.id,
id: this.detail.id,
skuId: this.unit.id,
}, res => {
if(res.code == 200){
if (res.code == 200) {
uni.showToast({
title: '添加成功',
});
@ -176,52 +160,56 @@
}
})
},
orderPay(){
orderPay() {
let data = {
id : this.detail.id,//id
skuId : this.unit.id,//id
addressId : this.address.id,//id
sku : this.unit.title,//
num : this.num,
id: this.detail.id, //id
skuId: this.unit.id, //id
addressId: this.address.id, //id
sku: this.unit.title, //
num: this.num,
}
if(this.$utils.verificationAll(data, {
skuId : '请选择规格',
addressId : '请选择地址',
})){
if (this.$utils.verificationAll(data, {
skuId: '请选择规格',
addressId: '请选择地址',
})) {
return
}
this.$api('orderPay', data, res => {
if(res.code == 200){
uni.redirectTo({
url: '/pages/index/order'
this.$api('orderCreate', {req:JSON.stringify(data)}, res => {
if (res.code == 200) {
let form = {
id: res.result.id
}
this.$api('orderPay', form, res => {
if (res.code == 200) {
uni.requestPayment({
provider: 'wxpay', //
timeStamp: res.result.timeStamp, //
nonceStr: res.result.nonceStr, //
package: res.result.packageValue,
signType: res.result.signType, //
paySign: res.result.paySign, //
success: function(res) {
// console.log('', res);
uni.redirectTo({
url: '/pages/index/order'
})
},
fail: function(err) {
console.log('支付失败', err);
// self.$refs.confirmationPopup.close()
uni.showToast({
icon: 'none',
title: "支付失败"
})
}
});
}
})
// uni.requestPayment({
// provider: 'wxpay', //
// timeStamp: res.result.timeStamp, //
// nonceStr: res.result.nonceStr, //
// package: res.result.packageValue,
// signType: res.result.signType, //
// paySign: res.result.paySign, //
// success: function (res) {
// console.log('',res);
// uni.redirectTo({
// url: '/pages/index/order'
// })
// },
// fail: function (err) {
// console.log('',err);
// uni.showToast({
// icon:'none',
// title:""
// })
// }
// });
}
})
},
@ -230,137 +218,160 @@
</script>
<style scoped lang="scss">
.content{
max-height: 80vh;
overflow: hidden;
overflow-y: auto;
.address{
display: flex;
padding: 20rpx;
background-color: #fff;
image{
width: 30rpx;
height: 30rpx;
margin: 20rpx;
}
view{
margin: 20rpx;
overflow:hidden; //
text-overflow:ellipsis; //
white-space:nowrap; //
}
.icon{
margin-left: auto;
}
}
.submit-info{
background-color: #fff;
padding: 30rpx;
margin-top: 20rpx;
.title{
font-size: 30rpx;
padding: 10rpx;
font-weight: 600;
}
.box{
.content {
max-height: 80vh;
overflow: hidden;
overflow-y: auto;
.address {
display: flex;
margin-top: 10rpx;
.image{
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
margin-right: 20rpx;
padding: 20rpx;
background-color: #fff;
image {
width: 30rpx;
height: 30rpx;
margin: 20rpx;
}
.info{
flex: 1;
.unit{
font-size: 24rpx;
padding: 10rpx 20rpx;
color: #717171;
display: flex;
align-items: center;
view {
margin: 20rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
.icon {
margin-left: auto;
}
}
.submit-info {
background-color: #fff;
padding: 30rpx;
margin-top: 20rpx;
.title {
font-size: 30rpx;
padding: 10rpx;
font-weight: 600;
}
.box {
display: flex;
margin-top: 10rpx;
.image {
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
margin-right: 20rpx;
}
.price{
color: $uni-color;
font-size: 28rpx;
padding: 10rpx 20rpx;
text{
font-size: 36rpx;
font-weight: 900;
.info {
flex: 1;
.unit {
font-size: 24rpx;
padding: 10rpx 20rpx;
color: #717171;
display: flex;
align-items: center;
}
.price {
color: $uni-color;
font-size: 28rpx;
padding: 10rpx 20rpx;
text {
font-size: 36rpx;
font-weight: 900;
}
}
}
}
}
}
.submit-unit{
padding: 30rpx;
background-color: #fff;
.title{
font-size: 28rpx;
font-weight: 600;
}
.list{
display: flex;
flex-wrap: wrap;
font-size: 22rpx;
.act{
color: $uni-color;
border: 1px solid $uni-color;
background-color: #F9E7DE;
.submit-unit {
padding: 30rpx;
background-color: #fff;
.title {
font-size: 28rpx;
font-weight: 600;
}
view{
border-radius: 15rpx;
width: 320rpx;
background-color: #F3F3F3;
border: 1px solid #F3F3F3;
margin: 10rpx;
.list {
display: flex;
justify-content: center;
padding: 15rpx 0;
flex-wrap: wrap;
font-size: 22rpx;
.act {
color: $uni-color;
border: 1px solid $uni-color;
background-color: #F9E7DE;
}
view {
border-radius: 15rpx;
width: 320rpx;
background-color: #F3F3F3;
border: 1px solid #F3F3F3;
margin: 10rpx;
display: flex;
justify-content: center;
padding: 15rpx 0;
}
}
}
}
.expense-detail{
padding: 30rpx;
background-color: #fff;
font-size: 28rpx;
.title{
font-weight: 600;
}
.detail{
background-color: #F6F6F6;
color: #717171;
margin: 10rpx 0;
padding: 10rpx 20rpx;
}
}
.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;
.expense-detail {
padding: 30rpx;
background-color: #fff;
font-size: 28rpx;
.title {
font-weight: 600;
}
.detail {
background-color: #F6F6F6;
color: #717171;
margin: 10rpx 0;
padding: 10rpx 20rpx;
}
}
.r{
background: $uni-color;
flex: 1;
height: 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;
}
}
}
}
</style>
</style>

+ 104
- 91
pages_order/order/orderDetail.vue View File

@ -1,93 +1,79 @@
<template>
<view>
<navbar
title="订单详情"
leftClick
@leftClick="$utils.navigateBack"
/>
<navbar title="订单详情" leftClick @leftClick="$utils.navigateBack" />
<!-- 水洗店 -->
<view class=""
v-if="userShop">
<view class="" v-if="userShop">
<view class="controls">
<view class="title">
<image src="../static/order/icon.png" mode=""></image>
服务完成
<image :src="order.pic" mode=""></image>
<!-- 服务完成 -->
{{order.typeDictText}}
</view>
<view class="tips">
待送回
<!-- 待送回 -->
{{order.statusDictText}}
</view>
<view class="btns">
<view class="btn1">
快递寄回
</view>
<view class="btn2">
线下配送
</view>
<orderTypeBtn :type='order.type' :status='order.status'></orderTypeBtn>
</view>
</view>
<view class="steps">
<uv-steps
activeColor="#FD5100"
:current="stepsCurrent" dot>
<uv-steps-item :title="item"
:key="index"
v-for="(item, index) in steps"></uv-steps-item>
<uv-steps activeColor="#FD5100" :current="stepsCurrent" dot>
<uv-steps-item :title="item" :key="index" v-for="(item, index) in steps"></uv-steps-item>
</uv-steps>
</view>
</view>
<!-- 酒店和水洗店 -->
<view class="info">
<view class="flex"
style="display: flex;">
<view class="flex" style="display: flex;">
<view style="width: 8rpx;height: 30rpx;
background: #FD5100;border-radius: 6rpx;" />
<view class="head-title">{{ typeText[order.type].name }}</view>
</view>
<view class="flex">
<view class="server-item">
<view class="img-box">
<image :src="order.pic" mode="aspectFill"></image>
<image :src="order.reasonPic" mode="aspectFill"></image>
</view>
<view class="server-info">
<view class="server-title">
{{order.title}}
{{order.goodsName}}
<!-- <view class="coupon">领券立减</view> -->
</view>
<view class="current-price"
v-if="order.orderPay">
<view class="current-price" v-if="order.orderPay">
<text class="unit"></text>{{order.orderPay}}
</view>
<view class="sales-volume" style="margin-top: 5px;">
<view class="desc">规格{{order.sku}}</view>
</view>
<view class="time-coupon">
<!-- <view class="flex">
<image src="@/static/home/time-icon.png"></image>
<view class="time">{{msgOrder.useTime}}分钟</view>
</view> -->
<!-- <view class="sales-volume">
<image src="@/static/icons/icon1.png"></image>
<view class="desc">已售出{{msgShop.payNum}}+</view>
</view> -->
</view>
</view>
</view>
</view>
<!-- <view class="line min_tips">
<view class="head-div flex">
<view style="width: 118rpx;height: 118rpx;border-radius: 50%;overflow: hidden;">
@ -114,14 +100,16 @@
服务技师
</view>
</view> -->
<view class="line address">
<view class="address-top">
<view class="">
收货地址
</view>
<view class="copy">
<image @click="$utils.copyText(order.userName + ' ' + order.userPhone + ' ' + order.userAddress)" src="../static/order/copy.png"></image>
<image
@click="$utils.copyText(order.userName + ' ' + order.userPhone + ' ' + order.userAddress)"
src="../static/order/copy.png"></image>
</view>
</view>
<view class="addressDetail">
@ -129,13 +117,12 @@
<view class="">{{order.userAddress}}</view>
</view>
</view>
<view class="line">
<!-- 水洗店不展示 -->
<view class="t min_tips"
v-if="!userShop && item.orderPay">
<view class="t min_tips" v-if="!userShop && item.orderPay">
<view class="">
实付款
</view>
@ -143,10 +130,9 @@
{{ order.orderPay }}
</view>
</view>
<!-- 水洗店不展示 -->
<view class="min_tips"
v-if="!userShop && item.rentPay">
<view class="min_tips" v-if="!userShop && item.rentPay">
<view class="">
租赁费用
</view>
@ -154,9 +140,8 @@
{{ order.rentPay }}
</view>
</view>
<view class="min_tips"
v-if="item.washPay">
<view class="min_tips" v-if="item.washPay">
<view class="">
水洗费用
</view>
@ -173,7 +158,7 @@
</view>
</view> -->
</view>
<!-- 订单信息 -->
<view class="line">
<view class="t min_tips">
@ -198,8 +183,8 @@
</view>
</view>
</view>
<!-- 下单须知 -->
<view class="line">
<view class="t min_tips">
@ -216,30 +201,36 @@
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { mapGetters } from 'vuex'
import {
mapGetters
} from 'vuex'
import orderTypeBtn from "../components/order/orderTypeBtn.vue"
export default {
computed : {
components: {
orderTypeBtn
},
computed: {
...mapGetters(['userShop']),
},
data() {
return {
stepsCurrent : 0,
steps : [
stepsCurrent: 0,
steps: [
'接单',
'检查',
'开始清洗',
'服务完成',
],
order : {},
orderId : 0,
typeText: [
{
order: {},
orderId: 0,
typeText: [{
name: '租赁押金'
},
{
@ -259,15 +250,29 @@
this.getData()
},
methods: {
getData(){
//
getData() {
this.$api('orderOne', {
id : this.orderId
id: this.orderId
}, res => {
if(res.code == 200){
if (res.code == 200) {
this.order = res.result
}
})
},
//
confirmReceiveGoods() {
this.$api('orderConfirm', {
id: this.orderId
}, res => {
if (res.code == 200) {
uni.navigateBack({
delta: -1
})
}
})
},
}
}
</script>
@ -277,8 +282,8 @@
background: linear-gradient(#4899a6, #6fc6ad, #6fc6ad);
padding-bottom: 10px;
}
.controls{
.controls {
margin: 20rpx;
background-color: #fff;
height: 400rpx;
@ -288,26 +293,31 @@
border-radius: 20rpx;
justify-content: center;
align-items: center;
.title{
.title {
display: flex;
justify-content: center;
align-items: center;
font-size: 40rpx;
image{
image {
width: 100rpx;
height: 100rpx;
margin-right: 20rpx;
}
}
.tips{
.tips {
font-size: 26rpx;
color: #FD5100;
margin-top: 10rpx;
}
.btns{
.btns {
margin-top: 50rpx;
display: flex;
view{
view {
margin: 0 20rpx;
display: flex;
justify-content: center;
@ -317,14 +327,16 @@
padding: 15rpx 40rpx;
border-radius: 40rpx;
}
.btn2{
.btn2 {
background-color: #FFFFFF;
border: 1px solid #A7A7A7;
color: #A7A7A7;
}
}
}
.steps{
.steps {
margin: 20rpx;
background-color: #fff;
display: flex;
@ -332,7 +344,8 @@
width: 710rpx;
border-radius: 20rpx;
padding: 70rpx 0;
/deep/ .uv-text__value{
/deep/ .uv-text__value {
font-size: 22rpx !important;
}
}
@ -354,8 +367,8 @@
font-size: 25rpx;
margin-right: 10rpx;
}
.btc{
.btc {
background: #ccc;
}
}
@ -468,18 +481,18 @@
}
.address {
.address-top{
.address-top {
display: flex;
justify-content: space-between;
align-items: center;
image{
image {
width: 30rpx;
height: 30rpx;
}
}
.addressDetail {
color: #777;
font-size: 22rpx;
@ -534,13 +547,13 @@
position: relative;
display: flex;
align-items: center;
image {
height: 45rpx;
width: 90rpx;
vertical-align: middle;
}
.auth {
position: absolute;
white-space: nowrap;
@ -584,4 +597,4 @@
}
}
}
</style>
</style>

Loading…
Cancel
Save