knowledgeDetails.vue 4.7 KB

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