现在就是希望这个日历能是最高层,但是好多方法就失败了,比如position之后用z-index,都没有用,想问问有没有好办法,样式代码贴在下面
试图在echarts全部渲染完之后再渲染遮罩层,但是echarts的canvas都是异步加载的,微信小程序dom无法操作,也不知道该怎么办,想问问大家有没有好办法,下面是js代码
const app = getApp()
import * as echarts from '../../ec-canvas/echarts';
var Chart = null;
Page({
onShareAppMessage: function (res) {
return {
title: '',
path: '/pages/index/index',
success: function () { },
fail: function () { }
}
},
data: {
calcal: false,
calendarData: '2008-01-01',
calendar: 'none',
ec: {
lazyLoad: true // 延迟加载
},
ec1: {
lazyLoad: true // 延迟加载
},
},
onLoad: function () {
var time = util.formatTime(new Date());
this.setData({
calendarData: time.split(' ')[0]
})
this.echartsComponnet = this.selectComponent('#lineChart');
this.echartsComponnet1 = this.selectComponent('#barChartD');
let params = {
dayDate: this.data.calendarData
}
this.getListData(params); //获取数据
},
onReady() {
},
getListData (params) {
let that = this;
wx.showLoading({
title: '加载中',
});
wx.request({
url: url就不说了
header: {
"Content-Type": "application/json"
},
method: "GET",
success:function(res){
console.log(res.data.data)
if(res.data.code == 200 && res.data.data){
that.setData({
HourData:res.data.data.HourData,
DayData:res.data.data.DayData,
calendarData:res.data.data.date.split(' ')[0]
})
that.init_echarts(); //初始化图表
}else {
wx.showToast({
title: '暂无数据',
})
}
wx.hideLoading()
},
fail:function(err){
console.log('err=============='+err)
wx.hideLoading()
}
})
},
//初始化图表
init_echarts: function () {
var that = this;
this.echartsComponnet.init((canvas, width, height,dpr) => {
// 初始化图表
Chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr //解决小程序视图模糊的问题,必写
});
Chart.clear();
Chart.setOption(this.getOption(this.data.HourData,'line'));
return Chart;
});
},
getOption( data , type) {
var option = { ……};
return option;
},
showCalendar () {
},
changeCalendarData(e) {
},
}