个人案例
多多省钱福利
基于云开发与拼多多开放接口写多多客商品推广小程序
多多省钱扫码体验
- 云开发cloudbase个人套餐现在不让绑定自定义域名了吗?
我买的套餐是个人版19.9一个月的,绑定自定义域名的时候提示如下,需要升级套餐后才能使用,符合条件的套餐每个月至少是199,我用不了那么大的套餐也要强制升级吗?你们刚出这个产品的时候是怎么宣传的,按量计费,成本更低,吃香要不要这么难看? [图片] [图片] [图片] [图片]
06-06 - 公众号为视频号进行了辅助认证,现在视频号的管理员联系不上,怎么才能取消公众号对视频号的辅助认证?
公众号为视频号进行了辅助认证,现在视频号的管理员联系不上,怎么才能取消公众号对视频号的辅助认证? 公众号appid:wx53d1697bc472b375
05-08 - 使用@cloudbase/js-sdk写前端页面,使用watch监听订单状态变化时,监听会自动关闭?
在vue开发中使用@cloudbase/js-sdk写web页面。在支付页面监听订单状态的改变,下单成功获取支付链接跳转到微信进行支付,支付成功返回到支付页面时,发现数据的监听已经关闭了 代码如下 页面加载是获取订单信息 mounted() { const query = this.$route.query dbWatch = null if (query) { this.order_no = query.order_no this.getPageData() } } 获取订单信息,数据获取成功后监听当前订单支付状态 // 请求数据案例 getPageData() { this.$request .getDataFromCloud('get_order_msg_to_pay', { order_no: this.order_no }) .then(res => { this.loading = false if (res.code === 200) { this.info = res.data if (res.data.order_msg.is_pay) { this.$notify({ type: 'success', message: '用户成功付款' }) this.$router.replace({ name: 'paySu', query: { order_no: res.data.order_msg.order_no } }) } else { if (!dbWatch) { this.initWatch(this.info.order_msg._id) } } } else { this.description = '暂无数据' this.show_empty = true } }) .catch(() => { this.loading = false this.description = '服务器异常' this.show_empty = true }) }, 初始化订单数据监听,订单状态变为已支付时,跳转到支付成功页 initWatch(order_id) { dbWatch = this.$request.cloudbase .database() .collection('orders') .doc(order_id) .watch({ onChange: snapshot => { if ( snapshot.msgType === 'NEXT_EVENT' && snapshot.docChanges && snapshot.docChanges.length > 0 && snapshot.docChanges[0].dataType === 'update' ) { const orderMsg = snapshot.docChanges[0].doc if (orderMsg.is_pay) { this.$notify({ type: 'success', message: '用户成功付款' }) this.$router.replace({ name: 'paySu', query: { order_no: orderMsg.order_no } }) } } }, onError: error => { console.log('收到error**********', error) } }) } 点击页面支付按钮进行支付: toPay() { this.addLoading = true this.$toast.loading({ duration: 0, message: '正在支付...', forbidClick: true }) // 获取操作系统信息 const browserName = platform.name.toLowerCase() const osFamily = platform.os.family.toLowerCase() let deviceType = 'Android' if (osFamily === 'ios' || browserName.includes('iphone') || browserName.includes('ipad')) { deviceType = 'iOS' } this.$request .getDataFromCloud(this.$utils.isMobile() ? 'pay_h5' : 'pay_native', { order_no: this.info.order_msg.order_no, device_type: deviceType }) .then(res => { console.log('res ===', JSON.stringify(res)) if (res.result.code === 200) { if (this.$utils.isMobile()) { location.href = res.result.data.pay_url } else { this.showPayCode = true this.$nextTick(() => { // 此时可以确认已经有ref对象了 QrCode.toCanvas(this.$refs.erCanvas, res.result.data.pay_url, { scale: 8 }) //将文字转成二维码 // 如果转化的二维码后面信息 是一个地址的话 就会跳转到该地址 如果不是地址就会显示内容 }) } } else { this.$notify({ type: 'danger', message: res.result.msg }) } console.log('pay_h5 res==', JSON.stringify(res)) this.$toast.clear() this.addLoading = false }) .catch(() => { this.$notify({ type: 'danger', message: '服务器异常' }) this.$toast.clear() this.addLoading = false }) } 获取支付链接后 执行 location.href = res.result.data.pay_url 跳转到微信进行支付,现在的问题是跳转到微信进行支付,在苹果手机上数据库监听会自己关闭 打印日志如下: [图片] 数据库监听方法中收到一条错误信息: 数据监听 error打印了 收到error********** {"errCode": "SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR", "errMsg": {"isTrusted": true}}
2023-12-03 - 云开发分账添加账号,报错?
云开发报错,哪位大神知道啥问题啊? [图片] 返回值 [图片] 参数打印: [图片]
2022-10-17 - 云开发 comment.set() 报错?
console.log("dealNetworkWhenSetTuid upData==", upData) await db.collection("user").where( { _openid: userMsg.data[0]._openid } ).update( { data: upData } ) 打印信息如下: dealNetworkWhenSetTuid upData== { "node_position": 3, "t_uid": "optGL0uXwly3i4x3WVOHB-HmI6ms", "first_t_user": { "operator": "set", "operands": [ {} ], "fieldName": {} }, "second_t_user": { "node_position": 1, "open_id": "oq6Pm5DIMXX2iKHCpQ5E_ObOlzZ4", "unionid": "optGL0v6N_8RwDyyacdabbGEz6KI", "money": 1 }, "second_t_openid": "oq6Pm5DIMXX2iKHCpQ5E_ObOlzZ4" } 错误信息: ERROR RequestId:cd1368e1-4aaa-11ec-956a-525400a835cb Result:{"errCode":1,"errMsg":"user code exception caught","stackTrace":"Error: errCode: -502001 database request fail | errMsg: [FailedOperation] multiple write errors: [{write errors: [{'$set' is empty. You must specify a field like so: {$set: {\u003cfield\u003e: ...}}}]}, {\u003cnil\u003e}]; \n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6032:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1364:23)\n at Promise (/var/user/node_modules/wx-server-sdk/index.js:1459:33)\n at process._tickCallback (internal/process/next_tick.js:68:7)"} 其中使用了:upData.first_t_user = command.set({}) 请问大佬,comment.set 不可以设置值为 空对象吗?
2021-12-03 - 云开发使用cloudbase/vue-provider 初始化报错?
使用cloudbase/vue-provider 做小程序云开发后台管理,初始化报错 错误信息如下: [图片] 初始化代码: [图片]
2021-08-04 - 微信视频号活动如何添加小程序链接?
看到nike视频号发起了一个活动,活动页面添加了微信小程序的跳转链接,怎么才可以在视频号活动中添加微信小程序的跳转链接呢? [图片]
2021-02-21 - 发送订阅消息无效参数?
云函数发送订阅消息一直提示无效参数 代码:[图片] 权限:[图片] 模板消息信息:[图片] 返回结果:[图片] 说明:确定对应发送的openid已经授权发送消息 补充:开发工具版本Nightly 1.05.2102012
2021-02-03 - 云开发聚合阶段做乘法处理,是否可以用一个随机数乘以一个参数?
const result=await db.collection('test_data') .aggregate() .project({ luck_num:1, name:1, temp_luck_num:$.multiply([Math.random(), '$luck_num']) }) .sort({ temp_luck_num: -1, }) .limit(5) .end() 这样相乘的结果就相当于luck_num*常数,而不是一个随机数,跪求大神指点
2021-01-28 - 红包封面审核好慢呀,四天了,怎么还没审核呀?
[图片]
2021-01-28