share.js 605 B

123456789101112131415161718192021222324252627282930313233343536
  1. export default {
  2. data() {
  3. return {
  4. //设置默认的分享参数
  5. share: {
  6. title: 'USKY快速开发平台',
  7. path: '/pages/index/index',
  8. imageUrl: '',
  9. desc: '',
  10. content: ''
  11. }
  12. }
  13. },
  14. //#ifdef MP-WEIXIN
  15. onShareAppMessage(res) {
  16. return {
  17. title: this.share.title,
  18. path: this.share.path,
  19. imageUrl: this.share.imageUrl,
  20. desc: this.share.desc,
  21. content: this.share.content,
  22. success(res) {
  23. uni.showToast({
  24. title: '分享成功'
  25. })
  26. },
  27. fail(res) {
  28. uni.showToast({
  29. title: '分享失败',
  30. icon: 'none'
  31. })
  32. }
  33. }
  34. }
  35. //#endif
  36. }