You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
// index.js
|
|
|
|
// 获取应用实例
|
|
|
|
const app = getApp()
|
|
|
|
|
|
|
|
Page({
|
|
|
|
data: {
|
|
|
|
tabbar: {},
|
|
|
|
condition: ['二十四小时', '最近七天', '最近三十天', '自定义'],
|
|
|
|
toplist: [{
|
|
|
|
url: '',
|
|
|
|
title: '入库数据总量',
|
|
|
|
num: '1'
|
|
|
|
}, {
|
|
|
|
url: '',
|
|
|
|
title: '微博数据',
|
|
|
|
num: '2'
|
|
|
|
}, {
|
|
|
|
url: '',
|
|
|
|
title: '其他数据',
|
|
|
|
num: '0'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: '',
|
|
|
|
title: '短视频数据',
|
|
|
|
num: '0'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: '',
|
|
|
|
title: '微信数据',
|
|
|
|
num: '0'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: '',
|
|
|
|
title: 'APP数据',
|
|
|
|
num: '0'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: '',
|
|
|
|
title: '论坛数据',
|
|
|
|
num: '0'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: '',
|
|
|
|
title: '新闻数据',
|
|
|
|
num: '0'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
navData:[
|
|
|
|
{
|
|
|
|
text: '数据'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: '事件'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: '传播媒体'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: '传播声量'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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
|
|
|
|
});
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.getTabBar().init();
|
|
|
|
},
|
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|