# dancegit-case-shop **Repository Path**: dancegit/dancegit-case-shop ## Basic Information - **Project Name**: dancegit-case-shop - **Description**: vue商城 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-22 - **Last Updated**: 2024-08-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 搭建脚手架 yarn create vue@latest 安装 yarn install 安装路由 yarn add vue-router@4 安装UI框架 https://vant-ui.github.io/vant/#/zh-CN/home yarn add vant 业务逻辑地址 / -> 默认首页 -> 顶级路由 /business 会员中心 -> 一级路由 嵌套路由 /business/login -> 登录界面 二级路由 /business/register -> 注册界面 二级路由 /business/profile -> 个人资料 /address 收获地址 一级路由 /address/index 二级路由 /address/add /address/edit /address/del /product 商品管理 -> 一级路由 /product/index -> 商品列表 /product/info -> 商品详细 路由:src/routers/business.js path: login, register, profile src/routers/address.js 控制器 /address/index 收获地址列表 /address/add 收获地址添加 /address/edit src/components/address 视图 /index.vue /add.vue edit.vue 组件:src/components/business/ login.vue register.vue profile.vue axios 发送http请求 并且是一个异步请求 安装axios 插件 yarn add axios 自动导入一些 第三方的 依赖包 yarn add unplugin-auto-import 去后端创建一个vue的接口模块 shop php think build --module shop 创建控制器 php think make:controller shop/Business //接口请求的地址 http://www.fast.com/shop/business/register Vue中发出的请求地址 http://localhost:5173/shop/business/register 打包后的源代码中发出的请求地址 http://www.shop.com/shop/business/check 安装cookie yarn add vue3-cookies 路由,组件,接口 有一定规律 /business/login 组件地址:src/business/login.vue 接口地址:www.fast.com/shop/Business.php -> function login 地区数据 yarn add @vant/area-data 对于项目打包后的源代码,要给他搭建一个站点去进行访问 ProxyRequests off Order deny,allow Allow from Off ProxyPass /shop http://www.fast.com/shop fa_product 商品表 id 1 name iphone12 fa_product_type 商品分类 attrs 商品属性的关联id 多个id 对应attribute表 fa_product_attribute_relation 具体商品属性关联表 id proid 商品id attrid attribute 表外键 value price id proid attrid value price 1 1 1 白色 20 1 1 1 黑色 30 1 1 1 蓝色 40 fa_product_attribute 商品属性表 id 主键ID 1 type 属性类型 1 从下方的属性列表中选择 0自行输入 name 属性的名称 颜色 value 属性的值 白色|黑色|蓝色|绿色 php think make:model common/Product/Attribute/Attribute php think make:model common/Product/Attribute/Relation 安装sku组件 yarn add vant-sku relationid attrs 规格属性信息 [ {"title":"颜色","value":"黑色", "price", 0}, {"title":"容量","value":"500", "price", 0}, {"title":"面膜","value":"5个", "price", 0} ] 仅退款 1、用户申请(order表 status 从1 改成 -1) 2、后台操作: 2.1(order表 status 从-1 改成 -4 退款成功) 2.2退钱 business表更新余额 2.3消费记录表 要插入一条退钱的记录 2.4商品表 增加回来库存 2.5可选 如果有用优惠券 要不要恢复使用的状态 发货:后台做的 fa_order 订单表 从 status = 1 -> status = 2(已发货) expressid 物流公司外键 expresscode 快递单号 退货的流程 用户填写退货单(back,back_product) -> 商家的仓库 -> 库管收到货要入库 -> 入库要将商品的库存进行更新 back back_product 插入 退货表 depot_storage 入库表 depot_storage_product 入库商品表 fa_team_order 拼团表 id busid 发起人 createtime 开始时间 endtime 结束时间 total 人数 proid 商品 status 1 正在拼团中 0 拼团结束(人数满了,时间到了) fa_team_order_business 拼团的人员名单表 id teamid 参与拼团活动外键ID busid 拼团人 addrid 收获地址ID proid 商品 createtime 参与拼团时间 total 拼团的价格 attrs 商品规格 remark 备注 单独购买:商品id和数量 一起发给后端 -> 将数据插入的购物车表 -> 返回购物车的ID给前端 php think make:model common/Team/Order php think make:model common/Team/Business 拼团流程: 发起拼团 参与拼团(扣钱) -> 在指定时间内,如果人数没有满 -> 拼团失败(返回金额) 拼团成功 -> 拼团10人 -> 批量下订单 (fa_order, fa_order_product fa_product) 批量下单 fa_order,fa_order_product 10条记录 fa_product 更新一次 扣库存 6 周六: 拼团逻辑全部过一遍 支付功能(云课堂、Vue商城) 8 周一: Vue(商城支付功能) 9 周二: 直播功能 10周三:UniApp Vue(微信小程序 - 接口)