瀏覽代碼

更换轮播图

xsh_1997 1 天之前
父節點
當前提交
4f28986adf
共有 5 個文件被更改,包括 9 次插入148 次删除
  1. 9 148
      ruoyi-ui-app/pages/home/index.vue
  2. 二進制
      ruoyi-ui-app/static/banner/1.png
  3. 二進制
      ruoyi-ui-app/static/banner/2.png
  4. 二進制
      ruoyi-ui-app/static/banner/3.png
  5. 二進制
      ruoyi-ui-app/static/banner/4.png

+ 9 - 148
ruoyi-ui-app/pages/home/index.vue

@@ -18,24 +18,12 @@
18 18
               :key="banner.id"
19 19
               class="home-banner__item"
20 20
             >
21
-              <view
22
-                class="home-banner__slide"
23
-                :class="'home-banner__slide--' + banner.tone"
24
-                role="button"
25
-                hover-class="home-banner__slide--hover"
26
-                @click="onBanner(banner)"
27
-              >
21
+              <view class="home-banner__slide">
28 22
                 <image
29
-                  v-if="banner.image"
30 23
                   class="home-banner__img"
31 24
                   :src="banner.image"
32 25
                   mode="aspectFill"
33 26
                 />
34
-                <view class="home-banner__mask" />
35
-                <view class="home-banner__copy">
36
-                  <text class="home-banner__title text-body">{{ $t(banner.titleKey) }}</text>
37
-                  <text class="home-banner__desc text-body">{{ $t(banner.descKey) }}</text>
38
-                </view>
39 27
               </view>
40 28
             </swiper-item>
41 29
           </swiper>
@@ -69,6 +57,8 @@ import { useUserStore } from '@/store/user'
69 57
 
70 58
 const GRID_ICON = '#5f7168'
71 59
 
60
+const BANNER_IMAGE_DIR = '/static/banner'
61
+
72 62
 export default {
73 63
   components: {
74 64
     'up-icon': UIcon
@@ -78,62 +68,10 @@ export default {
78 68
     return {
79 69
       navTitleKey: 'nav.home',
80 70
       banners: [
81
-        {
82
-          id: 'news',
83
-          titleKey: 'homePage.bannerNewsTitle',
84
-          descKey: 'homePage.bannerNewsDesc',
85
-          tone: 'green',
86
-          url: '/package-a/breeding-news/index'
87
-        },
88
-        {
89
-          id: 'clinic',
90
-          titleKey: 'homePage.bannerClinicTitle',
91
-          descKey: 'homePage.bannerClinicDesc',
92
-          tone: 'teal',
93
-          url: '/package-a/online-clinic/index'
94
-        },
95
-        {
96
-          id: 'classroom',
97
-          titleKey: 'homePage.bannerClassTitle',
98
-          descKey: 'homePage.bannerClassDesc',
99
-          tone: 'olive',
100
-          url: '/package-a/agri-classroom/index'
101
-        },
102
-        {
103
-          id: 'market',
104
-          titleKey: 'homePage.bannerMarketTitle',
105
-          descKey: 'homePage.bannerMarketDesc',
106
-          tone: 'amber',
107
-          url: '/package-a/yak-market/index'
108
-        },
109
-        {
110
-          id: 'booking',
111
-          titleKey: 'homePage.bannerBookingTitle',
112
-          descKey: 'homePage.bannerBookingDesc',
113
-          tone: 'indigo',
114
-          url: '/package-a/booking-service/index'
115
-        },
116
-        {
117
-          id: 'ai',
118
-          titleKey: 'homePage.bannerAiTitle',
119
-          descKey: 'homePage.bannerAiDesc',
120
-          tone: 'violet',
121
-          url: '/package-a/ai-assistant/index'
122
-        },
123
-        {
124
-          id: 'medicine',
125
-          titleKey: 'homePage.bannerMedicineTitle',
126
-          descKey: 'homePage.bannerMedicineDesc',
127
-          tone: 'coral',
128
-          url: '/package-a/medicine-tools/index'
129
-        },
130
-        {
131
-          id: 'resource',
132
-          titleKey: 'homePage.bannerResourceTitle',
133
-          descKey: 'homePage.bannerResourceDesc',
134
-          tone: 'slate',
135
-          url: '/package-a/livestock-resources/index'
136
-        }
71
+        { id: 'banner-1', image: `${BANNER_IMAGE_DIR}/1.png` },
72
+        { id: 'banner-2', image: `${BANNER_IMAGE_DIR}/2.png` },
73
+        { id: 'banner-3', image: `${BANNER_IMAGE_DIR}/3.png` },
74
+        { id: 'banner-4', image: `${BANNER_IMAGE_DIR}/4.png` }
137 75
       ],
138 76
       gridItems: [
139 77
         {
@@ -225,10 +163,6 @@ export default {
225 163
     goEntry(item) {
226 164
       if (!item.url) return
227 165
       uni.navigateTo({ url: item.url })
228
-    },
229
-    onBanner(banner) {
230
-      if (!banner.url) return
231
-      uni.navigateTo({ url: banner.url })
232 166
     }
233 167
   }
234 168
 }
@@ -285,88 +219,15 @@ export default {
285 219
   height: 100%;
286 220
   min-width: 0;
287 221
   overflow: hidden;
222
+  background: $morandi-bg-card;
288 223
   box-sizing: border-box;
289 224
 }
290 225
 
291
-.home-banner__slide--hover {
292
-  opacity: 0.92;
293
-}
294
-
295
-.home-banner__slide--green {
296
-  background: linear-gradient(135deg, #3d9b6e 0%, #22c55e 55%, #86efac 100%);
297
-}
298
-
299
-.home-banner__slide--teal {
300
-  background: linear-gradient(135deg, #4a7c6f 0%, #5f7168 50%, #8fb09a 100%);
301
-}
302
-
303
-.home-banner__slide--olive {
304
-  background: linear-gradient(135deg, #5c6b4a 0%, #6b7f72 45%, #a8b89a 100%);
305
-}
306
-
307
-.home-banner__slide--amber {
308
-  background: linear-gradient(135deg, #b45309 0%, #f59e0b 50%, #fde68a 100%);
309
-}
310
-
311
-.home-banner__slide--indigo {
312
-  background: linear-gradient(135deg, #3730a3 0%, #6366f1 48%, #a5b4fc 100%);
313
-}
314
-
315
-.home-banner__slide--violet {
316
-  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 50%, #ddd6fe 100%);
317
-}
318
-
319
-.home-banner__slide--coral {
320
-  background: linear-gradient(135deg, #be123c 0%, #f43f5e 48%, #fecdd3 100%);
321
-}
322
-
323
-.home-banner__slide--slate {
324
-  background: linear-gradient(135deg, #334155 0%, #64748b 50%, #cbd5e1 100%);
325
-}
326
-
327 226
 .home-banner__img {
328
-  position: absolute;
329
-  top: 0;
330
-  right: 0;
331
-  width: 52%;
332
-  height: 100%;
333
-  opacity: 0.35;
334
-}
335
-
336
-.home-banner__mask {
337 227
   position: absolute;
338 228
   inset: 0;
339
-  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.05) 70%);
340
-}
341
-
342
-.home-banner__copy {
343
-  position: relative;
344
-  z-index: 1;
345
-  display: flex;
346
-  flex-direction: column;
347
-  justify-content: flex-end;
229
+  width: 100%;
348 230
   height: 100%;
349
-  padding: 32rpx 28rpx 40rpx;
350
-  gap: 10rpx;
351
-  min-width: 0;
352
-  box-sizing: border-box;
353
-}
354
-
355
-.home-banner__title {
356
-  font-size: 34rpx;
357
-  font-weight: 600;
358
-  color: #ffffff;
359
-  line-height: 1.35;
360
-  word-break: break-word;
361
-  overflow-wrap: anywhere;
362
-}
363
-
364
-.home-banner__desc {
365
-  font-size: 26rpx;
366
-  color: rgba(255, 255, 255, 0.88);
367
-  line-height: 1.45;
368
-  word-break: break-word;
369
-  overflow-wrap: anywhere;
370 231
 }
371 232
 
372 233
 .home-services {

二進制
ruoyi-ui-app/static/banner/1.png


二進制
ruoyi-ui-app/static/banner/2.png


二進制
ruoyi-ui-app/static/banner/3.png


二進制
ruoyi-ui-app/static/banner/4.png