navigate经过2次跳转后,在back时没有触发最后一次的 eventChannel.emit 写了个代码片段 https://developers.weixin.qq.com/s/AeZFcImq7xhX
navigateTo 两次跳转后,无法正常返回数据A页面navigateTo B页面,然后B页面 navigateTo C页面 代码如下 A页面 wx.navigateTo({ url: '../../my/customer/customerList/customerList?from=customerStatistics', events:{ sendDataFromCustomerList:data=>{ console.log(data); } } }); B页面 wx.navigateTo({ url:'../customerSearch/customerSearch?from='+this.data.from, events:{ sendDataFromCustomerSearch: data => { console.log("=======>",data); const eventChannel = this.getOpenerEventChannel() eventChannel.emit('sendDataFromCustomerList',data); wx.navigateBack(); } } }) C页面 const eventChannel = this.getOpenerEventChannel() eventChannel.emit('sendDataFromCustomerSearch', {customer:this.data.customerList[event.currentTarget.id]}); wx.navigateBack(); 期望C页面的数据返回给B页面,B页面再返回给A页面 问题是现在B页面接收到了数据,但是A页面并没有监听到B页面发送的事件,也就没有接收到数据 当我把B页面发送数据的代码EventChannel.emit 添加timeOut 100毫秒后,就正常了 微信开发工具版本号 稳定版 Stable Build (1.03.2005140) 调试基础库 2.8.1 真机测试 iPhone8 iOS 13.4.1
2020-05-30elemMatch 这个好用! 感谢! 另外还有个问题求解 我的订单表 order 里有商品 goods的id 的数组[图片] 我现在是先把订单表的数据拿到,然后再通过订单里的商品id去查商品,需要2次操作才能拿到全部数据 有没有办法一次拿到订单数据,以及订单里商品数组对应的商品信息?
如何对集合中的数组进行筛选?我的客户表结构如下: [图片] 需求是输入关键字,要对所有用户的名字或者用户的车名进行模糊查询 例如一个用户叫 小红,另外一个用户有一辆 红旗轿车 要求输入 "红" 要把这两个用户都筛选出来 请问应该怎么写才能查到呢?
2020-05-27 var db = cloud.database() var $ = db.command.aggregate return db.collection('goods').aggregate() .lookup({ from: "goods_type", localField: "goodsTypeId", foreignField: "_id", as: "goodsTypeList" }) .replaceRoot({ newRoot: $.mergeObjects([ $.arrayElemAt(['$goodsTypeList', 0]), '$$ROOT' ]) }) .project({ goodsTypeList: 0 }) .end() 照着lookup的例子做出来了,实现了我想要的效果,只是不明白怎么实现的... .replaceRoot({ newRoot: $.mergeObjects([ $.arrayElemAt(['$goodsTypeList', 0]), '$$ROOT' ]) }) .project({ goodsTypeList: 0 }) 尤其是这一部分
请教一下表连接应该怎么做?大家好,我最近刚刚开始做小程序的开发,对云数据库的操作有很多疑问,请教一下关于表连接的写法 我有两个表 商品表goods 和 商品类型表goods_type 商品表字段:_id name goodsTypeid 商品类型表字段:_id,title 我希望能一次性获取到 商品表信息,同时每个商品对应的商品类型title也拿到 现在我是这么写的 cloud.database().collection("goods") .aggregate() .lookup({ //表连接 A+B from: 'goods_type', //A表字段 localField: 'goodsTypeId', //对应B表字段 foreignField: '_id', //B表别名 as: 'goodsTypeList' }) .end(); 这样我确实拿到了商品表的信息,但是商品表里的类型是数组的形式给我的,数组里有一条数据,就是商品对应的类型 请问我应该怎么做才可以直接获取到类型title,而不是数组呢?
2020-05-26扫了10分钟上不去,开发工具重启,电脑重启,都不行 发个帖子反应一下 再扫一次试试,成功了??? 我怀疑你们在监控我 (-_-!)
开发者工具无法登录[图片] 微信显示成功了,但是开发者工具就是不行
2020-05-19