源文件
This commit is contained in:
59
jeepay-ui-uapp-cashier/App.vue
Normal file
59
jeepay-ui-uapp-cashier/App.vue
Normal file
@@ -0,0 +1,59 @@
|
||||
<script>
|
||||
import appConfig from '@/config/appConfig.js';
|
||||
import { setToken, setPageType, setLiteToken, getExtStoreId } from '@/util/jeepayTokenUtil.js';
|
||||
|
||||
export default {
|
||||
onLaunch: function (options) {
|
||||
// #ifdef MP-WEIXIN
|
||||
getExtStoreId();
|
||||
// #endif
|
||||
setPageType();
|
||||
|
||||
if(appConfig.currentPageType == 'alipayLite'){
|
||||
uni.setStorageSync('alipayLiteRoute', JSON.stringify(options.query)) // 改变存储
|
||||
}
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
if(appConfig.currentPageType == 'alipayLite'){
|
||||
uni.setStorageSync('alipayLiteRoute', JSON.stringify(options.query)) // 改变存储
|
||||
}
|
||||
},
|
||||
onShow: function (options) {
|
||||
// uni.showToast({title:"刷新:" +JSON.stringify(options.query),icon:'none',duration:3000})
|
||||
if(appConfig.currentPageType == 'alipayLite'){
|
||||
uni.setStorageSync('alipayLiteRoute', JSON.stringify(options.query)) // 改变存储
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
getExtStoreId();
|
||||
// #endif
|
||||
// 每次小程序打开前台页面,都需要此设置才能渲染顶部颜色
|
||||
setPageType();
|
||||
|
||||
if (appConfig.currentPageType == appConfig.PAGE_TYPE_ENUM.WECHAT_LITE) {
|
||||
appConfig.scene = options.scene;
|
||||
}
|
||||
|
||||
// onLaunch == > 迁移到 onShow ( 在onLaunch 存在: 第一次 app调起支付宝小程序没有问题, 第二次提示状态不正确(token为旧的) )
|
||||
if (appConfig.currentPageType == appConfig.PAGE_TYPE_ENUM.ALIPAY_LITE) {
|
||||
let query = options.query || {};
|
||||
if (options.referrerInfo && options.referrerInfo.extraData) {
|
||||
query = Object.assign(query, options.referrerInfo.extraData);
|
||||
}
|
||||
|
||||
if (query.qrCode) {
|
||||
setLiteToken(query.qrCode);
|
||||
}
|
||||
}
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*每个页面公共css */
|
||||
@import './static/css/public.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user