details.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view>
  3. <!-- 乡村婚恋详情 -->
  4. <view class="container">
  5. <h1 class="title">{{fromData.titleName}}</h1>
  6. <!-- 头像昵称 -->
  7. <!-- <view class="wenzhangLy">-->
  8. <!-- &lt;!&ndash; 头像昵称 &ndash;&gt;-->
  9. <!-- <view class="txTime">-->
  10. <!-- <img-->
  11. <!-- class="uni-header-image"-->
  12. <!-- :src="initInfo.headImg == null || initInfo.headImg == '' ? initImgPath : loadImgSrcLocalhost(initInfo.headImg)"-->
  13. <!-- />-->
  14. <!-- <view class="time">-->
  15. <!-- <p>{{initInfo.name == null || initInfo.name == '' ? initInfo.wechatName : initInfo.name}}</p>-->
  16. <!-- <span>{{ fromData.createTime }}</span>-->
  17. <!-- </view>-->
  18. <!-- </view>-->
  19. <!-- </view>-->
  20. <view class="wenzhangCont article">
  21. <view v-html="fromData.textDetails"></view>
  22. <view v-for="(item, index) in fromData.pictureList" :key="index">
  23. <image :src="loadImgSrcLocalhost(item)"></image>
  24. </view>
  25. </view>
  26. <view class="fengexian"></view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { getDetails } from '@/api/specialService/loveAtVillage.js';
  32. import {
  33. getUserInfo
  34. } from '@/api/me/me.js'
  35. export default {
  36. data() {
  37. return {
  38. parentId: "",
  39. fromData: {},
  40. content: "",
  41. initInfo: {
  42. userId: null,
  43. scoreNum: 0,
  44. wechatName: "微信用户",
  45. name: null,
  46. headImg: null,
  47. },
  48. };
  49. },
  50. methods: {
  51. // 获取数据
  52. getDetails() {
  53. getDetails(this.parentId).then(res => {
  54. if (res.code == 200) {
  55. this.fromData = res.data
  56. }
  57. })
  58. },
  59. getUserInfoByUserId(userId) {
  60. getUserInfo(userId).then(res => {
  61. this.initInfo = res.data;
  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 './details.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>