|
@@ -161,16 +161,17 @@ Page({
|
|
|
userInfo: {},
|
|
|
hasUserInfo: false,
|
|
|
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
|
|
+
|
|
|
imagewidth: 0,//缩放后的宽
|
|
|
imageheight: 0,//缩放后的高
|
|
|
- chartData:{
|
|
|
- actual:[552,586,3555,4454,552,556,4455],
|
|
|
- prediction:[552,546,3585,4424,542,546,35,44,524,56,355,444,2224,421],
|
|
|
- timeData : [
|
|
|
- '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7', '2020/6/8', '2020/6/9', '2020/6/10','2020/6/11',
|
|
|
- '2020/6/12','2020/6/13','2020/6/14',
|
|
|
- ]
|
|
|
- },
|
|
|
+ // chartData:{
|
|
|
+ // actual:[552,586,3555,4454,552,556,4455],
|
|
|
+ // prediction:[552,546,3585,4424,542,546,35,44,524,56,355,444,2224,421],
|
|
|
+ // timeData : [
|
|
|
+ // '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7', '2020/6/8', '2020/6/9', '2020/6/10','2020/6/11',
|
|
|
+ // '2020/6/12','2020/6/13','2020/6/14',
|
|
|
+ // ]
|
|
|
+ // },
|
|
|
chartDatas:{
|
|
|
actual:[572,556,3555,4744,552,576,3555],
|
|
|
prediction:[352,246,385,2424,542,546,255],
|
|
@@ -179,7 +180,8 @@ Page({
|
|
|
]
|
|
|
},
|
|
|
ec: {
|
|
|
- onInit: initChart
|
|
|
+ onInit: initChart,
|
|
|
+ // lazyLoad: true // 延迟加载
|
|
|
},
|
|
|
// ec: {
|
|
|
// onInit: function (canvas, width, height) {
|
|
@@ -316,6 +318,30 @@ Page({
|
|
|
url: '../logs/logs'
|
|
|
})
|
|
|
},
|
|
|
+ //沪深
|
|
|
+ getHushen:function(){
|
|
|
+ apiServer.getHushen().then((res) =>{
|
|
|
+ if(res.statusCode == 200){
|
|
|
+ console.log(res);
|
|
|
+ this.setData({
|
|
|
+ chartDatas:this.recursion(res.data.data),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ recursion:function(row,a=[],b=[],c=[],d){
|
|
|
+ for(let i in row.actuals){
|
|
|
+ a.unshift(row.actuals[i].industryDate)
|
|
|
+ b.unshift(row.actuals[i].close)
|
|
|
+ c.unshift(row.actuals[i].pred)
|
|
|
+ }
|
|
|
+ if(row.tag){
|
|
|
+ d="#D81E06"
|
|
|
+ }else{
|
|
|
+ d="#07c160"
|
|
|
+ }
|
|
|
+ return {"timeData":a,"actual":b,"prediction":c,"color":d}
|
|
|
+ },
|
|
|
onReady: function (e) {
|
|
|
this.computeScrollViewHeight();
|
|
|
// var query = wx.createSelectorQuery()
|
|
@@ -325,6 +351,7 @@ Page({
|
|
|
},
|
|
|
onLoad: function () {
|
|
|
this.getNewsList();
|
|
|
+ this.getHushen();
|
|
|
let sysinfo = wx.getSystemInfoSync(),
|
|
|
windowHeight = sysinfo.windowHeight,
|
|
|
statusHeight = sysinfo.statusBarHeight,
|
|
@@ -433,8 +460,6 @@ Page({
|
|
|
catchTouchMove:function(res){
|
|
|
return false
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
//初始化图表
|
|
|
init_echarts: function () {
|
|
|
this.echartsComponnet.init((canvas, width, height) => {
|