app.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import {
  2. mapGetters,
  3. mapMutations
  4. } from 'vuex'
  5. import wechath5 from '@/utils/wechath5'
  6. import {isWeixinClient, currentPage, paramsToStr} from '@/utils/tools'
  7. import Cache from "@/utils/cache"
  8. import color from '@/config/color'
  9. export default {
  10. data() {
  11. return {
  12. colorConfig: color
  13. };
  14. },
  15. async onLoad(option) {
  16. },
  17. methods: {
  18. },
  19. computed: {
  20. ...mapGetters(['isLogin','inviteCode','appConfig'])
  21. },
  22. // 全局配置分享
  23. onShareAppMessage() {
  24. const { h5_share_image, share_intro, share_title, mnp_share_title, mnp_share_image } = this.appConfig.share
  25. // #ifdef H5
  26. const share = {
  27. title: share_title,
  28. path: `/pages/index/index?invite_code=${this.inviteCode}`,
  29. imageUrl: h5_share_image
  30. }
  31. // #endif
  32. // #ifdef MP-WEIXIN
  33. const share = {
  34. title: mnp_share_title,
  35. path: `/pages/index/index?invite_code=${this.inviteCode}`,
  36. imageUrl: mnp_share_image
  37. }
  38. // #endif
  39. return share
  40. },
  41. onShareTimeline() {
  42. const { h5_share_image, share_intro, share_title } = this.appConfig.share
  43. // #ifdef H5
  44. const share = {
  45. title: share_title,
  46. imageUrl: h5_share_image
  47. }
  48. // #endif
  49. // #ifdef MP-WEIXIN
  50. const share = {
  51. title: mnp_share_title,
  52. imageUrl: mnp_share_image
  53. }
  54. // #endif
  55. return share
  56. }
  57. };