+
{{ aggregateInfo.config.name || '微信收银台' }}
- 付款金额
+ 金额
¥ {{ aggregateInfo.order.amount || 0.00 }}
+
@@ -20,10 +21,10 @@
import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
-import { AggregateTypeEnum } from '@/enums/daxpay/DaxPayEnum'
+import { CheckoutAggregateEnum } from '@/enums/daxpay/DaxPayEnum'
import router from '@/router'
-import type {
- AggregateOrderAndConfigResult,
+import {
+ AggregateOrderAndConfigResult, aggregatePay, CheckoutAggregatePayParam,
CheckoutAuthCodeParam,
CheckoutPayParam,
} from '@/views/daxpay/checkout/CheckoutPay.api'
@@ -42,7 +43,8 @@ const openId = ref
('')
// 认证参数
const authParam = ref({
- aggregateType: AggregateTypeEnum.WECHAT,
+ orderNo: orderNo as string,
+ aggregateType: CheckoutAggregateEnum.WECHAT,
})
const aggregateInfo = ref({
@@ -62,7 +64,7 @@ function init() {
// 如果不是重定向跳转过来, 跳转到到重定向授权地址
if (!authCode) {
// 重定向跳转到微信授权地址
- generateAuthUrl({ orderNo: orderNo as string, aggregateType: AggregateTypeEnum.WECHAT }).then((res) => {
+ generateAuthUrl({ orderNo: orderNo as string, aggregateType: CheckoutAggregateEnum.WECHAT }).then((res) => {
const url = res.data
location.replace(url)
}).catch((res) => {
@@ -82,7 +84,7 @@ function init() {
async function initData() {
show.value = true
// 获取聚合配置
- getAggregateConfig(orderNo, AggregateTypeEnum.WECHAT).then(({ data }) => {
+ getAggregateConfig(orderNo, CheckoutAggregateEnum.WECHAT).then(({ data }) => {
aggregateInfo.value = data
}).catch((res) => {
router.push({ name: 'ErrorResult', query: { msg: res.message } })
@@ -107,9 +109,10 @@ function pay() {
loading.value = true
const from = {
orderNo: orderNo as string,
+ aggregateType: CheckoutAggregateEnum.WECHAT,
openId: openId.value,
- } as CheckoutPayParam
- checkoutPay(from)
+ } as CheckoutAggregatePayParam
+ aggregatePay(from)
.then(({ data }) => {
loading.value = false
// 拉起jsapi支付
@@ -141,5 +144,30 @@ function jsapiPay(data: WxJsapiSignResult) {