diff --git a/components.d.ts b/components.d.ts index a755e01..59fdbea 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,19 +7,29 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { + Auth: typeof import('./src/components/Auth.vue')['default'] NutAvatar: typeof import('@nutui/nutui-taro')['Avatar'] NutButton: typeof import('@nutui/nutui-taro')['Button'] - NutCategory: typeof import('@nutui/nutui-taro')['Category'] - NutCategoryPane: typeof import('@nutui/nutui-taro')['CategoryPane'] NutCell: typeof import('@nutui/nutui-taro')['Cell'] - NutIcon: typeof import('@nutui/nutui-taro')['Icon'] + NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup'] + NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox'] + NutDialog: typeof import('@nutui/nutui-taro')['Dialog'] + NutEmpty: typeof import('@nutui/nutui-taro')['Empty'] + NutForm: typeof import('@nutui/nutui-taro')['Form'] + NutFormItem: typeof import('@nutui/nutui-taro')['FormItem'] + NutGrid: typeof import('@nutui/nutui-taro')['Grid'] + NutGridItem: typeof import('@nutui/nutui-taro')['GridItem'] + NutInput: typeof import('@nutui/nutui-taro')['Input'] + NutOverlay: typeof import('@nutui/nutui-taro')['Overlay'] + NutPicker: typeof import('@nutui/nutui-taro')['Picker'] + NutPopup: typeof import('@nutui/nutui-taro')['Popup'] + NutPrice: typeof import('@nutui/nutui-taro')['Price'] NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar'] NutSwiper: typeof import('@nutui/nutui-taro')['Swiper'] NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem'] - NutTabbar: typeof import('@nutui/nutui-taro')['Tabbar'] - NutTabbarItem: typeof import('@nutui/nutui-taro')['TabbarItem'] NutTabPane: typeof import('@nutui/nutui-taro')['TabPane'] NutTabs: typeof import('@nutui/nutui-taro')['Tabs'] - NutToast: typeof import('@nutui/nutui-taro')['Toast'] + NutTextarea: typeof import('@nutui/nutui-taro')['Textarea'] + Pay: typeof import('./src/components/Pay.vue')['default'] } } diff --git a/config/index.ts b/config/index.ts index e4d3bda..14897e2 100644 --- a/config/index.ts +++ b/config/index.ts @@ -79,6 +79,7 @@ const config = { autoprefixer: { enable: true, config: { + } }, cssModules: { diff --git a/package.json b/package.json index e6e3b4c..4240467 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build:qq": "taro build --type qq", "build:jd": "taro build --type jd", "build:quickapp": "taro build --type quickapp", - "dev:weapp": "npm run build:weapp -- --watch", + "dev:weapp": "taro build --type weapp --watch", "dev:swan": "npm run build:swan -- --watch", "dev:alipay": "npm run build:alipay -- --watch", "dev:tt": "npm run build:tt -- --watch", @@ -36,46 +36,47 @@ "author": "", "dependencies": { "@babel/runtime": "^7.7.7", + "@nutui/icons-vue-taro": "^0.0.9", + "@nutui/nutui-taro": "^4.0.4", "@tarojs/components": "3.6.11", "@tarojs/helper": "3.6.11", - "@tarojs/plugin-platform-weapp": "3.6.11", + "@tarojs/plugin-framework-vue3": "3.6.11", + "@tarojs/plugin-html": "3.6.11", "@tarojs/plugin-platform-alipay": "3.6.11", - "@tarojs/plugin-platform-tt": "3.6.11", - "@tarojs/plugin-platform-swan": "3.6.11", + "@tarojs/plugin-platform-h5": "3.6.11", "@tarojs/plugin-platform-jd": "3.6.11", "@tarojs/plugin-platform-qq": "3.6.11", - "@tarojs/plugin-platform-h5": "3.6.11", + "@tarojs/plugin-platform-swan": "3.6.11", + "@tarojs/plugin-platform-tt": "3.6.11", + "@tarojs/plugin-platform-weapp": "3.6.11", "@tarojs/runtime": "3.6.11", "@tarojs/shared": "3.6.11", "@tarojs/taro": "3.6.11", - "@tarojs/plugin-html": "3.6.11", - "@tarojs/plugin-framework-vue3": "3.6.11", - "vue": "^3.2.40", - "@nutui/nutui-taro": "^4.0.4", - "@nutui/icons-vue-taro": "^0.0.9" + "pinia": "^2.1.6", + "vue": "^3.2.40" }, "devDependencies": { "@babel/core": "^7.8.0", - "@types/webpack-env": "^1.13.6", - "webpack": "^5.78.0", + "@tarojs/cli": "3.6.11", "@tarojs/taro-loader": "3.6.11", "@tarojs/webpack5-runner": "3.6.11", - "@tarojs/cli": "3.6.11", + "@types/node": "^18.15.11", + "@types/webpack-env": "^1.13.6", + "@typescript-eslint/eslint-plugin": "^5.20.0", + "@typescript-eslint/parser": "^5.20.0", "@vue/babel-plugin-jsx": "^1.0.6", "@vue/compiler-sfc": "^3.2.40", "babel-preset-taro": "3.6.11", "css-loader": "3.4.2", - "eslint-plugin-vue": "^8.0.0", - "eslint-config-taro": "3.6.11", "eslint": "^8.12.0", - "stylelint": "9.3.0", + "eslint-config-taro": "3.6.11", + "eslint-plugin-vue": "^8.0.0", "style-loader": "1.3.0", - "vue-loader": "^17.0.0", - "@typescript-eslint/parser": "^5.20.0", - "@typescript-eslint/eslint-plugin": "^5.20.0", + "stylelint": "9.3.0", + "ts-node": "^10.9.1", "typescript": "^4.1.0", "unplugin-vue-components": "^0.23.0", - "ts-node": "^10.9.1", - "@types/node": "^18.15.11" + "vue-loader": "^17.0.0", + "webpack": "^5.78.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 75fce90..cd820ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,9 @@ dependencies: '@tarojs/taro': specifier: 3.6.11 version: 3.6.11(postcss@8.4.27)(vue@3.2.40) + pinia: + specifier: ^2.1.6 + version: 2.1.6(typescript@4.1.2)(vue@3.2.40) vue: specifier: ^3.2.40 version: 3.2.40 @@ -112,6 +115,9 @@ devDependencies: stylelint: specifier: 9.3.0 version: 9.3.0 + taro-plugin-pinia: + specifier: ^1.0.0 + version: 1.0.0 ts-node: specifier: ^10.9.1 version: 10.9.1(@swc/core@1.3.23)(@types/node@18.15.11)(typescript@4.1.2) @@ -4315,6 +4321,10 @@ packages: - whiskers dev: true + /@vue/devtools-api@6.5.0: + resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} + dev: false + /@vue/reactivity-transform@3.2.40: resolution: {integrity: sha512-HQUCVwEaacq6fGEsg2NUuGKIhUveMCjOk8jGHqLXPI2w6zFoPrlQhwWEaINTv5kkZDXKEnCijAp+4gNEHG03yw==} dependencies: @@ -10906,6 +10916,24 @@ packages: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} + /pinia@2.1.6(typescript@4.1.2)(vue@3.2.40): + resolution: {integrity: sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==} + peerDependencies: + '@vue/composition-api': ^1.4.0 + typescript: '>=4.4.4' + vue: ^2.6.14 || ^3.3.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + typescript: + optional: true + dependencies: + '@vue/devtools-api': 6.5.0 + typescript: 4.1.2 + vue: 3.2.40 + vue-demi: 0.14.5(vue@3.2.40) + dev: false + /pinkie-promise@2.0.1: resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} engines: {node: '>=0.10.0'} @@ -13121,6 +13149,10 @@ packages: postcss-value-parser: 3.3.1 dev: true + /taro-plugin-pinia@1.0.0: + resolution: {integrity: sha512-Ip2LTRh7NGsFyEzkZWvU115xDqV3D8cRRbqqw0JKTvzHFBzpwycmrUVQQxV61AMg0r2RJm3mcEbQ997j7xNjtg==} + dev: true + /terser-webpack-plugin@5.3.9(@swc/core@1.3.23)(esbuild@0.14.54)(webpack@5.78.0): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} @@ -13428,7 +13460,6 @@ packages: resolution: {integrity: sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==} engines: {node: '>=4.2.0'} hasBin: true - dev: true /ufo@1.2.0: resolution: {integrity: sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==} @@ -13852,6 +13883,21 @@ packages: acorn-walk: 8.2.0 dev: true + /vue-demi@0.14.5(vue@3.2.40): + resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + dependencies: + vue: 3.2.40 + dev: false + /vue-eslint-parser@8.3.0(eslint@8.12.0): resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} diff --git a/project.config.json b/project.config.json index 86b9f1f..edfc4de 100644 --- a/project.config.json +++ b/project.config.json @@ -1,15 +1,15 @@ { - "miniprogramRoot": "./dist", - "projectname": "taroApp", - "description": "", - "appid": "wx3d814a9b985f6cab", - "setting": { - "urlCheck": true, - "es6": false, - "enhance": false, - "compileHotReLoad": false, - "postcss": false, - "minified": false - }, - "compileType": "miniprogram" + "miniprogramRoot": "./dist", + "projectname": "taroApp", + "description": "", + "appid": "wxdd00d46fa6f07974", + "setting": { + "urlCheck": true, + "es6": false, + "enhance": false, + "compileHotReLoad": false, + "postcss": false, + "minified": false + }, + "compileType": "miniprogram" } diff --git a/src/app.config.ts b/src/app.config.ts index b635fde..d523795 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,34 +1,78 @@ export default defineAppConfig({ pages: [ - 'pages/index/index', - 'pages/category/index', - 'pages/cart/index', - 'pages/user/index' + "pages/index/index", + "pages/category/index", + "pages/cart/index", + "pages/user/index", + ], + subPackages: [ + { + root: "pages/users", + pages: [ + "order_list/index", + "setting/index", + "user_setting/index", + "settled_mer/index", + "order_list_detail/index", + ], + }, + { + root: "pages/goods", + pages: [ + "goods_detail/index", + "order_create/index", + "order_status/index", + ], + }, + { + root: "pages/admin", + pages: ["verify/index"], + }, ], window: { - backgroundTextStyle: 'light', - navigationBarBackgroundColor: '#fff', - navigationBarTitleText: 'WeChat', - navigationBarTextStyle: 'black' + backgroundTextStyle: "light", + navigationBarBackgroundColor: "#fff", + navigationBarTitleText: "WeChat", + navigationBarTextStyle: "black", }, tabBar: { color: "#666666", selectedColor: "#ff0000", backgroundColor: "#ffffff", - borderStyle: 'white', - list: [{ - pagePath: 'pages/index/index', - text: '首页', - }, { - pagePath: 'pages/category/index', - text: '分类', - }, { - pagePath: 'pages/cart/index', - text: '购物车', - - }, { - pagePath: 'pages/user/index', - text: '我的', - }] - } -}) + borderStyle: "white", + list: [ + { + pagePath: "pages/index/index", + iconPath: "static/tabbar/1-001.png", + selectedIconPath: "static/tabbar/1-002.png", + text: "首页", + }, + { + pagePath: "pages/category/index", + iconPath: "static/tabbar/2-001.png", + selectedIconPath: "static/tabbar/2-002.png", + text: "分类", + }, + { + pagePath: "pages/cart/index", + iconPath: "static/tabbar/3-001.png", + selectedIconPath: "static/tabbar/3-002.png", + text: "购物车", + }, + { + pagePath: "pages/user/index", + iconPath: "static/tabbar/4-001.png", + selectedIconPath: "static/tabbar/4-002.png", + text: "我的", + }, + ], + }, + permission: { + "scope.userLocation": { + desc: "你的位置信息将用于小程序位置接口的效果展示", + }, + }, + requiredBackgroundModes: ["audio", "location"], + // @ts-ignore + requiredPrivateInfos: ["getLocation"], +}); diff --git a/src/app.scss b/src/app.scss index e69de29..e19438c 100644 --- a/src/app.scss +++ b/src/app.scss @@ -0,0 +1,27 @@ +@font-face { + font-family: AlibabaPuHuiTi-3-55-Regular; + src: url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.eot) + format("embedded-opentype"), + url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.otf) + format("opentype"), + url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.ttf) + format("TrueType"), + url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff) + format("woff"), + url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff2) + format("woff2"); +} + +page { + font-family: AlibabaPuHuiTi-3-55-Regular, serif; +} + +.app { + box-sizing: border-box; + background-color: #f5f5f5; + height: 100vh; + position: relative; + // 适配ios底部安全区域 + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); +} diff --git a/src/app.ts b/src/app.ts index ec0db96..126d791 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,9 +1,14 @@ -import { createApp } from 'vue' -import './app.scss' +import { createApp } from "vue"; +import { createPinia } from 'pinia' +import "./app.scss"; + const App = createApp({ - onShow (options) {}, - // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖 -}) + onLaunch() {}, + onShow() {}, + // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖 +}); -export default App +App.use(createPinia()) + +export default App; diff --git a/src/components/Tabbar.vue b/src/components/Tabbar.vue deleted file mode 100644 index 8cd9986..0000000 --- a/src/components/Tabbar.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/cart/index.config.ts b/src/pages/cart/index.config.ts index 12abc5f..a517688 100644 --- a/src/pages/cart/index.config.ts +++ b/src/pages/cart/index.config.ts @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: '首页' + navigationBarTitleText: '购物车' }) diff --git a/src/pages/cart/index.vue b/src/pages/cart/index.vue index b68e62f..a959c07 100644 --- a/src/pages/cart/index.vue +++ b/src/pages/cart/index.vue @@ -1,45 +1,35 @@ - @@ -50,4 +40,31 @@ export default { -moz-osx-font-smoothing: grayscale; text-align: center; } + +.bottom-box { + box-sizing: border-box; + background-color: #fff; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + height: 100px; + z-index: 999; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 20px; + box-shadow: 100px 104px 288px rgba(0, 0, 0, 0.01); + + .left { + display: flex; + align-items: center; + + .text-box { + margin-left: 10px; + } + } + + +} diff --git a/src/pages/category/index.vue b/src/pages/category/index.vue index def9526..f724182 100644 --- a/src/pages/category/index.vue +++ b/src/pages/category/index.vue @@ -1,59 +1,16 @@ diff --git a/src/pages/index/index.config.ts b/src/pages/index/index.config.ts index 12abc5f..a7c25c7 100644 --- a/src/pages/index/index.config.ts +++ b/src/pages/index/index.config.ts @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: '首页' + navigationBarTitleText: '首页', }) diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 3213fcf..efff37d 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,144 +1,225 @@ diff --git a/src/pages/user/index.config.ts b/src/pages/user/index.config.ts index b58e1d0..5734816 100644 --- a/src/pages/user/index.config.ts +++ b/src/pages/user/index.config.ts @@ -1,4 +1,4 @@ export default definePageConfig({ navigationBarTitleText: '个人中心', - navigationStyle: 'custom', + navigationStyle: 'custom' }) diff --git a/src/pages/user/index.vue b/src/pages/user/index.vue index 640d838..0bd81a1 100644 --- a/src/pages/user/index.vue +++ b/src/pages/user/index.vue @@ -1,169 +1,327 @@ diff --git a/src/pages/users/order_list/index.config.ts b/src/pages/users/order_list/index.config.ts new file mode 100644 index 0000000..a17a39d --- /dev/null +++ b/src/pages/users/order_list/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '我的订单' +}) \ No newline at end of file diff --git a/src/pages/users/order_list/index.vue b/src/pages/users/order_list/index.vue new file mode 100644 index 0000000..ddabd61 --- /dev/null +++ b/src/pages/users/order_list/index.vue @@ -0,0 +1,274 @@ + + + + + diff --git a/src/pages/users/setting/index.config.ts b/src/pages/users/setting/index.config.ts new file mode 100644 index 0000000..78fb3ec --- /dev/null +++ b/src/pages/users/setting/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '个人设置' +}) \ No newline at end of file diff --git a/src/pages/users/setting/index.vue b/src/pages/users/setting/index.vue new file mode 100644 index 0000000..8ddb18c --- /dev/null +++ b/src/pages/users/setting/index.vue @@ -0,0 +1,30 @@ + + + + + \ No newline at end of file diff --git a/src/pages/users/settled_mer/index.config.ts b/src/pages/users/settled_mer/index.config.ts new file mode 100644 index 0000000..4977ea9 --- /dev/null +++ b/src/pages/users/settled_mer/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '申请商户', +}) \ No newline at end of file diff --git a/src/pages/users/settled_mer/index.vue b/src/pages/users/settled_mer/index.vue new file mode 100644 index 0000000..2bc6fe5 --- /dev/null +++ b/src/pages/users/settled_mer/index.vue @@ -0,0 +1,160 @@ + + + + + \ No newline at end of file diff --git a/src/pages/users/user_setting/index.config.ts b/src/pages/users/user_setting/index.config.ts new file mode 100644 index 0000000..5ecc640 --- /dev/null +++ b/src/pages/users/user_setting/index.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '个人资料', +}) \ No newline at end of file diff --git a/src/pages/users/user_setting/index.vue b/src/pages/users/user_setting/index.vue new file mode 100644 index 0000000..b7b5447 --- /dev/null +++ b/src/pages/users/user_setting/index.vue @@ -0,0 +1,94 @@ + + + + + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 4df479a..4d4dbe2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,8 +20,15 @@ "resolveJsonModule": true, "typeRoots": [ "node_modules/@types" + ], + "types": [ + "@tarojs/components/vue3" ] }, - "include": ["./src", "./types", "components.d.ts"], + "include": [ + "./src", + "./types", + "components.d.ts" + ], "compileOnSave": false }