个人案例
- 便马 找地方
好友聚会,发起邀约?!为你推荐适合的地方 ...
便马 找地方扫码体验
- unityWebGL项目导入小程序:AbortController is not defined?
求高手拆招,unity使用WebGL方式导出,再导入微信小游戏后,编译报错如下: 问题一:来自微信插件plugin.js:74 exception thrown: ReferenceError: AbortController is not defined,ReferenceError: AbortController is not defined at _JS_WebRequest_Create (http://127.0.0.1:42687/game/webgl.wasm.framework.unityweb.js:3:61167) at TransportJavaScript::DoRequest(TransportDoRequestArgsProto<HeaderHelper, DownloadHandler, UploadHandler, CertificateHandler, ResponseHelper> const&) (<anonymous>:wasm-function[33276]:0xa4f204) at UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>::Task_DoRequest(void*) (<anonymous>:wasm-function[32057]:0xa0b0d3) at UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>::Job_ExecuteUnityWebRequest(UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>*) (<anonymous>:wasm-function[32060]:0xa0b548) at UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>::Begin() (<anonymous>:wasm-function[16183]:0x5a4848) at UnityWebRequest::Begin() (<anonymous>:wasm-function[32071]:0xa0b7f9) at UnityEngine::Analytics::WebRequestRestClient::PerformPost() (<anonymous>:wasm-function[9787]:0x3297a0) 。。。。。 at n (http://127.0.0.1:42687/game/__dev__/WAGameSubContext.js:1:24431)(env: Windows,mg,1.06.2206090; lib: 2.25.0) plugin.js:74 WebGL: INVALID_OPERATION: drawElements: no valid shader program in use 问题二:来自VM536 WAGameSubContext.js:1 Unhandled promise rejection TypeError: Browser.mainLoop.scheduler is not a function at Object.resume (webgl.wasm.framework.unityweb.js:3) at Object.calledMainCb (plugin.js:74) at callMain (webgl.wasm.framework.unityweb.js:3) at doRun (webgl.wasm.framework.unityweb.js:3) at run (webgl.wasm.framework.unityweb.js:3) at runCaller (webgl.wasm.framework.unityweb.js:3) at removeRunDependency (webgl.wasm.framework.unityweb.js:3) at receiveInstance (webgl.wasm.framework.unityweb.js:3) at receiveInstantiationResult (webgl.wasm.framework.unityweb.js:3) at VM536 WAGameSubContext.js:1 at n (VM536 WAGameSubContext.js:1)(env: Windows,mg,1.06.2206090; lib: 2.25.0)
2022-07-15 - 两表联合多条件查询,如何实现?
db.collection('pois') .aggregate() .lookup({ from: 'requests', let: { id: '$reqId', collect: '$isCollect' }, pipeline: $.pipeline() .match(_.expr($.and([ $.eq(['$reqId','$$id']), $.eq(['$userId','ok']), $.eq(['$$collect', 1]) ]))).done(), as: 'collectList' }) .end() SQL查询内容:pois.reqId 与 requests.reqId关联,且pois.isCollect=1,且requests.userId='ok', 上述SQL执行后发现:pois.isCollect=1和requests.userId='ok'没有生效,请问如何改写?
2021-01-25 - 开发者工具运行很卡,日志打印不出来(经常还有挂起的情况)?
查看本地任务管理器,如下图: [图片] 经过实验,发现是首页加入了文字滚动条出现了页面卡顿,CPU飙高的问题。
2021-01-22 - 小程序端,利用watch监听不到数据?
Page({ data:{ blocks: [] }, watcher:{}, onReady: function () { let that = this db.collection('test').where({ reqId: _.eq(reqId) }).orderBy('isAuthor','desc').get() .then(res => { that.setData({ blocks: res.data }) }).catch(err => { console.error(err) }) }, onShow: function () { console.log('onShow') this.watcher = db.collection('test').where({ reqId: this.data.reqObj.reqId }).orderBy('isAuthor','desc').watch({ onChange: function(res){ console.debug(JSON.stringify(res)) }, onError: function(err){ } }) }, }) [图片] 数据库权限已经开启 [图片] 监听后,操作数据库中的监控数据,小程序端没有任何反应,请问怎么处理?
2021-01-15 - this.data.list更新后,页面视图不更新?
小程序组件中,组件用来多选,更改this.data.list,组件视图中显示list值,最后将值回调给页面。 当首次打开组件选择,页面能够正常渲染更新,正常回调值返给页面。 但当第二次再打开组件选择,日志中可以看到this.data.list已经被更改,但是组件视图缺没有变化?
2021-01-07 - 云函数新增入库数据不包含openid_?是否可以手动自己加入openid_?
1、云函数新增入库数据不含openid_?(同步、异步入库是不是都不含) 2、是否可以在云函数中手动自己加入openid_字段,方便用户在小程序端操作该条记录?
2021-01-06 - 云开发支持批量更新么?
一组数据是从数据库中查出来的,经过用户操作后,是否可以根据主键再批量更新回去? 除了循环单条更新外,请问有什么好的解决方案?
2020-12-24 - 小程序聊天室如何实现消息监控显示的?
仿小程序聊天室,可以在页面上看到其他好友的实时消息,是通过什么组件来监控实现的?
2020-12-23 - 云函数超时20秒限制,有什么其他方法优化方法么?
打算用云函数做业务处理(异步)逻辑,处理业务时涉及与多个远程接口访问,大概要七八分钟的处理时间。 请问,有什么好的办法解决/优化/规避这一问题?普通请求20秒够了,但我这个要处理上百个接口的数据请求
2020-12-09 - 云函数调用报错,未能获取到返回值,为什么?
写了一个云函数,调用后出现错误 : WAService.js:1 Uncaught (in promise) Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID local_debug_b580f4c9-7026-40a5-a81b-ecf4814829b2, cloud function service error code -1, error message errCode: -501007 invalid parameters | errMsg: [InvalidParameter] Check request parameter fail. Please check your request, but if the problem cannot be solved, contact us.; ; at cloud.callFunction api; at new u (WAService.js:1) at d (WAService.js:1) at f (WAService.js:1) at Function.success (WAService.js:1) at WAService.js:1 at C (WAService.js:1) at i.<anonymous> (WAService.js:1) at i.emit (WAService.js:1) at Rs (WAService.js:1) at WAService.js:1 云函数如下: // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init() const db = cloud.database(); const command = db.command; // 云函数入口函数 exports.main = async (event, context) => { const wxContext = cloud.getWXContext() if(!wxContext.OPENID){ return {status: 'fail'} } let today = new Date().toLocaleDateString() let result; //限流 await db.collection('t_map_request').where({ userId: wxContext.OPENID, reqTime: command.and(command.gte(new Date(today+' 00:00:00')),command.lte(new Date(today+' 23:59:59'))) }).get().then(res => { if(res.data.length>10000){ result = {event, status: 'limit'} } if(res.data.length>2000){ let runCount = 0; res.data.forEach(element => { if(element.bestPoi==null){ runCount++; } }); if(runCount>2){ result = {event, status: 'wait'} } } }) if(result!=null){ return result; } //数据准备 let points = event.points //数组 let modes = event.modes //数组 let time = event.time let type = event.type let reqTime = new Date() //数据入库 await db.collection('t_map_request').add({ data: { userid: wxContext.OPENID, locations: points, modes: modes, startTime: new Date(time+':00'), reqTime: reqTime }, success: res => { result = {event, status: 'success', id: res._id} }, fail: err => { result = {event, status: 'fail'} } }); if(result==null){ result = {event, status: 'success'} } return result; } 调用:console.log(JSON.stringify(res));返回也为{} commitForm: function(points,modes,startDate,type,openId){ wx.showLoading('提交中...'); let pointsStr = JSON.stringify(points); let modeStr = JSON.stringify(modes); console.log('进入表单提交,receiveRequest | points='+pointsStr +'&modes='+modeStr +'&time='+startDate +'&type='+type +'&userId='+openId); try { var res = wx.cloud.callFunction({ name: 'receiveRequest', data: { points: points, modes: modes, time: startDate, type: type } }); console.log(JSON.stringify(res)); wx.hideLoading(); if (res.result.status == 'limit'){ console.log('结束表单提交:LIMIT'); app.showToast('抱歉!今日达到上限,请明日再尝试', 2000); }else if(res.result.status == 'wait'){ console.log('结束表单提交:WAIT'); app.showToast('系统正在为您处理上一个请求,请稍后再提交', 2000); }else{ console.log('结束表单提交:SUCCESS'); wx.cloud.callFunction({ name: 'handleRequest', data: { points: points, modes: modes, time: startDate, type: type } }); } return true; }catch (err) { return false; } }
2020-12-08