index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <route lang="yaml">
  2. style:
  3. navigationStyle: custom
  4. navigationBarTitleText: 游学日程
  5. </route>
  6. <script setup lang="ts">
  7. import { getMyStudyTours } from '../../../core/libs/requests'
  8. import { camera, map } from '../../../core/libs/svgs'
  9. import { useUserStore } from '../../../store'
  10. import { storeToRefs } from 'pinia'
  11. import { group } from 'radash'
  12. import dayjs from 'dayjs'
  13. import NavbarEvo from '@/components/navbar-evo.vue'
  14. import BottomAppBar from '@/components/bottom-app-bar.vue'
  15. import ButtonEvo from '@/components/button-evo.vue'
  16. import { useRouter } from '../../../core/utils/router'
  17. import ImageEvo from '@/components/image-evo.vue'
  18. const router = useRouter()
  19. const userStore = useUserStore()
  20. const { userInfo } = storeToRefs(userStore)
  21. const { data: studyTours, run: setStudyTours } = useRequest(() => getMyStudyTours(), {
  22. initialData: [],
  23. })
  24. const currentStudyTour = computed(() =>
  25. studyTours.value.find(
  26. (it) => dayjs(it.studyStartTime).isBefore(dayjs()) && dayjs(it.studyEndTime).isAfter(dayjs()),
  27. ),
  28. )
  29. const schedules = computed(
  30. () =>
  31. group(currentStudyTour.value?.studyTravelDOList || [], (it) =>
  32. dayjs(it?.travelTime).format('YYYY-MM-DD'),
  33. ) || { [dayjs().format('YYYY-MM-DD')]: [] },
  34. )
  35. onMounted(async () => {
  36. await setStudyTours()
  37. })
  38. </script>
  39. <template>
  40. <view class="flex-grow flex flex-col relative">
  41. <NavbarEvo transparent dark></NavbarEvo>
  42. <wd-img
  43. :src="currentStudyTour?.bannerUrl"
  44. width="100%"
  45. height="100%"
  46. mode="widthFix"
  47. custom-class="fixed! top-0 left-0"
  48. ></wd-img>
  49. <view class="w-full bg-transparent! h-300px"></view>
  50. <div class="">
  51. <view
  52. class="flex-grow bg-white relative bottom-4 p-6.5 rounded-lt-[20px] rounded-tr-[20px] overflow-hidden pt-20px"
  53. >
  54. <view class="border-b border-black/10 border-b-solid pb-5">
  55. <div class="text-black/85 text-2xl fw-500 font-['PingFang_SC'] leading-normal">
  56. {{ currentStudyTour?.name }}
  57. </div>
  58. <view class="flex mt-5">
  59. <wd-img
  60. custom-class="rounded-full overflow-hidden mr-1"
  61. width="22"
  62. height="22"
  63. :src="userInfo?.avatar"
  64. />
  65. <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-normal">
  66. {{ userInfo?.nickname }}
  67. </div>
  68. <div
  69. class="flex text-black/40 text-base font-normal font-['PingFang_SC'] leading-normal"
  70. >
  71. <view class="mx-3.5">|</view>
  72. {{ dayjs().format('M月D日') }}
  73. 第{{
  74. Object.keys(schedules || []).findIndex(
  75. (it) => it === dayjs().format('YYYY-MM-DD'),
  76. ) + 1
  77. }}天
  78. </div>
  79. </view>
  80. </view>
  81. <template
  82. v-for="(item, itemIndex) in schedules?.[dayjs().format('YYYY-MM-DD')]"
  83. :key="itemIndex"
  84. >
  85. <view class="flex flex-col mt-8">
  86. <!-- 左侧图标 -->
  87. <view class="flex items-center">
  88. <view
  89. class="w-[30px] h-[30px] bg-[#f6f6f6] rounded-full flex justify-center items-center"
  90. >
  91. <wd-img width="16" height="16" :src="map"></wd-img>
  92. </view>
  93. <div class="ml-3 text-black/90 font-normal">
  94. {{ dayjs(item?.travelTime).format('HH:mm') }}
  95. </div>
  96. <div class="ml-20px text-black/90 font-normal">
  97. {{ item.title }}
  98. </div>
  99. </view>
  100. <!-- 标题 -->
  101. <!-- 描述 -->
  102. <view class="ml-10 mt-2 border-b border-black/10 py-16px">
  103. <span class="text-black/60 text-sm font-normal lh-23px">行程介绍:</span>
  104. <span class="text-black/40 text-sm font-normal lh-23px">
  105. {{ item.travelDesc }}
  106. </span>
  107. </view>
  108. <!-- 打卡示例 -->
  109. <template v-if="item.clockExplainUrl">
  110. <view class="flex items-center ml-10">
  111. <wd-img width="16" height="16" :src="camera"></wd-img>
  112. <div class="ml-1 text-black/90 text-xs font-normal">打卡示例</div>
  113. </view>
  114. <wd-img
  115. v-if="(item.clockExplainUrl ?? '') !== ''"
  116. width="300px"
  117. custom-class="rounded-2xl overflow-hidden mt-11px ml-34px h-157px"
  118. :src="item.clockExplainUrl"
  119. mode="widthFix"
  120. enable-preview
  121. ></wd-img>
  122. <div class="mt-2.5 ml-10 text-black/40 text-xs font-normal">
  123. {{ item.clockExplainDesc }}
  124. </div>
  125. </template>
  126. </view>
  127. </template>
  128. </view>
  129. </div>
  130. <BottomAppBar fixed placeholder>
  131. <div
  132. class="p-3.5 bg-white/90 rounded-2xl backdrop-blur-[20px] bottom-4 left-0 right-0 flex items-center justify-between gap-1"
  133. >
  134. <view class="flex-1 flex items-center" v-if="false">
  135. <div class="text-black/85 text-sm font-normal font-['PingFang_SC'] leading-[34px]">
  136. 发布圈子可得
  137. </div>
  138. <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN_Exp'] leading-normal">
  139. {{ currentStudyTour.needPointsCount }}
  140. </div>
  141. <div class="text-black/85 text-sm font-normal font-['PingFang_SC'] leading-[34px]">
  142. 积分
  143. </div>
  144. </view>
  145. <view v-else class="flex-1"></view>
  146. <view>
  147. <ButtonEvo size="lg" @click="router.push('/pages-sub/publish/moment/index?circleType=1')">
  148. 发圈子
  149. </ButtonEvo>
  150. </view>
  151. </div>
  152. </BottomAppBar>
  153. </view>
  154. </template>