- 啥类目让用?
小程序后台找不到 [图片] 别人发的连接加不了 [图片]
2022-12-14 - 为啥找不到腾讯语音识别的插件?
[图片]
2022-12-14 - 如何改变函数的执行顺序?
app.js collectpy : function(){ wx.cloud.callFunction({ name:'collectgroup', success: res => { let r = res.result.list if (this.testCallBack){this.testCallBack(r)} wx.setStorageSync('collectgroup', r) console.log('a') }, }); }, order.js app.collectpy(), console.log('b') 程序是先输出的"b",后输出的"a",如何先输出"a",再输出"b",让程序按顺序执行
2022-12-05 - 云开发续费了,但是数据库还是不给用啊?
客服去哪里找?续费了读取数据还是要求续费。
2022-11-21 - 调用云函数失败?
两个云函数有一个调用成功,另一个报错,下面为调用失败的云函数。 // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init() // 云函数入口函数 const db = cloud.database() const MAX_LIMIT = 100 exports.main = async (event, context) => { const new_name = event.a // 先取出集合记录总数 const countResult = await db.collection(new_name).count() const total = countResult.total // 计算需分几次取 const batchTimes = Math.ceil(total / 100) // 承载所有读操作的 promise 的数组 const tasks = [] for (let i = 0; i < batchTimes; i++) { const promise = db.collection(new_name).skip(i * MAX_LIMIT).limit(MAX_LIMIT).get() tasks.push(promise) } // 等待所有 return (await Promise.all(tasks)).reduce((acc, cur) => { return { data: acc.data.concat(cur.data), errMsg: acc.errMsg, } }) } wx.cloud.callFunction({ name:'tichu', data: { a: 'allplayers' }, success: res => { console.log(res) }, fail :err => {console.log(err)} }); /* 捕获的错误为 Error: cloud.callFunction:fail Error: errCode: -504002 functions execute fail | errMsg: Error: collection.count:fail -501003 exceed request limit. [ResourceUnavailable.ResourceOverdue] Resource has expired. Please renewal fee, but if the problem cannot be solved, contact us. at Object.toSDKError (:43397/var/user/node_modules/wx-server-sdk/index.js:8064) at Object.checkError (:43397/var/user/node_modules/wx-server-sdk/index.js:1421) at :43397/var/user/node_modules/wx-server-sdk/index.js:1557 at processTicksAndRejections (:43397/appservice/internal/process/task_queues.js:97) (callId: 1669034947614-0.22814895692167214) (trace: 20:49:7 start->20:49:7 app show->20:49:8 system error (Error: errCode: -504002 functions execute fail | errMsg: Error: collection.count:fail -501003 exceed request limit. [ResourceUnavailable.ResourceOverdue] Resource has expired. Please renewal fee, but if the problem cannot be solved, contact us. at Object.toSDKError (:43397/var/user/node_modules/wx-server-sdk/index.js:8064) at Object.checkError (:43397/var/user/node_modules/wx-server-sdk/index.js:1421) at :43397/var/user/node_modules/wx-server-sdk/index.js:1557 at processTicksAndRejections (:43397/appservice/internal/process/task_queues.js:97)), abort) at k (VM30 WAService.js:1) at VM30 WAService.js:1 */ 本地调试的错误为: [error] 函数执行失败(耗时 107ms) Error: collection.count:fail -501003 exceed request limit. [ResourceUnavailable.ResourceOverdue] Resource has expired. Please renewal fee, but if the problem cannot be solved, contact us. at Object.toSDKError (/Users/admin/Desktop/tichu-opentest/cloudfunctions/tichu/node_modules/wx-server-sdk/index.js:8064:19) at Object.checkError (/Users/admin/Desktop/tichu-opentest/cloudfunctions/tichu/node_modules/wx-server-sdk/index.js:1421:23) at /Users/admin/Desktop/tichu-opentest/cloudfunctions/tichu/node_modules/wx-server-sdk/index.js:1557:33 at processTicksAndRejections (node:internal/process/task_queues:96:5) [图片][图片]
2022-11-21 - 获取头像按钮点了无效?
<view data-weui-theme="{{theme}}"> <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"> <image class="avatar" src="{{avatarUrl}}"></image> </button> <view> 姓名:<input type="nickname" class="weui-input" placeholder="请输入昵称"/> </view> </view> button按钮点了没有任何反应
2022-07-31 - 怎么取得return返回的data值啊?
const db = wx.cloud.database() const MAX_LIMIT = 100 exports.main = async (event, context) => { // 先取出集合记录总数 const countResult = await db.collection('building').count() const total = countResult.total // 计算需分几次取 const batchTimes = Math.ceil(total / 100) // 承载所有读操作的 promise 的数组 const tasks = [] for (let i = 0; i < batchTimes; i++) { const promise = db.collection('building').skip(i * MAX_LIMIT).limit(MAX_LIMIT).get() tasks.push(promise) } // 等待所有 return (await Promise.all(tasks)).reduce((acc, cur) => { return { data: acc.data.concat(cur.data), errMsg: acc.errMsg, } }) }
2022-01-22