调试接口
This commit is contained in:
@ -24,4 +24,27 @@ export interface ITeaSpecialistPayParams {
|
||||
|
||||
export function balancePay(data: ITeaSpecialistPayParams) {
|
||||
return http.Post<any>('/api/pay/yuePay', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退款订单ID
|
||||
*/
|
||||
export interface IRefundOrderParams {
|
||||
order_id: number
|
||||
order_type: number
|
||||
}
|
||||
|
||||
export function submitRefund(data: IRefundOrderParams) {
|
||||
return http.Post<any>('/api/order/submitRefund', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
export interface IRefundParams {
|
||||
id: number
|
||||
}
|
||||
|
||||
export function refund(data: IRefundParams) {
|
||||
return http.Post<any>('/api/pay/refund', data)
|
||||
}
|
||||
@ -306,6 +306,7 @@ export interface ITeaRoomPackageOrderListParams {
|
||||
use_status: string
|
||||
operation_type: number
|
||||
search: string
|
||||
type: number // 1:本地套餐 2.抖音套餐
|
||||
}
|
||||
|
||||
export function getTeaRoomPackageOrderList(data: ITeaRoomPackageOrderListParams) {
|
||||
@ -352,15 +353,16 @@ export function calculateTeaRoomPrice(data: ICalculateTeaRoomPriceParams) {
|
||||
*/
|
||||
export interface ITeaRoomGroupCouponListParams {
|
||||
store_id: number
|
||||
room_id: number
|
||||
}
|
||||
|
||||
export function getTeaRoomGroupCouponList(data: ITeaRoomGroupCouponListParams) {
|
||||
return http.Post<{list: {}}>('/api/order/teaStoreGroupUseLists', data)
|
||||
return http.Post<any>('/api/order/teaStoreGroupUseLists', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值接口
|
||||
*/
|
||||
export function teaRoomRecharge(money: number) {
|
||||
return http.Post<{id: number}>('/api/recharge/recharge', {money})
|
||||
return http.Post<any>('/api/recharge/recharge', {money})
|
||||
}
|
||||
@ -92,6 +92,7 @@ export interface ITeaRoomPackageDetailsResult {
|
||||
img: string
|
||||
introduce: string
|
||||
introduce_details: string
|
||||
discount_price: string
|
||||
price: string
|
||||
returd_details: string
|
||||
update_dtime: string
|
||||
@ -101,18 +102,21 @@ export interface ITeaRoomPackageDetailsResult {
|
||||
sold: number
|
||||
status: number
|
||||
store_id: number
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 茶室套餐-订单详情接口返回数据
|
||||
*/
|
||||
export interface ITeaRoomPackageOrderDetailsResult {
|
||||
id: number
|
||||
pay: number
|
||||
pay_way_title: string
|
||||
order_amount: string
|
||||
order_sn: string
|
||||
order_status: number
|
||||
dtime: string
|
||||
update_dtime?: string
|
||||
pay_dtime: string
|
||||
coupon_code?: string,
|
||||
coupon_code_img?: string,
|
||||
@ -133,5 +137,11 @@ export interface ITeaRoomPackageOrderDetailsResult {
|
||||
store_id: number
|
||||
distance: string,
|
||||
operation_type: number
|
||||
},
|
||||
user_group: {
|
||||
qr_url: string
|
||||
qr_sn: string
|
||||
status: number
|
||||
id?: number
|
||||
}
|
||||
}
|
||||
@ -171,3 +171,10 @@ export function getUserMember() {
|
||||
export function getUserBillDetails(id: number) {
|
||||
return http.Post<any>('/api/user/accountDetails', {id})
|
||||
}
|
||||
|
||||
/**
|
||||
* 转让订单
|
||||
*/
|
||||
export function transferOrder(order_id: number) {
|
||||
return http.Post('/api/order/transferOrder', {order_id})
|
||||
}
|
||||
@ -18,7 +18,8 @@
|
||||
<view class="coupon-tab">
|
||||
<wd-tabs v-model="tab" swipeable slidable="always" @click="Collect.handleChangeTab" :lazy="false">
|
||||
<wd-tab title="茶室"></wd-tab>
|
||||
<wd-tab title="茶艺师"></wd-tab>
|
||||
<!-- TODO 茶艺师内容先隐藏 -->
|
||||
<!-- <wd-tab title="茶艺师"></wd-tab> -->
|
||||
</wd-tabs>
|
||||
|
||||
<view class="">
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
showChecked
|
||||
:checked="item.id === checkedId"
|
||||
:onCheck="Coupons.handleCheck"
|
||||
couponType="coupon"
|
||||
:class="index !== couponList.use.length - 1 ? 'mb-20rpx' : ''"
|
||||
></coupon>
|
||||
</wd-radio-group>
|
||||
@ -51,6 +52,7 @@
|
||||
:coupon="item"
|
||||
:canUse="false"
|
||||
showChecked
|
||||
couponType="coupon"
|
||||
:checked="item.id === checkedId"
|
||||
:onCheck="Coupons.handleCheck"
|
||||
:class="index !== couponList.no_use.length - 1 ? 'mb-20rpx' : ''"
|
||||
@ -65,7 +67,7 @@
|
||||
<view class="mx-30rpx">
|
||||
<view class="mx30rpx">
|
||||
<text class="text-[#303133] font-bold text-30rpx leading-42rpx">可用团购券</text>
|
||||
<text class="text-[#606266] font-400 text-28rpx leading-40rpx ml-24rpx">2张</text>
|
||||
<text class="text-[#606266] font-400 text-28rpx leading-40rpx ml-24rpx">{{ groupCouponList.length }}张</text>
|
||||
</view>
|
||||
<view class="mt-28rpx radio">
|
||||
<wd-radio-group v-model="checkedId" size="large" checked-color="#4C9F44">
|
||||
@ -74,6 +76,7 @@
|
||||
:key="item.id"
|
||||
:coupon="item"
|
||||
canUse
|
||||
couponType="groupCoupon"
|
||||
:checked="item.id === checkedId"
|
||||
:onCheck="Coupons.handleCheck"
|
||||
:class="index !== groupCouponList.length - 1 ? 'mb-20rpx' : ''"
|
||||
@ -128,7 +131,7 @@
|
||||
no_use: [],
|
||||
use: []
|
||||
})
|
||||
const groupCouponList = ref<any>()
|
||||
const groupCouponList = ref<Array<any>>([])
|
||||
const checkedId = ref<number>(0)
|
||||
|
||||
const unCouponList = ref([
|
||||
@ -141,6 +144,7 @@
|
||||
|
||||
onLoad((args) => {
|
||||
teaRoomId.value = args.id
|
||||
console.log("🚀 ~ teaRoomId.value:", teaRoomId.value)
|
||||
storeId.value = args.storeId || 0
|
||||
couponType.value = args.type // 1:优惠券 2:团购券
|
||||
|
||||
@ -168,7 +172,9 @@
|
||||
* 初始化团购券列表
|
||||
*/
|
||||
handleInitGroupCoupon: async (id: number, numbers: number) => {
|
||||
const res = await getTeaRoomGroupCouponList({store_id: storeId.value})
|
||||
console.log("🚀 ~ teaRoomId.value2:", teaRoomId.value)
|
||||
|
||||
const res = await getTeaRoomGroupCouponList({store_id: storeId.value, room_id: teaRoomId.value})
|
||||
groupCouponList.value = res.list
|
||||
},
|
||||
|
||||
|
||||
@ -342,6 +342,7 @@
|
||||
|
||||
// 团购套餐
|
||||
const comboOrder = ref<ITeaRoomPackageOrderDetailsResult>({
|
||||
id: 0,
|
||||
pay: 0,
|
||||
pay_way_title: '',
|
||||
order_amount: '',
|
||||
@ -366,6 +367,11 @@
|
||||
store_id: 0,
|
||||
distance: '',
|
||||
operation_type: 1
|
||||
},
|
||||
user_group: {
|
||||
qr_url: '',
|
||||
qr_sn: '',
|
||||
status: 0
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -15,26 +15,27 @@
|
||||
</view>
|
||||
|
||||
<view class="text-[#909399] text-26rpx leading-36rpx mx-102rpx mb-40rpx">
|
||||
<text v-if="orderStatus === OrderStatus.ToUse">请在2025.12.31(含)前使用</text>
|
||||
<text v-if="orderStatus === OrderStatus.Used">品一口香茗,让生活慢下来,从一杯好茶开始</text>
|
||||
<!-- TODO 暂时不做 -->
|
||||
<!-- <text v-if="orderStatus === OrderStatus.ToUse">请在2025.12.31(含)前使用</text> -->
|
||||
<text v-if="orderStatus === DouYinOrderStatus.Used">品一口香茗,让生活慢下来,从一杯好茶开始</text>
|
||||
</view>
|
||||
|
||||
<!-- 待使用下显示 -->
|
||||
<view class="mx-30rpx bg-white rounded-16rpx p-30rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="mr-30rpx">
|
||||
<wd-img width="190rpx" height="190rpx" :src="`${OSS}images/home/home_image5.png`" mode="scaleToFill"></wd-img>
|
||||
<wd-img width="190rpx" height="190rpx" :src="order.group.img" 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 w-300rpx line-1">这是团购套餐的名字</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399] mt-8rpx">¥324</view>
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-300rpx line-1">{{ order.group.title }}</view>
|
||||
<view class="text-26rpx leading-36rpx text-[#909399] mt-8rpx">¥{{ order.group.price }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-26rpx leading-36rpx text-[#909399] mt-18rpx">
|
||||
3小时
|
||||
{{ order.group.hour }}小时
|
||||
</view>
|
||||
<view class="font-400 text-26rpx text-[#606266] leading-40rpx mt-40rpx">
|
||||
适用包间:青茶、红茶、绿茶
|
||||
适用包间:{{ order.room_name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -45,24 +46,24 @@
|
||||
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx">适用门店</view>
|
||||
<view class="mt-26rpx flex items-center">
|
||||
<view class="mr-24rpx">
|
||||
<wd-img width="170rpx" height="170rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
|
||||
<wd-img width="170rpx" height="170rpx" :src="order.store.image"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1 flex justify-between items-center relative">
|
||||
<view class="">
|
||||
<view class="text-[#303133] text-30rpx leading-40rpx line-2">这是商家的名称这是</view>
|
||||
<view class="mt-26rpx text-[#909399] text-24rpx leading-34rpx">距您9km</view>
|
||||
<view class="text-[#303133] text-30rpx leading-40rpx line-2">{{ order.store.name }}</view>
|
||||
<view class="mt-26rpx text-[#909399] text-24rpx leading-34rpx">距您{{ order.store.distance }}km</view>
|
||||
<view class="flex items-center mt-14rpx">
|
||||
<view class="mr-8rpx">
|
||||
<wd-img width="28rpx" height="28rpx" :src="`${OSS}icon/icon_location.png`"/>
|
||||
</view>
|
||||
<view class="ml-2rpx text-26rpx text-[#606266] line-1 w-300rpx">青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号青浦区仓路478号</view>
|
||||
<view class="ml-2rpx text-26rpx text-[#606266] line-1 w-300rpx">{{ order.store.address }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex absolute top-1/2 right-0 -translate-y-1/2">
|
||||
<view class="text-center mr-20rpx" @click="douyinOrderDetail.handleLocation">
|
||||
<view class="text-center mr-20rpx" @click="DouYinOrderDetail.handleLocation">
|
||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_nav.png`"/>
|
||||
</view>
|
||||
<view class="text-center" @click="douyinOrderDetail.handleCallPhone">
|
||||
<view class="text-center" @click="DouYinOrderDetail.handleCallPhone">
|
||||
<wd-img width="64rpx" height="64rpx" :src="`${OSS}icon/icon_phone.png`"/>
|
||||
</view>
|
||||
</view>
|
||||
@ -76,48 +77,64 @@
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>订单编号</view>
|
||||
<view>
|
||||
<text>7327328627526903</text>
|
||||
<text>{{ order.order_sn }}</text>
|
||||
<wd-divider vertical />
|
||||
<text class="text-[#4C9F44]">复制</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">
|
||||
<view>创建时间</view>
|
||||
<view>2019-05-16 12:20:26</view>
|
||||
<view>{{ order.dtime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx" v-if="orderStatus !== OrderStatus.Used">
|
||||
<view class="mt-34rpx">
|
||||
<!-- 待使用 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === OrderStatus.ToUse">
|
||||
<view class="w-692rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">立即预定</view>
|
||||
</view>
|
||||
<view class="w-full fixed bottom-0 left-0 right-0 bg-white h-152rpx" v-if="orderStatus !== DouYinOrderStatus.Used">
|
||||
<!-- 待使用 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center pt-34rpx" >
|
||||
<view class="w-692rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">立即预定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { OrderSource, OrderStatus, OrderStatusTitle } from '@/utils/order'
|
||||
console.log("🚀 ~ OrderStatusTitle:", OrderStatusTitle)
|
||||
import {toast} from '@/utils/toast'
|
||||
import { OrderSource, OrderStatus, OrderStatusTitle, DouYinOrderStatus, DouYinOrderStatusTextValue } from '@/utils/order'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { getTeaRoomPackageOrderDetail } from '@/api/tea-room'
|
||||
import { router, copy } from '@/utils/tools'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
const title = ref<string>('')
|
||||
const type = ref<string>('') // 订单类型:团购、抖音等
|
||||
const orderStatus = ref<string>('') // 订单状态:待使用、退款等
|
||||
|
||||
// 订单
|
||||
const orderId = ref<number>(0)
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
const order = ref<any>({})
|
||||
|
||||
onLoad((args) => {
|
||||
title.value = OrderStatusTitle[OrderSource.DouYin][args.orderStatus] || '订单详情'
|
||||
|
||||
type.value = args.type
|
||||
orderStatus.value = args.orderStatus
|
||||
orderId.value = args.orderId
|
||||
DouYinOrderDetail.handleInit()
|
||||
})
|
||||
|
||||
const douyinOrderDetail = {
|
||||
const DouYinOrderDetail = {
|
||||
/**
|
||||
* 获取订单详情
|
||||
*/
|
||||
handleInit: async () => {
|
||||
const res = await getTeaRoomPackageOrderDetail({
|
||||
id: orderId.value,
|
||||
latitude: uni.getStorageSync('latitude'),
|
||||
longitude: uni.getStorageSync('longitude')
|
||||
})
|
||||
order.value = res.details
|
||||
title.value = DouYinOrderStatusTextValue[order.value.user_group.status].title || '订单详情'
|
||||
orderStatus.value = order.value.user_group.status
|
||||
},
|
||||
|
||||
// 跳转到套餐详情
|
||||
handleToCombo: () => {
|
||||
|
||||
@ -130,16 +147,20 @@
|
||||
|
||||
// 处理导航逻辑
|
||||
handleLocation: () => {
|
||||
toast.info('正在导航...')
|
||||
// 可以使用uni.navigateTo或其他方式打开地图应用
|
||||
uni.navigateTo({
|
||||
url: '/pages/map/map' // 假设有一个地图页面
|
||||
uni.openLocation({
|
||||
latitude: Number(order.value.store.latitude),
|
||||
longitude: Number(order.value.store.longitude),
|
||||
name: order.value.store.name,
|
||||
address: order.value.store.address,
|
||||
scale: 18
|
||||
})
|
||||
},
|
||||
|
||||
// 处理拨打电话逻辑
|
||||
handleCallPhone: () => {
|
||||
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: order.value.store.contact_phone
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -44,12 +44,12 @@
|
||||
</view>
|
||||
|
||||
<!-- 间隔线 -->
|
||||
<view>
|
||||
<!-- <view>
|
||||
<wd-gap bg-color="#F4F5F6" height="20rpx"></wd-gap>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 兑换记录 -->
|
||||
<view class="px-30rpx">
|
||||
<!-- <view class="px-30rpx">
|
||||
<view class="text-32rpx text-[#303133] leading-144rpx h-144rpx border-b-2rpx border-b-solid border-b-[#E5E5E5]">兑换记录</view>
|
||||
<view class="w-full">
|
||||
<view class="h-144rpx border-b-2rpx border-b-solid border-b-[#E5E5E5] flex justify-between items-center" v-for="(item, index) in 3" :key="index">
|
||||
@ -60,7 +60,7 @@
|
||||
<view class="font-bold text-36rpx text-[#303133] leading-50rpx">¥129</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<wd-message-box selector="wd-message-box-slot"></wd-message-box>
|
||||
</view>
|
||||
@ -91,13 +91,13 @@
|
||||
uni.scanCode({
|
||||
success: async (res) => {
|
||||
console.log("🚀 ~ res:", res)
|
||||
if(res.result) {
|
||||
code.value = res.result
|
||||
if(res.rawData) {
|
||||
code.value = res.rawData
|
||||
uni.showLoading({ title: '兑换中...' })
|
||||
try {
|
||||
const params = {
|
||||
store_id: storeId.value,
|
||||
code: res.result.replace(/\s+/g, ''),
|
||||
code: res.rawData.replace(/\s+/g, ''),
|
||||
type: 1
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +84,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, DouYinOrderStatusText } from '@/utils/order'
|
||||
import { OrderSource, DouYinOrderStatusText, DouYinOrderStatusValue } from '@/utils/order'
|
||||
import { getTeaRoomPackageOrderList } from '@/api/tea-room'
|
||||
|
||||
|
||||
/* mescroll */
|
||||
@ -107,47 +108,26 @@
|
||||
const tab = ref<string>('all')
|
||||
|
||||
const OrderList = {
|
||||
// 上拉加载的回调: 其中num:当前页 从1开始, size:每页数据条数,默认10
|
||||
upCallback: (mescroll) => {
|
||||
// 需要留一下数据为空的时候显示的空数据图标内容
|
||||
// list({
|
||||
// page: mescroll.num,
|
||||
// size: mescroll.size
|
||||
// }).then((res: { list: Array<any>, totalPages: Number }) => {
|
||||
// const curPageData = res.list || [] // 当前页数据
|
||||
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
|
||||
// goods.value = goods.value.concat(curPageData); //追加新数据
|
||||
|
||||
// console.log("🚀 ~ goods:", goods)
|
||||
|
||||
// mescroll.endByPage(curPageData.length, res.totalPages); //必传参数(当前页的数据个数, 总页数)
|
||||
|
||||
// }).catch(() => {
|
||||
// mescroll.endErr(); // 请求失败, 结束加载
|
||||
// })
|
||||
// apiGoods(mescroll.num, mescroll.size).then(res=>{
|
||||
// const curPageData = res.list || [] // 当前页数据
|
||||
// if(mescroll.num == 1) goods.value = []; // 第一页需手动制空列表
|
||||
// goods.value = goods.value.concat(curPageData); //追加新数据
|
||||
// //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
||||
// //mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
|
||||
|
||||
// //方法一(推荐): 后台接口有返回列表的总页数 totalPage
|
||||
// //mescroll.endByPage(curPageData.length, totalPage); //必传参数(当前页的数据个数, 总页数)
|
||||
|
||||
// //方法二(推荐): 后台接口有返回列表的总数据量 totalSize
|
||||
// //mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
|
||||
|
||||
// //方法三(推荐): 您有其他方式知道是否有下一页 hasNext
|
||||
// //mescroll.endSuccess(curPageData.length, hasNext); //必传参数(当前页的数据个数, 是否有下一页true/false)
|
||||
|
||||
// //方法四 (不推荐),会存在一个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据当前页的数据个数判断,则需翻到第三页才会知道无更多数据.
|
||||
// mescroll.endSuccess(curPageData.length); // 请求成功, 结束加载
|
||||
// }).catch(()=>{
|
||||
mescroll.endErr(); // 请求失败, 结束加载
|
||||
// })
|
||||
upCallback: (mescroll) => {
|
||||
const filter = {
|
||||
page: mescroll.num,
|
||||
size: mescroll.size,
|
||||
operation_type: currentType.value,
|
||||
use_status: orderStatus.value,
|
||||
search: keywords.value,
|
||||
type: 2 // 1:本地套餐 2.抖音套餐
|
||||
}
|
||||
getTeaRoomPackageOrderList(filter).then((res) => {
|
||||
const curPageData = res.list || [] // 当前页数据
|
||||
if(mescroll.num == 1) list.value = [] // 第一页需手动制空列表
|
||||
list.value = list.value.concat(curPageData) //追加新数据
|
||||
mescroll.endSuccess(curPageData.length, Boolean(res.more))
|
||||
}).catch(() => {
|
||||
mescroll.endErr() // 请求失败, 结束加载
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 去兑换
|
||||
handleToExcharge: () => {
|
||||
uni.navigateTo({
|
||||
@ -164,10 +144,10 @@
|
||||
// 切换tab
|
||||
handleChangeTabs: (e: {index: number, name: string}) => {
|
||||
tab.value = e.name
|
||||
if (e.name === TeaRoomOrderStatusText.Pending) {
|
||||
if (e.name === DouYinOrderStatusText.ToUse) {
|
||||
orderStatus.value = '0'
|
||||
} else {
|
||||
orderStatus.value = TeaRoomOrderStatusValue[e.name] || ''
|
||||
orderStatus.value = DouYinOrderStatusValue[e.name] || ''
|
||||
}
|
||||
|
||||
// 切换tab时,重置当前的mescroll
|
||||
|
||||
@ -9,14 +9,18 @@
|
||||
|
||||
<template>
|
||||
<view class="pb-254rpx">
|
||||
<!-- 申请退款 -->
|
||||
<wd-message-box selector="wd-message-box-slot"></wd-message-box>
|
||||
|
||||
<view>
|
||||
<navbar :title="title" custom-class='!bg-[#F6F7F8]'></navbar>
|
||||
</view>
|
||||
|
||||
<view class="text-[#909399] text-26rpx leading-36rpx mx-102rpx mb-40rpx">
|
||||
<!-- <text v-if="orderStatus === OrderStatus.ToUse">请在2025.12.31(含)前使用</text> -->
|
||||
<text v-if="orderStatus === TeaRoomPackageOrderStatus.Used">感谢购买,期待再次光临!</text>
|
||||
<view v-if="orderStatus === TeaRoomPackageOrderStatus.Refunded" class="text-center mt-14rpx">
|
||||
<!-- TODO 暂时隐藏 -->
|
||||
<!-- <text v-if="orderStatus === GroupComboOrderStatus.ToUse">请在2025.12.31(含)前使用</text> -->
|
||||
<text v-if="orderStatus === GroupComboOrderStatus.Used">感谢购买,期待再次光临!</text>
|
||||
<view v-if="orderStatus === GroupComboOrderStatus.Refunded" class="text-center mt-14rpx">
|
||||
<view class="text-40rpx text-[#303133] leading-56rpx">
|
||||
<view>退款成功{{ order.order_amount }}</view>
|
||||
</view>
|
||||
@ -27,7 +31,7 @@
|
||||
|
||||
<view class="">
|
||||
<!-- 待使用下显示 -->
|
||||
<view class="mx-30rpx" v-if="orderStatus === TeaRoomPackageOrderStatus.ToUse">
|
||||
<view class="mx-30rpx" v-if="orderStatus === GroupComboOrderStatus.ToUse">
|
||||
<view class="bg-white rounded-16rpx p-30rpx">
|
||||
<view class="flex items-center">
|
||||
<view class="mr-30rpx">
|
||||
@ -51,10 +55,11 @@
|
||||
</view>
|
||||
<!-- 平台团购直营店待使用 -->
|
||||
<view class="mt-30rpx font-500 leading-48rpx" v-if="order.store.operation_type === StoreType.Direct">
|
||||
<!-- TODO 暂时隐藏 -->
|
||||
<!-- <view class="text-26rpx text-[#606266]">有效期:2025.04.04-2025.12.31</view> -->
|
||||
<view class="text-28rpx text-[#303133] mt-18rpx">
|
||||
<text class="mr-20rpx">券码 {{ order.coupon_code }}</text>
|
||||
<text class="text-[#4C9F44]" @click="copy(order.coupon_code)">复制</text>
|
||||
<text class="mr-20rpx">券码 {{ order.user_group.qr_sn }}</text>
|
||||
<text class="text-[#4C9F44]" @click="copy(order.user_group.qr_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -62,18 +67,18 @@
|
||||
<view class="mt-30rpx font-500 leading-48rpx" v-if="order.store.operation_type === StoreType.Franchise">
|
||||
<view class="px-30rpx mt-60rpx">
|
||||
<view class="text-center">
|
||||
<wd-img width="230rpx" height="230rpx" :src="order.coupon_code_img"></wd-img>
|
||||
<wd-img width="230rpx" height="230rpx" :src="order.user_group.qr_url"></wd-img>
|
||||
</view>
|
||||
<view class="text-28rpx text-[#303133] mt-32rpx text-center">
|
||||
<text class="mr-20rpx">券码 {{ order.coupon_code }}</text>
|
||||
<text class="text-[#4C9F44]" @click="copy(order.coupon_code)">复制</text>
|
||||
<text class="mr-20rpx">券码 {{ order.user_group.qr_sn }}</text>
|
||||
<text class="text-[#4C9F44]" @click="copy(order.user_group.qr_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 已使用下显示 -->
|
||||
<view class="mx-30rpx coupon-bg" v-if="orderStatus === TeaRoomPackageOrderStatus.Used">
|
||||
<view class="mx-30rpx coupon-bg" v-if="orderStatus === GroupComboOrderStatus.Used">
|
||||
<view class="flex items-center px-30rpx pt-30rpx pb-40rpx">
|
||||
<view class="mr-30rpx">
|
||||
<wd-img width="190rpx" height="190rpx" :src="`${OSS}images/home/home_image5.png`" mode="scaleToFill"></wd-img>
|
||||
@ -133,7 +138,7 @@
|
||||
</view>
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
|
||||
<view>付款时间</view>
|
||||
<view>{{ order.pay_dtime }}</view>
|
||||
<view>{{ order.update_dtime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -142,32 +147,32 @@
|
||||
<!-- 直营店 -->
|
||||
<view class="mt-34rpx" v-if="order.store.operation_type == StoreType.Direct">
|
||||
<!-- 待使用 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === TeaRoomPackageOrderStatus.ToUse">
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === GroupComboOrderStatus.ToUse">
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleToRefund">申请退款</view>
|
||||
<view class="w-330rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleUsePackage">立即预定</view>
|
||||
</view>
|
||||
|
||||
<!-- 已使用 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === TeaRoomPackageOrderStatus.Used">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === GroupComboOrderStatus.Used">
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]" @click="OrderDetail.handleAgainResrve">再次预定</view>
|
||||
</view>
|
||||
|
||||
<!-- 已退款 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === TeaRoomPackageOrderStatus.Refunded">
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === GroupComboOrderStatus.Refunded">
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleCallPhone">联系商家</view>
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133]" @click="OrderDetail.handleCallPhone">联系平台</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 加盟店 -->
|
||||
<view class="mt-34rpx" v-if="order.store.operation_type === StoreType.Franchise && orderStatus !== TeaRoomPackageOrderStatus.Used">
|
||||
<view class="mt-34rpx" v-if="order.store.operation_type === StoreType.Franchise && orderStatus !== GroupComboOrderStatus.Used">
|
||||
<!-- 待使用 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === TeaRoomPackageOrderStatus.ToUse">
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === GroupComboOrderStatus.ToUse">
|
||||
<view class="w-660rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133]" @click="OrderDetail.handleToRefund">申请退款</view>
|
||||
</view>
|
||||
|
||||
<!-- 已退款 -->
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === TeaRoomPackageOrderStatus.Refunded">
|
||||
<view class="text-32rpx leading-44rpx flex items-center justify-center leading-90rpx text-center" v-if="orderStatus === GroupComboOrderStatus.Refunded">
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133] mr-30rpx" @click="OrderDetail.handleCallPhone">联系商家</view>
|
||||
<view class="w-330rpx h-90rpx bg-[#F6F7F8] rounded-8rpx text-[#303133]" @click="OrderDetail.handleCallPhone">联系平台</view>
|
||||
</view>
|
||||
@ -177,15 +182,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { OrderSource, OrderStatus, OrderStatusTitle, TeaRoomPackageOrderStatusTextValue, TeaRoomPackageOrderStatus } from '@/utils/order'
|
||||
import { OrderSource, OrderStatusTitle, TeaRoomPackageOrderStatus, GroupComboOrderStatus, GroupComboOrderStatusTextValue } from '@/utils/order'
|
||||
import { getTeaRoomPackageOrderDetail } from '@/api/tea-room'
|
||||
import type { ITeaRoomPackageOrderDetailsResult } from '@/api/types/tea-room'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { handleToTRStoreHooks, handleToTGComboHooks } from '@/hooks/useOrder'
|
||||
import { handleToTRStoreHooks, handleToTGComboHooks, handleRefundOrderHooks } from '@/hooks/useOrder'
|
||||
import { router, copy } from '@/utils/tools'
|
||||
import { ReserveServiceCategory } from '@/utils/order'
|
||||
import UseStore from '@/components/UseStore.vue'
|
||||
import { StoreType } from '@/utils/tea'
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { PayOrderType } from '@/utils/pay'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
|
||||
@ -196,6 +202,7 @@
|
||||
const orderId = ref<number>(0)
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
const order = ref<ITeaRoomPackageOrderDetailsResult>({
|
||||
id: 0,
|
||||
pay: 0,
|
||||
pay_way_title: '',
|
||||
order_amount: '',
|
||||
@ -222,18 +229,23 @@
|
||||
store_id: 0,
|
||||
distance: '',
|
||||
operation_type: 1
|
||||
},
|
||||
user_group: {
|
||||
qr_url: '',
|
||||
qr_sn: '',
|
||||
status: 0
|
||||
}
|
||||
})
|
||||
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
onLoad((args) => {
|
||||
title.value = OrderStatusTitle[OrderSource.Combo][args.orderStatus] || '订单详情'
|
||||
|
||||
orderId.value = args.orderId
|
||||
// 获取订单详情
|
||||
OrderDetail.handleInit()
|
||||
|
||||
type.value = args.type
|
||||
orderStatus.value = args.orderStatus
|
||||
})
|
||||
|
||||
const OrderDetail = {
|
||||
@ -247,11 +259,8 @@
|
||||
longitude: uni.getStorageSync('longitude')
|
||||
})
|
||||
order.value = res.details
|
||||
|
||||
// order.value = res.details
|
||||
// console.log("🚀 ~ order.value :", order.value )
|
||||
title.value = TeaRoomPackageOrderStatusTextValue[order.value.order_status].title || '订单详情'
|
||||
orderStatus.value = order.value.order_status
|
||||
title.value = GroupComboOrderStatusTextValue[order.value.user_group.status].title || '订单详情'
|
||||
orderStatus.value = order.value.user_group.status
|
||||
},
|
||||
|
||||
/**
|
||||
@ -284,10 +293,30 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转到申请退款页面
|
||||
* 申请退款
|
||||
*/
|
||||
handleToRefund: () => {
|
||||
router.navigateTo(`/bundle/order/after-sales/after-sales?orderId=${orderId.value}&storeId=${order.value.store.id}&comboId=${order.value.group.id}&orderType=${OrderSource.Combo}&orderStatus=${OrderStatus.AfterSaleApply}`)
|
||||
message.confirm({
|
||||
title: '是否申请退款?',
|
||||
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') {
|
||||
let res = handleRefundOrderHooks(order.value.user_group.id, PayOrderType.ComboRefund)
|
||||
if (res) {
|
||||
OrderDetail.handleInit()
|
||||
uni.$emit('refreshComboOrderList')
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
@ -303,6 +332,13 @@
|
||||
handleUsePackage: () => {
|
||||
router.navigateTo(`/bundle/tea-room/choose-room?groupCouponId=${order.value.group.id}&teaRoomId=${order.value.store.id}`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 再次预定
|
||||
*/
|
||||
handleAgainResrve: () => {
|
||||
router.navigateTo( `/bundle/tea-room/room?id=${order.value.store.id}&type=${order.value.store.operation_type}`)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -24,15 +24,13 @@
|
||||
|
||||
<view class="tabs bg-[#F6F7F9] pb-20rpx">
|
||||
<wd-tabs v-model="tab" swipeable slidable="always" @change="OrderList.handleChangeTabs" :lazy="false">
|
||||
<wd-tab title="全部" :name="TeaRoomPackageOrderStatusText.All"></wd-tab>
|
||||
<wd-tab title="待使用" :name="TeaRoomPackageOrderStatusText.ToUse"></wd-tab>
|
||||
<wd-tab title="已使用" :name="TeaRoomPackageOrderStatusText.Used"></wd-tab>
|
||||
<wd-tab title="全部" :name="GroupComboOrderStatusText.All"></wd-tab>
|
||||
<wd-tab title="待使用" :name="GroupComboOrderStatusText.ToUse"></wd-tab>
|
||||
<wd-tab title="已使用" :name="GroupComboOrderStatusText.Used"></wd-tab>
|
||||
</wd-tabs>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="content mx-30rpx mt-34rpx">
|
||||
<mescroll-body ref="mescrollItem" @init="mescrollInit" @down="downCallback" @up="OrderList.upCallback" :down="downOption" :up="upOption">
|
||||
<view class="mb-20rpx" v-for="(item, index) in list" :key="index">
|
||||
@ -50,7 +48,7 @@
|
||||
import useMescroll from "@/uni_modules/mescroll-uni/hooks/useMescroll.js"
|
||||
import { OrderSource } from '@/utils/order'
|
||||
import { getTeaRoomPackageOrderList } from '@/api/tea-room'
|
||||
import { TeaRoomPackageOrderStatusText, TeaRoomPackageOrderStatusValue } from '@/utils/order'
|
||||
import { GroupComboOrderStatusValue, GroupComboOrderStatusText } from '@/utils/order'
|
||||
|
||||
// mescroll
|
||||
const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook
|
||||
@ -82,14 +80,14 @@
|
||||
const tab = ref<string>('all')
|
||||
|
||||
onLoad(() => {
|
||||
uni.$on('refreshPackageOrderList', () => {
|
||||
uni.$on('refreshComboOrderList', () => {
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll()
|
||||
})
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
uni.$off('refreshPackageOrderList')
|
||||
uni.$off('refreshComboOrderList')
|
||||
})
|
||||
|
||||
const OrderList = {
|
||||
@ -99,7 +97,8 @@
|
||||
size: mescroll.size,
|
||||
operation_type: currentType.value,
|
||||
use_status: orderStatus.value,
|
||||
search: keywords.value
|
||||
search: keywords.value,
|
||||
type: 1 // 1:本地套餐 2.抖音套餐
|
||||
}
|
||||
getTeaRoomPackageOrderList(filter).then((res) => {
|
||||
const curPageData = res.list || [] // 当前页数据
|
||||
@ -125,10 +124,10 @@
|
||||
*/
|
||||
handleChangeTabs: (e: {index: number, name: string}) => {
|
||||
tab.value = e.name
|
||||
if (e.name === TeaRoomPackageOrderStatusText.ToUse) {
|
||||
if (e.name === GroupComboOrderStatusText.ToUse) {
|
||||
orderStatus.value = '0'
|
||||
} else {
|
||||
orderStatus.value = TeaRoomPackageOrderStatusValue[e.name] || ''
|
||||
orderStatus.value = GroupComboOrderStatusValue[e.name] || ''
|
||||
}
|
||||
|
||||
// 切换tab时,重置当前的mescroll
|
||||
|
||||
@ -271,6 +271,8 @@
|
||||
<view class="w-630rpx h-90rpx bg-[#4C9F44] rounded-8rpx text-[#fff]">再次预定</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -285,12 +287,19 @@
|
||||
import { ReserveServiceCategory, OrderType } from '@/utils/order'
|
||||
import type { ITeaSpecialistFuture7DaysResult } from '@/api/types/tea'
|
||||
import { getNext7Days, renewTeaRoomOrder } from '@/api/tea-room'
|
||||
import { transferOrder } from '@/api/user'
|
||||
import { toTimes, copy } from '@/utils/tools'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
|
||||
const OSS = inject('OSS')
|
||||
const title = ref<string>('')
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
|
||||
// 消息弹窗
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
|
||||
// 续订包间
|
||||
const showRenewPopup = ref<boolean>(false)
|
||||
const timeList = [
|
||||
@ -333,9 +342,6 @@
|
||||
// 订单倒计时取消
|
||||
const time = ref<number>(30 * 60 * 60 * 1000)
|
||||
|
||||
// 取消订单弹窗
|
||||
const message = useMessage('wd-message-box-slot')
|
||||
|
||||
// 费用明细
|
||||
const showCostPopup = ref<boolean>(false) // 是否显示退款详情弹出框
|
||||
|
||||
@ -392,11 +398,30 @@
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const currentDate = `${year}-${month}-${day}`;
|
||||
|
||||
onLoad(async (args) => {
|
||||
orderId.value = args.orderId
|
||||
// 获取订单详情
|
||||
OrderDetail.handleInit()
|
||||
// 页面分享来源
|
||||
const shareSource = ref<string>('')
|
||||
|
||||
onLoad((args) => {
|
||||
shareSource.value = args.shareSource || ''
|
||||
if (args.orderId) {
|
||||
orderId.value = args.orderId
|
||||
// 获取订单详情
|
||||
OrderDetail.handleInit()
|
||||
}
|
||||
|
||||
const token = uni.getStorageSync('token')
|
||||
|
||||
if (token && shareSource.value === 'TransferOrder') {
|
||||
// 处理转让订单
|
||||
OrderDetail.handleTransferOrder()
|
||||
}
|
||||
|
||||
// 如果是从分享进入的未登录的情况下(TransferOrder),需要转让订单
|
||||
uni.$on('transferOrder', () => {
|
||||
// 处理未登录的情况下
|
||||
uni.$off('transferOrder')
|
||||
OrderDetail.handleTransferOrder()
|
||||
})
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
@ -407,7 +432,8 @@
|
||||
if (e.from === 'button') {
|
||||
return {
|
||||
title: `我在${order.value.store_msg.name}预定了${order.value.room_msg.title},一起来吧!`,
|
||||
path: `/pages/share/tea-room/share-order-detail?orderId=${orderId.value}`,
|
||||
// path: `/pages/share/tea-room/share-order-detail?orderId=${orderId.value}&shareSource=TransferOrder`,
|
||||
path: `/bundle/order/tea-room/order-detail?orderId=${orderId.value}&shareSource=TransferOrder`,
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -564,8 +590,40 @@
|
||||
handleChooseRenewTime: (item) => {
|
||||
console.log("🚀 ~ item:", item)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 转让订单
|
||||
*/
|
||||
handleTransferOrder: async () => {
|
||||
console.log('开始转让订单2')
|
||||
|
||||
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') {
|
||||
console.log('开始转让订单3')
|
||||
|
||||
transferOrder(orderId.value).then(res => {
|
||||
console.log('开始转让订单4', res)
|
||||
|
||||
toast.success('订单接收成功')
|
||||
router.redirectTo('/bundle/order/tea-room/order-list', 500)
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -509,7 +509,7 @@
|
||||
uni.$off('refreshOrderDetail')
|
||||
})
|
||||
|
||||
handleRefundOrderHooks(orderId.value, 'order')
|
||||
// handleRefundOrderHooks(orderId.value, 'order')
|
||||
|
||||
},
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 昵称 -->
|
||||
<view class="flex justify-between items-center mb-54rpx" @click="showEditNicknamePopup = true">
|
||||
<view class="flex justify-between items-center" @click="showEditNicknamePopup = true">
|
||||
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">昵称</view>
|
||||
<view class="flex justify-end">
|
||||
<view class="flex items-center">
|
||||
@ -100,8 +100,8 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 修改手机号 -->
|
||||
<view class="flex justify-between items-center" @click="Profile.handleToEditMobile">
|
||||
<!-- TODO 暂时隐藏-修改手机号 -->
|
||||
<!-- <view class="flex justify-between items-center" @click="Profile.handleToEditMobile">
|
||||
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">修改手机号</view>
|
||||
<view class="flex justify-end">
|
||||
<view class="flex items-center">
|
||||
@ -113,7 +113,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view class="bg-white rounded-16rpx mt-144rpx mx-30rpx px-30rpx py-32rpx text-center font-400 text-[#303133] text-30rpx leading-42rpx" @click="showLogoutPopup = true">
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
import { getNavBarHeight } from '@/utils/index'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { router } from '@/utils/tools'
|
||||
// import { wxpay } from '@/hooks/usePay'
|
||||
// import { wechatPay } from '@/hooks/usePay'
|
||||
import { teaRoomRecharge } from '@/api/tea-room'
|
||||
|
||||
let navbarHeight = ref<number>(0)
|
||||
|
||||
@ -92,6 +92,7 @@
|
||||
const groupCouponOrderId = ref<number>(0)
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
const order = ref<ITeaRoomPackageOrderDetailsResult>({
|
||||
id: 0,
|
||||
pay: 0,
|
||||
pay_way_title: '',
|
||||
order_amount: '',
|
||||
@ -116,6 +117,11 @@
|
||||
store_id: 0,
|
||||
distance: '',
|
||||
operation_type: 1
|
||||
},
|
||||
user_group: {
|
||||
qr_url: '',
|
||||
qr_sn: '',
|
||||
status: 0
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}</route>
|
||||
|
||||
<template>
|
||||
<view class="pb-180rpx">
|
||||
<!-- 费用明细 -->
|
||||
@ -77,8 +78,8 @@
|
||||
<template v-for="(label, labelIndex) in teaRoom.label" :key="labelIndex">
|
||||
<view class="mr-20rpx flex items-start">
|
||||
<wd-tag
|
||||
:color="randomLabelColor(labelIndex)"
|
||||
:bg-color="randomLabelColor(labelIndex)"
|
||||
:color="randomLabelColor(Number(labelIndex))"
|
||||
:bg-color="randomLabelColor(Number(labelIndex))"
|
||||
plain
|
||||
custom-class="!rounded-4rpx"
|
||||
>{{ label.label_name }}</wd-tag>
|
||||
@ -269,7 +270,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="mr-30rpx">
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' @click='Detail.handleSubmitOrder'>{{ isGroupBuying ? '立即购买' : '立即预定' }}</wd-button>
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' :disabled="isSubmitting" @click='Detail.handleSubmitOrder'>{{ isGroupBuying ? '立即购买' : '立即预定' }}</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -387,6 +388,9 @@
|
||||
})
|
||||
})
|
||||
|
||||
// 防止重复提交
|
||||
const isSubmitting = ref(false)
|
||||
|
||||
const Detail = {
|
||||
/**
|
||||
* 初始包间详情
|
||||
@ -414,7 +418,6 @@
|
||||
Object.assign(sevenDay, {minimum_time: teaRoom.value.room.hours})
|
||||
}
|
||||
|
||||
|
||||
// 获取门店余额
|
||||
const balance = await getTeaRoomBalance({ store_id: storeId.value })
|
||||
storeMoney.value = balance.data.money || 0
|
||||
@ -473,7 +476,7 @@
|
||||
selectedCoupon.value = {id: params.coupon.user_coupon_id, name: `${params.coupon.name}减${params.coupon.coupon_price}` }
|
||||
bill.value.coupon = params.coupon.coupon_price
|
||||
} else {
|
||||
selectedGroupCoupon.value = {id: params.coupon.id, name: `团购券-${params.coupon.tea_store_group.title}` }
|
||||
selectedGroupCoupon.value = {id: params.coupon.group_id, name: `团购券-${params.coupon?.title}` }
|
||||
bill.value.groupCoupon = params.coupon.coupon_price
|
||||
}
|
||||
|
||||
@ -489,13 +492,14 @@
|
||||
* 提交订单
|
||||
*/
|
||||
handleSubmitOrder: async () => {
|
||||
|
||||
if (isSubmitting.value) return
|
||||
// 只有预定茶室才会选择时间
|
||||
if (!isGroupBuying.value && bill.value.service.num == 0) {
|
||||
toast.info('请选择预定时间')
|
||||
return
|
||||
}
|
||||
|
||||
isSubmitting.value = true
|
||||
uni.showLoading({
|
||||
title: '提交中...'
|
||||
})
|
||||
@ -503,6 +507,7 @@
|
||||
try {
|
||||
let res: any = null
|
||||
if (isGroupBuying.value) {
|
||||
// 团购套餐ID
|
||||
res = await createTeaRoomPackageOrder({
|
||||
group_id: id.value,
|
||||
room_id: 0
|
||||
@ -528,6 +533,7 @@
|
||||
uni.$on('payment', params => {
|
||||
setTimeout(() => {
|
||||
uni.$off("payment")
|
||||
isSubmitting.value = false
|
||||
if (params.result) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/notice/reserve?type=${OrderType.TeaRoomOrder}&orderId=${params.orderId}&isGroupBuying=${isGroupBuying.value ? 1 : 0}`
|
||||
@ -546,14 +552,16 @@
|
||||
const name = isGroupBuying.value ? teaRoomPackage.value.title : teaRoom.value.name
|
||||
|
||||
router.navigateTo(
|
||||
`/pages/cashier/cashier?from=${OrderType.TeaRoomOrder}&orderId=${res.id}&name=${name}&storeId=${storeId.value}&isGroupBuying=${isGroupBuying.value ? 1 : 0}`
|
||||
`/pages/cashier/cashier?from=${OrderType.TeaRoomOrder}&orderId=${res.id}&name=${name}&storeId=${storeId.value}&isGroupBuying=${isGroupBuying.value ? 1 : 0}&cmoboId=${id.value || 0}`
|
||||
)
|
||||
}, 800)
|
||||
}, 500)
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
isSubmitting.value = false
|
||||
toast.info('订单提交失败,请稍后重试')
|
||||
return
|
||||
}
|
||||
// 正常流程下,isSubmitting.value 会在支付回调中重置
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page -->
|
||||
<route lang="jsonc" type="page">{
|
||||
"needLogin": true,
|
||||
"layout": "tabbar",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
@ -45,6 +46,7 @@
|
||||
<view class="text-26rpx mt-18rpx leading-48rpx text-[#606266]">营业时间:{{ teaRoom.day_time }} {{ teaRoom.start_time }}-{{ teaRoom.end_time }}</view>
|
||||
</view>
|
||||
<view class="flex flex-col items-end">
|
||||
<!-- TODO 后续改为门店充值 -->
|
||||
<view @click="Room.handleToRecharge">
|
||||
<recharge-btn name="充值"></recharge-btn>
|
||||
</view>
|
||||
@ -176,14 +178,7 @@
|
||||
// 随机颜色列表
|
||||
const tagColors = ['#40AE36', '#F55726']
|
||||
|
||||
onShow(() => {
|
||||
// 刷新茶室详情
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll()
|
||||
})
|
||||
|
||||
onLoad((args) => {
|
||||
console.log("🚀 ~ args:", uni.getStorageSync('latitude'), uni.getStorageSync('longitude'))
|
||||
if (args.id) {
|
||||
teaRoomId.value = Number(args.id)
|
||||
storeType.value = Number(args.type) || StoreType.Direct
|
||||
@ -194,8 +189,18 @@
|
||||
|
||||
Room.handleInit()
|
||||
}
|
||||
|
||||
uni.$on('refreshTeaRoomDetail', () => {
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll()
|
||||
})
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
console.log("🚀 ~ 卸载refreshTeaRoomDetail事件:")
|
||||
uni.$off('refreshTeaRoomDetail')
|
||||
})
|
||||
|
||||
const Room = {
|
||||
sheetMenuType: '', // 记录菜单类型
|
||||
|
||||
@ -366,7 +371,8 @@
|
||||
* 跳转到门店充值页面
|
||||
*/
|
||||
handleToRecharge: () => {
|
||||
router.navigateTo(`/bundle/store-recharge/store-recharge?id=${teaRoom.value.id}&storeName=${teaRoom.value.name}`)
|
||||
// router.navigateTo(`/bundle/store-recharge/store-recharge?id=${teaRoom.value.id}&storeName=${teaRoom.value.name}`)
|
||||
router.navigateTo('/bundle/wallet/recharge')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -108,9 +108,9 @@
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PayList, PayCategory, PayValue } from '@/utils/pay'
|
||||
import { PayList, PayCategory, PayValue, PayOrderType, PayOrderSource } from '@/utils/pay'
|
||||
import { wechatPay } from '@/hooks/usePay'
|
||||
import { prePay, balancePay } from '@/api/pay'
|
||||
import { prePay } from '@/api/pay'
|
||||
import { toast } from '@/utils/toast'
|
||||
|
||||
const pay = ref<number>(PayValue.WeChatPay) // 默认微信支付方式
|
||||
@ -127,9 +127,9 @@
|
||||
|
||||
onLoad(() => {
|
||||
// 模拟获取用户身份
|
||||
setTimeout(() => {
|
||||
currentVipType.value = 'partner'
|
||||
}, 1000)
|
||||
// setTimeout(() => {
|
||||
// currentVipType.value = 'partner'
|
||||
// }, 1000)
|
||||
})
|
||||
|
||||
const buy = {
|
||||
@ -147,8 +147,8 @@
|
||||
from: 'wx',
|
||||
order_id: 0,
|
||||
pay_way: 2,
|
||||
order_source: 1, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_type: 3 // 0为茶艺师 1为茶室包间 2为茶室套餐
|
||||
order_source: PayOrderSource.MINI, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_type: PayOrderType.BuyVip // 0为茶艺师 1为茶室包间 2为茶室套餐
|
||||
})
|
||||
|
||||
wechatPay(pay.pay.config).then((res) => {
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
<view class="mt-26rpx mb-20rpx border-b-2rpx border-b-dashed border-[#E5E5E5] mx-18rpx"></view>
|
||||
|
||||
<view class="text-28rpx leading-40rpx text-[#606266] mx-28rpx">
|
||||
<!-- TODO 内容先隐藏 -->
|
||||
<!-- <view class="flex justify-between items-center mb-16rpx">
|
||||
<view>茶艺师</view>
|
||||
<view>茶艺师的昵称</view>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
<template>
|
||||
<view class="mt-26rpx mx-30rpx">
|
||||
<bill-notice :type="type" :money="10.00" :time="bill.create_time" :order="bill.source_sn"></bill-notice>
|
||||
<bill-notice :type="type" :money="bill.amount" :time="bill.create_time" :order="bill.source_sn"></bill-notice>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
const id = ref<number>(0)
|
||||
const bill = ref({
|
||||
id: 0,
|
||||
amount: 0,
|
||||
change_type: 0,
|
||||
create_time: '',
|
||||
source_sn: ''
|
||||
|
||||
@ -34,14 +34,14 @@
|
||||
<view class="flex items-center">
|
||||
<view class="font-400 text-36rpx leading-50rpx text-[#303133] mr-20rpx mt-40rpx">¥</view>
|
||||
<view class="mt-44rpx">
|
||||
<wd-input type="text" v-model="person" placeholder="请输入金额" no-border custom-input-class="!h-80rpx !text-48rpx !leading-66rpx" >
|
||||
<wd-input type="text" v-model="rechargeMoney" placeholder="请输入金额" no-border custom-input-class="!h-80rpx !text-48rpx !leading-66rpx" >
|
||||
</wd-input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推广方式 -->
|
||||
<view class="mt-60rpx">
|
||||
<!-- <view class="mt-60rpx">
|
||||
<view class="mx-30rpx text-32rpx leading-44rpx text-[#303133]">
|
||||
<text class="mr-12rpx">推广方式</text>
|
||||
<text class="text-26rpx leading-36rpx text-[#909399]">(选填)</text>
|
||||
@ -74,9 +74,9 @@
|
||||
</wd-tab>
|
||||
</wd-tabs>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="fixed left-0 right-0 bottom-92rpx z-2 bg-[#4C9F44] text-[#fff] flex justify-center items-center h-90rpx rounded-8rpx mx-60rpx" @click="buy.handleConfirmRecharge">
|
||||
<view class="fixed left-0 right-0 bottom-92rpx z-2 bg-[#4C9F44] text-[#fff] flex justify-center items-center h-90rpx rounded-8rpx mx-60rpx" @click="buy.handleRecharge">
|
||||
确定转入
|
||||
</view>
|
||||
</view>
|
||||
@ -114,13 +114,20 @@
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
const OSS = inject('OSS')
|
||||
import { PayList, PayCategory, PayValue, PayOrderType, PayOrderSource } from '@/utils/pay'
|
||||
import { teaRoomRecharge } from '@/api/tea-room'
|
||||
import { wechatPay } from '@/hooks/usePay'
|
||||
import { prePay, balancePay } from '@/api/pay'
|
||||
import { toast } from '@/utils/toast'
|
||||
|
||||
const pay = ref<number>(PayValue.WeChatPay) // 默认微信支付方式
|
||||
const OSS = inject('OSS')
|
||||
|
||||
// 推广方式
|
||||
const tab = ref<number>(0)
|
||||
const person = ref<string>('') // 个人推广码
|
||||
const showStorePopup = ref<boolean>(false) // 显示门店列表弹窗
|
||||
const rechargeMoney = ref<string>('')
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
@ -137,6 +144,52 @@
|
||||
uni.navigateTo({
|
||||
url: '/pages/notice/pay?type=vip'
|
||||
})
|
||||
},
|
||||
|
||||
// 购买会员
|
||||
handleRecharge: async () => {
|
||||
if (!rechargeMoney.value) {
|
||||
toast.info('请输入转入金额')
|
||||
return
|
||||
}
|
||||
|
||||
uni.showLoading({ title: '支付中...' })
|
||||
try {
|
||||
// 先请求充值接口
|
||||
const res = await teaRoomRecharge(Number(rechargeMoney.value))
|
||||
|
||||
// 预支付
|
||||
const pay = await prePay({
|
||||
from: 'recharge',
|
||||
order_id: res.order_id,
|
||||
pay_way: 2,
|
||||
order_source: PayOrderSource.MINI, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_type: PayOrderType.Recharge
|
||||
})
|
||||
|
||||
wechatPay(pay.pay.config).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res === 'success') {
|
||||
toast.success('支付成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 800)
|
||||
return
|
||||
} else if (res === 'cancel') {
|
||||
toast.info('已取消支付')
|
||||
return
|
||||
} else {
|
||||
toast.info('支付失败,请重试')
|
||||
return
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
})
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -105,12 +105,19 @@ import { router } from '@/utils/tools'
|
||||
}
|
||||
const list = ref<Array<any>>([]) // 茶室列表
|
||||
const userMoney = ref<number>(0) // 用户余额
|
||||
const canReset = ref<boolean>(false) // 避免onShow重复加载
|
||||
|
||||
// 日期过滤
|
||||
const value = ref<number>(Date.now())
|
||||
const selectTime = ref<string>('')
|
||||
|
||||
onShow(() => {
|
||||
if (canReset.value) {
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll();
|
||||
}
|
||||
canReset.value = true
|
||||
|
||||
getUserInfo().then(res => {
|
||||
userMoney.value = Number(res.user_money)
|
||||
})
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<view class="booking-time">
|
||||
<wd-tabs v-model="selectedDay" color="#4C9F44" @click="BookingTime.handleChangeTimeTab">
|
||||
<scroll-view scroll-y class="!h-500rpx pb-100rpx">
|
||||
<block v-for="item in day.time" :key="item">
|
||||
<block v-for="(item, index) in day.time" :key="index">
|
||||
<wd-tab :title="`${item.display}`" :name="item.display">
|
||||
<view class="">
|
||||
<view class=" mt-30rpx">
|
||||
|
||||
@ -1,22 +1,45 @@
|
||||
<template>
|
||||
<view class="p-30rpx rounded-16rpx mb-20rpx bg-white" @click="onCheck(coupon.id)">
|
||||
<view class="flex justify-between items-start relative ">
|
||||
<view class="w-180rpx h-180rpx">
|
||||
<wd-img width="100%" height="100%" :src="coupon.tea_store_group.img"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1 ml-32rpx line-1" :class="canUse ? '' : 'opacity-40'">
|
||||
<view class="text-32rpx text-[#303133] leading-44rpx line-1 w-350rpx">{{ coupon.tea_store_group.title }}</view>
|
||||
<view class="text-26rpx text-[#6A6363] leading-36rpx mt-30rpx flex">
|
||||
<view class="line-1">{{ coupon.store_msg.name }}</view>
|
||||
<view class="mx-14rpx">|</view>
|
||||
<view>{{ coupon.tea_store_group.hour }}小时</view>
|
||||
<template v-if="couponType == 'coupon'">
|
||||
<view class="flex justify-between items-start relative ">
|
||||
<view class="w-180rpx h-180rpx">
|
||||
<wd-img width="100%" height="100%" :src="coupon.tea_store_group.img"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1 ml-32rpx line-1" :class="canUse ? '' : 'opacity-40'">
|
||||
<view class="text-32rpx text-[#303133] leading-44rpx line-1 w-350rpx">{{ coupon.tea_store_group.title }}</view>
|
||||
<view class="text-26rpx text-[#6A6363] leading-36rpx mt-30rpx flex">
|
||||
<view class="line-1">{{ coupon.store_msg.name }}</view>
|
||||
<view class="mx-14rpx">|</view>
|
||||
<view>{{ coupon.tea_store_group.hour }}小时</view>
|
||||
</view>
|
||||
<!-- <view class="text-24rpx leading-34rpx text-[#909399] mt-16rpx">有效期:2025-01-01至2025-05-05</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<wd-radio :value="coupon.id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
</view>
|
||||
<!-- <view class="text-24rpx leading-34rpx text-[#909399] mt-16rpx">有效期:2025-01-01至2025-05-05</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<wd-radio :value="coupon.id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
</template>
|
||||
|
||||
<template v-if="couponType == 'groupCoupon'">
|
||||
<view class="flex justify-between items-start relative ">
|
||||
<view class="w-180rpx h-180rpx">
|
||||
<wd-img width="100%" height="100%" :src="coupon?.img" radius="16rpx"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1 ml-32rpx line-1" :class="canUse ? '' : 'opacity-40'">
|
||||
<view class="text-32rpx text-[#303133] leading-44rpx line-1 w-350rpx">{{ coupon?.title }}</view>
|
||||
<view class="text-26rpx text-[#6A6363] leading-36rpx mt-30rpx flex">
|
||||
<view class="line-1 w-150rpx">{{ coupon.store_msg.name }}</view>
|
||||
<view class="mx-14rpx">|</view>
|
||||
<view>{{ coupon?.hour }}小时</view>
|
||||
</view>
|
||||
<!-- TODO暂时隐藏 -->
|
||||
<!-- <view class="text-24rpx leading-34rpx text-[#909399] mt-16rpx">有效期:2025-01-01至2025-05-05</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<wd-radio :value="coupon.id" shape="dot" :disabled="!canUse"></wd-radio>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -41,10 +64,14 @@
|
||||
}
|
||||
store_msg: {
|
||||
name: string
|
||||
}
|
||||
},
|
||||
img?: string //兼容团购优惠券-图片
|
||||
title?: string //兼容团购优惠券-团购券标题
|
||||
hour?: number //兼容团购优惠券-使用时长
|
||||
}
|
||||
canUse: boolean
|
||||
checked: boolean
|
||||
couponType: string
|
||||
onCheck: (id: number) => void
|
||||
}>()
|
||||
</script>
|
||||
|
||||
@ -8,20 +8,20 @@
|
||||
<wd-img width="40rpx" height="40rpx" :src="`${OSS}icon/icon_tea_room.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex items-center w-400rpx" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1">{{ order.store_name }}</view>
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1">{{ order.name }}</view>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="font-400 text-28rpx leading-40rpx">
|
||||
<text class="text-[#4C9F44]" v-if="order.order_status === TeaRoomPackageOrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="order.order_status === TeaRoomPackageOrderStatus.Used">已使用</text>
|
||||
<text class="text-[#C9C9C9]" v-if="order.order_status === TeaRoomPackageOrderStatus.Refunded">已退款</text>
|
||||
<text class="text-[#4C9F44]" v-if="order.status === GroupComboOrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="order.status === GroupComboOrderStatus.Used">已使用</text>
|
||||
<text class="text-[#C9C9C9]" v-if="order.status === GroupComboOrderStatus.Refunded">已退款</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-22rpx">
|
||||
<view class="flex">
|
||||
<view class="mr-28rpx">
|
||||
<wd-img width="200rpx" height="200rpx" :src="order.img"></wd-img>
|
||||
<wd-img width="200rpx" height="200rpx" :src="order.image"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view @click="ComboCard.handleToOrderDetail">
|
||||
@ -30,14 +30,15 @@
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">{{ order.hour }}小时</wd-tag>
|
||||
</view>
|
||||
<view class="font-400 leading-36rpx text-26rpx text-[#606266]">
|
||||
<view class="mt-12rpx" v-if="order.operation_type === StoreType.Direct">{{ order.introduce }}</view>
|
||||
<view class="mt-12rpx" v-if="order.operation_type === StoreType.Direct">适用包间 {{ order.room_title }}</view>
|
||||
<!-- TODO 字段先隐藏 -->
|
||||
<!-- <view class="mt-10rpx">有效期至2025-03-23</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end" v-if="order.order_status === TeaRoomPackageOrderStatus.ToUse">
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end" v-if="order.status === GroupComboOrderStatus.ToUse">
|
||||
<view
|
||||
@click="ComboCard.handleOrderRefund(OrderSource.Combo)"
|
||||
@click="ComboCard.handleOrderRefund(order, OrderSource.Combo)"
|
||||
class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#9CA3AF] text-[#303133]"
|
||||
:class="order.operation_type === StoreType.Direct ? ' mr-28rpx' : ''">
|
||||
申请退款
|
||||
@ -61,32 +62,31 @@
|
||||
<view class="mr-10rpx flex items-center">
|
||||
<wd-img width="40rpx" height="40rpx" :src="`${OSS}icon/icon_tea_room.png`"></wd-img>
|
||||
</view>
|
||||
<view class="flex items-center" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx w-400rpx line-1">这是茶馆的名称这是茶馆的名称这是茶馆的名称</view>
|
||||
<view class="flex items-center w-400rpx" @click="ComboCard.handleToStore">
|
||||
<view class="font-bold text-30rpx leading-42rpx text-[#303133] mr-10rpx line-1">{{ order.name }}</view>
|
||||
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="font-400 text-28rpx leading-40rpx mt-12rpx">
|
||||
<text class="text-[#4C9F44]" v-if="orderStatus === OrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="orderStatus === OrderStatus.Used">已使用</text>
|
||||
<text class="text-[#C9C9C9]" v-if="orderStatus === OrderStatus.Refunded">已退款</text>
|
||||
<text class="text-[#4C9F44]" v-if="order.status === DouYinOrderStatus.ToUse">待使用</text>
|
||||
<text class="text-[#606266]" v-if="order.status === DouYinOrderStatus.Used">已使用</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-22rpx">
|
||||
<view class="flex">
|
||||
<view class="mr-28rpx">
|
||||
<wd-img width="200rpx" height="200rpx" :src="`${OSS}images/home/home_image5.png`"></wd-img>
|
||||
<wd-img width="200rpx" height="200rpx" :src="order.image"></wd-img>
|
||||
</view>
|
||||
<view class="flex-1">
|
||||
<view @click="ComboCard.handleToOrderDetail">
|
||||
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字这是套餐的名字</view>
|
||||
<view class="font-500 text-30rpx text-[#303133] leading-42rpx line-1 w-400rpx">{{ order.title }}</view>
|
||||
<view>
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">3小时</wd-tag>
|
||||
<wd-tag bg-color="#F3F3F3" color="#606266" custom-class="!px-16rpx">{{ order.hour }}小时</wd-tag>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="text-center flex items-center text-28rpx mt-28rpx justify-end">
|
||||
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44]" v-if="type === OrderSource.DouYin">立即预定</view>
|
||||
<view class="w-178rpx h-70rpx leading-70rpx rounded-8rpx border-[2rpx] border-[#4C9F44] text-[#4C9F44]" v-if="order.status === DouYinOrderStatus.ToUse">立即预定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -219,12 +219,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ComboCard">
|
||||
import { OrderSource, OrderStatus, TeaRoomOrderStatus, TeaRoomPackageOrderStatus } from '@/utils/order'
|
||||
import { OrderSource, OrderStatus, TeaRoomOrderStatus, GroupComboOrderStatus, DouYinOrderStatus } from '@/utils/order'
|
||||
import { useMessage } from 'wot-design-uni'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { handleTRCancelOrderHooks, handleTRDeleteOrderHooks, handleTRToPayHooks, handleToTRStoreHooks, handleTGOrderRefundHooks } from '@/hooks/useOrder'
|
||||
import { handleTRCancelOrderHooks, handleTRDeleteOrderHooks, handleTRToPayHooks, handleToTRStoreHooks, handleRefundOrderHooks } from '@/hooks/useOrder'
|
||||
import { StoreType } from '@/utils/tea'
|
||||
import { router } from '@/utils/tools'
|
||||
import { PayOrderType } from '@/utils/pay'
|
||||
|
||||
/**
|
||||
* ComboCard 套餐卡片组件
|
||||
@ -270,14 +271,46 @@
|
||||
/**
|
||||
* 申请退款
|
||||
*/
|
||||
handleOrderRefund: (source: string) => {
|
||||
switch (source) {
|
||||
case OrderSource.Combo:
|
||||
router.navigateTo(`/bundle/order/after-sales/after-sales?orderId=${props.order.id}&storeId=${props.order.store_id}&comboId=${props.order.group_id}&orderType=${OrderSource.Combo}&orderStatus=${OrderStatus.AfterSaleApply}`)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
handleOrderRefund: (order: any, source: string) => {
|
||||
message.confirm({
|
||||
title: '是否申请退款?',
|
||||
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') {
|
||||
let orderType: number = 0
|
||||
switch (source) {
|
||||
case OrderSource.Combo:
|
||||
orderType = PayOrderType.ComboRefund
|
||||
let res = handleRefundOrderHooks(order.id, orderType)
|
||||
if (res) {
|
||||
uni.$emit('refreshComboOrderList')
|
||||
}
|
||||
// TODO 这里调用删除直营订单的接口
|
||||
break;
|
||||
case OrderSource.DouYin:
|
||||
// TODO 这里调用删除抖音订单的接口
|
||||
break;
|
||||
case OrderSource.TeaRoom:
|
||||
// 这里调用删除茶室订单的接口
|
||||
handleTRDeleteOrderHooks(props.order.id)
|
||||
break;
|
||||
case OrderSource.TeaSpecialist:
|
||||
// TODO 这里调用删除茶室订单的接口
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
// 点击取消按钮回调事件
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
@ -371,7 +404,7 @@
|
||||
handleToOrderDetail: () => {
|
||||
switch (props.type) {
|
||||
case OrderSource.Combo:
|
||||
router.navigateTo(`/bundle/order/platform/order-detail?orderId=${props.order.id}&orderStatus=${props.orderStatus}`)
|
||||
router.navigateTo(`/bundle/order/platform/order-detail?orderId=${props.order.id}`)
|
||||
break;
|
||||
case OrderSource.DouYin:
|
||||
router.navigateTo(`/bundle/order/douyin/douyin-order-detail?orderId=${props.order.id}&orderStatus=${props.orderStatus}`)
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
<template v-for="(label, labelIndex) in item.label" :key="labelIndex">
|
||||
<view class="mr-20rpx flex items-start">
|
||||
<wd-tag
|
||||
:color="randomLabelColor(labelIndex)"
|
||||
:bg-color="randomLabelColor(labelIndex)"
|
||||
:color="randomLabelColor(Number(labelIndex))"
|
||||
:bg-color="randomLabelColor(Number(labelIndex))"
|
||||
plain
|
||||
custom-class="!rounded-4rpx"
|
||||
>{{ label.label_name }}</wd-tag>
|
||||
@ -51,7 +51,7 @@
|
||||
<view class="flex mb-52rpx" :class="`${spec ? 'mt-10rpx' : 'mt-55rpx'}`">
|
||||
<view class="mr-14rpx">
|
||||
<price-format color="#FF5951" :first-size="34" :second-size="26"
|
||||
:subscript-size="26" :price="item.price" weight="500"></price-format>
|
||||
:subscript-size="26" :price="item.discount_price" weight="500"></price-format>
|
||||
</view>
|
||||
<view class="relative">
|
||||
<wd-img width="56rpx" height="56rpx" :src="`${OSS}icon/icon_sale.png`" radius="10rpx"/>
|
||||
|
||||
@ -101,6 +101,8 @@ export async function handleEnsureLocationAuthHooks() {
|
||||
type: 'gcj02',
|
||||
success(res) {
|
||||
handleSetLocationCacheHooks(res.latitude, res.longitude)
|
||||
console.log("🚀 ~ handleEnsureLocationAuthHooks ~ LOCATION_DEFAULT_LAT:", LOCATION_DEFAULT_LAT, LOCATION_DEFAULT_LNG)
|
||||
|
||||
resolve({ lat: res.latitude, lng: res.longitude })
|
||||
},
|
||||
fail() {
|
||||
@ -124,6 +126,8 @@ export async function handleEnsureLocationAuthHooks() {
|
||||
})
|
||||
}
|
||||
handleSetLocationCacheHooks(LOCATION_DEFAULT_LAT, LOCATION_DEFAULT_LNG)
|
||||
console.log("🚀 ~ handleEnsureLocationAuthHooks ~ LOCATION_DEFAULT_LAT:", LOCATION_DEFAULT_LAT, LOCATION_DEFAULT_LNG)
|
||||
|
||||
resolve({ lat: LOCATION_DEFAULT_LAT, lng: LOCATION_DEFAULT_LNG })
|
||||
}
|
||||
})
|
||||
|
||||
@ -5,6 +5,10 @@ import {
|
||||
deleteTeaRoomOrder,
|
||||
confirmTeaRoomOrder
|
||||
} from '@/api/tea-room'
|
||||
import {
|
||||
submitRefund,
|
||||
refund
|
||||
} from '@/api/pay'
|
||||
import { OrderType } from '@/utils/order'
|
||||
import { ReserveServiceCategory } from '@/utils/order'
|
||||
|
||||
@ -86,16 +90,19 @@ export async function handleTRConfirmOrderHooks(orderId: number) {
|
||||
* @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 handleRefundOrderHooks(orderId: number, orderType: number) {
|
||||
try {
|
||||
uni.showLoading({ title: '退款中...' })
|
||||
const res = await submitRefund({ order_id: orderId, order_type: orderType })
|
||||
await refund({ id: res.id })
|
||||
toast.info('退款成功')
|
||||
uni.hideLoading()
|
||||
return true
|
||||
} catch (error) {
|
||||
toast.info('退款失败')
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -109,21 +116,6 @@ export function handleToTRStoreHooks(storeId: number, operationType: number) {
|
||||
|
||||
/*************************************************************套餐***********************************************************************/
|
||||
|
||||
/**
|
||||
* 平台团购套餐-订单退款
|
||||
*/
|
||||
export async function handleTGOrderRefundHooks(orderId: number) {
|
||||
// try {
|
||||
// await confirmTeaRoomOrder({ id: orderId })
|
||||
// uni.$emit('refreshPackageOrderList')
|
||||
// uni.$emit('refreshPackageOrderDetail')
|
||||
// } catch (error) {
|
||||
// router.navigateBack()
|
||||
// throw error
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 跳转到套餐详情
|
||||
* @param storeId 门店ID
|
||||
@ -131,4 +123,4 @@ export async function handleTGOrderRefundHooks(orderId: number) {
|
||||
*/
|
||||
export function handleToTGComboHooks(storeId: number, id: number) {
|
||||
router.navigateTo(`/bundle/tea-room/detail?storeId=${storeId}&id=${id}&type=${ReserveServiceCategory.GroupBuying}`)
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,13 +85,13 @@ export async function handleConfirmOrderHooks(orderId: number) {
|
||||
* @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 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
|
||||
// }
|
||||
// }
|
||||
@ -49,7 +49,7 @@ const alovaInstance = createAlova({
|
||||
statesHook: VueHook,
|
||||
|
||||
beforeRequest: onAuthRequired((method) => {
|
||||
console.log("🚀 ~ method:", method)
|
||||
// console.log("🚀 ~ method:", method)
|
||||
// 设置默认 Content-Type
|
||||
method.config.headers = {
|
||||
ContentType: ContentTypeEnum.JSON,
|
||||
@ -69,9 +69,10 @@ const alovaInstance = createAlova({
|
||||
// method.config.headers.token = token;
|
||||
|
||||
const token = uni.getStorageSync('token')
|
||||
console.log("🚀 ~ token=auth:", token)
|
||||
if (!token) {
|
||||
toast.info('请先登录')
|
||||
router.switchTab('/pages/my/my', 500)
|
||||
router.navigateTo(import.meta.env.VITE_LOGIN_URL, 500)
|
||||
throw new Error('[请求错误]:未登录')
|
||||
}
|
||||
|
||||
@ -115,7 +116,7 @@ const alovaInstance = createAlova({
|
||||
|
||||
if (config.meta?.toast !== false) {
|
||||
toast.info(msg)
|
||||
router.switchTab('/pages/my/my', 1000)
|
||||
router.navigateTo(import.meta.env.VITE_LOGIN_URL, 1000)
|
||||
}
|
||||
throw new Error(`登录超时[${code}]:${msg}`)
|
||||
}
|
||||
|
||||
@ -155,6 +155,7 @@
|
||||
"type": "page",
|
||||
"layout": "tabbar",
|
||||
"style": {
|
||||
"needLogin": true,
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
@ -285,6 +286,7 @@
|
||||
{
|
||||
"path": "tea-room/room",
|
||||
"type": "page",
|
||||
"needLogin": true,
|
||||
"layout": "tabbar",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
|
||||
@ -41,26 +41,32 @@
|
||||
<pay @pay="Cashier.handleGetPayValue" :hidePlatformBalance="hidePlatformBalance" :hideStoreBalance="hideStoreBalance" :hideWechat="hideWechat" :storeMoney="storeMoney"></pay>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="fixed bottom-70rpx left-0 right-0 bg-#4C9F44 text-#fff font-bold text-30rpx leading-42rpx mx-60rpx h-90rpx leading-90rpx text-center rounded-8rpx"
|
||||
<!-- <view
|
||||
class="fixed bottom-70rpx left-0 right-0 text-#fff font-bold text-30rpx leading-42rpx mx-60rpx h-90rpx leading-90rpx text-center rounded-8rpx"
|
||||
@click="Cashier.handleToPay">立即支付
|
||||
</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" >
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-90rpx !leading-90rpx !w-630rpx' :disabled="isSubmitting" @click='Cashier.handleToPay'>{{ isGroupBuying ? '立即购买' : '立即预定' }}</wd-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import Pay from '@/components/Pay.vue'
|
||||
import { getTeaSpecialistDetails } from '@/api/tea'
|
||||
import { ITeaSpecialistDetailsFields } from '@/api/types/tea'
|
||||
import { prePay, balancePay } 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'
|
||||
import { PayValue, PayValueMap, PayOrderType, PayOrderSource } from '@/utils/pay'
|
||||
import { toast } from '@/utils/toast'
|
||||
import { router } from '@/utils/tools'
|
||||
import { PayValue, PayValueMap } from '@/utils/pay'
|
||||
import { prePay, balancePay } from '@/api/pay'
|
||||
import { useUserStore } from '@/store'
|
||||
import type {IUserInfoVo } from '@/api/types/login'
|
||||
import { getTeaRoomBalance, getTeaRoomOrderDetail, getTeaRoomPackageOrderDetail } from '@/api/tea-room'
|
||||
import { OrderType } from '@/utils/order'
|
||||
import { wxPay } from '@/hooks/usePay'
|
||||
import { wechatPay } from '@/hooks/usePay'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
|
||||
|
||||
// 用户信息
|
||||
const userInfo = ref<IUserInfoVo>(null)
|
||||
@ -109,6 +115,7 @@
|
||||
// 门店ID
|
||||
const storeId = ref<number>(0)
|
||||
const storeMoney = ref<number>(0)
|
||||
const comboId = ref<number>(0) // 套餐ID
|
||||
|
||||
// 一键续订
|
||||
const renew = ref<string>('')
|
||||
@ -118,7 +125,13 @@
|
||||
const isGroupBuying = ref<number>(0)
|
||||
const groupCouponId = ref<number>(0)
|
||||
|
||||
// 防止重复提交
|
||||
const isSubmitting = ref(false)
|
||||
|
||||
onLoad(async (args) => {
|
||||
orderId.value = Number(args.orderId)
|
||||
comboId.value = Number(args.cmoboId) || 0
|
||||
|
||||
// 一键续订
|
||||
renew.value = args.renew || ''
|
||||
isGroupBuying.value = Number(args.isGroupBuying)
|
||||
@ -149,8 +162,7 @@
|
||||
|
||||
// 获取订单详情
|
||||
if (args.from == OrderType.TeaRoomOrder && args.orderId) {
|
||||
// 获取订单详情
|
||||
orderId.value = Number(args.orderId)
|
||||
// 获取订单详情
|
||||
if (isGroupBuying.value == 0) {
|
||||
Cashier.handleGetOrderDetails()
|
||||
} else {
|
||||
@ -205,13 +217,11 @@
|
||||
*/
|
||||
handleGetRoomPackageDetails: async () => {
|
||||
// 获取订单详情接口
|
||||
const res = await getTeaRoomPackageOrderDetail({
|
||||
id: orderId.value,
|
||||
latitude: uni.getStorageSync('latitude'),
|
||||
longitude: uni.getStorageSync('longitude')
|
||||
const res = await getTeaRoomPackageDetail({
|
||||
id: comboId.value
|
||||
})
|
||||
order.value = res
|
||||
money.value = Number(res.details.order_amount)
|
||||
console.log("🚀 ~ res:", res)
|
||||
money.value = Number(res.details.discount_price)
|
||||
},
|
||||
|
||||
// 获取支付方式
|
||||
@ -224,50 +234,78 @@
|
||||
* 支付
|
||||
*/
|
||||
handleToPay: async () => {
|
||||
if (isSubmitting.value) return
|
||||
|
||||
if (pay.value == null || pay.value == undefined) {
|
||||
toast.info('请选择支付方式')
|
||||
return
|
||||
}
|
||||
|
||||
isSubmitting.value = true
|
||||
|
||||
if (from.value == OrderType.TeaRoomOrder) {
|
||||
// 预支付-茶室订单
|
||||
uni.showLoading({ title: '支付中...' })
|
||||
try {
|
||||
// 预支付
|
||||
let ordeType = 1
|
||||
let ordeType = PayOrderType.TeaRoom
|
||||
if (isGroupBuying.value) {
|
||||
ordeType = 2
|
||||
// 购买团购套餐
|
||||
ordeType = PayOrderType.BuyCombo
|
||||
}
|
||||
|
||||
const res1 = await prePay({
|
||||
const res = await prePay({
|
||||
from: PayValueMap[pay.value],
|
||||
order_id: orderId.value,
|
||||
pay_way: pay.value,
|
||||
order_source: 1, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_source: PayOrderSource.MINI, //订单来源:1-小程序; 2-h5; 3app
|
||||
order_type: ordeType // 0为茶艺师 1为茶室包间 2为茶室套餐
|
||||
})
|
||||
|
||||
// 余额支付(平台余额、门店余额)
|
||||
if (pay.value == PayValue.PlatformBalance || pay.value == PayValue.StoreBalance) {
|
||||
await balancePay({
|
||||
id: res1.pay
|
||||
id: res.pay
|
||||
})
|
||||
|
||||
uni.hideLoading()
|
||||
result.value = 'success'
|
||||
|
||||
isSubmitting.value = false
|
||||
router.navigateBack(1, 500)
|
||||
} else if (pay.value == PayValue.WeChatPay) {
|
||||
// 微信支付
|
||||
// await wxpay(res1.pay_params)
|
||||
// wxPay()
|
||||
wechatPay(res.pay.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(() => {
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
result.value = 'success'
|
||||
} catch (error) {
|
||||
isSubmitting.value = false
|
||||
uni.hideLoading()
|
||||
result.value = 'fail'
|
||||
router.navigateBack(1, 500)
|
||||
return
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 500);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,8 +51,8 @@
|
||||
const redirectUrl = ref<string>('')
|
||||
|
||||
onLoad((args) => {
|
||||
console.log("🚀 ~ login args:", args)
|
||||
redirectUrl.value = args.redirect || ''
|
||||
|
||||
})
|
||||
|
||||
const Login = {
|
||||
@ -72,12 +72,13 @@
|
||||
const res = await userStore.wxLogin()
|
||||
uni.hideLoading()
|
||||
if (res) {
|
||||
toast.info('登录成功')
|
||||
if (redirectUrl.value) {
|
||||
router.redirectTo(redirectUrl.value)
|
||||
} else {
|
||||
router.navigateBack(1, 500)
|
||||
const decoded = decodeURIComponent(redirectUrl.value)
|
||||
if (decoded == '/bundle/order/tea-room/order-detail') {
|
||||
uni.$emit('transferOrder')
|
||||
}
|
||||
|
||||
toast.info('登录成功')
|
||||
router.navigateBack(1, 500)
|
||||
}
|
||||
} catch(error) {
|
||||
uni.hideLoading()
|
||||
|
||||
@ -176,7 +176,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">
|
||||
@ -190,10 +190,10 @@
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</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 px-30rpx">
|
||||
<view v-for="(item, index) in serviceMenuList" :key="index">
|
||||
@ -210,7 +210,7 @@
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 推广码 -->
|
||||
@ -322,8 +322,6 @@
|
||||
user.value = res
|
||||
if (res.member === 1) {
|
||||
isVip.value = true
|
||||
} else {
|
||||
isVip.value = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -334,6 +332,8 @@
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
isVip.value = false
|
||||
|
||||
uni.$on('clearUser', () => {
|
||||
const userStore = useUserStore()
|
||||
isLogin.value = userStore.isLoggedIn
|
||||
|
||||
@ -6,18 +6,28 @@
|
||||
}</route>
|
||||
|
||||
<template>
|
||||
<view class="mt-84rpx flex justify-center items-center">
|
||||
<view v-if="type == OrderType.TeaRoomOrder">
|
||||
<reserve-notice :title="isGroupBuying ? '套餐购买成功' : '茶室预约成功'" 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.handleRoomSeeOrder">查看订单</view>
|
||||
<view class='bg-[#4C9F44] text-[#fff] rounded-8rpx h-90rpx leading-90rpx w-300rpx' @click="reserve.handleRoomDone">完成</view>
|
||||
</view>
|
||||
</template>
|
||||
</reserve-notice>
|
||||
<view class="">
|
||||
<view class="">
|
||||
<wd-navbar safeAreaInsetTop custom-class='!bg-[#fff]' :bordered="false" placeholder>
|
||||
<template #left>
|
||||
<view></view>
|
||||
</template>
|
||||
</wd-navbar>
|
||||
</view>
|
||||
<view class="mt-84rpx flex justify-center items-center">
|
||||
<view v-if="type == OrderType.TeaRoomOrder">
|
||||
<reserve-notice :title="isGroupBuying ? '套餐购买成功' : '茶室预约成功'" 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.handleRoomSeeOrder">查看订单</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>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
"layout": "tabbar",
|
||||
"style": {
|
||||
// 'custom' 表示开启自定义导航栏,默认 'default'
|
||||
"needLogin": true,
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "首页"
|
||||
}
|
||||
@ -45,30 +46,6 @@
|
||||
</template>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
|
||||
<!-- <view class="mx-30rpx" :style="{ paddingTop: navbarHeight + 'px' }"> -->
|
||||
<!-- 茶室预约 -->
|
||||
<!-- <view v-if="tab === 0">
|
||||
<mescroll-body @init="mescrollInit" @down="downCallback" @up="Reserve.upCallback" :up="upOption">
|
||||
<view v-for="(item, index) in 5" :key="index" >
|
||||
<view class="mb-20rpx" @click="Reserve.handleToReserveRoomOrder">
|
||||
<combo-card :type="OrderSource.TeaRoom" :order-status="OrderStatus.Consuming"></combo-card>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view> -->
|
||||
|
||||
<!-- 茶艺师预约 -->
|
||||
<!-- <view v-if="tab === 1">
|
||||
<mescroll-body @init="mescrollInit" @down="downCallback" @up="Reserve.upCallback" :up="upOption">
|
||||
<view v-for="(item, index) in 5" :key="index" >
|
||||
<view class="mb-20rpx" @click="Reserve.handleToTeaSpecialistOrder">
|
||||
<combo-card :type="OrderSource.TeaSpecialist" :order-status="OrderStatus.Consuming"></combo-card>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view> -->
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -104,6 +81,15 @@
|
||||
const orderStatus = ref<string>('')
|
||||
const list = ref<Array<any>>([]) // 茶室列表
|
||||
const keywords = ref<string>('') // 搜索关键词
|
||||
const canReset = ref<boolean>(false) // 避免onShow重复加载
|
||||
|
||||
onShow(() => {
|
||||
if (canReset.value) {
|
||||
list.value = []
|
||||
getMescroll().resetUpScroll();
|
||||
}
|
||||
canReset.value = true
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
})
|
||||
|
||||
@ -44,15 +44,29 @@ export const navigateToInterceptor = {
|
||||
needLoginPages = _needLoginPages
|
||||
}
|
||||
const isNeedLogin = needLoginPages.includes(path)
|
||||
console.log("🚀 ~ router: path:", path)
|
||||
console.log("🚀 ~ router: needLoginPages:", needLoginPages)
|
||||
|
||||
if (!isNeedLogin) {
|
||||
console.log("🚀 ~ router2: isNeedLogin:")
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
console.log("🚀 ~ router2-1: isNeedLogin:")
|
||||
|
||||
const hasLogin = isLogined()
|
||||
console.log("🚀 ~ hasLogin:", hasLogin)
|
||||
if (hasLogin) {
|
||||
console.log("🚀 ~ router3:")
|
||||
|
||||
return true
|
||||
}
|
||||
console.log("🚀 ~ router4:")
|
||||
|
||||
tabbarStore.restorePrevIdx()
|
||||
const redirectRoute = `${loginRoute}?redirect=${encodeURIComponent(url)}`
|
||||
console.log("🚀 ~ redirectRoute:", redirectRoute)
|
||||
uni.navigateTo({ url: redirectRoute })
|
||||
return false
|
||||
},
|
||||
|
||||
@ -301,17 +301,65 @@ export const TeaRoomPackageOrderStatusTextValue: Record<TeaRoomPackageOrderStatu
|
||||
},
|
||||
}
|
||||
|
||||
// 本地-团购套餐订单状态
|
||||
export enum GroupComboOrderStatus {
|
||||
ToUse = 0, // 待使用
|
||||
Used = 1, // 已使用
|
||||
Refunded = 2, // 已退款
|
||||
}
|
||||
|
||||
// 本地-团购套餐订单状态
|
||||
export enum GroupComboOrderStatusText {
|
||||
All = 'all', // 全部
|
||||
ToUse = 'toUse', // 待使用
|
||||
Used = 'used', // 已使用
|
||||
Refunded = 'refunded', // 已退款
|
||||
}
|
||||
|
||||
export const GroupComboOrderStatusValue: Record<GroupComboOrderStatusText, string | number> = {
|
||||
[GroupComboOrderStatusText.All]: '',
|
||||
[GroupComboOrderStatusText.ToUse]: 0,
|
||||
[GroupComboOrderStatusText.Used]: 1,
|
||||
[GroupComboOrderStatusText.Refunded]: 2,
|
||||
}
|
||||
|
||||
export const GroupComboOrderStatusTextValue: Record<GroupComboOrderStatus, any> = {
|
||||
[GroupComboOrderStatus.ToUse]: {
|
||||
title: '待使用'
|
||||
},
|
||||
[GroupComboOrderStatus.Used]: {
|
||||
title: '交易完成'
|
||||
},
|
||||
[GroupComboOrderStatus.Refunded]: {
|
||||
title: '退款成功'
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
// 抖音状态
|
||||
export enum DouYinOrderStatus {
|
||||
ToUse = 0, // 待使用
|
||||
Used = 1, // 已使用
|
||||
}
|
||||
|
||||
// 抖音订单状态文本
|
||||
export enum DouYinOrderStatusText {
|
||||
All = 'all', // 全部
|
||||
ToUse = 'tousee', // 待使用
|
||||
ToUse = 'toUse', // 待使用
|
||||
Used = 'used', // 已使用
|
||||
}
|
||||
|
||||
export enum DouYinOrderStatus {
|
||||
Pending = 0, // 待付款
|
||||
ToUse = 1, // 待使用
|
||||
Used = 2, // 已使用
|
||||
Refunded = 3, // 已退款
|
||||
}
|
||||
export const DouYinOrderStatusValue: Record<DouYinOrderStatusText, string | number> = {
|
||||
[DouYinOrderStatusText.All]: '',
|
||||
[DouYinOrderStatusText.ToUse]: 0,
|
||||
[DouYinOrderStatusText.Used]: 1,
|
||||
}
|
||||
|
||||
export const DouYinOrderStatusTextValue: Record<DouYinOrderStatus, any> = {
|
||||
[DouYinOrderStatus.ToUse]: {
|
||||
title: '待使用'
|
||||
},
|
||||
[DouYinOrderStatus.Used]: {
|
||||
title: '交易完成'
|
||||
},
|
||||
}
|
||||
|
||||
@ -52,4 +52,22 @@ export const PayList: PayMethod[] = [
|
||||
value: PayValue.WeChatPay,
|
||||
type: PayCategory.WeChatPay
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
// 支付订单类型
|
||||
export enum PayOrderType {
|
||||
TeaSpecialis = 0, // 茶艺师
|
||||
TeaRoom = 1, // 茶室支付
|
||||
BuyCombo = 2, // 购买套餐
|
||||
BuyVip = 3, // 购买会员
|
||||
Recharge = 4, // 充值
|
||||
ComboRefund = 5, // 套餐退款
|
||||
TeaRoomRefund = 6, // 茶室退款
|
||||
}
|
||||
|
||||
// 支付订单来源
|
||||
export enum PayOrderSource {
|
||||
MINI = 1, // 小程序
|
||||
H5 = 2, // H5
|
||||
APP = 3, // APP
|
||||
}
|
||||
Reference in New Issue
Block a user