diff --git a/pages/index/index.vue b/pages/index/index.vue index 15cf0ff..b95b964 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,6 +24,7 @@ import { getLocationParams } from "@/common/utils.js"; import GetPhonePopup from "@/components/base/getphonePopup.vue"; import { subscription } from "@/utils/common.js" + export default { components: { TabBar, GetPhonePopup @@ -47,9 +48,27 @@ }; }, mounted() { + uni.showShareMenu({ + withShareTicket: true, + menus: ["shareAppMessage"] + }); + this.phone = uni.getStorageSync("registerPhone"); getLogin(); }, + //分享好友 + onShareAppMessage() { + return { + title: '环市东院区安防小程序', + imageUrl: '../../static/share.jpg', + }; + }, + //分享朋友圈 + // onShareTimeline() { + // return { + // title: '安防平台小程序', + // } + // }, onShow() { let pages = getCurrentPages(); const curPage = pages[pages.length - 1]; diff --git a/pages/index/index.vue b/pages/index/index.vue index 15cf0ff..b95b964 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,6 +24,7 @@ import { getLocationParams } from "@/common/utils.js"; import GetPhonePopup from "@/components/base/getphonePopup.vue"; import { subscription } from "@/utils/common.js" + export default { components: { TabBar, GetPhonePopup @@ -47,9 +48,27 @@ }; }, mounted() { + uni.showShareMenu({ + withShareTicket: true, + menus: ["shareAppMessage"] + }); + this.phone = uni.getStorageSync("registerPhone"); getLogin(); }, + //分享好友 + onShareAppMessage() { + return { + title: '环市东院区安防小程序', + imageUrl: '../../static/share.jpg', + }; + }, + //分享朋友圈 + // onShareTimeline() { + // return { + // title: '安防平台小程序', + // } + // }, onShow() { let pages = getCurrentPages(); const curPage = pages[pages.length - 1]; diff --git a/static/share.jpg b/static/share.jpg new file mode 100644 index 0000000..20481b3 --- /dev/null +++ b/static/share.jpg Binary files differ