调试接口
This commit is contained in:
@ -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
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user