From 0a1267fa000d7a8e701be1ca52d3b1eff1f88980 Mon Sep 17 00:00:00 2001
From: zlong <953829746@qq.com>
Date: Sun, 24 Nov 2024 23:57:16 +0800
Subject: [PATCH 1/6] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=92=8C=E5=8D=A1=E7=89=87=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/pet-manual/components/CardList.vue | 36 ++++++
src/pages/pet-manual/index.vue | 128 ++++++++++++-------
2 files changed, 116 insertions(+), 48 deletions(-)
create mode 100644 src/pages/pet-manual/components/CardList.vue
diff --git a/src/pages/pet-manual/components/CardList.vue b/src/pages/pet-manual/components/CardList.vue
new file mode 100644
index 0000000..bc7973a
--- /dev/null
+++ b/src/pages/pet-manual/components/CardList.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+ {{ item.title }}
+
+
+ {{ item.desc }}
+
+
+ {{ item.time }}
+
+
+
+
+
+
+
diff --git a/src/pages/pet-manual/index.vue b/src/pages/pet-manual/index.vue
index 2815678..45bedfb 100644
--- a/src/pages/pet-manual/index.vue
+++ b/src/pages/pet-manual/index.vue
@@ -1,4 +1,5 @@
@@ -110,62 +125,79 @@ function handleClickType(item: TypeItem) {
-
- 热门推荐
-
-
-
-
-
-
- {{ item.content }}
-
-
-
-
-
-
- 养宠贴士
-
-
-
-
-
-
-
-
-
-
- {{ item.name }}
-
+
+
+
+ 历史记录
+
+
+
+ {{ item.name }}
-
-
-
-
-
-
-
- {{ item.title }}
-
-
- {{ item.desc }}
-
-
- {{ item.time }}
+
+
+ 搜索发现
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+ 热门推荐
+
+
+
+
+
+
+ {{ item.content }}
+
+
+
+
+
+
+ 养宠贴士
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
From 70a12d0cb460db1bb90a2dfe358cee9c874b6e9b Mon Sep 17 00:00:00 2001
From: zlong <953829746@qq.com>
Date: Sun, 24 Nov 2024 23:58:32 +0800
Subject: [PATCH 2/6] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=92=8C=E5=8D=A1=E7=89=87=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/pet-manual/components/CardList.vue | 36 ---
src/pages/pet-manual/index.vue | 221 -------------------
2 files changed, 257 deletions(-)
delete mode 100644 src/pages/pet-manual/components/CardList.vue
delete mode 100644 src/pages/pet-manual/index.vue
diff --git a/src/pages/pet-manual/components/CardList.vue b/src/pages/pet-manual/components/CardList.vue
deleted file mode 100644
index bc7973a..0000000
--- a/src/pages/pet-manual/components/CardList.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
- {{ item.title }}
-
-
- {{ item.desc }}
-
-
- {{ item.time }}
-
-
-
-
-
-
-
diff --git a/src/pages/pet-manual/index.vue b/src/pages/pet-manual/index.vue
deleted file mode 100644
index 45bedfb..0000000
--- a/src/pages/pet-manual/index.vue
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 历史记录
-
-
-
- {{ item.name }}
-
-
-
-
- 搜索发现
-
-
-
-
-
-
-
- {{ item.name }}
-
-
-
-
-
-
-
-
- 热门推荐
-
-
-
-
-
-
- {{ item.content }}
-
-
-
-
-
-
- 养宠贴士
-
-
-
-
-
-
-
-
-
-
- {{ item.name }}
-
-
-
-
-
-
-
-
-
-
-
From 44cd3af80a66ae17dac20d79010a1ea10453621b Mon Sep 17 00:00:00 2001
From: zlong <953829746@qq.com>
Date: Sun, 24 Nov 2024 23:58:52 +0800
Subject: [PATCH 3/6] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=92=8C=E5=8D=A1=E7=89=87=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/pet-manual/components/CardList.vue | 36 +++
src/pages/pet-manual/index.vue | 221 +++++++++++++++++++
2 files changed, 257 insertions(+)
create mode 100644 src/pages/pet-manual/components/CardList.vue
create mode 100644 src/pages/pet-manual/index.vue
diff --git a/src/pages/pet-manual/components/CardList.vue b/src/pages/pet-manual/components/CardList.vue
new file mode 100644
index 0000000..bc7973a
--- /dev/null
+++ b/src/pages/pet-manual/components/CardList.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+ {{ item.title }}
+
+
+ {{ item.desc }}
+
+
+ {{ item.time }}
+
+
+
+
+
+
+
diff --git a/src/pages/pet-manual/index.vue b/src/pages/pet-manual/index.vue
new file mode 100644
index 0000000..45bedfb
--- /dev/null
+++ b/src/pages/pet-manual/index.vue
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 历史记录
+
+
+
+ {{ item.name }}
+
+
+
+
+ 搜索发现
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+ 热门推荐
+
+
+
+
+
+
+ {{ item.content }}
+
+
+
+
+
+
+ 养宠贴士
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
From 7189c688cbd210f7c9bf408c8218d6578e14a87d Mon Sep 17 00:00:00 2001
From: zlong <953829746@qq.com>
Date: Tue, 26 Nov 2024 11:29:09 +0800
Subject: [PATCH 4/6] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E5=8F=96=E6=B6=88?=
=?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=90=9C=E7=B4=A2=E6=A0=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/pet-manual/index.vue | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/pages/pet-manual/index.vue b/src/pages/pet-manual/index.vue
index 45bedfb..3d80831 100644
--- a/src/pages/pet-manual/index.vue
+++ b/src/pages/pet-manual/index.vue
@@ -107,6 +107,9 @@ const isSearch = ref(false)
function handleSearchFocus() {
isSearch.value = false
}
+function handleCancel() {
+ isSearch.value = true
+}
const historyList = ref<{ name: string }[]>([
{ name: '猫' },
{ name: '狗' },
@@ -131,6 +134,7 @@ const findList = ref<{ name: string }[]>([
:cancel-button="isSearch ? 'none' : 'auto'"
:radius="20"
@focus="handleSearchFocus"
+ @cancel="handleCancel"
/>
From 23cc6b6d3559b036a280849bae012ecac1bb17a5 Mon Sep 17 00:00:00 2001
From: zlong <953829746@qq.com>
Date: Tue, 3 Dec 2024 09:04:00 +0800
Subject: [PATCH 5/6] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E8=AF=B7=E6=B1=82?=
=?UTF-8?q?=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/request.ts | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 src/api/request.ts
diff --git a/src/api/request.ts b/src/api/request.ts
new file mode 100644
index 0000000..971f474
--- /dev/null
+++ b/src/api/request.ts
@@ -0,0 +1,26 @@
+export function get(url: string, params: string | AnyObject | ArrayBuffer = {}) {
+ return _request('GET', url, params)
+}
+export function post(url: string, data: string | AnyObject | ArrayBuffer) {
+ return _request('POST', url, data)
+}
+
+function _request(
+ method: 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'CONNECT',
+ url: string,
+ data: string | AnyObject | ArrayBuffer = {},
+) {
+ return new Promise((resolve, reject) => {
+ uni.request({
+ method,
+ url,
+ data,
+ success: (result) => {
+ resolve(result.data as T)
+ },
+ fail: (result) => {
+ reject('服务器无法触达')
+ },
+ })
+ })
+}
From f1eec0ac6d2438b3e8e6e956960b5d67c8862766 Mon Sep 17 00:00:00 2001
From: zlong <953829746@qq.com>
Date: Tue, 3 Dec 2024 15:33:37 +0800
Subject: [PATCH 6/6] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E4=BB=A3=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env | 3 +
.env.development | 4 +
.env.example | 1 +
pet-manual/components/CardList.vue | 36 +++++
pet-manual/index.vue | 232 +++++++++++++++++++++++++++++
src/api/carousal.ts | 9 ++
src/model/carousals.ts | 0
src/pages/pet-manual/index.vue | 11 +-
vite.config.ts | 14 +-
9 files changed, 306 insertions(+), 4 deletions(-)
create mode 100644 .env
create mode 100644 .env.development
create mode 100644 .env.example
create mode 100644 pet-manual/components/CardList.vue
create mode 100644 pet-manual/index.vue
create mode 100644 src/api/carousal.ts
create mode 100644 src/model/carousals.ts
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(),