import * as echarts from '../../ec-canvas/echarts'; // var Api = require('../../api/urls.js'); var wxRequest = require('../../api/request.js') var app = getApp() function initChart(canvas, width, height, dpr, data) { const chart = echarts.init(canvas, null, { width: width, height: height, devicePixelRatio: dpr // new }); canvas.setChart(chart); var option = { xAxis : { type : 'category', splitNumber: 2, scale: true, show:false, splitLine:{     show:false   } }, yAxis : { type : 'value', splitNumber: 2, scale: true, show:false, splitLine:{     show:false    } }, series: [{ type: 'line', smooth: true, symbol: 'none', lineStyle: { color: '#D81E06', }, data:data, areaStyle: { color: '#D81E06', }, }] }; chart.setOption(option); return chart; } Page({ data: { // 页面配置 winWidth: 0, winHeight: 0, // tab切换 currentTab: 0, ec: { onInit: initChart }, array:[], }, onLoad: function() { var that = this; // 获取关注的信息 var userId={ userId:wx.getStorageSync('openid') // userId:'ocVI541TGfnTChi5DlIa7beac2YM' } console.log(userId); var that = this; // this.getFollow(userId); wxRequest.followList(userId).then((res)=>{ console.log(res); console.log(res.data.data); if(res.statusCode==200){ that.setData({ array:res.data.data }) console.log(that.data.array); }else{ wx.showToast({ title: '125', icon: 'none' }) } }) // 获取系统信息 wx.getSystemInfo({ success: function(res) { that.setData({ winWidth: res.windowWidth, winHeight: res.windowHeight }); } }); }, getFollow:function(userId){ }, open: function (e) { console.log(e) wx.navigateTo({ url: '../item/item?row='+JSON.stringify(e.currentTarget.dataset.row) }); } })