个人案例
- canvas 2D 开发工具正常,体验版不显示?
代码片段:https://developers.weixin.qq.com/s/MfkkFTmS7bng wx.chooseImage this.uploadImg(tempImg) 开发工具正常,体验版以上函数不执行 [图片]
2021-02-05 - canvas 开发工具正常,手机预览失败?
iphone7、ios 14.4 [图片][图片] 代码片段:https://developers.weixin.qq.com/s/Zh3LyTm97Xnn
2021-02-05 - 企业付款到零钱报错Error: NO_AUTH?
请问小程序云开发企业付款到零钱功能报错(此 IP 地址不允许调用接口)。我用了社区官方给的 IP 地址也同样报错。请问该如何获取正确的IP [图片]
2021-01-21 - 云开发微信支付回调函数报错(user code exception caught)?
错误信息 返回结果 {"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"ReferenceError: enent is not defined\n at Runtime.exports.main [as handler] (/var/user/index.js:16:21)\n at Runtime.handleOnce (/var/runtime/node10/Runtime.engine.js:214:23)\n at Timeout.setTimeout [as _onTimeout] (/var/runtime/node10/Runtime.engine.js:54:12)\n at ontimeout (timers.js:436:11)\n at tryOnTimeout (timers.js:300:5)\n at listOnTimeout (timers.js:263:5)\n at Timer.processTimers (timers.js:223:10)","statusCode":430} ERROR RequestId:024fa213-5ac4-11eb-8d8d-52540036d55c Result:{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"ReferenceError: enent is not defined\n at Runtime.exports.main [as handler] (/var/user/index.js:16:21)\n at Runtime.handleOnce (/var/runtime/node10/Runtime.engine.js:214:23)\n at Timeout.setTimeout [as _onTimeout] (/var/runtime/node10/Runtime.engine.js:54:12)\n at ontimeout (timers.js:436:11)\n at tryOnTimeout (timers.js:300:5)\n at listOnTimeout (timers.js:263:5)\n at Timer.processTimers (timers.js:223:10)","statusCode":430} END RequestId:024fa213-5ac4-11eb-8d8d-52540036d55c Report RequestId:024fa213-5ac4-11eb-8d8d-52540036d55c Duration:6ms Memory:256MB MemUsage:26.394531MB 回调函数 exports.main = async (event, context) => { const wxContext = cloud.getWXContext() const db = cloud.database() console.log('支付回调:', event) const orderId = event.outTradeNo const subMchId = event.subMchId const returnCode = event.returnCode const orderType = enent.attach if (returnCode == 'SUCCESS') { if (orderType == 'Vip') { const result = await db.collection('VipOrder') .where({ _id: orderId }) .update({ data: { outTradeNo: orderId, } }) const res = { errcode: 0, errmsg: '', result: result, } return res } else { const result = await db.collection('SaleOrder') .where({ _id: orderId }) .update({ data: { status: 1, subMchId: subMchId, outTradeNo: orderId, } }) const res = { errcode: 0, errmsg: '', result: result, } return res } } }
2021-01-20 - 云函数突破数据库每次只返回20条数据的限制,上滑刷新?
我的方法成功处理了每次只返回20条数据的限制,但是上滑加载更多的时候,为什么加载出来的数据是重复第一次的,而不是新数据啊? 云函数 async function getGoods() { const MAX_LIMIT = 100 const countResult = await db.collection('Goods').count() const total = countResult.total const batchTimes = Math.ceil(total / 100) const list = [] for (let i = 0; i < batchTimes; i++) { const promise = db.collection('Goods').aggregate() .lookup({ from: 'User', localField: 'adminId', foreignField: '_id', as: 'adminInfo', }) .skip(i * MAX_LIMIT).limit(MAX_LIMIT).end() list.push(promise) } return ( await Promise.all(list)).reduce((acc, cur) => ({ data: acc.data.concat(cur.data), errMsg: acc.errMsg, })) } index.js _fecthGoods: function () { wx.cloud.callFunction({ name: 'goodsMgt', data: { req_type: 'Selection' } }).then(res => { console.log(res) let goodsList = res.result.list this.setData({ goodsList: goodsList }) wx.lin.renderWaterFlow(goodsList);//瀑布流组件 console.log("商品列表:", this.data.goodsList) }) }, onReachBottom: function () { this._fecthGoods() wx.stopPullDownRefresh({ success: (res) => { console.log(res) }, }) },
2021-01-17 - 如何重置场景值?
分享小程序到指定群时的场景值(1044),在群聊里打开小程序,并点击返回按钮(自定义的导航返回)wx.reLaunch到首页,此时的场景值还是1044,请问如何重置场景值?
2021-01-13 - 开放社区,下滑刷新,能不能改成分页浏览?
拉到下面想点客服中心都点不了。 [图片]
2020-12-30 - 小程序认证需要固定电话?
请问,现在企业认证小程序一定要固定电话吗? 一开始说是要企业税务官网截图,现在又说不行,这是微信官方的规定还是审核公司(世纪恒通科技股份有限公司”)的规定啊。 现在哪还有固定电话用啊。 [图片][图片][图片]
2020-12-30 - 请问页面元素排列不规则,如何用wx:for渲染(二维数组)?
效果图 [图片] <block wx:for-items="{{item.memberlist}}" wx:key="item"> <image class="member_avatar" src="{{item[0].memberInfo[0].avatarUrl || '/images/default_img.png'}}"> </image> </block> 这里加了item[0]就渲染不出来了。 [图片]
2020-12-24 - 多个input输入内容后,push()到数组,结果重复?
data: { ask: [], }, // 答案D answerDInput: function (e) { let value = e.detail.value let asks = [] let askItem = { D: value, isCheck: false } asks.push(askItem) this.data.ask.push(...asks) this.setData({ ask: this.data.ask }) console.log(asks) console.log(this.data.ask) }, [图片]
2020-11-28