- 打开已上线小程序提示运行环境加载失败(2,101)
6.6.2 提示 加载运行环境失败, 6.6.3 小程序进不去
2018-02-10 - 小程序bug, ios低版本css动画接收不到回调
接收到用户反馈, (ipone6, ios 8.2, 微信 6.6.1),(iphone6s 8.1.3 微信 6.6.1) ,这种ios 版本时, css 动画的回调函数不会播放,(其它版本未测试) wxml 测试源码如下: [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"container"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]bindtap[代码][代码]=[代码][代码]"bindViewTap"[代码] [代码]class[代码][代码]=[代码][代码]"userinfo-avatar {{anim}}"[代码] [代码]src[代码][代码]=[代码][代码]"{{userInfo.avatarUrl}}"[代码] [代码]background-size[代码][代码]=[代码][代码]"cover"[代码] [代码]bind:animationend[代码][代码]=[代码][代码]"animationCallback"[代码][代码]></[代码][代码]image[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码]wxss 测试源码如下: [代码]@keyframes moveOut{[代码][代码] [代码][代码]from { [代码][代码]left[代码][代码]: [代码][代码]500[代码][代码]rpx; }[代码][代码] [代码][代码]to { [代码][代码]left[代码][代码]: [代码][代码]-500[代码][代码]rpx; }[代码][代码]}[代码] [代码]@keyframes moveIn {[代码][代码] [代码][代码]from { [代码][代码]left[代码][代码]: [代码][代码]-500[代码][代码]rpx; }[代码][代码] [代码][代码]to { [代码][代码]left[代码][代码]: [代码][代码]500[代码][代码]rpx; }[代码][代码]}[代码] [代码].userinfo {[代码][代码] [代码][代码]display[代码][代码]: flex;[代码][代码] [代码][代码]flex-[代码][代码]direction[代码][代码]: column;[代码][代码] [代码][代码]align-items: [代码][代码]center[代码][代码];[代码][代码]}[代码] [代码].userinfo-avatar {[代码][代码] [代码][代码]position[代码][代码]: [代码][代码]absolute[代码][代码];[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]128[代码][代码]rpx;[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]128[代码][代码]rpx;[代码][代码] [代码][代码]left[代码][代码]: [代码][代码]500[代码][代码]rpx;[代码][代码] [代码][代码]border-radius: [代码][代码]50%[代码][代码];[代码][代码]}[代码] [代码].moveOut {[代码][代码] [代码][代码]animation: moveOut [代码][代码]1[代码][代码]s forwards;[代码][代码]}[代码] [代码].moveIn {[代码][代码] [代码][代码]animation: moveIn [代码][代码]1[代码][代码]s forwards;[代码][代码]}[代码]JS 测试源码如下: [代码]//index.js[代码][代码]//获取应用实例[代码][代码]const app = getApp()[代码] [代码]Page({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]motto: [代码][代码]'Hello World'[代码][代码],[代码][代码] [代码][代码]userInfo: {},[代码][代码] [代码][代码]hasUserInfo: [代码][代码]false[代码][代码],[代码][代码] [代码][代码]canIUse: wx.canIUse([代码][代码]'button.open-type.getUserInfo'[代码][代码]),[代码][代码] [代码][代码]anim: [代码][代码]""[代码][代码],[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]if[代码] [代码](app.globalData.userInfo) {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: app.globalData.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码]([代码][代码]this[代码][代码].data.canIUse){[代码][代码] [代码][代码]app.userInfoReadyCallback = res => {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: res.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]wx.getUserInfo({[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]app.globalData.userInfo = res.userInfo[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: res.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]let self = [代码][代码]this[代码][代码];[代码] [代码] [代码][代码]setTimeout(()=>{[代码][代码] [代码][代码]self.setData({[代码][代码] [代码][代码]anim: [代码][代码]"moveOut"[代码][代码],[代码][代码] [代码][代码]}, response=>{}[代码][代码] [代码][代码]);[代码][代码] [代码][代码]}, 2000);[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]getUserInfo: [代码][代码]function[代码][代码](e) {[代码][代码] [代码][代码]console.log(e)[代码][代码] [代码][代码]app.globalData.userInfo = e.detail.userInfo[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]userInfo: e.detail.userInfo,[代码][代码] [代码][代码]hasUserInfo: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]animationCallback: [代码][代码]function[代码][代码](e) {[代码][代码] [代码][代码]console.error(e);[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]anim:[代码][代码]"moveIn"[代码][代码],[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码]})[代码]
2018-01-24 - 自定义组件中不能使用canvas 画图么
如题, 在自定义的一个Component wxml文件中添加了个canvas [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'container'[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]canvas[代码] [代码]canvas-id[代码][代码]=[代码][代码]'custom-canvas'[代码] [代码]style[代码][代码]=[代码][代码]"border: 1px solid;"[代码][代码]></[代码][代码]canvas[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码]节点, 在js 的ready 函数中执行下面代码, [代码]const ctx = wx.createCanvasContext([代码][代码]'custom-canvas'[代码][代码])[代码][代码]ctx.setFillStyle([代码][代码]'red'[代码][代码])[代码][代码]ctx.fillRect(10, 10, 150, 75)[代码][代码]ctx.draw()[代码] 但是同样在page 下定义相同布局, 在onLoad下执行相同代码, 会显示出canvas
2017-12-20