InteractInfo.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="InteractInfo">
  3. <!-- 图片盒子 -->
  4. <div class="title">
  5. <van-swipe class="my-swipe" :autoplay="5000" indicator-color="white">
  6. <van-swipe-item
  7. @click="lookImg(baseURL+item.filePath)"
  8. v-for="item in imgList"
  9. :key="item.id"
  10. >
  11. <img
  12. class="bacImg"
  13. v-lazy="baseURL+item.filePath"
  14. alt=""
  15. />
  16. </van-swipe-item>
  17. </van-swipe>
  18. </div>
  19. <!-- 畅游芜湖 -->
  20. <div class="titLoc">
  21. <div class="ll">
  22. <img :src="info.avatarUrl" alt="" />
  23. </div>
  24. <div class="rr">
  25. <h3>{{info.nickName}}</h3>
  26. <p><van-icon name="location" />{{info.positionName}}</p>
  27. </div>
  28. </div>
  29. <!-- 文字内容 -->
  30. <div class="txt">
  31. <h3>{{info.name}}</h3>
  32. <div v-html="info.description"></div>
  33. <div class="lastInfo">
  34. <div>#{{info.dictTopicName}}</div>
  35. <p>{{info.createTime}}</p>
  36. </div>
  37. </div>
  38. </div>
  39. </template>
  40. <script>
  41. import { baseURL } from "@/utils/request";
  42. import {getInfoAPI} from '@/api/interact'
  43. import { ImagePreview } from "vant";
  44. export default {
  45. name: "InteractInfo",
  46. components: {},
  47. data() {
  48. return {
  49. baseURL,
  50. info:{},
  51. imgList:[]
  52. };
  53. },
  54. computed: {},
  55. watch: {},
  56. methods: {
  57. lookImg(url) {
  58. ImagePreview({
  59. images: [url],
  60. showIndex: false,
  61. });
  62. },
  63. },
  64. async created() {
  65. const id =this.$route.params.id
  66. const res =await getInfoAPI(id)
  67. this.info=res.data.entity
  68. this.imgList=res.data.file
  69. },
  70. mounted() {},
  71. beforeCreate() {}, //生命周期 - 创建之前
  72. beforeMount() {}, //生命周期 - 挂载之前
  73. beforeUpdate() {}, //生命周期 - 更新之前
  74. updated() {}, //生命周期 - 更新之后
  75. beforeDestroy() {}, //生命周期 - 销毁之前
  76. destroyed() {}, //生命周期 - 销毁完成
  77. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  78. };
  79. </script>
  80. <style lang='less' scoped>
  81. .InteractInfo {
  82. width: 100%;
  83. height: 100%;
  84. overflow-y: auto;
  85. padding: 20px 15px;
  86. .title {
  87. width: 100%;
  88. height: 200px;
  89. position: relative;
  90. .my-swipe {
  91. width: 100%;
  92. height: 100%;
  93. }
  94. .my-swipe .van-swipe-item {
  95. border-radius: 8px;
  96. }
  97. .bacImg {
  98. border-radius: 8px;
  99. width: 100%;
  100. height: 100%;
  101. object-fit: cover;
  102. pointer-events: none;
  103. }
  104. /deep/.van-swipe__indicators {
  105. bottom: 5px;
  106. }
  107. /deep/.van-swipe__indicator {
  108. opacity: 0.6;
  109. }
  110. /deep/.van-swipe__indicator--active {
  111. opacity: 1;
  112. }
  113. }
  114. .titLoc {
  115. display: flex;
  116. margin: 20px 0;
  117. .ll {
  118. margin-right: 10px;
  119. width: 40px;
  120. height: 40px;
  121. border-radius: 50%;
  122. overflow: hidden;
  123. & > img {
  124. width: 100%;
  125. height: 100%;
  126. }
  127. }
  128. .rr {
  129. display: flex;
  130. flex-direction: column;
  131. justify-content: space-between;
  132. h3 {
  133. font-size: 16px;
  134. }
  135. p {
  136. font-size: 14px;
  137. color: #868686;
  138. }
  139. }
  140. }
  141. .txt {
  142. h3 {
  143. font-size: 16px;
  144. margin-bottom: 12px;
  145. }
  146. p {
  147. font-size: 14px;
  148. margin-bottom: 12px;
  149. line-height: 24px;
  150. color: #5c5c5c;
  151. }
  152. .lastInfo {
  153. margin-top: 22px;
  154. color: #868686;
  155. display: flex;
  156. align-items: center;
  157. & > div {
  158. margin-right: 8px;
  159. font-size: 14px;
  160. border-radius: 15px;
  161. border: 1px solid #868686;
  162. min-width: 60px;
  163. padding: 0 10px;
  164. height: 30px;
  165. line-height: 28px;
  166. }
  167. & > p {
  168. font-size: 12px;
  169. margin: 0;
  170. }
  171. }
  172. }
  173. }
  174. </style>