From 6ccdeba85e0cbd64e0ced4e01824134cf75fbfd8 Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 6 Sep 2022 19:46:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=83=AD=E5=8C=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/home/template/tpl.js | 15 +++--- pages/tabbar/home/template/tpl_flex_one.vue | 9 +++- pages/tabbar/home/template/tpl_hot_zone.vue | 57 +++++++++++++++++++++ pages/tabbar/home/views.vue | 13 ++--- 4 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 pages/tabbar/home/template/tpl_hot_zone.vue diff --git a/pages/tabbar/home/template/tpl.js b/pages/tabbar/home/template/tpl.js index 0e8897e..c1af693 100644 --- a/pages/tabbar/home/template/tpl.js +++ b/pages/tabbar/home/template/tpl.js @@ -1,8 +1,9 @@ /** 配置楼层模块的跳转 */ export function modelNavigateTo(item) { - let val = item.url; - - switch (val.___type) { + let val = item.url || item; + console.log(item); + // return; + switch (val.___type || item.type) { case "goods": uni.navigateTo({ url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId, @@ -36,7 +37,7 @@ export function modelNavigateTo(item) { }); break; case "other": - switch (val.title) { + switch (val.title || item.title) { case "首页": uni.switchTab({ url: `/pages/tabbar/home/index`, @@ -102,12 +103,12 @@ export function modelNavigateTo(item) { url: `/pages/product/shopList`, }); break; - case "外部链接": + default: // #ifdef H5 - window.location.href = val.url; + window.location.href = val.url || item.link; // #endif // #ifdef APP-PLUS - plus.runtime.openURL(val.url) //不需要拼接\ + plus.runtime.openURL(val.url || item.link) //不需要拼接\ // #endif break; } diff --git a/pages/tabbar/home/template/tpl_flex_one.vue b/pages/tabbar/home/template/tpl_flex_one.vue index 9af2c5c..7945a4e 100644 --- a/pages/tabbar/home/template/tpl_flex_one.vue +++ b/pages/tabbar/home/template/tpl_flex_one.vue @@ -1,15 +1,20 @@ + diff --git a/pages/tabbar/home/views.vue b/pages/tabbar/home/views.vue index 4001ee8..aae0ad5 100644 --- a/pages/tabbar/home/views.vue +++ b/pages/tabbar/home/views.vue @@ -50,7 +50,7 @@ - + @@ -125,13 +125,14 @@ export default { getFloorData().then((res) => { if (res.data.success) { this.pageData = JSON.parse(res.data.result.pageData); + console.log(this.pageData); } }); - }, - // 是否有网络链接 - isConnected(val){ - val ? this.init() : '' - }, + }, + // 是否有网络链接 + isConnected(val) { + val ? this.init() : ""; + }, /** * TODO 扫码功能后续还会后续增加