Sfoglia il codice sorgente

university detail - brochure fit wx

abpcoder 22 ore fa
parent
commit
436c592864

+ 1 - 1
src/pagesOther/pages/university/detail/components/college-profile.vue

@@ -17,7 +17,7 @@
         <view class="mt-30">
             <view class="text-32 font-bold text-fore-title">开设专业</view>
             <uv-gap v-if="loading" height="15"/>
-            <uv-skeleton v-if="loading" :title="false" rows="3" rows-height="44" :rows-width="['100%','100%','100%']"/>
+            <uv-skeleton v-if="loading" :title="false" rows="3" rows-height="30" :rows-width="['100%','100%','100%']"/>
             <view v-for="(g,i) in grouped" :key="i"
                   class="mt-28 p-28 flex justify-between items-center bg-back-light rounded-lg">
                 <view class="text-28 font-bold text-fore-title truncate">{{ g.root.name }}</view>

+ 20 - 11
src/pagesOther/pages/university/detail/components/plus/college-brochure-list.vue

@@ -1,11 +1,11 @@
 <template>
     <uv-cell-group :border="false">
-        <uv-cell v-for="(b,i) in list" :key="i" cell-style="padding: 10px 0" @click="handlePreview(null, b)">
+        <uv-cell v-for="item in list" :key="item.id" cell-style="padding: 10px 0" @click="handlePreview(item)">
             <template #title>
-                <view class="text-28 text-fore-title mb-20">{{ b.title }}</view>
+                <view class="text-28 text-fore-title mb-20">{{ item.title }}</view>
             </template>
             <template #label>
-                <view class="text-24 text-fore-light">{{ b.createTime }}</view>
+                <view class="text-24 text-fore-light">{{ item.createTime }}</view>
             </template>
         </uv-cell>
     </uv-cell-group>
@@ -18,23 +18,32 @@ import {useTransferPage} from "@/hooks/useTransferPage";
 import {EnumBrochureType} from "@/common/enum";
 import {routes} from "@/common/routes";
 
-defineProps<{
+withDefaults(defineProps<{
     list: UniversityBrochure[]
-}>()
+}>(), {
+    list: () => []
+})
 
-const detail = inject(UNIVERSITY_DETAIL)
-const brochures = computed(() => detail.value.enrollBrochures || [])
+const detail = inject(UNIVERSITY_DETAIL, ref({} as UniversityDetail))
 const baseInfo = computed(() => detail.value.baseInfo || {})
 const {transferTo} = useTransferPage()
 
-const handlePreview = function (type: EnumBrochureType | null, item: UniversityBrochure | null = null) {
-    const brochure = item || brochures.value.find(b => b.type == type)
-    if (!brochure) return
+const handlePreview = function (brochure: UniversityBrochure) {
     if (brochure.url) {
         uni.openDocument({
             filePath: brochure.url,
             fail: result => {
-                console.log('open failed', result)
+                uni.setClipboardData({
+                    data: brochure.url,
+                    showToast: false,
+                    success: () => {
+                        uni.$ie.showModal({
+                            title: '提示',
+                            content: '已将文件地址复制到粘贴板',
+                            showCancel: false
+                        })
+                    }
+                })
             }
         })
     } else {

+ 6 - 2
src/pagesOther/pages/university/intro/intro.vue

@@ -12,7 +12,7 @@
             </view>
         </uv-sticky>
         <uv-gap height="10" bg-color="#F6F8FA"/>
-        <view class="p-30 text-28 leading-38 text-fore-content">
+        <view class="p-30 text-28 leading-38 text-fore-content university-intro-content">
             <uv-parse :content="detail.content||prevData.content"/>
         </view>
         <uv-back-top :scroll-top="scrollTop"/>
@@ -44,5 +44,9 @@ onMounted(async () => {
 </script>
 
 <style lang="scss">
-
+.university-intro-content {
+    img, image, table {
+        max-width: 100%;
+    }
+}
 </style>