page.vue 1.7 KB

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