} | } | ||||
}, | }, | ||||
_tap(e,move) { | _tap(e,move) { | ||||
console.log(e,move,'=========前',this.inScrollView,this.inAli) | |||||
let cid = this.cid | let cid = this.cid | ||||
let currentIndex = null; | let currentIndex = null; | ||||
let legendIndex = null; | let legendIndex = null; | ||||
} | } | ||||
this.emitMsg({name: 'getIndex', params: { type:"getIndex", event:{ x: e.detail.x - data.left, y: e.detail.y - data.top }, currentIndex: currentIndex, legendIndex: legendIndex, id: cid, opts: cfu.instance[cid].opts}}); | this.emitMsg({name: 'getIndex', params: { type:"getIndex", event:{ x: e.detail.x - data.left, y: e.detail.y - data.top }, currentIndex: currentIndex, legendIndex: legendIndex, id: cid, opts: cfu.instance[cid].opts}}); | ||||
} | } | ||||
console.log(e,move,'=========后2') | |||||
}) | }) | ||||
.exec(); | .exec(); | ||||
} else { | } else { | ||||
console.log(e,move,'=========后4') | |||||
if(move){ | if(move){ | ||||
if (this.tooltipShow === true) { | if (this.tooltipShow === true) { | ||||
this._showTooltip(e); | this._showTooltip(e); | ||||
this.emitMsg({name: 'getIndex', params: {type:"getIndex", event:{ x: e.detail.x, y: e.detail.y - e.currentTarget.offsetTop }, currentIndex: currentIndex, legendIndex: legendIndex, id: cid, opts: cfu.instance[cid].opts}}); | this.emitMsg({name: 'getIndex', params: {type:"getIndex", event:{ x: e.detail.x, y: e.detail.y - e.currentTarget.offsetTop }, currentIndex: currentIndex, legendIndex: legendIndex, id: cid, opts: cfu.instance[cid].opts}}); | ||||
} | } | ||||
} | } | ||||
console.log(e,move,'=========后') | |||||
}, | }, | ||||
_touchStart(e) { | _touchStart(e) { | ||||
let cid = this.cid | let cid = this.cid |
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性 | // 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性 | ||||
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc']; | const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc']; | ||||
const colorMap = ['#1890FF']; | |||||
//事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改 | //事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改 | ||||
const formatDateTime = (timeStamp, returnType)=>{ | const formatDateTime = (timeStamp, returnType)=>{ | ||||
}, | }, | ||||
"map":{ | "map":{ | ||||
"type": "map", | "type": "map", | ||||
"color": color, | |||||
"color": colorMap, | |||||
"padding": [0,0,0,0], | "padding": [0,0,0,0], | ||||
"dataLabel": true, | "dataLabel": true, | ||||
"extra": { | "extra": { |
import qiun from "./qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue"; | import qiun from "./qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue"; | ||||
const state = reactive({ | const state = reactive({ | ||||
chartData: {}, | chartData: {}, | ||||
opts: { | |||||
color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"], | |||||
opts: { //["贵州省","海南省"] | |||||
color: ["#EE6666","#1890FF","#1890FF","#1890FF","#1890FF", | |||||
"#1890FF","#1890FF","#1890FF","#1890FF","#1890FF", | |||||
"#1890FF","#1890FF","#1890FF","#1890FF","#1890FF", | |||||
"#1890FF","#1890FF","#1890FF","#1890FF","#1890FF", | |||||
"#1890FF","#1890FF","#1890FF","#1890FF","#EE6666", | |||||
"#1890FF","#1890FF","#1890FF","#1890FF","#1890FF", | |||||
"#1890FF","#1890FF","#1890FF","#1890FF","#1890FF"], | |||||
padding: [0,0,0,0], | padding: [0,0,0,0], | ||||
dataLabel: true, | dataLabel: true, | ||||
fontSize:9, | |||||
enableScroll: false, | enableScroll: false, | ||||
extra: { | extra: { | ||||
map: { | map: { | ||||
active:false, | |||||
border: true, | border: true, | ||||
borderWidth: 1, | borderWidth: 1, | ||||
borderColor: "#666666", | borderColor: "#666666", |
//处理请求错误 | //处理请求错误 | ||||
reject(err) | reject(err) | ||||
} | } | ||||
wx.request(options) | |||||
uni.getNetworkType({ | |||||
success: function (res) { | |||||
if(res.networkType=='none'){ | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: "网络异常", | |||||
success: function(res) { | |||||
if (res.confirm) { | |||||
console.log('用户点击确定'); | |||||
} else if (res.cancel) { | |||||
console.log('用户点击取消'); | |||||
} | |||||
} | |||||
}); | |||||
}else{ | |||||
wx.request(options) | |||||
} | |||||
console.log("res.networkType",res.networkType); | |||||
} | |||||
}); | |||||
}); | }); | ||||
} | } |