From 9029bee5645a38a0074d49028ad6ddfcb8c2ea3b Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Fri, 3 Jan 2025 17:02:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=95=E9=83=A8=E8=8F=9C=E5=8D=95diy?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=95=88=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 6 +- components/common/common.vue | 5 +- pages/diy/diy.vue | 18 +++- pages/plugins/allocation/cashier/cashier.css | 6 ++ pages/plugins/allocation/cashier/cashier.vue | 105 +++++++++++-------- 5 files changed, 91 insertions(+), 49 deletions(-) create mode 100644 pages/plugins/allocation/cashier/cashier.css diff --git a/App.vue b/App.vue index 72d1dd6c..3dd45dda 100644 --- a/App.vue +++ b/App.vue @@ -967,9 +967,9 @@ */ app_tabbar_pages() { var temp_tabbar = this.data.system_tabbar; - var app_tabber = this.get_config('app_tabber') || null; - if(app_tabber != null && (app_tabber.content || null) != null && (app_tabber.content.nav_content || null) != null) { - temp_tabbar = app_tabber.content.nav_content.map(function(v) { + var app_tabbar = this.get_config('app_tabbar') || null; + if(app_tabbar != null && (app_tabbar.content || null) != null && (app_tabbar.content.nav_content || null) != null) { + temp_tabbar = app_tabbar.content.nav_content.map(function(v) { if((v.link || null) != null && (v.link.page || null) != null) { return v.link.page; } diff --git a/components/common/common.vue b/components/common/common.vue index 4688c7a5..d12dc0e0 100644 --- a/components/common/common.vue +++ b/components/common/common.vue @@ -149,8 +149,9 @@ // 底部菜单初始化 footer_init(status = 0) { + var is_use_native_tabbar = app.globalData.data.is_use_native_tabbar == 1; var upd_data = { - is_tabbar: (app.globalData.data.is_use_native_tabbar == 1) ? false : app.globalData.is_tabbar_pages() + is_tabbar: is_use_native_tabbar ? false : app.globalData.is_tabbar_pages() }; if(upd_data['is_tabbar']) { upd_data['key'] = Math.random(); @@ -159,7 +160,7 @@ this.setData(upd_data); // 如果没有菜单数据则读取一次 - if(upd_data['is_tabbar'] && status == 0 && upd_data['app_tabbar'] == null) { + if(!is_use_native_tabbar && status == 0 && (upd_data['app_tabbar'] || null) == null) { app.globalData.init_config(0, this, 'footer_init', 1); } }, diff --git a/pages/diy/diy.vue b/pages/diy/diy.vue index 8412ea6c..1830d773 100644 --- a/pages/diy/diy.vue +++ b/pages/diy/diy.vue @@ -66,9 +66,7 @@ this.get_data(); // 公共onshow事件 - if ((this.$refs.common || null) != null) { - this.$refs.common.on_show(); - } + this.init_common(); // 设置顶部导航的默认颜色 this.set_navigation_bar_color(); @@ -80,6 +78,14 @@ }, methods: { + // 初始化公共 + init_common() { + // 公共onshow事件 + if ((this.$refs.common || null) != null) { + this.$refs.common.on_show(); + } + }, + // 获取数据 get_data(params = {}) { // 还没有数据则读取缓存 @@ -96,6 +102,9 @@ // 设置顶部导航的默认颜色 this.set_navigation_bar_color(); + + // 公共onshow事件 + this.init_common(); } } else { // 已有本地缓存则直接取远程有效数据(默认首次取的是远程缓存数据) @@ -145,6 +154,9 @@ // 设置顶部导航的默认颜色 this.set_navigation_bar_color(); + + // 公共onshow事件 + this.init_common(); } // 分享菜单处理 diff --git a/pages/plugins/allocation/cashier/cashier.css b/pages/plugins/allocation/cashier/cashier.css new file mode 100644 index 00000000..72469d86 --- /dev/null +++ b/pages/plugins/allocation/cashier/cashier.css @@ -0,0 +1,6 @@ +.page { + height: 100vh; +} +.page > .content { + padding-top: 20%; +} \ No newline at end of file diff --git a/pages/plugins/allocation/cashier/cashier.vue b/pages/plugins/allocation/cashier/cashier.vue index ff8a1fc2..9581b9c3 100644 --- a/pages/plugins/allocation/cashier/cashier.vue +++ b/pages/plugins/allocation/cashier/cashier.vue @@ -1,25 +1,29 @@