panhui 3 роки тому
батько
коміт
1c300c57a1

+ 1 - 1
.env.production

@@ -1 +1 @@
-VITE_BASE_URL=https://www.raex.vip
+VITE_BASE_URL=http://localhost:8080

+ 22 - 10
index.html

@@ -1,13 +1,25 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
-    <meta charset="UTF-8">
-    <link rel="icon" href="/favicon.ico">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>拍卖的那个</title>
-  </head>
-  <body>
-    <div id="app"></div>
-    <script type="module" src="/src/main.js"></script>
-  </body>
+    <head>
+        <meta charset="UTF-8" />
+        <link rel="icon" href="/favicon.ico" />
+        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+        <title>拍卖的那个</title>
+        <style>
+            @font-face {
+                font-family: 'icomoon';
+                src: url('fonts/icomoon.eot?vluorg');
+                src: url('fonts/icomoon.eot?vluorg#iefix') format('embedded-opentype'),
+                    url('fonts/icomoon.ttf?vluorg') format('truetype'), url('fonts/icomoon.woff?vluorg') format('woff'),
+                    url('fonts/icomoon.svg?vluorg#icomoon') format('svg');
+                font-weight: normal;
+                font-style: normal;
+                font-display: block;
+            }
+        </style>
+    </head>
+    <body>
+        <div id="app"></div>
+        <script type="module" src="/src/main.js"></script>
+    </body>
 </html>

+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "normalize.css": "^8.0.1",
     "pinia": "^2.0.26",
     "qs": "^6.11.0",
+    "swiper": "^8.4.5",
     "vant": "^4.0.0",
     "vue": "^3.2.45",
     "vue-i18n": "9",

BIN
public/fonts/icomoon.eot


+ 17 - 0
public/fonts/icomoon.svg

@@ -0,0 +1,17 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="icomoon" horiz-adv-x="1024">
+<font-face units-per-em="1024" ascent="960" descent="-64" />
+<missing-glyph horiz-adv-x="1024" />
+<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
+<glyph unicode="&#xe900;" glyph-name="tabbar_01_pre" d="M530.286 813.714c212.077 0 384-171.923 384-384s-171.923-384-384-384c-212.077 0-384 171.923-384 384v384h384zM431.543 330.971v-58.514h219.429v58.514h-219.429z" />
+<glyph unicode="&#xe901;" d="M117.029 564.984l393.981 284.796 395.962-284.761v-263.305c0-137.345-111.34-248.686-248.686-248.686h-541.257v511.955zM175.543 535.077v-423.497l490.782 0.13c101.3 4.213 182.133 87.669 182.133 190.005v233.326l-337.335 242.615-335.579-242.578z" />
+<glyph unicode="&#xe902;" d="M329.143 448h58.514v-219.429h-58.514v219.429z" />
+<glyph unicode="&#xe903;" d="M621.714 448h58.514v-219.429h-58.514v219.429z" />
+<glyph unicode="&#xe904;" glyph-name="tabbar_02_pre" d="M511.053 813.711l366.661-263.689v-248.308c0-121.187-98.242-219.429-219.429-219.429h-512v467.747l364.767 263.679zM387.657 448h-58.514v-219.429h58.514v219.429zM680.229 448h-58.514v-219.429h58.514v219.429z" />
+<glyph unicode="&#xe905;" d="M530.286 842.971h-413.257v-413.257c0-228.236 185.022-413.257 413.257-413.257s413.257 185.022 413.257 413.257c0 228.236-185.022 413.257-413.257 413.257zM175.543 429.714v354.743h354.743c195.919 0 354.743-158.824 354.743-354.743s-158.824-354.743-354.743-354.743c-195.919 0-354.743 158.824-354.743 354.743z" />
+<glyph unicode="&#xe906;" d="M650.971 330.971v-58.514h-219.429v58.514h219.429z" />
+</font></defs></svg>

BIN
public/fonts/icomoon.ttf


BIN
public/fonts/icomoon.woff


BIN
src/assets/bg.png


BIN
src/assets/bg2.png


BIN
src/assets/c1.png


BIN
src/assets/home_icon_liucheng.png


BIN
src/assets/home_icon_pingtaixieyi.png


BIN
src/assets/home_icon_redian.png


BIN
src/assets/info_icon_qianggouzhong.png


BIN
src/assets/info_icon_shijian.png


BIN
src/assets/p1.png


+ 17 - 0
src/assets/svgs/tabbar_01.svg

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>tabbar_icon_01</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="我的" transform="translate(-80.000000, -734.000000)" fill="#ABABAB">
+            <g id="编组-3" transform="translate(0.000000, 729.000000)">
+                <g id="标签一" transform="translate(66.000000, 5.000000)">
+                    <g id="编组" transform="translate(14.000000, 0.000000)">
+                        <path d="M24.8,10.8012197 L14.0270926,3.01382419 L3.2,10.8002507 L3.2,18 C3.2,21.7555363 6.2444637,24.8 10,24.8 L24.8,24.8 L24.8,10.8012197 Z M23.2,11.619 L23.2,23.199 L10,23.2 L9.78018869,23.1954381 C7.01025922,23.0802518 4.8,20.7982427 4.8,18 L4.8,11.62 L14.024,4.986 L23.2,11.619 Z" id="路径" fill-rule="nonzero" transform="translate(14.000000, 13.906912) scale(-1, 1) translate(-14.000000, -13.906912) "></path>
+                        <rect id="矩形" x="9" y="14" width="1.6" height="6"></rect>
+                        <rect id="矩形备份" x="17" y="14" width="1.6" height="6"></rect>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 15 - 0
src/assets/svgs/tabbar_01_pre.svg

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>tabbar_icon_01</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="我的" transform="translate(-266.000000, -734.000000)" fill="#2D2D2D">
+            <g id="编组-3" transform="translate(0.000000, 729.000000)">
+                <g id="标签二" transform="translate(252.000000, 5.000000)">
+                    <g id="编组" transform="translate(14.000000, 0.000000)">
+                        <path d="M14.5,4 C20.2989899,4 25,8.70101013 25,14.5 C25,20.2989899 20.2989899,25 14.5,25 C8.70101013,25 4,20.2989899 4,14.5 L4,4 L14.5,4 Z M11.8,17.2 L11.8,18.8 L17.8,18.8 L17.8,17.2 L11.8,17.2 Z" id="形状结合"></path>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 16 - 0
src/assets/svgs/tabbar_02.svg

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>tabbar_icon_01</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="首页" transform="translate(-266.000000, -1348.000000)" fill="#ABABAB">
+            <g id="编组-3备份" transform="translate(0.000000, 1343.000000)">
+                <g id="标签二" transform="translate(252.000000, 5.000000)">
+                    <g id="编组" transform="translate(14.000000, 0.000000)">
+                        <path d="M14.5,3.2 L3.2,3.2 L3.2,14.5 C3.2,20.7408177 8.25918233,25.8 14.5,25.8 C20.7408177,25.8 25.8,20.7408177 25.8,14.5 C25.8,8.25918233 20.7408177,3.2 14.5,3.2 Z M4.8,14.5 L4.8,4.8 L14.5,4.8 C19.8571621,4.8 24.2,9.14283793 24.2,14.5 C24.2,19.8571621 19.8571621,24.2 14.5,24.2 C9.14283793,24.2 4.8,19.8571621 4.8,14.5 Z" id="矩形" fill-rule="nonzero"></path>
+                        <rect id="矩形备份" transform="translate(14.800000, 18.000000) rotate(-270.000000) translate(-14.800000, -18.000000) " x="14" y="15" width="1.6" height="6"></rect>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 15 - 0
src/assets/svgs/tabbar_02_pre.svg

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>tabbar_icon_01</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="首页" transform="translate(-80.000000, -1348.000000)" fill="#2D2D2D" fill-rule="nonzero">
+            <g id="编组-3备份" transform="translate(0.000000, 1343.000000)">
+                <g id="标签一" transform="translate(66.000000, 5.000000)">
+                    <g id="编组" transform="translate(14.000000, 0.000000)">
+                        <path d="M13.9741102,4.00008433 L24,11.2103168 L24,18 C24,21.3137085 21.3137085,24 18,24 L4,24 L4,11.2100545 L13.9741102,4.00008433 Z M10.6,14 L9,14 L9,20 L10.6,20 L10.6,14 Z M18.6,14 L17,14 L17,20 L18.6,20 L18.6,14 Z" id="形状结合"></path>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

BIN
src/assets/tabbar_icon_01.png


BIN
src/assets/tabbar_icon_01_pre.png


BIN
src/assets/tabbar_icon_02.png


BIN
src/assets/tabbar_icon_02_pre.png


+ 101 - 0
src/components/ProductInfo.vue

@@ -0,0 +1,101 @@
+<template>
+    <div class="product-info">
+        <van-image width="104" height="104" fit="cover" :src="productImg" />
+        <div class="content">
+            <div class="text1 van-ellipsis">名称名称名称名称名称名称名称名称名称名称名称名称…</div>
+            <div class="badges">
+                <div class="badge" v-for="i in 3" :key="i">小标语</div>
+            </div>
+            <div class="flex1"></div>
+            <div class="datas">
+                <div class="data">
+                    <div class="val">10.00</div>
+                    <div class="name">当前价(元)</div>
+                </div>
+                <div class="data">
+                    <div class="val">3%</div>
+                    <div class="name">日化收益</div>
+                </div>
+                <div class="data">
+                    <div class="val">0.30</div>
+                    <div class="name">明日可得(元)</div>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import productImg from '../assets/c1.png'
+</script>
+
+<style lang="less" scoped>
+.product-info {
+    .f();
+    .van-image {
+        flex-shrink: 0;
+    }
+}
+
+.content {
+    align-self: stretch;
+    padding: 6px 10px;
+    flex-grow: 1;
+    overflow: hidden;
+    .f-col();
+
+    .text1 {
+        font-size: 14px;
+        color: #1b1300;
+        line-height: 24px;
+    }
+
+    .badges {
+        .f();
+        margin-top: 2px;
+        .badge {
+            font-size: 10px;
+            color: #392d19;
+            line-height: 16px;
+            background: #ffffff66;
+            border-radius: 2px;
+            padding: 0 2px;
+        }
+        .badge + .badge {
+            margin-left: 6px;
+        }
+    }
+}
+
+.datas {
+    .f();
+    .data {
+        width: 33%;
+        .f-col();
+        align-items: center;
+        .val {
+            font-size: 13px;
+            font-weight: bold;
+            color: #000000;
+            line-height: 24px;
+        }
+        .name {
+            font-size: 11px;
+            color: rgba(0, 0, 0, 0.6);
+            line-height: 17px;
+        }
+
+        &:nth-child(1) {
+            .val {
+                color: var(--red);
+            }
+        }
+
+        &:nth-child(2) {
+            .val {
+                color: var(--green);
+            }
+        }
+    }
+}
+</style>

+ 6 - 0
src/main.js

@@ -5,6 +5,9 @@ import router from './router'
 import http from '@/plugins/http'
 import { IonicVue, IonButton } from '@ionic/vue'
 import i18n from './locales'
+import Vant from 'vant';
+import { ConfigProvider } from 'vant';
+import 'vant/lib/index.css';
 import { useDark } from '@vueuse/core'
 
 import 'normalize.css/normalize.css'
@@ -33,6 +36,9 @@ app.use(createPinia())
 app.use(IonicVue)
 app.use(router)
 app.use(http)
+app.use(Vant)
+app.use(ConfigProvider)
+
 useDark()
 router.isReady().then(() => {
     app.mount('#app')

+ 7 - 11
src/router/index.js

@@ -6,27 +6,23 @@ const router = createRouter({
     routes: [
         {
             path: '/',
-            redirect: '/home/tab1'
+            redirect: '/home'
         },
         {
-            path: '/home/',
+            path: '/',
             component: TabsPage,
             children: [
                 {
                     path: '',
-                    redirect: '/home/tab1'
-                },
-                {
-                    path: 'tab1',
-                    component: () => import('@/views/Tab1Page.vue')
+                    redirect: '/home'
                 },
                 {
-                    path: 'tab2',
-                    component: () => import('@/views/Tab2Page.vue')
+                    path: 'home',
+                    component: () => import('@/views/Home.vue')
                 },
                 {
-                    path: 'tab3',
-                    component: () => import('@/views/Tab3Page.vue')
+                    path: 'mine',
+                    component: () => import('@/views/Mine.vue')
                 }
             ]
         },

+ 5 - 0
src/styles/common.less

@@ -2,3 +2,8 @@
     display: flex;
     align-items: center;
 }
+
+.f-col(){
+    display: flex;
+    flex-direction: column;
+}

+ 45 - 0
src/styles/fonts.less

@@ -0,0 +1,45 @@
+[class^='icon-'],
+[class*=' icon-'] {
+    /* use !important to prevent issues with browser extensions that change fonts */
+    font-family: 'icomoon' !important;
+    speak: never;
+    font-style: normal;
+    font-weight: normal;
+    font-variant: normal;
+    text-transform: none;
+    line-height: 1;
+
+    /* Better Font Rendering =========== */
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-tabbar_01_pre:before {
+    content: '\e900';
+}
+.icon-tabbar_01 .path1:before {
+    content: '\e901';
+    color: rgb(171, 171, 171);
+}
+.icon-tabbar_01 .path2:before {
+    content: '\e902';
+    margin-left: -1em;
+    color: rgb(171, 171, 171);
+}
+.icon-tabbar_01 .path3:before {
+    content: '\e903';
+    margin-left: -1em;
+    color: rgb(171, 171, 171);
+}
+.icon-tabbar_02_pre:before {
+    content: '\e904';
+}
+.icon-tabbar_02 .path1:before {
+    content: '\e905';
+    color: rgb(171, 171, 171);
+}
+.icon-tabbar_02 .path2:before {
+    content: '\e906';
+    margin-left: -1em;
+    color: rgb(171, 171, 171);
+}

+ 12 - 0
src/styles/main.less

@@ -1,3 +1,15 @@
+:root {
+    --bg2: #f5f7fa;
+    --van-primary-color: #2d2d2d;
+    --van-tabbar-item-font-size: 10px;
+    --van-tabbar-item-icon-size: 28px;
+    --van-tabbar-item-icon-margin-bottom: 2px;
+    --van-gray-6: #c8c9cc;
+    --yellow: #ffd563;
+    --red: #ff0000;
+    --green: #00b016;
+}
+
 body {
     min-height: 100vh;
     font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans',

+ 311 - 0
src/views/Home.vue

@@ -0,0 +1,311 @@
+<template>
+    <ion-page>
+        <ion-content :fullscreen="true" class="home">
+            <!-- 轮播图模块 -->
+            <div class="swiper-content">
+                <swiper
+                    :modules="[Controller]"
+                    @swiper="setSecondSwiper"
+                    :controller="{ control: firstSwiper }"
+                    class="mySwiper"
+                    :autoplay="{ delay: 3500, disableOnInteraction: false }"
+                >
+                    <swiper-slide v-for="(item, index) in topBanners" :key="index">
+                        <van-image :src="item.pic" fit="cover" height="58.7vw" width="100vw" />
+                    </swiper-slide>
+                </swiper>
+
+                <swiper
+                    class="swiper-box"
+                    :modules="[Controller]"
+                    @swiper="setFirstSwiper"
+                    :controller="{ control: secondSwiper }"
+                    parallax
+                    pagination
+                >
+                    <swiper-slide v-for="(item, index) in topBanners" :key="index">
+                        <div
+                            class="text1"
+                            data-swiper-parallay="-300"
+                            data-swiper-parallax-scale="0.15"
+                            data-swiper-parallax-duration="600"
+                        >
+                            {{ item.remark }}
+                        </div>
+                        <div
+                            class="text2"
+                            data-swiper-parallax="-300"
+                            data-swiper-parallax-scale="0.15"
+                            data-swiper-parallax-duration="600"
+                        >
+                            限量发售
+                        </div>
+                    </swiper-slide>
+                </swiper>
+            </div>
+
+            <!-- 通知 -->
+            <van-notice-bar
+                left-icon="volume-o"
+                background="#fff"
+                color="#000"
+                text="
+                    无论我们能活多久,我们能够享受的只有无法分割的此刻,此外别无其他。
+                "
+            >
+                <template #left-icon>
+                    <img class="bar-icon" src="../assets/home_icon_redian.png" alt="" />
+                    <div class="driver"></div>
+                </template>
+            </van-notice-bar>
+
+            <!-- 初级场 -->
+
+            <template v-for="(item, index) in categories" :key="index">
+                <div class="level">
+                    <van-cell :title="item.name" value="全部" :border="false" is-link />
+                    <div class="first" v-if="index === 0">
+                        <van-image
+                            :src="item.icon || firstImg"
+                            width="calc(100vw - 40px)"
+                            height="calc(100vw - 40px)"
+                            fit="cover"
+                            radius="4"
+                        />
+                        <div class="first-content">
+                            <product-info></product-info>
+                        </div>
+
+                        <div class="status hot">
+                            <img src="../assets/info_icon_qianggouzhong.png" alt="" />
+                            <span>火爆抢购中…</span>
+                        </div>
+                    </div>
+                    <div class="second" v-else>
+                        <van-image :src="item.icon || secondImg" fit="cover" />
+
+                        <div class="status">
+                            <img src="../assets/info_icon_shijian.png" alt="" />
+                            <span>15:00 开启</span>
+                        </div>
+                    </div>
+                </div>
+            </template>
+
+            <div class="tools">
+                <div class="tool">
+                    <img src="../assets/home_icon_pingtaixieyi.png" alt="" />
+                    <span>平台协议</span>
+                </div>
+                <div class="tool">
+                    <img src="../assets/home_icon_liucheng.png" alt="" />
+                    <span>使用教程</span>
+                </div>
+            </div>
+        </ion-content>
+    </ion-page>
+</template>
+
+<script setup>
+import { Swiper, SwiperSlide } from 'swiper/vue'
+import 'swiper/swiper.min.css'
+import 'swiper/swiper-bundle.min.css'
+import SwiperCore, { Pagination, Autoplay, Parallax, Controller } from 'swiper'
+
+import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton } from '@ionic/vue'
+import { useRouter } from 'vue-router'
+import { ref, getCurrentInstance, onMounted } from 'vue'
+
+import swiperImg from '../assets/bg.png'
+import firstImg from '../assets/p1.png'
+import secondImg from '../assets/bg2.png'
+
+import productInfo from '../components/ProductInfo.vue'
+
+const router = useRouter()
+function navigate() {
+    router.push({ name: 'login' })
+}
+
+const {
+    appContext: {
+        config: { globalProperties: global }
+    }
+} = getCurrentInstance()
+
+SwiperCore.use([Pagination, Autoplay, Parallax, Controller])
+const firstSwiper = ref(null)
+const secondSwiper = ref(null)
+const setFirstSwiper = swiper => {
+    firstSwiper.value = swiper
+}
+const setSecondSwiper = swiper => {
+    secondSwiper.value = swiper
+}
+
+const topBanners = ref([])
+function getBanner() {
+    global.$http.post('/banner/all', {}, { body: 'json' }).then(res => {
+        topBanners.value = res.content.filter(item => {
+            return item.type === 'TOP'
+        })
+    })
+}
+const categories = ref([])
+function getCategory() {
+    global.$http.post('saleBatch/all', {}, { body: 'json' }).then(res => {
+        categories.value = res.content
+    })
+}
+
+onMounted(() => {
+    getBanner()
+    getCategory()
+})
+</script>
+
+<style lang="less" scoped>
+.home {
+    --ion-background-color: var(--bg2);
+}
+
+.swiper-content {
+    padding-bottom: 6.4vw;
+}
+.swiper-box {
+    margin: 0 auto;
+    height: 25vw;
+    width: 89vw;
+    background: #112982 linear-gradient(135deg, #d700ff 0%, #3e22ff 100%);
+    box-shadow: 0px 0px 6px 0px #4a65ff;
+    border-radius: 2px;
+    --swiper-theme-color: #fff;
+    --swiper-pagination-color: #fff;
+    position: absolute;
+    top: 40vw;
+    left: 5.5vw;
+    .swiper-slide {
+        .f-col();
+        align-items: center;
+        justify-content: center;
+        .text1 {
+            font-size: 20px;
+            font-weight: bold;
+            color: #ffffff;
+            line-height: 28px;
+            text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.5);
+        }
+        .text2 {
+            font-size: 12px;
+            color: #ffffff;
+            line-height: 17px;
+            text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.5);
+            margin-top: 2px;
+            margin-bottom: 15px;
+        }
+    }
+
+    /deep/.swiper-pagination-bullet {
+        background-color: #fff;
+        width: 18px;
+        height: 2px;
+        border-radius: 2px;
+    }
+    /deep/.swiper-pagination {
+        bottom: calc(2.7vw + 6px);
+    }
+}
+
+.van-notice-bar {
+    margin: 16px 20px 14px;
+    --van-notice-bar-font-size: 13px;
+    border-radius: 4px;
+    .bar-icon {
+        width: 43px;
+        height: 16px;
+    }
+
+    .driver {
+        width: 1px;
+        height: 10px;
+        background: rgba(0, 0, 0, 0.2);
+        margin: 0 8px 0 9px;
+    }
+}
+
+/deep/.van-cell {
+    --van-cell-background-color: var(--bg2);
+    --van-cell-horizontal-padding: 20px;
+    background: var(--bg2);
+    .van-cell__title {
+        font-size: 16px;
+        font-weight: bold;
+    }
+}
+.first {
+    margin: 4px 20px 14px;
+    position: relative;
+    .first-content {
+        position: absolute;
+        bottom: 12px;
+        left: 12px;
+        right: 12px;
+        background: var(--yellow);
+        border-radius: 4px;
+        overflow: hidden;
+    }
+}
+
+.status {
+    .f();
+    padding: 2px 6px;
+    background: var(--green);
+    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.3);
+    border-radius: 4px;
+    position: absolute;
+    top: 18px;
+    left: 18px;
+    img {
+        width: 18px;
+        height: 18px;
+    }
+    span {
+        font-size: 12px;
+        color: #ffffff;
+        line-height: 22px;
+        margin-left: 6px;
+    }
+
+    &.hot {
+        background: var(--red);
+    }
+}
+
+.second {
+    margin: 4px 20px 14px;
+    border-radius: 4px;
+    overflow: hidden;
+    position: relative;
+}
+
+.tools {
+    .f();
+    padding: 14px 20px 30px;
+    .tool {
+        width: 50%;
+        .f();
+        justify-content: center;
+        height: 58px;
+        background: #efefef;
+        border-radius: 4px;
+        img {
+            width: 22px;
+            height: 22px;
+            margin-right: 6px;
+        }
+    }
+    .tool + .tool {
+        margin-left: 15px;
+    }
+}
+</style>

+ 0 - 9
src/views/HomeView.vue

@@ -1,9 +0,0 @@
-<script setup>
-import TheWelcome from '../components/TheWelcome.vue'
-</script>
-
-<template>
-    <main>
-        <TheWelcome />
-    </main>
-</template>

+ 0 - 5
src/views/Tab2Page.vue → src/views/Mine.vue

@@ -1,10 +1,5 @@
 <template>
     <ion-page>
-        <ion-header>
-            <ion-toolbar>
-                <ion-title>Tab 2</ion-title>
-            </ion-toolbar>
-        </ion-header>
         <ion-content :fullscreen="true">
             <ion-header collapse="condense">
                 <ion-toolbar>

+ 39 - 14
src/views/TabsPage.vue

@@ -1,29 +1,39 @@
 <template>
-    <ion-page>
-        <ion-tabs>
+    <ion-page class="tabs">
+        <ion-tabs ref="tab" @ionTabsDidChange="tabChange">
             <ion-router-outlet></ion-router-outlet>
             <ion-tab-bar slot="bottom">
-                <ion-tab-button tab="tab1" href="/home/tab1">
-                    <ion-icon :icon="triangle" />
-                    <ion-label>Tab 1</ion-label>
+                <ion-tab-button tab="home" href="/home">
+                    <img class="icon" src="../assets/tabbar_icon_01_pre.png" v-if="activeTab === 'home'" alt="" />
+                    <img class="icon" src="../assets/tabbar_icon_01.png" v-else alt="" />
+                    <ion-label>首页</ion-label>
                 </ion-tab-button>
 
-                <ion-tab-button tab="tab2" href="/home/tab2">
-                    <ion-icon :icon="ellipse" />
-                    <ion-label>Tab 2</ion-label>
-                </ion-tab-button>
-
-                <ion-tab-button tab="tab3" href="/home/tab3">
-                    <ion-icon :icon="square" />
-                    <ion-label>Tab 3</ion-label>
+                <ion-tab-button tab="mine" icon="icon-tabbar_02" icon-on="icon-tabbar_02_pre" href="/mine">
+                    <img class="icon" src="../assets/tabbar_icon_02_pre.png" v-if="activeTab === 'mine'" alt="" />
+                    <img class="icon" src="../assets/tabbar_icon_02.png" v-else alt="" />
+                    <ion-label>我的</ion-label>
                 </ion-tab-button>
             </ion-tab-bar>
         </ion-tabs>
     </ion-page>
 </template>
 
+<script setup>
+import { ref, onMounted } from 'vue'
+const activeTab = ref(null)
+const tabChange = tabInfo => {
+    if (tabInfo.tab === 'home') {
+        activeTab.value = 'home'
+    }
+    if (tabInfo.tab === 'mine') {
+        activeTab.value = 'mine'
+    }
+}
+</script>
+
 <script>
-import { defineComponent } from 'vue'
+import { defineComponent, onMounted, ref } from 'vue'
 import { IonTabBar, IonTabButton, IonTabs, IonLabel, IonIcon, IonPage, IonRouterOutlet } from '@ionic/vue'
 import { ellipse, square, triangle } from 'ionicons/icons'
 
@@ -39,3 +49,18 @@ export default defineComponent({
     }
 })
 </script>
+
+<style lang="less" scoped>
+.tabs {
+    --ion-tab-bar-background: #fff;
+    --color: #939599;
+    --ion-tab-bar-color-selected: #000;
+    --ion-tab-bar-border-color: #fff;
+}
+
+.icon {
+    width: 28px;
+    height: 28px;
+    display: block;
+}
+</style>

+ 21 - 1
yarn.lock

@@ -460,6 +460,13 @@ doctrine@^3.0.0:
   dependencies:
     esutils "^2.0.2"
 
+dom7@^4.0.4:
+  version "4.0.4"
+  resolved "https://registry.yarnpkg.com/dom7/-/dom7-4.0.4.tgz#8b68c5d8e5e2ed0fddb1cb93e433bc9060c8f3fb"
+  integrity sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==
+  dependencies:
+    ssr-window "^4.0.0"
+
 errno@^0.1.1:
   version "0.1.8"
   resolved "https://registry.npmmirror.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f"
@@ -1378,6 +1385,11 @@ sourcemap-codec@^1.4.8:
   resolved "https://registry.npmmirror.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
   integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
 
+ssr-window@^4.0.0, ssr-window@^4.0.2:
+  version "4.0.2"
+  resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be"
+  integrity sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==
+
 strip-ansi@^6.0.1:
   version "6.0.1"
   resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
@@ -1402,6 +1414,14 @@ supports-preserve-symlinks-flag@^1.0.0:
   resolved "https://registry.npmmirror.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
   integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
 
+swiper@^8.4.5:
+  version "8.4.5"
+  resolved "https://registry.yarnpkg.com/swiper/-/swiper-8.4.5.tgz#149ca81f67393d3f33abddd0f968fc37e99980b5"
+  integrity sha512-zveyEFBBv4q1sVkbJHnuH4xCtarKieavJ4SxP0QEHvdpPLJRuD7j/Xg38IVVLbp7Db6qrPsLUePvxohYx39Agw==
+  dependencies:
+    dom7 "^4.0.4"
+    ssr-window "^4.0.2"
+
 text-table@^0.2.0:
   version "0.2.0"
   resolved "https://registry.npmmirror.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
@@ -1438,7 +1458,7 @@ util-deprecate@^1.0.2:
 
 vant@^4.0.0:
   version "4.0.0"
-  resolved "https://registry.npmmirror.com/vant/-/vant-4.0.0.tgz#573e5bc5a98fbb452bf2069bc278e2c57edebbfc"
+  resolved "https://registry.yarnpkg.com/vant/-/vant-4.0.0.tgz#573e5bc5a98fbb452bf2069bc278e2c57edebbfc"
   integrity sha512-s3FDA7mWfkgFBWq/8J09dQZETeCzfGT41289fTIcp7VEcME62zXEw+8S41+stJVjk8fNXYRvMXsGfcD7HTLpaQ==
   dependencies:
     "@vant/popperjs" "^1.3.0"