diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..2fa9907 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,47 @@ +# Copilot Instructions for chazhi_store + +## 项目架构与核心约定 + +- 本项目基于 UniApp(Unibest 3.8.2),采用 Vue 3 + TypeScript,目录结构以 `src/` 为主,分为页面、组件、API、服务、工具等模块。 +- 页面与组件的方法命名规范:对外暴露方法统一以 `handle` 前缀命名(如 `handleLogin`),内部方法无需加前缀,所有方法集中在对象底部。 +- 组件/页面对外方法对象名建议与文件名一致,若冲突可加 `s` 后缀。 +- 路由、页面配置见 `src/pages.json`、`src/router/`,布局在 `src/layouts/`。 +- 样式采用 `unocss`,全局样式在 `src/uni.scss`,图标需在 `uno.config.ts` 的 `safelist` 配置。 + +## 网络请求与数据流 + +- 支持三种请求库: + - 简单版 http(`src/http/http.ts`),示例见 `src/api/foo.ts` + - alova(`src/http/alova.ts`),示例见 `src/api/foo-alova.ts` + - vue-query(`src/http/vue-query.ts`),自动生成接口,示例见 `src/service/` +- 选择建议:简单场景用 http,复杂/自动化用 alova 或 vue-query。 +- 状态管理采用 `pinia`,入口在 `src/store/`。 + +## Tabbar 策略 + +- 支持 4 种 tabbar:无、原生、自定义有缓存、自定义无缓存,详见 `src/tabbar/README.md`。 +- tabbar 配置需与接口返回的 path 对齐,使用 unocss 图标需在 `uno.config.ts` safelist 配置。 + +## 关键开发流程 + +- 构建/运行:使用 HBuilderX 或 `vite`,配置见 `vite.config.ts`。 +- 依赖管理:使用 `pnpm`,依赖锁定在 `pnpm-lock.yaml`。 +- 约定优于配置,所有新增页面/组件/服务请遵循现有命名与结构。 + +## 重要文件/目录参考 + +- `src/pages/` 页面目录 +- `src/components/` 通用组件 +- `src/api/` 接口定义 +- `src/http/` 请求库实现 +- `src/service/` 业务服务层 +- `src/store/` 状态管理 +- `src/utils/` 工具函数 +- `src/layouts/` 布局 +- `src/tabbar/` tabbar 策略与配置 + +## 其他说明 + +- 代码注释与文档以中文为主。 +- 详细用法、特殊约定见各模块下 README.md。 +- 遇到不明确的约定,优先参考现有实现和 README。 diff --git a/env/.env b/env/.env index a63ca5a..e8d1d55 100644 --- a/env/.env +++ b/env/.env @@ -1,5 +1,5 @@ VITE_APP_TITLE = '茶址' -VITE_APP_PORT = 9000 +VITE_APP_PORT = 9002 VITE_UNI_APPID = '__UNI__D1E5001' VITE_WX_APPID = 'wx63e106209b842919' diff --git a/src/bundle/account/switch.vue b/src/bundle/account/switch.vue new file mode 100644 index 0000000..b50968c --- /dev/null +++ b/src/bundle/account/switch.vue @@ -0,0 +1,54 @@ +{ + "layout": "default", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#F6F7F9" + } +} + + + + + + + diff --git a/src/bundle/finance/finance.vue b/src/bundle/finance/finance.vue new file mode 100644 index 0000000..5bc698d --- /dev/null +++ b/src/bundle/finance/finance.vue @@ -0,0 +1,133 @@ +{ + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#F6F7F8" + } +} + + + + + + + diff --git a/src/bundle/store/verify-code.vue b/src/bundle/store/verify-code.vue new file mode 100644 index 0000000..8bebbe5 --- /dev/null +++ b/src/bundle/store/verify-code.vue @@ -0,0 +1,73 @@ +{ + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#F6F7F9" + } +} + + + + + + + diff --git a/src/bundle/store/verify-record.vue b/src/bundle/store/verify-record.vue new file mode 100644 index 0000000..469f96e --- /dev/null +++ b/src/bundle/store/verify-record.vue @@ -0,0 +1,79 @@ +{ + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#F6F7F8" + } +} + + + + + + + diff --git a/src/manifest.json b/src/manifest.json index fa783d9..09cbe33 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { - "name": "茶址", - "appid": "__UNI__D1E5001", + "name": "", + "appid": "", "description": "", "versionName": "1.0.0", "versionCode": "100", @@ -18,93 +18,22 @@ "modules": {}, "distribute": { "android": { - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "minSdkVersion": 30, - "targetSdkVersion": 30, - "abiFilters": [ - "armeabi-v7a", - "arm64-v8a" - ] + "permissions": [] }, "ios": {}, - "sdkConfigs": {}, - "icons": { - "android": { - "hdpi": "static/app/icons/72x72.png", - "xhdpi": "static/app/icons/96x96.png", - "xxhdpi": "static/app/icons/144x144.png", - "xxxhdpi": "static/app/icons/192x192.png" - }, - "ios": { - "appstore": "static/app/icons/1024x1024.png", - "ipad": { - "app": "static/app/icons/76x76.png", - "app@2x": "static/app/icons/152x152.png", - "notification": "static/app/icons/20x20.png", - "notification@2x": "static/app/icons/40x40.png", - "proapp@2x": "static/app/icons/167x167.png", - "settings": "static/app/icons/29x29.png", - "settings@2x": "static/app/icons/58x58.png", - "spotlight": "static/app/icons/40x40.png", - "spotlight@2x": "static/app/icons/80x80.png" - }, - "iphone": { - "app@2x": "static/app/icons/120x120.png", - "app@3x": "static/app/icons/180x180.png", - "notification@2x": "static/app/icons/40x40.png", - "notification@3x": "static/app/icons/60x60.png", - "settings@2x": "static/app/icons/58x58.png", - "settings@3x": "static/app/icons/87x87.png", - "spotlight@2x": "static/app/icons/80x80.png", - "spotlight@3x": "static/app/icons/120x120.png" - } - } - } - }, - "compatible": { - "ignoreVersion": true + "sdkConfigs": {} } }, "quickapp": {}, "mp-weixin": { - "appid": "wx63e106209b842919", + "appid": "", "setting": { - "urlCheck": false, - "es6": true, - "minified": true + "urlCheck": false }, - "usingComponents": true, - "requiredPrivateInfos": [ - "getLocation" - ], - "optimization": { - "subPackages": true - }, - "permission": { - "scope.userLocation": { - "desc": "我们需要获取您的位置,以方便推荐附近茶室给您" - } - } + "usingComponents": true }, "mp-alipay": { - "usingComponents": true, - "styleIsolation": "shared" + "usingComponents": true }, "mp-baidu": { "usingComponents": true @@ -116,7 +45,126 @@ "enable": false }, "vueVersion": "3", - "h5": { - "router": {} + "default": { + "name": "茶址", + "appid": "__UNI__D1E5001", + "description": "", + "versionName": "1.0.0", + "versionCode": "100", + "transformPx": false, + "h5": { + "router": {} + }, + "app-plus": { + "usingComponents": true, + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "compatible": { + "ignoreVersion": true + }, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 + }, + "modules": {}, + "distribute": { + "android": { + "minSdkVersion": 30, + "targetSdkVersion": 30, + "abiFilters": [ + "armeabi-v7a", + "arm64-v8a" + ], + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios": {}, + "sdkConfigs": {}, + "icons": { + "android": { + "hdpi": "static/app/icons/72x72.png", + "xhdpi": "static/app/icons/96x96.png", + "xxhdpi": "static/app/icons/144x144.png", + "xxxhdpi": "static/app/icons/192x192.png" + }, + "ios": { + "appstore": "static/app/icons/1024x1024.png", + "ipad": { + "app": "static/app/icons/76x76.png", + "app@2x": "static/app/icons/152x152.png", + "notification": "static/app/icons/20x20.png", + "notification@2x": "static/app/icons/40x40.png", + "proapp@2x": "static/app/icons/167x167.png", + "settings": "static/app/icons/29x29.png", + "settings@2x": "static/app/icons/58x58.png", + "spotlight": "static/app/icons/40x40.png", + "spotlight@2x": "static/app/icons/80x80.png" + }, + "iphone": { + "app@2x": "static/app/icons/120x120.png", + "app@3x": "static/app/icons/180x180.png", + "notification@2x": "static/app/icons/40x40.png", + "notification@3x": "static/app/icons/60x60.png", + "settings@2x": "static/app/icons/58x58.png", + "settings@3x": "static/app/icons/87x87.png", + "spotlight@2x": "static/app/icons/80x80.png", + "spotlight@3x": "static/app/icons/120x120.png" + } + } + } + } + }, + "quickapp": {}, + "mp-weixin": { + "appid": "wx63e106209b842919", + "setting": { + "urlCheck": false, + "es6": true, + "minified": true + }, + "requiredPrivateInfos": [ + "getLocation" + ], + "optimization": { + "subPackages": true + }, + "usingComponents": true, + "permission": { + "scope.userLocation": { + "desc": "我们需要获取您的位置,以方便推荐附近茶室给您" + } + } + }, + "mp-alipay": { + "usingComponents": true, + "styleIsolation": "shared" + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "uniStatistics": { + "enable": false + }, + "vueVersion": "3" } } \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index d7bbdb8..2e35a31 100644 --- a/src/pages.json +++ b/src/pages.json @@ -32,10 +32,16 @@ "text": "首页" }, { - "iconPath": "static/tabbar/reserve.png", - "selectedIconPath": "static/tabbar/reserve_s.png", + "iconPath": "static/tabbar/order.png", + "selectedIconPath": "static/tabbar/order_s.png", "pagePath": "pages/reserve/reserve", - "text": "预约" + "text": "订单" + }, + { + "iconPath": "static/tabbar/store.png", + "selectedIconPath": "static/tabbar/store_s.png", + "pagePath": "pages/login/login", + "text": "门店管理" }, { "iconPath": "static/tabbar/my.png", @@ -102,13 +108,30 @@ "path": "pages/login/login", "type": "page", "layout": "default", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/login/mobile", + "type": "page", + "layout": "default", "style": { "navigationBarTitleText": "", "navigationBarBackgroundColor": "#fff" } }, { - "path": "pages/login/mobile", + "path": "pages/login/password", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#fff" + } + }, + { + "path": "pages/login/set-password", "type": "page", "layout": "default", "style": { @@ -181,6 +204,15 @@ { "root": "bundle", "pages": [ + { + "path": "account/switch", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#F6F7F9" + } + }, { "path": "collect/collect", "type": "page", @@ -216,6 +248,15 @@ "navigationBarTitleText": "分包页面" } }, + { + "path": "finance/finance", + "type": "page", + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#F6F7F8" + } + }, { "path": "profile/profile", "type": "page", @@ -249,6 +290,24 @@ "navigationStyle": "custom" } }, + { + "path": "store/verify-code", + "type": "page", + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#F6F7F9" + } + }, + { + "path": "store/verify-record", + "type": "page", + "layout": "default", + "style": { + "navigationStyle": "custom", + "navigationBarBackgroundColor": "#F6F7F8" + } + }, { "path": "store-recharge/store-recharge", "type": "page", diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 254420a..2368feb 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -9,121 +9,126 @@ } @@ -311,36 +208,6 @@ page { background-repeat: no-repeat; } -.search-box { - display: flex; - height: 100%; - margin-right: 40px; - --wot-search-padding: 0; - --wot-search-side-padding: 0; - - :deep() { - .wd-search { - background: transparent !important; - width: 100% !important; - } - - .wd-search__block { - background-color: #fff !important; - } - - .wd-search__input { - // #ifdef MP - padding-left: 32px !important; - padding-right: 32px !important; - // #endif - - // #ifndef MP - padding-right: 0 !important; - // #endif - } - } -} - .rounded { border-radius: 20rpx 0rpx 20rpx 0rpx; } diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index 64579e4..f768c3b 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -1,112 +1,202 @@ { "layout": "default", "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#fff" + "navigationStyle": "custom" } } + diff --git a/src/pages/login/password.vue b/src/pages/login/password.vue new file mode 100644 index 0000000..52010ab --- /dev/null +++ b/src/pages/login/password.vue @@ -0,0 +1,224 @@ +{ + "layout": "default", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#fff" + } +} + + + + + + + diff --git a/src/pages/login/set-password.vue b/src/pages/login/set-password.vue new file mode 100644 index 0000000..10229f0 --- /dev/null +++ b/src/pages/login/set-password.vue @@ -0,0 +1,223 @@ +{ + "layout": "default", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#fff" + } +} + + + + + + + diff --git a/src/static/tabbar/home.png b/src/static/tabbar/home.png index 2fa5c0a..87992da 100644 Binary files a/src/static/tabbar/home.png and b/src/static/tabbar/home.png differ diff --git a/src/static/tabbar/home_s.png b/src/static/tabbar/home_s.png index b58714d..305753d 100644 Binary files a/src/static/tabbar/home_s.png and b/src/static/tabbar/home_s.png differ diff --git a/src/static/tabbar/my_s.png b/src/static/tabbar/my_s.png index 85a80c3..ff791cc 100644 Binary files a/src/static/tabbar/my_s.png and b/src/static/tabbar/my_s.png differ diff --git a/src/static/tabbar/order.png b/src/static/tabbar/order.png new file mode 100644 index 0000000..50863ba Binary files /dev/null and b/src/static/tabbar/order.png differ diff --git a/src/static/tabbar/order_s.png b/src/static/tabbar/order_s.png new file mode 100644 index 0000000..32d5fb9 Binary files /dev/null and b/src/static/tabbar/order_s.png differ diff --git a/src/static/tabbar/reserve.png b/src/static/tabbar/reserve.png deleted file mode 100644 index 9f817e7..0000000 Binary files a/src/static/tabbar/reserve.png and /dev/null differ diff --git a/src/static/tabbar/reserve_s.png b/src/static/tabbar/reserve_s.png deleted file mode 100644 index dc9c686..0000000 Binary files a/src/static/tabbar/reserve_s.png and /dev/null differ diff --git a/src/static/tabbar/store.png b/src/static/tabbar/store.png new file mode 100644 index 0000000..227f21c Binary files /dev/null and b/src/static/tabbar/store.png differ diff --git a/src/static/tabbar/store_s.png b/src/static/tabbar/store_s.png new file mode 100644 index 0000000..ac1a7af Binary files /dev/null and b/src/static/tabbar/store_s.png differ diff --git a/src/tabbar/config.ts b/src/tabbar/config.ts index 20ce39f..bf2529c 100644 --- a/src/tabbar/config.ts +++ b/src/tabbar/config.ts @@ -42,23 +42,23 @@ export const nativeTabbarList: NativeTabBarItem[] = [ text: '首页', }, { - iconPath: 'static/tabbar/reserve.png', - selectedIconPath: 'static/tabbar/reserve_s.png', + iconPath: 'static/tabbar/order.png', + selectedIconPath: 'static/tabbar/order_s.png', pagePath: 'pages/reserve/reserve', - text: '预约', + text: '订单', + }, + { + iconPath: 'static/tabbar/store.png', + selectedIconPath: 'static/tabbar/store_s.png', + pagePath: 'pages/login/login', + text: '门店管理', }, { iconPath: 'static/tabbar/my.png', selectedIconPath: 'static/tabbar/my_s.png', pagePath: 'pages/my/my', text: '我的', - }, - // { - // iconPath: 'static/tabbar/example.png', - // selectedIconPath: 'static/tabbar/exampleHL.png', - // pagePath: 'pages/about/about', - // text: '关于', - // }, + } ] // pagePath 是 nativeTabbarList 和 customTabbarList 的关联点,如果没有对应上,会有问题!!