补充一下,change 返回的 e.detail 是正确的
movable-view 触发scale 跟 change 返回值不一致movable-view 触发 bindscale 跟 bindchange 返回的 e.detail 不一致 操作步骤是 : 1、将图片双指操作放大,打印 e.detail 2、稍微移动(x\y 轴都只是轻微移动,请别怀疑我移动幅度大),触发 change 事件,打印 e.detail 结果是,x 轴偏移值,是一致的,可以通过下图可以看出,但 y 值相差很大。 [图片] 代码 [代码]<[代码][代码]movable-area[代码] [代码]class[代码][代码]=[代码][代码]"movearea"[代码] [代码]scale-area>[代码][代码] [代码][代码]<[代码][代码]movable-view[代码] [代码]class[代码][代码]=[代码][代码]"moveview"[代码] [代码]style[代码][代码]=[代码][代码]"height: {{items.viewH}}rpx"[代码] [代码]direction[代码][代码]=[代码][代码]"all"[代码] [代码]@[代码][代码]change[代码][代码]=[代码][代码]"onChange({{index}})"[代码] [代码]@[代码][代码]scale[代码][代码]=[代码][代码]"onScale({{index}})"[代码] [代码]scale [代码][代码]scale-min[代码][代码]=[代码][代码]"1"[代码] [代码]scale-max[代码][代码]=[代码][代码]"10"[代码] [代码]scale-value[代码][代码]=[代码][代码]"1"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]class[代码][代码]=[代码][代码]"pics"[代码] [代码]mode[代码][代码]=[代码][代码]"widthFix"[代码] [代码]src[代码][代码]=[代码][代码]'{{items.pic}}'[代码] [代码]@[代码][代码]load[代码][代码]=[代码][代码]'loadpic({{index}})'[代码] [代码]/>[代码][代码] [代码][代码]</[代码][代码]movable-view[代码][代码]>[代码][代码] [代码][代码]</[代码][代码]movable-area[代码][代码]>[代码] [代码]onChange(index, e) {[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]clearTimeout(that.iTimer)[代码][代码] [代码][代码]that.iTimer = setTimeout([代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]console.log([代码][代码]'change返回的e.detail:'[代码][代码]);[代码][代码] [代码][代码]console.log(e.detail);[代码][代码] [代码][代码]}, 300)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onScale(index, e) {[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]clearTimeout(that.iTimer2)[代码][代码] [代码][代码]that.iTimer2 = setTimeout([代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]console.log([代码][代码]'scale返回的e.detail:'[代码][代码]);[代码][代码] [代码][代码]console.log(e.detail);[代码][代码] [代码][代码]}, 300)[代码][代码] [代码][代码]}[代码]
2018-08-09