shareable.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view>
  3. <page ref="list" />
  4. </view>
  5. </template>
  6. <script>
  7. import page from "./modules/page.vue";
  8. export default {
  9. components: { page },
  10. data() {
  11. return {
  12. id: "",
  13. detail: {}
  14. }
  15. },
  16. onLoad(options) {
  17. if (options.id) {
  18. this.id = options.id - 0;
  19. setTimeout(() => {
  20. this.$refs.list.getDetail(this.id).then(detail => {
  21. this.detail = detail;
  22. })
  23. }, 100)
  24. }
  25. },
  26. methods: {
  27. getSheraDate() {
  28. let detail = this.detail
  29. return {
  30. title: detail.title, // 标题
  31. path: "/packageA/advertising/shareable?id=" + detail.sat_sharematerialid, // 分享路径
  32. imageUrl: this.detail.attinfos.find(v => v.usetype == "avatar").url || ""// 分享图
  33. };
  34. }
  35. },
  36. onShareAppMessage(res) {
  37. return this.getSheraDate()
  38. },
  39. onShareTimeline() {
  40. return this.getSheraDate()
  41. }
  42. }
  43. </script>
  44. <style></style>