parent
9396c9c903
commit
9f3535ad8d
@ -1,6 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"time-component":"/components/timecomponent/index"
|
||||
"time-component-home":"/components/timecomponentHome/index"
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"time-component":"/components/timecomponent/index"
|
||||
"time-component-home":"/components/timecomponentHome/index"
|
||||
}
|
||||
}
|
@ -1,24 +1,23 @@
|
||||
<view class="p-container">
|
||||
<!-- 时间组件 -->
|
||||
<time-component bindchange="changeTime"></time-component>
|
||||
<view class="list_event">
|
||||
<view class="event_title" bindtap="a">传播重点媒体排行</view>
|
||||
<view class="ranking">
|
||||
<view class="title">排名</view>
|
||||
<view class="title">媒体</view>
|
||||
<view class="title2">传播量</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="rank" wx:for="{{ranking}}" wx:key="index" wx:if="{{index<10}}" >
|
||||
<view class="dis_image">
|
||||
<image class="rank_num" wx:if="{{index === 0}}" src="{{imageUrl}}/img_diyi.png"></image>
|
||||
<image class="rank_num" wx:if="{{index === 1}}" src="{{imageUrl}}/img_dier.png"></image>
|
||||
<image class="rank_num" wx:if="{{index === 2}}" src="{{imageUrl}}/img_disan.png"></image>
|
||||
<view class="num" wx:if="{{index !== 0 &&index !== 1 &&index !== 2 }}">{{index >= 9 ? index + 1 : '0' + (index + 1)}}</view>
|
||||
</view>
|
||||
<view class="media">{{item.name}}</view>
|
||||
<view class="volume">{{item.value}}</view>
|
||||
</view>
|
||||
<time-component-home bindchange="changeTime"></time-component-home>
|
||||
<view class="list_event">
|
||||
<view class="event_title" bindtap="a">传播重点媒体排行</view>
|
||||
<view class="ranking">
|
||||
<view class="title">排名</view>
|
||||
<view class="title">媒体</view>
|
||||
<view class="title2">传播量</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="rank" wx:for="{{ranking}}" wx:key="index" wx:if="{{index<10}}">
|
||||
<view class="dis_image">
|
||||
<image class="rank_num" wx:if="{{index === 0}}" src="{{imageUrl}}/img_diyi.png"></image>
|
||||
<image class="rank_num" wx:if="{{index === 1}}" src="{{imageUrl}}/img_dier.png"></image>
|
||||
<image class="rank_num" wx:if="{{index === 2}}" src="{{imageUrl}}/img_disan.png"></image>
|
||||
<view class="num" wx:if="{{index !== 0 &&index !== 1 &&index !== 2 }}">{{index >= 9 ? index + 1 : '0' + (index + 1)}}</view>
|
||||
</view>
|
||||
<view class="media">{{item.name}}</view>
|
||||
<view class="volume">{{item.value}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"c-echars": "../../components/c-echars/index",
|
||||
"time-component": "../../components/timecomponent/index"
|
||||
"time-component-home":"../../components/timecomponentHome/index"
|
||||
}
|
||||
}
|
@ -1,73 +1,78 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
data: {
|
||||
tabActive: 0,
|
||||
themeData: [],
|
||||
data: {
|
||||
tabActive: 0,
|
||||
themeData: [],
|
||||
},
|
||||
methods: {
|
||||
toAddTheme() {
|
||||
this.triggerEvent('hide')
|
||||
wx.navigateTo({
|
||||
url: "/pages/insight/pages/addTheme/index"
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
toAddTheme() {
|
||||
wx.navigateTo({
|
||||
url: "/pages/insight/pages/addTheme/index"
|
||||
})
|
||||
},
|
||||
changeTab(event) {
|
||||
this.setData({ tabActive: event.detail.index});
|
||||
this.getData()
|
||||
},
|
||||
getData() {
|
||||
changeTab(event) {
|
||||
this.setData({
|
||||
tabActive: event.detail.index
|
||||
});
|
||||
this.getData()
|
||||
},
|
||||
getData() {
|
||||
app.globalData.request({
|
||||
action: 'getSchemeDataToTheme',
|
||||
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
|
||||
pageIndex: 1,
|
||||
pageSize: 100,
|
||||
sType: this.data.tabActive == 0 ? 'now' : 'former'
|
||||
}).then(res => {
|
||||
let data = res;
|
||||
let nd = new Date().valueOf();
|
||||
data.forEach(ele => {
|
||||
if (new Date(ele.EndTime).valueOf() < nd) {
|
||||
ele.Classify = 1
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
themeData: data
|
||||
})
|
||||
});
|
||||
},
|
||||
toThemeDataList(event) {
|
||||
let id = event.currentTarget.dataset.id.Guids;
|
||||
let start = event.currentTarget.dataset.id.StartTime;
|
||||
let end = event.currentTarget.dataset.id.EndTime;
|
||||
let Name = event.currentTarget.dataset.id.Name;
|
||||
wx.navigateTo({
|
||||
url: '/pages/insight/pages/themeList/index' + '?Guid=' + id + '&StartTime=' + start + '&EndTime=' + end + '&Name=' + Name,
|
||||
})
|
||||
},
|
||||
editTheme(event) {
|
||||
let id = event.currentTarget.dataset.id
|
||||
this.triggerEvent('hide')
|
||||
wx.navigateTo({
|
||||
url: '/pages/insight/pages/editTheme/index' + '?Guid=' + id,
|
||||
})
|
||||
},
|
||||
deleteTheme(event) {
|
||||
wx.showModal({
|
||||
title: '是否要删除该主题?',
|
||||
success: (result) => {
|
||||
if (result.cancel == false) {
|
||||
app.globalData.request({
|
||||
action: 'getSchemeDataToTheme',
|
||||
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
|
||||
pageIndex: 1,
|
||||
pageSize: 100,
|
||||
sType: this.data.tabActive == 0 ? 'now' : 'former'
|
||||
action: 'delCarBigDataByGuid',
|
||||
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
|
||||
Guids: event.currentTarget.dataset.id
|
||||
}).then(res => {
|
||||
let data = res;
|
||||
let nd = new Date().valueOf();
|
||||
data.forEach(ele => {
|
||||
if(new Date(ele.EndTime).valueOf() < nd) {
|
||||
ele.Classify = 1
|
||||
}
|
||||
})
|
||||
this.setData({themeData: data})
|
||||
this.getData()
|
||||
});
|
||||
},
|
||||
toThemeDataList(event) {
|
||||
let id = event.currentTarget.dataset.id.Guids;
|
||||
let start = event.currentTarget.dataset.id.StartTime;
|
||||
let end = event.currentTarget.dataset.id.EndTime;
|
||||
let Name = event.currentTarget.dataset.id.Name;
|
||||
wx.navigateTo({
|
||||
url: '/pages/insight/pages/themeList/index' + '?Guid=' + id +'&StartTime='+start+'&EndTime='+end+'&Name='+Name,
|
||||
})
|
||||
},
|
||||
editTheme(event) {
|
||||
let id = event.currentTarget.dataset.id
|
||||
this.triggerEvent('hide')
|
||||
wx.navigateTo({
|
||||
url: '/pages/insight/pages/editTheme/index' + '?Guid=' + id,
|
||||
})
|
||||
},
|
||||
deleteTheme(event) {
|
||||
wx.showModal({
|
||||
title: '是否要删除该主题?',
|
||||
success: (result) => {
|
||||
if(result.cancel == false) {
|
||||
app.globalData.request({
|
||||
action: 'delCarBigDataByGuid',
|
||||
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
|
||||
Guids: event.currentTarget.dataset.id
|
||||
}).then(res => {
|
||||
this.getData()
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
this.getData()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
this.getData()
|
||||
}
|
||||
}
|
||||
})
|
@ -1,36 +1,36 @@
|
||||
// index.js
|
||||
|
||||
Page({
|
||||
data: {
|
||||
active: 0,
|
||||
showChart: true,
|
||||
wshow: true,
|
||||
},
|
||||
onShow() {
|
||||
if (!wx.getStorageSync('token')) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/mine/pages/bindUser/index?isHome=1",
|
||||
})
|
||||
} else {
|
||||
this.getTabBar().init();
|
||||
if (this.data.active == 2 || this.data.active == 3 ||this.data.active == 1) {
|
||||
this.reLoad()
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
changeTab(val) {
|
||||
let n = val.detail.index;
|
||||
this.setData({
|
||||
active: n
|
||||
})
|
||||
},
|
||||
reLoad() {
|
||||
this.setData({
|
||||
wshow: false
|
||||
})
|
||||
this.setData({
|
||||
wshow: true
|
||||
})
|
||||
data: {
|
||||
active: 0,
|
||||
showChart: true,
|
||||
wshow: true,
|
||||
},
|
||||
onShow() {
|
||||
if (!wx.getStorageSync('token')) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/mine/pages/bindUser/index?isHome=1",
|
||||
})
|
||||
} else {
|
||||
this.getTabBar().init();
|
||||
if (this.data.active == 2 || this.data.active == 3 || this.data.active == 1) {
|
||||
this.reLoad()
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
wshow: true
|
||||
})
|
||||
|
||||
},
|
||||
themeHide() {
|
||||
this.setData({
|
||||
wshow: false
|
||||
})
|
||||
},
|
||||
changeTab(val) {
|
||||
let n = val.detail.index;
|
||||
this.setData({
|
||||
active: n
|
||||
})
|
||||
},
|
||||
});
|
@ -1,9 +1,17 @@
|
||||
<view class="container">
|
||||
<!-- <c-echars showChart="{{showChart}}" canvasId="eventbar-canvas" chartId="eventbar" chartOption="{{chartOption}}" height="100%"></c-echars> -->
|
||||
<van-tabs class="menu-tabs" active="{{ active }}" ellipsis="{{false}}" animated="{{true}}" bind:change="changeTab">
|
||||
<van-tab title="品牌对比"><brand-child wx:if="{{active===0}}"></brand-child></van-tab>
|
||||
<van-tab title="车型对比"><model-child wx:if="{{active===1}}"></model-child></van-tab>
|
||||
<van-tab title="事件对比"><event-child wx:if="{{active===2 && wshow}}"></event-child></van-tab>
|
||||
<van-tab title="主题对比"><theme-child wx:if="{{active===3 && wshow}}"></theme-child></van-tab>
|
||||
</van-tabs>
|
||||
<!-- <c-echars showChart="{{showChart}}" canvasId="eventbar-canvas" chartId="eventbar" chartOption="{{chartOption}}" height="100%"></c-echars> -->
|
||||
<van-tabs class="menu-tabs" active="{{ active }}" ellipsis="{{false}}" animated="{{true}}" bind:change="changeTab">
|
||||
<van-tab title="品牌对比">
|
||||
<brand-child wx:if="{{active===0 && wshow}} " bind:hide="themeHide"></brand-child>
|
||||
</van-tab>
|
||||
<van-tab title="车型对比">
|
||||
<model-child wx:if="{{active===1 && wshow}} " bind:hide="themeHide"></model-child>
|
||||
</van-tab>
|
||||
<van-tab title="事件对比">
|
||||
<event-child wx:if="{{active===2 && wshow}} " bind:hide="themeHide"></event-child>
|
||||
</van-tab>
|
||||
<van-tab title="主题对比">
|
||||
<theme-child wx:if="{{active===3 && wshow}}" bind:hide="themeHide"></theme-child>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
Loading…
Reference in new issue