广告弹窗相关更新

This commit is contained in:
GaoHao
2024-08-28 17:07:13 +08:00
parent 244e7bc736
commit c2ff506543
8 changed files with 19 additions and 8 deletions

View File

@@ -53,6 +53,7 @@
}, },
watch: { watch: {
forceUpdate(val,oldval) { forceUpdate(val,oldval) {
console.log(val,oldval)
// 在 forceUpdate 改变时执行更新操作 // 在 forceUpdate 改变时执行更新操作
let time = uni.cache.get('popUpTime') ? new Date().getTime() - uni.cache.get('popUpTime') : 1000; let time = uni.cache.get('popUpTime') ? new Date().getTime() - uni.cache.get('popUpTime') : 1000;
if ( time >= 1000 ) { if ( time >= 1000 ) {

View File

@@ -338,7 +338,6 @@
}, },
async onShow() { async onShow() {
// 判断显示那个页面 // 判断显示那个页面
if (uni.cache.get('shopUser') && uni.cache.get('token')) { if (uni.cache.get('shopUser') && uni.cache.get('token')) {
this.showindex = false this.showindex = false
uni.cache.set('types', 'index'); uni.cache.set('types', 'index');
@@ -351,10 +350,9 @@
uni.cache.set('shopUserInfo',this.usershopUserinfo) uni.cache.set('shopUserInfo',this.usershopUserinfo)
} }
this.loginwxuserInfo() //个人信息接口 this.loginwxuserInfo() //个人信息接口
if ( !uni.cache.get('forceUpdate') ) { if ( uni.cache.get('forceUpdate') == 1) {
this.forceUpdate = !this.forceUpdate; this.forceUpdate = !this.forceUpdate;
} }
uni.cache.set('forceUpdate',false)
this.getShopExtend() this.getShopExtend()
this.timersetInterval = '0' this.timersetInterval = '0'
} else { } else {

View File

@@ -62,18 +62,22 @@
methods: { methods: {
scanCodehandle(i) { scanCodehandle(i) {
console.log(1) console.log(1)
setTimeout(()=>{
uni.cache.set('forceUpdate',2)
},200)
if (i == 0) { if (i == 0) {
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code') let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
uni.cache.set('tableCode', tableCode) uni.cache.set('tableCode', tableCode)
if (tableCode) { if (tableCode) {
uni.cache.set('forceUpdate',true)
uni.pro.navigateTo('order_food/order_food', { uni.pro.navigateTo('order_food/order_food', {
// shopId_id: uni.cache.get('shopUser'), // shopId_id: uni.cache.get('shopUser'),
}) })
} }
},
fail: () => {
} }
}) })
} else { } else {

View File

@@ -126,7 +126,7 @@
// this.shopId = e.shopId; // this.shopId = e.shopId;
// this.init(); // this.init();
// } // }
console.log(e) uni.cache.set('forceUpdate',1)
if (e.q) { if (e.q) {
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId') this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
this.tokenShow = false; this.tokenShow = false;

View File

@@ -99,7 +99,8 @@
} }
}, },
onLoad(e) { onLoad(e) {
this.shopId_id = e.shopId_id this.shopId_id = e.shopId_id;
uni.cache.set('forceUpdate',1)
}, },
onShow() { onShow() {
this.init(); this.init();

View File

@@ -209,6 +209,7 @@
} }
this.swiperCurrent = '' this.swiperCurrent = ''
this.init_fn() this.init_fn()
uni.cache.set('forceUpdate',1)
}, },
onReachBottom() { onReachBottom() {
if (this.navtabindex == 1) { if (this.navtabindex == 1) {

View File

@@ -474,8 +474,8 @@
}, },
async onShow() { async onShow() {
let _this = this; let _this = this;
this.forceUpdate = !this.forceUpdate;
this.orderdetailFlag = true; this.orderdetailFlag = true;
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: 0, scrollTop: 0,
duration: 0 duration: 0
@@ -1115,6 +1115,10 @@
setTimeout(() => { setTimeout(() => {
this.getElementTop(); this.getElementTop();
}, 500); }, 500);
this.forceUpdate = !this.forceUpdate;
setTimeout(()=>{
uni.cache.set('forceUpdate',1);
},300)
} }
}, },

View File

@@ -73,7 +73,9 @@
shopExtend: null, shopExtend: null,
}; };
}, },
onLoad() {}, onLoad() {
uni.cache.set('forceUpdate',1)
},
computed: { computed: {
HeighT() { //手机类型的尺寸 HeighT() { //手机类型的尺寸
return this.$store.getters.is_BarHeight return this.$store.getters.is_BarHeight