informationDetail.vue 5.7 KB

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