百富门答题小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
910 B

3 weeks ago
  1. import { mapState } from 'vuex'
  2. export default {
  3. data() {
  4. return {
  5. // 默认的全局分享内容
  6. Gshare: {
  7. // title: '三只青蛙',
  8. path: '/pages/index/index', // 全局分享的路径,比如 首页
  9. // imageUrl: '/static/image/login/logo.png', // 全局分享的图片(可本地可网络)
  10. }
  11. }
  12. },
  13. computed: {
  14. ...mapState(['configList', 'userInfo']),
  15. },
  16. // 定义全局分享
  17. // 1.发送给朋友
  18. onShareAppMessage(res) {
  19. let o = {
  20. ...this.Gshare,
  21. title : this.configList.logo_name,
  22. }
  23. if(this.userInfo.id){
  24. o.path = this.Gshare.path + '?shareId=' + this.userInfo.id
  25. }
  26. return o
  27. },
  28. //2.分享到朋友圈
  29. onShareTimeline(res) {
  30. let o = {
  31. ...this.Gshare,
  32. title : this.configList.logo_name,
  33. }
  34. if(this.userInfo.id){
  35. o.path = this.Gshare.path + '?shareId=' + this.userInfo.id
  36. }
  37. return o
  38. },
  39. methods: {
  40. }
  41. }