commit b7b9dd950cfb376f5835e971470bea28896f6bac Author: wxc <191104855@qq.com> Date: Mon Jan 15 18:01:53 2024 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b47b3fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +.history diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c0a6e5a --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..16d5a83 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# 局长信箱 +## 技术栈 +- Vue 3 + Vite + vant +- sass + diff --git a/index.html b/index.html new file mode 100644 index 0000000..afd1ddf --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + 局长信箱 即接即办 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..5ade2c1 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "mailbox-outer-h5", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "vant": "^4.8.2", + "vue": "^3.3.11", + "vue-router": "^4.2.5" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^4.5.2", + "sass": "^1.69.7", + "unplugin-auto-import": "^0.17.3", + "vite": "^5.0.8", + "vite-svg-loader": "^5.1.0" + } +} diff --git a/public/imgs/bg.png b/public/imgs/bg.png new file mode 100644 index 0000000..f1a82cf Binary files /dev/null and b/public/imgs/bg.png differ diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..6ca9745 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/src/assets/icons/search.svg b/src/assets/icons/search.svg new file mode 100644 index 0000000..e50a631 --- /dev/null +++ b/src/assets/icons/search.svg @@ -0,0 +1,11 @@ + + + ic_chakan + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/write.svg b/src/assets/icons/write.svg new file mode 100644 index 0000000..dc0ad4e --- /dev/null +++ b/src/assets/icons/write.svg @@ -0,0 +1,11 @@ + + + ic_xiexin + + + + + + + + \ No newline at end of file diff --git a/src/assets/vue.svg b/src/assets/vue.svg new file mode 100644 index 0000000..770e9d3 --- /dev/null +++ b/src/assets/vue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Icon.vue b/src/components/Icon.vue new file mode 100644 index 0000000..07f42e8 --- /dev/null +++ b/src/components/Icon.vue @@ -0,0 +1,29 @@ + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..8d500dc --- /dev/null +++ b/src/main.js @@ -0,0 +1,16 @@ +import { createApp } from 'vue' +import router from './router/index' + +import './style.scss' +import 'vant/lib/index.css'; +import App from './App.vue' +import { Button, Tab, Tabs } from 'vant'; +import Icon from '@/components/Icon.vue' + +createApp(App) + .use(router) + .use(Button) + .use(Tab) + .use(Tabs) + .component('Icon', Icon) + .mount('#app') diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..1676ec3 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,32 @@ +import { createRouter, createWebHashHistory } from 'vue-router' + +import Home from '@/views/Home.vue' +import Mail from '@/views/mail/Index.vue' + +import NotFound from '@/views/error/404.vue' + +const constantRoutes = [ + { + path: '/', + component: Home + }, + { + path: '/mail', + component: Mail + }, + { + path: '/:catchAll(.*)', + name: 'not-found', + component: NotFound, + meta: { + title: '404' + } + } +]; + +const router = createRouter({ + history: createWebHashHistory(), + routes: constantRoutes +}); + +export default router; diff --git a/src/style.scss b/src/style.scss new file mode 100644 index 0000000..335b5f7 --- /dev/null +++ b/src/style.scss @@ -0,0 +1,136 @@ +:root:root { + --primary-color: #184DCF; + --van-blue: var(--primary-color); + +} + +body { + font-size: 14px; + font-family: PingFang-SC-Heavy; + margin: 0; + --header-height: 8.377vh; +} + +#app { + max-width: 1200px; + margin: auto; +} + +p { + margin: 0.5em 0; +} + +svg { + width: 1em; +} + +svg+span { + margin-left: .5em; +} + +.none { + display: none; +} +.flex { + display: flex; +} +.flex-inline { + display: inline-flex; +} + +.flex.v-center, .flex-inline.v-center { + align-items: center; +} + +.flex.center, .flex-inline.center { + justify-content: center; +} + +.flex.between, .flex-inline.between { + justify-content: space-between; +} + +.flex.end, .flex-inline.end { + justify-content: flex-end; +} + +.flex.wrap, .flex-inline.wrap { + flex-wrap: wrap; +} +.flex.max-content, .flex-inline.max-content { + width: max-content; +} +.flex.gap, .flex-inline.gap { + gap: 0 8px; +} +.flex.gap-10 { + gap: 0 10px; +} +.flex.gap-16 { + gap: 0 16px; +} + +.text-center { + text-align: center; +} +.text-nowrap { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.text-wrap { + white-space: pre-wrap; +} + +.container { + padding: 18px 36px; +} + +.pointer:hover { + cursor: pointer; +} +.relative { + position: relative; +} +.ml-4 { + margin-left: 4px; +} +.ml-8 { + margin-left: 8px; +} +.ml-10 { + margin-left: 10px; +} +.mr-4 { + margin-right: 4px; +} +.mr-8 { + margin-right: 8px; +} +.mr-10 { + margin-right: 10px; +} +.mr-20 { + margin-right: 20px; +} +.mt-8 { + margin-top: 8px; +} +.mt-10 { + margin-top: 10px; +} +.mt-20 { + margin-top: 20px; +} +.mb-8 { + margin-bottom: 8px; +} +.mb-10 { + margin-bottom: 10px; +} +.mb-20 { + margin-bottom: 20px; +} +.mb-40 { + margin-bottom: 40px; +} \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue new file mode 100644 index 0000000..1bf806d --- /dev/null +++ b/src/views/Home.vue @@ -0,0 +1,43 @@ + + + \ No newline at end of file diff --git a/src/views/error/404.vue b/src/views/error/404.vue new file mode 100644 index 0000000..e6c7b6a --- /dev/null +++ b/src/views/error/404.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/src/views/mail/Index.vue b/src/views/mail/Index.vue new file mode 100644 index 0000000..8229d41 --- /dev/null +++ b/src/views/mail/Index.vue @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..08ea182 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,29 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import AutoImport from 'unplugin-auto-import/vite' +import svgLoader from 'vite-svg-loader' +import path from 'path' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [ + vue(), + svgLoader(), + AutoImport({ + imports: [ + 'vue' + ] + }), + ], + resolve: { + // https://cn.vitejs.dev/config/#resolve-alias + alias: { + // 设置路径 + '~': path.resolve(__dirname, './'), + // 设置别名 + '@': path.resolve(__dirname, './src/') + }, + // https://cn.vitejs.dev/config/#resolve-extensions + extensions: ['.js'] +}, +})