12345678910111213141516171819202122232425262728293031323334353637 |
- import { onLaunch, onShow, onHide, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
- import { getToken } from '@/utils/auth'
- export default {
- data() {
- return {
- // 可全局覆盖的默认参数
- shareConfig: {
- title: '金邻助家-着力打造全国居家服务行业标准和建立综合信用评价体系',
- path: `/pages/login?scene=${uni.getStorageSync('userType')}:${uni.getStorageSync('userId')}`,
- // path:'/pages/index',
- // imageUrl: '/static/serverImg/mine/user.png',
- imageUrl:''
- }
- }
- },
- onLaunch:function () {
- uni.showShareMenu({
- withShareTicket: true,
- menus: ['shareAppMessage', 'shareTimeline']
- })
- },
- onShareAppMessage() {
- return {
- title: this.shareConfig.title,
- path: this.shareConfig.path,
- imageUrl: this.shareConfig.imageUrl
- }
- },
- onShareTimeline() {
- return {
- title: this.shareConfig.title,
- query: `scene=${uni.getStorageSync('userType')}:${uni.getStorageSync('userId')}`,
- // query:``,
- imageUrl: this.shareConfig.imageUrl
- }
- }
- }
|