|
@@ -2,7 +2,7 @@ import * as echarts from '../../ec-canvas/echarts';
|
|
|
|
|
|
const app = getApp();
|
|
|
var host = app.globalData.host;
|
|
|
-var id;
|
|
|
+var id, record_id;
|
|
|
|
|
|
Page({
|
|
|
onShareAppMessage: function (res) {
|
|
@@ -20,9 +20,10 @@ Page({
|
|
|
},
|
|
|
|
|
|
onLoad(options) {
|
|
|
- id=options.id
|
|
|
+ id = options.id, record_id = options.record_id
|
|
|
this.setData({
|
|
|
- id:id
|
|
|
+ id:id,
|
|
|
+ record_id: record_id
|
|
|
})
|
|
|
wx.showNavigationBarLoading()
|
|
|
/**获取token */
|
|
@@ -32,7 +33,7 @@ Page({
|
|
|
this.setData({
|
|
|
userInfo: res.data
|
|
|
})
|
|
|
- this.getData(options.id);
|
|
|
+ this.getData(id, record_id);
|
|
|
},
|
|
|
fail: error => {
|
|
|
//跳转到登陆页面
|
|
@@ -42,10 +43,17 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getData(id) {
|
|
|
+ getData(id, record_id) {
|
|
|
+ var data={}
|
|
|
+ if(id){
|
|
|
+ data.id=id
|
|
|
+ }
|
|
|
+ if (record_id) {
|
|
|
+ data.record_id = record_id
|
|
|
+ }
|
|
|
wx.request({
|
|
|
url: host + '/api/wx/player/match',
|
|
|
- data: { id: id },
|
|
|
+ data: data,
|
|
|
header: {
|
|
|
'Authorization': this.data.userInfo.token
|
|
|
},
|
|
@@ -68,14 +76,20 @@ Page({
|
|
|
|
|
|
/**折线图 */
|
|
|
function initChart(canvas, width, height, dpr) {
|
|
|
-
|
|
|
+ var data = {}
|
|
|
+ if (id) {
|
|
|
+ data.id = id
|
|
|
+ }
|
|
|
+ if (record_id) {
|
|
|
+ data.record_id = record_id
|
|
|
+ }
|
|
|
wx.getStorage({
|
|
|
key: 'userInfo',
|
|
|
success: res => {
|
|
|
var info = res.data
|
|
|
wx.request({
|
|
|
url: host + '/api/wx/player/match',
|
|
|
- data:{id:id},
|
|
|
+ data: data,
|
|
|
header: {
|
|
|
'Authorization': info.token
|
|
|
},
|