knowledgeDetails.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view>
  3. <!-- 知识库详情 -->
  4. <view class="container">
  5. <h1 class="title">{{fromData.titleName}}</h1>
  6. <view class="wenzhangLy">
  7. <!-- 头像昵称 -->
  8. <view class="txTime">
  9. <img class="uni-header-image"
  10. :src="initInfo.headImg == null || initInfo.headImg == '' ? 'http://116.142.80.12:9000/10_03.png' : initInfo.headImg" />
  11. <view class="time">
  12. <p>{{initInfo.wechatName}}</p>
  13. <span>{{fromData.createTime}}</span>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="wenzhangCont">
  18. <view v-html="fromData.textDetails"></view>
  19. <view>
  20. <image :src="loadImgSrcLocalhost(fromData.imgUrlList)"></image>
  21. </view>
  22. </view>
  23. <view class="fengexian"></view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. getDetails
  30. } from '@/api/knowledge/knowledge.js';
  31. import {
  32. getUserInfo
  33. } from '@/api/me/me.js'
  34. export default {
  35. data() {
  36. return {
  37. parentId: "",
  38. fromData: {},
  39. content: "",
  40. initInfo: {
  41. userId: null,
  42. scoreNum: 0,
  43. wechatName: "微信用户",
  44. name: null,
  45. headImg: null,
  46. },
  47. };
  48. },
  49. methods: {
  50. // 获取数据
  51. getDetails() {
  52. getDetails(this.parentId).then(res => {
  53. if (res.code == 200) {
  54. this.fromData = res.data
  55. }
  56. })
  57. },
  58. getUserInfoByUserId(userId) {
  59. getUserInfo(userId).then(res => {
  60. this.initInfo = res.data;
  61. console.log("this.initInfo", this.initInfo)
  62. })
  63. },
  64. }
  65. /**
  66. * 生命周期函数--监听页面加载
  67. */
  68. ,
  69. onLoad(options) {
  70. this.parentId = options.id
  71. this.getDetails()
  72. },
  73. /**
  74. * 生命周期函数--监听页面初次渲染完成
  75. */
  76. onReady() {
  77. this.userId = getApp().globalData.userId
  78. this.getUserInfoByUserId(this.userId)
  79. },
  80. /**
  81. * 生命周期函数--监听页面显示
  82. */
  83. onShow() {},
  84. /**
  85. * 生命周期函数--监听页面隐藏
  86. */
  87. onHide() {},
  88. /**
  89. * 生命周期函数--监听页面卸载
  90. */
  91. onUnload() {},
  92. /**
  93. * 页面相关事件处理函数--监听用户下拉动作
  94. */
  95. onPullDownRefresh() {},
  96. /**
  97. * 页面上拉触底事件的处理函数
  98. */
  99. onReachBottom() {},
  100. /**
  101. * 用户点击右上角分享
  102. */
  103. onShareAppMessage() {},
  104. };
  105. </script>
  106. <style lang="scss">
  107. @import './knowledgeDetails.css';
  108. .collect {
  109. .icon-shoucang:before {
  110. color: red;
  111. }
  112. }
  113. .not-collect {}
  114. .effectBix {
  115. width: 56px;
  116. height: 56px;
  117. border-radius: 50px;
  118. font-family: 'Bebas Neue', cursive;
  119. background: linear-gradient(45deg, transparent 5%, #FF013C 5%);
  120. border: 0;
  121. color: #fff;
  122. text-align: center;
  123. line-height: 56px;
  124. outline: transparent;
  125. position: absolute;
  126. transform: rotate(-30deg);
  127. right: 3%;
  128. top: -5%;
  129. }
  130. .effectBox,
  131. .effectBox::after {
  132. width: 56px;
  133. height: 56px;
  134. border-radius: 50px;
  135. font-size: 16px;
  136. font-family: 'Bebas Neue', cursive;
  137. background: linear-gradient(45deg, transparent 5%, #FF013C 5%);
  138. border: 0;
  139. color: #fff;
  140. opacity: 1;
  141. letter-spacing: 3px;
  142. text-align: center;
  143. line-height: 56px;
  144. outline: transparent;
  145. position: relative;
  146. left: 78%;
  147. top: 113%;
  148. transform: rotate(-30deg);
  149. z-index: 1;
  150. }
  151. .effectBox::after {
  152. --slice-0: inset(50% 50% 50% 50%);
  153. --slice-1: inset(80% -6px 0 0);
  154. --slice-2: inset(50% -6px 30% 0);
  155. --slice-3: inset(10% -6px 85% 0);
  156. --slice-4: inset(40% -6px 43% 0);
  157. --slice-5: inset(80% -6px 5% 0);
  158. content: 'AVAILABLE NOW';
  159. display: block;
  160. position: absolute;
  161. top: 0;
  162. left: 0;
  163. right: 0;
  164. bottom: 0;
  165. background: linear-gradient(45deg, transparent 3%, #00E6F6 3%, #00E6F6 5%, #FF013C 5%);
  166. text-shadow: -3px -3px 0px #F8F005, 3px 3px 0px #00E6F6;
  167. clip-path: var(--slice-0);
  168. }
  169. .effectBox:hover::after {
  170. animation: 1s glitch;
  171. animation-timing-function: steps(2, end);
  172. }
  173. @keyframes glitch {
  174. 0% {
  175. clip-path: var(--slice-1);
  176. transform: translate(-20px, -10px);
  177. }
  178. 10% {
  179. clip-path: var(--slice-3);
  180. transform: translate(10px, 10px);
  181. }
  182. 20% {
  183. clip-path: var(--slice-1);
  184. transform: translate(-10px, 10px);
  185. }
  186. 30% {
  187. clip-path: var(--slice-3);
  188. transform: translate(0px, 5px);
  189. }
  190. 40% {
  191. clip-path: var(--slice-2);
  192. transform: translate(-5px, 0px);
  193. }
  194. 50% {
  195. clip-path: var(--slice-3);
  196. transform: translate(5px, 0px);
  197. }
  198. 60% {
  199. clip-path: var(--slice-4);
  200. transform: translate(5px, 10px);
  201. }
  202. 70% {
  203. clip-path: var(--slice-2);
  204. transform: translate(-10px, 10px);
  205. }
  206. 80% {
  207. clip-path: var(--slice-5);
  208. transform: translate(20px, -10px);
  209. }
  210. 90% {
  211. clip-path: var(--slice-1);
  212. transform: translate(-10px, 0px);
  213. }
  214. 100% {
  215. clip-path: var(--slice-1);
  216. transform: translate(0);
  217. }
  218. }
  219. </style>