page.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. <bottomForm v-if="detail.sharepagecontrol.style_bottom" :bottomType="detail.sharepagecontrol.style_bottom"
  10. :type="detail.sharepagecontrol.style_signup" ownertable="sat_sharematerial" :ownerid="detail.sat_sharematerialid" />
  11. <view v-else style="height: 10px;" />
  12. </view>
  13. </template>
  14. <script>
  15. import { viewImage } from "../../../utils/settleFiles";
  16. export default {
  17. name: "advertisingPage",
  18. data() {
  19. return {
  20. detail: {
  21. type: 1,//1图片 2视频 3图文
  22. content: ""
  23. },
  24. }
  25. },
  26. methods: {
  27. getDetail(id) {
  28. return new Promise((resolve, reject) => {
  29. this.$Http.basic({
  30. "id": "20240408131902",
  31. "content": {
  32. "sat_sharematerialid": id
  33. }
  34. }).then(res => {
  35. console.log('获取长图文详情', res)
  36. if (this.cutoff(res.msg)) return;
  37. let tips = '';
  38. if (!res.data.status) {
  39. tips = '数据已过期'
  40. } else {
  41. if (res.data.status != '发布') tips = '敬请期待!'
  42. };
  43. if (tips) {
  44. uni.showModal({
  45. title: '提示',
  46. content: tips,
  47. showCancel: false,
  48. complete: (complete) => {
  49. uni.navigateBack();
  50. },
  51. })
  52. } else {
  53. this.detail = res.data;
  54. resolve(res.data)
  55. uni.setNavigationBarTitle({
  56. title: res.data.title,
  57. })
  58. }
  59. })
  60. })
  61. },
  62. onClick(item, index) {
  63. console.log(item, index)
  64. if (item.jumpurl) {
  65. uni.navigateTo({
  66. url: item.jumpurl,
  67. fail: (fail) => {
  68. viewImage(item.attinfos[0].url)
  69. },
  70. })
  71. } else {
  72. viewImage(item.attinfos[0].url)
  73. }
  74. }
  75. },
  76. }
  77. </script>
  78. <style lang="scss" >
  79. image,
  80. img {
  81. display: block;
  82. vertical-align: bottom;
  83. }
  84. .image {
  85. width: 100vw;
  86. }
  87. .image:first-child {
  88. margin-top: 0;
  89. }
  90. </style>