# bufan-shop-node **Repository Path**: nevermo2013/bufan-shop-node ## Basic Information - **Project Name**: bufan-shop-node - **Description**: shop移动端node服务接口 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2022-02-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 为了快速让学习者搭建本地的服务,现在对程序进行了修改 1. **删除了对wafer2的依赖,删除了小程序登陆等相关的** 2. **数据库中存了一个用户数据,供接口使用,无需掉登陆** ## 下载源码 git clone https://github.com/heyushuo/mpvue-shop-node.git ## 开始使用 ### 1.项目开始前本机安装mysql5.7版本,然后创建数据库nodemysql并导入项目根目录下的nodemysql.sql ### 2.项目根目录有一个config.js文件,在这里可以配置数据库相关信息账号密码等 ```javascript mysql: { host: 'localhost', port: 3306, user: '', db: 'nodemysql', //数据库名字 pass: '', //数据库密码 char: 'utf8mb4' }; ``` #### 安装依赖 npm install #### 启动项目 npm run dev # 项目目录结构 # 1.mysql.js存放对knex的引用(用来操作数据库使用) 2.本项目所有的业务逻辑都在**controllers**文件夹中 3.本项目所有的接口都写在**router文件夹下的index.js**里边 ```javascript //首页数据 //1.首页 router.get('/index/index', controllers.home.index) //2.首页品牌制造商直供的详情内的列表数据 router.get('/brand/listaction', controllers.brand.index.listAction) //3.首页品牌制造商直供的详情数据 router.get('/brand/detailaction', controllers.brand.index.detailAction) /** * 分类 */ //1.分类和子类 router.get('/category/indexaction', controllers.category.index.indexAction) //2.通过分类的id来查询子类接口 router.get('/category/currentaction', controllers.category.index.currentAction) //3.获取导航数据 router.get('/category/categoryNav', controllers.category.index.categoryNav) /** * 商品相关接口 */ //1.商品详情接口 router.get('/goods/detailaction', controllers.goods.index.detailAction) //2.获取商品列表 router.get('/goods/goodsList', controllers.goods.index.goodsList) /** * 专题接口 */ //1.列表 router.get('/topic/listaction', controllers.topic.index.listAction) //2.详情加下方四个专题推荐 router.get('/topic/detailaction', controllers.topic.index.detailAction) /** * 搜索相关接口 */ //1.关键词和搜索历史接口 router.get('/search/indexaction', controllers.search.index.indexAction) //2.搜索提示接口 router.get('/search/helperaction', controllers.search.index.helperAction) //3.搜索的关键词添加到数据库 router.post('/search/addhistoryaction', controllers.search.index.addHistoryAction) //4.清空搜索历史 router.post('/search/clearhistoryAction', controllers.search.index.clearhistoryAction) /** * 收藏相关接口 */ //1.添加收藏 router.post('/collect/addcollect', controllers.collect.index.addCollect) //2.获取收藏列表 router.get('/collect/listAction', controllers.collect.index.listAction) //2.获取收藏列表 router.get('/collect/deleteCollect', controllers.collect.index.deleteCollect) /** * 购物车相关接口 */ //1.添加购物车 router.post('/cart/addCart', controllers.cart.index.addCart) //2.购物车列表 router.get('/cart/cartList', controllers.cart.index.cartList) //3.删除商品 router.get('/cart/deleteAction', controllers.cart.index.deleteAction) /** * 订单相关 */ router.post('/order/submitAction', controllers.order.index.submitAction) router.get('/order/detailAction', controllers.order.index.detailAction) /** * 收货地址相关接口 */ //1.保存和跟新收货地址 router.post('/address/saveAction', controllers.address.index.saveAction) //2.获取收货地址列表 router.get('/address/getListAction', controllers.address.index.getListAction) //3.获取收货地址详情 router.get('/address/detailAction', controllers.address.index.detailAction) //4.删除收货地址 router.get('/address/deleteAction', controllers.address.index.deleteAction) /** * 意见反馈 */ router.post('/feedback/submitAction', controllers.feedback.index.submitAction) ``` # 如果需要小程序登陆的可以看,腾讯提供的小程序node解决方案 # ## [ Wafer2 Node.js Demo](https://github.com/tencentyun/wafer2-quickstart-nodejs) ## # 下方为微信小程序效果展示 # ### 1.首页展示和专题页效果 ![](https://user-gold-cdn.xitu.io/2018/8/27/165793588dd8808f?w=323&h=571&f=gif&s=3649872) ![](https://user-gold-cdn.xitu.io/2018/8/25/165717735a9e3c60?w=327&h=573&f=gif&s=3983502) ### 2、分类页面,分类子页面以及搜索功能、搜索列表、历史记录、模糊搜索提示 ![](https://user-gold-cdn.xitu.io/2018/8/25/1657185090f5d3cd?w=327&h=573&f=gif&s=884918) ![](https://user-gold-cdn.xitu.io/2018/8/25/1657188bf2746d85?w=327&h=573&f=gif&s=585295) ### 3、购物车功能添加购物车,单选多选,删除和商品收藏功能 ![](https://user-gold-cdn.xitu.io/2018/8/25/165719656d9bdb5b?w=327&h=573&f=gif&s=1979300) ![](https://user-gold-cdn.xitu.io/2018/8/25/165719e76bd00f05?w=327&h=573&f=gif&s=1770550) ### 4、地址管理 ![](https://user-gold-cdn.xitu.io/2018/8/25/165719e2d9b28ee1?w=327&h=573&f=gif&s=611343) # 小程序端传送门 [点击进入小程序地址](https://github.com/heyushuo/mpvue-shop) # 最后 # - 喜欢的记得点个start,鼓励一下谢谢哈!! - 微信号 hys838723 - qq群号 647099996