调试接口

This commit is contained in:
wangxiaowei
2025-12-20 22:44:12 +08:00
parent fc3072980c
commit a2f1023de8
32 changed files with 982 additions and 483 deletions

View File

@ -54,7 +54,7 @@
import { ITeaSpecialistDetailsFields } from '@/api/types/tea'
import { toast } from '@/utils/toast'
import { router } from '@/utils/tools'
import { PayValue } from '@/utils/pay'
import { PayValue, PayValueMap } from '@/utils/pay'
import { prePay, balancePay } from '@/api/pay'
import { useUserStore } from '@/store'
import type {IUserInfoVo } from '@/api/types/login'
@ -139,7 +139,6 @@
title.value = `茶室预定-${args.name}`
} else {
title.value = `茶室套餐购买-${args.name}`
hidePlatformBalance.value = true // 隐藏平台余额支付
hideStoreBalance.value = true // 隐藏门店余额支付
}
}
@ -218,6 +217,7 @@
// 获取支付方式
handleGetPayValue: (value: number) => {
pay.value = value
console.log("🚀 ~ pay.value:", pay.value)
},
/**
@ -234,18 +234,23 @@
uni.showLoading({ title: '支付中...' })
try {
// 预支付
let ordeType = 1
if (isGroupBuying.value) {
ordeType = 2
}
const res1 = await prePay({
from: isGroupBuying.value ? 'wx' : 'balance',
from: PayValueMap[pay.value],
order_id: orderId.value,
pay_way: pay.value,
order_source: 1, //订单来源1-小程序; 2-h5; 3app
order_type: 1 // 0为茶艺师 1为茶室包间
order_type: ordeType // 0为茶艺师 1为茶室包间 2为茶室套餐
})
// 余额支付(平台余额、门店余额)
if (pay.value == PayValue.PlatformBalance || pay.value == PayValue.StoreBalance) {
await balancePay({
id: res1.pay_id
id: res1.pay
})
} else if (pay.value == PayValue.WeChatPay) {
// 微信支付