- 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 - 上传报错:以下文件没有被打包上传
[图片] 更新开发者工具之后,才出现的问题。 上传的时候,提示这个。 开发者工具版本是 1.02.1804090 确认这些文件是肯定有用到的。 比如第一个,在页面上的代码,是需要链接过去的。 [图片]
2018-04-12 - iphone6s IOS9 微信版本6.6.2 播放音乐BUG
iphone6s IOS9 微信版本6.6.2 播放音乐,第一次暂停需要点击2次才会暂停,另外切换前后台,也并没有按代码的执行暂停。 代码如下 [代码]<[代码][代码]view[代码] [代码]bindtap[代码][代码]=[代码][代码]"switchMusic"[代码] [代码]class[代码][代码]=[代码][代码]"music-wrapper"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{isPlay}}"[代码] [代码]class[代码][代码]=[代码][代码]"playing music"[代码][代码]></[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:else [代码][代码]class[代码][代码]=[代码][代码]"music"[代码][代码]></[代码][代码]view[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码]const app = getApp()[代码][代码]Page({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]isPlay: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]musicUrl: [代码][代码]'/images/bg.mp3'[代码][代码] [代码][代码]},[代码][代码] [代码] [代码] [代码][代码]onShow() {[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]this[代码][代码].data.isPlay) {[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.play()[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onHide(){[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.pause()[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onLoad() {[代码][代码] [代码][代码]let audioCtx = wx.createInnerAudioContext()[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]audioCtx: audioCtx[代码][代码] [代码][代码]})[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.autoplay = [代码][代码]true[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.loop = [代码][代码]true[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.src = [代码][代码]this[代码][代码].data.musicUrl[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.onPlay(() => {[代码][代码] [代码][代码]console.log([代码][代码]'播放中'[代码][代码])[代码][代码] [代码][代码]})[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.onPause(() => {[代码][代码] [代码][代码]console.log([代码][代码]'暂停中'[代码][代码])[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]switchMusic() {[代码][代码] [代码][代码]if[代码] [代码](![代码][代码]this[代码][代码].data.isPlay) {[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.play()[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]isPlay: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]this[代码][代码].data.audioCtx.pause()[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]isPlay: [代码][代码]false[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]})[代码] [代码].music-wrapper {[代码][代码] [代码][代码]position[代码][代码]: [代码][代码]fixed[代码][代码];[代码][代码] [代码][代码]z-index[代码][代码]: [代码][代码]100000[代码][代码];[代码][代码] [代码][代码]top[代码][代码]: [代码][代码]40[代码][代码]rpx;[代码][代码] [代码][代码]left[代码][代码]: [代码][代码]20[代码][代码]rpx;[代码][代码] [代码][代码]background[代码][代码]: [代码][代码]none[代码][代码];[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]60[代码][代码]rpx;[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]60[代码][代码]rpx;[代码][代码] [代码][代码]margin[代码][代码]: [代码][代码]0[代码][代码];[代码][代码] [代码][代码]padding[代码][代码]: [代码][代码]0[代码][代码];[代码][代码] [代码][代码]border-radius: [代码][代码]50%[代码][代码];[代码][代码] [代码] [代码]}[代码][代码].music {[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]60[代码][代码]rpx;[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]60[代码][代码]rpx;[代码][代码] [代码][代码]display[代码][代码]: [代码][代码]block[代码][代码];[代码][代码] [代码][代码]background[代码][代码]: [代码][代码]#f30[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码].playing{[代码][代码] [代码][代码]background[代码][代码]: [代码][代码]#000[代码][代码];[代码][代码] [代码][代码]-webkit-transform: rotate([代码][代码]360[代码][代码]deg);[代码][代码] [代码][代码]animation: rotation [代码][代码]2[代码][代码]s linear infinite;[代码][代码] [代码][代码]-moz-animation: rotation [代码][代码]2[代码][代码]s linear infinite;[代码][代码] [代码][代码]-webkit-animation: rotation [代码][代码]2[代码][代码]s linear infinite;[代码][代码] [代码][代码]-o-animation: rotation [代码][代码]2[代码][代码]s linear infinite;[代码][代码] [代码][代码]}[代码][代码]@-webkit-keyframes rotation{[代码][代码] [代码][代码]from {-webkit-transform: rotate([代码][代码]0[代码][代码]deg);}[代码][代码] [代码][代码]to {-webkit-transform: rotate([代码][代码]360[代码][代码]deg);}[代码][代码]}[代码]
2018-02-08 - 如何在小程序里打开web页面(不是在webview里开)
需要在小程序里点击某个按钮,跳出到某个web页面 (不是通过webview里打开)。要怎么操作?在 “微信棋牌群排行” 这个小程序里是可以跳转到web页的。
2017-12-15