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

364 lines
8.8 KiB

3 days ago
2 months ago
3 days ago
2 months ago
2 months ago
3 days ago
4 days ago
2 months ago
2 months ago
3 days ago
3 days ago
  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" @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="aspectFill" @click="previewImage(detail.highlights, idx)"></image>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="section" id="thoughts">
  51. <view class="flex section-header">
  52. <view>学员心得</view>
  53. <view class="btn" @click="onAdd">新增心得</view>
  54. </view>
  55. <view class="section-content thoughts">
  56. <view class="card" v-for="item in detail.thoughts" :key="item.id">
  57. <commentCard :data="item" @change="onCommentChange"></commentCard>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="section report" id="report">
  62. <view class="section-header">行后报告</view>
  63. <view class="section-content report report-card">
  64. <image class="report-cover" :src="configList.report_page_01" mode="widthFix" />
  65. <view class="report-btn flex" @click="jumpToExport">
  66. <image class="icon" src="@/pages_order/static/activity/icon-double-arrow-left.png" mode="widthFix"></image>
  67. <view>点击查看详情</view>
  68. <image class="icon" src="@/pages_order/static/activity/icon-double-arrow-right.png" mode="widthFix"></image>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </scroll-view>
  74. <markPopup ref="markPopup"></markPopup>
  75. <record-form-popup ref="recordFormPopup" @submitted="getData"></record-form-popup>
  76. <posterPopup ref="posterPopup"></posterPopup>
  77. <view class="flex bottom">
  78. <!-- <button class="flex btn btn-palin" @click="openPosterPopup">生成海报</button> -->
  79. <button class="flex btn btn-primary" @click="onApplyEmail">申请邮件</button>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. // import commentCard from '@/pages_order/comment/commentCard.vue'
  85. import commentCard from './commentCard.vue'
  86. import markPopup from '@/pages_order/growing/activity/markPopup.vue'
  87. import recordFormPopup from '@/pages_order/comment/recordFormPopup.vue'
  88. import posterPopup from '@/components/base/posterPopup.vue'
  89. export default {
  90. components: {
  91. commentCard,
  92. markPopup,
  93. recordFormPopup,
  94. posterPopup,
  95. },
  96. data() {
  97. return {
  98. id: null,
  99. tabs: [
  100. { id: 'highlights', name: '活动掠影' },
  101. { id: 'thoughts', name: '学员心得' },
  102. { id: 'report', name: '行后报告' },
  103. ],
  104. current: 0,
  105. detail: {},
  106. scrollIntoView: null,
  107. }
  108. },
  109. onLoad(arg) {
  110. const { id, shareId } = arg
  111. if (shareId) {
  112. uni.setStorageSync('shareId', shareId)
  113. }
  114. if (shareId && !uni.getStorageSync('token')) {
  115. uni.navigateTo({
  116. url: '/pages_order/auth/wxLogin'
  117. })
  118. return
  119. }
  120. this.id = id
  121. this.getData()
  122. },
  123. methods: {
  124. async getData() {
  125. try {
  126. const result = await this.$fetch('queryExperienceById', { recordId: this.id })
  127. const { activityId, imageContentList, experienceList } = result
  128. this.detail = {
  129. activityId,
  130. highlights: imageContentList.reduce((arr, item) => {
  131. return arr.concat(item.image?.split?.(',') || [])
  132. }, []),
  133. thoughts: experienceList,
  134. // todo: check key about "行后报告"
  135. }
  136. } catch (err) {
  137. }
  138. },
  139. //点击tab栏
  140. clickTabs({ index }) {
  141. this.current = index
  142. this.scrollIntoView = this.tabs[this.current].id
  143. },
  144. onCommentChange() {
  145. // todo: refresh comment list
  146. },
  147. openPosterPopup() {
  148. const path = `/pages_order/growing/activity/index?id=${this.id}&shareId=${this.userInfo.id}`
  149. this.$refs.posterPopup.open(path)
  150. },
  151. onApplyEmail() {
  152. uni.navigateTo({
  153. url: `/pages_order/growing/activity/export?id=${this.id}&mode=export`
  154. })
  155. // this.$utils.navigateTo(`/pages_order/growing/activity/applyEmail?id=${this.id}`)
  156. },
  157. jumpToExport() {
  158. uni.navigateTo({
  159. url: `/pages_order/growing/activity/export?id=${this.id}`
  160. })
  161. },
  162. onMark() {
  163. this.$refs.markPopup.open(this.detail.activityId)
  164. },
  165. onAdd() {
  166. this.$refs.recordFormPopup.open()
  167. },
  168. previewImage(arr, index) {
  169. uni.previewImage({
  170. urls: arr,
  171. current: arr[index], // 当前显示图片的链接
  172. });
  173. },
  174. },
  175. }
  176. </script>
  177. <style scoped lang="scss">
  178. .tabs {
  179. background: #D8F2FF;
  180. }
  181. .scroll-view {
  182. $tab-height: 44px;
  183. $bottom-height: 73px;
  184. height: calc(100vh - env(safe-area-inset-bottom) - #{$bottom-height} - #{$tab-height} - #{$navbar-height} - var(--status-bar-height) - 20rpx);
  185. &-content {
  186. padding: 32rpx;
  187. }
  188. }
  189. .cover-img {
  190. width: 100%;
  191. height: 348rpx;
  192. border-radius: 12rpx;
  193. overflow: hidden;
  194. .img {
  195. width: 100%;
  196. height: 100%;
  197. }
  198. }
  199. .section {
  200. margin-top: 32rpx;
  201. &-header {
  202. justify-content: space-between;
  203. font-size: 36rpx;
  204. font-weight: 600;
  205. color: #080808;
  206. .icon {
  207. margin-right: 24rpx;
  208. width: 36rpx;
  209. height: 36rpx;
  210. background: #080808;
  211. border-radius: 50%;
  212. overflow: hidden;
  213. .img {
  214. width: 24rpx;
  215. height: auto;
  216. }
  217. }
  218. .btn {
  219. padding: 6rpx 22rpx;
  220. font-family: PingFang SC;
  221. font-size: 28rpx;
  222. font-weight: 500;
  223. line-height: 1.5;
  224. color: #FFFFFF;
  225. background: linear-gradient(to right, #21FEEC, #019AF9);
  226. border: 2rpx solid #00A9FF;
  227. border-radius: 30rpx;
  228. }
  229. }
  230. &-content {
  231. }
  232. }
  233. .highlights {
  234. margin-top: 18rpx;
  235. display: grid;
  236. grid-template-columns: repeat(3, 1fr);
  237. gap: 16rpx;
  238. &-item {
  239. min-width: 0;
  240. height: 304rpx;
  241. border: 2rpx solid #CDCDCD;
  242. border-radius: 12rpx;
  243. overflow: hidden;
  244. .img {
  245. width: 100%;
  246. height: 100%;
  247. }
  248. }
  249. }
  250. .thoughts {
  251. margin-top: 24rpx;
  252. .card + .card {
  253. margin-top: 24rpx;
  254. }
  255. }
  256. .report {
  257. margin-top: 24rpx;
  258. &-card {
  259. width: 100%;
  260. border-radius: 64rpx;
  261. overflow: hidden;
  262. font-size: 0;
  263. }
  264. &-cover {
  265. width: 100%;
  266. height: auto;
  267. }
  268. &-btn {
  269. width: 100%;
  270. padding: 32rpx 0;
  271. column-gap: 16rpx;
  272. color: #252545;
  273. font-size: 28rpx;
  274. background: #E5E4EB;
  275. .icon {
  276. width: 40rpx;
  277. height: auto;
  278. }
  279. }
  280. }
  281. .bottom {
  282. position: fixed;
  283. left: 0;
  284. bottom: 0;
  285. z-index: 999;
  286. // justify-content: space-between;
  287. // column-gap: 32rpx;
  288. width: 100vw;
  289. padding: 32rpx 40rpx;
  290. padding-bottom: calc(env(safe-area-inset-bottom) + 32rpx);
  291. background: #FFFFFF;
  292. box-sizing: border-box;
  293. .btn {
  294. flex: 1;
  295. font-size: 36rpx;
  296. font-weight: 500;
  297. border-radius: 41rpx;
  298. line-height: 1.4;
  299. &-palin {
  300. padding: 14rpx 0;
  301. color: #252545;
  302. border: 2rpx solid #252545;
  303. }
  304. &-primary {
  305. padding: 14rpx 0;
  306. color: #FFFFFF;
  307. background: linear-gradient(to right, #21FEEC, #019AF9);
  308. border: 2rpx solid #00A9FF;
  309. }
  310. }
  311. }
  312. </style>