Bladeren bron

修改bug

purui 1 maand geleden
bovenliggende
commit
5fdc84676a

+ 8 - 1
packages/app/src/pages-sub/home/activity/images/index.vue

@@ -22,6 +22,13 @@ const { data, run: setData } = useRequest(
     }),
   { initialData: { list: [], total: 0 } },
 )
+const previewImg = (i,index) => {
+	console.log(data)
+	uni.previewImage({
+		urls:data.value?.list[i].picture,
+		current:index
+	})
+}
 onLoad(async (query: { id: string; type: 'activity' | 'studyTour'; title: string }) => {
   await uni.setNavigationBarTitle({ title: query.title })
   id.value = query.id
@@ -39,7 +46,7 @@ onLoad(async (query: { id: string; type: 'activity' | 'studyTour'; title: string
         <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" enable-preview show-menu-by-longpress />
+        <wd-img width="100%" mode="widthFix" :src="img" @click="previewImg(i,index)" />
       </template>
     </template>
   </div>

+ 6 - 2
packages/app/src/pages-sub/home/components/article.vue

@@ -16,6 +16,10 @@ const props = defineProps({
     type: Date,
     default: () => new Date(),
   },
+  isBanner:{
+	  type:Boolean,
+	  default:false,
+  },
   viewNum: {
     type: Number,
     default: 0,
@@ -28,10 +32,10 @@ const props = defineProps({
 </script>
 <template>
   <div class="px-3.5 bg-white flex-grow">
-    <div class="text-black text-xl font-normal font-['PingFang_SC'] leading-loose">
+    <div v-if="!isBanner" class="text-black text-xl font-normal font-['PingFang_SC'] leading-loose">
       {{ title }}
     </div>
-    <div class="flex items-center my-5">
+    <div class="flex items-center my-5" v-if="!isBanner">
       <div class="w-7 h-7 overflow-hidden roudnded-full">
         <slot name="avatar"></slot>
       </div>

+ 16 - 9
packages/app/src/pages-sub/home/content/index.vue

@@ -21,15 +21,21 @@ onLoad(async (query: { id: string; type?: 'banner' }) => {
   type.value = query.type
   if (type.value === 'banner') {
     request.value = () =>
-      getBanner(id.value).then((res) => ({
-        ...res,
-        data: {
-          title: res.data?.name,
-          contentDetail: res.data?.bannerDetailsContent,
-          createTime: res.data?.createTime.toString(),
-          viewsCount: res.data?.viewCount,
-        },
-      }))
+      getBanner(id.value).then((res) => {
+		  uni.setNavigationBarTitle({
+		  	title:res.data?.name
+		  })
+		  return {
+			...res,
+			data: {
+			  isBanner:true,	
+			  title: res.data?.name,
+			  contentDetail: res.data?.bannerDetailsContent,
+			  createTime: res.data?.createTime.toString(),
+			  viewsCount: res.data?.viewCount,
+			},
+		  }
+	  })
   } else {
     request.value = () => getContent({ id: id.value })
   }
@@ -45,6 +51,7 @@ onShareTimeline(() => ({
 <template>
   <div class="flex-grow bg-white">
     <Article
+	  :isBanner = "data.isBanner"
       :title="data?.title"
       :author="{ name: '筑巢荟' }"
       :content="data?.contentDetail"

+ 8 - 2
packages/app/src/pages-sub/home/moment/index.vue

@@ -173,6 +173,12 @@ const toDesignerHomepage = () => {
     )
   }
 }
+const previewImg = (index) => {
+	uni.previewImage({
+		urls:data.value?.bannerUrls,
+		current:index
+	})
+}
 onMounted(async () => {})
 const dictMemberDesignStyle = ref<any[]>()
 const dictCircleSpaceType = ref<any[]>()
@@ -334,9 +340,9 @@ const handleClick = async (value: boolean) => {
       </view>
     </view>
     <div v-if="data.circleType === '2'" class="mb-4">
-      <SectionHeading custom-class="mx-3.5 my-7" title="效果图"></SectionHeading>
+      <SectionHeading custom-class="mx-3.5 my-7" title="案例图片"></SectionHeading>
       <template v-for="(it, i) in data?.bannerUrls" :key="i">
-        <wd-img width="100%" mode="widthFix" :src="it"></wd-img>
+        <wd-img width="100%" mode="widthFix" :src="it" @click="previewImg(i)"></wd-img>
       </template>
     </div>
     <div class="mx-3.5">

+ 11 - 1
packages/app/src/pages/material/detail/index.vue

@@ -67,6 +67,16 @@ const imageGroup = ref<any[]>([
   [{ width: '93px' }, { width: '32px', marginLeft: '41px' }],
 ])
 const isLoaded = ref(false)
+const checkFodder = () => {
+	if(materialHomePageData.value.fodderList[0].fodderUrl){
+		dealerPanelState.value = true
+	}else{
+		uni.showToast({
+			title:"暂无素材包",
+			icon:"none"
+		})
+	}
+}
 const handleDownload = async () => {
   downloading.value = true
   const { filePath } = await uni.downloadFile({
@@ -312,7 +322,7 @@ onShareTimeline(() => ({
         <wd-button
           custom-class="w-full! rounded-lg!"
           :disabled="(data?.agreementFileUrl ?? '') === ''"
-          @click="clickByPermission('download', () => (dealerPanelState = true))"
+          @click="clickByPermission('download', () => (checkFodder()))"
         >
           下载所有素材包
         </wd-button>