新增摸大红业务并修复后台链接按钮白字
支持分类筛选、搜索、下单支付建群与固定二维码;合并迁移种子数据;后台表格编辑/详情链接恢复主题色可见。
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { showDialog, showToast } from 'vant'
|
||||
|
||||
import type { PaymentOrder } from '@/features/orders/api/orders'
|
||||
import {
|
||||
paymentPayURL,
|
||||
useOrderPaymentCashier,
|
||||
@@ -14,7 +15,11 @@ export { paymentPayURL as mobilePaymentPayURL }
|
||||
* 并处理微信 / 支付宝内嵌浏览器的直接跳转拉起支付。对外 API 名保持不变,
|
||||
* Mobile 视图无需改动。
|
||||
*/
|
||||
export function useMobilePaymentCashier() {
|
||||
|
||||
export function useMobilePaymentCashier(options?: {
|
||||
queryPayment?: (orderId: number) => Promise<PaymentOrder>
|
||||
paidMessage?: string
|
||||
}) {
|
||||
function isInAppPaymentBrowser(): boolean {
|
||||
if (typeof navigator === 'undefined') return false
|
||||
const ua = navigator.userAgent || ''
|
||||
@@ -32,9 +37,10 @@ export function useMobilePaymentCashier() {
|
||||
confirmButtonText: '知道了',
|
||||
})
|
||||
},
|
||||
paidMessage: '支付成功,正在进入群消息',
|
||||
paidMessage: options?.paidMessage || '支付成功,正在进入群消息',
|
||||
pollIntervalMs: 2500,
|
||||
qrWidth: 220,
|
||||
queryPayment: options?.queryPayment,
|
||||
openExternalURL: url => {
|
||||
if (isHTTPURL(url) && isInAppPaymentBrowser()) {
|
||||
window.location.href = url
|
||||
|
||||
@@ -41,6 +41,11 @@ export interface UseOrderPaymentCashierOptions {
|
||||
*/
|
||||
openExternalURL?: (url: string) => boolean
|
||||
/** 弹窗显隐控制方式。PC 用 el-dialog(v-model 一个 ref),Mobile 用 van-popup。返回 true 表示用 ref,false 表示 composable 内部 ref。 */
|
||||
/**
|
||||
* 自定义支付状态查询。默认走租号订单 `/orders/:id/query-payment`。
|
||||
* 摸大红等独立业务可注入自己的查询函数。
|
||||
*/
|
||||
queryPayment?: (orderId: number) => Promise<PaymentOrder>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +136,8 @@ export function useOrderPaymentCashier(options: UseOrderPaymentCashierOptions) {
|
||||
checkingPayment.value = true
|
||||
const previousPayURL = payURL.value
|
||||
try {
|
||||
const payment = await queryOrderPayment(activePayment.value.order_id)
|
||||
const query = options.queryPayment || queryOrderPayment
|
||||
const payment = await query(activePayment.value.order_id)
|
||||
activePayment.value = payment
|
||||
if (payment.paid) {
|
||||
await handlePaid()
|
||||
|
||||
Reference in New Issue
Block a user