马化腾先生,您能不能派一位技术人员帮我解决一下分享朋友圈问题,我实在是解决不了?Mr. Ma Huateng, can you send a technician to help me solve the problem of sharing circle of friends, I really can’t solve it?
马化腾先生,您能不能派一位技术人员帮我解决一下分享朋友圈问题,我实在是解决不了?
问题:用eventChannel.emit传递数据导致详情页分享朋友圈空白,这个问题应该怎么解决,
说明:以前我用云开发doc读取,转发朋友圈是可以的,现在用eventChannel.emit转发变成空白,这个问题困扰我一个月了,始终解决不了,哪位大神伸出援手,帮兄弟一把
// car.js 像被打开页面 carDel 传递数据
detail: function (event) {
let item = event.detail.item;
let _id = event.detail.id;
wx.navigateTo({
url: '../../car/carDel/carDel?id=' + _id,
success: function (res) {
res.eventChannel.emit('acceptDataFromOpenerPage', {
data: item
})
}
})
},
// carDel.js详情页
onLoad: function (options) {
let that = this;
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('acceptDataFromOpenerPage', function (data) {
that.setData({
list: data.data,
});
})
},
// 分享
onShareAppMessage: function (res) {
return {
title: this.data.list.three,
path: '/pages/car/car/car?id=' + this.data.list._id,
imageUrl: this.data.list.url[0]
}
},
// 朋友圈
onShareTimeline() {
return {
title: this.data.list.three
query: 这个位置怎么携带参数才能够在 eventChannel.on中打开朋友圈
imageUrl: this.data.list.url[0]
}
},
Question: Using eventChannel.emit How to solve the problem of blank sharing circle of friends in detail page caused by data transfer? Note: in the past, I used cloud development doc to read, and forwarding friend circle was OK. Now I use eventChannel.emit Forwarding has become a blank. This problem has been bothering me for a month, but it still can't be solved. Which God has reached out to help my brother// car.js Detail: function (event) {let item= event.detail.item ; let _ id = event.detail.id ; wx.navigateTo ({ url: '../../car/carDel/carDel?id=' + _ id, success: function (res) { res.eventChannel.emit ('acceptDataFromOpenerPage', { data: item }) } }) }, // carDel.js Detail page onload: function (options) {let that = this; const eventchannel= this.getOpenerEventChannel (); eventChannel.on ('acceptDataFromOpenerPage', function (data) { that.setData ({ list: data.data , }); }) }, //Share onshare appmessage: function (RES) {return {Title: this.data.list .three, path: '/pages/car/car/car?id=' + this.data.list . id, imageUrl: this.data.list . URL [0]}}, / / circle of friends onshare timeline() {return {Title: this.data.list . three query: how to carry parameters in this location eventChannel.on Open the circle of friends imageurl: this.data.list .url[0] } },
onShareTimeline() {
console.log(this.data.list)//需要知道这里的值。
return {
title: this.data.list.three
query: 这个位置怎么携带参数才能够在 eventChannel.on中打开朋友圈
imageUrl: this.data.list.url[0]
}
},