shareable.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view>
  3. <page :shareuserid="shareUserid" ref="list" />
  4. </view>
  5. </template>
  6. <script>
  7. import page from "./modules/page.vue";
  8. import { winTheCustomer } from "../../utils/share";
  9. export default {
  10. components: { page },
  11. data() {
  12. return {
  13. id: "",
  14. detail: {},
  15. shareUserid: 0,
  16. };
  17. },
  18. onLoad(options) {
  19. this.id = options.id - 0;
  20. this.isInitializeLogin(render.bind(this));
  21. function render() {
  22. this.$refs.list.getDetail(this.id).then((detail) => {
  23. this.detail = detail;
  24. });
  25. this.shareUserid = winTheCustomer(options.shareUserid || 0, "长图文", {
  26. ownertable: "sat_sharematerial",
  27. ownerid: this.id,
  28. });
  29. }
  30. },
  31. methods: {
  32. getSheraDate() {
  33. let detail = this.detail;
  34. return {
  35. title: detail.title, // 标题
  36. path:
  37. "/packageA/advertising/shareable?id=" +
  38. detail.sat_sharematerialid +
  39. "&shareUserid=" +
  40. this.shareUserid, // 分享路径
  41. imageUrl: "", // 分享图
  42. };
  43. },
  44. },
  45. onShareAppMessage(res) {
  46. return this.getSheraDate();
  47. },
  48. onShareTimeline() {
  49. return this.getSheraDate();
  50. },
  51. };
  52. </script>