分享图片自定义

This commit is contained in:
linfeng 2023-05-16 09:40:33 +08:00
parent 6dfb588983
commit 27231d6325

View File

@ -92,7 +92,8 @@
data() { data() {
return { return {
userInfo: '', userInfo: '',
hasLogin: false hasLogin: false,
shareCover: 'http://pic.linfeng.tech/logo.png'
}; };
}, },
onLoad() { onLoad() {
@ -102,6 +103,7 @@
menus: ['shareAppMessage', 'shareTimeline'] menus: ['shareAppMessage', 'shareTimeline']
}); });
//#endif //#endif
this.getSysInfo()
}, },
onShow() { onShow() {
if (uni.getStorageSync('hasLogin')) { if (uni.getStorageSync('hasLogin')) {
@ -112,11 +114,10 @@
} }
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let imgURL = 'http://pic.linfeng.tech/logo.png';
return { return {
title: this.$c.miniappName, title: this.$c.miniappName,
path: '/pages/index/index', path: '/pages/index/index',
imageUrl: imgURL imageUrl: this.shareCover
}; };
}, },
methods: { methods: {
@ -145,6 +146,11 @@
url: url url: url
}); });
}, },
getSysInfo() {
this.$H.get('system/miniConfig').then(res => {
this.shareCover = res.result.intro;
});
},
commercialLink() { commercialLink() {
// #ifdef H5 // #ifdef H5
window.open("https://www.linfeng.tech") window.open("https://www.linfeng.tech")