完善茶艺师接口对接
This commit is contained in:
10
src/App.vue
10
src/App.vue
@ -27,11 +27,11 @@
|
||||
// uni.setStorageSync(LOCATION_CITY_KEY, LOCATION_DEFAULT_CITY)
|
||||
})
|
||||
onShow((options) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `当前请求域名是:${import.meta.env.VITE_SERVER_BASEURL}`,
|
||||
showCancel: false
|
||||
})
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: `当前请求域名是:${import.meta.env.VITE_SERVER_BASEURL}`,
|
||||
// showCancel: false
|
||||
// })
|
||||
if (options?.path === 'bundle/order/tea-room/order-detail') {
|
||||
uni.setStorageSync('transferOrderParams', {
|
||||
orderId: options?.query?.orderId || '',
|
||||
|
||||
@ -9,4 +9,11 @@ export function getHomeBannerList() {
|
||||
meta: { ignoreAuth: true }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页优惠券弹窗
|
||||
*/
|
||||
export function getHomeCouponPopup() {
|
||||
return http.Post<any>('api/UserCoupon/isCoupin')
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import { http } from '@/http/alova'
|
||||
|
||||
/**
|
||||
* 预支付接口
|
||||
* 预支付接口1.0
|
||||
*/
|
||||
export interface IPrePayParams {
|
||||
from: string
|
||||
@ -16,6 +16,14 @@ export function prePay(data: IPrePayParams) {
|
||||
return http.Post<any>('/api/pay/prepay', data)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 预支付接口2.0(茶艺师预定)
|
||||
*/
|
||||
export function newPrePay(data: IPrePayParams) {
|
||||
return http.Post<any>('/api/pay/newprepay', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 余额支付接口
|
||||
*/
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
import { http } from '@/http/alova'
|
||||
|
||||
/**
|
||||
* 获取已开通城市列表
|
||||
*/
|
||||
export function getOpenCityList() {
|
||||
return http.Post<any>('/teamapi/user/teaStoreCity')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取茶艺师列表
|
||||
*/
|
||||
@ -32,6 +39,13 @@ export function getTeaSpecialistDetail(data: ITeaSpecialistDetailParams) {
|
||||
return http.Post<any>('/api/Teamaster/TeamasterDetails', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 费用明细
|
||||
*/
|
||||
export function getTeaSpecialistFeeDetails(data) {
|
||||
return http.Post<any>('/api/Teamaster/countTeamPrice', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 茶叶商品列表
|
||||
*/
|
||||
@ -44,4 +58,43 @@ export function getTeaProducts() {
|
||||
*/
|
||||
export function getTeaSpecialistCoupons() {
|
||||
return http.Post<any>('/api/Teamaster/userCoupon')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
* @param id 订单ID
|
||||
*/
|
||||
export function cancelTeaSpecialistOrder(id: number) {
|
||||
return http.Post('/api/Teamaster/cancelOrder', {id})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
* @param 订单ID
|
||||
*/
|
||||
export function deleteTeaSpecialistOrder(id: number) {
|
||||
return http.Post('/api/Teamaster/delOrder', {id})
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建续单订单
|
||||
*/
|
||||
export interface ITeaSpecialistRenewOrder {
|
||||
id: Number
|
||||
type: Number
|
||||
hours: Number
|
||||
tea_id: string
|
||||
}
|
||||
|
||||
export function createTeaSpecialistRenewOrder(data: ITeaSpecialistRenewOrder) {
|
||||
return http.Post<any>('/api/Teamaster/addTeamRenwOrder', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款
|
||||
* @param id 订单ID
|
||||
* @param order_type 固定传10
|
||||
*/
|
||||
export function applyTeaSpecialistRefund(id: number, order_type: number = 10) {
|
||||
return http.Post('/api/Teamaster/TeamRefund', {id, order_type})
|
||||
}
|
||||
|
||||
@ -103,10 +103,11 @@ export interface ICreateTeaSpecialistOrderParams {
|
||||
is_teacup: number
|
||||
tea_id: string
|
||||
user_coupon_id: number
|
||||
server_number: number
|
||||
}
|
||||
|
||||
export function createTeaSpecialistOrder(data: ICreateTeaSpecialistOrderParams) {
|
||||
return http.Post<ICreateTeaSpecialistOrderResult>('/api/Teamaster/addTeamOrder', data)
|
||||
return http.Post<any>('/api/Teamaster/addTeamOrder', data)
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@ -12,7 +12,7 @@ export interface ITeaSpecialistOrderListParams {
|
||||
}
|
||||
|
||||
export function getTeaSpecialistOrderList(data: ITeaSpecialistOrderListParams) {
|
||||
return http.Post<IOrderListResult>('/api/order/orderList',
|
||||
return http.Post<IOrderListResult>('/api/Teamaster/teamOrderList',
|
||||
data
|
||||
)
|
||||
}
|
||||
@ -25,7 +25,7 @@ export interface ITeaSpecialistOrderDetailsParams {
|
||||
}
|
||||
|
||||
export function getTeaSpecialistOrderDetails(data: ITeaSpecialistOrderDetailsParams) {
|
||||
return http.Post<IOrderDetailsResult>('/api/order/orderDetails',
|
||||
return http.Post<any>('/api/Teamaster/teamOrderDetails',
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
@ -32,16 +32,11 @@ export interface IAddUserAddressParams {
|
||||
id: number
|
||||
contact: string
|
||||
telephone: string
|
||||
// province: string
|
||||
// province_id?: number
|
||||
// city: string
|
||||
// city_id?: number
|
||||
// district: string
|
||||
// district_id?: number
|
||||
// city_id: number
|
||||
longitude: number,
|
||||
latitude: number,
|
||||
address: string
|
||||
is_default: number
|
||||
// is_default: number
|
||||
}
|
||||
|
||||
export function addUserAddress(data: IAddUserAddressParams) {
|
||||
|
||||
@ -9,15 +9,14 @@
|
||||
|
||||
<template>
|
||||
<view class="pb-254rpx">
|
||||
|
||||
<!-- 一键续订 -->
|
||||
<wd-popup v-model="showRenewPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative pb-26rpx">
|
||||
<view class="absolute top-18rpx right-30rpx" @click="showRenewPopup = false">
|
||||
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
|
||||
</view>
|
||||
|
||||
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">续订包间</view>
|
||||
|
||||
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">续订茶艺师</view>
|
||||
<view>
|
||||
<scroll-view scroll-y class="h-[660rpx] pb-20rpx">
|
||||
<view class="mx-60rpx">
|
||||
@ -25,8 +24,8 @@
|
||||
<view class="grid grid-cols-4 gap-x-20rpx gap-y-20rpx mt-28rpx">
|
||||
<view v-for="item in timeList" :key="item.id"
|
||||
class="h-72rpx rounded-16rpx flex items-center justify-center text-28rpx leading-40rpx"
|
||||
:class="[item.id == selectedRenewTime ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F7F7F7] text-[#606266]']"
|
||||
@click="selectedRenewTime = item.id">
|
||||
:class="[item.id == selectedRenewTime ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F7F7F7] text-[#606266]']"
|
||||
@click="selectedRenewTime = item.id; OrderDetail.handleTotalCostPrice()">
|
||||
{{ item.time }}
|
||||
</view>
|
||||
</view>
|
||||
@ -41,30 +40,11 @@
|
||||
class="h-110rpx rounded-16rpx flex flex-col items-center justify-center text-28rpx leading-40rpx"
|
||||
:class="selectedRenewTea.includes(item.id) ? 'bg-[#4C9F44] text-[#fff]' : 'bg-[#F7F7F7] text-[#606266]'"
|
||||
@click="OrderDetail.handleToggleRenewTea(item.id)">
|
||||
<view>{{item.title}}</view>
|
||||
<view>{{item.price}}</view>
|
||||
<view>{{ item.name }}</view>
|
||||
<view>{{ item.price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mx-60rpx mt-60rpx">
|
||||
<view class="text-[#01000D] text-32rpx leading-44rpx">支付方式</view>
|
||||
<view class="mt-28rpx">
|
||||
<wd-radio-group v-model="pay" shape="dot" checked-color="#4C9F44">
|
||||
<view class="flex justify-between items-center mb-40rpx" v-for="(item, index) in payList" :key="index" @click="pay = item.id">
|
||||
<view class="flex items-center">
|
||||
<wd-img width="50rpx" height="50rpx" :src="item.icon"></wd-img>
|
||||
<view class="ml-20rpx text-30rpx text-[#303133] leading-42rpx">{{ item.name }}</view>
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
<wd-radio :value="item.value">
|
||||
<view class="text-[#303133] text-26rpx leading-36rpx mr-20rpx" v-if="item.id == 1">可用202.22</view>
|
||||
</wd-radio>
|
||||
</view>
|
||||
</view>
|
||||
</wd-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view>
|
||||
@ -75,14 +55,11 @@
|
||||
<view class="flex items-center">
|
||||
<view class="text-24rpx text-[#303133] leading-34rpx">合计:</view>
|
||||
<view class="flex items-center h-56rpx mr-16rpx">
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="23.02"></price-format>
|
||||
<view class="ml-20rpx">
|
||||
<price-format color="#909399" :first-size="26" :second-size="26" :subscript-size="26" :price="23.02" lineThrough></price-format>
|
||||
</view>
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="renewCostPrice"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx'>立即预定</wd-button>
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' @click="OrderDetail.handleNowRenew">立即预定</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -99,23 +76,22 @@
|
||||
</view>
|
||||
<view class="text-[#303133] text-36rpx leading-46rpx text-center mt-48rpx">茶艺师续订成功</view>
|
||||
<view class="text-[#9CA3AF] text-28rpx leading-44rpx mt-16rpx text-center">可以刷新页面查看预约时间</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto">好的</view>
|
||||
<view class="w-630rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff] mt-174rpx mx-auto" @click="showRenewSuccessPopup = false">好的</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
|
||||
<!-- 退款规则 -->
|
||||
<wd-popup v-model="showRefundRule" custom-class="rounded-16rpx" lock-scroll>
|
||||
<wd-popup v-model="showRefundRulePopup" custom-class="rounded-16rpx" lock-scroll>
|
||||
<view class="w-592rpx py-52rpx">
|
||||
<view class="text-36rpx text-[#303133] leading-50rpx text-center">确定申请退款吗?</view>
|
||||
<view class="font-400 text-32rpx text-[#303133] leading-44rpx text-center mt-40rpx">退款按照如下规则,请谨慎操作。</view>
|
||||
<view class="font-400 text-32rpx text-[#303133] leading-44rpx px-54rpx mt-18rpx">
|
||||
<view>1)茶艺师未出发,100%退款;</view>
|
||||
<view>2)茶艺师已出发未到达目的地,不退车马费;</view>
|
||||
<view>3)茶艺师出发并到达目的地,不退车马费,并且支付茶艺师50%服务费。</view>
|
||||
<view>2)茶艺师已出发未到达目的地,不退车马费,并且支付茶艺师30%服务费。</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="mt-54rpx text-32rpx leading-44rpx flex items-center justify-center leading-80rpx text-center">
|
||||
<view class="w-240rpx h-80rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRule = false">取消</view>
|
||||
<view class="w-240rpx h-80rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRulePopup = false">取消</view>
|
||||
<view class="w-240rpx h-80rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleConfirmRefund">确定退款</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -124,8 +100,8 @@
|
||||
<!-- 取消订单 -->
|
||||
<wd-message-box selector="wd-message-box-slot"></wd-message-box>
|
||||
|
||||
<!-- 费用详情 -->
|
||||
<wd-popup v-model="showCostPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<!-- TODO 费用详情-暂时不要 -->
|
||||
<!-- <wd-popup v-model="showCostPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative pb-30rpx">
|
||||
<view class="absolute top-18rpx right-30rpx" @click="showCostPopup = false">
|
||||
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
|
||||
@ -179,7 +155,7 @@
|
||||
<view>¥158</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="px-30rpx">
|
||||
<view class="flex justify-between items-center">
|
||||
@ -204,71 +180,98 @@
|
||||
<view>¥698.90</view>
|
||||
</view>
|
||||
</view>
|
||||
</wd-popup> -->
|
||||
|
||||
<!-- 用户订单备注内容 -->
|
||||
<wd-popup v-model="showOrderMarksPopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
|
||||
<view class="relative pb-26rpx">
|
||||
<view class="absolute top-18rpx right-30rpx" @click="showOrderMarksPopup = false">
|
||||
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
|
||||
</view>
|
||||
|
||||
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">订单备注</view>
|
||||
<view class="px-32rpx">
|
||||
<wd-textarea v-model="order.remark" readonly
|
||||
custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA] !mt-20rpx'
|
||||
custom-textarea-class='!bg-[#F8F9FA] !h-500rpx' />
|
||||
</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
|
||||
<view>
|
||||
<navbar :title="title" custom-class='!bg-[#F6F7F8]' :leftArrow="false"></navbar>
|
||||
</view>
|
||||
|
||||
<!-- 导航栏 -->
|
||||
<navbar :title="title" custom-class='!bg-[#F6F7F8]' :leftArrow="false"></navbar>
|
||||
|
||||
<view class="text-[#909399] text-26rpx leading-36rpx mb-40rpx">
|
||||
<view class="text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Pay">使用过程中有任何问题,请联系客服</view>
|
||||
<view class="flex items-center justify-center" v-if="orderStatus == TeaSpecialistOrderStatus.Pending">
|
||||
<view class="text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Arrived || orderStatus == TeaSpecialistOrderStatus.Accepted">使用过程中有任何问题,请联系客服</view>
|
||||
<view class="flex items-center justify-center" v-if="(orderStatus == TeaSpecialistOrderStatus.Unpaid || orderStatus == TeaSpecialistOrderStatus.Pending) && order.timekeeping > 0">
|
||||
<view class="flex items-center mr-6rpx">
|
||||
<wd-img width="36rpx" height="36rpx" :src="`${OSS}icon/icon_time.png`"/>
|
||||
</view>
|
||||
<view class="flex items-center text-26rpx leading-36rpx text-[#909399]">
|
||||
<view>还剩</view>
|
||||
<view class="mx-6rpx">
|
||||
<wd-count-down :time="order.time1" custom-class="!text-[#FF5951]" />
|
||||
<wd-count-down :time="order.timekeeping" custom-class="!text-[#FF5951]" />
|
||||
</view>
|
||||
<view>订单自动取消</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ml-80rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Finished">感谢您的选择,期待再续茶香!</view>
|
||||
<view class="ml-80rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Confirm">您的服务已经结束,请及时确认订单</view>
|
||||
<view class="ml-80rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Completed">感谢您的选择,期待再续茶香!</view>
|
||||
<view v-if="orderStatus >= TeaSpecialistOrderStatus.SpecialistRefund" class="text-center mt-14rpx">
|
||||
<view class="text-40rpx text-[#303133] leading-56rpx">
|
||||
<view>退款成功¥{{ order.refund_price }}</view>
|
||||
</view>
|
||||
<view class="text-28rpx text-[#606266] leading-54rpx mt-20rpx">谢谢您的信任,我们一定会做的更好</view>
|
||||
<view class="text-24rpx text-[#606266] leading-34rpx mt-12rpx">{{ order.refund_time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 信息模块 -->
|
||||
<view class="mx-30rpx coupon-bg" >
|
||||
<view class="mx-30rpx coupon-bg" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="flex items-center px-30rpx pt-30rpx">
|
||||
<view class="mr-30rpx">
|
||||
<wd-img width="190rpx" height="190rpx" :src="order.teamaster.image" mode="scaleToFill"></wd-img>
|
||||
<wd-img width="190rpx" height="190rpx" :src="order.image" mode="scaleToFill"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1 w-280rpx">
|
||||
{{ order.teamaster.name }}
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
{{ order.title }}
|
||||
</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399]">¥{{ order.order_amount }}</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399]">¥{{ order.server_all_price }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view>¥{{ order.teamaster.price }}/小时</view>
|
||||
<view>¥{{ order.server_price }}/小时</view>
|
||||
<view>x{{ order.hours }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view class="w-300rpx line-1">车马费(¥{{ order.fare_price }}元/公里)</view>
|
||||
<view>¥{{ order.fare_distance_price }}/小时</view>
|
||||
<view class="w-300rpx line-1">车马费(¥{{ order.mileage_price }}元/公里)</view>
|
||||
<view>¥{{ order.mileage_server_price }}</view>
|
||||
</view>
|
||||
<view class="text-[#606266] text-right mt-26rpx" v-if="orderStatus !== TeaSpecialistOrderStatus.Pending">
|
||||
<text class="text-24rpx leading-34rpx mr-12rpx">实付</text>
|
||||
<text class="tetx-32rpx leading-36rpx">¥{{ order.order_amount }}</text>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-70rpx">
|
||||
<view class="mt-70rpx relative">
|
||||
<view class="flex items-center absolute right-0 top-10rpx right-44rpx" v-if="order.is_renewal">
|
||||
<wd-img :src="`${OSS}icon/icon_renew.png`" width="40rpx" height="40rpx"></wd-img>
|
||||
<view class="font-bold text-28rpx leading-40rpx text-[#4C9F44] ml-8px">订单已续订</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="orderStatus === TeaSpecialistOrderStatus.Arrived"
|
||||
class="renewOrder absolute right-0 bottom-36rpx w-170rpx h-56rpx text-center leading-56rpx font-bold text-28rpx text-[#fff] bg-[#4C9F44]"
|
||||
@click="showRenewPopup = true">一键续订</view>
|
||||
|
||||
<view class="text-30rpx leading-42rpx text-[#303133] px-30rpx">预约信息</view>
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx"
|
||||
v-if="orderStatus == TeaSpecialistOrderStatus.Pending || orderStatus == TeaSpecialistOrderStatus.Pay || orderStatus == TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Confirm">
|
||||
<view class="mb-20rpx px-30rpx">预约时间:{{ order.start_time }} - {{ order.end_time }}</view>
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx">
|
||||
<view class="mb-20rpx px-30rpx">预约时间:{{ order.day_time }} {{ order.start_time }} - {{ order.end_time }}</view>
|
||||
<view class="flex justify-between items-center pl-30rpx">
|
||||
<view>预约时长:{{ order.hours }}小时</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Cancelled || orderStatus == TeaSpecialistOrderStatus.Finished">
|
||||
<view class="font-500 text-26rpx leading-48rpx text-[#606266] mt-20rpx pb-28rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Completed">
|
||||
<view class="mb-20rpx px-30rpx">服务时间:{{ order.start_time }} - {{ order.end_time }}</view>
|
||||
<view class="flex justify-between items-center pl-30rpx">
|
||||
<view>服务时长:{{ order.hours }}小时</view>
|
||||
@ -277,53 +280,135 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退款下单独处理一个信息模块 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderStatus >= TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="flex items-center pt-30rpx">
|
||||
<view class="mr-30rpx">
|
||||
<wd-img width="190rpx" height="190rpx" :src="order.image" mode="scaleToFill"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view class="flex justify-between items-center">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1 w-280rpx">
|
||||
{{ order.title }}
|
||||
</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399]">¥{{ order.server_all_price }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view>¥{{ order.server_price }}/小时</view>
|
||||
<view>x{{ order.hours }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
<view class="w-300rpx line-1">车马费(¥{{ order.mileage_price }}元/公里)</view>
|
||||
<view>¥{{ order.mileage_server_price }}</view>
|
||||
</view>
|
||||
<view class="text-[#606266] text-right mt-26rpx" v-if="orderStatus !== TeaSpecialistOrderStatus.Pending">
|
||||
<text class="text-24rpx leading-34rpx mr-12rpx">实付</text>
|
||||
<text class="tetx-32rpx leading-36rpx">¥{{ order.order_amount }}</text>
|
||||
<!-- <wd-icon name="chevron-right" size="32rpx"></wd-icon> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 茶艺服务 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">茶艺服务</view>
|
||||
<view>
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx w-120rpx whitespace-nowrap">服务人数</view>
|
||||
<view class="text-[#303133]">{{ order.server_number }}人</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx w-120rpx whitespace-nowrap">预定茶叶</view>
|
||||
<view class="text-[#303133]">{{ order.leaf_name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx w-120rpx whitespace-nowrap">茶具使用</view>
|
||||
<view class="text-[#303133]">{{ order.is_teacup == 1 ? '茶艺师提供' : '客户自备' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-32rpx" v-if="order.is_renewal">
|
||||
<view class="renew-border"></view>
|
||||
<view class="mt-22rpx">
|
||||
<view class="font-bold text-28rpx leading-40rpx text-[#4C9F44]">续订信息</view>
|
||||
<view class="mt-16rpx">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center">
|
||||
<view class="mr-50rpx">续订时长</view>
|
||||
<view>{{ order.renew_hour }}小时</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center mt-18rpx">
|
||||
<view class="mr-50rpx">续订金额</view>
|
||||
<view>{{ order.renew_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center mt-18rpx">
|
||||
<view class="mr-50rpx">续订茶叶金额</view>
|
||||
<view>{{ order.renew_tea_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bg-white px-30rpx mx-30rpx mt-20rpx rounded-16rpx h-80rpx flex justify-between items-center" v-if="(orderStatus === TeaSpecialistOrderStatus.Accepted || orderStatus === TeaSpecialistOrderStatus.Arrived) && orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="font-500 text-24rpx leading-48rpx text-[#909399]">想问问茶艺师到哪里了?</view>
|
||||
<view class="flex items-center" @click="OrderDetail.handleCall">
|
||||
<wd-img :src="`${OSS}icon/icon_phone2.png`" width="34rpx" height="34rpx"></wd-img>
|
||||
<view class="text-26rpx leading-36rpx text-[#4C9F44] ml-6rpx">联系茶艺师</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- TODO 订单备注有内容在显示 -->
|
||||
<view class="bg-[#FFFDF7] px-30rpx py-20rpx rounded-16rpx mt-20rpx mx-30rpx" @click="showOrderMarksPopup = true" v-if="order.remark && orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="flex items-center">
|
||||
<wd-img :src="`${OSS}icon/icon_tips2.png`" width="40rpx" height="40rpx"></wd-img>
|
||||
<view class="ml-12rpx">订单备注</view>
|
||||
</view>
|
||||
<view class="flex items-start mt-22rpx">
|
||||
<text class="text-28rpx leading-40rpx text-[#606266]">备注信息</text>
|
||||
<text class="text-28rpx text-[#303133] ml-50rpx line-2 w-450rpx">{{ order.remark }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务方式 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx">
|
||||
<view class="bg-white rounded-16rpx px-30rpx pb-32rpx mx-30rpx mt-20rpx" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">服务方式</view>
|
||||
<view>
|
||||
<view class="flex justify-between items-center relative">
|
||||
<view>
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx">服务方式</view>
|
||||
<view class="text-[#303133]">{{ Number(order.service_type) == 1 ? '到店服务' : '上门服务'}}</view>
|
||||
<view class="text-[#303133]">{{ order.service_type == 1 ? '到店服务' : '上门服务'}}</view>
|
||||
</view>
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx">{{ Number(order.service_type) == 1 ? '服务门店' : '服务地址'}}</view>
|
||||
<view class="text-[#303133] line-1 w-300rpx" v-if="Number(order.service_type) == 1">{{ order.store_address.name }}</view>
|
||||
<view class="text-[#303133] line-1 w-300rpx" v-if="Number(order.service_type) != 1">
|
||||
{{ order.address.province }} {{ order.address.city }} {{ order.address.district }} {{ order.address.address }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx flex items-center mt-22rpx">
|
||||
<view class="text-[#606266] mr-54rpx">到达时长</view>
|
||||
<view class="text-[#303133]">{{ order.reach_time }}分钟左右到达</view>
|
||||
<view class="text-[#606266] mr-54rpx">{{ order.service_type == 1 ? '服务门店' : '服务地址'}}</view>
|
||||
<view class="text-[#303133] line-1 w-300rpx">{{ order.address }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex absolute top-1/2 right-0 -translate-y-1/2">
|
||||
<view class="text-center mr-20rpx" @click="OrderDetail.handleOpenMap">
|
||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_nav.png`"/>
|
||||
</view>
|
||||
<view class="text-center" v-if="orderStatus != TeaSpecialistOrderStatus.Pending" @click="OrderDetail.handleCallService">
|
||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_phone.png`"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单信息 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx">
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderStatus < TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="text-[#303133] text-32rpx leading-44rpx">订单信息</view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>订单编号</view>
|
||||
<view>
|
||||
<text>{{ order.order_sn }}</text>
|
||||
<wd-divider vertical />
|
||||
<text class="text-[#4C9F44]" @click="OrderDetail.handleCopy(order.order_sn)">复制</text>
|
||||
<text class="text-[#4C9F44]" @click="copy(order.order_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending && order.pay_way">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Unpaid && order.pay_way">
|
||||
<view>交易方式</view>
|
||||
<view>{{ order.pay_way_title }}</view>
|
||||
</view>
|
||||
@ -331,39 +416,65 @@
|
||||
<view>创建时间</view>
|
||||
<view>{{ order.dtime }}</view>
|
||||
</view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Pending && orderStatus != TeaSpecialistOrderStatus.Cancelled">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Unpaid">
|
||||
<view>付款时间</view>
|
||||
<view>{{ order.update_dtime }}</view>
|
||||
<view>{{ order.pay_time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退款订单 -->
|
||||
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="orderStatus >= TeaSpecialistOrderStatus.SpecialistRefund">
|
||||
<view class="text-[#303133] text-32rpx leading-44rpx">退款信息</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>退款时间</view>
|
||||
<view>{{ order.refund_time }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>订单编号</view>
|
||||
<view>
|
||||
<text>{{ order.order_sn }}</text>
|
||||
<wd-divider vertical />
|
||||
<text class="text-[#4C9F44]" @click="copy(order.order_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx" v-if="orderStatus != TeaSpecialistOrderStatus.Cancelled && orderStatus != TeaSpecialistOrderStatus.Finished">
|
||||
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx"
|
||||
v-if="orderStatus === TeaSpecialistOrderStatus.Unpaid ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Arrived ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Accepted ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Completed ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Pending ||
|
||||
orderStatus === TeaSpecialistOrderStatus.Departed">
|
||||
<view class="mt-34rpx">
|
||||
<!-- 预约单、服务中 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx" v-if="orderStatus === TeaSpecialistOrderStatus.Serving || orderStatus == TeaSpecialistOrderStatus.Confirm">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleConfirmOrder">确认订单</view>
|
||||
</view>
|
||||
|
||||
<!-- 待付款 -->
|
||||
<view class="flex items-center justify-between mx-58rpx mt-34rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Pending">
|
||||
<view class="flex items-center justify-between mx-58rpx mt-34rpx" v-if="orderStatus == TeaSpecialistOrderStatus.Unpaid">
|
||||
<view class="flex items-center">
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] mr-16rpx" @click="OrderDetail.handleCancelOrder">取消订单</view>
|
||||
</view>
|
||||
<view class="w-360rpx h-90rpx leading-90rpx text-center bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleToPay">立即支付¥{{ order.order_amount }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务中 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx" v-if="orderStatus === TeaSpecialistOrderStatus.Arrived">
|
||||
<view class="w-630rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleAgainReserve">再次预定</view>
|
||||
</view>
|
||||
|
||||
<!-- 已预约 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus == TeaSpecialistOrderStatus.Pay">
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRule = true">申请退款</view>
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133]" @click="OrderDetail.handleCallService">联系客服</view>
|
||||
<view
|
||||
class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center"
|
||||
v-if="orderStatus === TeaSpecialistOrderStatus.Pending || orderStatus === TeaSpecialistOrderStatus.Accepted || orderStatus === TeaSpecialistOrderStatus.Departed ">
|
||||
<view class="w-630rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="showRefundRulePopup = true">申请退款</view>
|
||||
</view>
|
||||
|
||||
<!-- 交易完成 -->
|
||||
<!-- <view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx"
|
||||
v-if="orderStatus == TeaSpecialistOrderStatus.Finished || orderStatus == TeaSpecialistOrderStatus.Cancelled">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
|
||||
</view> -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center mt-34rpx"
|
||||
v-if="orderStatus == TeaSpecialistOrderStatus.Completed">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleAgainReserve">再次预定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -371,26 +482,28 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { TeaSpecialistOrderStatusTextValue, TeaSpecialistOrderStatus } from '@/utils/order'
|
||||
import { getTeaSpecialistOrderDetails } from '@/api/teaSpecialist-order'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { handleCancelOrderHooks, handleToPayHooks, handleDeleteOrderHooks, handleConfirmOrderHooks, handleRefundOrderHooks } from '@/hooks/useTeaSpecialistOrder'
|
||||
import { useMessage, useToast } from 'wot-design-uni'
|
||||
import { TeaSpecialistManageOrderStatusText, TeaSpecialistManageStatusTextValue, TeaSpecialistOrderStatus} from '@/utils/teaSpecialistOrder'
|
||||
import { handleCancelOrderHooks, handleRefundTeaSpecialistOrderHooks } from '@/hooks/useTeaSpecialistOrder'
|
||||
import { router, copy, toPlus } from '@/utils/tools'
|
||||
import { OrderType } from '@/utils/order'
|
||||
import { getTeaTypeList } from '@/api/tea'
|
||||
import { getTeaSpecialistFeeDetails, createTeaSpecialistRenewOrder } from '@/api/tea-specialist'
|
||||
import type { ITeaTypeListResult } from '@/api/types/tea'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
const toast = useToast()
|
||||
const title = ref<string>('')
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
const showRefundRule = ref<boolean>(false) // 退款规则弹窗
|
||||
|
||||
// 订单倒计时取消
|
||||
const time = ref<number>(30 * 60 * 60 * 1000)
|
||||
const showRefundRulePopup = ref<boolean>(false) // 退款规则弹窗
|
||||
|
||||
// 取消订单弹窗
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
// 费用明细
|
||||
const showCostPopup = ref<boolean>(false) // 是否显示退款详情弹出框
|
||||
const renewCostPrice = ref<number>(0)
|
||||
|
||||
/** 续订 **/
|
||||
const showRenewPopup = ref<boolean>(false)
|
||||
@ -421,99 +534,107 @@
|
||||
}
|
||||
])
|
||||
|
||||
const teaList = [
|
||||
{id: 1, title: '红茶(3泡)', price: '¥128.00'},
|
||||
{id: 2, title: '铁观音(3泡)', price: '¥128.00'},
|
||||
{id: 3, title: '红茶(3泡)', price: '¥128.00'},
|
||||
{id: 4, title: '红茶(3泡)', price: '¥128.00'},
|
||||
{id: 5, title: '红茶(3泡)', price: '¥128.00'},
|
||||
]
|
||||
const teaList = ref<ITeaTypeListResult[]>([]) // 茶叶列表
|
||||
const selectedRenewTea = ref<Array<any>>([]) // 选择的续订时间
|
||||
const showRenewSuccessPopup = ref<boolean>(false)
|
||||
|
||||
// 订单备注
|
||||
const showOrderMarksPopup = ref<boolean>(false)
|
||||
|
||||
// 订单
|
||||
const orderId = ref<number>(0)
|
||||
const order = ref<any>({})
|
||||
const order = ref({
|
||||
id: 0, // 订单ID
|
||||
order_status: 0, // 订单状态
|
||||
order_sn: '', // 订单编号
|
||||
timekeeping: 0, // 倒计时
|
||||
order_amount: 0, // 订单金额
|
||||
refund_time: '', // 退款时间
|
||||
image: '', // 茶艺师图片
|
||||
title: '', // 茶艺师标题
|
||||
hours: 0, // 预定小时
|
||||
server_all_price: 0, // 服务费
|
||||
server_price: 0, // 服务费单价
|
||||
mileage_price: 0, // 车马费
|
||||
mileage_server_price: 0, // 车马费总价
|
||||
day_time: '', // 预约日期
|
||||
start_time: '', // 开始日期
|
||||
end_time: '', // 结束日期0
|
||||
service_type: 1, // 服务方式 1到店服务 2上门服务
|
||||
address: '', // 服务地址
|
||||
longitude: 0, // 经度
|
||||
latitude: 0, // 纬度
|
||||
server_number: 0, // 服务人数
|
||||
leaf_name: '', // 预定茶叶
|
||||
is_teacup: 0, // 是否使用茶具
|
||||
remark: '', // 订单备注
|
||||
pay_way: '', // 支付方式
|
||||
pay_way_title: '', // 支付方式标题
|
||||
dtime: '', // 创建时间
|
||||
pay_time: '', // 付款时间
|
||||
team_mobile: '', // 茶艺师电话
|
||||
is_renewal: 0, // 是否有一键续订
|
||||
team_user_id: 0, // 茶艺师ID
|
||||
refund_price: 0, // 退款金额
|
||||
renew_hour: 0, // 续订小时
|
||||
renew_price: 0, // 续订金额
|
||||
renew_tea_price: 0, // 续订茶叶金额
|
||||
})
|
||||
|
||||
onLoad(async (args) => {
|
||||
orderId.value = args.orderId
|
||||
// 获取订单详情
|
||||
OrderDetail.handleInit()
|
||||
})
|
||||
|
||||
|
||||
onUnload(() => {
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
const OrderDetail = {
|
||||
// 获取订单详情
|
||||
/**
|
||||
* 获取订单详情和茶叶列表
|
||||
*/
|
||||
handleInit: async () => {
|
||||
const res = await getTeaSpecialistOrderDetails({id: orderId.value})
|
||||
const data = res.details
|
||||
order.value = data
|
||||
title.value = TeaSpecialistOrderStatusTextValue[data.order_status].title || '订单详情'
|
||||
console.log("🚀 ~ title.value:", title.value)
|
||||
orderStatus.value = data.order_status
|
||||
},
|
||||
order.value = res
|
||||
title.value = TeaSpecialistManageStatusTextValue[res.order_status].pageTitle || '订单详情'
|
||||
orderStatus.value = res.order_status
|
||||
|
||||
// 确认订单
|
||||
handleConfirmOrder: () => {
|
||||
message.confirm({
|
||||
title: '确认订单',
|
||||
msg: '为保障您的权益,请茶艺师服务完成后在确认订单',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
cancelButtonProps: {
|
||||
customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
// 点击确认按钮回调事件
|
||||
if (res.action == 'confirm') {
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
handleConfirmOrderHooks(orderId.value)
|
||||
}
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
// 获取茶叶列表
|
||||
const tea = await getTeaTypeList()
|
||||
teaList.value = tea
|
||||
},
|
||||
|
||||
// 续订茶艺师
|
||||
handleToggleRenewTea: (id: number) => {
|
||||
handleToggleRenewTea: (id: number ) => {
|
||||
const idx = selectedRenewTea.value.indexOf(id)
|
||||
if (idx > -1) {
|
||||
selectedRenewTea.value.splice(idx, 1) // 已选中则移除
|
||||
} else {
|
||||
selectedRenewTea.value.push(id) // 未选中则添加
|
||||
}
|
||||
},
|
||||
|
||||
// 再次预定
|
||||
handleAgainReeserve: () => {
|
||||
showRenewSuccessPopup.value = true
|
||||
showRenewPopup.value = false
|
||||
OrderDetail.handleTotalCostPrice()
|
||||
},
|
||||
|
||||
// 申请退款
|
||||
handleConfirmRefund: () => {
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
showRefundRule.value = false
|
||||
handleConfirmRefund: async () => {
|
||||
showRefundRulePopup.value = false
|
||||
toast.loading('加载中...')
|
||||
const res = await handleRefundTeaSpecialistOrderHooks(order.value.id, 10) // 固定传10
|
||||
console.log("🚀 ~ res:", res)
|
||||
toast.close()
|
||||
|
||||
if (res) {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
// handleRefundOrderHooks(orderId.value, 'order')
|
||||
|
||||
toast.show('订单退款成功')
|
||||
}
|
||||
},
|
||||
|
||||
// 取消订单
|
||||
/**
|
||||
* 取消订单
|
||||
*/
|
||||
handleCancelOrder: () => {
|
||||
message.confirm({
|
||||
title: '确定取消订单?',
|
||||
@ -526,66 +647,148 @@
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
}).then(async (res) => {
|
||||
if (res.action == 'confirm') {
|
||||
// 点击确认按钮回调事件
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
toast.loading('加载中...')
|
||||
const res = await handleCancelOrderHooks(orderId.value)
|
||||
toast.close()
|
||||
|
||||
if (res) {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
handleCancelOrderHooks(orderId.value)
|
||||
toast.show('订单取消成功')
|
||||
}
|
||||
}
|
||||
toast.info('订单取消成功')
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
},
|
||||
|
||||
// 支付
|
||||
handleToPay: () => {
|
||||
uni.$on('refreshOrderDetail', () => {
|
||||
OrderDetail.handleInit()
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
handleToPayHooks(orderId.value, order.value.teamaster.id)
|
||||
},
|
||||
|
||||
// 打开地图
|
||||
handleOpenMap: () => {
|
||||
if (Number(order.value.service_type) == 1) {
|
||||
uni.openLocation({
|
||||
latitude: Number(order.value.store_address.latitude),
|
||||
longitude: Number(order.value.store_address.longitude),
|
||||
name: order.value.store_address.name,
|
||||
address: order.value.store_address.address,
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.openLocation({
|
||||
latitude: Number(order.value.address.latitude),
|
||||
longitude: Number(order.value.address.longitude),
|
||||
name: order.value.address.address,
|
||||
address: order.value.address.province + ' ' + order.value.address.city + ' ' + order.value.address.district + ' ' + order.value.address.address,
|
||||
})
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
|
||||
// 联系客服
|
||||
handleCallService: () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: order.value.customer_service_phone, // 替换为需要拨打的电话号码
|
||||
});
|
||||
/**
|
||||
* 一键续订的金额
|
||||
*/
|
||||
handleTotalCostPrice: async () => {
|
||||
let params = {
|
||||
hours: 0,
|
||||
tea_id: '',
|
||||
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
|
||||
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
|
||||
user_coupon_id: 0,
|
||||
is_teacup: 0,
|
||||
team_user_id: order.value.team_user_id
|
||||
}
|
||||
|
||||
if (selectedRenewTime.value > 0) {
|
||||
// 选定了时间
|
||||
params.hours = selectedRenewTime.value
|
||||
}
|
||||
|
||||
if (selectedRenewTea.value.length > 0) {
|
||||
// 选定了茶叶
|
||||
params.tea_id = selectedRenewTea.value.join(',')
|
||||
}
|
||||
|
||||
const res = await getTeaSpecialistFeeDetails(params)
|
||||
renewCostPrice.value = Number(toPlus(res.server_all_price, res.leaf_amount))
|
||||
},
|
||||
|
||||
// 复制订单号
|
||||
handleCopy: (text: string) => {
|
||||
uni.setClipboardData({
|
||||
data: text,
|
||||
success: () => {
|
||||
toast.info('复制成功')
|
||||
}
|
||||
/**
|
||||
* 去支付
|
||||
*/
|
||||
handleToPay: () => {
|
||||
uni.$off("payment")
|
||||
uni.$on('payment', params => {
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
if (params.result) {
|
||||
toast.show('支付成功')
|
||||
setTimeout(() => {
|
||||
OrderDetail.handleInit()
|
||||
}, 500)
|
||||
} else {
|
||||
toast.show('支付失败')
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
router.navigateTo(`/pages/cashier/cashier?from=${OrderType.TeaSpecialist}&orderId=${order.value.id}&teaSpecialistName=${order.value.title}&renewPrice=1`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交续单订单
|
||||
*/
|
||||
handleNowRenew: async () => {
|
||||
if (selectedRenewTime.value == 0 && selectedRenewTea.value.length == 0) {
|
||||
toast.show('请选择续单内容')
|
||||
return false
|
||||
}
|
||||
|
||||
toast.loading('创建订单中')
|
||||
let params = {
|
||||
id: order.value.id,
|
||||
type: 0,
|
||||
hours: 0,
|
||||
tea_id: ''
|
||||
}
|
||||
|
||||
if (selectedRenewTime.value > 0 && selectedRenewTea.value.length > 0) {
|
||||
// 选择了茶叶和时间,定义类型为3
|
||||
params.type = 3
|
||||
params.hours = selectedRenewTime.value
|
||||
params.tea_id = selectedRenewTea.value.join(',')
|
||||
} else if (selectedRenewTime.value > 0) {
|
||||
// 选择了时间但是没有选择茶叶,定义类型为1
|
||||
params.type = 1
|
||||
params.hours = selectedRenewTime.value
|
||||
} else if (selectedRenewTea.value.length > 0) {
|
||||
// 选择了茶叶但是没有选择时间,定义类型为2
|
||||
params.type = 2
|
||||
params.tea_id = selectedRenewTea.value.join(',')
|
||||
}
|
||||
const res = await createTeaSpecialistRenewOrder(params)
|
||||
console.log("🚀 ~ res:", res)
|
||||
toast.close()
|
||||
if (res.order_id) {
|
||||
uni.$off("payment")
|
||||
uni.$on('payment', params => {
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
if (params.result) {
|
||||
showRenewSuccessPopup.value = true
|
||||
setTimeout(() => {
|
||||
OrderDetail.handleInit()
|
||||
}, 500)
|
||||
} else {
|
||||
toast.show('支付失败')
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
showRenewPopup.value = false
|
||||
router.navigateTo(`/pages/cashier/cashier?from=${OrderType.TeaSpecialist}&orderId=${order.value.id}&renewOrderId=${res.order_id}&teaSpecialistName=${order.value.title}&teaSpecialistOrderAmount=${res.price}`)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
handleOpenMap: () => {
|
||||
uni.openLocation({
|
||||
latitude: Number(order.value.latitude),
|
||||
longitude: Number(order.value.longitude),
|
||||
address: order.value.address,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 茶艺师-再次预定
|
||||
*/
|
||||
handleAgainReserve: () => {
|
||||
router.navigateTo(`/bundle_b/pages/tea-specialist/list`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
handleCall: () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: order.value.team_mobile
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -602,4 +805,12 @@
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.renewOrder {
|
||||
border-radius: 100rpx 0rpx 0rpx 100rpx;
|
||||
}
|
||||
|
||||
.renew-border {
|
||||
border-top: 2rpx dashed #E5E7EB;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -23,11 +23,11 @@
|
||||
</wd-navbar>
|
||||
<view class="tabs">
|
||||
<wd-tabs v-model="tab" swipeable slidable="always" :lazy="false" @click="OrderList.handleChangeTabs">
|
||||
<wd-tab title="全部" :name="TeaSpecialistOrderStatusText.All"></wd-tab>
|
||||
<wd-tab title="待付款" :name="TeaSpecialistOrderStatusText.Pending"></wd-tab>
|
||||
<wd-tab title="预约单" :name="TeaSpecialistOrderStatusText.Pay"></wd-tab>
|
||||
<wd-tab title="待确认" :name="TeaSpecialistOrderStatusText.Confirm"></wd-tab>
|
||||
<wd-tab title="已完结" :name="TeaSpecialistOrderStatusText.Finished"></wd-tab>
|
||||
<wd-tab title="全部" :name="TeaSpecialistManageOrderStatusText.All"></wd-tab>
|
||||
<wd-tab title="待付款" :name="TeaSpecialistManageOrderStatusText.Unpaid"></wd-tab>
|
||||
<wd-tab title="预约单" :name="TeaSpecialistManageOrderStatusText.Reserved"></wd-tab>
|
||||
<wd-tab title="服务中" :name="TeaSpecialistManageOrderStatusText.Service"></wd-tab>
|
||||
<wd-tab title="已完成" :name="TeaSpecialistManageOrderStatusText.Completed"></wd-tab>
|
||||
</wd-tabs>
|
||||
</view>
|
||||
</view>
|
||||
@ -37,37 +37,9 @@
|
||||
<!-- 全部 -->
|
||||
<mescroll-body ref="mescrollItem0" @init="mescrollInit" @down="downCallback" @up="OrderList.upCallback" :down="downOption" :up="upOption">
|
||||
<view class="mb-20rpx" v-for="(item, index) in list" :key="index">
|
||||
<combo-card :type="OrderSource.TeaRoom" :order="item"></combo-card>
|
||||
<combo-card :type="OrderSource.TeaSpecialist" :order="item"></combo-card>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
|
||||
<!-- 待付款 -->
|
||||
<!-- <mescroll-body ref="mescrollItem1" @init="mescrollInit" @down="downCallback" @up="OrderList.upCallback" :down="downOption" :up="upOption" v-if="tab === OrderStatus.Pending">
|
||||
<view class="mb-20rpx" v-for="(item, index) in list" :key="index">
|
||||
<combo-card :type="OrderSource.TeaSpecialist" :order="item"></combo-card>
|
||||
</view>
|
||||
</mescroll-body> -->
|
||||
|
||||
<!-- 预约单 -->
|
||||
<!-- <mescroll-body ref="mescrollItem2" @init="mescrollInit" @down="downCallback" @up="OrderList.upCallback" :down="downOption" :up="upOption" v-if="tab === OrderStatus.Reserved">
|
||||
<view class="mb-20rpx" v-for="(item, index) in list" :key="index">
|
||||
<combo-card :type="OrderSource.TeaSpecialist" :order="item"></combo-card>
|
||||
</view>
|
||||
</mescroll-body> -->
|
||||
|
||||
<!-- 待确认 -->
|
||||
<!-- <mescroll-body ref="mescrollItem2" @init="mescrollInit" @down="downCallback" @up="OrderList.upCallback" :down="downOption" :up="upOption" v-if="tab === OrderStatus.Confirm">
|
||||
<view class="mb-20rpx" v-for="(item, index) in list" :key="index">
|
||||
<combo-card :type="OrderSource.TeaSpecialist" :order="item"></combo-card>
|
||||
</view>
|
||||
</mescroll-body> -->
|
||||
|
||||
<!-- 已完结 -->
|
||||
<!-- <mescroll-body ref="mescrollItem3" @init="mescrollInit" @down="downCallback" @up="OrderList.upCallback" v-if="tab === OrderStatus.Finished">
|
||||
<view class="mb-20rpx" v-for="(item, index) in list" :key="index">
|
||||
<combo-card :type="OrderSource.TeaSpecialist" :order="item"></combo-card>
|
||||
</view>
|
||||
</mescroll-body> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -78,7 +50,8 @@
|
||||
import ComboCard from '@/components/order/ComboCard.vue'
|
||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
||||
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
|
||||
import { OrderSource, OrderStatus, TeaSpecialistOrderStatusText, TeaSpecialistOrderStatusValue } from '@/utils/order'
|
||||
import { OrderSource, OrderStatus, TeaSpecialistOrderStatusText } from '@/utils/order'
|
||||
import { TeaSpecialistManageOrderStatusText, TeaSpecialistOrderStatusValue } from '@/utils/teaSpecialistOrder'
|
||||
import { router } from '@/utils/tools'
|
||||
|
||||
/* mescroll */
|
||||
@ -107,6 +80,11 @@
|
||||
// 根据传过来的参数决定显示哪个tab
|
||||
if (args.orderStatus) {
|
||||
tab.value = args.orderStatus
|
||||
if (tab.value === TeaSpecialistOrderStatusText.Pending) {
|
||||
orderStatus.value = ''
|
||||
} else {
|
||||
orderStatus.value = TeaSpecialistOrderStatusValue[tab.value] || ''
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@ -138,7 +116,7 @@
|
||||
handleChangeTabs: (e: {index: number, name: string}) => {
|
||||
tab.value = e.name
|
||||
if (e.name === TeaSpecialistOrderStatusText.Pending) {
|
||||
orderStatus.value = '0'
|
||||
orderStatus.value = ''
|
||||
} else {
|
||||
orderStatus.value = TeaSpecialistOrderStatusValue[e.name] || ''
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<view>
|
||||
<view>
|
||||
<view class="flex items-center mx-36rpx">
|
||||
<view class="text-30rpx leading-42rpx text-#303133 mr-60rpx w-100rpx">联系人</view>
|
||||
<view class="text-30rpx leading-42rpx text-#303133 mr-60rpx w-150rpx">联系人</view>
|
||||
<view>
|
||||
<wd-input v-model="form.contact" size="large" placeholder="请填写联系人" no-border placeholderStyle="font-size: 30rpx; line-height: 42rpx; color: #c9c9c9;"></wd-input>
|
||||
</view>
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
<view>
|
||||
<view class="flex items-center mx-36rpx">
|
||||
<view class="text-30rpx leading-42rpx text-#303133 mr-60rpx w-100rpx">电话</view>
|
||||
<view class="text-30rpx leading-42rpx text-#303133 mr-60rpx w-150rpx">电话</view>
|
||||
<view>
|
||||
<wd-input v-model="form.telephone" size="large" placeholder="请填写联系电话" no-border placeholderStyle="font-size: 30rpx; line-height: 42rpx; color: #c9c9c9;"></wd-input>
|
||||
</view>
|
||||
@ -35,21 +35,22 @@
|
||||
<view class="h-2rpx bg-#F2F2F2"></view>
|
||||
</view>
|
||||
|
||||
<!-- <view>
|
||||
<view class="flex items-center mx-36rpx">
|
||||
<view class="text-30rpx leading-42rpx text-#303133 mr-60rpx w-100rpx">省市区</view>
|
||||
<view class="add-address">
|
||||
<wd-col-picker v-model="address" :columns="area" :column-change="columnChange" auto-complete @confirm="Add.handleConfirmAddress" placeholder="请选择省市区"> </wd-col-picker>
|
||||
<!-- <view class="flex items-center mx-36rpx">
|
||||
<view class="text-30rpx leading-42rpx text-[#303133] w-150rpx mr-60rpx">选择地区</view>
|
||||
<wd-picker :columns="cityColumns" v-model="form.city_id" use-default-slot @confirm="Add.handleConfirmAddress">
|
||||
<view class="flex items-center">
|
||||
<wd-input readonly v-model="city" size="large" placeholder="请选择地区" no-border placeholderStyle="font-size: 30rpx; line-height: 42rpx; color: #c9c9c9;"></wd-input>
|
||||
<wd-icon name="chevron-right" size="32rpx" color="#909399"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
</wd-picker>
|
||||
<view class="h-2rpx bg-#F2F2F2"></view>
|
||||
</view> -->
|
||||
|
||||
<view>
|
||||
<view class="flex items-center mx-36rpx" @click="Add.handleChooseLocation">
|
||||
<view class="text-30rpx leading-42rpx text-#303133 mr-60rpx w-100rpx">地址</view>
|
||||
<view class="text-30rpx leading-42rpx text-#303133 mr-60rpx w-150rpx">地址</view>
|
||||
<view>
|
||||
<wd-input readonly v-model="form.address" size="large" placeholder="请填写具体地址" no-border placeholderStyle="font-size: 30rpx; line-height: 42rpx; color: #c9c9c9;"></wd-input>
|
||||
<wd-input readonly v-model="form.address" size="large" placeholder="请选择地址" no-border placeholderStyle="font-size: 30rpx; line-height: 42rpx; color: #c9c9c9;"></wd-input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -57,12 +58,12 @@
|
||||
|
||||
<view class="h-12rpx bg-#F7F7F7"></view>
|
||||
|
||||
<view class="flex justify-between items-center mx-36rpx mt-32rpx">
|
||||
<!-- <view class="flex justify-between items-center mx-36rpx mt-32rpx">
|
||||
<view class="text-30rpx leading-42rpx text-#303133">设为默认地址</view>
|
||||
<view class="">
|
||||
<wd-switch v-model="isDefaultAddress" active-color="#4C9F44"/>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="fixed bottom-70rpx left-0 right-0">
|
||||
<view
|
||||
@ -85,12 +86,12 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { useColPickerData } from '@/hooks/useColPickerData'
|
||||
import { addUserAddress, IAddUserAddressParams, deleteUserAddress, userAddressDetails, editUserAddress } from '@/api/user'
|
||||
import { getOpenCityList } from '@/api/tea-specialist'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { mobile } from '@/utils/test'
|
||||
import { router } from '@/utils/tools'
|
||||
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
// 弹出框
|
||||
@ -102,44 +103,21 @@
|
||||
// 地址id
|
||||
const addressId = ref<number>(0)
|
||||
|
||||
// 获取已开通城市
|
||||
const cityColumns = ref<Array<{ label: string, value: number }>>([])
|
||||
|
||||
// 表单信息
|
||||
const form = reactive<IAddUserAddressParams>({
|
||||
contact: '',
|
||||
telephone: '',
|
||||
// province: '',
|
||||
// province_id: 0,
|
||||
// city: '',
|
||||
// city_id: 0,
|
||||
// district: '',
|
||||
// district_id: 0,
|
||||
city_id: 0,
|
||||
longitude: 0,
|
||||
latitude: 0,
|
||||
address: '',
|
||||
is_default: 0,
|
||||
// is_default: 0,
|
||||
id: 0
|
||||
})
|
||||
|
||||
// 省市区数据
|
||||
const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||
const address = ref<string[]>([])
|
||||
const area = ref<any[]>([])
|
||||
const columnChange = async ({ selectedItem, resolve, finish }) => {
|
||||
await Add.handleSleep(0)
|
||||
|
||||
const areaData = findChildrenByCode(colPickerData, selectedItem.value)
|
||||
if (areaData && areaData.length) {
|
||||
resolve(
|
||||
areaData.map((item) => {
|
||||
return {
|
||||
value: item.value,
|
||||
label: item.text
|
||||
}
|
||||
})
|
||||
)
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
const city = ref<string>('')
|
||||
|
||||
// 是否默认地址
|
||||
const isDefaultAddress = ref<boolean>(false)
|
||||
@ -151,41 +129,50 @@
|
||||
addressId.value = Number(args.id)
|
||||
Add.handleGetAddressDetails()
|
||||
}
|
||||
|
||||
Add.handleGetCity()
|
||||
})
|
||||
|
||||
const Add = {
|
||||
// 确认省市区
|
||||
// handleConfirmAddress: (e) => {
|
||||
// form.province = e.selectedItems[0]?.label || ''
|
||||
// form.province_id = Number(e.selectedItems[0]?.value) || 0
|
||||
// form.city = e.selectedItems[1]?.label || ''
|
||||
// form.city_id = Number(e.selectedItems[1]?.value) || 0
|
||||
// form.district = e.selectedItems[2]?.label || ''
|
||||
// form.district_id = Number(e.selectedItems[2]?.value) || 0
|
||||
// },
|
||||
/**
|
||||
* 获取已开通城市
|
||||
*/
|
||||
handleGetCity: async () => {
|
||||
const res = await getOpenCityList()
|
||||
cityColumns.value = res.list.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id
|
||||
}))
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认选择的地址
|
||||
*/
|
||||
handleConfirmAddress: (e: any) => {
|
||||
form.city_id = Number(e.value)
|
||||
city.value = e.selectedItems.label || ''
|
||||
},
|
||||
|
||||
|
||||
// 获取地址详情
|
||||
handleGetAddressDetails: async () => {
|
||||
const res = await userAddressDetails({
|
||||
id: addressId.value
|
||||
})
|
||||
console.log("🚀 ~ res:", res)
|
||||
form.contact = res.address_details.contact
|
||||
form.telephone = res.address_details.telephone
|
||||
form.address = res.address_details.address
|
||||
|
||||
// form.city_id = res.address_details.city_id,
|
||||
|
||||
// form.province = res.address_details.province
|
||||
// form.province_id = res.address_details.province_id
|
||||
// form.city = res.address_details.city
|
||||
// form.city_id = res.address_details.city_id
|
||||
// form.district = res.address_details.district
|
||||
// form.district_id = res.address_details.district_id
|
||||
form.address = res.address_details.address
|
||||
form.is_default = res.address_details.is_default
|
||||
isDefaultAddress.value = res.address_details.is_default === 1 ? true : false
|
||||
address.value = [
|
||||
String(res.address_details.province_id),
|
||||
String(res.address_details.city_id),
|
||||
String(res.address_details.district_id)
|
||||
]
|
||||
console.log("🚀 ~ address.value:", address.value)
|
||||
// form.is_default = res.address_details.is_default
|
||||
},
|
||||
|
||||
// 删除地址
|
||||
@ -210,14 +197,14 @@
|
||||
})
|
||||
toast.info('删除成功')
|
||||
uni.$emit('refreshAddressList')
|
||||
router.navigateBack(500)
|
||||
router.navigateBack(1, 500)
|
||||
}).catch((res) => {
|
||||
console.log("🚀 ~ res2:", res)
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* 选择地址
|
||||
*/
|
||||
handleChooseLocation: async () => {
|
||||
@ -250,8 +237,8 @@
|
||||
return
|
||||
}
|
||||
|
||||
// if (!form.province || !form.city || !form.district) {
|
||||
// toast.info('请选择省市区')
|
||||
// if (!form.city_id) {
|
||||
// toast.info('请选择城市')
|
||||
// return
|
||||
// }
|
||||
|
||||
@ -260,18 +247,20 @@
|
||||
return
|
||||
}
|
||||
|
||||
form.is_default = isDefaultAddress.value ? 1 : 0
|
||||
// form.is_default = isDefaultAddress.value ? 1 : 0
|
||||
|
||||
if (addressId.value > 0 ) {
|
||||
// 编辑地址
|
||||
form.id = addressId.value
|
||||
await editUserAddress(form)
|
||||
} else {
|
||||
delete form.id
|
||||
await addUserAddress(form)
|
||||
}
|
||||
|
||||
uni.$emit('refreshAddressList')
|
||||
router.navigateBack(500)
|
||||
|
||||
router.navigateBack(1, 500)
|
||||
},
|
||||
|
||||
handleSleep: async (second: number = 1) => {
|
||||
|
||||
@ -270,19 +270,17 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-24rpx">
|
||||
<view class="font-bold text-28rpx leading-48rpx text-[#303133]">对饮八式</view>
|
||||
<view class="font-bold text-28rpx leading-48rpx text-[#303133]">茶品介绍</view>
|
||||
<view class="mt-24rpx font-500 text-[#303133] text-26rpx leading-48rpx">
|
||||
<view>
|
||||
<text class="mr-20rpx">① 洗尘</text>
|
||||
<text class="mr-20rpx">② 坦呈</text>
|
||||
<text class="mr-20rpx">③ 苏酲</text>
|
||||
<text class="mr-20rpx">④ 法度</text>
|
||||
<text class="mr-20rpx">1. 产地介绍</text>
|
||||
<text class="mr-20rpx">2. 基础属性</text>
|
||||
<text class="mr-20rpx">3. 外形品相</text>
|
||||
<text class="mr-20rpx">4. 色香表现</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="mr-20rpx">⑤ 养成</text>
|
||||
<text class="mr-20rpx">⑥ 身受</text>
|
||||
<text class="mr-20rpx">⑦ 分享</text>
|
||||
<text class="mr-20rpx">⑧ 放下</text>
|
||||
<text class="mr-20rpx">5.工艺特点</text>
|
||||
<text class="mr-20rpx">6. 滋味口感</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -413,8 +411,8 @@
|
||||
// 获取茶艺师详情
|
||||
const res = await getTeaSpecialistDetail({
|
||||
team_user_id: args.id,
|
||||
latitude: uni.getStorageSync('latitude'),
|
||||
longitude: uni.getStorageSync('longitude'),
|
||||
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
|
||||
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
|
||||
})
|
||||
info.value = res.teamaster
|
||||
console.log("🚀 ~ res:", res)
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 团体茶艺师预购 -->
|
||||
<view class="">
|
||||
<!-- <view class="">
|
||||
<view class="mx-30rpx flex items-center">
|
||||
<view class="flex items-center mr-14rpx">
|
||||
<wd-img width="160rpx" height="36rpx" :src="`${OSS}images/h5/home/home_image1.png`" />
|
||||
@ -50,17 +50,17 @@
|
||||
</view>
|
||||
<view class="font-400 text-22rpx leading-32rpx text-#818CA9">定制方案</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="mt-16rpx relative w-690rpx h-260rpx mx-30rpx">
|
||||
<!-- <view class="mt-16rpx relative w-690rpx h-260rpx mx-30rpx"> -->
|
||||
<!-- <view class="mt-16rpx relative w-690rpx h-260rpx mx-30rpx" @click="router.navigateTo('/pages/reserve/group-tea-specialist')"> -->
|
||||
<wd-img width="690rpx" height="260rpx" :src="`${OSS}images/h5/home/home_image2.png`" mode="scaleToFill" />
|
||||
<!-- <wd-img width="690rpx" height="260rpx" :src="`${OSS}images/h5/home/home_image2.png`" mode="scaleToFill" />
|
||||
<view class="h-64rpx absolute bottom-0 right-0 bg-[#4C9F44] text-[#fff] flex items-center px-26rpx rounded">
|
||||
<text class="mr-8rpx">一键约</text>
|
||||
<wd-img width="22rpx" height="18.06rpx" :src="`${OSS}icon/icon_arrow_right.png`" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 茶艺师列表 -->
|
||||
<view class="">
|
||||
@ -104,13 +104,13 @@
|
||||
</view>
|
||||
|
||||
<view class="flex items-center">
|
||||
<!-- 到店服务 -->
|
||||
<view class="mr-12rpx" v-if="item.server_type == 1">
|
||||
<!-- 到店服务标签 -->
|
||||
<view class="mr-12rpx" v-if="item.server_type == 1 || item.server_type == 3">
|
||||
<wd-tag color="#F55726" bg-color="#F55726" plain custom-class="!rounded-4rpx">到店服务</wd-tag>
|
||||
</view>
|
||||
|
||||
<!-- 上门服务 -->
|
||||
<view class="mr-12rpx" v-if="item.server_type == 2">
|
||||
<!-- 上门服务标签 -->
|
||||
<view class="mr-12rpx" v-if="item.server_type == 2 || item.server_type == 3">
|
||||
<wd-tag color="#40AE36" bg-color="#40AE36" plain custom-class="!rounded-4rpx">上门服务</wd-tag>
|
||||
</view>
|
||||
|
||||
@ -227,11 +227,6 @@
|
||||
* @param state 茶艺师状态: 0:可约 1:工作中
|
||||
*/
|
||||
handleReserveTeaSpecialist: (id: number, state: number) => {
|
||||
if (state === 1) {
|
||||
toast.show('茶艺师工作中,暂不可预约')
|
||||
return
|
||||
}
|
||||
|
||||
router.navigateTo(`/bundle_b/pages/tea-specialist/detail?id=${id}`)
|
||||
},
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
</view>
|
||||
<view class="" v-if="currentTimePicker == 'end'">
|
||||
<wd-datetime-picker-view
|
||||
:minDate='minTimestamp'
|
||||
:minDate='futureTimestamp'
|
||||
:maxDate='maxTimestamp'
|
||||
type="datetime"
|
||||
v-model="endTimeValue"
|
||||
@ -76,12 +76,12 @@
|
||||
<view>
|
||||
<view class="flex justify-between items-center text-30rpx text-[#303133] leading-42rpx">
|
||||
<view>服务费</view>
|
||||
<view>¥{{ bill.service.total }}</view>
|
||||
<view>¥{{ costBill.server_all_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx">
|
||||
<view>服务费(¥{{ bill.service.unitPrice }}元/小时)</view>
|
||||
<view>x{{ bill.service.num }}</view>
|
||||
<view>服务费(¥{{ costBill.server_price }}元/小时)</view>
|
||||
<view>x{{ costParams.hours }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -89,12 +89,12 @@
|
||||
<view>
|
||||
<view class="flex justify-between items-center text-30rpx text-[#303133] leading-42rpx mt-52rpx">
|
||||
<view>车马费</view>
|
||||
<view>¥{{ bill.travel.total }}</view>
|
||||
<view>¥{{ costBill.mileage_server_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx">
|
||||
<view>车马费(¥{{ bill.travel.unitPrice }}元/小时)</view>
|
||||
<view>{{ bill.travel.num }}公里</view>
|
||||
<view>车马费(¥{{ costBill.mileage_price }}元/小时)</view>
|
||||
<view>{{ costBill.team_user_distance }}公里</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -102,23 +102,28 @@
|
||||
<view>
|
||||
<view class="flex justify-between items-center text-30rpx text-[#303133] leading-42rpx mt-52rpx">
|
||||
<view>茶艺服务</view>
|
||||
<view>¥{{ bill.teaService.total }}</view>
|
||||
<view>¥{{ costBill.leaf_tea_all_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx">
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx" v-if="selectedTeaTxt.length > 0">
|
||||
<view class='w-400rpx'>{{ selectedTeaTxt.join('/') }}</view>
|
||||
<view>¥{{ bill.teaService.total }}</view>
|
||||
<view>¥{{ costBill.leaf_amount }}</view>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx" v-if="teaUsageValue > 0">
|
||||
<view class='w-400rpx'>茶具使用</view>
|
||||
<view>{{ costBill.teacup_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt-52rpx">
|
||||
<view class="flex justify-between items-center text-30rpx text-[#303133] leading-42rpx">
|
||||
<view>优惠</view>
|
||||
<view class="text-[#4C9F44]">-¥{{ bill.coupon }}</view>
|
||||
<view class="text-[#4C9F44]">-¥{{ costBill.coupon_price }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx">
|
||||
<view>优惠券</view>
|
||||
<view>-¥{{ bill.coupon }}</view>
|
||||
<view>-¥{{ costBill.coupon_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -128,7 +133,7 @@
|
||||
|
||||
<view class="flex justify-between items-center text-30rpx text-[#303133] leading-42rpx">
|
||||
<view>实付金额</view>
|
||||
<view>¥{{ bill.total }}</view>
|
||||
<view>¥{{ costBill.order_amount }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -154,26 +159,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 预定茶叶 -->
|
||||
<view class="mx-60rpx mb-50rpx">
|
||||
<view class="text-32rpx leading-44rpx text-#303133">
|
||||
<text class="mr-20rpx">预定茶叶</text>
|
||||
<text class="text-26rpx leading-36rpx text-#909399">支持多选</text>
|
||||
</view>
|
||||
<view class="mt-28rpx">
|
||||
<view class="grid grid-cols-3 gap-x-16rpx gap-y-16rpx">
|
||||
<view
|
||||
v-for="(item, index) in teaList" :key="index"
|
||||
class="text-28rpx leading-40rpx rounded-8rpx text-center py-14rpx"
|
||||
:class="selectedTea.includes(item.id) ? 'bg-#4C9F44 text-#fff' : 'bg-#F7F7F7 text-#606266'"
|
||||
@click="Reserve.handleToggleTea(item.id, item.name, item.price)">
|
||||
<view>{{item.name}}</view>
|
||||
<view>¥{{item.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 茶具使用 -->
|
||||
<view class="mx-60rpx mb-70rpx">
|
||||
<view class="text-32rpx leading-44rpx text-#303133">茶具使用</view>
|
||||
@ -193,6 +178,26 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 预定茶叶 -->
|
||||
<view class="mx-60rpx mb-50rpx">
|
||||
<view class="text-32rpx leading-44rpx text-#303133">
|
||||
<text class="mr-20rpx">预定茶叶</text>
|
||||
<text class="text-26rpx leading-36rpx text-#909399">支持多选</text>
|
||||
</view>
|
||||
<view class="mt-28rpx">
|
||||
<view class="grid grid-cols-3 gap-x-16rpx gap-y-16rpx">
|
||||
<view
|
||||
v-for="(item, index) in teaList" :key="index"
|
||||
class="text-28rpx leading-40rpx rounded-8rpx text-center py-14rpx"
|
||||
:class="selectedTea.includes(item.id) ? 'bg-#4C9F44 text-#fff' : 'bg-#F7F7F7 text-#606266'"
|
||||
@click="Reserve.handleToggleTea(item.id, item.name, item.price)">
|
||||
<view>{{item.name}}</view>
|
||||
<view>¥{{item.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="h-2rpx bg-#EFF0F2"></view>
|
||||
|
||||
<!-- 按钮 -->
|
||||
@ -200,7 +205,7 @@
|
||||
<view class="">
|
||||
<view class="text-24rpx leading-34rpx text-#303133">已选 {{selectedTea.length}} 项</view>
|
||||
<view class="">
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="totalSelectedTeaPrice"></price-format>
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="costBill.order_amount"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -225,7 +230,7 @@
|
||||
<!-- 茶艺师信息 -->
|
||||
<view class="flex items-center bg-white p-20rpx rounded-10rpx mb-20rpx mt-20rpx">
|
||||
<view class="mr-28rpx relative">
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
|
||||
<wd-img width="200rpx" height="200rpx" :src="info.image"></wd-img>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx">
|
||||
@ -269,7 +274,7 @@
|
||||
<view class="flex items-center">
|
||||
<view class="text-28rpx leading-40rpx text-#303133 w-430rpx line-1 text-right">
|
||||
<template v-if="address && address.id > 0">
|
||||
{{address.contact}} {{ address.telephone }} {{ address.province }}{{ address.city }}{{ address.district }}{{ address.address }}
|
||||
{{address.contact}} {{ address.telephone }} {{ address.address }}
|
||||
</template>
|
||||
<template v-else>
|
||||
请选择地址
|
||||
@ -288,10 +293,7 @@
|
||||
<view class="text-[26rpx] text-[#606266] leading-36rpx">{{ sevenDay.minimum_time }}小时起订</view>
|
||||
<view class="flex items-center">
|
||||
<view class="text-[28rpx] text-[#909399] leading-40rpx w-430rpx line-1 text-right">
|
||||
<template v-if="serviceTypeValue == 1 && dayHours">
|
||||
{{ dayTime }} {{ dayHours }}
|
||||
</template>
|
||||
<template v-else-if="serviceTypeValue == 2 && startTimeLayout && endTimeLayout">
|
||||
<template v-if="startTimeLayout && endTimeLayout">
|
||||
{{ startTimeLayout }} {{ endTimeLayout }}
|
||||
</template>
|
||||
<template v-else>
|
||||
@ -326,15 +328,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单备注 -->
|
||||
<view class="bg-white py-26rpx px-30rpx mt-20rpx">
|
||||
<view class="text-32rpx leading-44rpx text-#303133 mb-28rpx">
|
||||
<text class="mr-20rpx">订单备注 </text>
|
||||
<text class="text-26rpx leading-36rpx text-#909399">(选填)</text>
|
||||
</view>
|
||||
<wd-textarea placeholder="有想说的可以在这里写哦!" v-model="orderRemarks" custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA]' custom-textarea-class='!bg-[#F8F9FA]' />
|
||||
</view>
|
||||
|
||||
<!-- 优惠券 -->
|
||||
<view class="bg-white py-26rpx px-30rpx mt-20rpx" @click="Reserve.handleToCoupon(CouponType.Discount)">
|
||||
<view class="text-[#303133] text-32rpx leading-44rpx font-bold mb-24rpx">优惠券</view>
|
||||
@ -356,6 +349,22 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单备注 -->
|
||||
<view class="bg-white py-26rpx px-30rpx mt-20rpx">
|
||||
<view class="text-32rpx leading-44rpx text-#303133 mb-28rpx">
|
||||
<text class="mr-20rpx">订单备注 </text>
|
||||
<text class="text-26rpx leading-36rpx text-#909399">(选填)</text>
|
||||
</view>
|
||||
<wd-textarea v-model="orderRemarks"
|
||||
:auto-height="true"
|
||||
no-border
|
||||
placeholder="有想说的可以在这里写哦!"
|
||||
custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA]'
|
||||
custom-textarea-class='!bg-[#F8F9FA] !min-h-[100rpx] !px-24rpx' />
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<!-- <view class="bg-white py-26rpx px-30rpx mt-20rpx">
|
||||
<pay hide-store-balance @pay="Reserve.handleGetPayValue"></pay>
|
||||
@ -367,7 +376,7 @@
|
||||
<view class="flex items-center ml-40rpx mr-20rpx" @click="showCostPopup = true">
|
||||
<view class="text-24rpx text-[#303133] leading-34rpx w-50rpx whitespace-nowrap mr-10rpx">合计:</view>
|
||||
<view class="flex items-center h-56rpx mr-16rpx">
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="bill.total"></price-format>
|
||||
<price-format color="#FF5951" :first-size="40" :second-size="40" :subscript-size="28" :price="costBill.order_amount"></price-format>
|
||||
</view>
|
||||
<view class="flex items-center text-[#4C9F44] w-100rpx whitespace-nowrap">
|
||||
<view class="text-24rpx mr-10rpx">费用明细</view>
|
||||
@ -375,7 +384,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="mr-30rpx">
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' @click="Reserve.handleSubmitOrder">立即预定</wd-button>
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' :disabled="isSubmitting" @click="Reserve.handleSubmitOrder">立即预定</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -396,12 +405,15 @@
|
||||
import type { IUserAddressListResult } from '@/api/types/user'
|
||||
import BookingTime from '@/components/BookingTime.vue'
|
||||
import { CouponType } from '@/utils/coupon'
|
||||
import { getTeaSpecialistDetail } from '@/api/tea-specialist'
|
||||
import { getTeaSpecialistDetail, getTeaSpecialistFeeDetails } from '@/api/tea-specialist'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const toast = useToast()
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
// 防止重复提交
|
||||
const isSubmitting = ref(false)
|
||||
|
||||
// 服务方式
|
||||
const serviceType = ref<Array<any>>([
|
||||
{type: 1, name: '到店服务'},
|
||||
@ -434,8 +446,9 @@
|
||||
const startTimeValue = ref<string>('') // 开始时间
|
||||
const endTimeValue = ref<string>('') // 结束时间
|
||||
const now = new Date()
|
||||
const minTimestamp = Date.now()
|
||||
// 允许选择今天及未来六天的日期
|
||||
const minTimestamp = Date.now() + 0.5 * 60 * 60 * 1000
|
||||
// 允许选择今天及未来六天的日期
|
||||
const futureTimestamp = minTimestamp + 2 * 60 * 60 * 1000
|
||||
const maxTimestamp = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 6, 23, 59, 59, 999).getTime()
|
||||
const startTimeLayout = ref<string>('')
|
||||
const endTimeLayout = ref<string>('')
|
||||
@ -453,7 +466,6 @@
|
||||
})
|
||||
|
||||
// 茶艺服务
|
||||
const teaService = ref<{id: number, name: string}>({id: 0, name: ''})
|
||||
const showTeaServicePopup = ref<boolean>(false) // 显示门店列表弹窗
|
||||
const servicePeople = ref<number>(1) // 服务人数
|
||||
const teaList = ref<ITeaTypeListResult[]>([]) // 茶叶列表
|
||||
@ -464,10 +476,10 @@
|
||||
|
||||
// 茶具使用
|
||||
const teaUsageList = ref<Array<any>>([
|
||||
{type: 1, name: '客户自备'},
|
||||
{type: 2, name: '茶艺师提供'},
|
||||
{type: 0, name: '客户自备'},
|
||||
{type: 1, name: '茶艺师提供'},
|
||||
])
|
||||
const teaUsageValue = ref<number>(1)
|
||||
const teaUsageValue = ref<number>(0)
|
||||
|
||||
// 订单备注
|
||||
const orderRemarks = ref<string>('')
|
||||
@ -479,6 +491,7 @@
|
||||
const id = ref<number>(0)
|
||||
const info = ref({
|
||||
id: 0,
|
||||
image: '',
|
||||
image_arr: [], // 轮播图
|
||||
name: '', // 茶艺师名字
|
||||
star: 0, // 茶艺师评分
|
||||
@ -494,6 +507,7 @@
|
||||
hobby_introduce: '', // 兴趣爱好介绍
|
||||
price: 0, // 服务费
|
||||
mileage_price: 0, // 车马费
|
||||
state: 0, // 茶艺师状态哦
|
||||
})
|
||||
|
||||
// 选择的优惠券
|
||||
@ -524,25 +538,44 @@
|
||||
coupon: 0,
|
||||
total: 0
|
||||
})
|
||||
|
||||
|
||||
// 费用明细
|
||||
const costBill = ref<any>({
|
||||
order_amount: 0, // 订单实付价格
|
||||
server_price: 0, // 服务费单价
|
||||
server_all_price: 0, // 服务费总价
|
||||
mileage_price: 0, // 车马费单价
|
||||
team_user_distance: 0, // 车马费公里数
|
||||
mileage_server_price: 0, //车马费总价
|
||||
leaf_tea_all_price: 0, // 茶艺服务费
|
||||
leaf_amount: 0, // 茶叶金额
|
||||
teacup_price: 0, // 茶具金额
|
||||
coupon_price: 0, // 优惠券金额
|
||||
})
|
||||
|
||||
// 计算费用明细参数
|
||||
const costParams = ref({
|
||||
hours: 0, // 预定小时数
|
||||
tea_id: '', // 茶叶id
|
||||
longitude: 0, // 经度
|
||||
latitude: 0, // 纬度
|
||||
user_coupon_id: 0, // 优惠券id
|
||||
is_teacup: 0, // 是否需要茶具 0客户自备 1茶艺师提供
|
||||
team_user_id: 0, // 茶艺师id
|
||||
})
|
||||
|
||||
onLoad(async (args) => {
|
||||
if (args.id) {
|
||||
id.value = Number(args.id)
|
||||
costParams.value.team_user_id = Number(args.id)
|
||||
|
||||
// 获取茶艺师详情
|
||||
const res = await getTeaSpecialistDetail({
|
||||
team_user_id: args.id,
|
||||
latitude: uni.getStorageSync('latitude'),
|
||||
longitude: uni.getStorageSync('longitude'),
|
||||
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
|
||||
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
|
||||
})
|
||||
info.value = res.teamaster
|
||||
|
||||
|
||||
// bill.value.travel = {
|
||||
// total: toTimes(info.fare_price, info.distance),
|
||||
// unitPrice: info.fare_price,
|
||||
// num: info.distance
|
||||
// }
|
||||
}
|
||||
|
||||
// 初始化数据
|
||||
@ -550,11 +583,12 @@
|
||||
})
|
||||
|
||||
const Reserve = {
|
||||
/**
|
||||
* 初始化-获取茶叶列表
|
||||
*/
|
||||
handleInit: async () => {
|
||||
// 获取茶叶列表
|
||||
const tea = await getTeaTypeList()
|
||||
teaList.value = tea as ITeaTypeListResult[]
|
||||
console.log("🚀 ~ teaList.value:", teaList.value)
|
||||
},
|
||||
|
||||
/**
|
||||
@ -585,39 +619,37 @@
|
||||
dayHours.value = ''
|
||||
sevenDay.minimum_time = MINIMUMTIME
|
||||
sevenDay.time = []
|
||||
teaHouse.value = {id: 0, name: ''}
|
||||
}
|
||||
|
||||
teaHouse.value = {id: 0, name: ''}
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择预订时间
|
||||
*/
|
||||
handleChooseTime: async () => {
|
||||
if (info.value.state === 1) {
|
||||
toast.show('茶艺师工作中,暂不可预约')
|
||||
return
|
||||
}
|
||||
|
||||
if (serviceTypeValue.value === 1 && teaHouse.value.id === 0) {
|
||||
// 到店服务必须要选择门店
|
||||
toast.show('请先选择门店')
|
||||
return false
|
||||
}
|
||||
|
||||
if (serviceTypeValue.value === 1) {
|
||||
const storeId = teaHouse.value.id || 0
|
||||
const next7 = await getNext7Days(storeId, getCurrentDate())
|
||||
// disabled = 0 可预约 1不可逾越
|
||||
Object.assign(sevenDay, next7.data)
|
||||
Object.assign(sevenDay, {minimum_time: MINIMUMTIME})
|
||||
showBookTimePopup.value = true
|
||||
} else if (serviceTypeValue.value === 2) {
|
||||
// 上门服务
|
||||
showReservePopup.value = true
|
||||
}
|
||||
showReservePopup.value = true
|
||||
},
|
||||
|
||||
/**
|
||||
* 切换预定茶叶选择
|
||||
*/
|
||||
handleToggleTea: (id: number, name: string, price: number) => {
|
||||
console.log("🚀 ~ id:", id)
|
||||
const index = selectedTea.value.indexOf(id)
|
||||
if (index > -1) {
|
||||
console.log("🚀 ~ index:", index)
|
||||
if (index >= 0) {
|
||||
// 已选择,取消选择
|
||||
selectedTea.value.splice(index, 1)
|
||||
selectedTeaTxt.value.splice(index, 1)
|
||||
@ -628,9 +660,14 @@
|
||||
selectedTeaTxt.value.push(name)
|
||||
selectedTeaPrice.value.push(price)
|
||||
}
|
||||
console.log("🚀 ~ selectedTea.value:", selectedTea.value)
|
||||
|
||||
totalSelectedTeaPrice.value = toPlus(selectedTeaPrice.value)
|
||||
bill.value.teaService.total = Number(totalSelectedTeaPrice.value) // 更新茶艺服务费用
|
||||
|
||||
// 计算费用明细
|
||||
costParams.value.tea_id = selectedTea.value.join(',')
|
||||
Reserve.handleCost()
|
||||
},
|
||||
|
||||
/**
|
||||
@ -639,8 +676,14 @@
|
||||
handleToChooseStore: () => {
|
||||
uni.$on('chooseTeaHouse', params => {
|
||||
console.log("🚀 ~ params:", params)
|
||||
|
||||
uni.$off('chooseTeaHouse')
|
||||
teaHouse.value = params
|
||||
|
||||
// 计算费用明细
|
||||
costParams.value.longitude = params.longitude
|
||||
costParams.value.latitude = params.latitude
|
||||
// Reserve.handleCost()
|
||||
})
|
||||
router.navigateTo('/bundle_b/pages/tea-specialist/store?from=reserve')
|
||||
},
|
||||
@ -650,8 +693,13 @@
|
||||
*/
|
||||
handleToAddress: () => {
|
||||
uni.$on('chooseAddress', params => {
|
||||
console.log("🚀 ~ params:", params)
|
||||
uni.$off('chooseAddress')
|
||||
address.value = params
|
||||
|
||||
costParams.value.longitude = params.longitude
|
||||
costParams.value.latitude = params.latitude
|
||||
// Reserve.handleCost()
|
||||
})
|
||||
router.navigateTo('/bundle_b/pages/tea-specialist/address/list?from=reserve')
|
||||
},
|
||||
@ -660,21 +708,20 @@
|
||||
* 选中预定时间
|
||||
*/
|
||||
handleChooseReserveTime: (params: any) => {
|
||||
console.log("🚀 ~ params:", params)
|
||||
reserveTime.value = params
|
||||
if (!digits(params.countSelectedTime)) {
|
||||
message.alert({
|
||||
title: '提示',
|
||||
msg: '选择时间段不满一小时按一小时算请合理选择时间',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonProps: {
|
||||
customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
})
|
||||
}
|
||||
// if (!digits(params.countSelectedTime)) {
|
||||
// message.alert({
|
||||
// title: '提示',
|
||||
// msg: '选择时间段不满一小时按一小时算请合理选择时间',
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonProps: {
|
||||
// customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
// },
|
||||
// confirmButtonProps: {
|
||||
// customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
// },
|
||||
// })
|
||||
// }
|
||||
|
||||
timeSlots.value = params.selectedTimestamps
|
||||
dayTitle.value = params.dayTitle
|
||||
@ -684,10 +731,9 @@
|
||||
}).join(',')
|
||||
dayHours.value = times
|
||||
startTime.value = params.selectedTimestamps[0]
|
||||
console.log("🚀 ~ startTime.value:", startTime.value)
|
||||
endTime.value = params.selectedTimestamps[params.selectedTimestamps.length - 1]
|
||||
console.log("🚀 ~ endTime.value:", endTime.value)
|
||||
|
||||
// 预定了几个小时
|
||||
countHours.value = params.countSelectedTime
|
||||
|
||||
bill.value.service = {
|
||||
@ -698,14 +744,16 @@
|
||||
endHour: params.selectedTime[params.selectedTime.length - 1].time
|
||||
}
|
||||
|
||||
// Detail.handleCalculateTeaRoomPrice()
|
||||
// 计算费用明细
|
||||
costParams.value.hours = params.countSelectedTime
|
||||
Reserve.handleCost()
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转优惠券页面
|
||||
*/
|
||||
handleToCoupon(type) {
|
||||
if (reserveTime.value.length == 0) {
|
||||
if (totalHour.value == 0) {
|
||||
toast.info('请选择预定时间')
|
||||
return
|
||||
}
|
||||
@ -716,10 +764,13 @@
|
||||
selectedCoupon.value = {id: params.coupon.id, name: params.coupon.name}
|
||||
bill.value.coupon = params.coupon.coupon_price
|
||||
selectCouponId.value = params.coupon.id // 这里的ID是在数据表自增的ID,保存下来是为了回显列表的,没有其他作用
|
||||
|
||||
// 计算费用明细
|
||||
costParams.value.user_coupon_id = params.coupon.id
|
||||
Reserve.handleCost()
|
||||
})
|
||||
|
||||
// 获取预定了几个小时
|
||||
const count = bill.value.service.num
|
||||
router.navigateTo(`/bundle_b/pages/tea-specialist/coupon?couponId=${selectCouponId.value}`)
|
||||
},
|
||||
|
||||
@ -729,7 +780,7 @@
|
||||
handleResetTeaService: () => {
|
||||
servicePeople.value = 1
|
||||
selectedTea.value = []
|
||||
teaUsageValue.value = 1
|
||||
teaUsageValue.value = 0
|
||||
},
|
||||
|
||||
/**
|
||||
@ -740,60 +791,82 @@
|
||||
toast.info('请选择预定茶叶')
|
||||
return
|
||||
}
|
||||
teaService.value = { id: 1, name: '茶艺服务' }
|
||||
showTeaServicePopup.value = false
|
||||
|
||||
// 计算费用明细
|
||||
costParams.value.is_teacup = teaUsageValue.value
|
||||
Reserve.handleCost()
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交订单数据
|
||||
*/
|
||||
handleSubmitOrder: async () => {
|
||||
if (serviceTypeValue.value == 1 && teaHouse.value.id == 0) {
|
||||
toast.info('请选择门店地址')
|
||||
if (isSubmitting.value) return
|
||||
|
||||
if (costParams.value.longitude == 0 && costParams.value.latitude == 0) {
|
||||
toast.info('请选择地址')
|
||||
return false
|
||||
}
|
||||
|
||||
if (info.value.state === 1) {
|
||||
toast.show('茶艺师工作中,暂不可预约')
|
||||
return
|
||||
}
|
||||
|
||||
if (serviceTypeValue.value == 2 && address.value.id == 0) {
|
||||
toast.info('请选择上门服务地址')
|
||||
return
|
||||
}
|
||||
|
||||
if (bill.value.service.num == 0) {
|
||||
if (totalHour.value == 0) {
|
||||
toast.info('请选择预定时间')
|
||||
return
|
||||
return false
|
||||
}
|
||||
|
||||
if (selectedTea.value.length == 0) {
|
||||
toast.info('请选择茶艺时服务')
|
||||
return
|
||||
toast.info('请选择茶叶')
|
||||
return false
|
||||
}
|
||||
|
||||
// if (teaUsageValue.value == -1) {
|
||||
// toast.info('请选择茶具需求')
|
||||
// showTeaServicePopup.value = true
|
||||
// return false
|
||||
// }
|
||||
|
||||
isSubmitting.value = true
|
||||
// uni.showLoading({
|
||||
// title: '提交中...'
|
||||
// })
|
||||
toast.loading('提交中...')
|
||||
|
||||
// 提交的订单数据
|
||||
const params = {
|
||||
team_user_id: id.value, // 茶艺师ID
|
||||
server_type: serviceTypeValue.value, // 服务方式 1到店服务 2上门服务
|
||||
longitude: uni.getStorageSync('longitude'), // 经度
|
||||
latitude: uni.getStorageSync('latitude'), // 纬度
|
||||
longitude: costParams.value.longitude, // 经度
|
||||
latitude: costParams.value.latitude, // 纬度
|
||||
store_id: serviceTypeValue.value == 1 ? teaHouse.value.id : 0, // 茶室Id如果是上门服务则传0
|
||||
address: serviceTypeValue.value == 1 ? teaHouse.value.name : address.value.address, // 地址: 到店传茶室名称 上门则传地址
|
||||
start_time: serviceTypeValue.value == 1 ? startTime.value : Math.floor(Door.startTimeTimestamp / 1000), // 预约开始时间
|
||||
end_time: serviceTypeValue.value == 1 ? endTime.value : Math.floor(Door.endTimeTimestamp / 1000), // 预约结束时间
|
||||
hours: serviceTypeValue.value == 1 ? countHours.value : totalHour.value, // 预约小时数
|
||||
start_time: Math.floor(Door.startTimeTimestamp / 1000), // 预约开始时间
|
||||
end_time: Math.floor(Door.endTimeTimestamp / 1000), // 预约结束时间
|
||||
hours: totalHour.value, // 预约小时数
|
||||
remrk: orderRemarks.value, // 订单备注
|
||||
is_teacup: teaUsageValue.value, // 是否需要茶具 1客户自备 2茶艺师提供
|
||||
is_teacup: teaUsageValue.value, // 是否需要茶具 0客户自备 1茶艺师提供
|
||||
tea_id: selectedTea.value.join(','), // 茶叶商品ids 多个逗号隔开
|
||||
user_coupon_id: selectedCoupon.value.id, // 优惠券id默认传0
|
||||
server_number: servicePeople.value
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await createTeaSpecialistOrder(params)
|
||||
toast.close()
|
||||
|
||||
uni.$on('payment', params => {
|
||||
console.log("🚀 ~ params:", params)
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
isSubmitting.value = false
|
||||
|
||||
if (params.result) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/notice/reserve?type=teaSpecialist&orderId=${params.orderId}`
|
||||
url: `/pages/notice/reserve?type=${OrderType.TeaSpecialist}&orderId=${params.orderId}`
|
||||
})
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
@ -804,12 +877,23 @@
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
router.navigateTo(`/pages/cashier/cashier?from=${OrderType.TeaSpecialist}&orderId=${res.id}&teaSpecialistId=${info.id}&teaSpecialistName=${info.name}`)
|
||||
router.navigateTo(`/pages/cashier/cashier?from=${OrderType.TeaSpecialist}&orderId=${res.order_id}&teaSpecialistName=${info.value.name}&teaSpecialistOrderAmount=${res.order_amount}`)
|
||||
}, 800)
|
||||
} catch (error) {
|
||||
toast.info('订单提交失败,请稍后重试')
|
||||
toast.close()
|
||||
isSubmitting.value = false
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 计算费用明细
|
||||
*/
|
||||
handleCost: async () => {
|
||||
toast.loading('计费中...')
|
||||
const res = await getTeaSpecialistFeeDetails(costParams.value)
|
||||
toast.close()
|
||||
costBill.value = res
|
||||
}
|
||||
}
|
||||
|
||||
@ -819,8 +903,12 @@
|
||||
endTimeTimestamp: 0, // 记录结束时间戳
|
||||
|
||||
handleStartTimePicker: (e: {value: number}) => {
|
||||
console.log("🚀 ~ e:", e)
|
||||
Door.startTimeTimestamp = e.value
|
||||
startTimeLayout.value = Door.handleFormatDate(e.value)
|
||||
endTimeLayout.value = Door.handleFormatDate(Number(e.value) + Number(2 * 60 * 60 * 1000)) // 初始化结束时间是未来2个小时
|
||||
Door.endTimeTimestamp = Number(e.value) + Number(2 * 60 * 60 * 1000) // 初始化结束时间是未来2个小时
|
||||
endTimeValue.value = String(Door.endTimeTimestamp)
|
||||
Door.handleTotalTimestamp()
|
||||
},
|
||||
|
||||
@ -831,8 +919,6 @@
|
||||
},
|
||||
|
||||
handleFormatTime: (type: string, values: string) => {
|
||||
const now = new Date();
|
||||
|
||||
if (type === 'year') {
|
||||
return `${values}年`
|
||||
}
|
||||
@ -898,25 +984,29 @@
|
||||
* 确定时间
|
||||
*/
|
||||
handleConfirmHour: () => {
|
||||
if (totalHour.value <= sevenDay.minimum_time) {
|
||||
if (totalHour.value < sevenDay.minimum_time) {
|
||||
toast.info(`起订时间${sevenDay.minimum_time}小时`)
|
||||
return
|
||||
}
|
||||
|
||||
if (!digits(totalHour.value)) {
|
||||
message.alert({
|
||||
title: '提示',
|
||||
msg: '选择时间段不满一小时按一小时算请合理选择时间',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonProps: {
|
||||
customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
})
|
||||
}
|
||||
// if (!digits(totalHour.value)) {
|
||||
// message.alert({
|
||||
// title: '提示',
|
||||
// msg: '选择时间段不满一小时按一小时算请合理选择时间',
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonProps: {
|
||||
// customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
// },
|
||||
// confirmButtonProps: {
|
||||
// customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
// },
|
||||
// })
|
||||
// }
|
||||
showReservePopup.value = false
|
||||
|
||||
// 计算费用明细
|
||||
costParams.value.hours = totalHour.value
|
||||
Reserve.handleCost()
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -91,8 +91,8 @@
|
||||
const filter = {
|
||||
page: mescroll.num,
|
||||
size: mescroll.size,
|
||||
latitude: uni.getStorageSync('latitude'),
|
||||
longitude: uni.getStorageSync('longitude'),
|
||||
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
|
||||
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
|
||||
search: storeName.value
|
||||
}
|
||||
|
||||
|
||||
@ -160,54 +160,52 @@
|
||||
<view v-if="type === OrderSource.TeaSpecialist" class="bg-white rounded-10rpx p-28rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="mr-28rpx">
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`" radius="10rpx"></wd-img>
|
||||
<wd-img width="200rpx" height="200rpx" :src="order.image" radius="10rpx"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1" @click="ComboCard.handleToOrderDetail">
|
||||
<view class="flex items-center relative">
|
||||
<view class="w-400rpx flex items-center">
|
||||
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx">茶艺师</view>
|
||||
<view class="w-160rpx h-40rpx relative mr-44rpx">
|
||||
<view class="absolute left-0 top-0 h-36rpx flex items-start">
|
||||
<wd-img :src="`${OSS}icon/icon_gold_medal.png`" width="36rpx" height="36rpx"></wd-img>
|
||||
</view>
|
||||
<view class="bg-[#F0F6EF] text-[#006C2D] font-400 text-22rpx leading-32rpx rounded-4rpx text-center w-150rpx ml-18rpx pb-4rpx">金牌茶艺师</view>
|
||||
<view class="font-bold text-[#303133] text-30rpx leading-42rpx mr-14rpx w-120rpx line-1">{{ order.name}}</view>
|
||||
<view>
|
||||
<tea-specialist-level :level="order.level"></tea-specialist-level>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="font-400 text-28rpx leading-20rpx text-[#4C9F44] flex items-center absolute top-6rpx right-0">
|
||||
<text v-if="orderStatus === OrderStatus.Consuming">消费中</text>
|
||||
<text v-if="orderStatus === OrderStatus.Reserved">已预约</text>
|
||||
<text v-if="orderStatus === OrderStatus.Serving">服务中</text>
|
||||
<text v-if="orderStatus === OrderStatus.Finished" class="text-[#606266]">完成</text>
|
||||
<text v-if="orderStatus === OrderStatus.Pending" class="text-[#FF5951]" >待付款</text>
|
||||
<text v-if="orderStatus === OrderStatus.Cancelled" class="text-[#C9C9C9]" >订单取消</text>
|
||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Unpaid" class="text-[#FF5951]">待付款</text>
|
||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Pending" class="text-[#FF5951]">待接单</text>
|
||||
<text v-if="order.order_status >= TeaSpecialistOrderStatus.SpecialistRefund && order.order_status <= TeaSpecialistOrderStatus.CustomerRefundAfterArrive" class="text-[#606266]">已退款</text>
|
||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Accepted">已预约</text>
|
||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Arrived">服务中</text>
|
||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Completed" class="text-[#606266]">完成</text>
|
||||
<text v-if="order.order_status === TeaSpecialistOrderStatus.Cancelled" class="text-[#C9C9C9]">订单取消</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex items-center">
|
||||
<view class="mr-12rpx">
|
||||
<view class="mr-12rpx" v-if="order.server_type == 1 || order.server_type == 3">
|
||||
<wd-tag color="#F55726" bg-color="#F55726" plain>到店服务</wd-tag>
|
||||
</view>
|
||||
<view class="mr-12rpx" v-if="order.server_type == 2 || order.server_type == 3">
|
||||
<wd-tag color="#40AE36" bg-color="#40AE36" plain custom-class="!rounded-4rpx">上门服务</wd-tag>
|
||||
</view>
|
||||
<view>
|
||||
<wd-tag color="#F55726" bg-color="#F55726" plain>到点服务</wd-tag>
|
||||
<view class="mr-12rpx">
|
||||
<wd-tag color="#818CA9" bg-color="#F3F3F3">{{ order.both }}岁</wd-tag>
|
||||
</view>
|
||||
<view class="flex items-center mt-8rpx">
|
||||
<wd-img :src="order.sex == 1 ? `${OSS}icon/icon_man.png` : `${OSS}icon/icon_woman.png`" width="28rpx" height="28rpx"></wd-img>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="font-400 text-[#606266] text-26rpx leading-36rpx mt-42rpx">
|
||||
预约时间:03/18 08:00-12:00
|
||||
预约时间:{{ order.day_time }} {{ order.start_time }}-{{ order.end_time }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 操作按钮 -->
|
||||
<view>
|
||||
<view v-if="orderStatus === OrderStatus.Finished || orderStatus === OrderStatus.Cancelled"
|
||||
class="flex items-center text-28rpx mt-28rpx justify-end"
|
||||
@click="ComboCard.handleDeleteOrder(OrderSource.TeaSpecialist)">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] flex items-center justify-center">
|
||||
删除订单
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="orderStatus === OrderStatus.Pending"
|
||||
<!-- 待付款 -->
|
||||
<view v-if="order.order_status === TeaSpecialistOrderStatus.Unpaid"
|
||||
class="flex items-center text-28rpx mt-28rpx justify-end">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] mr-28rpx flex items-center justify-center"
|
||||
@click="ComboCard.handleCancelOrder(OrderSource.TeaSpecialist)">
|
||||
@ -216,6 +214,24 @@
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44] flex items-center justify-center"
|
||||
@click="ComboCard.handleToPayOrder(OrderSource.TeaSpecialist)">去支付</view>
|
||||
</view>
|
||||
|
||||
<!-- 已完成、已取消 -->
|
||||
<view v-if="order.order_status === TeaSpecialistOrderStatus.Completed || order.order_status === TeaSpecialistOrderStatus.Cancelled"
|
||||
class="flex items-center text-28rpx mt-28rpx justify-end"
|
||||
@click="ComboCard.handleDeleteOrder(OrderSource.TeaSpecialist)">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] flex items-center justify-center">
|
||||
删除订单
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务中 -->
|
||||
<view v-if="order.order_status === TeaSpecialistOrderStatus.Arrived"
|
||||
class="flex items-center text-28rpx mt-28rpx justify-end">
|
||||
<view class="w-178rpx h-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133] flex items-center justify-center"
|
||||
@click="ComboCard.handleAgainReserve">
|
||||
再次预定
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -226,12 +242,15 @@
|
||||
|
||||
<script lang="ts" setup name="ComboCard">
|
||||
import { OrderSource, OrderStatus, TeaRoomOrderStatus, GroupComboOrderStatus, DouYinOrderStatus } from '@/utils/order'
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { useMessage, useToast } from 'wot-design-uni'
|
||||
// import { toast } from '@/utils/toast'
|
||||
import { handleTRCancelOrderHooks, handleTRDeleteOrderHooks, handleTRToPayHooks, handleToTRStoreHooks, handleRefundOrderHooks } from '@/hooks/useOrder'
|
||||
import { StoreType } from '@/utils/tea'
|
||||
import { router } from '@/utils/tools'
|
||||
import { PayOrderType } from '@/utils/pay'
|
||||
import { TeaSpecialistOrderStatus } from '@/utils/teaSpecialistOrder'
|
||||
import { handleCancelOrderHooks, handleDeleteOrderHooks } from '@/hooks/useTeaSpecialistOrder'
|
||||
import { OrderType } from '@/utils/order'
|
||||
|
||||
/**
|
||||
* ComboCard 套餐卡片组件
|
||||
@ -239,6 +258,7 @@
|
||||
*/
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const toast = useToast()
|
||||
|
||||
const props = defineProps({
|
||||
/**
|
||||
@ -336,7 +356,7 @@
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
}).then(async (res) => {
|
||||
switch (source) {
|
||||
case OrderSource.Combo:
|
||||
// TODO 这里调用删除直营订单的接口
|
||||
@ -349,7 +369,15 @@
|
||||
handleTRDeleteOrderHooks(props.order.id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
toast.loading('加载中...')
|
||||
const res = await handleDeleteOrderHooks(props.order.id)
|
||||
toast.close()
|
||||
if (res) {
|
||||
toast.show('删除成功')
|
||||
setTimeout(() => {
|
||||
uni.$emit('refreshOrderList')
|
||||
}, 500)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -374,7 +402,7 @@
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
}).then(async (res) => {
|
||||
if (res.action == 'confirm') {
|
||||
switch (source) {
|
||||
case OrderSource.Combo:
|
||||
@ -388,7 +416,15 @@
|
||||
handleTRCancelOrderHooks(props.order.id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
toast.loading('加载中...')
|
||||
const res = await handleCancelOrderHooks(props.order.id)
|
||||
toast.close()
|
||||
if (res) {
|
||||
toast.show('订单取消成功')
|
||||
setTimeout(() => {
|
||||
uni.$emit('refreshOrderList')
|
||||
}, 500)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -436,11 +472,56 @@
|
||||
handleTRToPayHooks(props.order.id, props.order.room_name, props.order.store_id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
router.navigateTo( `/bundle/order/tea-specialist/order-detail?orderStatus=${props.orderStatus}&toPay=true`)
|
||||
uni.$off("payment")
|
||||
uni.$on('payment', params => {
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
if (params.result) {
|
||||
toast.show('支付成功')
|
||||
setTimeout(() => {
|
||||
uni.$emit('refreshOrderList')
|
||||
}, 500)
|
||||
} else {
|
||||
toast.show('支付失败')
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
setTimeout(() => {
|
||||
router.navigateTo(`/pages/cashier/cashier?from=${OrderType.TeaSpecialist}&orderId=${props.order.id}&teaSpecialistName=${props.order.name}`)
|
||||
}, 800)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 茶艺师-再次预定
|
||||
*/
|
||||
handleAgainReserve: () => {
|
||||
router.navigateTo(`/bundle_b/pages/tea-specialist/list`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 茶艺师-确认订单
|
||||
*/
|
||||
handleConfirmOrder: () => {
|
||||
message.confirm({
|
||||
title: '确认订单',
|
||||
msg: '为保障您的权益,请茶艺师服务完成后在确认订单',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
cancelButtonProps: {
|
||||
customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
},
|
||||
confirmButtonProps: {
|
||||
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.action == 'confirm') {
|
||||
// TODO 确认订单接口
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -99,7 +99,6 @@ export async function handleRefundOrderHooks(id: number, orderType: number) {
|
||||
|
||||
// 退款延迟-1.5秒钟后再执行(同步等待)
|
||||
await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
console.log("🚀 ~ handleRefundOrderHooks ~ 退款延迟:")
|
||||
uni.hideLoading();
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { router } from '@/utils/tools'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { cancelTeaSpecialistOrder, deleteTeaSpecialistOrder, confirmTeaSpecialistOrder, refundTeaSpecialistOrder } from '@/api/teaSpecialist-order'
|
||||
import { cancelTeaSpecialistOrder, deleteTeaSpecialistOrder, applyTeaSpecialistRefund } from '@/api/tea-specialist'
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
@ -8,47 +8,10 @@ import { cancelTeaSpecialistOrder, deleteTeaSpecialistOrder, confirmTeaSpecialis
|
||||
*/
|
||||
export async function handleCancelOrderHooks(orderId: number) {
|
||||
try {
|
||||
const response = await cancelTeaSpecialistOrder({ id: orderId })
|
||||
uni.$emit('refreshOrderList')
|
||||
uni.$emit('refreshOrderDetail')
|
||||
await cancelTeaSpecialistOrder(orderId)
|
||||
return true
|
||||
} catch (error) {
|
||||
router.navigateBack()
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新支付
|
||||
* @param orderId 订单ID
|
||||
* @param teaSpecialistId 茶艺师ID
|
||||
* @returns
|
||||
*/
|
||||
export function handleToPayHooks(orderId: number, teaSpecialistId: number) {
|
||||
try {
|
||||
uni.$on('payment', params => {
|
||||
console.log("🚀 ~ params:", params)
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
uni.$emit('refreshOrderList')
|
||||
uni.$emit('refreshOrderDetail')
|
||||
if (params.result) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/notice/reserve?type=teaSpecialist&orderId=${params.orderId}`
|
||||
})
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/bundle/order/tea-specialist/order-list'
|
||||
})
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
router.navigateTo(`/pages/cashier/cashier?from=order&orderId=${orderId}&teaSpecialistId=${teaSpecialistId}`)
|
||||
}, 800)
|
||||
} catch (error) {
|
||||
toast.info('订单提交失败,请稍后重试')
|
||||
return
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,41 +20,23 @@ export function handleToPayHooks(orderId: number, teaSpecialistId: number) {
|
||||
*/
|
||||
export async function handleDeleteOrderHooks(orderId: number) {
|
||||
try {
|
||||
const response = await deleteTeaSpecialistOrder({ id: orderId })
|
||||
uni.$emit('refreshOrderList')
|
||||
uni.$emit('refreshOrderDetail')
|
||||
await deleteTeaSpecialistOrder(orderId)
|
||||
return true
|
||||
} catch (error) {
|
||||
router.navigateBack()
|
||||
throw error
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认(完成)订单
|
||||
*/
|
||||
export async function handleConfirmOrderHooks(orderId: number) {
|
||||
try {
|
||||
const response = await confirmTeaSpecialistOrder({ id: orderId })
|
||||
uni.$emit('refreshOrderList')
|
||||
uni.$emit('refreshOrderDetail')
|
||||
} catch (error) {
|
||||
router.navigateBack()
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单退款
|
||||
* @param orderId 订单ID
|
||||
* @param orderType 订单类型
|
||||
*/
|
||||
// export async function handleRefundOrderHooks(orderId: number, orderType: string) {
|
||||
// try {
|
||||
// const response = await refundTeaSpecialistOrder({ id: orderId, order_type: orderType })
|
||||
// uni.$emit('refreshOrderList')
|
||||
// uni.$emit('refreshOrderDetail')
|
||||
// } catch (error) {
|
||||
// router.navigateBack()
|
||||
// throw error
|
||||
// }
|
||||
// }
|
||||
export async function handleRefundTeaSpecialistOrderHooks(orderId: number, orderType: number) {
|
||||
try {
|
||||
await applyTeaSpecialistRefund(orderId, orderType)
|
||||
return true
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import App from './App.vue'
|
||||
import { requestInterceptor } from './http/interceptor'
|
||||
import { routeInterceptor } from './router/interceptor'
|
||||
import NavBar from '@/components/Navbar.vue'
|
||||
import useShare from '@/hooks/useShare'
|
||||
|
||||
import store from './store'
|
||||
import '@/style/index.scss'
|
||||
@ -11,7 +12,6 @@ import 'virtual:uno.css'
|
||||
|
||||
import { getNavBarHeight, getCapsuleOffset } from '@/utils/index'
|
||||
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
/* 注册全局组件 */
|
||||
@ -20,11 +20,15 @@ export function createApp() {
|
||||
app.use(store)
|
||||
app.use(routeInterceptor)
|
||||
app.use(requestInterceptor)
|
||||
|
||||
app.use(VueQueryPlugin)
|
||||
app.provide('OSS', 'https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/')
|
||||
app.provide('navbarHeight', getNavBarHeight())
|
||||
app.provide('capsuleOffset', getCapsuleOffset())
|
||||
|
||||
|
||||
app.mixin(useShare())
|
||||
|
||||
return {
|
||||
app,
|
||||
}
|
||||
|
||||
@ -91,7 +91,8 @@
|
||||
},
|
||||
"usingComponents": true,
|
||||
"requiredPrivateInfos": [
|
||||
"getLocation"
|
||||
"getLocation",
|
||||
"chooseLocation"
|
||||
],
|
||||
"optimization": {
|
||||
"subPackages": true
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<pay @pay="Cashier.handleGetPayValue" :hidePlatformBalance="hidePlatformBalance" :hideStoreBalance="hideStoreBalance" :hideWechat="hideWechat" :storeMoney="storeMoney"></pay>
|
||||
</view>
|
||||
|
||||
<view class="fixed bottom-70rpx left-0 right-0 text-#fff font-bold text-30rpx leading-42rpx mx-60rpx text-center rounded-8rpx w-630rpx" >
|
||||
<view class="fixed bottom-70rpx left-0 right-0 text-#fff font-bold text-30rpx leading-42rpx mx-60rpx text-center rounded-8rpx w-630rpx" >
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-90rpx !leading-90rpx !w-630rpx' :disabled="isSubmitting" @click='Cashier.handleToPay'>{{ isGroupBuying ? '立即购买' : '立即预定' }}</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
@ -50,7 +50,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { getTeaSpecialistDetails } from '@/api/tea'
|
||||
import { ITeaSpecialistDetailsFields } from '@/api/types/tea'
|
||||
import { prePay, balancePay } from '@/api/pay'
|
||||
import { prePay, balancePay, newPrePay } from '@/api/pay'
|
||||
import type {IUserInfoVo } from '@/api/types/login'
|
||||
import { getTeaRoomBalance, getTeaRoomOrderDetail, getTeaRoomPackageOrderDetail, getTeaRoomPackageDetail } from '@/api/tea-room'
|
||||
import Pay from '@/components/Pay.vue'
|
||||
@ -60,7 +60,7 @@
|
||||
import { OrderType } from '@/utils/order'
|
||||
import { wechatPay } from '@/hooks/usePay'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
import { getTeaSpecialistOrderDetails } from '@/api/teaSpecialist-order'
|
||||
|
||||
|
||||
// 用户信息
|
||||
@ -116,12 +116,17 @@
|
||||
const renew = ref<string>('')
|
||||
const renewPrice = ref<number>(0)
|
||||
|
||||
|
||||
|
||||
// 购买套餐支付
|
||||
const isGroupBuying = ref<number>(0)
|
||||
const groupCouponId = ref<number>(0)
|
||||
|
||||
// 只有在续订茶艺师下才有这个renewOrderId
|
||||
const renewOrderId = ref<number>(0)
|
||||
// 预约茶艺师支付
|
||||
const reserveTeaSpecialist = ref<boolean>(false)
|
||||
const teaSpecialistOrderAmount = ref<number>(0) // 茶艺师订单金额
|
||||
|
||||
// 防止重复提交
|
||||
const isSubmitting = ref(false)
|
||||
@ -139,7 +144,7 @@
|
||||
// 一键续订
|
||||
renew.value = args?.renew || ''
|
||||
renewPrice.value = Number(args?.renewPrice) || 0
|
||||
|
||||
|
||||
// 获取门店余额
|
||||
if (args.storeId) {
|
||||
storeId.value = Number(args.storeId)
|
||||
@ -159,8 +164,16 @@
|
||||
}
|
||||
} else if (from.value === OrderType.TeaSpecialist) {
|
||||
// 预约茶艺师
|
||||
renewOrderId.value = args.renewOrderId
|
||||
teaSpecialistOrderAmount.value = Number(args.teaSpecialistOrderAmount) || 0
|
||||
reserveTeaSpecialist.value = true
|
||||
title.value = `预约茶艺师-${args.teaSpecialistName || ''}`
|
||||
if (renewOrderId.value > 0) {
|
||||
title.value = `续订茶艺师-${args.teaSpecialistName || ''}`
|
||||
} else {
|
||||
title.value = `预订茶艺师-${args.teaSpecialistName || ''}`
|
||||
}
|
||||
|
||||
hideStoreBalance.value = true // 隐藏门店余额支付
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
@ -177,6 +190,9 @@
|
||||
} else {
|
||||
Cashier.handleGetRoomPackageDetails()
|
||||
}
|
||||
} else if (args.from == OrderType.TeaSpecialist && args.orderId) {
|
||||
// 获取预定茶艺师订单详情
|
||||
Cashier.handleGetTeaSpecialistOrderDetails()
|
||||
}
|
||||
})
|
||||
|
||||
@ -191,20 +207,22 @@
|
||||
})
|
||||
|
||||
const Cashier = {
|
||||
/**获取茶艺师详情
|
||||
|
||||
/**获取茶艺师订单详情
|
||||
*
|
||||
* @param id
|
||||
* @param user_id
|
||||
*/
|
||||
handleGetTeaSpecialistDetails: async (id: number, user_id: number) => {
|
||||
const res = await getTeaSpecialistDetails({
|
||||
id,
|
||||
latitude: uni.getStorageSync('latitude') || import.meta.env.VITE_DEFAULT_LATITUDE,
|
||||
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
|
||||
user_id
|
||||
handleGetTeaSpecialistOrderDetails: async () => {
|
||||
const res = await getTeaSpecialistOrderDetails({
|
||||
id: orderId.value
|
||||
})
|
||||
// 将返回的数据合并到 reactive 对象中
|
||||
Object.assign(info, res.teamaster || {})
|
||||
order.value = res
|
||||
if (teaSpecialistOrderAmount.value > 0) {
|
||||
money.value = teaSpecialistOrderAmount.value
|
||||
} else {
|
||||
money.value = Number(res.order_amount)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -226,11 +244,9 @@
|
||||
* @param value
|
||||
*/
|
||||
handleGetRoomPackageDetails: async () => {
|
||||
// 获取订单详情接口
|
||||
const res = await getTeaRoomPackageDetail({
|
||||
id: comboId.value
|
||||
})
|
||||
console.log("🚀 ~ res:", res)
|
||||
money.value = Number(res.details.discount_price)
|
||||
},
|
||||
|
||||
@ -240,7 +256,6 @@
|
||||
*/
|
||||
handleGetPayValue: (value: number) => {
|
||||
pay.value = value
|
||||
console.log("🚀 ~ pay.value:", pay.value)
|
||||
},
|
||||
|
||||
/**
|
||||
@ -325,6 +340,59 @@
|
||||
router.navigateBack(1, 500)
|
||||
return
|
||||
}
|
||||
} else if (from.value == OrderType.TeaSpecialist) {
|
||||
// 预支付-茶艺师订单
|
||||
uni.showLoading({ title: '支付中...' })
|
||||
try {
|
||||
// 预支付
|
||||
const res = await newPrePay({
|
||||
from: PayValueMap[pay.value],
|
||||
order_id: renewOrderId.value > 0 ? renewOrderId.value : orderId.value, //如果是续单的话,则用续单的订单ID
|
||||
pay_way: pay.value,
|
||||
order_source: PayOrderSource.MINI, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_type: renewOrderId.value > 0 ? PayOrderType.RenewTeaSpecialist : PayOrderType.TeaSpecialis, // 茶艺师订单
|
||||
})
|
||||
|
||||
// 余额支付(平台余额)
|
||||
if (pay.value == PayValue.PlatformBalance && res) {
|
||||
|
||||
uni.hideLoading()
|
||||
result.value = 'success'
|
||||
|
||||
isSubmitting.value = false
|
||||
router.navigateBack(1, 500)
|
||||
} else if (pay.value == PayValue.WeChatPay) {
|
||||
// 微信支付
|
||||
wechatPay(res.config).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res === 'success') {
|
||||
toast.success('支付成功')
|
||||
result.value = 'success'
|
||||
} else if (res === 'cancel') {
|
||||
toast.info('已取消支付')
|
||||
result.value = 'fail'
|
||||
} else {
|
||||
toast.info('支付失败,请重试')
|
||||
result.value = 'fail'
|
||||
}
|
||||
|
||||
isSubmitting.value = false
|
||||
router.navigateBack(1, 500)
|
||||
return
|
||||
}).catch((e) => {
|
||||
console.log("🚀 ~ error:", e)
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
return
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
isSubmitting.value = false
|
||||
uni.hideLoading()
|
||||
result.value = 'fail'
|
||||
router.navigateBack(1, 500)
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -10,6 +10,31 @@
|
||||
|
||||
<template>
|
||||
<view class="home-bg">
|
||||
<!-- 领取优惠券 -->
|
||||
<wd-overlay :show="showCoupon" @click="showCoupon = false">
|
||||
<view class="flex flex-col justify-center items-center h-100%">
|
||||
<view class="w-652rpx h-590rpx relative" >
|
||||
<wd-img :src="`${OSS}images/home/home_image8.png`" width="100%" height="100%"></wd-img>
|
||||
<view class="absolute top-82rpx left-1/2 transform -translate-x-1/2 flex flex-col items-center">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#E64545]">正在发送一波优惠券</view>
|
||||
<view class="font-bold text-[#313131] text-36rpx leading-50rpx mt-38rpx">你有待领取的优惠券</view>
|
||||
|
||||
<view class="mt-220rpx " @click.stop="showCoupon = false">
|
||||
<view class="h-90rpx relative">
|
||||
<wd-img :src="`${OSS}images/home/home_image9.png`" width="342rpx" height="90rpx"></wd-img>
|
||||
<view class="absolute top-20rpx left-1/2 transform -translate-x-1/2 flex flex-col items-center" @click.stop="Index.handleToGetCoupon">立即领取</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="mt-80rpx" @click.stop="showCoupon = false">
|
||||
<wd-img :src="`${OSS}icon/icon_close2.png`" width="72rpx" height="72rpx"></wd-img>
|
||||
</view>
|
||||
</view>
|
||||
</wd-overlay>
|
||||
|
||||
<view class="home-bg w-[100%] fixed top-0 left-0 z-100">
|
||||
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
|
||||
<template #left>
|
||||
@ -30,7 +55,14 @@
|
||||
|
||||
<view :style="{ paddingTop: navbarHeight + 'px' }">
|
||||
<view class="mt-32rpx mx-30rpx">
|
||||
<wd-swiper height="240rpx" indicatorPosition="bottom-left" :indicator="{ type: 'dots-bar' }" :list="swiperList" v-model:current="current" mode="aspectFit"></wd-swiper>
|
||||
<wd-swiper
|
||||
height="240rpx"
|
||||
indicatorPosition="bottom-left"
|
||||
:indicator="{ type: 'dots-bar' }"
|
||||
:list="swiperList"
|
||||
v-model:current="current"
|
||||
mode="aspectFit"
|
||||
@click="Index.handleBanner"></wd-swiper>
|
||||
</view>
|
||||
|
||||
<view class="mt-40rpx flex items-center h-36rpx mx-30rpx">
|
||||
@ -114,14 +146,14 @@
|
||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
||||
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
|
||||
import { LOCATION_DENY_TIME_KEY, handleEnsureLocationAuthHooks, LOCATION_DEFAULT_CITY, handleGetLocationCity, LOCATION_CITY_KEY, handleForceGetLocation } from '@/hooks/useLocation'
|
||||
import { getHomeBannerList } from '@/api/home'
|
||||
import { getHomeBannerList, getHomeCouponPopup } from '@/api/home'
|
||||
import { getHomeTeaStoreList } from '@/api/tea-room'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const navbarHeight = inject('navbarHeight')
|
||||
|
||||
/** 轮播图 **/
|
||||
// 轮播图
|
||||
const swiperList = ref<string[]>([])
|
||||
const current = ref<number>(0)
|
||||
|
||||
@ -143,6 +175,10 @@
|
||||
|
||||
let lastLocation = { lat: 0, lng: 0 }
|
||||
const canLocation = ref<boolean>(false)
|
||||
|
||||
// 显示优惠券弹窗
|
||||
const showCoupon = ref<boolean>(false)
|
||||
|
||||
onShow(async () => {
|
||||
// if (canLocation) {
|
||||
// const location = await handleGetLocationCity(latitude.value, longitude.value)
|
||||
@ -166,6 +202,16 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const userStore = useUserStore()
|
||||
const userId = userStore.userInfo?.id
|
||||
if (userId) {
|
||||
// 获取首页优惠券弹窗
|
||||
const res = await getHomeCouponPopup()
|
||||
if (Number(res.status) === 0) {
|
||||
showCoupon.value = true
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
onLoad(async() => {
|
||||
@ -299,6 +345,46 @@
|
||||
longitude.value = params.longitude
|
||||
Index.handleResetSearch()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转领取优惠券页面
|
||||
*/
|
||||
handleToGetCoupon: () => {
|
||||
showCoupon.value = false
|
||||
router.switchTab('/pages/my/my')
|
||||
},
|
||||
|
||||
/**
|
||||
* 轮播图跳转
|
||||
*/
|
||||
handleBanner: (e: any) => {
|
||||
switch(e.index){
|
||||
case 0:
|
||||
// 跳转到茶艺师入驻
|
||||
router.navigateTo('/bundle/settle-in/tea-specialist')
|
||||
break;
|
||||
case 1:
|
||||
// 跳转到茶馆入驻
|
||||
router.navigateTo('/bundle/settle-in/tea-room')
|
||||
break;
|
||||
case 2:
|
||||
// 跳转到茶艺师列表
|
||||
router.navigateTo('/bundle_b/pages/tea-specialist/list')
|
||||
break;
|
||||
case 3:
|
||||
// 跳转到充值会员
|
||||
router.navigateTo('/bundle/vip/benefits')
|
||||
break;
|
||||
}
|
||||
// if (e.index == 2) {
|
||||
// // 跳转到茶艺师列表
|
||||
// router.navigateTo(`/bundle_b/pages/tea-specialist/list`)
|
||||
// }
|
||||
|
||||
|
||||
console.log("🚀 ~ e:", e)
|
||||
// const index = e.currentTarget.dataset.index
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
</view>
|
||||
<!-- <view class="font-400 text-24rpx text-[#D2D0D0] leading-34rpx">请尽快领取会员权益</view> -->
|
||||
</view>
|
||||
<view class="mt-50rpx ml-24rpx">
|
||||
<!-- <view class="mt-50rpx ml-24rpx">
|
||||
<scroll-view class="w-[100%] whitespace-nowrap" :scroll-x="true" scroll-left="120">
|
||||
<view class="scroll-item mr-20rpx" v-for="(item, index) in couponList" :key="index">
|
||||
<view class="font-bold text-22rpx text-[#AF6400] leading-32rpx mt-6rpx">{{ item.type_id == 1 ? '茶艺师券' : '茶室券' }}</view>
|
||||
@ -118,7 +118,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 非会员下的状态 -->
|
||||
@ -133,6 +133,24 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券 -->
|
||||
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx px-30rpx py-20rpx flex items-center justify-between" v-if="isLogin && couponList.length > 0">
|
||||
<scroll-view class="w-[100%] whitespace-nowrap" :scroll-x="true" scroll-left="120">
|
||||
<view class="scroll-item mr-20rpx" v-for="(item, index) in couponList" :key="index">
|
||||
<view class="font-bold text-22rpx text-[#AF6400] leading-32rpx mt-6rpx">{{ item.type_id == 1 ? '茶艺师券' : '茶室券' }}</view>
|
||||
<view class="font-bold text-[#1C1C1D] leading-34rpx mt-8rpx">
|
||||
<text class="text-24rpx">¥</text>
|
||||
<text class="text-30rpx">{{ item.coupon_price }}</text>
|
||||
</view>
|
||||
<view class="font-400 text-20rpx leading-28rpx text-[#1C1C1D]">{{ item.name }}</view>
|
||||
<view class="font-400 text-20rpx w-126rpx h-40rpx rounded-20rpx mt-18rpx leading-40rpx mx-auto"
|
||||
:class="item.use == 1 ? 'bg-[#E6E3DF]' : 'bg-[#FCCA84]'" @click="My.handleClaimCoupon(item.id, item.type_id)">
|
||||
{{ item.use == 1 ? '已领取' : '立即领取' }}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 团购 -->
|
||||
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx px-56rpx py-48rpx flex items-center justify-between">
|
||||
<view class="flex items-center" @click="router.navigateTo('/bundle/order/douyin/order-list')">
|
||||
@ -174,7 +192,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 茶艺师订单 -->
|
||||
<!-- <view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx">
|
||||
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx">
|
||||
<view class="px-30rpx pt-30rpx py-24rpx">茶艺师订单</view>
|
||||
<view class="flex relative px-30rpx">
|
||||
<view v-for="(item, index) in teaReserveMenuList" :key="index">
|
||||
@ -186,7 +204,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 更多服务 -->
|
||||
<view class="bg-white rounded-16rpx mx-30rpx mt-28rpx pb-34rpx">
|
||||
@ -237,7 +255,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { TeaRoomOrderStatusText, TeaSpecialistOrderStatusText } from '@/utils/order'
|
||||
import { TeaRoomOrderStatusText } from '@/utils/order'
|
||||
import { TeaSpecialistManageOrderStatusText } from '@/utils/teaSpecialistOrder'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { router } from '@/utils/tools'
|
||||
import { useUserStore } from '@/store'
|
||||
@ -282,11 +301,11 @@
|
||||
|
||||
// 茶艺师订单
|
||||
const teaReserveMenuList = reactive([
|
||||
{ id: 1, title: '全部订单', icon: `${OSS}icon/icon_tea_all_order.png`, badge: '', status: TeaSpecialistOrderStatusText.All },
|
||||
{ id: 2, title: '待付款', icon: `${OSS}icon/icon_tea_wait_pay_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Pending },
|
||||
{ id: 3, title: '预约单', icon: `${OSS}icon/icon_tea_reserve_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Pay },
|
||||
{ id: 4, title: '待确认', icon: `${OSS}icon/icon_tea_wait_confirm_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Confirm },
|
||||
{ id: 4, title: '已完结', icon: `${OSS}icon/icon_tea_finish_order.png`, badge: '', status: TeaSpecialistOrderStatusText.Finished },
|
||||
{ id: 1, title: '全部订单', icon: `${OSS}icon/icon_tea_all_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.All },
|
||||
{ id: 2, title: '待付款', icon: `${OSS}icon/icon_tea_wait_pay_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Unpaid },
|
||||
{ id: 3, title: '预约单', icon: `${OSS}icon/icon_tea_reserve_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Reserved },
|
||||
{ id: 4, title: '服务中', icon: `${OSS}icon/icon_tea_wait_confirm_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Service },
|
||||
{ id: 5, title: '已完成', icon: `${OSS}icon/icon_tea_wait_confirm_order.png`, badge: '', status: TeaSpecialistManageOrderStatusText.Completed },
|
||||
])
|
||||
|
||||
// 更多服务
|
||||
@ -321,6 +340,8 @@
|
||||
isVip.value = true
|
||||
}
|
||||
})
|
||||
|
||||
My.handleInit()
|
||||
} else {
|
||||
Object.keys(user.value).forEach(key => {
|
||||
user.value[key] = ''
|
||||
@ -368,13 +389,17 @@
|
||||
/**
|
||||
* 领取优惠券
|
||||
*/
|
||||
handleClaimCoupon: async (id: number) => {
|
||||
handleClaimCoupon: async (id: number, type_id: number) => {
|
||||
await claimMyCoupon({id})
|
||||
toast.info('领取成功')
|
||||
My.handleInit()
|
||||
getUserInfo().then(res => {
|
||||
user.value = res
|
||||
})
|
||||
|
||||
if (type_id == 1) {
|
||||
router.navigateTo('/bundle_b/pages/tea-specialist/list')
|
||||
}
|
||||
},
|
||||
|
||||
// 跳转到个人信息
|
||||
|
||||
@ -25,6 +25,16 @@
|
||||
</template>
|
||||
</reserve-notice>
|
||||
</view>
|
||||
<view v-if="type == OrderType.TeaSpecialist">
|
||||
<reserve-notice title="茶艺师预约成功" desc="可以点击下方查看预约单具体信息">
|
||||
<template #layout>
|
||||
<view class="pb-22rpx mt-40rpx mx-30rpx flex justify-between items-center text-[32rpx] text-center">
|
||||
<view class='bg-[#F6F7F8] text-[#303133] rounded-8rpx h-90rpx leading-90rpx mr-28rpx w-300rpx' @click="reserve.handleSeeTeaSpecialistOrder">查看订单</view>
|
||||
<view class='bg-[#4C9F44] text-[#fff] rounded-8rpx h-90rpx leading-90rpx w-300rpx' @click="reserve.handleRoomDone">完成</view>
|
||||
</view>
|
||||
</template>
|
||||
</reserve-notice>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -67,6 +77,13 @@
|
||||
router.navigateTo('/bundle/order/tea-room/order-list')
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 预约茶艺师 - 查看订单
|
||||
*/
|
||||
handleSeeTeaSpecialistOrder: () => {
|
||||
router.navigateTo('/bundle/order/tea-specialist/order-list')
|
||||
},
|
||||
|
||||
/**
|
||||
* 预约茶室 - 完成
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<wd-navbar safeAreaInsetTop :bordered="false" custom-style="background-color: transparent !important;">
|
||||
<template #left>
|
||||
<view class="search-box flex items-center ml-26rpx">
|
||||
<wd-search v-model="keywords" placeholder="请输入内容" hide-cancel disabled placeholder-left
|
||||
<wd-search v-model="keywords" placeholder="请输入内容" hide-cancel placeholder-left
|
||||
@search="Reserve.handleSearch()"
|
||||
placeholderStyle="text-align:left;padding-left: 24rpx;line-heigt: 44rpx;color: #C9C9C9; font-size: 32rpx;font-weight: normal;">
|
||||
</wd-search>
|
||||
@ -26,7 +26,7 @@
|
||||
<view class="tabs">
|
||||
<wd-tabs v-model="tab" swipeable slidable="always" @change="Reserve.handleChangeTab" :lazy="false">
|
||||
<wd-tab title="茶室预约"></wd-tab>
|
||||
<!-- <wd-tab title="茶艺师预约"></wd-tab> -->
|
||||
<wd-tab title="茶艺师预约"></wd-tab>
|
||||
</wd-tabs>
|
||||
</view>
|
||||
</view>
|
||||
@ -143,6 +143,7 @@
|
||||
tab.value = item.index
|
||||
|
||||
// 切换tab时,重置当前的mescroll
|
||||
keywords.value = ''
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll();
|
||||
},
|
||||
|
||||
@ -56,7 +56,6 @@ export const PayList: PayMethod[] = [
|
||||
|
||||
// 支付订单类型
|
||||
export enum PayOrderType {
|
||||
TeaSpecialis = 0, // 茶艺师
|
||||
TeaRoom = 1, // 茶室支付
|
||||
BuyCombo = 2, // 购买套餐
|
||||
BuyVip = 3, // 购买会员
|
||||
@ -64,6 +63,8 @@ export enum PayOrderType {
|
||||
ComboRefund = 5, // 套餐退款
|
||||
TeaRoomRefund = 6, // 茶室退款
|
||||
RenewRoom = 7, // 续订包间
|
||||
TeaSpecialis = 10, // 茶艺师
|
||||
RenewTeaSpecialist = 11, // 续订茶艺师服务
|
||||
}
|
||||
|
||||
// 支付订单来源
|
||||
|
||||
@ -18,9 +18,9 @@ export const TeaSpecialistLevelValue = {
|
||||
|
||||
// 茶艺师对象结构
|
||||
export const TeaSpecialistLevels = [
|
||||
{ id: 1, value: 'gold', label: TeaSpecialistLevel.Gold, level: 1 },
|
||||
{ id: 2, value: 'senior', label: TeaSpecialistLevel.Senior, level: 2 },
|
||||
{ id: 1, value: 'gold', label: TeaSpecialistLevel.Gold, level: 5 },
|
||||
{ id: 2, value: 'senior', label: TeaSpecialistLevel.Senior, level: 4 },
|
||||
{ id: 3, value: 'intermediate', label: TeaSpecialistLevel.Intermediate, level: 3 },
|
||||
{ id: 4, value: 'junior', label: TeaSpecialistLevel.Junior, level: 4 },
|
||||
{ id: 5, value: 'enthusiast', label: TeaSpecialistLevel.Enthusiast, level: 5 }
|
||||
{ id: 4, value: 'junior', label: TeaSpecialistLevel.Junior, level: 2 },
|
||||
{ id: 5, value: 'enthusiast', label: TeaSpecialistLevel.Enthusiast, level: 1 }
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user