kevin.T 1 неделя назад
Родитель
Сommit
ab65df9459

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

@@ -16,9 +16,9 @@ const props = defineProps({
     type: Date,
     default: () => new Date(),
   },
-  isBanner:{
-	  type:Boolean,
-	  default:false,
+  isBanner: {
+    type: Boolean,
+    default: false,
   },
   viewNum: {
     type: Number,
@@ -26,7 +26,7 @@ const props = defineProps({
   },
   content: {
     type: String,
-    default: '<div>1111</div>',
+    default: '<div></div>',
   },
 })
 </script>

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

@@ -16,26 +16,26 @@ const id = ref()
 const type = ref()
 const request = ref<() => Promise<IResData<Partial<Content>>>>()
 const { data, run } = useRequest(() => request.value(), { initialData: {} })
-onLoad(async (query: { id: string; type?: 'banner' }) => {
+onLoad(async (query: { id: string; type?: 'banner'; data?: string }) => {
   id.value = query.id
   type.value = query.type
   if (type.value === 'banner') {
     request.value = () =>
       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,
-			},
-		  }
-	  })
+        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 })
   }
@@ -51,7 +51,7 @@ onShareTimeline(() => ({
 <template>
   <div class="flex-grow bg-white">
     <Article
-	  :isBanner = "data.isBanner"
+      :isBanner="data.isBanner"
       :title="data?.title"
       :author="{ name: '筑巢荟' }"
       :content="data?.contentDetail"

+ 11 - 8
packages/app/src/pages-sub/home/offline-activity/cycling-rankings/index.vue

@@ -69,10 +69,10 @@ onShareTimeline(() => ({
             inactive-value="期榜"
           />
           <div
-            class="absolute top-0 left-0 w-80px border-[1px] border-solid border-[#FFFFFF] h-32px z-10 rounded-full overflow-hidden flex items-center justify-between"
+            class="absolute top-0 left-0 w-80px border-[1px] border-solid border-[#FFFFFF] h-30px z-10 rounded-full overflow-hidden flex items-center justify-between"
           >
-            <div class="w-40px text-center lh-32px font-size-[14px] text-[#FFFFFF]">期榜</div>
-            <div class="w-40px text-center lh-32px font-size-[14px] text-[#FFFFFF]">总榜</div>
+            <div class="w-40px text-center lh-30px font-size-[14px] text-[#FFFFFF]">期榜</div>
+            <div class="w-40px text-center lh-30px font-size-[14px] text-[#FFFFFF]">总榜</div>
           </div>
         </div>
         <div v-show="checked === '期榜'">
@@ -268,25 +268,28 @@ onShareTimeline(() => ({
   &__circle {
     width: 40px !important;
     border-radius: 26px !important;
-    height: 30px !important;
+    height: 32px !important;
+    top: 0 !important;
+    left: 0 !important;
     &::after {
       content: '期榜' !important;
       color: rgba($color: #000000, $alpha: 0.85);
       text-align: center;
-      line-height: 26px;
-      height: 26px !important;
+      line-height: 32px;
+      height: 32px !important;
       display: block;
       border: none !important;
     }
   }
   &.is-checked {
     .wd-switch__circle {
-      left: 40px !important;
+      left: 42px !important;
       &::after {
         content: '总榜' !important;
         color: rgba($color: #000000, $alpha: 0.85);
         text-align: center;
-        height: 26px !important;
+        height: 32px !important;
+        line-height: 32px;
         display: block;
         border: none !important;
       }

+ 18 - 1
packages/app/src/pages/home/components/home-banner.vue

@@ -1,12 +1,16 @@
 <script setup lang="ts">
 import ImageEvo from '@/components/image-evo.vue'
 import { unix } from 'dayjs'
+import { useRouter } from '../../../core/utils/router'
+const router = useRouter()
 
 const props = withDefaults(
   defineProps<{
     id: string | number
     url: string
     cover: string
+    detailsType: number | string | null | undefined
+    item: object | any
   }>(),
   {},
 )
@@ -16,6 +20,16 @@ const playing = ref(false)
 const duration = ref(0)
 const durationText = computed(() => unix(duration.value).format('mm:ss'))
 const videoContext = ref<UniNamespace.VideoContext>()
+const handleClick = () => {
+  if (props?.item?.url && props.item?.url?.startsWith('http')) {
+    router.push(`/pages-sub/common/webview/index?url=${props.item.url}`)
+  }
+  if (props.detailsType === '1' && !props?.item?.url) {
+    router.push(
+      `/pages-sub/home/content/index?type=home-banner&id=${props.id}&data=${JSON.stringify(props.item)}`,
+    )
+  }
+}
 const handlePlay = async () => {
   videoContext.value?.play()
   playing.value = true
@@ -40,7 +54,7 @@ defineExpose({
 })
 </script>
 <template>
-  <div class="w-full h-full relative">
+  <div class="w-full h-full relative" v-if="!detailsType && item.indexPromotionalVideoImage">
     <div v-show="!playing" class="absolute left-0 top-0 w-full h-full bg-black">
       <ImageEvo :src="cover"></ImageEvo>
     </div>
@@ -78,4 +92,7 @@ defineExpose({
       </view>
     </div>
   </div>
+  <div class="w-full h-full relative" v-else @click="handleClick">
+    <ImageEvo :src="cover"></ImageEvo>
+  </div>
 </template>

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

@@ -196,7 +196,17 @@ onShareAppMessage(shareAppMessage)
     <view class="bg-black w-full relative aspect-[1.26/1]">
       <swiper :autoplay="autoplay" @change="handleSwiperChange">
         <template
-          v-for="{ data: { id, coverVideoImage, indexPromotionalVideoImage } } of swiperData"
+          v-for="{
+            data: {
+              id,
+              coverVideoImage,
+              indexPromotionalVideoImage,
+              detailsType,
+              url,
+              details,
+              name,
+            },
+          } of swiperData"
           :key="id"
         >
           <swiper-item>
@@ -205,6 +215,16 @@ onShareAppMessage(shareAppMessage)
               :id="id"
               :url="indexPromotionalVideoImage"
               :cover="coverVideoImage"
+              :detailsType="detailsType"
+              :item="{
+                id,
+                coverVideoImage,
+                indexPromotionalVideoImage,
+                detailsType,
+                url,
+                details,
+                name,
+              }"
               @play="handlePlay"
               @ended="autoplay = true"
             />

+ 19 - 17
packages/app/src/pages/material/index.vue

@@ -118,8 +118,19 @@ const resetSearch = () => {
   setMaterials()
 }
 const submitSearch = () => {
+  translateType.value = ''
   setMaterials()
 }
+const bannersLogoList = computed(() => {
+  return bannersLogo.value
+    .map((m) => {
+      if (m.bannerImgUrl && m.status === 0) {
+        return m.bannerImgUrl
+      }
+    })
+    .filter((f) => f)
+})
+console.log('bannersLogoList', bannersLogoList.value)
 onMounted(async () => {
   await setMaterialDealerData()
   console.log(materialDealerData.value)
@@ -133,7 +144,7 @@ onMounted(async () => {
     setMaterials(),
   ])
 
-  console.log('setBannersLogo', bannersLogo.value)
+  console.log('bannersLogoList', bannersLogoList.value)
 })
 </script>
 <template>
@@ -181,12 +192,11 @@ onMounted(async () => {
       <!-- <template v-for="({ brandLevelName, materialsList }, i) in materialDealerData" :key="i">
         <SectionHeading :title="brandLevelName" custom-class="mx-3.5"></SectionHeading>
       </template> -->
-      <div class="mx-14px bg-[#fff] rounded-2xl">
-        <wd-swiper
-          :list="bannersLogo && bannersLogo.map((m) => m.bannerImgUrl)"
-          :height="330"
-          autoplay
-        ></wd-swiper>
+      <div
+        class="mx-14px bg-[#fff] rounded-2xl"
+        v-if="bannersLogoList && bannersLogoList.length > 0"
+      >
+        <wd-swiper :list="bannersLogoList" :height="330" autoplay></wd-swiper>
       </div>
       <div class="text-black/85 mx-14px">
         <div class="flex items-center justify-between py-3.5">
@@ -211,11 +221,7 @@ onMounted(async () => {
                     ? '#0CBE7D'
                     : ''
                 "
-                :name="
-                  translateType === 'brandType' || searchParams.manageBrandSet.length > 0
-                    ? 'caret-down-small'
-                    : 'caret-up-small'
-                "
+                :name="translateType === 'brandType' ? 'caret-up-small' : 'caret-down-small'"
                 size="14px"
               ></wd-icon>
             </div>
@@ -238,11 +244,7 @@ onMounted(async () => {
                     ? '#0CBE7D'
                     : ''
                 "
-                :name="
-                  translateType === 'manageType' || searchParams.manageTypeSet.length > 0
-                    ? 'caret-down-small'
-                    : 'caret-up-small'
-                "
+                :name="translateType === 'manageType' ? 'caret-up-small' : 'caret-down-small'"
                 size="14px"
               ></wd-icon>
             </div>