share.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // share.js
  2. export default {
  3. // 发送给朋友,有默认配置项。
  4. onShareAppMessage() {
  5. return {
  6. title: '开邻智教', //分享的标题
  7. //path: 'pages/index/index', //点击分享链接之后进入的页面路径
  8. //imageUrl: '/static/logo.png', //分享发送的链接图片地址
  9. success() {
  10. // 分享完成,请注意此时不一定是成功分享
  11. uni.showToast({
  12. title: "分享成功",
  13. duration: 3500,
  14. icon: "success"
  15. });
  16. },
  17. fail() {
  18. // 分享失败
  19. uni.showToast({
  20. title: "分享失败",
  21. duration: 3500,
  22. icon: "error"
  23. });
  24. }
  25. };
  26. },
  27. // 分享到朋友圈,有默认配置项。
  28. onShareTimeline() {
  29. return {
  30. title: '开邻智教', //分享的标题
  31. //query: 'pages/index/index', //点击分享链接之后进入的页面路径
  32. //imageUrl: '/static/logo.png' ,//分享发送的链接图片地址
  33. success() {
  34. // 分享完成
  35. uni.showToast({
  36. title: "分享成功",
  37. duration: 3500,
  38. icon: "success"
  39. });
  40. },
  41. fail() {
  42. // 分享失败
  43. uni.showToast({
  44. title: "分享失败",
  45. duration: 3500,
  46. icon: "error"
  47. });
  48. }
  49. }
  50. },
  51. };