Commit ad1491ba by 姜雷

修改触发事件

parent 78aec937
......@@ -117,13 +117,13 @@ Component({
methods: {
clickHandle(e) {
console.log(e);
const { touches } = e.detail;
const { changedTouches } = e.detail;
let x = 0;
let y = 0;
if (touches && touches.length) {
x = touches[0].x;
y = touches[0].y;
if (changedTouches && changedTouches.length) {
x = changedTouches[0].x;
y = changedTouches[0].y;
}
const objArr = platforFeeChart.getSnapRecords({ x, y });
if (objArr.length) this.triggerEvent('selectedData', objArr[0]._origin);
......
<!-- pages/components/PlatformFeeChart/PlatformFeeChart.wxml -->
<ff-canvas id="PlatformFeeChart" canvas-id="PlatformFeeChart" opts="{{ opts }}" bindcanvastouch="clickHandle" />
\ No newline at end of file
<ff-canvas id="PlatformFeeChart" canvas-id="PlatformFeeChart" opts="{{ opts }}" bindcanvastouchend="clickHandle" />
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment