toParticulars(e) {
console.log(e.currentTarget.dataset.id);
var j = e.currentTarget.dataset.id;
let list = this.data.lists;
for (var i = 0; i < list.length; i++) {
if (list[i].id == j) {
listconnect[0] = list[i];
}
}
wx.navigateTo({
url: "/pages/notice/detail",
success: (res) => {
res.eventChannel.emit("acceptDataFromOpenerPage", {
data: listconnect,
});
},
});
}
onLoad: function (options) {
const eventChannel = this.getOpenerEventChannel()
eventChannel.on('acceptDataFromOpenerPage', function (data) {
console.log(data.data)
list = data.data
})
this.setData({
list: list
})
},
手机型号是iphone11
1、JS异步问题。
list = data.data that.setData()//必须紧跟着写在这里,才有数据。