|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
globalData: {
|
|
|
|
//正式
|
|
|
|
// url: 'https://pay.bxb.cn/crest',
|
|
|
|
// imgUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com',
|
|
|
|
//测试
|
|
|
|
// url: 'https://paycs.dctpay.com/crest',
|
|
|
|
// imgUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com',
|
|
|
|
userInfo: "",
|
|
|
|
openId: '',
|
|
|
|
token: '',
|
|
|
|
appId: 'wxa075e8509802f826',
|
|
|
|
code: '', //code获取openid
|
|
|
|
snNo: '', // 设备sn号
|
|
|
|
platformType: '', //区分平台
|
|
|
|
//正式
|
|
|
|
url: 'https://hsg.dctpay.com/user',
|
|
|
|
graurl: 'https://pay.dctpay.com/crest',
|
|
|
|
imgUrl: 'https://pay.dctpay.com/filesystem/',
|
|
|
|
imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/',
|
|
|
|
//测试
|
|
|
|
// url: 'https://hsgcs.dctpay.com/user',
|
|
|
|
// graurl:'https://gratia-pay.dctpay.com/crest',
|
|
|
|
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
|
|
|
|
// imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/',
|
|
|
|
},
|
|
|
|
onLaunch: function() {
|
|
|
|
|
|
|
|
},
|
|
|
|
onShow: function() {
|
|
|
|
console.log('App Show')
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
var userAgent = navigator.userAgent.toLowerCase();
|
|
|
|
if (userAgent.match(/Alipay/i) == "alipay") {
|
|
|
|
that.globalData.platformType = 'ALIPAY';
|
|
|
|
} else if (userAgent.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
|
that.globalData.platformType = 'WECHAT';
|
|
|
|
} else {
|
|
|
|
that.globalData.platformType = 'UQRCODEPAY';
|
|
|
|
}
|
|
|
|
|
|
|
|
uni.getStorage({
|
|
|
|
key: 'openId',
|
|
|
|
success(e) {
|
|
|
|
if (e.data) {
|
|
|
|
that.globalData.openId = e.data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
uni.getStorage({
|
|
|
|
key: 'user',
|
|
|
|
success(e) {
|
|
|
|
if (e.data) {
|
|
|
|
that.globalData.userInfo = e.data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
uni.getStorage({
|
|
|
|
key: 'token',
|
|
|
|
success(e) {
|
|
|
|
if (e.data) {
|
|
|
|
that.globalData.token = e.data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
onHide: function() {
|
|
|
|
console.log('App Hide')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
/*每个页面公共css */
|
|
|
|
</style>
|