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 扫码功能后续还会后续增加