|
@@ -9,7 +9,8 @@ import QrcodeVue from 'qrcode.vue'
|
|
|
import { show, showConfirm } from '@/components/Toast'
|
|
|
import { openPay, queryOrderStatus, getOrderInfo } from '@/api/api'
|
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
|
-import { GetRequest } from '@/utils/index'
|
|
|
+import { GetRequest, getRemark } from '@/utils/index'
|
|
|
+import { paysidtype } from '@/utils/status'
|
|
|
import { getCurrentInstance } from 'vue'
|
|
|
|
|
|
//得到i18n的locale token, info,
|
|
@@ -19,11 +20,7 @@ const route = useRoute()
|
|
|
const { isEur, info } = useUserStore()
|
|
|
const orderSn = ref(route.query.id || GetRequest('orderSn'))
|
|
|
let { $cdn } = getCurrentInstance()?.proxy
|
|
|
-let PAYSID = {
|
|
|
- wechatPay: 0,
|
|
|
- alipay: 1,
|
|
|
- paypal: 2
|
|
|
-}
|
|
|
+
|
|
|
const selectedPayType = ref(isEur ? 'paypal' : 'alipay')
|
|
|
watch(selectedPayType, () => {
|
|
|
getCode()
|
|
@@ -36,7 +33,6 @@ const response = ref({
|
|
|
})
|
|
|
onMounted(() => {
|
|
|
getDetial()
|
|
|
- getCode()
|
|
|
})
|
|
|
|
|
|
function inverRequest() {
|
|
@@ -77,6 +73,7 @@ async function handleQueryOrderStatus() {
|
|
|
function getDetial() {
|
|
|
getOrderInfo(orderSn.value).then((res) => {
|
|
|
orderDetal.value = res
|
|
|
+ getCode()
|
|
|
})
|
|
|
}
|
|
|
function handlePay() {
|
|
@@ -84,14 +81,10 @@ function handlePay() {
|
|
|
}
|
|
|
async function getCode() {
|
|
|
qrCodeUrl.value = ''
|
|
|
- let paysidtype = {
|
|
|
- wechatPay: 2,
|
|
|
- alipay: 3,
|
|
|
- paypal: 5
|
|
|
- }
|
|
|
openPay({
|
|
|
orderSn: orderSn.value,
|
|
|
payType: paysidtype[selectedPayType.value],
|
|
|
+ productName: getRemark(orderDetal.value.goodsInfo, orderDetal.value.orderType, t),
|
|
|
openId: ''
|
|
|
}).then((res) => {
|
|
|
qrCodeUrl.value = res.qrCodeUrl || res.redirect
|
|
@@ -209,7 +202,22 @@ async function getCode() {
|
|
|
/>
|
|
|
<h-icon type="vip_true" class="select-icon"></h-icon>
|
|
|
<img src="@/assets/images/vip_true.svg" class="t-click" alt />
|
|
|
- <!-- paypal -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="isEur"
|
|
|
+ class="pay-type paypal-pay"
|
|
|
+ @click="selectedPayType = 'stripe'"
|
|
|
+ :class="{ 'is-active': selectedPayType === 'stripe' }"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ style="height: 26px; width: 62px"
|
|
|
+ src="@/assets/images/stripe.png"
|
|
|
+ class="t-icon"
|
|
|
+ alt
|
|
|
+ />
|
|
|
+ <h-icon type="vip_true" class="select-icon"></h-icon>
|
|
|
+ <img src="@/assets/images/vip_true.svg" class="t-click" alt />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="pay-info">
|