- skylin渲染显示未定义?
代码参考:https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/worklet.html js: Page({ onShow() { this.animator = wx.createAnimation({ duration: 1000, timingFunction: "linear" }); this.animator.scale(1, 1).step(); this.setData({ animator: this.animator.export() }); console.log(this.animator); console.log(this.data); }, listener(res) { console.log(this.animator); console.log(this.data); this.animator.scale(3, 2).step(); this.setData({ animator: this.animator.export() }); }, run(optional){ 'worklet'; console.log('123wula coming',optional); }, called:()=>{ this.run('at now'); wx.worklet.runOnUI(run)('now'); }, onLoad(res){ this.called(); } }); wxml: 这是一个动画视图 点击我触发动画 报错信息: TypeError: Cannot read property 'run' of undefined [图片]
08-13 - Page的函数在onLoad中调用结果不同?
//js Page({ data: { userInfo: {}, hasUserInfo: false, }, onLoad: function() { const that=this; wx.login({ success (res) { that.getUserProfile(); console.log(res); console.log(that.data.userInfo); } }) }, getUserProfile(){ wx.showLoading({ title: '加载中', }); //如果不点击只能运行到这里 wx.getUserProfile({ desc: 'nickname', success:(res)=>{ console.log(res); this.setData({userInfo:res.userInfo,hasUserInfo:true}); wx.hideLoading(); } }); } } ); wxml: <view class="container"> <view class="userinfo"> <!-- 如果没有用户信息,只显示获取用户信息的按钮 --> <block wx:if="{{!hasUserInfo}}"> <button bind:tap="getUserProfile">若登陆失败,点此显示信息</button> </block> <!-- 如果有用户信息,显示用户头像和昵称 --> <block wx:else> <text>{{userInfo.nickName}}</text> <image src="{{userInfo.avatarUrl}}" mode="widthFix"/> </block> </view> </view>
08-10 - 调试确定已更新的信息无法显示?
<!--wxml--> <view class="container"> <view class="userinfo"> <!-- 如果没有用户信息,只显示获取用户信息的按钮 --> <block wx:if="{{!hasUserInfo}}"> <button bind:tap="getUserProfile">获取用户信息</button> </block> <!-- 如果有用户信息,显示用户头像和昵称 --> <block wx:else> <text>{{userInfo.nickName}}</text> <image src="userInfo.avatarUrl" mode="widthFix"/> </block> </view> </view> js: //js Page({ data: { userInfo: {}, hasUserInfo: false, }, onLoad: function() { }, getUserProfile(){ wx.getUserProfile({ desc: 'nickname', success:(res)=>{ console.log(res); this.setData({userInfo:res.rawData,hasUserInfo:true}); console.log(this.data.userInfo); } }) } } ); 控制台信息:{cloudID: undefined, encryptedData: "4PxhrI7abWIvWhmrWaJ+Wss1T00Ol5Qtkr3/zJcfgthaG6QOh3…CPUQpYUt03KyWGm/QdR4F8Ib85xiNnejLx1euQ2djfxiTCwAN", iv: "5uDhJgWNhFFMbYJVD9Nmuw==", signature: "fc680633c9c59f58184c2f2cd1b40125b111cb11", userInfo: {…}, …} load.js? [sm]:15"nickName":"微信用户","gender":0,"language":"","city":"","province":"","country":"","avatarUrl":"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132","is_demote":true} [渲染层网络层错误] Failed to load local image resource /pages/load/userInfo.avatarUrl the server responded with a status of 500 (HTTP/1.1 500 Internal Server Error) (env: Windows,mp,1.06.2405020; lib: 3.5.3) [图片][图片]{
08-10 - 下载程序导入无法运行?
我先是github下载了代码https://github.com/imageslr/weapp-library/tree/master; 然后“导入”开发者工具,界面以及问题如图片显示。错误信息[ app.json 文件内容错误] app.json: 在项目根目录未找到 app.json (env: Windows,mp,1.06.2405020; lib: 3.5.3)https://project.config.json 想问哪里需要修改?有两份project.config.json,需要删除哪一个(外面的吗?)[图片]
08-09 - tabBar设置之后其他页面无法显示只显示了tabBar?
以下为app.json;https://github.com/RebeccaHanjw/weapp-wechat-zhihu中的tabBar似乎同样阻塞其他页面显示,fir,sec,thir均为tabBar的页面 { "pages": [ "pages/fir/fir", "pages/sec/sec", "pages/thir/thir", "pages/index/index", "pages/log/log" ], "window": { "navigationBarBackgroundColor": "#f00fff", "navigationBarTextStyle": "white", "navigationBarTitleText": "首页" }, "style": "v2", "tabBar": { "list": [ { "pagePath": "pages/fir/fir", "text": "first" }, { "pagePath": "pages/sec/sec", "text": "second" }, { "pagePath": "pages/thir/thir", "text": "third" } ] } }
08-06