支付宝优化
This commit is contained in:
29
App.vue
29
App.vue
@@ -4,9 +4,25 @@
|
||||
import Api from '@/common/js/api.js'
|
||||
export default {
|
||||
globalData: {
|
||||
systemInfo: null
|
||||
systemInfo: null,
|
||||
tableCode: null,
|
||||
shopId: null,
|
||||
queueId: null,
|
||||
},
|
||||
onLaunch: function() {
|
||||
onLaunch: function(options) {
|
||||
console.log(3333)
|
||||
console.log(options)
|
||||
if ( options.query.qrCode ) {
|
||||
if (this.getQueryString(options.query.qrCode, 'code')) {
|
||||
this.globalData.tableCode = this.getQueryString(options.query.qrCode, 'code')
|
||||
}
|
||||
if (this.getQueryString(options.query.qrCode, 'shopId')) {
|
||||
this.globalData.shopId = this.getQueryString(options.query.qrCode, 'shopId')
|
||||
}
|
||||
if (this.getQueryString(options.query.qrCode, 'queueId')) {
|
||||
this.globalData.queueId = this.getQueryString(options.query.qrCode, 'queueId')
|
||||
}
|
||||
}
|
||||
if ( uni.getStorageSync("NAME") && !uni.getStorageSync("NAME").data) {
|
||||
uni.cache.clear();
|
||||
}
|
||||
@@ -68,7 +84,14 @@
|
||||
// console.log('App Hide');
|
||||
},
|
||||
methods: {
|
||||
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user