zhuf 1 year ago
parent
commit
4ddf547edf
9 changed files with 150 additions and 68 deletions
  1. 1 0
      components.d.ts
  2. 1 9
      index.html
  3. 4 3
      src/App.vue
  4. 1 13
      src/components/TheFooter.vue
  5. 51 0
      src/components/TheHeader.vue
  6. 1 40
      src/pages/index.vue
  7. 82 0
      src/store/user.d.ts
  8. 8 0
      src/store/user.ts
  9. 1 3
      src/styles/main.css

+ 1 - 0
components.d.ts

@@ -13,6 +13,7 @@ declare module '@vue/runtime-core' {
     RouterView: typeof import('vue-router')['RouterView']
     TheCounter: typeof import('./src/components/TheCounter.vue')['default']
     TheFooter: typeof import('./src/components/TheFooter.vue')['default']
+    TheHeader: typeof import('./src/components/TheHeader.vue')['default']
     TheInput: typeof import('./src/components/TheInput.vue')['default']
   }
 }

+ 1 - 9
index.html

@@ -7,19 +7,11 @@
   <title>Vitesse Lite</title>
   <meta name="description" content="Opinionated Vite Starter Template">
 </head>
-<body class="font-sans dark:text-white dark:bg-hex-121212">
+<body class="font-sans">
   <div id="app"></div>
   <noscript>
     <div>Please enable JavaScript to use this application.</div>
   </noscript>
-  <script>
-    (function() {
-      const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
-      const setting = localStorage.getItem('color-schema') || 'auto'
-      if (setting === 'dark' || (prefersDark && setting !== 'light'))
-        document.documentElement.classList.toggle('dark', true)
-    })()
-  </script>
   <script type="module" src="/src/main.ts"></script>
 </body>
 </html>

+ 4 - 3
src/App.vue

@@ -1,6 +1,7 @@
 <template>
-  <main font-sans p="x-4 y-10" text="center gray-700 dark:gray-200">
-    <RouterView />
+  <div class="min-h-screen w-screen flex flex-col">
+    <TheHeader />
+    <RouterView class="flex-auto" />
     <TheFooter />
-  </main>
+  </div>
 </template>

+ 1 - 13
src/components/TheFooter.vue

@@ -1,15 +1,3 @@
 <template>
-  <nav mt-6 inline-flex gap-2 text-xl>
-    <button icon-btn @click="toggleDark()">
-      <div i-carbon-sun dark:i-carbon-moon />
-    </button>
-
-    <a
-      i-carbon-logo-github icon-btn
-      rel="noreferrer"
-      href="https://github.com/antfu/vitesse-lite"
-      target="_blank"
-      title="GitHub"
-    />
-  </nav>
+  <div class="h-160px bg-dark-50 text-light-50" />
 </template>

+ 51 - 0
src/components/TheHeader.vue

@@ -0,0 +1,51 @@
+<script setup lang='ts'>
+import { user } from '~/store/user'
+
+const NavList = [
+  {
+    id: 'live_class',
+    label: '直播课程',
+
+  },
+  {
+    id: 'excellent_playback',
+    label: '精彩回放',
+
+  },
+  {
+    id: 'small_class',
+    label: '小班课程',
+
+  },
+  {
+    id: 'series_courses',
+    label: '系列课程',
+  },
+]
+</script>
+
+<template>
+  <div class="h-100px flex items-center justify-center">
+    <div class="w-1200px flex justify-between">
+      <div class="text-3xl">
+        宜昌市乡村教育振兴网络扶智课堂
+      </div>
+      <div class="cursor-pointer">
+        <img
+          class="inline-block h-40px w-40px rounded-1/2 align-middle hover:bg-hex-1259A110 hover:text-hex-1259A1"
+          :src="user.user_avatar" alt=""
+        >
+        <span class="ml-10px inline-block align-middle">
+          {{ user.user_realname }}
+        </span>
+      </div>
+    </div>
+  </div>
+  <div class="flex items-center justify-center bg-blue-600 text-lg text-light-50">
+    <div class="w-1200px flex">
+      <div v-for="item in NavList" :key="item.id" class="h-64px w-120px cursor-pointer text-center leading-64px hover:bg-blue-500">
+        {{ item.label }}
+      </div>
+    </div>
+  </div>
+</template>

+ 1 - 40
src/pages/index.vue

@@ -1,46 +1,7 @@
 <script setup lang="ts" generic="T extends any, O extends any">
-defineOptions({
-  name: 'IndexPage',
-})
-
-const name = ref('')
-
 const router = useRouter()
-function go() {
-  if (name.value)
-    router.push(`/hi/${encodeURIComponent(name.value)}`)
-}
 </script>
 
 <template>
-  <div>
-    <div i-carbon-campsite inline-block text-4xl />
-    <p>
-      <a rel="noreferrer" href="https://github.com/antfu/vitesse-lite" target="_blank">
-        Vitesse Lite
-      </a>
-    </p>
-    <p>
-      <em text-sm op75>Opinionated Vite Starter Template</em>
-    </p>
-
-    <div py-4 />
-
-    <TheInput
-      v-model="name"
-      placeholder="What's your name?"
-      autocomplete="false"
-      @keydown.enter="go"
-    />
-
-    <div>
-      <button
-        class="m-3 text-sm btn"
-        :disabled="!name"
-        @click="go"
-      >
-        Go
-      </button>
-    </div>
-  </div>
+  <div />
 </template>

+ 82 - 0
src/store/user.d.ts

@@ -0,0 +1,82 @@
+export interface User {
+  about: string
+  address: string
+  area_id1: string
+  area_id2: string
+  area_id3: string
+  area_id4: string
+  create_dateline: string
+  email_token: string
+  email_token_exptime: string
+  email_validation: string
+  gender: string
+  ischeck: string
+  isdelete: string
+  modify_dateline: string
+  openid: string
+  parent_user_id: string
+  phone_validation: string
+  qq: string
+  setting: Setting
+  /**
+   * 用户token
+   */
+  token: string
+  user_abalance: string
+  user_address: { [key: string]: any }
+  user_alipay_account: string
+  /**
+   * 用户头像
+   */
+  user_avatar: string
+  user_birthday: string
+  user_cardno: string
+  user_dcash: string
+  user_detail_id: string
+  user_dqsj: string
+  /**
+   * email
+   */
+  user_email: string
+  user_group_id: string
+  user_id: string
+  user_level: string
+  user_level_id: string
+  /**
+   * 用户名
+   */
+  user_name: string
+  /**
+   * 用户昵称
+   */
+  user_nickname: string
+  user_password: string
+  user_phone: string
+  /**
+   * 用户真实姓名
+   */
+  user_realname: string
+  user_role_id: string
+  user_score: string
+  webchatopenid: string,
+  user_role_id_ext_now: string,
+}
+
+interface Setting {
+  site_address: string
+  site_email: string
+  site_hotphone: string
+  site_icp: string
+  site_linephone: string
+  site_wx_appid: string
+  site_wx_mchid: string
+  site_wx_sp_appid: string
+  site_wx_sp_mchid: string
+  site_wxapp_appid: string
+  sitedomain: string
+  sitefavicon: string
+  sitelogo: string
+  sitename: string
+  siteqrcode: string
+  user_failedlogin_max: string
+}

File diff suppressed because it is too large
+ 8 - 0
src/store/user.ts


+ 1 - 3
src/styles/main.css

@@ -6,6 +6,4 @@ body,
   padding: 0;
 }
 
-html.dark {
-  background: #121212;
-}
+