support share in wechat and timeline

This commit is contained in:
Daniel Kou 2026-05-11 17:17:19 +08:00
parent f354db835f
commit 19f68c8c41

32
main.js
View File

@ -10,6 +10,22 @@ Vue.config.productionTip = false
import uView from 'uni_modules/uview-ui';
Vue.use(uView);
// 全局分享 mixin - 所有页面默认开启分享到微信好友和朋友圈
Vue.mixin({
onShareAppMessage() {
return {
title: '汇商生活家',
path: '/pages/index/index'
}
},
onShareTimeline() {
return {
title: '汇商生活家',
query: ''
}
}
})
// 导入工具函数
import { processImageUrl } from './utils/index.js'
@ -39,6 +55,22 @@ const app = createApp(App)
// 安装 uView
app.use(uView)
// 全局分享 mixin - 所有页面默认开启分享到微信好友和朋友圈
app.mixin({
onShareAppMessage() {
return {
title: '汇商生活家',
path: '/pages/index/index'
}
},
onShareTimeline() {
return {
title: '汇商生活家',
query: ''
}
}
})
// 导入工具函数
import { processImageUrl } from './utils/index.js'