fix(index): 修复首页在已登录状态下,不能点击的问题

This commit is contained in:
2025-12-20 16:52:29 +08:00
parent 3556691b56
commit 973c8dddd0
7 changed files with 48 additions and 9 deletions

View File

@@ -98,6 +98,11 @@
if (uni.getStorageSync('servicerConfig')) {
this.$store.commit('setServicerConfig', uni.getStorageSync('servicerConfig'));
}
// 企业微信配置
if (uni.getStorageSync('wxworkConfig')) {
this.$store.commit('setWxworkConfig', uni.getStorageSync('wxworkConfig'));
}
// 版权信息
if (uni.getStorageSync('copyright')) {
@@ -296,7 +301,7 @@
this.shareConfig();
}
},
// 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
// 代表在watch里声明了firstName这个方法之后立即先去执行handler方法
immediate: true
}
}

View File

@@ -11,19 +11,37 @@ try {
}
} catch (e) {}
// 本地调试配置, 不同环境的配置
const localConfig = {
'460': { // 制氧设备平台
uniacid: 460,
domain: 'https://xcx30.5g-quickapp.com/',
},
'2285': { // 数码喷墨墨水
uniacid: 2285,
domain: 'https://xcx.aigc-quickapp.com/',
}
}
const {
uniacid: defaultUniacid,
domain: defaultDomain,
} = localConfig['2285'] ?? {}
// 调试版本,配置说明
const devCfg = {
// 商户ID
uniacid: 460, //825
uniacid: defaultUniacid, //825
//api请求地址
baseUrl: 'https://xcx30.5g-quickapp.com/',
baseUrl: defaultDomain,
// 图片域名
imgDomain: 'https://xcx30.5g-quickapp.com/',
imgDomain: defaultDomain,
// H5端域名
h5Domain: 'https://xcx30.5g-quickapp.com/',
h5Domain: defaultDomain,
// // api请求地址
// baseUrl: 'https://tsaas.liveplatform.cn/',

View File

@@ -145,7 +145,16 @@ class EventBus {
)
// 调用 defaultAsyncHandler仅当允许
await callDefaultAsyncHandler(event, null, domResult)
await callDefaultAsyncHandler(event, null, domResult ?? true)
// 如果不允许继续传播,则直接返回(根据 defaultPrevented 判断结果)
if (!allowContinuePropagation) {
return !event.defaultPrevented
}
// 否则继续走普通 EventBus 处理fallthrough
} else if (this.platform === 'h5') {
// 调用 defaultAsyncHandler仅当允许
await callDefaultAsyncHandler(event, null, true)
// 如果不允许继续传播,则直接返回(根据 defaultPrevented 判断结果)
if (!allowContinuePropagation) {
@@ -192,6 +201,10 @@ class EventBus {
await callDefaultAsyncHandler(event, handler, awaitedResult)
} catch (error) {
console.error(`EventBus ${eventName} error:`, error)
// 发现错误,默认调用 defaultAsyncHandler仅当允许
await callDefaultAsyncHandler(event, handler, true)
// 如果全局或该 handler 指定遇错停止传播,则停止
if (stopOnError || handler.options?.stopOnError) {
break

View File

@@ -324,7 +324,7 @@
//切换英文标题
if(this.lang == 'en-us'){
this.categoryTree.map(item => {
item.child_list.map(items => {
item?.child_list?.map(items => {
items.category_name = items.en_category_name;
return items;
})

View File

@@ -3,7 +3,7 @@ export default {
// 异步触发事件
async __$emitEvent(payload = {eventName: '__unnamedEvent', data: {}, promiseCallback: null}) {
// console.log('__$emitEvent', payload)
await this.$eventBus?.emit(payload.eventName, payload.data, payload.promiseCallback)
await this.$eventBus.emit(payload.eventName, payload.data, payload.promiseCallback)
},
}
}

View File

@@ -44,6 +44,9 @@ uniStorage();
import loadingCover from '@/components/loading-cover/loading-cover.vue';
Vue.component('loading-cover', loadingCover);
import nsMpHtml from '@/components/ns-mp-html/ns-mp-html.vue';
Vue.component('ns-mp-html', nsMpHtml);
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
Vue.component('ns-empty', nsEmpty);

View File

@@ -62,7 +62,7 @@ export default {
// 统一处理点击及触摸事件
_handleDiyGroupInteractionEvent(payload) {
if (this.storeToken) {
return;
return true;
}
// 打开登录弹窗