{"id":16976872,"url":"https://github.com/hai-27/vue-store","last_synced_at":"2025-04-09T07:03:20.085Z","repository":{"id":37395270,"uuid":"243488245","full_name":"hai-27/vue-store","owner":"hai-27","description":"基于Vue+Vue-Router+Vuex+Element-ui+axios，参考小米商城，实现的电商项目。","archived":false,"fork":false,"pushed_at":"2023-03-02T19:02:45.000Z","size":16931,"stargazers_count":1135,"open_issues_count":52,"forks_count":274,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-10-15T01:27:30.698Z","etag":null,"topics":["axios","element-ui","vue","vue-router","vuex"],"latest_commit_sha":null,"homepage":"http://8.141.3.248","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hai-27.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-27T10:06:42.000Z","updated_at":"2024-10-12T16:30:32.000Z","dependencies_parsed_at":"2024-10-26T01:05:13.421Z","dependency_job_id":null,"html_url":"https://github.com/hai-27/vue-store","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hai-27%2Fvue-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hai-27%2Fvue-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hai-27%2Fvue-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hai-27%2Fvue-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hai-27","download_url":"https://codeload.github.com/hai-27/vue-store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994120,"owners_count":21030050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axios","element-ui","vue","vue-router","vuex"],"created_at":"2024-10-14T01:27:28.651Z","updated_at":"2025-04-09T07:03:20.064Z","avatar_url":"https://github.com/hai-27.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Store（参考小米商城）\n\n## 前言\n\n2020年寒假尤其特殊，因为新型冠状病毒肺炎疫情，学校至今没有开学。想起上学期利用课余时间学习了`Vue.js`、`Node.js`，一直想做个完整的项目实战一下，但之前在学校并没有那么多的时间。现在恰好有时间，就想着做一个项目巩固之前学到的东西。\n\n思来想去，最后决定模仿 [小米商城 ](www.mi.com)做一个电商项目。可能时间隔得有点久了，之前学的东西很多都差不多忘记了，做这个项目基本上都是看着官方的文档一点一点做的。在家里也免不了有各种各样的事情耽误了项目的进度。现在终于差不多做好了，分享出来，新手上路，如有错误，请多多指教。\n\n## 说明\n\n\u003e 本项目前后端分离，前端参考 [小米商城](www.mi.com) 实现，但与小米官方没有关系，纯属个人瞎搞，若需要购买小米产品请到小米官方商城。\n\n\u003e 这是本项目的前端，后端请移步到[store-server](https://github.com/hai-27/store-server) 。\n\n\u003e 前端已经部署在阿里云，欢迎访问 [http://101.132.181.9/](http://101.132.181.9/) （没有兼容移动端，请使用电脑访问）。\n\n\u003e 后端也已经部署在阿里云，接口地址已经修改为线上地址，本地运行前端也可以正常访问后端。\n\n\u003e 本人在读本科大三，今年暑假即将开始实习，后面的时间可能没有那么的自由，但会不定期的更新完善该项目，如有问题请直接在 Issues 中提。\n\n\u003e 如果觉得这个项目还不错，您可以点右上角 `Star`支持一下， 谢谢！ ^_^\n\n## 项目简介\n\n本项目前后端分离，前端基于`Vue`+`Vue-router`+`Vuex`+`Element-ui`+`Axios`，参考小米商城实现。后端基于`Node.js(Koa框架)`+`Mysql`实现。\n\n前端包含了11个页面：首页、登录、注册、全部商品、商品详情页、关于我们、我的收藏、购物车、订单结算页面、我的订单以及错误处理页面。\n\n实现了商品的展示、商品分类查询、关键字搜索商品、商品详细信息展示、登录、注册、用户购物车、订单结算、用户订单、用户收藏列表以及错误处理功能。\n\n后端采取了MVC模式，根据前端需要的数据分模块设计了相应的接口、控制层、数据持久层。后端传送地址[store-server](https://github.com/hai-27/store-server) 。\n\n## 技术栈\n\n- **前端：**`Vue`+`Vue-router`+`Vuex`+`Element-ui`+`Axios`\n\n- **后端：**`Node.js`、`Koa框架`\n\n- **数据库：**`Mysql`\n\n## 功能模块\n\n### 登录\n\n页面使用了element-ui的`Dialog`实现弹出蒙版对话框的效果，`登录`按钮设置在App.vue根组件，通过`vuex`中的`showLogin`状态控制登录框是否显示。\n\n这样设计是为了既可以通过点击页面中的按钮登录，也可以是用户访问需要登录验证的页面或后端返回需要验证登录的提示后自动弹出登录框，减少了页面的跳转，简化用户操作。\n\n用户输入的数据往往是不可靠的，所以本项目前后端都对登录信息进行了校验，前端基于element-ui的表单校验方式，自定义了校验规则进行校验。\n\n### 注册\n\n页面同样使用了element-ui的`Dialog`实现弹出蒙版对话框的效果，`注册`按钮设置在App.vue根组件，通过父子组件传值控制注册框是否显示。\n\n用户输入的数据往往是不可靠的，所以本项目前后端同样都对注册信息进行了校验，前端基于element-ui的表单校验方式，自定义了校验规则进行校验。\n\n### 首页\n\n首页主要是对商品的展示，有轮播图展示推荐的商品，分类别对热门商品进行展示。\n\n### 全部商品\n\n全部商品页面集成了全部商品展示、商品分类查询，以及根据关键字搜索商品结果展示。\n\n### 商品详情页\n\n商品详情页主要是对某个商品的详细信息进行展示，用户可以在这里把喜欢的商品加入购物车或收藏列表。\n\n### 我的购物车\n\n购物车采用vuex实现，页面效果参考了小米商城的购物车。\n\n详细实现过程请看：[基于Vuex实现小米商城购物车](https://juejin.im/post/5e660ef9518825490276748a)\n\n### 订单结算\n\n用户在购物车选择了准备购买的商品后，点击“去结算”按钮，会来到该页面。\n用户在这里选择收货地址，确认订单的相关信息，然后确认购买。\n\n### 我的收藏\n\n用户在商品的详情页，可以通过点击加入 喜欢 按钮，把喜欢的商品加入到收藏列表。\n\n### 我的订单\n\n对用户的所有订单进行展示。\n\n## 运行项目\n\n**注意：**\n\n- 后端接口地址已经修改为线上的地址，本地运行会直接分为我部署在服务器的后端。\n- 为了方便测试，数据库数据没有加密，注册时切记**不要使用自己的常用密码**。\n- 如果需要自己运行后端，请移步到[store-server](https://github.com/hai-27/store-server) clone后端项目，并修改前端的接口地址为您的服务器地址。\n\n```\n1. Clone project\n\ngit clone https://github.com/hai-27/vue-store.git\n\n2. Project setup\n\ncd vue-store\nnpm install\n\n3. Compiles and hot-reloads for development\n\nnpm run serve\n\n4. Compiles and minifies for production\n\nnpm run build\n```\n## 页面截图\n\n**首页**\n\n![](https://raw.githubusercontent.com/hai-27/vue-store/master/public/screenshots/home.png)\n\n**全部商品**\n\n![](https://raw.githubusercontent.com/hai-27/vue-store/master/public/screenshots/goods.png)\n\n**购物车**\n\n![](https://raw.githubusercontent.com/hai-27/vue-store/master/public/screenshots/shoppingCart.png)\n\n**我的收藏**\n\n![](https://raw.githubusercontent.com/hai-27/vue-store/master/public/screenshots/collect.png)\n\n**我的订单**\n\n![](https://raw.githubusercontent.com/hai-27/vue-store/master/public/screenshots/order.png)\n\n**登录**\n\n![](https://raw.githubusercontent.com/hai-27/vue-store/master/public/screenshots/login.png)\n\n**注册**\n\n![](https://raw.githubusercontent.com/hai-27/vue-store/master/public/screenshots/register.png)\n\n\n\n**作者** [hai-27](https://github.com/hai-27)\n\n2020年3月8日","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhai-27%2Fvue-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhai-27%2Fvue-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhai-27%2Fvue-store/lists"}