page.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view>
  3. <block v-if="detail.type == 1">
  4. <image
  5. v-for="(item, index) in detail.attinfos_pic"
  6. :key="item.attachmentid"
  7. class="image"
  8. :src="item.attinfos[0].url"
  9. mode="widthFix"
  10. hover-class="navigator-hover"
  11. lazy-load="true"
  12. @click="onClick(item, index)"
  13. />
  14. </block>
  15. <u-parse v-else-if="detail.type == 3" :content="detail.content" />
  16. <bottomForm
  17. v-if="detail.sharepagecontrol.style_bottom"
  18. :shareuserid="shareuserid"
  19. :bottomType="detail.sharepagecontrol.style_bottom"
  20. :type="detail.sharepagecontrol.style_signup"
  21. ownertable="sat_sharematerial"
  22. :ownerid="detail.sat_sharematerialid"
  23. />
  24. <view v-else style="height: 10px" />
  25. </view>
  26. </template>
  27. <script>
  28. import { viewImage } from "../../../utils/settleFiles";
  29. export default {
  30. name: "advertisingPage",
  31. props: {
  32. shareuserid: {
  33. type: [String, Number],
  34. default: 0,
  35. },
  36. },
  37. data() {
  38. return {
  39. detail: {
  40. type: 1, //1图片 2视频 3图文
  41. content: "",
  42. },
  43. };
  44. },
  45. methods: {
  46. getDetail(id) {
  47. return new Promise((resolve, reject) => {
  48. this.$Http
  49. .basic({
  50. id: "20240408131902",
  51. content: {
  52. sat_sharematerialid: id,
  53. },
  54. })
  55. .then((res) => {
  56. console.log("获取长图文详情", res);
  57. if (this.cutoff(res.msg)) return;
  58. let tips = "";
  59. if (!res.data.status) {
  60. tips = "数据已过期";
  61. } else {
  62. if (res.data.status != "发布") tips = "敬请期待!";
  63. }
  64. if (tips) {
  65. uni.showModal({
  66. title: "提示",
  67. content: tips,
  68. showCancel: false,
  69. complete: (complete) => {
  70. uni.navigateBack();
  71. },
  72. });
  73. } else {
  74. this.detail = res.data;
  75. resolve(res.data);
  76. uni.setNavigationBarTitle({
  77. title: res.data.title,
  78. });
  79. }
  80. });
  81. });
  82. },
  83. onClick(item, index) {
  84. console.log(item, index);
  85. if (item.jumpurl) {
  86. uni.navigateTo({
  87. url: item.jumpurl,
  88. fail: (fail) => {
  89. viewImage(item.attinfos[0].url);
  90. },
  91. });
  92. } else {
  93. viewImage(item.attinfos[0].url);
  94. }
  95. },
  96. },
  97. };
  98. </script>
  99. <style lang="scss" >
  100. image,
  101. img {
  102. display: block;
  103. vertical-align: bottom;
  104. }
  105. .image {
  106. width: 100vw;
  107. }
  108. .image:first-child {
  109. margin-top: 0;
  110. }
  111. </style>