2031 lines
88 KiB
Vue
2031 lines
88 KiB
Vue
<script>
|
|
import "~/assets/styles/PaymentDialog.BNFKQF1U.css";
|
|
import { toDisplayString } from "vue";
|
|
import { renderList } from "vue";
|
|
import { onUnmounted } from "vue";
|
|
import { normalizeClass } from "vue";
|
|
import { mergeModels } from "vue";
|
|
import { useModel } from "vue";
|
|
import { watch } from "vue";
|
|
import { createBlock } from "vue";
|
|
import { ref } from "vue";
|
|
import { withCtx } from "vue";
|
|
import { createCommentVNode } from "vue";
|
|
import { computed } from "vue";
|
|
import { createElementBlock } from "vue";
|
|
import { Fragment } from "vue";
|
|
import { createElementVNode } from "vue";
|
|
import { createTextVNode } from "vue";
|
|
import { unref } from "vue";
|
|
import { defineComponent } from "vue";
|
|
import { createVNode } from "vue";
|
|
import { openBlock } from "vue";
|
|
import { NuxtLink } from "#components";
|
|
import { ApiError } from "~/lib/auth.js";
|
|
import { sanitizeMessage } from "~/lib/auth.js";
|
|
import { useApi } from "~/lib/auth.js";
|
|
import { useAuth } from "~/lib/auth.js";
|
|
import dialog from "primevue/dialog";
|
|
import button from "primevue/button";
|
|
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
|
|
import message from "primevue/message";
|
|
import select from "primevue/select";
|
|
var ue = {
|
|
key: 0,
|
|
class: `paid`,
|
|
},
|
|
de = {
|
|
class: `order-line`,
|
|
},
|
|
fe = {
|
|
key: 0,
|
|
class: `amount`,
|
|
},
|
|
pe = {
|
|
key: 0,
|
|
class: `voucher-tip`,
|
|
},
|
|
me = {
|
|
key: 1,
|
|
class: `gateway-list primary-gateways`,
|
|
role: `group`,
|
|
"aria-label": `支付方式`,
|
|
},
|
|
he = [`aria-busy`],
|
|
ge = {
|
|
class: `voucher-heading`,
|
|
},
|
|
_e = {
|
|
key: 0,
|
|
class: `voucher-empty`,
|
|
role: `status`,
|
|
},
|
|
ve = {
|
|
key: 1,
|
|
class: `voucher-feedback`,
|
|
role: `alert`,
|
|
},
|
|
ye = {
|
|
class: `voucher-choice`,
|
|
},
|
|
be = {
|
|
class: `voucher-option`,
|
|
},
|
|
xe = {
|
|
key: 0,
|
|
},
|
|
Se = {
|
|
key: 3,
|
|
class: `voucher-empty`,
|
|
role: `status`,
|
|
},
|
|
Ce = {
|
|
key: 4,
|
|
class: `voucher-help`,
|
|
},
|
|
we = [`aria-pressed`, `disabled`, `onClick`],
|
|
Te = [`src`],
|
|
Ee = {
|
|
class: `gateway-title`,
|
|
},
|
|
De = {
|
|
key: 1,
|
|
class: `pi pi-check-circle gateway-selected`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
Oe = [`aria-pressed`, `disabled`],
|
|
ke = {
|
|
class: `balance-copy`,
|
|
},
|
|
Ae = {
|
|
key: 0,
|
|
class: `pi pi-check-circle gateway-selected`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
je = {
|
|
key: 2,
|
|
class: `payment-combination`,
|
|
"aria-label": `组合支付`,
|
|
},
|
|
Me = {
|
|
class: `combination-amount`,
|
|
role: `status`,
|
|
},
|
|
Ne = {
|
|
class: `gateway-list combination-gateways`,
|
|
role: `group`,
|
|
"aria-label": `剩余金额支付方式`,
|
|
},
|
|
Pe = [`aria-pressed`, `disabled`, `onClick`],
|
|
Fe = [`src`],
|
|
Ie = {
|
|
class: `gateway-title`,
|
|
},
|
|
Le = {
|
|
key: 1,
|
|
class: `pi pi-check-circle gateway-selected`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
Re = {
|
|
key: 0,
|
|
class: `balance-note`,
|
|
},
|
|
ze = {
|
|
key: 3,
|
|
class: `balance-breakdown`,
|
|
role: `status`,
|
|
},
|
|
Be = {
|
|
key: 4,
|
|
class: `balance-note`,
|
|
},
|
|
Ve = {
|
|
key: 6,
|
|
class: `pay-step`,
|
|
},
|
|
He = {
|
|
key: 0,
|
|
class: `balance-note`,
|
|
},
|
|
Ue = [`innerHTML`],
|
|
We = {
|
|
key: 1,
|
|
class: `inline-payment`,
|
|
},
|
|
Ge = {
|
|
key: 0,
|
|
class: `paid`,
|
|
},
|
|
Ke = {
|
|
class: `order-line`,
|
|
},
|
|
qe = {
|
|
key: 0,
|
|
class: `amount`,
|
|
},
|
|
Je = {
|
|
key: 0,
|
|
class: `voucher-tip`,
|
|
},
|
|
Ye = {
|
|
key: 1,
|
|
class: `gateway-list primary-gateways`,
|
|
role: `group`,
|
|
"aria-label": `支付方式`,
|
|
},
|
|
Xe = [`aria-busy`],
|
|
Ze = {
|
|
class: `voucher-heading`,
|
|
},
|
|
Qe = {
|
|
key: 0,
|
|
class: `voucher-empty`,
|
|
role: `status`,
|
|
},
|
|
$e = {
|
|
key: 1,
|
|
class: `voucher-feedback`,
|
|
role: `alert`,
|
|
},
|
|
et = {
|
|
class: `voucher-choice`,
|
|
},
|
|
tt = {
|
|
class: `voucher-option`,
|
|
},
|
|
nt = {
|
|
key: 0,
|
|
},
|
|
rt = {
|
|
key: 3,
|
|
class: `voucher-empty`,
|
|
role: `status`,
|
|
},
|
|
it = {
|
|
key: 4,
|
|
class: `voucher-help`,
|
|
},
|
|
at = [`aria-pressed`, `disabled`, `onClick`],
|
|
ot = [`src`],
|
|
st = {
|
|
class: `gateway-title`,
|
|
},
|
|
ct = {
|
|
key: 1,
|
|
class: `pi pi-check-circle gateway-selected`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
lt = [`aria-pressed`, `disabled`],
|
|
ut = {
|
|
class: `balance-copy`,
|
|
},
|
|
dt = {
|
|
key: 0,
|
|
class: `pi pi-check-circle gateway-selected`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
ft = {
|
|
key: 2,
|
|
class: `payment-combination`,
|
|
"aria-label": `组合支付`,
|
|
},
|
|
pt = {
|
|
class: `combination-amount`,
|
|
role: `status`,
|
|
},
|
|
mt = {
|
|
class: `gateway-list combination-gateways`,
|
|
role: `group`,
|
|
"aria-label": `剩余金额支付方式`,
|
|
},
|
|
ht = [`aria-pressed`, `disabled`, `onClick`],
|
|
gt = [`src`],
|
|
_t = {
|
|
class: `gateway-title`,
|
|
},
|
|
vt = {
|
|
key: 1,
|
|
class: `pi pi-check-circle gateway-selected`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
yt = {
|
|
key: 0,
|
|
class: `balance-note`,
|
|
},
|
|
bt = {
|
|
key: 3,
|
|
class: `balance-breakdown`,
|
|
role: `status`,
|
|
},
|
|
xt = {
|
|
key: 4,
|
|
class: `balance-note`,
|
|
},
|
|
St = {
|
|
key: 6,
|
|
class: `pay-step`,
|
|
},
|
|
Ct = {
|
|
key: 0,
|
|
class: `balance-note`,
|
|
},
|
|
wt = [`innerHTML`],
|
|
Tt = {
|
|
class: `inline-pay-actions`,
|
|
},
|
|
x = Object.assign(
|
|
_plugin_vue_export_helper_t(
|
|
defineComponent({
|
|
__name: `PaymentDialog`,
|
|
props: mergeModels(
|
|
{
|
|
orderId: {},
|
|
amount: {},
|
|
inline: {
|
|
type: Boolean,
|
|
},
|
|
},
|
|
{
|
|
modelValue: {
|
|
type: Boolean,
|
|
default: !1,
|
|
},
|
|
modelModifiers: {},
|
|
},
|
|
),
|
|
emits: mergeModels([`success`, `updated`], [`update:modelValue`]),
|
|
setup(i, { emit: _ }) {
|
|
let b = useModel(i, `modelValue`),
|
|
x = i,
|
|
Et = _,
|
|
S = useApi(),
|
|
Dt = useAuth(),
|
|
C = ref(1),
|
|
w = ref([]),
|
|
T = ref(``),
|
|
E = ref(``),
|
|
D = ref(!1),
|
|
O = ref(!1),
|
|
k = ref(``),
|
|
A = ref(!1),
|
|
j = ref(null),
|
|
M = ref(``),
|
|
N = ref(!1),
|
|
P = ref(``),
|
|
F = ref(``),
|
|
I = ref(!1),
|
|
L = ref(0),
|
|
R = ref(0),
|
|
Ot = ref(!1),
|
|
z = ref(``),
|
|
kt = computed(
|
|
() =>
|
|
I.value &&
|
|
P.value !== `recharge` &&
|
|
!Ot.value &&
|
|
F.value === `Unpaid`,
|
|
),
|
|
B = computed(
|
|
() => N.value && j.value !== null && j.value < (H(z.value) ?? 0),
|
|
),
|
|
At = computed(() =>
|
|
N.value ? Math.min(j.value ?? 0, H(z.value) ?? 0) : 0,
|
|
),
|
|
jt = computed(() => Math.max(0, (H(z.value) ?? 0) - At.value)),
|
|
V = computed(() => kt.value && j.value !== null && j.value > 0),
|
|
Mt = computed(
|
|
() =>
|
|
I.value &&
|
|
F.value === `Unpaid` &&
|
|
!A.value &&
|
|
!D.value &&
|
|
!J.value &&
|
|
(N.value ? V.value && (!B.value || !!T.value) : !!T.value),
|
|
),
|
|
Nt = computed(() =>
|
|
M.value
|
|
? `余额暂不可用,请重试`
|
|
: j.value === null
|
|
? `正在获取可用余额…`
|
|
: P.value === `recharge`
|
|
? `充值订单不支持余额支付`
|
|
: Ot.value
|
|
? `预开票订单不支持余额支付`
|
|
: I.value && F.value !== `Unpaid`
|
|
? `当前订单状态不支持余额支付`
|
|
: j.value
|
|
? `${j.value < (H(z.value) ?? 0) ? `需组合支付,` : ``}余额 ¥${U(j.value)}`
|
|
: `可用余额 ¥0.00`,
|
|
);
|
|
function H(e) {
|
|
if (e == null || String(e).trim() === ``) return null;
|
|
let t = Number(e),
|
|
n = Math.round(t * 100);
|
|
return Number.isFinite(t) && t >= 0 && Number.isSafeInteger(n)
|
|
? n
|
|
: null;
|
|
}
|
|
function U(e) {
|
|
return (e / 100).toFixed(2);
|
|
}
|
|
let W = ref([]),
|
|
G = ref(null),
|
|
K = ref(0),
|
|
q = computed(
|
|
() =>
|
|
I.value &&
|
|
[`new`, `renew`, `upgrade`, `change_billing_cycle`].includes(
|
|
P.value,
|
|
),
|
|
),
|
|
J = ref(!1),
|
|
Y = ref(``),
|
|
X = 0,
|
|
paymentPoll = null,
|
|
Z = (e, t) => e === X && b.value && String(x.orderId) === String(t);
|
|
function stopPaymentPolling() {
|
|
const session = paymentPoll;
|
|
paymentPoll = null;
|
|
if (!session) return;
|
|
clearInterval(session.interval);
|
|
clearTimeout(session.deadlineTimer);
|
|
}
|
|
function It() {
|
|
O.value ||
|
|
(stopPaymentPolling(),
|
|
(O.value = !0),
|
|
Dt.refreshOverview?.().catch(() => {}),
|
|
Et(`success`));
|
|
}
|
|
async function $(e = X, t = x.orderId, n = !1) {
|
|
if (!t) return !1;
|
|
let r = await S.get(`/order/${t}`);
|
|
if (!Z(e, t)) return !1;
|
|
if (
|
|
!r.order ||
|
|
String(r.order.id) !== String(t) ||
|
|
H(r.order.amount) === null ||
|
|
!r.order.type ||
|
|
!r.order.status
|
|
)
|
|
throw Error(`订单支付信息加载失败,请重试`);
|
|
return (
|
|
(z.value = U(H(r.order.amount))),
|
|
(L.value = H(r.order.credit) ?? 0),
|
|
(R.value =
|
|
H(r.order.amount_unpaid) ??
|
|
Math.max(0, H(r.order.amount) - L.value)),
|
|
(Ot.value = Number(r.customfields?.is_pre_invoice) === 1),
|
|
(P.value = r.order.type),
|
|
(F.value = r.order.status),
|
|
(I.value = !0),
|
|
n && Et(`updated`, r.order),
|
|
r.order.status === `Paid` && It(),
|
|
!0
|
|
);
|
|
}
|
|
async function Lt(e = X, t = x.orderId) {
|
|
if (t) {
|
|
M.value = ``;
|
|
try {
|
|
let n = await S.get(`/account`);
|
|
if (!Z(e, t)) return;
|
|
let r = H(n.account?.credit);
|
|
if (r === null) throw Error(`可用余额加载失败,请重试`);
|
|
j.value = r;
|
|
} catch (n) {
|
|
if (!Z(e, t)) return;
|
|
((j.value = null),
|
|
(M.value =
|
|
n instanceof Error
|
|
? n.message
|
|
: `可用余额加载失败,请重试`));
|
|
}
|
|
}
|
|
}
|
|
async function Rt(e = X, t = x.orderId) {
|
|
if (t)
|
|
try {
|
|
let n = await S.get(`/gateway`);
|
|
if (!Z(e, t)) return;
|
|
((w.value = (n.list ?? []).filter((e) => e.name !== `credit`)),
|
|
w.value.some((e) => e.name === T.value) ||
|
|
(T.value = w.value.length === 1 ? w.value[0].name : ``));
|
|
} catch (n) {
|
|
Z(e, t) &&
|
|
(k.value =
|
|
n instanceof Error ? n.message : `获取支付方式失败`);
|
|
}
|
|
}
|
|
async function zt(e = X, t = x.orderId, n = !0) {
|
|
if (t) {
|
|
(n && (J.value = !0), (Y.value = ``));
|
|
try {
|
|
let n = await S.get(`/voucher/pay`, {
|
|
order_id: t,
|
|
});
|
|
if (!Z(e, t)) return;
|
|
if (!Array.isArray(n?.list)) throw Error(`代金券响应格式异常`);
|
|
W.value = n.list;
|
|
let r =
|
|
W.value.find((e) => Number(e.is_applied) === 1)?.id ?? null;
|
|
((r !== G.value || !r) && (K.value = r ? null : 0),
|
|
(G.value = r));
|
|
} catch {
|
|
Z(e, t) &&
|
|
((W.value = []), (Y.value = `代金券加载失败,请重试`));
|
|
} finally {
|
|
n && Z(e, t) && (J.value = !1);
|
|
}
|
|
}
|
|
}
|
|
async function Bt() {
|
|
b.value &&
|
|
x.orderId &&
|
|
q.value &&
|
|
!D.value &&
|
|
!A.value &&
|
|
!J.value &&
|
|
(await zt());
|
|
}
|
|
function Vt(e) {
|
|
let t = H(e.min_price);
|
|
return t === null ? `` : t > 0 ? `满 ¥${U(t)} 可用` : `无金额门槛`;
|
|
}
|
|
async function Ht() {
|
|
// A visible dialog can outlive session invalidation until route teardown.
|
|
if (!Dt.isLoggedIn) return;
|
|
let e = x.orderId,
|
|
t = X;
|
|
if (e && b.value && !D.value && !A.value) {
|
|
((A.value = !0), (k.value = ``));
|
|
try {
|
|
if (
|
|
(await Promise.all([
|
|
$(t, e).then((n) => (n && q.value ? zt(t, e) : void 0)),
|
|
Lt(t, e),
|
|
Rt(t, e),
|
|
]),
|
|
!Z(t, e))
|
|
)
|
|
return;
|
|
N.value = V.value && L.value > 0;
|
|
} catch (n) {
|
|
Z(t, e) &&
|
|
((I.value = !1),
|
|
(k.value =
|
|
n instanceof Error ? n.message : `支付信息加载失败`));
|
|
} finally {
|
|
Z(t, e) && (A.value = !1);
|
|
}
|
|
}
|
|
}
|
|
function Ut() {
|
|
D.value ||
|
|
A.value ||
|
|
J.value ||
|
|
!V.value ||
|
|
((N.value = !0), (k.value = ``));
|
|
}
|
|
function Wt(e) {
|
|
D.value ||
|
|
A.value ||
|
|
J.value ||
|
|
(w.value.some((t) => t.name === e) &&
|
|
((N.value = !1), (T.value = e), (k.value = ``)));
|
|
}
|
|
function Gt(e) {
|
|
D.value ||
|
|
A.value ||
|
|
J.value ||
|
|
!B.value ||
|
|
(w.value.some((t) => t.name === e) &&
|
|
((T.value = e), (k.value = ``)));
|
|
}
|
|
async function Kt(e) {
|
|
let t = x.orderId,
|
|
n = X;
|
|
if (!(!t || D.value || A.value || J.value)) {
|
|
((J.value = !0), (k.value = ``));
|
|
try {
|
|
let r = await S.post(`/voucher/pay`, {
|
|
order_id: t,
|
|
use: +!!e,
|
|
auto: 0,
|
|
voucher_get_id: e ?? ``,
|
|
});
|
|
if (!Z(n, t)) return;
|
|
((G.value = r.voucher_get_id ? Number(r.voucher_get_id) : null),
|
|
(K.value = Number(r.voucher_amount ?? 0)),
|
|
await $(n, t, !0));
|
|
} catch (e) {
|
|
if (!Z(n, t)) return;
|
|
((k.value = e instanceof Error ? e.message : `代金券使用失败`),
|
|
await Promise.all([
|
|
zt(n, t, !1),
|
|
$(n, t, !0).catch(() => {
|
|
Z(n, t) && (I.value = !1);
|
|
}),
|
|
]));
|
|
} finally {
|
|
Z(n, t) && (J.value = !1);
|
|
}
|
|
}
|
|
}
|
|
function qt(e) {
|
|
Kt(e.value ?? null);
|
|
}
|
|
(watch(
|
|
[b, () => x.orderId, () => Dt.token],
|
|
() => {
|
|
(X++,
|
|
stopPaymentPolling(),
|
|
b.value &&
|
|
((C.value = 1),
|
|
(O.value = !1),
|
|
(D.value = !1),
|
|
(A.value = !1),
|
|
(E.value = ``),
|
|
(T.value = ``),
|
|
(w.value = []),
|
|
(I.value = !1),
|
|
(P.value = ``),
|
|
(F.value = ``),
|
|
(N.value = !1),
|
|
(j.value = null),
|
|
(M.value = ``),
|
|
(L.value = 0),
|
|
(R.value = 0),
|
|
(Ot.value = !1),
|
|
(W.value = []),
|
|
(G.value = null),
|
|
(K.value = 0),
|
|
(J.value = !1),
|
|
(Y.value = ``),
|
|
(z.value = x.amount ?? ``),
|
|
Ht()));
|
|
},
|
|
{
|
|
immediate: !0,
|
|
flush: `sync`,
|
|
},
|
|
),
|
|
onUnmounted(() => {
|
|
(X++, stopPaymentPolling());
|
|
}));
|
|
async function Jt() {
|
|
if (D.value || A.value || J.value || !b.value || !x.orderId) return;
|
|
if (!Mt.value) {
|
|
k.value = I.value
|
|
? N.value && B.value && !T.value
|
|
? `请选择一种方式支付剩余金额`
|
|
: `请选择可用的支付方式`
|
|
: `请先重新获取支付信息`;
|
|
return;
|
|
}
|
|
let e = x.orderId,
|
|
t = X,
|
|
n = T.value,
|
|
r = N.value,
|
|
i = H(z.value),
|
|
a = j.value;
|
|
((D.value = !0), (k.value = ``));
|
|
try {
|
|
if (!(await $(t, e)) || !Z(t, e) || O.value) return;
|
|
if (F.value !== `Unpaid`)
|
|
throw Error(`当前订单状态不支持支付,请刷新订单`);
|
|
if (H(z.value) !== i)
|
|
throw Error(`订单金额已变化,请核对后重新确认支付`);
|
|
if (r) {
|
|
if ((await Lt(t, e), !Z(t, e))) return;
|
|
if (!V.value)
|
|
throw Error(M.value || `当前订单无法使用余额支付`);
|
|
if (j.value !== a)
|
|
throw Error(`可用余额已变化,请核对抵扣金额后重新确认支付`);
|
|
}
|
|
let o = n;
|
|
if (r && j.value >= (H(z.value) ?? 0)) o = `credit`;
|
|
else {
|
|
if (!n) throw Error(`余额不足,请选择一种方式支付剩余金额`);
|
|
if (
|
|
(r || L.value > 0) &&
|
|
(await S.post(`/credit`, {
|
|
id: e,
|
|
use: +!!r,
|
|
}),
|
|
!Z(t, e) || !(await $(t, e)) || !Z(t, e) || O.value)
|
|
)
|
|
return;
|
|
}
|
|
if (!Z(t, e)) return;
|
|
let s = await S.post(
|
|
`/pay`,
|
|
{
|
|
id: e,
|
|
gateway: o,
|
|
},
|
|
!0,
|
|
);
|
|
if (!Z(t, e)) return;
|
|
s.code === `Paid`
|
|
? It()
|
|
: s.data?.html
|
|
? ((E.value = s.data.html),
|
|
(C.value = 2),
|
|
startPaymentPolling(t, e))
|
|
: (k.value = sanitizeMessage(s.msg) || `发起支付失败`);
|
|
} catch (n) {
|
|
if (!Z(t, e)) return;
|
|
((k.value = n instanceof Error ? n.message : `发起支付失败`),
|
|
await Promise.all([
|
|
$(t, e).catch(() => {
|
|
Z(t, e) && (I.value = !1);
|
|
}),
|
|
Lt(t, e),
|
|
]));
|
|
} finally {
|
|
Z(t, e) && (D.value = !1);
|
|
}
|
|
}
|
|
function startPaymentPolling(generation, orderId) {
|
|
stopPaymentPolling();
|
|
const session = {
|
|
identity: S.identity(),
|
|
expiresAt: Date.now() + 5 * 60 * 1000,
|
|
interval: null,
|
|
deadlineTimer: null,
|
|
inFlight: false,
|
|
};
|
|
paymentPoll = session;
|
|
const isCurrent = () =>
|
|
paymentPoll === session &&
|
|
Z(generation, orderId) &&
|
|
S.identity() === session.identity &&
|
|
localStorage.getItem(`jwt`) === session.identity;
|
|
function expire() {
|
|
const current = isCurrent();
|
|
if (paymentPoll === session) stopPaymentPolling();
|
|
if (current) k.value = `支付超时,请关闭后重新发起`;
|
|
}
|
|
async function pollStatus() {
|
|
if (!isCurrent()) {
|
|
if (paymentPoll === session) stopPaymentPolling();
|
|
return;
|
|
}
|
|
if (Date.now() >= session.expiresAt) {
|
|
expire();
|
|
return;
|
|
}
|
|
if (session.inFlight) return;
|
|
session.inFlight = true;
|
|
try {
|
|
const status = await S.getRaw(
|
|
`/pay/${orderId}/status`,
|
|
undefined,
|
|
{
|
|
timeoutMs: Math.max(
|
|
1,
|
|
Math.min(15000, session.expiresAt - Date.now()),
|
|
),
|
|
},
|
|
);
|
|
if (!isCurrent()) return;
|
|
if (Date.now() >= session.expiresAt) {
|
|
expire();
|
|
return;
|
|
}
|
|
if (status.code === `Paid`) It();
|
|
} catch (error) {
|
|
if (!isCurrent()) return;
|
|
if (error instanceof ApiError && error.status === 400) {
|
|
stopPaymentPolling();
|
|
k.value = error.message;
|
|
}
|
|
} finally {
|
|
session.inFlight = false;
|
|
}
|
|
}
|
|
session.deadlineTimer = setTimeout(expire, 5 * 60 * 1000);
|
|
session.interval = setInterval(pollStatus, 2000);
|
|
}
|
|
return (n, a) => {
|
|
let o = NuxtLink,
|
|
c = button,
|
|
d = select,
|
|
_ = message,
|
|
te = dialog;
|
|
return x.inline
|
|
? (openBlock(),
|
|
createElementBlock(`section`, We, [
|
|
(a[26] ||= createElementVNode(`h3`, null, `支付方式`, -1)),
|
|
unref(O)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, Ge, [
|
|
...(a[15] ||= [
|
|
createElementVNode(
|
|
`i`,
|
|
{
|
|
class: `pi pi-check-circle`,
|
|
},
|
|
null,
|
|
-1,
|
|
),
|
|
createElementVNode(`p`, null, `支付成功`, -1),
|
|
]),
|
|
]))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 1,
|
|
},
|
|
[
|
|
createElementVNode(`div`, Ke, [
|
|
(a[16] ||= createTextVNode(` 订单 `, -1)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
`#` + toDisplayString(i.orderId),
|
|
1,
|
|
),
|
|
unref(z) || i.amount
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`span`,
|
|
qe,
|
|
`应付:¥` +
|
|
toDisplayString(
|
|
unref(C) === 2
|
|
? U(unref(R))
|
|
: unref(z) || i.amount,
|
|
),
|
|
1,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
]),
|
|
unref(G)
|
|
? (openBlock(),
|
|
createElementBlock(`p`, Je, [
|
|
unref(K) === null
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 1,
|
|
},
|
|
[
|
|
createTextVNode(
|
|
`代金券已使用,抵扣后金额以订单合计为准。`,
|
|
),
|
|
],
|
|
64,
|
|
))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 0,
|
|
},
|
|
[
|
|
createTextVNode(
|
|
`代金券已抵扣 ¥` +
|
|
toDisplayString(
|
|
unref(K).toFixed(2),
|
|
),
|
|
1,
|
|
),
|
|
],
|
|
64,
|
|
)),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1
|
|
? (openBlock(),
|
|
createElementBlock(`div`, Ye, [
|
|
createElementVNode(
|
|
`section`,
|
|
{
|
|
class: `voucher-row`,
|
|
"aria-label": `代金券`,
|
|
"aria-busy": unref(J),
|
|
},
|
|
[
|
|
createElementVNode(`div`, Ze, [
|
|
(a[18] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`代金券`,
|
|
-1,
|
|
)),
|
|
createVNode(
|
|
o,
|
|
{
|
|
to: `/vouchers`,
|
|
target: `_blank`,
|
|
rel: `noopener`,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
...(a[17] ||= [
|
|
createTextVNode(
|
|
`查看 / 领取代金券`,
|
|
-1,
|
|
),
|
|
createElementVNode(
|
|
`i`,
|
|
{
|
|
class: `pi pi-external-link`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
null,
|
|
-1,
|
|
),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
),
|
|
]),
|
|
unref(I) && !unref(q)
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
Qe,
|
|
`当前订单类型不支持使用代金券`,
|
|
))
|
|
: unref(Y)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, $e, [
|
|
createElementVNode(
|
|
`span`,
|
|
null,
|
|
toDisplayString(unref(Y)),
|
|
1,
|
|
),
|
|
createVNode(
|
|
c,
|
|
{
|
|
label: `重试`,
|
|
text: ``,
|
|
size: `small`,
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J),
|
|
onClick: Bt,
|
|
},
|
|
null,
|
|
8,
|
|
[`disabled`],
|
|
),
|
|
]))
|
|
: unref(A) ||
|
|
unref(J) ||
|
|
unref(W).length
|
|
? (openBlock(),
|
|
createBlock(
|
|
d,
|
|
{
|
|
key: 2,
|
|
modelValue: unref(G),
|
|
"aria-label": `代金券`,
|
|
options: unref(W),
|
|
optionLabel: `code`,
|
|
optionValue: `id`,
|
|
loading: unref(J),
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J) ||
|
|
!unref(W).length,
|
|
placeholder:
|
|
unref(A) || unref(J)
|
|
? `正在加载代金券…`
|
|
: `请选择代金券(可不使用)`,
|
|
showClear: ``,
|
|
class: `voucher-select`,
|
|
onChange: qt,
|
|
},
|
|
{
|
|
option: withCtx(
|
|
({ option: t }) => [
|
|
createElementVNode(
|
|
`div`,
|
|
et,
|
|
[
|
|
createElementVNode(
|
|
`span`,
|
|
null,
|
|
[
|
|
createTextVNode(
|
|
toDisplayString(
|
|
t.code,
|
|
),
|
|
1,
|
|
),
|
|
createElementVNode(
|
|
`span`,
|
|
tt,
|
|
`抵 ¥` +
|
|
toDisplayString(
|
|
t.price,
|
|
),
|
|
1,
|
|
),
|
|
],
|
|
),
|
|
Vt(t)
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`small`,
|
|
nt,
|
|
toDisplayString(
|
|
Vt(t),
|
|
),
|
|
1,
|
|
))
|
|
: createCommentVNode(
|
|
``,
|
|
!0,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
_: 1,
|
|
},
|
|
8,
|
|
[
|
|
`modelValue`,
|
|
`options`,
|
|
`loading`,
|
|
`disabled`,
|
|
`placeholder`,
|
|
],
|
|
))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
rt,
|
|
`本单暂无可用代金券`,
|
|
)),
|
|
unref(q)
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
it,
|
|
`仅展示已领取且符合本单使用条件的代金券。`,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
8,
|
|
Xe,
|
|
),
|
|
(openBlock(!0),
|
|
createElementBlock(
|
|
Fragment,
|
|
null,
|
|
renderList(
|
|
unref(w),
|
|
(t) => (
|
|
openBlock(),
|
|
createElementBlock(
|
|
`button`,
|
|
{
|
|
key: t.id,
|
|
type: `button`,
|
|
class: normalizeClass([
|
|
`gateway-item`,
|
|
{
|
|
active:
|
|
unref(T) === t.name &&
|
|
!unref(N),
|
|
},
|
|
]),
|
|
"aria-pressed":
|
|
unref(T) === t.name && !unref(N),
|
|
disabled:
|
|
unref(D) || unref(A) || unref(J),
|
|
onClick: (e) => Wt(t.name),
|
|
},
|
|
[
|
|
t.url
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`img`,
|
|
{
|
|
key: 0,
|
|
src: t.url,
|
|
alt: ``,
|
|
class: `gateway-icon`,
|
|
},
|
|
null,
|
|
8,
|
|
ot,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(
|
|
`span`,
|
|
st,
|
|
toDisplayString(t.title),
|
|
1,
|
|
),
|
|
unref(T) === t.name && !unref(N)
|
|
? (openBlock(),
|
|
createElementBlock(`i`, ct))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
10,
|
|
at,
|
|
)
|
|
),
|
|
),
|
|
128,
|
|
)),
|
|
createElementVNode(
|
|
`button`,
|
|
{
|
|
type: `button`,
|
|
class: normalizeClass([
|
|
`gateway-item balance-method`,
|
|
{
|
|
active: unref(N),
|
|
},
|
|
]),
|
|
"aria-pressed": unref(N),
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J) ||
|
|
!unref(V),
|
|
onClick: Ut,
|
|
},
|
|
[
|
|
(a[20] ||= createElementVNode(
|
|
`i`,
|
|
{
|
|
class: `pi pi-wallet balance-icon`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
null,
|
|
-1,
|
|
)),
|
|
createElementVNode(`span`, ut, [
|
|
(a[19] ||= createElementVNode(
|
|
`span`,
|
|
{
|
|
class: `balance-title`,
|
|
},
|
|
`余额支付`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`small`,
|
|
null,
|
|
toDisplayString(unref(Nt)),
|
|
1,
|
|
),
|
|
]),
|
|
unref(N)
|
|
? (openBlock(),
|
|
createElementBlock(`i`, dt))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
10,
|
|
lt,
|
|
),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1 && unref(B)
|
|
? (openBlock(),
|
|
createElementBlock(`section`, ft, [
|
|
createElementVNode(`p`, pt, [
|
|
(a[21] ||= createTextVNode(`还需支付 `, -1)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
toDisplayString(U(unref(jt))),
|
|
1,
|
|
),
|
|
(a[22] ||= createTextVNode(` 元`, -1)),
|
|
]),
|
|
createElementVNode(`div`, mt, [
|
|
(openBlock(!0),
|
|
createElementBlock(
|
|
Fragment,
|
|
null,
|
|
renderList(
|
|
unref(w),
|
|
(t) => (
|
|
openBlock(),
|
|
createElementBlock(
|
|
`button`,
|
|
{
|
|
key: t.id,
|
|
type: `button`,
|
|
class: normalizeClass([
|
|
`gateway-item`,
|
|
{
|
|
active: unref(T) === t.name,
|
|
},
|
|
]),
|
|
"aria-pressed": unref(T) === t.name,
|
|
disabled:
|
|
unref(D) || unref(A) || unref(J),
|
|
onClick: (e) => Gt(t.name),
|
|
},
|
|
[
|
|
t.url
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`img`,
|
|
{
|
|
key: 0,
|
|
src: t.url,
|
|
alt: ``,
|
|
class: `gateway-icon`,
|
|
},
|
|
null,
|
|
8,
|
|
gt,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(
|
|
`span`,
|
|
_t,
|
|
toDisplayString(t.title),
|
|
1,
|
|
),
|
|
unref(T) === t.name
|
|
? (openBlock(),
|
|
createElementBlock(`i`, vt))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
10,
|
|
ht,
|
|
)
|
|
),
|
|
),
|
|
128,
|
|
)),
|
|
]),
|
|
unref(w).length
|
|
? createCommentVNode(``, !0)
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
yt,
|
|
`暂无可用的组合支付方式,请稍后重试。`,
|
|
)),
|
|
]))
|
|
: unref(C) === 1 && unref(N)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, bt, [
|
|
createElementVNode(`span`, null, [
|
|
(a[23] ||= createTextVNode(
|
|
`余额抵扣 `,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
`¥` + toDisplayString(U(unref(At))),
|
|
1,
|
|
),
|
|
(a[24] ||= createTextVNode(
|
|
`,余额充足,可全额支付。`,
|
|
-1,
|
|
)),
|
|
]),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1 && !unref(N) && unref(L) > 0
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
xt,
|
|
`本单已选择余额抵扣 ¥` +
|
|
toDisplayString(U(unref(L))) +
|
|
`;确认使用其他方式支付时将取消抵扣。`,
|
|
1,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1 && (!unref(I) || unref(M))
|
|
? (openBlock(),
|
|
createBlock(
|
|
c,
|
|
{
|
|
key: 5,
|
|
label: `重新获取支付信息`,
|
|
severity: `secondary`,
|
|
text: ``,
|
|
loading: unref(A),
|
|
disabled: unref(D) || unref(J),
|
|
onClick: Ht,
|
|
},
|
|
null,
|
|
8,
|
|
[`loading`, `disabled`],
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 2
|
|
? (openBlock(),
|
|
createElementBlock(`div`, St, [
|
|
unref(L) > 0
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
Ct,
|
|
`余额抵扣 ¥` +
|
|
toDisplayString(U(unref(L))) +
|
|
`,剩余待支付 ¥` +
|
|
toDisplayString(U(unref(R))),
|
|
1,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(
|
|
`div`,
|
|
{
|
|
class: `pay-box`,
|
|
innerHTML: unref(E),
|
|
},
|
|
null,
|
|
8,
|
|
wt,
|
|
),
|
|
(a[25] ||= createElementVNode(
|
|
`div`,
|
|
{
|
|
class: `polling-tip`,
|
|
},
|
|
[
|
|
createElementVNode(`i`, {
|
|
class: `pi pi-spin pi-spinner`,
|
|
}),
|
|
createTextVNode(` 等待支付结果…`),
|
|
],
|
|
-1,
|
|
)),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(k)
|
|
? (openBlock(),
|
|
createBlock(
|
|
_,
|
|
{
|
|
key: 7,
|
|
severity: `error`,
|
|
closable: !1,
|
|
class: `msg`,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createTextVNode(
|
|
toDisplayString(unref(k)),
|
|
1,
|
|
),
|
|
]),
|
|
_: 1,
|
|
},
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
64,
|
|
)),
|
|
createElementVNode(`div`, Tt, [
|
|
unref(O)
|
|
? (openBlock(),
|
|
createBlock(c, {
|
|
key: 1,
|
|
label: `完成`,
|
|
onClick: (a[3] ||= (e) => (b.value = !1)),
|
|
}))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 0,
|
|
},
|
|
[
|
|
unref(C) === 1
|
|
? (openBlock(),
|
|
createBlock(
|
|
c,
|
|
{
|
|
key: 0,
|
|
label: `确认支付`,
|
|
icon: `pi pi-check`,
|
|
loading: unref(D),
|
|
disabled: !unref(Mt),
|
|
onClick: Jt,
|
|
},
|
|
null,
|
|
8,
|
|
[`loading`, `disabled`],
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
64,
|
|
)),
|
|
]),
|
|
]))
|
|
: (openBlock(),
|
|
createBlock(
|
|
te,
|
|
{
|
|
key: 0,
|
|
visible: b.value,
|
|
"onUpdate:visible": (a[2] ||= (e) => (b.value = e)),
|
|
header: `订单支付`,
|
|
modal: ``,
|
|
draggable: !1,
|
|
style: {
|
|
width: `min(480px, calc(100vw - 28px))`,
|
|
},
|
|
},
|
|
{
|
|
footer: withCtx(() => [
|
|
unref(O)
|
|
? (openBlock(),
|
|
createBlock(c, {
|
|
key: 1,
|
|
label: `完成`,
|
|
onClick: (a[1] ||= (e) => (b.value = !1)),
|
|
}))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 0,
|
|
},
|
|
[
|
|
createVNode(c, {
|
|
label: `取消`,
|
|
severity: `secondary`,
|
|
text: ``,
|
|
onClick: (a[0] ||= (e) => (b.value = !1)),
|
|
}),
|
|
unref(C) === 1
|
|
? (openBlock(),
|
|
createBlock(
|
|
c,
|
|
{
|
|
key: 0,
|
|
label: `确认支付`,
|
|
icon: `pi pi-check`,
|
|
loading: unref(D),
|
|
disabled: !unref(Mt),
|
|
onClick: Jt,
|
|
},
|
|
null,
|
|
8,
|
|
[`loading`, `disabled`],
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
64,
|
|
)),
|
|
]),
|
|
default: withCtx(() => [
|
|
unref(O)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, ue, [
|
|
...(a[4] ||= [
|
|
createElementVNode(
|
|
`i`,
|
|
{
|
|
class: `pi pi-check-circle`,
|
|
},
|
|
null,
|
|
-1,
|
|
),
|
|
createElementVNode(`p`, null, `支付成功`, -1),
|
|
]),
|
|
]))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 1,
|
|
},
|
|
[
|
|
createElementVNode(`div`, de, [
|
|
(a[5] ||= createTextVNode(` 订单 `, -1)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
`#` + toDisplayString(i.orderId),
|
|
1,
|
|
),
|
|
unref(z) || i.amount
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`span`,
|
|
fe,
|
|
`应付:¥` +
|
|
toDisplayString(
|
|
unref(C) === 2
|
|
? U(unref(R))
|
|
: unref(z) || i.amount,
|
|
),
|
|
1,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
]),
|
|
unref(G)
|
|
? (openBlock(),
|
|
createElementBlock(`p`, pe, [
|
|
unref(K) === null
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 1,
|
|
},
|
|
[
|
|
createTextVNode(
|
|
`代金券已使用,抵扣后金额以订单合计为准。`,
|
|
),
|
|
],
|
|
64,
|
|
))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
Fragment,
|
|
{
|
|
key: 0,
|
|
},
|
|
[
|
|
createTextVNode(
|
|
`代金券已抵扣 ¥` +
|
|
toDisplayString(
|
|
unref(K).toFixed(2),
|
|
),
|
|
1,
|
|
),
|
|
],
|
|
64,
|
|
)),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1
|
|
? (openBlock(),
|
|
createElementBlock(`div`, me, [
|
|
createElementVNode(
|
|
`section`,
|
|
{
|
|
class: `voucher-row`,
|
|
"aria-label": `代金券`,
|
|
"aria-busy": unref(J),
|
|
},
|
|
[
|
|
createElementVNode(`div`, ge, [
|
|
(a[7] ||= createElementVNode(
|
|
`span`,
|
|
null,
|
|
`代金券`,
|
|
-1,
|
|
)),
|
|
createVNode(
|
|
o,
|
|
{
|
|
to: `/vouchers`,
|
|
target: `_blank`,
|
|
rel: `noopener`,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
...(a[6] ||= [
|
|
createTextVNode(
|
|
`查看 / 领取代金券`,
|
|
-1,
|
|
),
|
|
createElementVNode(
|
|
`i`,
|
|
{
|
|
class: `pi pi-external-link`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
null,
|
|
-1,
|
|
),
|
|
]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
),
|
|
]),
|
|
unref(I) && !unref(q)
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
_e,
|
|
`当前订单类型不支持使用代金券`,
|
|
))
|
|
: unref(Y)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, ve, [
|
|
createElementVNode(
|
|
`span`,
|
|
null,
|
|
toDisplayString(unref(Y)),
|
|
1,
|
|
),
|
|
createVNode(
|
|
c,
|
|
{
|
|
label: `重试`,
|
|
text: ``,
|
|
size: `small`,
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J),
|
|
onClick: Bt,
|
|
},
|
|
null,
|
|
8,
|
|
[`disabled`],
|
|
),
|
|
]))
|
|
: unref(A) ||
|
|
unref(J) ||
|
|
unref(W).length
|
|
? (openBlock(),
|
|
createBlock(
|
|
d,
|
|
{
|
|
key: 2,
|
|
modelValue: unref(G),
|
|
"aria-label": `代金券`,
|
|
options: unref(W),
|
|
optionLabel: `code`,
|
|
optionValue: `id`,
|
|
loading: unref(J),
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J) ||
|
|
!unref(W).length,
|
|
placeholder:
|
|
unref(A) || unref(J)
|
|
? `正在加载代金券…`
|
|
: `请选择代金券(可不使用)`,
|
|
showClear: ``,
|
|
class: `voucher-select`,
|
|
onChange: qt,
|
|
},
|
|
{
|
|
option: withCtx(
|
|
({ option: t }) => [
|
|
createElementVNode(
|
|
`div`,
|
|
ye,
|
|
[
|
|
createElementVNode(
|
|
`span`,
|
|
null,
|
|
[
|
|
createTextVNode(
|
|
toDisplayString(
|
|
t.code,
|
|
),
|
|
1,
|
|
),
|
|
createElementVNode(
|
|
`span`,
|
|
be,
|
|
`抵 ¥` +
|
|
toDisplayString(
|
|
t.price,
|
|
),
|
|
1,
|
|
),
|
|
],
|
|
),
|
|
Vt(t)
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`small`,
|
|
xe,
|
|
toDisplayString(
|
|
Vt(t),
|
|
),
|
|
1,
|
|
))
|
|
: createCommentVNode(
|
|
``,
|
|
!0,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
_: 1,
|
|
},
|
|
8,
|
|
[
|
|
`modelValue`,
|
|
`options`,
|
|
`loading`,
|
|
`disabled`,
|
|
`placeholder`,
|
|
],
|
|
))
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
Se,
|
|
`本单暂无可用代金券`,
|
|
)),
|
|
unref(q)
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
Ce,
|
|
`仅展示已领取且符合本单使用条件的代金券。`,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
8,
|
|
he,
|
|
),
|
|
(openBlock(!0),
|
|
createElementBlock(
|
|
Fragment,
|
|
null,
|
|
renderList(
|
|
unref(w),
|
|
(t) => (
|
|
openBlock(),
|
|
createElementBlock(
|
|
`button`,
|
|
{
|
|
key: t.id,
|
|
type: `button`,
|
|
class: normalizeClass([
|
|
`gateway-item`,
|
|
{
|
|
active:
|
|
unref(T) === t.name &&
|
|
!unref(N),
|
|
},
|
|
]),
|
|
"aria-pressed":
|
|
unref(T) === t.name &&
|
|
!unref(N),
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J),
|
|
onClick: (e) => Wt(t.name),
|
|
},
|
|
[
|
|
t.url
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`img`,
|
|
{
|
|
key: 0,
|
|
src: t.url,
|
|
alt: ``,
|
|
class: `gateway-icon`,
|
|
},
|
|
null,
|
|
8,
|
|
Te,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(
|
|
`span`,
|
|
Ee,
|
|
toDisplayString(t.title),
|
|
1,
|
|
),
|
|
unref(T) === t.name && !unref(N)
|
|
? (openBlock(),
|
|
createElementBlock(`i`, De))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
10,
|
|
we,
|
|
)
|
|
),
|
|
),
|
|
128,
|
|
)),
|
|
createElementVNode(
|
|
`button`,
|
|
{
|
|
type: `button`,
|
|
class: normalizeClass([
|
|
`gateway-item balance-method`,
|
|
{
|
|
active: unref(N),
|
|
},
|
|
]),
|
|
"aria-pressed": unref(N),
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J) ||
|
|
!unref(V),
|
|
onClick: Ut,
|
|
},
|
|
[
|
|
(a[9] ||= createElementVNode(
|
|
`i`,
|
|
{
|
|
class: `pi pi-wallet balance-icon`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
null,
|
|
-1,
|
|
)),
|
|
createElementVNode(`span`, ke, [
|
|
(a[8] ||= createElementVNode(
|
|
`span`,
|
|
{
|
|
class: `balance-title`,
|
|
},
|
|
`余额支付`,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`small`,
|
|
null,
|
|
toDisplayString(unref(Nt)),
|
|
1,
|
|
),
|
|
]),
|
|
unref(N)
|
|
? (openBlock(),
|
|
createElementBlock(`i`, Ae))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
10,
|
|
Oe,
|
|
),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1 && unref(B)
|
|
? (openBlock(),
|
|
createElementBlock(`section`, je, [
|
|
createElementVNode(`p`, Me, [
|
|
(a[10] ||= createTextVNode(
|
|
`还需支付 `,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
toDisplayString(U(unref(jt))),
|
|
1,
|
|
),
|
|
(a[11] ||= createTextVNode(` 元`, -1)),
|
|
]),
|
|
createElementVNode(`div`, Ne, [
|
|
(openBlock(!0),
|
|
createElementBlock(
|
|
Fragment,
|
|
null,
|
|
renderList(
|
|
unref(w),
|
|
(t) => (
|
|
openBlock(),
|
|
createElementBlock(
|
|
`button`,
|
|
{
|
|
key: t.id,
|
|
type: `button`,
|
|
class: normalizeClass([
|
|
`gateway-item`,
|
|
{
|
|
active: unref(T) === t.name,
|
|
},
|
|
]),
|
|
"aria-pressed":
|
|
unref(T) === t.name,
|
|
disabled:
|
|
unref(D) ||
|
|
unref(A) ||
|
|
unref(J),
|
|
onClick: (e) => Gt(t.name),
|
|
},
|
|
[
|
|
t.url
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`img`,
|
|
{
|
|
key: 0,
|
|
src: t.url,
|
|
alt: ``,
|
|
class: `gateway-icon`,
|
|
},
|
|
null,
|
|
8,
|
|
Fe,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(
|
|
`span`,
|
|
Ie,
|
|
toDisplayString(t.title),
|
|
1,
|
|
),
|
|
unref(T) === t.name
|
|
? (openBlock(),
|
|
createElementBlock(`i`, Le))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
10,
|
|
Pe,
|
|
)
|
|
),
|
|
),
|
|
128,
|
|
)),
|
|
]),
|
|
unref(w).length
|
|
? createCommentVNode(``, !0)
|
|
: (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
Re,
|
|
`暂无可用的组合支付方式,请稍后重试。`,
|
|
)),
|
|
]))
|
|
: unref(C) === 1 && unref(N)
|
|
? (openBlock(),
|
|
createElementBlock(`div`, ze, [
|
|
createElementVNode(`span`, null, [
|
|
(a[12] ||= createTextVNode(
|
|
`余额抵扣 `,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`b`,
|
|
null,
|
|
`¥` + toDisplayString(U(unref(At))),
|
|
1,
|
|
),
|
|
(a[13] ||= createTextVNode(
|
|
`,余额充足,可全额支付。`,
|
|
-1,
|
|
)),
|
|
]),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1 && !unref(N) && unref(L) > 0
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
Be,
|
|
`本单已选择余额抵扣 ¥` +
|
|
toDisplayString(U(unref(L))) +
|
|
`;确认使用其他方式支付时将取消抵扣。`,
|
|
1,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 1 && (!unref(I) || unref(M))
|
|
? (openBlock(),
|
|
createBlock(
|
|
c,
|
|
{
|
|
key: 5,
|
|
label: `重新获取支付信息`,
|
|
severity: `secondary`,
|
|
text: ``,
|
|
loading: unref(A),
|
|
disabled: unref(D) || unref(J),
|
|
onClick: Ht,
|
|
},
|
|
null,
|
|
8,
|
|
[`loading`, `disabled`],
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
unref(C) === 2
|
|
? (openBlock(),
|
|
createElementBlock(`div`, Ve, [
|
|
unref(L) > 0
|
|
? (openBlock(),
|
|
createElementBlock(
|
|
`p`,
|
|
He,
|
|
`余额抵扣 ¥` +
|
|
toDisplayString(U(unref(L))) +
|
|
`,剩余待支付 ¥` +
|
|
toDisplayString(U(unref(R))),
|
|
1,
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
createElementVNode(
|
|
`div`,
|
|
{
|
|
class: `pay-box`,
|
|
innerHTML: unref(E),
|
|
},
|
|
null,
|
|
8,
|
|
Ue,
|
|
),
|
|
(a[14] ||= createElementVNode(
|
|
`div`,
|
|
{
|
|
class: `polling-tip`,
|
|
},
|
|
[
|
|
createElementVNode(`i`, {
|
|
class: `pi pi-spin pi-spinner`,
|
|
}),
|
|
createTextVNode(` 等待支付结果…`),
|
|
],
|
|
-1,
|
|
)),
|
|
]))
|
|
: createCommentVNode(``, !0),
|
|
unref(k)
|
|
? (openBlock(),
|
|
createBlock(
|
|
_,
|
|
{
|
|
key: 7,
|
|
severity: `error`,
|
|
closable: !1,
|
|
class: `msg`,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createTextVNode(
|
|
toDisplayString(unref(k)),
|
|
1,
|
|
),
|
|
]),
|
|
_: 1,
|
|
},
|
|
))
|
|
: createCommentVNode(``, !0),
|
|
],
|
|
64,
|
|
)),
|
|
]),
|
|
_: 1,
|
|
},
|
|
8,
|
|
[`visible`],
|
|
));
|
|
};
|
|
},
|
|
}),
|
|
[[`__scopeId`, `data-v-4931e21e`]],
|
|
),
|
|
{
|
|
__name: `PaymentDialog`,
|
|
},
|
|
);
|
|
export {};
|
|
export default x;
|
|
</script>
|