鸿宇研学生前端代码
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.

280 lines
6.4 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. id: null,
  81. tabs: [
  82. { id: 'highlights', name: '活动掠影' },
  83. { id: 'thoughts', name: '学员心得' },
  84. { id: 'report', name: '行后报告' },
  85. ],
  86. current: 0,
  87. detail: {},
  88. scrollIntoView: null,
  89. }
  90. },
  91. onLoad(arg) {
  92. const { id } = arg
  93. this.id = id
  94. this.getData()
  95. },
  96. methods: {
  97. async getData() {
  98. // todo
  99. this.detail = {
  100. highlights: [
  101. '/static/image/temp-38.png',
  102. '/static/image/temp-39.png',
  103. '/static/image/temp-40.png',
  104. '/static/image/temp-41.png',
  105. '/static/image/temp-42.png',
  106. '/static/image/temp-43.png',
  107. '/static/image/temp-44.png',
  108. '/static/image/temp-45.png',
  109. '/static/image/temp-46.png',
  110. ],
  111. thoughts: [],
  112. }
  113. },
  114. //点击tab栏
  115. clickTabs({ index }) {
  116. this.current = index
  117. this.scrollIntoView = this.tabs[this.current].id
  118. },
  119. onCommentChange() {
  120. // todo: refresh comment list
  121. },
  122. jumpToPoster() {
  123. // todo
  124. },
  125. onApplyEmail() {
  126. this.$utils.navigateTo(`/pages_order/growing/activity/applyEmail?id=${this.id}`)
  127. },
  128. },
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .tabs {
  133. background: #D8F2FF;
  134. }
  135. .scroll-view {
  136. $tab-height: 44px;
  137. $bottom-height: 73px;
  138. height: calc(100vh - env(safe-area-inset-bottom) - #{$bottom-height} - #{$tab-height} - #{$navbar-height} - var(--status-bar-height) - 20rpx);
  139. &-content {
  140. padding: 32rpx;
  141. }
  142. }
  143. .cover-img {
  144. width: 100%;
  145. height: 348rpx;
  146. border-radius: 12rpx;
  147. overflow: hidden;
  148. .img {
  149. width: 100%;
  150. height: 100%;
  151. }
  152. }
  153. .section {
  154. margin-top: 32rpx;
  155. &-header {
  156. justify-content: space-between;
  157. font-size: 36rpx;
  158. font-weight: 600;
  159. color: #080808;
  160. .icon {
  161. margin-right: 24rpx;
  162. width: 36rpx;
  163. height: 36rpx;
  164. background: #080808;
  165. border-radius: 50%;
  166. overflow: hidden;
  167. .img {
  168. width: 24rpx;
  169. height: auto;
  170. }
  171. }
  172. .btn-mark {
  173. padding: 6rpx 22rpx;
  174. font-family: PingFang SC;
  175. font-size: 28rpx;
  176. font-weight: 500;
  177. line-height: 1.5;
  178. color: #FFFFFF;
  179. background: linear-gradient(to right, #21FEEC, #019AF9);
  180. border: 2rpx solid #00A9FF;
  181. border-radius: 30rpx;
  182. }
  183. }
  184. &-content {
  185. }
  186. }
  187. .highlights {
  188. margin-top: 18rpx;
  189. display: grid;
  190. grid-template-columns: repeat(3, 1fr);
  191. gap: 16rpx;
  192. &-item {
  193. min-width: 0;
  194. border: 2rpx solid #CDCDCD;
  195. border-radius: 12rpx;
  196. overflow: hidden;
  197. .img {
  198. width: 100%;
  199. height: 304rpx;
  200. }
  201. }
  202. }
  203. .thoughts {
  204. margin-top: 24rpx;
  205. .card + .card {
  206. margin-top: 24rpx;
  207. }
  208. }
  209. .report {
  210. margin-top: 24rpx;
  211. }
  212. .bottom {
  213. position: fixed;
  214. left: 0;
  215. bottom: 0;
  216. z-index: 999;
  217. justify-content: space-between;
  218. column-gap: 32rpx;
  219. width: 100vw;
  220. padding: 32rpx 40rpx;
  221. padding-bottom: calc(env(safe-area-inset-bottom) + 32rpx);
  222. background: #FFFFFF;
  223. box-sizing: border-box;
  224. .btn {
  225. flex: 1;
  226. font-size: 36rpx;
  227. font-weight: 500;
  228. border-radius: 41rpx;
  229. line-height: 1.4;
  230. &-palin {
  231. padding: 14rpx 0;
  232. color: #252545;
  233. border: 2rpx solid #252545;
  234. }
  235. &-primary {
  236. padding: 14rpx 0;
  237. color: #FFFFFF;
  238. background: linear-gradient(to right, #21FEEC, #019AF9);
  239. border: 2rpx solid #00A9FF;
  240. }
  241. }
  242. }
  243. </style>