添加预约时间

This commit is contained in:
2025-05-17 15:15:11 +08:00
parent 7ae003c61f
commit cdf7e721c5
7 changed files with 101 additions and 39 deletions

View File

@ -66,6 +66,7 @@ export function getVerifyLists(data) {
params: data,
});
}
// 核销详情
export function verification(data) {
return request.post("order/verification", data);
@ -75,11 +76,18 @@ export function verification(data) {
export function verificationConfirm(data) {
return request.post("order/verificationConfirm", data);
}
//确认收货组件
export function getwxReceiveDetail(params) {
return request.get("order/wxReceiveDetail", { params });
}
//查询确认收货
export function getwechatSyncCheck(params) {
return request.get("order/wechatSyncCheck", { params });
}
// 店铺预约时间
export function yuyueTime(data) {
return request.post("order/yuyueTime", data)
}

View File

@ -76,7 +76,8 @@ export default {
addressList: [],
hasAddress: true,
deleteSure: false,
currentId: 0
currentId: 0,
type: 0
}
},
@ -98,6 +99,7 @@ export default {
methods: {
onSelect(e) {
console.log("e>>>", e);
if (this.type) {
let { id } = e.currentTarget.dataset
uni.$emit('selectaddress', {

View File

@ -81,12 +81,12 @@
name: '兑换'
}
],
current: 1,
current: 0,
upOption:{
noMoreSize: 4,
empty:{
tip: '~ 空空如也 ~', // 提示
btnText: ''
btnText: '',
},
textNoMore: '没有更多了'
},

View File

@ -7,7 +7,7 @@
<view class="aside">
<scroll-view style="height: 100%;" scroll-y="true" scroll-with-animation="true">
<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)">
<text class="name">{{ item.name }}</text>
<view v-if="index == selectIndex" class="active-line bg-default"></view>
@ -20,8 +20,8 @@
<view class="main">
<scroll-view style="height: 100%" scroll-y="true" scroll-with-animation="true">
<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>900 - 930</view>
<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>{{ item.start_time }}-{{ item.end_time }}</view>
</view>
</view>
</scroll-view>
@ -33,9 +33,11 @@
</template>
<script>
import {getCatrgory} from '@/api/store'
import {yuyueTime} from '@/api/order'
export default {
name: "appointment-time",
props: {
value: {
type: Boolean,
@ -46,25 +48,44 @@
return {
mobile: '',
selectIndex: 0,
cateList: []
cateList: [],
dateList: [],
timeList: []
};
},
created() {
this.getCatrgoryFun()
this.dateList = [
{'name': '今天'},
{'name': '明天'}
]
this.getYuYueTime()
},
methods: {
getCatrgoryFun() {
getCatrgory().then(res => {
if (res.code == 1) {
this.cateList = res.data
}
});
// 获取预约时间
getYuYueTime() {
const store_id = 1
yuyueTime({store_id}).then((res) => {
this.timeList = res.data
})
},
changeActive(index) {
const {cateList} = this
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) {
@ -96,7 +117,7 @@
this.$emit('input', val)
}
}
}
},
};
</script>

View File

@ -60,13 +60,13 @@
// 提交数据
handleSubmit(e) {
const {mobile} = this
if (!mobile) return this.$toast({
title: '请授权手机号'
})
// const {mobile} = this
// if (!mobile) return this.$toast({
// title: '请授权手机号'
// })
this.$emit('update', {
mobile
mobile: 15005837859
})
this.showPop = false

View File

@ -15,8 +15,8 @@ const IS_H5 = false
const baseURLMap = {
// 开发环境
// development: 'https://likeshop-open.yixiangonline.com',
development: 'http://admin.likeshop.com',
// development: 'https://jianbing.stnav.com',
// development: 'http://admin.likeshop.com',
development: 'https://jianbing.stnav.com',
// development: 'https://jb.stnav.com',
// 生产环境https://php-b2c.likeshop.cn

View File

@ -102,13 +102,13 @@
<view class="bg-white br16 p24 u-m-t-32 nr row-between" @click="appointmentTime">
<view>预约时间</view>
<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>
</view>
</view>
<!-- #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-center">
<u-icon name="weixin-circle-fill" color="#28C445" size="80"></u-icon>
@ -121,11 +121,11 @@
</u-radio-group>
</view>
</view>
</view>
</view> -->
<!-- #endif -->
<!-- #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-center">
<u-icon name="zhifubao-circle-fill" color="#1477FE" size="80"></u-icon>
@ -138,7 +138,7 @@
</u-radio-group>
</view>
</view>
</view>
</view> -->
<!-- #endif -->
<view class="fixed bg-white row-between px48 u-padding-top-20 u-padding-bottom-20">
@ -175,7 +175,7 @@
</tabs>
</view>
</u-popup>
<appointment-time v-model="timePopup" @close="timePopup = false" @update="handleSubmitMobile" />
<appointment-time v-model="timePopup" @close="timePopup = false" @update="handleSubmitTime" />
</view>
</template>
@ -219,6 +219,9 @@ export default {
showCoupon: false, // 显示优惠券Popup
userRemark: '', // 用户留言
type: '', // 订单类型
day: '',
timeId: 0,
time: ''
}
},
@ -236,7 +239,17 @@ export default {
this.pay.alipay = 1
//#endif
getDelivery()
this.getDeliveryFun()
},
onUnload() {
// 取消全局监听
uni.$off(['selectaddress', 'store'])
},
methods: {
getDeliveryFun() {
getDelivery()
.then(({ code, data, msg }) => {
// 请求结果判断
if (code != 1) throw new Error(msg)
@ -292,14 +305,8 @@ export default {
.catch((err) => {
console.log(err)
})
},
},
onUnload() {
// 取消全局监听
uni.$off(['selectaddress', 'store'])
},
methods: {
appointmentTime() {
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) {
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.type = this.type
from.time_id = this.timeId
try {
const { code, data, msg } = await orderBuy(from)