个人案例
- 爱去宁国
致力于公共信息平等与安全 使人人皆可访问并从中受益
爱去宁国扫码体验
- 怎么实现查询列表时得到用户是否点赞的结果?
// 文章结构如下 { _id: 'xxx', title: '文章一', starList: [{ openId: 1234 }, { openId: 5678 }] } { _id: 'yyy', title: '文章二', starList: [{ openId: '5678' }] } // 假设当前登录用户的 openid 是 1234 // 想得到如下结果 [ { _id: 'xxx', title: '文章一', starList: [{ openId: 1234 }, { openId: 5678 }], starStatus: true, }, { _id: 'yyy', title: '文章二', starList: [{ openId: 5678 }], starStatus: false, } ]
2020-11-24 - 怎么把云数据库中多个字段合并成一个字段?
// 数据如下 { _id: 'xxxx', review: false, reviewer: '系统', reviewReason: '风险控制' } // 希望得到如下类似结果 { _id: 'xxx', review: { result: true, operator: '系统', reason: '风险控制' } }
2020-11-23 - 如何联表查询用户指定的信息?
① user 表 { _id: user_1, openId: 123, nickName: 爱去宁国, avatarUrl: http://mp.weixin.com/123.jpg, points: 100 } ② info 表 { _id: info_1, _openid: 123, createTime: 2020-08-29 } ③ 我想根据 info 表的 _openid 联表查询用户信息,预期返回结果如下: { _id: info_1, _openid: 123, createTime: 2020-08-29, creator: { userId: user_1 nickName: 爱去宁国, creatorAvatarUrl: http://mp.weixin.com/123.jpg } } 哪位老哥指点下,感谢
2020-08-29 - 小程序端调用 db.collection.doc.update 数据没更新,不知道是什么原因?
// 数据库权限设置为:所有用户可读,仅创建者可读写 // 这条 ID 的数据是我自己创建的数据,ID 也没有错 // 小程序端代码 const db = wx.cloud.database() db.collection('second-hand') .doc(id) .update({ data: { quantity: 0, } }) // 返回 { errMsg: "document.update:ok", stats: {updated: 0} } // 有人知道是什么问题么,感谢
2020-08-06 - WEUI Half Screen Dialog 真机右上角三个点闲置有问题?
[图片] [图片]
2020-07-28 - 联系了我们市级的网信办,可是他们也不是很清楚具体的审核流程,应该怎么办?
联系了当地的网信办,可是他们不是很清楚具体的审核流程,应该怎么办? 联系省级(安徽省)吗?
2020-07-27 - 跪求小程序团队将 app.global中的数据设置成响应式的?
肯定会收到一大波暂
2020-06-10 - 支付回调多次调用,不知道是否正常?
日志内容 Request ID: 5ee25738-a571-11ea-92e9-52540018bbb2 执行时间: 268ms内存使用: 27.60 MB 返回结果 null 日志 START RequestId: 5ee25738-a571-11ea-92e9-52540018bbb2 Event RequestId: 5ee25738-a571-11ea-92e9-52540018bbb2 2020-06-03T08:08:13.069Z 支付回调 event { appid: 'wxd2d16a504f24665e', attach: 'orderId=f2a60d815ed75a170034d5bd77e4d471&ngId=5d00f012db5fe76b2daf5359', bankType: 'CMB_CREDIT', cashFee: 1, feeType: 'CNY', isSubscribe: 'N', mchId: '1800008281', nonceStr: 'NGACMBK20200603160647713NS010582', openid: 'oPoo447SiviJ8pgkfmBP-nmD6hAk', outTradeNo: 'NGACMBK20200603160647713OT010582', resultCode: 'SUCCESS', returnCode: 'SUCCESS', subAppid: 'wxfd8c68c4a916e5f7', subIsSubscribe: 'N', subMchId: '1503004961', subOpenid: 'oSkWu4lD_R-3fj0Hed1P3KhBcmbk', timeEnd: '20200603160705', totalFee: 1, tradeType: 'JSAPI', transactionId: '4200000550202006030095980471', userInfo: { appId: 'wxfd8c68c4a916e5f7', openId: 'oSkWu4lD_R-3fj0Hed1P3KhBcmbk' } } END RequestId: 5ee25738-a571-11ea-92e9-52540018bbb2 Report RequestId: 5ee25738-a571-11ea-92e9-52540018bbb2 Duration:268ms Memory:256MB MemUsage:27.597656MB 日志内容 Request ID: 5bb34497-a571-11ea-86ca-525400b79590 执行时间: 125ms内存使用: 29.51 MB 返回结果 null 日志 START RequestId: 5bb34497-a571-11ea-86ca-525400b79590 Event RequestId: 5bb34497-a571-11ea-86ca-525400b79590 2020-06-03T08:08:07.673Z 支付回调 event { appid: 'wxd2d16a504f24665e', attach: 'orderId=f2a60d815ed75a170034d5bd77e4d471&ngId=5d00f012db5fe76b2daf5359', bankType: 'CMB_CREDIT', cashFee: 1, feeType: 'CNY', isSubscribe: 'N', mchId: '1800008281', nonceStr: 'NGACMBK20200603160647713NS010582', openid: 'oPoo447SiviJ8pgkfmBP-nmD6hAk', outTradeNo: 'NGACMBK20200603160647713OT010582', resultCode: 'SUCCESS', returnCode: 'SUCCESS', subAppid: 'wxfd8c68c4a916e5f7', subIsSubscribe: 'N', subMchId: '1503004961', subOpenid: 'oSkWu4lD_R-3fj0Hed1P3KhBcmbk', timeEnd: '20200603160705', totalFee: 1, tradeType: 'JSAPI', transactionId: '4200000550202006030095980471', userInfo: { appId: 'wxfd8c68c4a916e5f7', openId: 'oSkWu4lD_R-3fj0Hed1P3KhBcmbk' } } END RequestId: 5bb34497-a571-11ea-86ca-525400b79590 Report RequestId: 5bb34497-a571-11ea-86ca-525400b79590 Duration:125ms Memory:256MB MemUsage:29.511719MB [图片] outTradeNo 都是一样的,这正常吗?
2020-06-03 - 云端测试没问题,本地调试和小程序端报错?502005
云函数如下 const cloud = require('wx-server-sdk') cloud.init({ traceUser: true, env: cloud.DYNAMIC_CURRENT_ENV, }) const db = cloud.database() const ngCollection = db.collection('ng') const _ = db.command exports.main = async (event) => { const { type, payload } = event if (type === 'LIST') { console.log('123') return await ngCollection.get() } 云端测试没问题,能正常返回数据。 本地调试报错: 函数执行失败(耗时 147ms) Error: errCode: -502005 database collection not exists | errMsg: [ResourceNotFound] Db or Table not exist. Please check your request, but if the problem cannot be solved, contact us.; 小程序端报错:errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID local_debug_0dd9ba91-74f4-4597-9964-1e6e098511e9, cloud function service error code -1, error message errCode: -502005 database collection not exists | errMsg: [ResourceNotFound] Db or Table not exist. Please check your request, but if the problem cannot be solved, contact us.; ; at cloud.callFunction api; 不知道是什么问题。是 env 吗?
2020-05-25 - 通过 useExtendedLib 扩展库 的方式引入 weui,使用 grids 组件报错为什么?
{ "navigationBarTitleText": "", "usingComponents": { "mp-grids": "weui-miniprogram/grids/grids" } } 报:Error: Component is not found in path "pages/home/weui-miniprogram/grids/grids" (using by "pages/home/home")
2020-05-21