informationDetail.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view>
  3. <!-- pages/me.wxml -->
  4. <view class="container">
  5. <h1 class="title">{{ detailInfo.titleName }}</h1>
  6. <view class="wenzhangLy">
  7. <!-- 头像昵称 -->
  8. <view class="txTime">
  9. <image :src="loadImgSrc(detailInfo.headImg!=null?detailInfo.headImg:'/profile/upload/2024/03/05/abf969632ee94bd5a429c8c2dbb2f6b4 (1)_20240305092823A002.png')" style="border-radius: 50px;"></image>
  10. <view class="time">
  11. <p>{{detailInfo.nickName?detailInfo.nickName:'网友'}}</p>
  12. <span>{{ detailInfo.createTime }}</span>
  13. </view>
  14. </view>
  15. <!-- 积分 -->
  16. <!-- <span class="jf">100</span> -->
  17. </view>
  18. <view class="wenzhangCont article">
  19. <span v-html="detailInfo.textDetails">
  20. </span>
  21. <view >
  22. <!-- 图片轮播 -->
  23. <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" :circular="circular">
  24. <block v-for="(one, index) in detailInfo.urls" :key="index">
  25. <swiper-item><image :src="loadImgSrc(one)" style="background-size: 100% 100%;"></image></swiper-item>
  26. </block>
  27. </swiper>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import { getServer } from '@/api/information/information.js'
  35. // pages/me.js
  36. export default {
  37. data() {
  38. return {
  39. anwserVal:'',
  40. anwserList:[
  41. {
  42. deptName:'国家乡村振兴局',
  43. updateTime:'2023-2-27 16:04',
  44. desc:'用好政策效果评估成果,进一步优化巩固拓展脱贫攻坚成果同乡村振兴有效衔接政策供给,为推动工作提质增效提供有力支撑保障。',
  45. }
  46. ],
  47. isCollection:false,
  48. isAdopt:false,
  49. adoptTopSize:'115',
  50. adoptIndex:null,
  51. detailInfo:{},
  52. };
  53. },
  54. methods: {
  55. // 评论回答
  56. answerFunc(){
  57. this.anwserList.push({
  58. deptName:'国家烟草局',
  59. updateTime:new Date().getFullYear() + "-" + new Date().getMonth() + "-" + new Date().getDay() + " " + (new Date().getHours() < 10 ? "0" + new Date().getHours() : new Date().getHours()) + ':' + (new Date().getMinutes() < 10 ? "0" + new Date().getMinutes() : new Date().getMinutes()),
  60. desc:this.anwserVal,
  61. })
  62. this.anwserVal = null
  63. },
  64. adoptFunc(idx){
  65. this.adoptIndex = idx
  66. this.isAdopt = true
  67. },
  68. // 标记喜欢
  69. collectionFunc(){
  70. this.isCollection = !this.isCollection
  71. },
  72. // 加工图片路径
  73. srcExcutedFunc(html){
  74. let newReg = /(?<=(src="))[^"]*?(?=")/ig;
  75. let newHtml = html
  76. var allSrc = html.match(newReg);
  77. try{
  78. if(allSrc.length != 0){
  79. allSrc.forEach(e => {
  80. newHtml = newHtml.replace(e,this.loadImgSrc(e))
  81. })
  82. }
  83. }catch(e){
  84. //TODO handle the exception
  85. }
  86. return newHtml
  87. }
  88. }
  89. /**
  90. * 生命周期函数--监听页面加载
  91. */,
  92. onLoad(options) {
  93. console.log('options',options)
  94. getServer(options).then(res => {
  95. let result = res.data
  96. // result.textDetails = this.srcExcutedFunc(result.textDetails)
  97. this.detailInfo = result
  98. })
  99. },
  100. /**
  101. * 生命周期函数--监听页面初次渲染完成
  102. */
  103. onReady(e) {
  104. },
  105. /**
  106. * 生命周期函数--监听页面显示
  107. */
  108. onShow() {},
  109. /**
  110. * 生命周期函数--监听页面隐藏
  111. */
  112. onHide() {},
  113. /**
  114. * 生命周期函数--监听页面卸载
  115. */
  116. onUnload() {},
  117. /**
  118. * 页面相关事件处理函数--监听用户下拉动作
  119. */
  120. onPullDownRefresh() {},
  121. /**
  122. * 页面上拉触底事件的处理函数
  123. */
  124. onReachBottom() {},
  125. /**
  126. * 用户点击右上角分享
  127. */
  128. onShareAppMessage() {},
  129. };
  130. </script>
  131. <style lang="scss">
  132. @import './informationDetail.css';
  133. .collect{
  134. .icon-shoucang:before{
  135. color: red;
  136. }
  137. }
  138. .not-collect{
  139. }
  140. .effectBix{
  141. width: 56px;
  142. height: 56px;
  143. border-radius: 50px;
  144. font-family: 'Bebas Neue', cursive;
  145. background: linear-gradient(45deg, transparent 5%, #FF013C 5%);
  146. border: 0;
  147. color: #fff;
  148. text-align: center;
  149. line-height: 56px;
  150. outline: transparent;
  151. position: absolute;
  152. transform: rotate(-30deg);
  153. right:3%;
  154. top: -5%;
  155. }
  156. .effectBox, .effectBox::after {
  157. width: 56px;
  158. height: 56px;
  159. border-radius: 50px;
  160. font-size: 16px;
  161. font-family: 'Bebas Neue', cursive;
  162. background: linear-gradient(45deg, transparent 5%, #FF013C 5%);
  163. border: 0;
  164. color: #fff;
  165. opacity: 1;
  166. letter-spacing: 3px;
  167. text-align: center;
  168. line-height: 56px;
  169. outline: transparent;
  170. position: relative;
  171. left: 78%;
  172. top: 113%;
  173. transform: rotate(-30deg);
  174. z-index: 1;
  175. }
  176. .effectBox::after {
  177. --slice-0: inset(50% 50% 50% 50%);
  178. --slice-1: inset(80% -6px 0 0);
  179. --slice-2: inset(50% -6px 30% 0);
  180. --slice-3: inset(10% -6px 85% 0);
  181. --slice-4: inset(40% -6px 43% 0);
  182. --slice-5: inset(80% -6px 5% 0);
  183. content: 'AVAILABLE NOW';
  184. display: block;
  185. position: absolute;
  186. top: 0;
  187. left: 0;
  188. right: 0;
  189. bottom: 0;
  190. background: linear-gradient(45deg, transparent 3%, #00E6F6 3%, #00E6F6 5%, #FF013C 5%);
  191. text-shadow: -3px -3px 0px #F8F005, 3px 3px 0px #00E6F6;
  192. clip-path: var(--slice-0);
  193. }
  194. .effectBox:hover::after {
  195. animation: 1s glitch;
  196. animation-timing-function: steps(2, end);
  197. }
  198. @keyframes glitch {
  199. 0% {
  200. clip-path: var(--slice-1);
  201. transform: translate(-20px, -10px);
  202. }
  203. 10% {
  204. clip-path: var(--slice-3);
  205. transform: translate(10px, 10px);
  206. }
  207. 20% {
  208. clip-path: var(--slice-1);
  209. transform: translate(-10px, 10px);
  210. }
  211. 30% {
  212. clip-path: var(--slice-3);
  213. transform: translate(0px, 5px);
  214. }
  215. 40% {
  216. clip-path: var(--slice-2);
  217. transform: translate(-5px, 0px);
  218. }
  219. 50% {
  220. clip-path: var(--slice-3);
  221. transform: translate(5px, 0px);
  222. }
  223. 60% {
  224. clip-path: var(--slice-4);
  225. transform: translate(5px, 10px);
  226. }
  227. 70% {
  228. clip-path: var(--slice-2);
  229. transform: translate(-10px, 10px);
  230. }
  231. 80% {
  232. clip-path: var(--slice-5);
  233. transform: translate(20px, -10px);
  234. }
  235. 90% {
  236. clip-path: var(--slice-1);
  237. transform: translate(-10px, 0px);
  238. }
  239. 100% {
  240. clip-path: var(--slice-1);
  241. transform: translate(0);
  242. }
  243. }
  244. </style>