diff --git a/.env b/.env
new file mode 100644
index 0000000..da5b2cc
--- /dev/null
+++ b/.env
@@ -0,0 +1,3 @@
+VITE_ENABLE_MOCK=false
+VITE_API_PREFIX=/api
+VITE_PROXY_ENDPOINT=http://localhost:8000
diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..7010158
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,4 @@
+VITE_ENABLE_MOCK=false
+VITE_API_PREFIX=/api
+VITE_PROXY_ENDPOINT=https://bright.yilibili.com
+
diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..92b86ee
--- /dev/null
+++ b/.env.example
@@ -0,0 +1 @@
+VITE_ENABLE_MOCK=true
diff --git a/pet-manual/components/CardList.vue b/pet-manual/components/CardList.vue
new file mode 100644
index 0000000..bc7973a
--- /dev/null
+++ b/pet-manual/components/CardList.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+ {{ item.title }}
+
+
+ {{ item.desc }}
+
+
+ {{ item.time }}
+
+
+
+
+
+
+
diff --git a/pet-manual/index.vue b/pet-manual/index.vue
new file mode 100644
index 0000000..21de306
--- /dev/null
+++ b/pet-manual/index.vue
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 历史记录
+
+
+
+ {{ item.name }}
+
+
+
+
+ 搜索发现
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+ 热门推荐
+
+
+
+
+
+
+ {{ item.content }}
+
+
+
+
+
+
+ 养宠贴士
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/api/carousal.ts b/src/api/carousal.ts
new file mode 100644
index 0000000..89a3736
--- /dev/null
+++ b/src/api/carousal.ts
@@ -0,0 +1,9 @@
+import { get } from '@/api/request'
+
+function getCarousalList() {
+ return get('https://bright.yilibili.com/api/carousals/active-list')
+}
+
+export default {
+ getCarousalList,
+}
diff --git a/src/model/carousals.ts b/src/model/carousals.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/pet-manual/index.vue b/src/pages/pet-manual/index.vue
index 3d80831..21de306 100644
--- a/src/pages/pet-manual/index.vue
+++ b/src/pages/pet-manual/index.vue
@@ -1,4 +1,5 @@
@@ -131,7 +138,7 @@ const findList = ref<{ name: string }[]>([
v-model="searchValue"
placeholder="请搜索你想要的内容"
bg-color="white" clear-button="auto"
- :cancel-button="isSearch ? 'none' : 'auto'"
+ :cancel-button="isSearch ? 'none' : 'always'"
:radius="20"
@focus="handleSearchFocus"
@cancel="handleCancel"
diff --git a/vite.config.ts b/vite.config.ts
index 23167d0..c253cfc 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -8,13 +8,14 @@ import postcssPresetEnv from 'postcss-preset-env'
import tailwindcss from 'tailwindcss'
import nested from 'tailwindcss/nesting'
import AutoImport from 'unplugin-auto-import/vite'
-import { defineConfig } from 'vite'
+import { defineConfig, loadEnv } from 'vite'
import tailwindcssConfig from './tailwind.config' // 注意匹配实际文件
// 注意匹配实际文件
// https://vitejs.dev/config/
-export default async () => {
+export default async ({ command, mode }) => {
+ const env = loadEnv(mode, process.cwd(), '')
return defineConfig({
css: {
postcss: {
@@ -30,6 +31,15 @@ export default async () => {
],
},
},
+ server: {
+ proxy: {
+ '/api': {
+ target: env.VITE_PROXY_ENDPOINT,
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/api/, ''),
+ },
+ },
+ },
plugins: [
// https://github.com/uni-helper/vite-plugin-uni-manifest
UniHelperManifest(),