diff --git a/README.md b/README.md index dd52660..9f65d3f 100644 --- a/README.md +++ b/README.md @@ -325,3 +325,22 @@ be imported.

微信收款码

--> + + +引入了wot ui 组件 +### 引入 +https://wot-design-uni.cn/guide/join-group.html + +安装 area-data 组件 +# 通过 pnpm +pnpm add @vant/area-data + +使用 +在 Vant 的 Area 组件中使用时,直接引用 areaList 对象即可: + +import { areaList } from '@vant/area-data'; +在 Vant 的 Cascader 组件中使用时,请使用 useCascaderAreaData 方法: + +import { useCascaderAreaData } from '@vant/area-data'; + +const cascaderAreaData = useCascaderAreaData(); \ No newline at end of file diff --git a/env/.env b/env/.env index 3cb2619..5391e26 100644 --- a/env/.env +++ b/env/.env @@ -5,8 +5,8 @@ VITE_APP_TITLE=uniapp-vue3模板项目 VITE_APP_ENV=development # 接口地址 -# VITE_API_BASE_URL=http://www.caipu.com:8545 -VITE_API_BASE_URL=https://ceshi-recipeapi.lihaink.cn/ +VITE_API_BASE_URL=http://www.caipu.com:8545 +# VITE_API_BASE_URL=https://ceshi-recipeapi.lihaink.cn/ # 端口号 VITE_APP_PORT=9527 @@ -15,8 +15,8 @@ VITE_APP_PORT=9527 VITE_APP_PROXY=true # API代理前缀 -# VITE_API_PREFIX= http://www.caipu.com:8545 -VITE_API_PREFIX= https://ceshi-recipeapi.lihaink.cn/ +VITE_API_PREFIX= http://www.caipu.com:8545 +# VITE_API_PREFIX= https://ceshi-recipeapi.lihaink.cn/ # 删除console VITE_DROP_CONSOLE=false diff --git a/package.json b/package.json index ad571cf..fbdf21d 100644 --- a/package.json +++ b/package.json @@ -68,12 +68,14 @@ "@dcloudio/uni-components": "3.0.0-4060420250429001", "@dcloudio/uni-h5": "3.0.0-4060420250429001", "@dcloudio/uni-mp-weixin": "3.0.0-4060420250429001", + "@vant/area-data": "^2.0.0", "dayjs": "^1.11.13", "pinia": "2.2.4", "pinia-plugin-persistedstate": "4.1.3", "uview-plus": "^3.4.28", "vue": "3.4.21", "vue-i18n": "9.1.9", + "wot-design-uni": "^1.11.1", "z-paging": "^2.8.4" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ab81295..e292633 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: '@dcloudio/uni-mp-weixin': specifier: 3.0.0-4060420250429001 version: 3.0.0-4060420250429001(@nuxt/kit@3.17.2)(postcss@8.5.3)(vue@3.4.21(typescript@5.8.3)) + '@vant/area-data': + specifier: ^2.0.0 + version: 2.0.0 dayjs: specifier: ^1.11.13 version: 1.11.13 @@ -41,6 +44,9 @@ importers: vue-i18n: specifier: 9.1.9 version: 9.1.9(vue@3.4.21(typescript@5.8.3)) + wot-design-uni: + specifier: ^1.11.1 + version: 1.11.1(vue@3.4.21(typescript@5.8.3)) z-paging: specifier: ^2.8.4 version: 2.8.6 @@ -2342,6 +2348,9 @@ packages: cpu: [x64] os: [win32] + '@vant/area-data@2.0.0': + resolution: {integrity: sha512-zgP4AA8z09S9QTNgVCCHo9cHjcybrv22RJDYPjuCkecn4SB98T5EoPQh2TwqbQXmUhbaOGgiZGy3OUaUxnY7qg==} + '@vitejs/plugin-legacy@5.3.2': resolution: {integrity: sha512-8moCOrIMaZ/Rjln0Q6GsH6s8fAt1JOI3k8nmfX4tXUxE5KAExVctSyOBk+A25GClsdSWqIk2yaUthH3KJ2X4tg==} engines: {node: ^18.0.0 || >=20.0.0} @@ -5977,6 +5986,12 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wot-design-uni@1.11.1: + resolution: {integrity: sha512-Pjfnz+4v0XDWvVJ/mkgVUzneOpB/WR0H+iD+Wt0hbELopuZhA1DzFvUsRA90cP/7sPsKiwiwKl3aXecG++4SkQ==} + engines: {HBuilderX: ^3.8.7} + peerDependencies: + vue: '>=3.2.47' + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -8839,6 +8854,8 @@ snapshots: '@unrs/resolver-binding-win32-x64-msvc@1.7.2': optional: true + '@vant/area-data@2.0.0': {} + '@vitejs/plugin-legacy@5.3.2(terser@5.39.0)(vite@5.2.8(@types/node@22.15.17)(sass@1.79.6)(terser@5.39.0))': dependencies: '@babel/core': 7.27.1 @@ -13183,6 +13200,10 @@ snapshots: word-wrap@1.2.5: {} + wot-design-uni@1.11.1(vue@3.4.21(typescript@5.8.3)): + dependencies: + vue: 3.4.21(typescript@5.8.3) + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 diff --git a/src/hooks/area-data/index.ts b/src/hooks/area-data/index.ts new file mode 100644 index 0000000..a0ab741 --- /dev/null +++ b/src/hooks/area-data/index.ts @@ -0,0 +1,38 @@ +// 可以将此代码放置于项目src/hooks/useColPickerData.ts中 +import { useCascaderAreaData } from '@vant/area-data' + +export type CascaderOption = { + text: string + value: string + children?: CascaderOption[] +} + +/** + * 使用'@vant/area-data'作为数据源,构造ColPicker组件的数据 + * @returns + */ +export default function useColPickerData() { + // '@vant/area-data' 数据源 + const colPickerData: CascaderOption[] = useCascaderAreaData() + + // 根据code查找子节点,不传code则返回所有节点 + function findChildrenByCode(data: CascaderOption[], code?: string): CascaderOption[] | null { + if (!code) { + return data + } + for (const item of data) { + if (item.value === code) { + return item.children || null + } + if (item.children) { + const childrenResult = findChildrenByCode(item.children, code) + if (childrenResult) { + return childrenResult + } + } + } + return null + } + + return { colPickerData, findChildrenByCode } +} \ No newline at end of file diff --git a/src/hooks/index.ts b/src/hooks/index.ts index a38242d..d412284 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -5,4 +5,7 @@ import useModal from './use-modal'; import usePermission from './use-permission'; import useShare from './use-share'; -export { useClipboard, useLoading, useLocation, useModal, usePermission, useShare }; +import useColPickerData from './area-data'; + + +export {useColPickerData, useClipboard, useLoading, useLocation, useModal, usePermission, useShare }; diff --git a/src/manifest.json b/src/manifest.json index f81a4bd..b89c637 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -81,7 +81,9 @@ "h5" : { "router" : { "mode" : "hash", - "base" : "/caipu_uni/" + // "base" : "/caipu_uni/" + "base" : "" + }, "sdkConfigs" : { "maps" : { diff --git a/src/pages.json b/src/pages.json index 70b7846..c4baea3 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,10 +1,12 @@ { "easycom": { + "autoscan": true, "custom": { "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue", - "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue" + "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue", + "^wd-(.*)": "wot-design-uni/components/wd-$1/wd-$1.vue" } }, "pages": [ @@ -106,6 +108,89 @@ } + ] + }, + { + "root": "pages/banquet", + "pages": [ + + { + "path": "home/index", + "style": { + "navigationBarTitleText": "首页", + "navigationStyle": "custom" + }, + "needLogin": true + }, + + { + "path": "cook/list", + "style": { + "navigationBarTitleText": "厨师", + "navigationStyle": "custom" + }, + "needLogin": true + }, + { + "path": "cook/detail", + "style": { + "navigationBarTitleText": "厨师详情", + "navigationStyle": "custom" + }, + "needLogin": true + }, + + { + "path": "hotel/list", + "style": { + "navigationBarTitleText": "酒店", + "navigationStyle": "custom" + }, + "needLogin": true + }, + { + "path": "hotel/detail", + "style": { + "navigationBarTitleText": "酒店详情", + "navigationStyle": "custom" + }, + "needLogin": true + }, + + { + "path": "combo/index", + "style": { + "navigationBarTitleText": "餐标选择", + "navigationStyle": "custom" + }, + "needLogin": true + }, + { + "path": "combo/detail", + "style": { + "navigationBarTitleText": "订单详情", + "navigationStyle": "custom" + }, + "needLogin": true + }, + { + "path": "order/detail", + "style": { + "navigationBarTitleText": "订单详情", + "navigationStyle": "custom" + }, + "needLogin": true + }, + { + "path": "order/pay", + "style": { + "navigationBarTitleText": "付款详情", + "navigationStyle": "custom" + }, + "needLogin": true + } + + ] } ], @@ -120,18 +205,38 @@ "selectedColor": "#59CB56", "borderStyle": "black", "backgroundColor": "#ffffff", - "list": [{ + "list": [ + { "iconPath": "static/images/tabbar/shouye.png", "selectedIconPath": "static/images/tabbar/shouye_selected.png", - "pagePath": "pages/tab/home/index", - "text": "菜单分类" + "pagePath": "pages/banquet/home/index", + "text": "首页" }, { + "iconPath": "static/images/tabbar/shouye.png", + "selectedIconPath": "static/images/tabbar/shouye_selected.png", + "pagePath": "pages/banquet/cook/list", + "text": "选厨师" + }, + { "iconPath": "static/images/tabbar/bofang.png", "selectedIconPath": "static/images/tabbar/bofang_selected.png", - "pagePath": "pages/tab/list/index", - "text": "食谱清单" + "pagePath": "pages/banquet/hotel/list", + "text": "选酒店" }, + + // { + // "iconPath": "static/images/tabbar/shouye.png", + // "selectedIconPath": "static/images/tabbar/shouye_selected.png", + // "pagePath": "pages/tab/home/index", + // "text": "菜单分类" + // }, + // { + // "iconPath": "static/images/tabbar/bofang.png", + // "selectedIconPath": "static/images/tabbar/bofang_selected.png", + // "pagePath": "pages/tab/list/index", + // "text": "食谱清单" + // }, { "iconPath": "static/images/tabbar/wode.png", "selectedIconPath": "static/images/tabbar/wode_selected.png", diff --git a/src/pages/banquet/combo/detail.vue b/src/pages/banquet/combo/detail.vue new file mode 100644 index 0000000..1f75029 --- /dev/null +++ b/src/pages/banquet/combo/detail.vue @@ -0,0 +1,392 @@ + + + + diff --git a/src/pages/banquet/combo/index.vue b/src/pages/banquet/combo/index.vue new file mode 100644 index 0000000..e355a9b --- /dev/null +++ b/src/pages/banquet/combo/index.vue @@ -0,0 +1,406 @@ + + + + diff --git a/src/pages/banquet/cook/detail.vue b/src/pages/banquet/cook/detail.vue new file mode 100644 index 0000000..178a213 --- /dev/null +++ b/src/pages/banquet/cook/detail.vue @@ -0,0 +1,206 @@ + + + \ No newline at end of file diff --git a/src/pages/banquet/cook/list.vue b/src/pages/banquet/cook/list.vue new file mode 100644 index 0000000..62aafcd --- /dev/null +++ b/src/pages/banquet/cook/list.vue @@ -0,0 +1,273 @@ + + + diff --git a/src/pages/banquet/home/index.vue b/src/pages/banquet/home/index.vue new file mode 100644 index 0000000..2bd6f18 --- /dev/null +++ b/src/pages/banquet/home/index.vue @@ -0,0 +1,218 @@ + + + + diff --git a/src/pages/banquet/hotel/detail.vue b/src/pages/banquet/hotel/detail.vue new file mode 100644 index 0000000..2fed1e9 --- /dev/null +++ b/src/pages/banquet/hotel/detail.vue @@ -0,0 +1,244 @@ + + + \ No newline at end of file diff --git a/src/pages/banquet/hotel/list.vue b/src/pages/banquet/hotel/list.vue new file mode 100644 index 0000000..351b9d0 --- /dev/null +++ b/src/pages/banquet/hotel/list.vue @@ -0,0 +1,273 @@ + + + diff --git a/src/pages/banquet/order/detail.vue b/src/pages/banquet/order/detail.vue new file mode 100644 index 0000000..65c72d5 --- /dev/null +++ b/src/pages/banquet/order/detail.vue @@ -0,0 +1,207 @@ + + + + diff --git a/src/pages/banquet/order/pay.vue b/src/pages/banquet/order/pay.vue new file mode 100644 index 0000000..1b692b5 --- /dev/null +++ b/src/pages/banquet/order/pay.vue @@ -0,0 +1,332 @@ + + + + diff --git a/src/pages/common/goods/order.vue b/src/pages/common/goods/order.vue index fb07c59..b8758fb 100644 --- a/src/pages/common/goods/order.vue +++ b/src/pages/common/goods/order.vue @@ -18,7 +18,6 @@ body {