kevin.T 2 tuần trước cách đây
mục cha
commit
365417c4ba

+ 13 - 14
packages/app/src/pages-sub/home/schedule/index.vue

@@ -39,21 +39,20 @@ onMounted(async () => {
 })
 </script>
 <template>
-  <view class="flex-grow flex flex-col">
+  <view class="flex-grow flex flex-col relative">
     <NavbarEvo transparent dark></NavbarEvo>
-    <view class="bg-black w-full aspect-[1.26/1]">
-      <!--      <ImageEvo :src="currentStudyTour?.bannerUrl"></ImageEvo>-->
-      <div
-        class="w-full h-100vh bg-[length:100%_auto] bg-top bg-no-repeat"
-        :style="{
-          backgroundImage: `url(${currentStudyTour?.bannerUrl})`,
-          backgroundAttachment: 'fixed',
-        }"
-      ></div>
-      <div class="aspect-[4.17/1] absolute left-0 bottom-0 w-full flex items-center"></div>
-    </view>
-    <div class="flex-grow bg-white rounded-lt-[20px] rounded-tr-[20px] overflow-hidden pt-10px">
-      <view class="flex-grow relative bottom-4 p-6.5">
+    <wd-img
+      :src="currentStudyTour?.bannerUrl"
+      width="100%"
+      height="100%"
+      mode="widthFix"
+      custom-class="fixed! top-0 left-0"
+    ></wd-img>
+    <view class="w-full bg-transparent! h-300px"></view>
+    <div class="">
+      <view
+        class="flex-grow bg-white relative bottom-4 p-6.5 rounded-lt-[20px] rounded-tr-[20px] overflow-hidden pt-20px"
+      >
         <view class="border-b border-black/10 border-b-solid pb-5">
           <div class="text-black/85 text-2xl fw-500 font-['PingFang_SC'] leading-normal">
             {{ currentStudyTour?.name }}

+ 61 - 0
packages/app/src/pages/home/components/article.vue

@@ -0,0 +1,61 @@
+<script setup lang="ts">
+import dayjs from 'dayjs'
+import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html.vue'
+import view from '@designer-hub/assets/src/libs/assets/view'
+
+const props = defineProps({
+  title: {
+    type: String,
+    default: '',
+  },
+  author: {
+    type: Object,
+    default: () => ({ name: '匿名' }),
+  },
+  createdAt: {
+    type: Date,
+    default: () => new Date(),
+  },
+  viewNum: {
+    type: Number,
+    default: 0,
+  },
+  content: {
+    type: String,
+    default: '<div>1111</div>',
+  },
+})
+</script>
+<template>
+  <div class="px-3.5 bg-white flex-grow">
+    <div class="text-black text-xl font-normal font-['PingFang_SC'] leading-loose">
+      {{ title }}
+    </div>
+    <div class="flex items-center my-5">
+      <div class="w-7 h-7 overflow-hidden roudnded-full">
+        <slot name="avatar"></slot>
+      </div>
+      <div class="flex-1 ml-1">
+        <div class="text-black/90 text-sm font-normal font-['PingFang_SC'] leading-normal">
+          {{ author.name }}
+        </div>
+        <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
+          编辑于
+          {{ dayjs(createdAt).format('YYYY/MM/DD') }}
+        </div>
+      </div>
+      <div class="flex items-center gap-1">
+        <slot name="viewLeft"></slot>
+        <!-- <wd-icon name="view" size="18" color="rgba(0,0,0,.45)"></wd-icon> -->
+        <wd-img :src="view" width="18" height="18"></wd-img>
+        <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
+          {{ viewNum || 0 }}
+        </div>
+      </div>
+    </div>
+    <!-- <u-parse :content="content"></u-parse> -->
+    <!-- <div class="content" v-html="content"></div> -->
+    <mpHtml :content="content"></mpHtml>
+  </div>
+</template>
+<style lang="scss"></style>

+ 1 - 3
packages/app/src/pages/messages/detail/index.vue

@@ -8,13 +8,11 @@
 </route>
 <script setup lang="ts">
 import { logo } from '../../../core/libs/svgs'
-import Article from '@/pages-sub/home/components/article.vue'
-import { Content } from '@/core/libs/models'
+import Article from '@/pages/home/components/article.vue'
 import { fuckYou, fuckYouMom } from '@/core/libs/requests'
 
 const id = ref()
 const type = ref()
-const request = ref<() => Promise<IResData<Partial<Content>>>>()
 
 const { data, run: setData } = useRequest(() => fuckYouMom({ id: id.value }))
 onLoad(async (query?: { id: string; type?: 'banner' }) => {