|
@@ -3,10 +3,12 @@ import { showConfirm } from '@/components/Toast'
|
|
import { ref, computed, onMounted } from 'vue'
|
|
import { ref, computed, onMounted } from 'vue'
|
|
import { useUserStore } from '@/stores/user'
|
|
import { useUserStore } from '@/stores/user'
|
|
import { openPay, getOrderInfo } from '@/api/api'
|
|
import { openPay, getOrderInfo } from '@/api/api'
|
|
|
|
+import { useRoute } from 'vue-router';
|
|
import { GetRequest } from '@/utils/index'
|
|
import { GetRequest } from '@/utils/index'
|
|
const payType = ref('0')
|
|
const payType = ref('0')
|
|
-const orderSn = ref(GetRequest('orderSn'))
|
|
|
|
|
|
+const route = useRoute()
|
|
const orderDetal = ref({})
|
|
const orderDetal = ref({})
|
|
|
|
+const orderSn = ref(route.params.id || GetRequest('orderSn'))
|
|
const is_weixn = computed(() => {
|
|
const is_weixn = computed(() => {
|
|
if (typeof WeixinJSBridge == 'undefined') {
|
|
if (typeof WeixinJSBridge == 'undefined') {
|
|
return false
|
|
return false
|
|
@@ -26,17 +28,24 @@ onMounted(() => {
|
|
const { token, info, isEur } = useUserStore()
|
|
const { token, info, isEur } = useUserStore()
|
|
async function handelPay() {
|
|
async function handelPay() {
|
|
let apiData = {
|
|
let apiData = {
|
|
- orderSn: GetRequest('orderSn'),
|
|
|
|
|
|
+ orderSn: orderSn.value,
|
|
payType: !is_weixn.value ? '1' : payType.value,
|
|
payType: !is_weixn.value ? '1' : payType.value,
|
|
openId: 'dolor exercitation velit'
|
|
openId: 'dolor exercitation velit'
|
|
}
|
|
}
|
|
- const res = await openPay(apiData)
|
|
|
|
- console.log('apiData', res)
|
|
|
|
|
|
+ // const res = await openPay(apiData)
|
|
|
|
+ // console.log('apiData', res)
|
|
if (is_weixn.value) {
|
|
if (is_weixn.value) {
|
|
//微信内支付
|
|
//微信内支付
|
|
onBridgeReady(res)
|
|
onBridgeReady(res)
|
|
} else {
|
|
} else {
|
|
- window.location.href = res.form || res.h5Url
|
|
|
|
|
|
+ showConfirm({
|
|
|
|
+ text: '成功了',
|
|
|
|
+ type: 'warn',
|
|
|
|
+ callback: (val) => {
|
|
|
|
+ console.log('我的测试计划', val)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // window.location.href = res.form || res.h5Url
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 调微信支付
|
|
// 调微信支付
|