app.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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','userInfo'])
  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. // path: `/pages/index/index?invite_code=FPTR88`,
  37. imageUrl: mnp_share_image
  38. }
  39. // #endif
  40. return share
  41. },
  42. onShareTimeline() {
  43. const { h5_share_image, share_intro, share_title } = this.appConfig.share
  44. // #ifdef H5
  45. const share = {
  46. title: share_title,
  47. imageUrl: h5_share_image
  48. }
  49. // #endif
  50. // #ifdef MP-WEIXIN
  51. const share = {
  52. title: mnp_share_title,
  53. imageUrl: mnp_share_image
  54. }
  55. // #endif
  56. return share
  57. }
  58. };