page.vue 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. let tips = '';
  39. if (!res.data.status) {
  40. tips = '数据已过期'
  41. } else {
  42. if (res.data.status != '发布') tips = '敬请期待!'
  43. };
  44. if (tips) {
  45. uni.showModal({
  46. title: '提示',
  47. content: tips,
  48. showCancel: false,
  49. complete: (complete) => {
  50. uni.navigateBack();
  51. },
  52. })
  53. } else {
  54. this.detail = res.data;
  55. resolve(res.data)
  56. uni.setNavigationBarTitle({
  57. title: res.data.title,
  58. })
  59. }
  60. })
  61. })
  62. },
  63. onClick(item, index) {
  64. console.log(item, index)
  65. if (item.jumpurl) {
  66. uni.navigateTo({
  67. url: item.jumpurl,
  68. fail: (fail) => {
  69. viewImage(item.attinfos[0].url)
  70. },
  71. })
  72. } else {
  73. viewImage(item.attinfos[0].url)
  74. }
  75. }
  76. },
  77. }
  78. </script>
  79. <style lang="scss" >
  80. image,
  81. img {
  82. display: block;
  83. vertical-align: bottom;
  84. }
  85. .image {
  86. width: 100vw;
  87. }
  88. .image:first-child {
  89. margin-top: 0;
  90. }
  91. </style>