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

feat: 更新热门活动项组件,添加点击跳转功能;优化滑块组件,启用自动播放

EvilDragon 3 місяців тому
батько
коміт
6cbf5ff04f

+ 10 - 6
packages/app/src/components/hot-activity-item.vue

@@ -17,7 +17,10 @@ const { listItemButtonText, statusText, status, difference, startAt, endAt, refr
   useActivity(activityOptions)
 </script>
 <template>
-  <view class="relative w-full h-full box-border flex m-a">
+  <view
+    class="relative w-full h-full box-border flex m-a"
+    @click="router.push(`/pages/home/activity/detail/index?id=${options?.id}&type=${type}`)"
+  >
     <view class="w-full h-full flex flex-col justify-between pt-14 box-border px-3.5">
       <!-- <view class="flex"></view> -->
       <div class="w-[321px] h-[88px] relative">
@@ -53,11 +56,12 @@ const { listItemButtonText, statusText, status, difference, startAt, endAt, refr
           :end-at="options?.applyEndTime"
           @end="refresh"
         ></ActivityCountDown>
-        <div>
-          <ButtonEvo
-            size="md"
-            @click="router.push(`/pages/home/activity/detail/index?id=${options?.id}&type=${type}`)"
-          >
+        <div
+          @click.stop="
+            router.push(`/pages/home/activity/detail/index?id=${options?.id}&type=${type}`)
+          "
+        >
+          <ButtonEvo size="md">
             <!-- 立即报名 -->
             {{ options?.ifSingnUp ? '已报名' : listItemButtonText }}
           </ButtonEvo>

+ 1 - 1
packages/app/src/components/hot-activity.vue

@@ -26,7 +26,7 @@ onMounted(() => {
     </view>
     <div class="absolute left-0 right-0 top-1 bottom-6 z-1 py-3.5">
       <div class="h-full w-full relative">
-        <swiper class="" @change="(e) => (current = e.detail.current)">
+        <swiper class="" autoplay @change="(e) => (current = e.detail.current)">
           <template v-for="it of items" :key="it.id">
             <swiper-item class="">
               <HotActivityItem ref="item" :options="it.data" :type="it.type"></HotActivityItem>