page.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view>
  3. <block v-if="detail.type == 1">
  4. <image v-for="(item, index) in detail.attinfos_pic" :key="item.attachmentid" class="image"
  5. :src="item.attinfos[0].url" mode="widthFix" hover-class="navigator-hover" lazy-load="true"
  6. @click="onClick(item, index)" />
  7. </block>
  8. <u-parse v-else-if="detail.type == 3" :content="detail.content" />
  9. <bottom1 v-if="detail.sharepagecontrol.style_bottom == '默认黑色预约报名样式'" />
  10. <view v-else style="height: 10px;" />
  11. </view>
  12. </template>
  13. <script>
  14. import { viewImage } from "../../../utils/settleFiles";
  15. import bottom1 from "../../../components/bottomModules/bottom1.vue";
  16. export default {
  17. name: "advertisingPage",
  18. components: { bottom1 },
  19. data() {
  20. return {
  21. detail: {
  22. type: 1,//1图片 2视频 3图文
  23. content: ""
  24. },
  25. }
  26. },
  27. methods: {
  28. getDetail(id) {
  29. return new Promise((resolve, reject) => {
  30. this.$Http.basic({
  31. "id": "20240408131902",
  32. "content": {
  33. "sat_sharematerialid": id
  34. }
  35. }).then(res => {
  36. console.log('获取长图文详情', res)
  37. if (this.cutoff(res.msg)) return;
  38. this.detail = res.data;
  39. resolve(res.data)
  40. uni.setNavigationBarTitle({
  41. title: res.data.title,
  42. })
  43. })
  44. })
  45. },
  46. onClick(item, index) {
  47. console.log(item, index)
  48. if (item.jumpurl) {
  49. uni.navigateTo({
  50. url: item.jumpurl,
  51. fail: (fail) => {
  52. viewImage(item.attinfos[0].url)
  53. },
  54. })
  55. } else {
  56. viewImage(item.attinfos[0].url)
  57. }
  58. }
  59. },
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .image {
  64. width: 100vw;
  65. margin-top: 10px;
  66. }
  67. .image:first-child {
  68. margin-top: 0;
  69. }
  70. </style>