liuyongli 3 years ago
parent 7ab0424d94
commit 7dbf1c748f

@ -1,5 +1,11 @@
// 地区分布
export default function pictographicOption(dRegion=[],dValue=[]){
export default function pictographicOption(dRegion = [], dValue = []) {
if(dRegion.length < 5) {
let n = 5 - dRegion.length;
for(let i = 0; i < n; i++) {
dRegion.push('')
}
}
return {
tooltip: {
trigger: "item",
@ -14,15 +20,15 @@ export default function pictographicOption(dRegion=[],dValue=[]){
confine: true
},
xAxis: {
show:false,
type:'value'
show: false,
type: 'value'
},
yAxis:
{
data: dRegion,
inverse: true,
axisTick: { show: false },
axisLine: { show: false },
inverse: true,
axisLabel: {
margin: 10,
color: '#333333',
@ -31,23 +37,24 @@ export default function pictographicOption(dRegion=[],dValue=[]){
},
grid: {
// top: 'center',
bottom:20,
height:186,
width:48,
top: 'top',
bottom: 20,
height: 186,
width: 48,
left: 60,
},
series: [
{
itemStyle:{
normal:{
color:'#0084FF',
barBorderRadius:12
itemStyle: {
normal: {
color: '#0084FF',
barBorderRadius: 12
},
},
// current data
type: 'bar',
barWidth:10,
data:dValue,
barWidth: 10,
data: dValue,
label: {
show: true,
formatter: function (params) {
@ -57,7 +64,7 @@ export default function pictographicOption(dRegion=[],dValue=[]){
// offset: [20, 0],
color: '#333333',
fontSize: 12,
position:[60,-1]
position: [60, -1]
},
showBackground: true,
backgroundStyle: {
@ -68,5 +75,5 @@ export default function pictographicOption(dRegion=[],dValue=[]){
},
},
]
}
}
}

@ -34,10 +34,10 @@ export default function pictographicOption(dRegion = [], dValue = [], dSum = 0)
},
grid: {
top: '10%',
bottom: 20,
bottom: 5,
height: 186,
width: 48,
left: 60,
left: 55,
},
series: [{
itemStyle: {

@ -36,9 +36,9 @@ export default function pictographicOption(dRegion = [], dValue = [], dSum = 0)
}
},
grid: {
height: 186,
width: '50%',
left: 'center',
height: 186,
left:'23%',
},
series: [{
itemStyle: {

@ -20,10 +20,19 @@ Component({
},
lifetimes: {
attached() {
wx.setStorageSync('sTimeType', '34');
let st = wx.getStorageSync('sTimeType')
if (st) {
let n = this.data.valList.findIndex(ele => ele == st);
this.setData({
intervalSel: n
})
} else {
wx.setStorageSync('sTimeType', 34);
wx.setStorageSync('sStartTime', '');
wx.setStorageSync('sEndTime', '');
}
}
},
methods: {
priceSel(e){

@ -52,7 +52,7 @@
<view class="area_box">
<view class="top-title">
<view style="width: 45%;">论坛正面话题对比</view>
<view style="width:50%;margin-right: 32rpx;">
<view style="width:50%;margin-right: 32rpx; ">
<van-tabs type="card" active="{{ positiveActive }}" color="#BBBBBB" bind:change="positiveChange">
<van-tab title="组一"></van-tab>
<van-tab title="组二" wx:if="{{bbsInfoData.length>2}}"></van-tab>
@ -61,7 +61,7 @@
</view>
</view>
<view wx:for="{{positive}}" wx:key="{{item.name}}">
<view style="margin-left: 32rpx;">{{item.name}}</view>
<view style="margin:10px 32rpx 0 32rpx">{{item.name}}</view>
<view style="width:686rpx;height:486rpx;margin-top: -50px;">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func}}" height="100%"></c-echars>
</view>
@ -80,7 +80,7 @@
</view>
</view>
<view wx:for="{{negative}}" wx:key="{{item.name}}">
<view style="margin-left: 32rpx;">{{item.name}}</view>
<view style="margin:10px 32rpx 0 32rpx">{{item.name}}</view>
<view style="width:686rpx;height:486rpx;margin-top: -50px;">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func}}" height="100%"></c-echars>
</view>

@ -94,5 +94,5 @@
height: 970rpx;
background:#ffffff;
border-radius: 8rpx;
padding-top:32rpx;
padding:32rpx 0;
}

@ -152,7 +152,6 @@ Component({
obj.func = pieOption(['#FF4852', '#FF6E25', '#FFBF00', '#20CC62', '#00D6D6', '#00AAFF', '#7257FF'], i)
newData.push(obj)
}
console.log(newData);
this.setData({
weiboDist: newData
})
@ -193,11 +192,13 @@ Component({
newRes.push(obj)
}
newRes = newRes.map(ele => {
ele.func = [pictographicOption(ele.region.slice(0, 5), ele.value.slice(0, 5), ele.sum),
ele.func = [pictographicOption(ele.region.slice(0, 5), ele.value.slice(0, 5), ele.sum,),
pictographicOption(ele.region.slice(5, 10), ele.value.slice(5, 10), ele.sum)
]
return ele
})
console.log('ser',newRes)
this.setData({
area: newRes
})

@ -71,16 +71,15 @@
<view class="top-title">
<view style="width: 45%;">活跃用户信息</view>
</view>
<view wx:for="{{area}}">
<view style="margin-left:32rpx ;">事件一</view>
<view class="chart_box" style="margin-top: -100rpx;">
<view style="float:left;width:342rpx;height:486rpx;">
<view wx:for="{{area}}" wx:for-index='indedx'>
<view style="margin:10px 32rpx 0 32rpx">{{indedx==0?"事件一":"事件二"}}</view>
<view class="chart_box" style="margin-top:-60rpx;">
<view style="float:left;width:342rpx;height:400rpx;">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func[0]}}" height="100%"></c-echars>
</view>
<view style="float:right;width:342rpx;height:486rpx;">
<view style="float:right;width:342rpx;height:400rpx;">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func[1]}}" height="100%"></c-echars>
</view>
</view>
</view>
</view>

@ -1,7 +1,7 @@
.chart_box{
margin-top: 24rpx;
width: 686rpx;
height: 486rpx;
height: 400rpx;
padding-top:32rpx ;
background: white;
}
@ -70,10 +70,10 @@
.area_box{
margin-top: 24rpx;
width: 686rpx;
height: 970rpx;
height: 880rpx;
background:#ffffff;
border-radius: 8rpx;
padding-top:32rpx;
padding:32rpx 0;
}
.event_distribution{
height: 894rpx;

@ -61,9 +61,8 @@
</view>
</view>
<view wx:for="{{positive}}" wx:key="{{item.name}}">
<view style="margin-left: 32rpx;height: 30px;line-height: 30px;">{{item.name}}</view>
<!---->
<view style="width:686rpx;height:486rpx; margin: -50px 0 0px 0;padding-bottom: 20px; ">
<view style="margin-left: 32rpx;">{{item.name}}</view>
<view style="width:686rpx;height:470rpx; margin: -50px 0 0px 0;padding-bottom: 10px; ">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func}}" height="100%"></c-echars>
</view>
</view>
@ -82,7 +81,7 @@
</view>
<view wx:for="{{negative}}" wx:key="{{item.name}}">
<view style="margin-left: 32rpx;">{{item.name}}</view>
<view style="width:686rpx;height:486rpx;margin: -50px 0 0px 0;padding-bottom: 20px; ">
<view style="width:686rpx;height:470rpx;margin: -50px 0 0px 0;padding-bottom: 10px; ">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func}}" height="100%"></c-echars>
</view>
</view>

@ -95,12 +95,12 @@
</view>
</view>
<view wx:for="{{area}}">
<view style="margin-left:32rpx ;height: 40rpx;line-height: 40rpx;">{{item.name}}</view>
<view class="chart_box" style="margin-top: -100rpx;">
<view style="float:left;width:342rpx;height:486rpx;">
<view style="margin:10px 32rpx 0 32rpx">{{item.name}}</view>
<view class="chart_box1" style="margin-top: -60rpx;">
<view style="float:left;width:342rpx;height:400rpx;">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func[0]}}" height="100%"></c-echars>
</view>
<view style="float:right;width:342rpx;height:486rpx;">
<view style="float:right;width:342rpx;height:400rpx;">
<c-echars showChart="{{showChart}}" canvasId="region-canvas1" chartId="regionbar1" chartOption="{{item.func[1]}}" height="100%"></c-echars>
</view>

@ -5,6 +5,13 @@
padding:32rpx 0;
background: white;
}
.chart_box1{
margin-top: 24rpx;
width: 686rpx;
height: 400rpx;
padding:32rpx 0;
background: white;
}
.chart_box1{
margin-top: 24rpx;

@ -1 +1,47 @@
@import '../common/index.wxss';.van-tree-select{display:flex;font-size:var(--tree-select-font-size,14px);position:relative;-webkit-user-select:none;user-select:none}.van-tree-select__nav{--sidebar-padding:12px 8px 12px 12px;background-color:var(--tree-select-nav-background-color,#f7f8fa);flex:1}.van-tree-select__nav__inner{height:100%;width:100%!important}.van-tree-select__content{background-color:var(--tree-select-content-background-color,#fff);flex:2}.van-tree-select__item{font-weight:700;line-height:var(--tree-select-item-height,44px);padding:0 32px 0 var(--padding-md,16px);position:relative}.van-tree-select__item--active{color:var(--tree-select-item-active-color,#ee0a24)}.van-tree-select__item--disabled{color:var(--tree-select-item-disabled-color,#c8c9cc)}.van-tree-select__selected{position:absolute;right:var(--padding-md,16px);top:50%;transform:translateY(-50%)}
@import '../common/index.wxss';
.van-tree-select {
display: flex;
font-size: var(--tree-select-font-size, 14px);
position: relative;
-webkit-user-select: none;
user-select: none
}
.van-tree-select__nav {
--sidebar-padding: 12px 8px 12px 12px;
background-color: var(--tree-select-nav-background-color, #f7f8fa);
flex: 1
}
.van-tree-select__nav__inner {
height: 100%;
width: 100% !important
}
.van-tree-select__content {
background-color: var(--tree-select-content-background-color, #fff);
flex: 2
}
.van-tree-select__item {
font-weight: 700;
line-height: var(--tree-select-item-height, 44px);
padding: 0 32px 0 var(--padding-md, 16px);
position: relative
}
.van-tree-select__item--active {
color: var(--tree-select-item-active-color, #ee0a24)
}
.van-tree-select__item--disabled {
color: var(--tree-select-item-disabled-color, #c8c9cc)
}
.van-tree-select__selected {
position: absolute;
right: var(--padding-md, 16px);
top: 50%;
transform: translateY(-50%)
}

@ -10,13 +10,14 @@ let iPageIndex = 1 // 当前第几页,0代表第一页
let iPageSize = 20 //每页显示多少数据
Page({
data: {
nengtitle1: '全部级别',
nengtitle2: '全部价格',
nengtitle3: '全部能源',
active: 0,
end: moment().format("YYYY-MM"),
showChart: true,
// select: false,
grade_value1: "",
grade_value2: "",
grade_value3: "",
grade_value4: 0,
grades4: [{
text: '列表展示',
@ -48,15 +49,14 @@ Page({
sEnergyType: '',
imageUrl: getApp().globalData.imageUrl,
mockData: [],
show1: false,
mainActiveIndex: 0,
mainActiveIndex2:0,
mainActiveIndex2: 0,
activeId: '',
activeId2: '',
//
ec: {
lazyLoad: true // 设置图表懒加载
},
showvalue:false,
},
// 标签切换点击事件
onChange(val) {
@ -173,8 +173,6 @@ Page({
},
//页面上拉触底事件的处理函数
onReachBottom: function () {
// console.log("上拉触底事件")
// console.log(iPageIndex)
let that = this
if (!that.data.loadMore) {
that.setData({
@ -266,33 +264,14 @@ Page({
this.data.builds = e.detail.val
}
},
// 按级别
mySelect1(e) {
iPageIndex = 1
iPageSize = 20
this.setData({
ranking: [],
sSpec: e.detail,
})
this.getTrend()
},
// 按价格
mySelect2(e) {
mySelect2({ detail }) {
iPageIndex = 1
iPageSize = 20
this.setData({
ranking: [],
sPriceType: e.detail,
})
this.getTrend()
},
// 按能源
mySelect3(e) {
iPageIndex = 1
iPageSize = 20
this.setData({
ranking: [],
sEnergyType: e.detail,
sPriceType: this.data.grades2[detail].value,
nengtitle2:this.data.grades2[detail].text,
})
this.getTrend()
},
@ -303,7 +282,7 @@ Page({
this.setData({
ranking: [],
a: e.detail != 0,
showvalue:false
showvalue: false
})
this.getTrend()
},
@ -315,9 +294,9 @@ Page({
let dj = this.data.num % 2 == 0
this.setData({
ranking: [],
grade_value1: "",
grade_value2: "",
grade_value3: "",
nengtitle1: '全部级别',
nengtitle2: '全部价格',
nengtitle3: '全部能源',
sSpec: '',
sPriceType: '',
sEnergyType: '',
@ -404,51 +383,75 @@ Page({
})
},
// 树形结构父级点击
onClickNav({ detail = {} }) {
// 按能源
onClickNav({
detail = {}
}) {
this.setData({
mainActiveIndex: detail.index || 0,
});
let {grades3} = this.data;
if(!grades3[detail.index].children) {
let {
grades3
} = this.data;
if (!grades3[detail.index].children) {
this.setData({
ranking: [],
sEnergyType:grades3[detail.index].id || "",
sEnergyType: grades3[detail.index].id || "",
nengtitle3: grades3[detail.index].text,
})
this.getTrend()
}
},
onClickNav2({ detail = {} }) {
// 按级别
onClickNav2({
detail = {}
}) {
this.setData({
mainActiveIndex2: detail.index || 0,
});
let {grades1} = this.data;
console.log('xds',grades1[detail.index])
if(!grades1[detail.index].children) {
let {
grades1
} = this.data;
if (!grades1[detail.index].children) {
this.setData({
ranking: [],
sSpec: grades1[detail.index].id || "",
nengtitle1: grades1[detail.index].text,
})
this.getTrend()
}
},
// 树形结构子级点击
onClickItem({ detail = {} }) {
// 按能源
onClickItem({
detail = {}
}) {
const activeId = this.data.activeId === detail.id ? null : detail.id;
let {mainActiveIndex} = this.data;
let {
mainActiveIndex
} = this.data;
this.setData({
ranking: [],
sEnergyType: mainActiveIndex+","+activeId,
activeId,
nengtitle3: detail.text,
sEnergyType: mainActiveIndex + "," + activeId,
});
this.getTrend()
},
onClickItem2({ detail = {} }) {
const activeId = this.data.activeId === detail.id ? null : detail.id;
let {mainActiveIndex2} = this.data;
// 按级别
onClickItem2({
detail = {}
}) {
const activeId2 = this.data.activeId2 === detail.id ? null : detail.id;
let {
mainActiveIndex2
} = this.data;
this.setData({
ranking: [],
sSpec: mainActiveIndex2+","+activeId,
activeId2,
nengtitle1: detail.text,
sSpec: mainActiveIndex2 + "," + activeId2,
});
this.getTrend()
},

@ -24,12 +24,12 @@
</scroll-view>
<view style="height: 60rpx;margin-top: 10px;">
<van-dropdown-menu custom-class="dropdown-menu" active-color="#027AFF;">
<van-dropdown-item value="{{ grade_value1 }}" title="全部级别">
<van-tree-select items="{{ grades1 }}" main-active-index="{{ mainActiveIndex2 }}" active-id="{{ activeId }}" bind:click-nav="onClickNav2" bind:click-item="onClickItem2"/>
<van-dropdown-item title="{{nengtitle1}}">
<van-tree-select items="{{ grades1 }}" main-active-index="{{ mainActiveIndex2 }}" active-id="{{ activeId2 }}" bind:click-nav="onClickNav2" bind:click-item="onClickItem2" />
</van-dropdown-item>
<van-dropdown-item value="{{ grade_value2 }}" options="{{ grades2 }}" bind:change="mySelect2" title="全部价格" />
<van-dropdown-item value="{{ grade_value3 }}" title="全部能源">
<van-tree-select items="{{ grades3 }}" main-active-index="{{ mainActiveIndex }}" active-id="{{ activeId }}" bind:click-nav="onClickNav" bind:click-item="onClickItem"/>
<van-dropdown-item value="{{ grade_value2 }}" options="{{ grades2 }}" bind:change="mySelect2" title="{{nengtitle2}}" />
<van-dropdown-item title="{{nengtitle3}}">
<van-tree-select items="{{ grades3 }}" main-active-index="{{ mainActiveIndex }}" active-id="{{ activeId }}" bind:click-nav="onClickNav" bind:click-item="onClickItem" />
</van-dropdown-item>
<van-dropdown-item value="{{ grade_value4 }}" options="{{ grades4 }}" bind:change="mySelect4" />
</van-dropdown-menu>

@ -2,13 +2,15 @@
.dropdown-menu {
box-shadow: 0 0 0 !important;
}
.detail-page {
position: relative;
}
.van-dropdown-menu__item{
.van-dropdown-menu__item {
border: 1px solid #F9F9F9;
position: relative;
margin:10rpx;
margin: 10rpx;
}
.menu-tabs .van-tabs__nav {
@ -283,13 +285,14 @@
}
/* 下拉内容 */
van-dropdown-item van-dropdown-item--down{
van-dropdown-item van-dropdown-item--down {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.select_box {
background-color: #fff;
/* padding: 0 20rpx; */
@ -341,8 +344,17 @@ van-dropdown-item van-dropdown-item--down{
text-align: center;
border-radius: 50rpx;
}
.jb-item{
.jb-item {
font-size: 20rpx;
height: 30px;
line-height: 30px;
}
.show {
display: none;
}
.is_show {
display: block;
}

@ -228,6 +228,7 @@ Page({
sStartTime: result.detail.sStartTime,
sEndTime: result.detail.sEndTime,
});
console.log('xs', result.detail.sTimeType)
this.getData();
},
toEventDetail(e) {
@ -333,7 +334,7 @@ Page({
sCrisis: wjList.join(',') || '',
sType: 'BrandData',
sField: JSON.stringify(sField), //导出字段
sFileName: "事件数据" + date, //文件名称
sFileName: this.data.fileName, //文件名称
sCheckedIds: this.data.result.join(',') || '', //数据id
iNum: this.data.result.length == 0 ? this.data.total : this.data.result.length, //导出条数
iTimeType: this.data.iTimeType, //0发布时间 1入库时间

@ -332,7 +332,7 @@ Component({
sCrisis: wjList.join(',') || '',
sType: 'BrandDataHot',
sField: JSON.stringify(sField), //导出字段
sFileName: "事件数据" + date, //文件名称
sFileName: this.data.fileName, //文件名称
sCheckedIds: this.data.result.join(',') || '', //数据id
iNum: this.data.result.length == 0 ? this.data.total : this.data.result.length, //导出条数
iTimeType: this.data.iTimeType, //0发布时间 1入库时间

@ -333,7 +333,7 @@ Page({
sCrisis: wjList.join(',') || '',
sType: 'BrandData',
sField: JSON.stringify(sField), //导出字段
sFileName: "事件数据" + date, //文件名称
sFileName: this.data.fileName, //文件名称
sCheckedIds: this.data.result.join(',') || '', //数据id
iNum: this.data.result.length == 0 ? this.data.total : this.data.result.length, //导出条数
iTimeType: this.data.iTimeType, //0发布时间 1入库时间

@ -427,7 +427,7 @@ Page({
sType: 'ZhuTiFenXiBl',
sGuid: this.data.Guid,
sField: JSON.stringify(sField), //导出字段
sFileName: "事件数据" + date, //文件名称
sFileName:this.data.fileName, //文件名称
sCheckedIds: this.data.result.join(',') || '', //数据id
iNum: this.data.result.length == 0 ? this.data.total : this.data.result.length, //导出条数
iTimeType: this.data.iTimeType, //0发布时间 1入库时间

Loading…
Cancel
Save