travelGuideDetails.vue 4.8 KB

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