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

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