// pages/index/index.js import * as echarts from "../../components/echarts/echarts"; function initChart(canvas, width, height, dpr) { const chart = echarts.init(canvas, null, { width: width, height: height, devicePixelRatio: dpr }); canvas.setChart(chart); var option = { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, legend: {}, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: ['一月', '二月', '三月', '四月', '五月', '六月','七月','八月','九月','十一月','十二月'] }, yAxis: { type: 'value', boundaryGap: [0, 0.01] }, series: [ { name: '核收数', type: 'bar', data: [10, 20, 46, 120, 90, 80] }, { name: '接收数', type: 'bar', data: [20, 56, 46, 30, 45, 60] } ] }; chart.setOption(option); return chart; }; Page({ /** * 页面的初始数据 */ data: { ec: { onInit: initChart }, msg:[], //首页中间消息列表 }, //跳转对应界面 goLogisticsType(e){ console.log(JSON.stringify(e)); var tag = e.currentTarget.dataset.id var url //自建物流 if(tag === 'goMelogistics'){ url = '../meLogistics/meLogistics' } //第三方 if(tag === 'goThreelogistics'){ url = '../threeLogistics/threeLogistics' } //货运 if(tag === 'goLogistics'){ url = '../freiLogistics/freiLogistics' } //物流交接 if(tag === 'goHandover'){ url = '../handover/handover' } wx.navigateTo({ url: url, }) }, //自建物流 goMelogistics(){ wx.navigateTo({ url: '../meLogistics/meLogistics', }) }, //第三方物流 goThreelogistics(){ wx.navigateTo({ url: '../threeLogistics/threeLogistics', }) }, //物流交接 goHandover(){ wx.navigateTo({ url: '../freiLogistics/freiLogistics', // url: '../handover/handover', }) }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })