share.js 923 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. var common_vendor = require("../../common/vendor.js");
  3. var core_config_index = require("../config/index.js");
  4. var share = {
  5. data() {
  6. return {
  7. share: {
  8. title: core_config_index.config.get("name"),
  9. path: `/pages/home/index`,
  10. imageUrl: core_config_index.config.getResource("logo.png")
  11. }
  12. };
  13. },
  14. onShareAppMessage(res) {
  15. let shareInfo = common_vendor.index.getStorageSync("shareInfo");
  16. return {
  17. title: shareInfo.title || this.share.title,
  18. imageUrl: shareInfo.imgUrl || this.share.imageUrl,
  19. path: shareInfo.path || this.share.path
  20. };
  21. },
  22. onShareTimeline(res) {
  23. let shareInfo = common_vendor.index.getStorageSync("shareInfo");
  24. return {
  25. title: shareInfo.title || this.share.title,
  26. imageUrl: shareInfo.imgUrl || this.share.imageUrl,
  27. path: shareInfo.path || this.share.path
  28. };
  29. }
  30. };
  31. exports.share = share;