源文件
This commit is contained in:
42
jeepay-ui-uapp-cashier/pages/hub/h5.vue
Normal file
42
jeepay-ui-uapp-cashier/pages/hub/h5.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<view></view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import { setToken } from '@/util/jeepayTokenUtil.js'
|
||||
import { $getRedirectUrl } from '@/http/apiManager.js'
|
||||
import navigateUtil from '@/util/navigateUtil.js'
|
||||
import storageManage from '@/util/storageManage.js'
|
||||
import { onMounted } from 'vue'
|
||||
import { navigateTo } from "@/util/member.js"
|
||||
|
||||
// uniapp 的钩子事件(同步), 一般用作获取到页面传参
|
||||
// 通用放置token & 如果获取异常 将跳转到错误页面;
|
||||
onLoad( (toPageParams) => setToken(toPageParams) )
|
||||
|
||||
// vue的挂载钩子
|
||||
onMounted( (opt) => {
|
||||
$getRedirectUrl().then( ({bizData}) => {
|
||||
// 如果缓存包含该渠道用户ID, 那么直接跳转。
|
||||
if(bizData.channelUserIdCacheKey && storageManage.channelUserId(bizData.channelUserIdCacheKey)){
|
||||
navigateTo(storageManage.channelUserId(bizData.channelUserIdCacheKey))
|
||||
return false
|
||||
}
|
||||
// 需要重定向
|
||||
if(bizData.redirectFlag){
|
||||
location.href = bizData.redirectUrl
|
||||
return false;
|
||||
}else{ // 无需获取
|
||||
navigateUtil.redirectTo('/pages/payway/index') // 跳转到输入金额 页面;
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user