鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

276 lines
6.2 KiB

  1. <template>
  2. <view class="page__view highlight">
  3. <!-- 导航栏 -->
  4. <navbar title="活动详情" leftClick @leftClick="$utils.navigateBack" />
  5. <view class="tabs">
  6. <uv-tabs
  7. :list="tabs"
  8. :scrollable="false"
  9. lineColor="#00A9FF"
  10. lineWidth="48rpx"
  11. lineHeight="4rpx"
  12. :activeStyle="{
  13. 'font-family': 'PingFang SC',
  14. 'font-weight': 500,
  15. 'font-size': '32rpx',
  16. 'line-height': 1.4,
  17. 'color': '#00A9FF',
  18. }"
  19. :inactiveStyle="{
  20. 'font-family': 'PingFang SC',
  21. 'font-weight': 400,
  22. 'font-size': '32rpx',
  23. 'line-height': 1.4,
  24. 'color': '#191919',
  25. }"
  26. @click="clickTabs"
  27. ></uv-tabs>
  28. </view>
  29. <scroll-view type="custom" scroll-y="true" :scroll-into-view="scrollIntoView" class="scroll-view">
  30. <view class="scroll-view-content">
  31. <view class="cover-img">
  32. <image class="img" src="@/static/image/temp-20.png" mode="aspectFill"></image>
  33. </view>
  34. <view class="section" id="highlights">
  35. <view class="flex section-header">
  36. <view class="flex">
  37. <view class="flex icon">
  38. <image class="img" src="@/static/image/icon-mark.png" mode="widthFix"></image>
  39. </view>
  40. <view>活动掠影</view>
  41. </view>
  42. <view class="btn btn-mark">标记有我</view>
  43. </view>
  44. <view class="section-content highlights">
  45. <view class="highlights-item" v-for="(image, idx) in detail.highlights" :key="idx">
  46. <image class="img" :src="image" mode="scaleToFill"></image>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="section" id="thoughts">
  51. <view class="section-header">学员心得</view>
  52. <view class="section-content thoughts">
  53. <view class="card" v-for="item in detail.thoughts" :key="item.id">
  54. <commentCard :data="item" @change="onCommentChange"></commentCard>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="section report" id="report">
  59. <view class="section-header">行后报告</view>
  60. <view class="section-content report">
  61. <!-- todo -->
  62. </view>
  63. </view>
  64. </view>
  65. </scroll-view>
  66. <view class="flex bottom">
  67. <button class="flex btn btn-palin" @click="jumpToPoster">生成海报</button>
  68. <button class="flex btn btn-primary" @click="onApplyEmail">申请邮件</button>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import commentCard from '@/pages_order/comment/commentCard.vue'
  74. export default {
  75. components: {
  76. commentCard,
  77. },
  78. data() {
  79. return {
  80. tabs: [
  81. { id: 'highlights', name: '活动掠影' },
  82. { id: 'thoughts', name: '学员心得' },
  83. { id: 'report', name: '行后报告' },
  84. ],
  85. current: 0,
  86. detail: {},
  87. scrollIntoView: null,
  88. }
  89. },
  90. onLoad() {
  91. this.getData()
  92. },
  93. methods: {
  94. async getData() {
  95. // todo
  96. this.detail = {
  97. highlights: [
  98. '/static/image/temp-38.png',
  99. '/static/image/temp-39.png',
  100. '/static/image/temp-40.png',
  101. '/static/image/temp-41.png',
  102. '/static/image/temp-42.png',
  103. '/static/image/temp-43.png',
  104. '/static/image/temp-44.png',
  105. '/static/image/temp-45.png',
  106. '/static/image/temp-46.png',
  107. ],
  108. thoughts: [],
  109. }
  110. },
  111. //点击tab栏
  112. clickTabs({ index }) {
  113. this.current = index
  114. this.scrollIntoView = this.tabs[this.current].id
  115. },
  116. onCommentChange() {
  117. // todo: refresh comment list
  118. },
  119. jumpToPoster() {
  120. // todo
  121. },
  122. onApplyEmail() {
  123. // todo
  124. },
  125. },
  126. }
  127. </script>
  128. <style scoped lang="scss">
  129. .tabs {
  130. background: #D8F2FF;
  131. }
  132. .scroll-view {
  133. $tab-height: 44px;
  134. $bottom-height: 73px;
  135. height: calc(100vh - env(safe-area-inset-bottom) - #{$bottom-height} - #{$tab-height} - #{$navbar-height} - var(--status-bar-height) - 20rpx);
  136. &-content {
  137. padding: 32rpx;
  138. }
  139. }
  140. .cover-img {
  141. width: 100%;
  142. height: 348rpx;
  143. border-radius: 12rpx;
  144. overflow: hidden;
  145. .img {
  146. width: 100%;
  147. height: 100%;
  148. }
  149. }
  150. .section {
  151. margin-top: 32rpx;
  152. &-header {
  153. justify-content: space-between;
  154. font-size: 36rpx;
  155. font-weight: 600;
  156. color: #080808;
  157. .icon {
  158. margin-right: 24rpx;
  159. width: 36rpx;
  160. height: 36rpx;
  161. background: #080808;
  162. border-radius: 50%;
  163. overflow: hidden;
  164. .img {
  165. width: 24rpx;
  166. height: auto;
  167. }
  168. }
  169. .btn-mark {
  170. padding: 6rpx 22rpx;
  171. font-family: PingFang SC;
  172. font-size: 28rpx;
  173. font-weight: 500;
  174. line-height: 1.5;
  175. color: #FFFFFF;
  176. background: linear-gradient(to right, #21FEEC, #019AF9);
  177. border: 2rpx solid #00A9FF;
  178. border-radius: 30rpx;
  179. }
  180. }
  181. &-content {
  182. }
  183. }
  184. .highlights {
  185. margin-top: 18rpx;
  186. display: grid;
  187. grid-template-columns: repeat(3, 1fr);
  188. gap: 16rpx;
  189. &-item {
  190. min-width: 0;
  191. border: 2rpx solid #CDCDCD;
  192. border-radius: 12rpx;
  193. overflow: hidden;
  194. .img {
  195. width: 100%;
  196. height: 304rpx;
  197. }
  198. }
  199. }
  200. .thoughts {
  201. margin-top: 24rpx;
  202. .card + .card {
  203. margin-top: 24rpx;
  204. }
  205. }
  206. .report {
  207. margin-top: 24rpx;
  208. }
  209. .bottom {
  210. position: fixed;
  211. left: 0;
  212. bottom: 0;
  213. z-index: 999;
  214. justify-content: space-between;
  215. column-gap: 32rpx;
  216. width: 100vw;
  217. padding: 32rpx 40rpx;
  218. padding-bottom: calc(env(safe-area-inset-bottom) + 32rpx);
  219. background: #FFFFFF;
  220. box-sizing: border-box;
  221. .btn {
  222. flex: 1;
  223. font-size: 36rpx;
  224. font-weight: 500;
  225. border-radius: 41rpx;
  226. line-height: 1.4;
  227. &-palin {
  228. padding: 14rpx 0;
  229. color: #252545;
  230. border: 2rpx solid #252545;
  231. }
  232. &-primary {
  233. padding: 14rpx 0;
  234. color: #FFFFFF;
  235. background: linear-gradient(to right, #21FEEC, #019AF9);
  236. border: 2rpx solid #00A9FF;
  237. }
  238. }
  239. }
  240. </style>