Переглянути джерело

feat(app): 设计游学同学荟

EvilDragon 4 місяців тому
батько
коміт
c306e844f3

+ 1 - 1
packages/app/src/components/moment-item.vue

@@ -4,7 +4,7 @@ import dayjs from 'dayjs'
 import { beforeNow } from '../utils/date-util'
 import Tag from './tag.vue'
 import { stringify } from 'qs'
-import { isImageOrVideo } from '@/core/utils/common'
+import { isImageOrVideo } from '../core/utils/common'
 
 const props = defineProps({
   options: {

+ 2 - 1
packages/app/src/core/libs/requests.ts

@@ -288,8 +288,9 @@ export const getMaterialDetail = (query: { id: string }) =>
 export const createMaterialsReferrer = (data) =>
   httpPost('/app-api/member/materials-referrer/create', data)
 export const getContents = (query: {
-  contentType: 'desin_learn' | 'offline_activity' | 'desin_communication'
+  contentType: '1' | '2' | '3'
   contentCategory?: string
+  pageSize?: string
 }) => httpGet<{ list: Content[] }>('/app-api/member/content-manger/page', query)
 export const getAllCategories = () => httpGet('/app-api/member/categories/getAllCategories')
 export const getContent = (query: { id: string }) =>

+ 11 - 5
packages/app/src/pages/home/components/class-item.vue

@@ -1,5 +1,5 @@
 <script lang="ts" setup>
-import { frame, peoples, polygon16 } from '@/core/libs/svgs'
+import { frame, peoples, polygon16 } from '../../../core/libs/svgs'
 
 defineProps({
   customClass: {
@@ -10,26 +10,31 @@ defineProps({
     type: String,
     default: () => '',
   },
+  options: {
+    type: Object,
+    default: () => ({}),
+  },
 })
 const handleClick = async () => {
   await uni.navigateTo({ url: '/pages/home/classmates-detail/index' })
 }
 </script>
 <template>
-  <view class="my-6 relative h-43 flex items-end" :class="[customClass]" @click="handleClick">
+  <view class="relative h-43 flex items-end" :class="[customClass]" @click="handleClick">
     <view class="absolute left-0 bottom-0 rounded-2xl overflow-hidden">
       <wd-img
         custom-class="vertical-bottom"
         width="136"
         height="172"
         mode="scaleToFill"
-        src="https://via.placeholder.com/136x172"
+        :src="options.bannerUrl"
       />
       <div
         class="absolute left-2.5 bottom-2.5 px-2 py-1 bg-black/30 rounded-[20px] backdrop-blur-[10px]"
       >
         <div class="text-white text-[10px] font-normal font-['PingFang SC'] leading-relaxed">
-          米兰2班
+          <!-- 米兰2班 -->
+          {{ options.classGrade }}
         </div>
       </div>
     </view>
@@ -37,7 +42,8 @@ const handleClick = async () => {
       class="w-full h-[145px] pl-39 pt-6 pr-6 pb-6 flex flex-col box-border bg-white rounded-2xl shadow"
     >
       <div class="text-black/90 text-base font-normal font-['PingFang SC'] leading-normal">
-        2024届米兰国际家具展
+        <!-- 2024届米兰国际家具展 -->
+        {{ options.title }}
       </div>
 
       <view

+ 1 - 1
packages/app/src/pages/home/moment/index.vue

@@ -20,7 +20,7 @@ import CommentItem from '../components/comment-item.vue'
 import AvatarGroupCasual from '@/components/avatar-group-casual/avatar-group-casual.vue'
 import { useUserStore } from '../../../store'
 import { storeToRefs } from 'pinia'
-import { isImageOrVideo } from '@/core/utils/common'
+import { isImageOrVideo } from '../../../core/utils/common'
 
 const userStore = useUserStore()
 const { userInfo } = storeToRefs(userStore)

+ 11 - 5
packages/app/src/pages/home/study-tour/index.vue

@@ -17,11 +17,16 @@ import TimeLine from './components/time-line.vue'
 import { getByDictType, getContents } from '../../../core/libs/requests'
 import { DictType } from '../../../core/models/moment'
 
-const { data: studyTours, run: setStudyTours } = useRequest(() =>
-  getContents({ contentType: 'desin_learn' }),
+const { data: studyTours, run: setStudyTours } = useRequest(() => getContents({ contentType: '1' }))
+const { data: classmates, run: setClassmates } = useRequest(
+  () => getContents({ contentType: '1', contentCategory: '101', pageSize: '2' }),
+  { initialData: { list: [] } },
 )
 onMounted(async () => {
   await setStudyTours()
+  await setClassmates()
+  console.log(classmates.value)
+
   console.log(studyTours.value)
 })
 </script>
@@ -102,12 +107,13 @@ onMounted(async () => {
       </div>
     </card>
     <section-heading
-      custom-class="my-6"
+      custom-class=""
       title="同学荟"
       path="/pages/home/classmates/index"
     ></section-heading>
-    <class-item></class-item>
-    <class-item></class-item>
+    <template v-for="(it, i) in classmates.list" :key="i">
+      <ClassItem :options="it"></ClassItem>
+    </template>
     <section-heading custom-class="my-6" title="设计圈"></section-heading>
     <moment-item></moment-item>
   </view>