You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
9 months ago
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
share: {
|
||
|
title: '智能充电,安全实惠',
|
||
|
path: "/pages/login/index",
|
||
|
imageUrl: `${this.baseImgURL}/wxShare.png`,
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
// 发送给朋友
|
||
|
onShareAppMessage(res) {
|
||
|
// 来自页面内的按钮的转发
|
||
|
if (res.from == 'button') {
|
||
|
console.log("按钮转发--配置");
|
||
|
}
|
||
|
// 获取加载的页面
|
||
|
let pages = getCurrentPages(),
|
||
|
// 获取当前页面的对象
|
||
|
view = pages[pages.length - 1];
|
||
|
this.share.path = `/${view.route}`;
|
||
|
|
||
|
//转发参数
|
||
|
return this.share;
|
||
|
},
|
||
|
//分享到朋友圈
|
||
|
onShareTimeline(res) {
|
||
|
// 获取加载的页面
|
||
|
let pages = getCurrentPages(),
|
||
|
// 获取当前页面的对象
|
||
|
view = pages[pages.length - 1];
|
||
|
// console.log("获取加载的页面", pages);
|
||
|
console.log("当前页面的对象", view);
|
||
|
this.share.path = `/${view.route}`;
|
||
|
//转发参数
|
||
|
return this.share;
|
||
|
}
|
||
|
}
|