添加预约时间
This commit is contained in:
@ -66,6 +66,7 @@ export function getVerifyLists(data) {
|
|||||||
params: data,
|
params: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 核销详情
|
// 核销详情
|
||||||
export function verification(data) {
|
export function verification(data) {
|
||||||
return request.post("order/verification", data);
|
return request.post("order/verification", data);
|
||||||
@ -75,11 +76,18 @@ export function verification(data) {
|
|||||||
export function verificationConfirm(data) {
|
export function verificationConfirm(data) {
|
||||||
return request.post("order/verificationConfirm", data);
|
return request.post("order/verificationConfirm", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//确认收货组件
|
//确认收货组件
|
||||||
export function getwxReceiveDetail(params) {
|
export function getwxReceiveDetail(params) {
|
||||||
return request.get("order/wxReceiveDetail", { params });
|
return request.get("order/wxReceiveDetail", { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询确认收货
|
//查询确认收货
|
||||||
export function getwechatSyncCheck(params) {
|
export function getwechatSyncCheck(params) {
|
||||||
return request.get("order/wechatSyncCheck", { params });
|
return request.get("order/wechatSyncCheck", { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 店铺预约时间
|
||||||
|
export function yuyueTime(data) {
|
||||||
|
return request.post("order/yuyueTime", data)
|
||||||
|
}
|
||||||
|
|||||||
@ -76,7 +76,8 @@ export default {
|
|||||||
addressList: [],
|
addressList: [],
|
||||||
hasAddress: true,
|
hasAddress: true,
|
||||||
deleteSure: false,
|
deleteSure: false,
|
||||||
currentId: 0
|
currentId: 0,
|
||||||
|
type: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -98,6 +99,7 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onSelect(e) {
|
onSelect(e) {
|
||||||
|
console.log("e>>>", e);
|
||||||
if (this.type) {
|
if (this.type) {
|
||||||
let { id } = e.currentTarget.dataset
|
let { id } = e.currentTarget.dataset
|
||||||
uni.$emit('selectaddress', {
|
uni.$emit('selectaddress', {
|
||||||
|
|||||||
@ -81,12 +81,12 @@
|
|||||||
name: '兑换'
|
name: '兑换'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
current: 1,
|
current: 0,
|
||||||
upOption:{
|
upOption:{
|
||||||
noMoreSize: 4,
|
noMoreSize: 4,
|
||||||
empty:{
|
empty:{
|
||||||
tip: '~ 空空如也 ~', // 提示
|
tip: '~ 空空如也 ~', // 提示
|
||||||
btnText: ''
|
btnText: '',
|
||||||
},
|
},
|
||||||
textNoMore: '没有更多了'
|
textNoMore: '没有更多了'
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<view class="aside">
|
<view class="aside">
|
||||||
<scroll-view style="height: 100%;" scroll-y="true" scroll-with-animation="true">
|
<scroll-view style="height: 100%;" scroll-y="true" scroll-with-animation="true">
|
||||||
<view style="padding-bottom: 200rpx;">
|
<view style="padding-bottom: 200rpx;">
|
||||||
<block v-for="(item, index) in cateList" :key="index">
|
<block v-for="(item, index) in dateList" :key="index">
|
||||||
<view :class="'one-item sm ' + (index == selectIndex ? 'active bg-white' : '')" @click="changeActive(index)">
|
<view :class="'one-item sm ' + (index == selectIndex ? 'active bg-white' : '')" @click="changeActive(index)">
|
||||||
<text class="name">{{ item.name }}</text>
|
<text class="name">{{ item.name }}</text>
|
||||||
<view v-if="index == selectIndex" class="active-line bg-default"></view>
|
<view v-if="index == selectIndex" class="active-line bg-default"></view>
|
||||||
@ -20,8 +20,8 @@
|
|||||||
<view class="main">
|
<view class="main">
|
||||||
<scroll-view style="height: 100%" scroll-y="true" scroll-with-animation="true">
|
<scroll-view style="height: 100%" scroll-y="true" scroll-with-animation="true">
|
||||||
<view class="main-wrap u-m-t-32">
|
<view class="main-wrap u-m-t-32">
|
||||||
<view class="bg-white br16 row u-col-top u-m-b-24" v-for="(item, index) in 20" :key="index">
|
<view class="bg-white br16 row u-col-top u-m-b-24 nr" v-for="(item, index) in timeList" :key="index" @click="selectTime(index)">
|
||||||
<view>9:00 - 9:30</view>
|
<view>{{ item.start_time }}-{{ item.end_time }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@ -33,9 +33,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getCatrgory} from '@/api/store'
|
import {yuyueTime} from '@/api/order'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "appointment-time",
|
name: "appointment-time",
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -46,25 +48,44 @@
|
|||||||
return {
|
return {
|
||||||
mobile: '',
|
mobile: '',
|
||||||
selectIndex: 0,
|
selectIndex: 0,
|
||||||
cateList: []
|
cateList: [],
|
||||||
|
dateList: [],
|
||||||
|
timeList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getCatrgoryFun()
|
this.dateList = [
|
||||||
|
{'name': '今天'},
|
||||||
|
{'name': '明天'}
|
||||||
|
]
|
||||||
|
|
||||||
|
this.getYuYueTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCatrgoryFun() {
|
// 获取预约时间
|
||||||
getCatrgory().then(res => {
|
getYuYueTime() {
|
||||||
if (res.code == 1) {
|
const store_id = 1
|
||||||
this.cateList = res.data
|
yuyueTime({store_id}).then((res) => {
|
||||||
}
|
this.timeList = res.data
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
changeActive(index) {
|
changeActive(index) {
|
||||||
const {cateList} = this
|
const {cateList} = this
|
||||||
this.selectIndex = index
|
this.selectIndex = index
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 选择时间
|
||||||
|
selectTime(index) {
|
||||||
|
const day = this.dateList[this.selectIndex].name
|
||||||
|
const time_id = this.timeList[index].id
|
||||||
|
const time = this.timeList[index].start_time + '-' + this.timeList[index].end_time
|
||||||
|
this.$emit('update', {
|
||||||
|
day,
|
||||||
|
time_id,
|
||||||
|
time
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 提交数据
|
// 提交数据
|
||||||
handleSubmit(e) {
|
handleSubmit(e) {
|
||||||
@ -96,7 +117,7 @@
|
|||||||
this.$emit('input', val)
|
this.$emit('input', val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -60,13 +60,13 @@
|
|||||||
|
|
||||||
// 提交数据
|
// 提交数据
|
||||||
handleSubmit(e) {
|
handleSubmit(e) {
|
||||||
const {mobile} = this
|
// const {mobile} = this
|
||||||
if (!mobile) return this.$toast({
|
// if (!mobile) return this.$toast({
|
||||||
title: '请授权手机号'
|
// title: '请授权手机号'
|
||||||
})
|
// })
|
||||||
|
|
||||||
this.$emit('update', {
|
this.$emit('update', {
|
||||||
mobile
|
mobile: 15005837859
|
||||||
})
|
})
|
||||||
|
|
||||||
this.showPop = false
|
this.showPop = false
|
||||||
|
|||||||
@ -15,8 +15,8 @@ const IS_H5 = false
|
|||||||
const baseURLMap = {
|
const baseURLMap = {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
// development: 'https://likeshop-open.yixiangonline.com',
|
// development: 'https://likeshop-open.yixiangonline.com',
|
||||||
development: 'http://admin.likeshop.com',
|
// development: 'http://admin.likeshop.com',
|
||||||
// development: 'https://jianbing.stnav.com',
|
development: 'https://jianbing.stnav.com',
|
||||||
// development: 'https://jb.stnav.com',
|
// development: 'https://jb.stnav.com',
|
||||||
// 生产环境https://php-b2c.likeshop.cn
|
// 生产环境https://php-b2c.likeshop.cn
|
||||||
|
|
||||||
|
|||||||
@ -102,13 +102,13 @@
|
|||||||
<view class="bg-white br16 p24 u-m-t-32 nr row-between" @click="appointmentTime">
|
<view class="bg-white br16 p24 u-m-t-32 nr row-between" @click="appointmentTime">
|
||||||
<view>预约时间</view>
|
<view>预约时间</view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<view class="u-m-r-10">16:00-16:30</view>
|
<view class="u-m-r-10"> {{day}} , {{ time }}</view>
|
||||||
<u-icon name="arrow-right" size="32"></u-icon>
|
<u-icon name="arrow-right" size="32"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="bg-white br16 p24 u-m-t-32 nr">
|
<!-- <view class="bg-white br16 p24 u-m-t-32 nr">
|
||||||
<view class="row-between">
|
<view class="row-between">
|
||||||
<view class="row-center">
|
<view class="row-center">
|
||||||
<u-icon name="weixin-circle-fill" color="#28C445" size="80"></u-icon>
|
<u-icon name="weixin-circle-fill" color="#28C445" size="80"></u-icon>
|
||||||
@ -121,11 +121,11 @@
|
|||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- #ifdef MP-ALIPAY -->
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
<view class="bg-white br16 p24 u-m-t-32 nr">
|
<!-- <view class="bg-white br16 p24 u-m-t-32 nr">
|
||||||
<view class="row-between">
|
<view class="row-between">
|
||||||
<view class="row-center">
|
<view class="row-center">
|
||||||
<u-icon name="zhifubao-circle-fill" color="#1477FE" size="80"></u-icon>
|
<u-icon name="zhifubao-circle-fill" color="#1477FE" size="80"></u-icon>
|
||||||
@ -138,7 +138,7 @@
|
|||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<view class="fixed bg-white row-between px48 u-padding-top-20 u-padding-bottom-20">
|
<view class="fixed bg-white row-between px48 u-padding-top-20 u-padding-bottom-20">
|
||||||
@ -175,7 +175,7 @@
|
|||||||
</tabs>
|
</tabs>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<appointment-time v-model="timePopup" @close="timePopup = false" @update="handleSubmitMobile" />
|
<appointment-time v-model="timePopup" @close="timePopup = false" @update="handleSubmitTime" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -219,6 +219,9 @@ export default {
|
|||||||
showCoupon: false, // 显示优惠券Popup
|
showCoupon: false, // 显示优惠券Popup
|
||||||
userRemark: '', // 用户留言
|
userRemark: '', // 用户留言
|
||||||
type: '', // 订单类型
|
type: '', // 订单类型
|
||||||
|
day: '',
|
||||||
|
timeId: 0,
|
||||||
|
time: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -236,7 +239,17 @@ export default {
|
|||||||
this.pay.alipay = 1
|
this.pay.alipay = 1
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
getDelivery()
|
this.getDeliveryFun()
|
||||||
|
},
|
||||||
|
|
||||||
|
onUnload() {
|
||||||
|
// 取消全局监听
|
||||||
|
uni.$off(['selectaddress', 'store'])
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getDeliveryFun() {
|
||||||
|
getDelivery()
|
||||||
.then(({ code, data, msg }) => {
|
.then(({ code, data, msg }) => {
|
||||||
// 请求结果判断
|
// 请求结果判断
|
||||||
if (code != 1) throw new Error(msg)
|
if (code != 1) throw new Error(msg)
|
||||||
@ -292,14 +305,8 @@ export default {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onUnload() {
|
|
||||||
// 取消全局监听
|
|
||||||
uni.$off(['selectaddress', 'store'])
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
appointmentTime() {
|
appointmentTime() {
|
||||||
this.timePopup = true
|
this.timePopup = true
|
||||||
},
|
},
|
||||||
@ -408,12 +415,36 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 选择预约时间
|
||||||
|
handleSubmitTime(data) {
|
||||||
|
this.day = data.day
|
||||||
|
this.timeId = data.time_id
|
||||||
|
this.time = data.time
|
||||||
|
this.timePopup = false
|
||||||
|
},
|
||||||
|
|
||||||
// 订单提交
|
// 订单提交
|
||||||
async handleOrderSubmit(from) {
|
async handleOrderSubmit(from) {
|
||||||
this.showLoading = true
|
this.showLoading = true
|
||||||
|
// 判断预约时间
|
||||||
|
if (this.day === '今天') {
|
||||||
|
const today = new Date();
|
||||||
|
const year = today.getFullYear();
|
||||||
|
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||||
|
const date = String(today.getDate()).padStart(2, '0');
|
||||||
|
from.date = `${year}-${month}-${date}`;
|
||||||
|
} else if (this.day === '明天') {
|
||||||
|
const tomorrow = new Date();
|
||||||
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||||
|
const year = tomorrow.getFullYear();
|
||||||
|
const month = String(tomorrow.getMonth() + 1).padStart(2, '0');
|
||||||
|
const date = String(tomorrow.getDate()).padStart(2, '0');
|
||||||
|
from.date = `${year}-${month}-${date}`;
|
||||||
|
}
|
||||||
|
|
||||||
from.remark = this.userRemark
|
from.remark = this.userRemark
|
||||||
from.type = this.type
|
from.type = this.type
|
||||||
|
from.time_id = this.timeId
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { code, data, msg } = await orderBuy(from)
|
const { code, data, msg } = await orderBuy(from)
|
||||||
|
|||||||
Reference in New Issue
Block a user