优化
This commit is contained in:
@@ -183,18 +183,32 @@ export default {
|
||||
InvitingPartyEventindex: null,
|
||||
chatInfo: {},
|
||||
currentConversation: null,
|
||||
inid: null,
|
||||
// parentMessage: null,
|
||||
style: {
|
||||
backgroundColor: "#ffffff",
|
||||
},
|
||||
};
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
if (res.from === 'menu') {
|
||||
return {
|
||||
title: '分享',
|
||||
path: `${getCurrentPages()[getCurrentPages().length - 1].route}?inid=${this.item.id}`,
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.inid = options.inid;
|
||||
if (this.inid) {
|
||||
this.GetonShareAppMessagedata();
|
||||
}
|
||||
// 获取源页面的eventChannel对象
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
// 监听itemDetail事件
|
||||
eventChannel.on("itemDetail", (data) => {
|
||||
this.item = data.item; // 将接收到的数据赋值给item
|
||||
console.log(" itemDetail", data.item);
|
||||
});
|
||||
|
||||
uni.getStorage({
|
||||
@@ -211,6 +225,29 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//分享直接获取数据
|
||||
GetonShareAppMessagedata() {
|
||||
request({
|
||||
url: "pk/pkInfoDetail",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.inid,
|
||||
userId: this.id,
|
||||
},
|
||||
userInfo: true,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.item = res.data;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//修改信息
|
||||
// onRecompose(item) {
|
||||
// this.parentMessage = item;
|
||||
@@ -232,6 +269,11 @@ export default {
|
||||
Returnfunc() {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
fail: () => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/Home/Home',
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
open() {
|
||||
|
||||
Reference in New Issue
Block a user