支付宝优化

This commit is contained in:
GaoHao
2024-10-29 18:27:43 +08:00
parent a868117cda
commit b2abe69e37
10 changed files with 89 additions and 42 deletions

29
App.vue
View File

@@ -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>