mattersDetail.vue 5.9 KB

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