diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..5d126348471c348decba17143ce128130c9f4104 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a8d4a477fdf0f7393bcbfb5903a8f5f27d2d20c0..00897bcec1afcc8cc5d6a2cc362bc418087688de 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -15,6 +15,13 @@ module.exports = { wx: true, WechatMiniprogram: true, getCurrentPages: true, + getApp: true, + UniApp: true, + UniHelper: true, + App: true, + Page: true, + Component: true, + AnyObject: true, }, parserOptions: { ecmaVersion: 'latest', @@ -25,7 +32,7 @@ module.exports = { { singleQuote: true, semi: false, - printWidth: 80, + printWidth: 100, trailingComma: 'all', endOfLine: 'auto', }, diff --git a/.husky/pre-commit b/.husky/pre-commit index a5a29d9f7da2c47591a22c51582ff4ce647cf0d8..7e154687b63ab4c46c97f8987b677703b4b4fe08 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm lint-staged +npm run lint-staged diff --git a/.prettierrc.json b/.prettierrc.json index 25fb32d9277c3a12163aad72550e49e65277026c..7469f12cb23f2a81475a4366987bb58df93a316e 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,7 +1,7 @@ { "singleQuote": true, "semi": false, - "printWidth": 80, + "printWidth": 100, "trailingComma": "all", "endOfLine": "auto" } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 919f4d02c089dfa98dd0c49449bf2c655835ba72..3c9306cc960902a9a85fd739840ec48c61259bf7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,6 +6,7 @@ "evils.uniapp-vscode", // uni-app 文档 "vue.volar", // vue3 语法支持 "vue.vscode-typescript-vue-plugin", // vue3 ts 插件 + "editorconfig.editorconfig", // editorconfig "dbaeumer.vscode-eslint", // eslint "esbenp.prettier-vscode" // prettier ] diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d1b76322f16fd3fcd71e984012c1f874e399267f --- /dev/null +++ b/README.md @@ -0,0 +1,98 @@ +## 项目简介 + +小兔鲜儿项目包含从首页浏览商品,商品详情,微信登录,加入购物车,提交订单,微信支付,订单管理等功能。 + +当前仓库为小兔鲜儿的**项目模板**。 + +### 技术栈 + +- 前端框架:[uni-app](https://uniapp.dcloud.net.cn/) (Vue3 + TS + Setup) +- 状态管理:[pinia](https://pinia.vuejs.org/zh/) +- 组件库:[uni-ui](https://uniapp.dcloud.net.cn/component/uniui/uni-ui.html) + +## 资料说明 + +### 📀 视频学习 + +[https://www.bilibili.com/video/BV1Bp4y1379L/](https://www.bilibili.com/video/BV1Bp4y1379L/?share_source=copy_web&vd_source=2ac50d29193927b3c8597537dc4bc81d) + +### 📗 接口文档 + +[https://www.apifox.cn/apidoc/shared-0e6ee326-d646-41bd-9214-29dbf47648fa/](https://www.apifox.cn/apidoc/shared-0e6ee326-d646-41bd-9214-29dbf47648fa/) + +### ✏️ 在线笔记 + +[https://megasu.gitee.io/uni-app-shop-note/](https://megasu.gitee.io/uni-app-shop-note/) + +### 📦 项目源码 + +[https://gitee.com/Megasu/uniapp-shop-vue3-ts/](https://gitee.com/Megasu/uniapp-shop-vue3-ts/) + +## 运行程序 + +1. 安装依赖 + +```shell +# npm +npm i --registry=https://registry.npmmirror.com + +# pnpm +pnpm i --registry=https://registry.npmmirror.com +``` + +2. 运行程序 + +```shell +# 微信小程序端 +npm run dev:mp-weixin + +# H5端 +npm run dev:h5 + +# App端 +需 HbuilderX 工具,运行 - 运行到手机或模拟器 +``` + +3. 微信开发者工具导入 `/dist/dev/mp-weixin` 目录 + +### 工程结构解析 + +``` +├── .husky # Git Hooks +├── .vscode # VS Code 插件 + 设置 +├── dist # 打包文件夹(可删除重新打包) +├── src # 源代码 +│ ├── components # 全局组件 +│ ├── composables # 组合式函数 +│ ├── pages # 主包页面 +│ ├── index # 首页 +│ ├── category # 分类页 +│ ├── cart # 购物车 +│ ├── my # 我的 +│ └── login # 登录页 +│ ├── services # 所有请求 +│ ├── static # 存放应用引用的本地静态资源的目录 +│ ├── images # 普通图片 +│ └── tabs # tabBar 图片 +│ ├── stores # 全局 pinia store +│ ├── modules # 模块 +│ └── index.ts # store 入口 +│ ├── styles # 全局样式 +│ └── fonts.scss # 字体图标 +│ ├── types # 类型声明文件 +│ └── component.d.ts # 全局组件类型声明 +│ ├── utils # 全局方法 +│ ├── App.vue # 入口页面 +│ ├── main.ts # Vue初始化入口文件 +│ ├── pages.json # 配置页面路由等页面类信息 +│ ├── manifest.json # 配置appid等打包信息 +│ └── uni.scss # uni-app 内置的常用样式变量 +├── .editorconfig # editorconfig 配置 +├── .eslintrc.cjs # eslint 配置 +├── .prettierrc.json # prettier 配置 +├── .gitignore # git 忽略文件 +├── index.html # H5 端首页 +├── package.json # package.json 依赖 +├── tsconfig.json # typescript 配置 +└── vite.config.ts # vite 配置 +``` diff --git a/index.html b/index.html index b2860a9c813377314add6bf08e5ce3a2da5e4c9f..81370dfe4bef89ec12d3ae05bf01c507ab7febae 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ '') -