一、需求说明1.1、运营人员需求- 创建商品
- 配置拼团商品,配置拼团规则
- 查看已经拼团成功的订单,未拼团成功的订单。
- 订单发货
1.2、用户需求- 查询拼团商品
- 拼团下单
- 分享拼团订单,邀请朋友一起拼
- 查询订单结果,订单跟踪
二、更多咨询服务关注+私信获取 如需远程支撑,源代码部署,应用运行,疑问解答,请关注+私信 三、数据设计商品表 CREATE TABLE `yx_store_product` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '商品id', `mer_id` int(10) unsigned DEFAULT '0' COMMENT '商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)', `image` varchar(256) NOT NULL COMMENT '商品图片', `slider_image` varchar(2000) NOT NULL COMMENT '轮播图', `store_name` varchar(128) NOT NULL COMMENT '商品名称', `store_info` varchar(256) NOT NULL COMMENT '商品简介', `keyword` varchar(256) NOT NULL COMMENT '关键字', `bar_code` varchar(15) DEFAULT '' COMMENT '产品条码(一维码)', `cate_id` varchar(64) NOT NULL COMMENT '分类id', `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品价格', `vip_price` decimal(8,2) unsigned DEFAULT '0.00' COMMENT '会员价格', `ot_price` decimal(8,2) unsigned DEFAULT '0.00' COMMENT '市场价', `postage` decimal(8,2) unsigned DEFAULT '0.00' COMMENT '邮费', `unit_name` varchar(32) DEFAULT NULL COMMENT '单位名', `sort` smallint(11) DEFAULT '0' COMMENT '排序', `sales` mediumint(11) unsigned DEFAULT '0' COMMENT '销量', `stock` mediumint(11) unsigned DEFAULT '0' COMMENT '库存', `is_show` tinyint(1) DEFAULT '1' COMMENT '状态(0:未上架,1:上架)', `is_hot` tinyint(1) DEFAULT '0' COMMENT '是否热卖', `is_benefit` tinyint(1) DEFAULT '0' COMMENT '是否优惠', `is_best` tinyint(1) DEFAULT '0' COMMENT '是否精品', `is_new` tinyint(1) DEFAULT '0' COMMENT '是否新品', `description` text COMMENT '产品描述', `create_time` datetime DEFAULT NULL COMMENT '添加时间', `update_time` datetime DEFAULT NULL, `is_postage` tinyint(1) unsigned DEFAULT '0' COMMENT '是否包邮', `is_del` tinyint(1) unsigned DEFAULT '0' COMMENT '是否删除', `mer_use` tinyint(1) unsigned DEFAULT '0' COMMENT '商户是否代理 0不可代理1可代理', `give_integral` decimal(8,2) unsigned DEFAULT NULL COMMENT '获得积分', `cost` decimal(8,2) unsigned DEFAULT NULL COMMENT '成本价', `is_seckill` tinyint(1) unsigned DEFAULT '0' COMMENT '秒杀状态 0 未开启 1已开启', `is_bargain` tinyint(1) unsigned DEFAULT NULL COMMENT '砍价状态 0未开启 1开启', `is_good` tinyint(1) DEFAULT '0' COMMENT '是否优品推荐', `ficti` mediumint(11) DEFAULT '100' COMMENT '虚拟销量', `browse` int(11) DEFAULT '0' COMMENT '浏览量', `code_path` varchar(64) NOT NULL DEFAULT '' COMMENT '产品二维码地址(用户小程序海报)', `is_sub` tinyint(1) DEFAULT '0' COMMENT '是否单独分佣', `temp_id` int(10) DEFAULT NULL COMMENT '运费模板ID', `spec_type` tinyint(1) DEFAULT '0' COMMENT '规格 0单 1多', `is_integral` tinyint(1) unsigned zerofill DEFAULT NULL COMMENT '是开启积分兑换', `integral` int(11) DEFAULT '0' COMMENT '需要多少积分兑换 只在开启积分兑换时生效', PRIMARY KEY (`id`) USING BTREE, KEY `is_hot` (`is_hot`) USING BTREE, KEY `is_benefit` (`is_benefit`) USING BTREE, KEY `is_best` (`is_best`) USING BTREE, KEY `is_new` (`is_new`) USING BTREE, KEY `toggle_on_sale, is_del` (`is_del`) USING BTREE, KEY `price` (`price`) USING BTREE, KEY `is_show` (`is_show`) USING BTREE, KEY `sort` (`sort`) USING BTREE, KEY `sales` (`sales`) USING BTREE, KEY `add_time` (`create_time`) USING BTREE, KEY `is_postage` (`is_postage`) USING BTREE) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='商品表';
CREATE TABLE `yx_store_combination` (`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,`product_id` bigint(20) unsigned NOT NULL COMMENT '商品id',`mer_id` int(10) unsigned DEFAULT '0' COMMENT '商户id',`image` varchar(255) NOT NULL COMMENT '推荐图',`images` varchar(2000) NOT NULL COMMENT '轮播图',`title` varchar(255) NOT NULL COMMENT '活动标题',`attr` varchar(255) DEFAULT NULL COMMENT '活动属性',`people` int(2) unsigned NOT NULL COMMENT '参团人数',`info` varchar(255) NOT NULL COMMENT '简介',`price` decimal(10,2) unsigned DEFAULT NULL COMMENT '价格',`product_price` decimal(10,2) DEFAULT NULL COMMENT '商品原价',`sort` int(10) unsigned NOT NULL COMMENT '排序',`sales` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',`stock` int(10) unsigned DEFAULT NULL COMMENT '库存',`create_time` datetime NOT NULL COMMENT '添加时间',`update_time` datetime DEFAULT NULL,`is_host` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '推荐',`is_show` tinyint(1) unsigned NOT NULL COMMENT '产品状态',`is_del` tinyint(1) unsigned NOT NULL DEFAULT '0',`combination` tinyint(1) unsigned NOT NULL DEFAULT '1',`mer_use` tinyint(1) unsigned DEFAULT NULL COMMENT '商户是否可用1可用0不可用',`description` text NOT NULL COMMENT '拼团内容',`start_time` datetime NOT NULL COMMENT '拼团开始时间',`stop_time` datetime NOT NULL COMMENT '拼团结束时间',`effective_time` int(11) NOT NULL DEFAULT '0' COMMENT '拼团订单有效时间',`cost` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '拼团产品成本',`browse` int(11) DEFAULT '0' COMMENT '浏览量',`unit_name` varchar(32) DEFAULT '' COMMENT '单位名',`spec_type` tinyint(1) DEFAULT NULL COMMENT '规格 0单 1多',`temp_id` int(10) DEFAULT NULL COMMENT '运费模板ID',PRIMARY KEY (`id`) USING BTREE) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='拼团产品表';
订单表 CREATE TABLE `yx_store_order` (`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID',`order_id` varchar(32) NOT NULL COMMENT '订单号',`extend_order_id` varchar(32) DEFAULT NULL COMMENT '额外订单号',`uid` bigint(20) unsigned NOT NULL COMMENT '用户id',`real_name` varchar(32) NOT NULL COMMENT '用户姓名',`user_phone` varchar(18) NOT NULL COMMENT '用户电话',`user_address` varchar(100) NOT NULL COMMENT '详细地址',`cart_id` varchar(256) NOT NULL DEFAULT '[]' COMMENT '购物车id',`freight_price` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '运费金额',`total_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单商品总数',`total_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单总价',`total_postage` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '邮费',`pay_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际支付金额',`pay_postage` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付邮费',`deduction_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '抵扣金额',`coupon_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券id',`coupon_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券金额',`paid` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态',`pay_time` datetime DEFAULT NULL COMMENT '支付时间',`pay_type` varchar(32) NOT NULL COMMENT '支付方式',`create_time` datetime NOT NULL COMMENT '创建时间',`update_time` datetime DEFAULT NULL,`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货;3:已完成;-1:已退款)',`refund_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 未退款 1 申请中 2 已退款',`refund_reason_wap_img` varchar(255) DEFAULT NULL COMMENT '退款图片',`refund_reason_wap_explain` varchar(255) DEFAULT NULL COMMENT '退款用户说明',`refund_reason_time` datetime DEFAULT NULL COMMENT '退款时间',`refund_reason_wap` varchar(255) DEFAULT NULL COMMENT '前台退款原因',`refund_reason` varchar(255) DEFAULT NULL COMMENT '不退款的理由',`refund_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',`delivery_sn` varchar(100) DEFAULT '' COMMENT '快递公司编号',`delivery_name` varchar(64) DEFAULT NULL COMMENT '快递名称/送货人姓名',`delivery_type` varchar(32) DEFAULT NULL COMMENT '发货类型',`delivery_id` varchar(64) DEFAULT NULL COMMENT '快递单号/手机号',`gain_integral` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费赚取积分',`use_integral` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '使用积分',`pay_integral` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际支付积分',`back_integral` decimal(8,2) unsigned DEFAULT '0.00' COMMENT '给用户退了多少积分',`mark` varchar(512) NOT NULL COMMENT '备注',`is_del` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',`unique` char(32) NOT NULL COMMENT '唯一id(md5加密)类似id',`remark` varchar(512) DEFAULT NULL COMMENT '管理员备注',`mer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商户ID',`is_mer_check` tinyint(3) unsigned NOT NULL DEFAULT '0',`combination_id` bigint(20) unsigned DEFAULT '0' COMMENT '拼团产品id0一般产品',`pink_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '拼团id 0没有拼团',`cost` decimal(8,2) unsigned NOT NULL COMMENT '成本价',`seckill_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '秒杀产品ID',`bargain_id` int(11) unsigned DEFAULT '0' COMMENT '砍价id',`verify_code` varchar(50) NOT NULL DEFAULT '' COMMENT '核销码',`store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',`shipping_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '配送方式 1=快递 ,2=门店自提',`is_channel` tinyint(1) unsigned DEFAULT '0' COMMENT '支付渠道(0微信公众号1微信小程序)',`is_remind` tinyint(1) unsigned DEFAULT '0',`is_system_del` tinyint(1) DEFAULT '0',PRIMARY KEY (`id`) USING BTREE,UNIQUE KEY `order_id_2` (`order_id`,`uid`) USING BTREE,UNIQUE KEY `unique` (`unique`) USING BTREE,KEY `uid` (`uid`) USING BTREE,KEY `add_time` (`create_time`) USING BTREE,KEY `pay_price` (`pay_price`) USING BTREE,KEY `paid` (`paid`) USING BTREE,KEY `pay_time` (`pay_time`) USING BTREE,KEY `pay_type` (`pay_type`) USING BTREE,KEY `status` (`status`) USING BTREE,KEY `is_del` (`is_del`) USING BTREE,KEY `coupon_id` (`coupon_id`) USING BTREE) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='订单表';
拼团订单关联表 CREATE TABLE `yx_store_pink` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uid` bigint(20) unsigned NOT NULL COMMENT '用户id', `order_id` varchar(32) NOT NULL COMMENT '订单id 生成', `order_id_key` int(10) unsigned NOT NULL COMMENT '订单id 数据库', `total_num` int(10) unsigned NOT NULL COMMENT '购买商品个数', `total_price` decimal(10,2) unsigned NOT NULL COMMENT '购买总金额', `cid` bigint(20) unsigned NOT NULL COMMENT '拼团产品id', `pid` bigint(20) unsigned NOT NULL COMMENT '产品id', `people` int(10) unsigned NOT NULL COMMENT '拼团总人数', `price` decimal(10,2) unsigned NOT NULL COMMENT '拼团产品单价', `create_time` datetime NOT NULL COMMENT '开始时间', `update_time` datetime DEFAULT NULL, `stop_time` datetime DEFAULT NULL, `k_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '团长id 0为团长', `is_tpl` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否发送模板消息0未发送1已发送', `is_refund` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否退款 0未退款 1已退款', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态1进行中2已完成3未完成', `is_del` tinyint(1) DEFAULT '0' COMMENT '是否删除1删除 0否', `unique_id` varchar(128) DEFAULT NULL COMMENT '库存唯一值', PRIMARY KEY (`id`) USING BTREE) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='拼团表';
如上述数据库,整个业务模块包含4个表进行存储,分别是商品表,拼团商品表,订单表,订单评团关联表, 四、拼团界面路径



五、拼团商品列表实现运营管理员需要先配置好拼团的商品,如下截图是拼团商品列表,展示了已经配置好的拼团商品。

列表实现代码,使用table进行显示 <el-table v-loading="loading" :data="data" size="small" style="width: 100%;"> <el-table-column prop="id" label="id" /> <el-table-column prop="productId" label="商品id" /> <el-table-column prop="image" label="产品主图"> <template slot-scope="scope"> <a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a> </template> </el-table-column> <el-table-column prop="title" label="拼团名称" /> <el-table-column prop="people" label="参团人数" /> <el-table-column prop="price" label="拼团价" /> <el-table-column prop="cost" label="原价" /> <el-table-column prop="stock" label="库存" /> <el-table-column prop="browse" label="浏览量" /> <el-table-column prop="countPeopleAll" label="参与人数" /> <el-table-column prop="countPeoplePink" label="成团数量" /> <el-table-column prop="countPeopleBrowse" label="访客人数" /> <el-table-column label="状态" align="center"> <template slot-scope="scope"> <div @click="onSale(scope.row.id,scope.row.isShow)"> <el-tag v-if="scope.row.isShow === 1" style="cursor: pointer" :type="''">已开启</el-tag> <el-tag v-else style="cursor: pointer" :type=" 'info' ">已关闭</el-tag> </div> </template> </el-table-column> <el-table-column prop="stopTime" label="结束时间"> <template slot-scope="scope"> <span>{{ formatTimeTwo(scope.row.stopTime) }}</span> </template> </el-table-column> <el-table-column v-if="checkPermission(['admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT','YXSTORECOMBINATION_DELETE'])" label="操作" width="150px" align="center" fixed="right"> <template slot-scope="scope"> <el-button size="mini" type="primary" icon="el-icon-edit" @click="toUpdateURL(scope.row.id)" > 编辑 </el-button> <el-popover :ref="scope.row.id" v-permission="['admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE']" placement="top" width="180" > <p>确定删除本条数据吗?</p> <div style="text-align: right; margin: 0"> <el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button> <el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button> </div> <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" /> </el-popover> </template> </el-table-column></el-table>
如上,table里面包含了拼团商品和操作按钮,table绑定的数据源是:data="data" beforeInit() { this.url = 'api/yxStoreCombination' const sort = 'id,desc' this.params = { page: this.page, size: this.size, sort: sort } const query = this.query const type = query.type const value = query.value if (type && value) { this.params[type] = value } return true},
初始化商品数据列表获取url地址如上第2行代码 API接口查询代码 @Log("查询拼团")@ApiOperation(value = "查询拼团")@GetMapping(value = "/yxStoreCombination")@PreAuthorize("hasAnyRole('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_SELECT')")public ResponseEntity getYxStoreCombinations(YxStoreCombinationQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(yxStoreCombinationService.queryAll(criteria,pageable),HttpStatus.OK);}
|
最新评论
查看全部评论(2)