Selaa lähdekoodia

feat: 添加活动图片页面,获取游学或活动照片列表功能

EvilDragon 5 kuukautta sitten
vanhempi
commit
c9146f492e

+ 17 - 0
packages/app/src/core/libs/requests.ts

@@ -651,6 +651,23 @@ export const getStudyTourSignups = (query: { studyId: string }) =>
     total: number
   }>('/app-api/member/app-study-abroad/signup/page', query)
 /**
+ * 获取游学或活动的照片列表
+ * @param query {{bizId: string; bizType: '1'|'2'}} bizId: 游学或活动id, bizType: 1-游学, 2-活动
+ */
+export const getPhotoList = (query: { bizId: string; bizType: '1' | '2' }) =>
+  httpGet<
+    ResPageData<{
+      id: number
+      bizId: number
+      bizType: string
+      bizTypeName: string
+      travelDate: string
+      video: any[]
+      picture: any[]
+      createTime: string
+    }>
+  >('/app-api/member/app-study-abroad/pageStudyActivityPhoto', query)
+/**
  * 获取Banner列表
  */
 export const getBanners = (query: { mode: BannerMode }) =>

+ 8 - 0
packages/app/src/pages.json

@@ -388,6 +388,14 @@
       }
     },
     {
+      "path": "pages/home/activity/images/index",
+      "type": "page",
+      "style": {
+        "navigationBarTitleText": "活动图片",
+        "navigationBarBackgroundColor": "#ffffff"
+      }
+    },
+    {
       "path": "pages/home/mall/confirm-order/index",
       "type": "page",
       "style": {

+ 21 - 0
packages/app/src/pages/home/activity/detail/index.vue

@@ -40,6 +40,7 @@ import { useActivity } from '../../../../composables/activity'
 import ImageEvo from '@/components/image-evo.vue'
 import TooltipEvo from '@/components/tooltip-evo.vue'
 import ActivityAsOf from '../../components/activity-as-of.vue'
+import images from '@designer-hub/assets/src/libs/assets/images'
 const themeVars = ref<ConfigProviderThemeVars>({
   tableBorderColor: 'white',
   tabsNavLineBgColor: 'white',
@@ -428,6 +429,26 @@ onShareTimeline(() => ({ title: data.value.name, imageUrl: data.value.thumbnailU
         </div>
       </div>
     </BottomAppBar>
+    <!-- <wd-fab
+      custom-class="bg-red"
+      :draggable="true"
+      :expandable="false"
+      :gap="{ bottom: 120 }"
+    ></wd-fab> -->
+    <!-- <wd-fab  :expandable="false" :gap="{ bottom: 0, top: 0 }"></wd-fab> -->
+    <div
+      class="fixed bottom-30 right-8 bg-[#0cbe7c] w-15 h-15 rounded-full flex flex-col items-center justify-center"
+      @click="
+        router.push(`/pages/home/activity/images/index?id=${id}&type=${type}&title=${data.name}`)
+      "
+    >
+      <div>
+        <wd-img width="29" height="29" :src="images"></wd-img>
+      </div>
+      <div class="text-white text-[10px] font-normal font-['PingFang_SC'] leading-tight">
+        查看照片
+      </div>
+    </div>
 
     <wd-action-sheet v-model="show">
       <view class="px-3.5 py-10">

+ 41 - 0
packages/app/src/pages/home/activity/images/index.vue

@@ -0,0 +1,41 @@
+<route lang="json">
+{
+  "style": {
+    "navigationBarTitleText": "活动图片",
+    "navigationBarBackgroundColor": "#ffffff"
+  }
+}
+</route>
+<script setup lang="ts">
+import { getPhotoList } from '../../../../core/libs/requests'
+
+const id = ref()
+const type = ref()
+const { data, run: setData } = useRequest(
+  () =>
+    getPhotoList({
+      bizId: id.value,
+      bizType: { studyTour: '2', activity: '1' }[type.value],
+      pageSize: -1,
+    }),
+  { initialData: { list: [], total: 0 } },
+)
+onLoad(async (query: { id: string; type: 'activity' | 'studyTour'; title: string }) => {
+  uni.setNavigationBarTitle({ title: query.title })
+  id.value = query.id
+  type.value = query.type
+  await setData()
+})
+</script>
+<template>
+  <div class="flex flex-col flex-grow p-4 bg-white gap-4">
+    <template v-for="(it, i) in data.list" :key="i">
+      <template v-for="(video, index) in it.video" :key="index">
+        <video class="w-full" :src="video"></video>
+      </template>
+      <template v-for="(img, index) in it.picture" :key="index">
+        <wd-img width="100%" mode="widthFix" :src="img" />
+      </template>
+    </template>
+  </div>
+</template>

+ 1 - 0
packages/app/src/types/uni-pages.d.ts

@@ -42,6 +42,7 @@ interface NavigateToOptions {
        "/pages/publish/tags/index" |
        "/pages/common/status/success/index" |
        "/pages/home/activity/detail/index" |
+       "/pages/home/activity/images/index" |
        "/pages/home/mall/confirm-order/index" |
        "/pages/home/mall/detail/index" |
        "/pages/home/mall/shopping-cart/index" |

+ 5 - 0
packages/assets/src/assets/images.svg

@@ -0,0 +1,5 @@
+<svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="Frame">
+<path id="Vector" d="M1.61111 7.24156V21.4826C1.61111 22.8117 1.88017 23.0651 3.19363 23.0651H21.1265C22.4291 23.0651 22.709 22.8234 22.709 21.4822V7.24197C22.709 5.94462 22.4609 5.65905 21.1265 5.65905H3.19363C1.88541 5.65905 1.61111 5.88581 1.61111 7.24197V7.24156ZM20.2247 19.3728H4.10632C5.86807 16.8043 9.00048 12.5204 9.79677 12.5204C10.5673 12.5204 13.1829 15.9802 14.3643 17.1986C14.3643 17.1986 15.8839 15.1682 16.6798 15.1682C17.4922 15.1694 20.1985 19.3519 20.2247 19.3728ZM15.4884 10.4062C15.4884 10.1506 15.5387 9.89759 15.6365 9.66148C15.7342 9.42538 15.8776 9.21084 16.0583 9.03013C16.2389 8.84942 16.4535 8.70607 16.6896 8.60827C16.9256 8.51047 17.1787 8.46013 17.4342 8.46013C17.6898 8.46013 17.9428 8.51047 18.1789 8.60827C18.415 8.70607 18.6295 8.84942 18.8102 9.03013C18.9909 9.21084 19.1342 9.42538 19.232 9.66148C19.3298 9.89759 19.3801 10.1506 19.3801 10.4062C19.38 10.9222 19.175 11.4171 18.8101 11.7819C18.4452 12.1468 17.9503 12.3518 17.4342 12.3518C16.9182 12.3518 16.4233 12.1468 16.0584 11.7819C15.6935 11.4171 15.4885 10.9222 15.4884 10.4062ZM11.5058 4.70648L8.42088 4.12124C7.39702 3.9271 6.99102 3.99638 6.74049 4.70688H11.5058V4.70648ZM26.0396 7.4647L23.6229 7.00634V21.5023C23.6229 22.1669 23.579 22.9189 23.0534 23.4356C22.5423 23.9363 21.802 23.9786 21.1487 23.9786H19.6958L22.794 24.5634C24.0736 24.8051 24.3938 24.6198 24.6436 23.3039L27.2999 9.31265C27.5415 8.03785 27.3502 7.7116 26.0396 7.46269V7.4647Z" fill="white"/>
+</g>
+</svg>

+ 2 - 0
packages/assets/src/libs/assets/images.ts

@@ -0,0 +1,2 @@
+import images from '../../assets/images.svg' 
+ export default images