From 8a760f2a4358598cc5860f778e3cdf67eedae722 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Wed, 29 Jun 2022 14:28:01 +0800 Subject: [PATCH] cxw-010203 --- components/indexCom/dataChild/index.js | 8 ++ components/indexCom/dataChild/index.json | 3 + components/indexCom/dataChild/index.wxml | 3 + components/indexCom/dataChild/index.wxss | 0 pages/index/index.js | 138 ++++------------------- pages/index/index.json | 1 + pages/index/index.wxml | 53 +-------- pages/index/index.wxss | 7 +- 8 files changed, 47 insertions(+), 166 deletions(-) create mode 100644 components/indexCom/dataChild/index.js create mode 100644 components/indexCom/dataChild/index.json create mode 100644 components/indexCom/dataChild/index.wxml create mode 100644 components/indexCom/dataChild/index.wxss diff --git a/components/indexCom/dataChild/index.js b/components/indexCom/dataChild/index.js new file mode 100644 index 0000000..7134a36 --- /dev/null +++ b/components/indexCom/dataChild/index.js @@ -0,0 +1,8 @@ +Component({ + data: { + + }, + methods: { + + } +}) \ No newline at end of file diff --git a/components/indexCom/dataChild/index.json b/components/indexCom/dataChild/index.json new file mode 100644 index 0000000..fba482a --- /dev/null +++ b/components/indexCom/dataChild/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/components/indexCom/dataChild/index.wxml b/components/indexCom/dataChild/index.wxml new file mode 100644 index 0000000..af4be2d --- /dev/null +++ b/components/indexCom/dataChild/index.wxml @@ -0,0 +1,3 @@ + + 2222 + \ No newline at end of file diff --git a/components/indexCom/dataChild/index.wxss b/components/indexCom/dataChild/index.wxss new file mode 100644 index 0000000..e69de29 diff --git a/pages/index/index.js b/pages/index/index.js index 74ea677..7823625 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -4,142 +4,48 @@ const app = getApp() Page({ data: { - active:0, - arr:[ - { - title:'点餐', - // path:'/shop/goods' - }, - { - title:'评价', - // path:'/shop/ratings' - }, - { - title:'商家信息', - // path:'/shop/info' - }, - ], - tabbar: {}, - condition: ['二十四小时', '最近七天', '最近三十天', '自定义'], - toplist: [{ - url: '', - title: '入库数据总量', - num: '1' - }, { - url: '', - title: '微博数据', - num: '2' - }, { - url: '', - title: '其他数据', - num: '0' - }, - { - url: '', - title: '短视频数据', - num: '0' - }, - { - url: '', - title: '微信数据', - num: '0' + active: 0, + navData: [{ + text: '数据', + component: 'data-child' }, { - url: '', - title: 'APP数据', - num: '0' + text: '事件', + component: 'data-child' }, { - url: '', - title: '论坛数据', - num: '0' + text: '传播媒体', + component: 'data-child' }, { - url: '', - title: '新闻数据', - num: '0' - }, - ], - navData:[ - { - text: '数据', - path:'/pages/insight' - - }, - { - text: '事件', - path:'/pages/insight' + text: '传播声量', + component: 'data-child' }, { - text: '传播媒体' + text: '晴雨表', + component: 'data-child' }, { - text: '传播声量' + text: '尾盘洞察', + component: 'data-child' }, { - text: '晴雨表' + text: '热议图谱', + component: 'data-child' }, { - text: '尾盘洞察' + text: '用户画像', + component: 'data-child' }, { - text: '热议图谱' + text: '热销排行', + component: 'data-child' }, - { - text: '用户画像' - }, - { - text: '热销排行' - }, - ], - currentTab: 0, - navScrollLeft: 0 - + ], }, - switchNav(event){ - // 获取当前tab 的id - var cur = event.currentTarget.dataset.current; - //每个tab选项宽度占1/5 - var singleNavWidth = this.data.windowWidth / 5; - //tab选项居中 - this.setData({ - navScrollLeft: (cur - 2) * singleNavWidth - }) - // 判断id是否和点击的tab id 一致 - if (this.data.currentTab == cur) { - return false; - } else { - this.setData({ - currentTab: cur - }) - } -}, -switchTab(event){ - var cur = event.detail.current; - var singleNavWidth = this.data.windowWidth / 5; - this.setData({ - currentTab: cur, - navScrollLeft: (cur - 2) * singleNavWidth - }); -}, -watch:{ - active(newVal){ - switch (newVal) { - case 0: - // this.$router.push('/shop/goods') - break; - case 1: - // this.$router.push('/shop/ratings') - break; - case 2: - // this.$router.push('/shop/info') - break; - } - } -}, onShow() { - this.getTabBar().init(); + this.getTabBar().init(); }, onLoad: function (options) { diff --git a/pages/index/index.json b/pages/index/index.json index b55b5a2..8dd343a 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,4 +1,5 @@ { "usingComponents": { + "data-child": "../../components/indexCom/dataChild/index" } } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index d9a9efd..a55e082 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,53 +1,10 @@ - - 内容 1 - 内容 2 - 内容 3 - 内容 4 - 内容 5 - 内容 6 - - - - - - - - - - - - - {{navItem.text}} - - - - {{item}} - - - - - {{tabItem}} - - - + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 7ecd7db..8367d56 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -5,14 +5,17 @@ } .menu-tabs .van-tab{ - color: #A0A0A0; /* 字体颜色 */ + color: #98CDFF; /* 字体颜色 */ background-color: #006BFF;/* 标签背景颜色 */ } .menu-tabs .van-tab--active{ color: #FFFFFF; /* 字体颜色 */ + font-size: 17px; + } + .menu-tabs .van-tabs__line { + background: transparent; } - .nav { /* 设置tab-nav宽高度 */