Procházet zdrojové kódy

feat:添加用户的农资农服页面

wangsisi před 1 týdnem
rodič
revize
b207b3019a

+ 2 - 2
src/App.vue

@@ -70,7 +70,7 @@
                 />
             </template>
         </tabbar-item>
-        <tabbar-item replace to="/message" v-if="curRole == 0">
+        <tabbar-item replace to="/agri_services" v-if="curRole == 0">
             <span>农资农服</span>
             <template #icon="props">
                 <img
@@ -126,7 +126,7 @@ const router = useRouter();
 // 首页loading加载完才显示底部导航栏
 const showTab = ref(false);
 // 0: 农户, 1: 专家, 2:农资农服
-const curRole = ref(1);
+const curRole = ref(0);
 
 let tabBarHeight = 0;
 onMounted(() => {

+ 7 - 0
src/router/globalRoutes.js

@@ -137,5 +137,12 @@ export default [
         path: "/user_manage",
         name: "UserManage",
         component: () => import("@/views/old_mini/user/manage.vue"),
+    },
+    // 农资农服
+    {
+        path: "/agri_services",
+        name: "AgriServices",
+        meta: { showTabbar: true, keepAlive: true },
+        component: () => import("@/views/old_mini/agri_services/index.vue"),
     }
 ];

+ 45 - 0
src/views/old_mini/agri_services/index.vue

@@ -0,0 +1,45 @@
+<template>
+    <div class="agri-services">
+        <tabs v-model:active="active" class="tabs">
+            <tab title="农事动态">
+                农事动态
+                <!-- <farm-manage /> -->
+            </tab>
+            <tab title="农资农服大厅">
+                农资农服大厅
+                <!-- <demand-hall /> -->
+            </tab>
+        </tabs>
+    </div>
+</template>
+
+<script setup>
+import { ref } from "vue";
+import { Tab, Tabs } from "vant";
+
+const active = ref(0);
+</script>
+<style lang="scss" scoped>
+.agri-services {
+    width: 100%;
+    height: 100%;
+    .tabs {
+        ::v-deep {
+            .van-tabs__wrap {
+                margin-bottom: 8px;
+            }
+            .van-tabs__line {
+                width: 24px;
+                height: 4px;
+            }
+            .van-tab {
+                width: 100px;
+                flex: none;
+            }
+            .van-tabs__nav {
+                justify-content: center;
+            }
+        }
+    }
+}
+</style>