支付宝优化

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

View File

@@ -134,11 +134,17 @@
timer: null //定时器
};
},
onLoad(e) {
onLoad(options) {
// 隐藏首页按钮
if (e.q) {
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
// #ifdef MP-WEIXIN
if (options.q) {
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
}
// #endif
// #ifdef MP-ALIPAY
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
// #endif
},
computed: {},

View File

@@ -121,33 +121,35 @@
type: "",
}
},
async onLoad(e) {
async onLoad(options) {
// if ( e.type == 'list' || e.type == 'index') {
// this.shopId = e.shopId;
// this.init();
// }
console.log(e)
uni.cache.set('forceUpdate',1)
if (e.q) {
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
// #ifdef MP-WEIXIN
if (options.q) {
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
uni.cache.set('shopId',this.shopId)
this.tokenShow = false;
// 等待登录结果返回
// if (!uni.cache.get('token')) {
// await this.$onLaunched;
// }
this.shopInfo();
this.paygetActive()
} else{
this.shopId = e.shopId;
this.type = e.type;
if ( e.amount ) { this.amount = e.amount; }
uni.cache.set('shopId',this.shopId)
this.shopInfo();
this.paygetActive()
}
// #endif
// #ifdef MP-ALIPAY
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
uni.cache.set('shopId',this.shopId)
// #endif
if (options.shopId) {
this.shopId = options.shopId
uni.cache.set('shopId',this.shopId)
}
if (options.type) {
this.type = options.type
}
if ( options.amount ) { this.amount = options.amount; }
this.shopInfo();
this.paygetActive()
},
methods: {
/**

View File

@@ -374,6 +374,7 @@
shopExtend: null,
shopId: "",
tableCode: "",
orderAMeal: true,
}
},
onPageScroll(e) {
@@ -402,16 +403,24 @@
this.$store.getters.is_BarHeight.customBar)
}
},
onLoad(e) {
if (e.q) {
this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
onLoad(options) {
// #ifdef MP-WEIXIN
if (options.q) {
this.tableCode = this.getQueryString(decodeURIComponent(options.q), 'code')
uni.cache.set('tableCode', this.tableCode)
}
if ( e.shopId ) {
this.shopId = e.shopId
// #endif
// #ifdef MP-ALIPAY
if (getApp().globalData.tableCode) {
this.tableCode = getApp().globalData.tableCode
uni.cache.set('tableCode', this.tableCode)
}
if ( e.tableCode ) {
this.tableCode = e.tableCode
// #endif
if ( options.shopId ) {
this.shopId = options.shopId
}
if ( options.tableCode ) {
this.tableCode = options.tableCode
}
},
@@ -431,7 +440,9 @@
},
async onShow() {
let _this = this;
if (!this.orderAMeal){
uni.pro.switchTab('index/index')
}
this.$nextTick(() => {
uni.pageScrollTo({
scrollTop: 0,
@@ -539,7 +550,8 @@
if (this.shopId) {params.shopId = this.shopId}
let res = await this.api.productqueryShop(params)
if (res.code == 0) {
if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount) {
if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount&&this.orderAMeal) {
this.orderAMeal = false;
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
tableCode: this.tableCode,
shopId: res.data.storeInfo.id,

View File

@@ -40,7 +40,7 @@
textMargin: 14
},
qrcodeSize: 400,
createcardNo: '4637700074809642',
createcardNo: '',
shopInfo: null
};
},