From ab53a1ecc2a17435cf0de1b22c564beb96f80791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Wed, 16 Jun 2021 18:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=8A=B5=E6=B4=BB=E5=8A=A8=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/api/promotion.js | 2 +- manager/src/config/index.js | 8 +- .../lili-floor-renovation/renovation.vue | 320 +++++++++--------- .../shrinkable-menu/shrinkable-menu.vue | 1 + manager/src/views/member/list/index.vue | 63 +++- manager/src/views/promotion/coupon/coupon.vue | 84 ++--- .../couponActivity/couponPublish.vue | 151 ++++++--- .../src/views/{ => promotion}/live/live.vue | 24 +- .../views/{ => promotion}/live/liveDetail.vue | 0 seller/src/config/index.js | 8 +- .../goods/goods-seller/goodsOperation.vue | 2 + seller/src/views/promotion/live/addLive.vue | 1 - seller/src/views/promotion/live/liveGoods.vue | 4 +- 13 files changed, 394 insertions(+), 274 deletions(-) rename manager/src/views/{ => promotion}/live/live.vue (92%) rename manager/src/views/{ => promotion}/live/liveDetail.vue (100%) diff --git a/manager/src/api/promotion.js b/manager/src/api/promotion.js index fca59f8a..9c0ccdd0 100644 --- a/manager/src/api/promotion.js +++ b/manager/src/api/promotion.js @@ -14,7 +14,7 @@ export const getPromotionSeckill = params => { // 是否推荐直播间 export const whetherStar = params => { - return getRequest(`/broadcast/studio/id/${params.id}&recommend=${params.recommend}`); + return putRequest(`/broadcast/studio/recommend/${params.id}`,params); }; // 添加优惠券活动 diff --git a/manager/src/config/index.js b/manager/src/config/index.js index 1a28698c..8b6b162f 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -21,10 +21,10 @@ export default { // buyer: "https://buyer-api.pickmall.cn", // seller: "https://store-api.pickmall.cn", // manager: "https://admin-api.pickmall.cn" - common: 'http://192.168.0.100:8890', - buyer: 'http://192.168.0.100:8888', - seller: 'http://192.168.0.100:8889', - manager: 'http://192.168.0.100:8887' + common: 'http://192.168.0.109:8890', + buyer: 'http://192.168.0.109:8888', + seller: 'http://192.168.0.109:8889', + manager: 'http://192.168.0.109:8887' }, api_prod: { common: "https://common-api.pickmall.cn", diff --git a/manager/src/views/lili-floor-renovation/renovation.vue b/manager/src/views/lili-floor-renovation/renovation.vue index d5074863..dc969508 100644 --- a/manager/src/views/lili-floor-renovation/renovation.vue +++ b/manager/src/views/lili-floor-renovation/renovation.vue @@ -1,172 +1,180 @@ \ No newline at end of file +.show-content { + margin-left: 150px; + margin-top: 60px; +} +.ghost { + background: #fff; + height: 30px; + position: relative; + &::after { + content: "松开鼠标添加模块"; + position: absolute; + background: #fff; + border: 1px dashed #409eff; + color: #409eff; + top: 0; + left: 0; + width: 100%; + height: 50px; + text-align: center; + line-height: 50px; + } +} +.btn-bar { + position: fixed; + width: 100%; + background: #fff; + height: 50px; + padding: 10px; + box-shadow: 1px 1px 10px #999; + z-index: 99; + top: 100px; +} + diff --git a/manager/src/views/main-components/shrinkable-menu/shrinkable-menu.vue b/manager/src/views/main-components/shrinkable-menu/shrinkable-menu.vue index 68738da7..aabb380e 100644 --- a/manager/src/views/main-components/shrinkable-menu/shrinkable-menu.vue +++ b/manager/src/views/main-components/shrinkable-menu/shrinkable-menu.vue @@ -55,6 +55,7 @@ export default { }, methods: { changeMenu(name) { //二级路由点击 + console.log(name) this.$router.push({ name: name }); diff --git a/manager/src/views/member/list/index.vue b/manager/src/views/member/list/index.vue index fec0be21..fdffb632 100644 --- a/manager/src/views/member/list/index.vue +++ b/manager/src/views/member/list/index.vue @@ -312,6 +312,7 @@ export default { ], data: [], // 表单数据 total: 0, // 表单数据总数 + selectMember: [], //保存选中的用户 }; }, props: { @@ -320,18 +321,66 @@ export default { type: Boolean, default: false, }, + // 已选择用户数据 + selectedList: { + type: null, + default: "", + }, + }, + watch: { + selectedList: { + handler(val) { + this.$set(this, "selectMember", JSON.parse(JSON.stringify(val))); + this.init(this.data); + // 将父级数据与当前组件数据进行匹配 + + }, + deep: true, + immediate: true, + }, }, methods: { // 回调给父级 callback(val, index) { - val.___selected = !val.___selected; + this.$set(val, "___selected", !val.___selected); + console.log(val.___selected); + let findUser = this.selectMember.find((item) => { + return item.id == val.id; + }); + // 如果没有则添加 + if (!findUser) { + this.selectMember.push(val); + } else { + // 有重复数据就删除 + this.selectMember.map((item, index) => { + if (item.id == findUser.id) { + this.selectMember.splice(index, 1); + } + }); + } + this.$emit("callback", val); }, - init() { - this.getData(); + // 初始化信息 + init(data) { + data.forEach((item) => { + if (this.selectMember.length != 0) { + this.selectMember.forEach((member) => { + if (member.id == item.id) { + this.$set(item, "___selected", true); + } + }); + } else { + this.$set(item, "___selected", false); + } + }); + this.data = data; }, changePage(v) { this.searchForm.pageNumber = v; + // 此处如果是父子级传值的时候需要做一下处理 + //selectedMember + this.getData(); }, changePageSize(v) { @@ -387,15 +436,13 @@ export default { } }); }, + //查询会员列表 getData() { API_Member.getMemberListData(this.searchForm).then((res) => { if (res.result.records) { this.loading = false; - res.result.records.forEach((item) => { - item.___selected = false; - }); - this.data = res.result.records; + this.init(res.result.records); this.total = res.result.total; } }); @@ -484,7 +531,7 @@ export default { }, }, mounted() { - this.init(); + this.getData(); }, }; diff --git a/manager/src/views/promotion/coupon/coupon.vue b/manager/src/views/promotion/coupon/coupon.vue index 262d3588..7db021f4 100644 --- a/manager/src/views/promotion/coupon/coupon.vue +++ b/manager/src/views/promotion/coupon/coupon.vue @@ -4,7 +4,7 @@
- + - +
@@ -26,21 +25,17 @@
- +
- + @@ -68,7 +63,7 @@ export default { pageSize: 10, // 页面大小 sort: "startTime", // 默认排序字段 order: "desc", // 默认排序方式 - getType: '', // 默认排序方式 + getType: "", // 默认排序方式 }, form: { // 添加或编辑表单对象初始化数据 @@ -77,7 +72,7 @@ export default { // 表单验证规则 formValidate: { promotionName: [ - {required: true, message: "不能为空", trigger: "blur"}, + { required: true, message: "不能为空", trigger: "blur" }, ], }, submitLoading: false, // 添加或编辑提交状态 @@ -94,15 +89,16 @@ export default { { title: "活动名称", key: "promotionName", - width: 120, + minWidth: 100, fixed: "left", }, { title: "优惠券名称", key: "couponName", - width: 120, - tooltip: true - }, { + minWidth: 100, + tooltip: true, + }, + { title: "面额/折扣", key: "price", width: 120, @@ -124,9 +120,11 @@ export default { width: 150, render: (h, params) => { return h( - "div", params.row.receivedNum + "/" + params.row.publishNum) + "div", + params.row.receivedNum + "/" + params.row.publishNum + ); }, - minWidth:130, + minWidth: 130, }, { title: "优惠券类型", @@ -162,20 +160,19 @@ export default { }, { title: "活动时间", - width: 120, - render: (h, params) => { + render: (h, params) => { if (params.row.getType === "ACTIVITY") { return h("div", "长期有效"); } else { return h("div", { domProps: { - innerHTML: params.row.startTime + "
" + params.row.endTime, + innerHTML: + params.row.startTime + "
" + params.row.endTime, }, }); } }, - minWidth:150, }, { title: "状态", @@ -210,14 +207,14 @@ export default { ), ]); }, - minWidth:70, + minWidth: 70, }, { title: "操作", slot: "action", align: "center", fixed: "right", - minWidth: 140 + maxWidth: 140, }, ], data: [], // 表单数据 @@ -233,13 +230,13 @@ export default { //优惠券类型 查询参数 getType: { type: String, - default: '' + default: "", }, //已选择优惠券 - selectList: { + selectedList: { type: Array, - default: [] - } + default: [], + }, }, watch: { $route(to, from) { @@ -255,16 +252,27 @@ export default { }, init() { this.getDataList(); + + // 判断是否是父级回调给自己已选择优惠券 + if (this.selectedList.length != 0) { + // console.log(this.selectedList); + this.selectedList.forEach((item) => { + item._checked = true; + item.___selected = true; + }); + this.$set(this, "data", this.selectedList); + console.log(this.data); + } }, add() { - this.$router.push({name: "add-platform-coupon"}); + this.$router.push({ name: "add-platform-coupon" }); }, /** 跳转至领取详情页面 */ receiveInfo(v) { - this.$router.push({name: "member-receive-coupon", query: {id: v.id}}); + this.$router.push({ name: "member-receive-coupon", query: { id: v.id } }); }, info(v) { - this.$router.push({name: "platform-coupon-info", query: {id: v.id}}); + this.$router.push({ name: "platform-coupon-info", query: { id: v.id } }); }, changePage(v) { this.searchForm.pageNumber = v - 1; @@ -294,7 +302,7 @@ export default { changeSelect(e) { this.selectList = e; this.selectCount = e.length; - this.checked ? this.check() : ''; + this.checked ? this.check() : ""; }, getDataList() { this.loading = true; @@ -309,9 +317,9 @@ export default { getPlatformCouponList(this.searchForm).then((res) => { this.loading = false; if (res.success) { - res.result.records.forEach(item => { - item.___selected = false - }) + res.result.records.forEach((item) => { + item.___selected = false; + }); this.data = res.result.records; this.total = res.result.total; } @@ -353,7 +361,7 @@ export default { }); }, edit(v) { - this.$router.push({name: "edit-platform-coupon", query: {id: v.id}}); + this.$router.push({ name: "edit-platform-coupon", query: { id: v.id } }); }, remove(v) { this.$Modal.confirm({ diff --git a/manager/src/views/promotion/couponActivity/couponPublish.vue b/manager/src/views/promotion/couponActivity/couponPublish.vue index 1e42bf67..61fbc7bc 100644 --- a/manager/src/views/promotion/couponActivity/couponPublish.vue +++ b/manager/src/views/promotion/couponActivity/couponPublish.vue @@ -6,12 +6,11 @@

活动信息

- + - + @@ -27,15 +26,16 @@ 指定会员 - + +
+ +
+
- {{ selectedMember }} - +

配置优惠券

@@ -47,8 +47,8 @@
@@ -61,12 +61,12 @@ - - + + - + @@ -76,10 +76,7 @@ import couponTemplate from "@/views/promotion/coupon/coupon"; import userList from "@/views/member/list/index"; -import { - saveActivityCoupon, - updateCouponActivity, -} from "@/api/promotion"; +import { saveActivityCoupon, updateCouponActivity } from "@/api/promotion"; export default { name: "addCouponActivity", @@ -89,30 +86,72 @@ export default { }, data() { return { - showCouponSelect: false,//显示优惠券选择框 + showCouponSelect: false, //显示优惠券选择框 modalType: 0, // 是否编辑 - rangeTime: '',//时间区间 - checkUserList: false,//会员选择器 - selectedMember: [],//选择的会员 + rangeTime: "", //时间区间 + checkUserList: false, //会员选择器 + selectedMember: [], //选择的会员 form: { - promotionName: '', //活动名称 - activityScope: 'ALL', //活动范围 - couponActivityType: 'REGISTERED', //触发活动方式 - activityScopeInfo: '', //活动描述 - startTime: '', //开始时间 - endTime: '', //结束时间 - couponActivityItems: [] - + promotionName: "", //活动名称 + activityScope: "ALL", //活动范围 + couponActivityType: "REGISTERED", //触发活动方式 + activityScopeInfo: "", //活动描述 + startTime: "", //开始时间 + endTime: "", //结束时间 + couponActivityItems: [], }, // 表单 id: this.$route.query.id, // 优惠券活动id submitLoading: false, // 添加或编辑提交状态 - selectCouponList: [],//选择的优惠券列表 + selectCouponList: [], //选择的优惠券列表 formRule: { - promotionName: [{required: true, message: "活动名称不能为空"}], - rangeTime: [{required: true, message: "请选择活动有效期"}], - description: [{required: true, message: "请输入范围描述"}], + promotionName: [{ required: true, message: "活动名称不能为空" }], + rangeTime: [{ required: true, message: "请选择活动有效期" }], + description: [{ required: true, message: "请输入范围描述" }], }, - //优惠券表哥 + // 用户表格 + userColumns: [ + { + title: "用户名称", + key: "nickName", + minWidth: 120, + }, + { + title: "手机号", + key: "mobile", + render: (h, params) => { + return h("div", params.row.mobile || "暂未填写"); + }, + }, + { + title: "最后登录时间", + key: "lastLoginDate", + }, + { + title: "操作", + key: "action", + minWidth: 50, + align: "center", + render: (h, params) => { + return h( + "Button", + { + props: { + size: "small", + type: "error", + ghost: true, + }, + on: { + click: () => { + this.delUser(params.index); + }, + }, + }, + "删除" + ); + }, + }, + ], + //优惠券表格 columns: [ { title: "优惠券名称", @@ -175,7 +214,7 @@ export default { }, on: { click: () => { - // this.delGoods(params.index); + this.delCoupon(params.index); }, }, }, @@ -194,14 +233,32 @@ export default { } }, methods: { + // 删除选择的优惠券 + delUser(index) { + this.selectedMember.splice(index, 1); + }, + // 删除选择的优惠券 + delCoupon(index) { + this.selectCouponList.splice(index, 1); + }, // 返回已选择的用户 callbackSelectUser(val) { - let index = this.selectedMember.indexOf(val) - if (index > 0) { - this.selectedMember.remove(val); + // 每次将返回的数据回调判断 + let findUser = this.selectedMember.find((item) => { + return item.id == val.id; + }); + // 如果没有则添加 + if (!findUser) { + this.selectedMember.push(val); + } else { + // 有重复数据就删除 + this.selectedMember.map((item, index) => { + if (item.id == findUser.id) { + this.selectedMember.splice(index, 1); + } + }); } - this.selectedMember.push(val); }, // 添加指定用户 @@ -218,17 +275,16 @@ export default { /** * 返回优惠券*/ selectedCoupon(val) { - this.selectCouponList = val + this.selectCouponList = val; //清空原有数据 this.form.couponActivityItems = []; val.forEach((item, index) => { - this.form.couponActivityItems.push({ num: 0, - couponId: item.id - }) - }) - console.log(val) + couponId: item.id, + }); + }); + console.log(val); }, getCoupon() { @@ -276,7 +332,6 @@ export default { }, /** 保存平台优惠券 */ handleSubmit() { - this.form.startTime = this.$options.filters.unixToDate( this.rangeTime[0] / 1000 ); @@ -287,7 +342,7 @@ export default { this.$refs.form.validate((valid) => { if (valid) { const params = JSON.parse(JSON.stringify(this.form)); - console.log(params) + console.log(params); this.submitLoading = true; if (this.modalType === 0) { // 添加 避免编辑后传入id等数据 记得删除 @@ -318,7 +373,7 @@ export default { this.$store.state.app.pageOpenedList ); this.$router.go(-1); - } + }, }, }; diff --git a/manager/src/views/live/live.vue b/manager/src/views/promotion/live/live.vue similarity index 92% rename from manager/src/views/live/live.vue rename to manager/src/views/promotion/live/live.vue index 25614680..b7d7498c 100644 --- a/manager/src/views/live/live.vue +++ b/manager/src/views/promotion/live/live.vue @@ -93,7 +93,7 @@ export default { }, on: { "on-change": () => { - this.star(params.row,params.index); + this.star(params.row, params.index); }, }, }, @@ -183,19 +183,19 @@ export default { /** * 是否推荐 */ - async star(val,index) { - let switched - if(this.liveData[index].recommend){ - this.$set(this.liveData[index],'recommend',false) - switched = false - } - else{ - - this.$set(this.liveData[index],'recommend',true) - switched = true + async star(val, index) { + let switched; + if (this.liveData[index].recommend) { + this.$set(this.liveData[index], "recommend", false); + switched = false; + } else { + this.$set(this.liveData[index], "recommend", true); + switched = true; } - await whetherStar({id:val.id,recommend:switched}); + await whetherStar({ id: val.id, recommend: switched }); + + this.getStoreLives(); }, /** diff --git a/manager/src/views/live/liveDetail.vue b/manager/src/views/promotion/live/liveDetail.vue similarity index 100% rename from manager/src/views/live/liveDetail.vue rename to manager/src/views/promotion/live/liveDetail.vue diff --git a/seller/src/config/index.js b/seller/src/config/index.js index 17f824e8..27da5927 100644 --- a/seller/src/config/index.js +++ b/seller/src/config/index.js @@ -22,10 +22,10 @@ export default { // buyer: 'https://buyer-api.pickmall.cn', // seller: 'https://store-api.pickmall.cn', // manager: 'https://admin-api.pickmall.cn', - common: 'http://192.168.0.100:8890', - buyer: 'http://192.168.0.100:8888', - seller: 'http://192.168.0.100:8889', - manager: 'http://192.168.0.100:8887' + common: 'http://192.168.0.109:8890', + buyer: 'http://192.168.0.109:8888', + seller: 'http://192.168.0.109:8889', + manager: 'http://192.168.0.109:8887' }, api_prod: { common: 'https://common-api.pickmall.cn', diff --git a/seller/src/views/goods/goods-seller/goodsOperation.vue b/seller/src/views/goods/goods-seller/goodsOperation.vue index fc7417d4..5c434575 100644 --- a/seller/src/views/goods/goods-seller/goodsOperation.vue +++ b/seller/src/views/goods/goods-seller/goodsOperation.vue @@ -25,6 +25,8 @@ + +
diff --git a/seller/src/views/promotion/live/addLive.vue b/seller/src/views/promotion/live/addLive.vue index cfa0c37e..f2d9327f 100644 --- a/seller/src/views/promotion/live/addLive.vue +++ b/seller/src/views/promotion/live/addLive.vue @@ -153,7 +153,6 @@ import { addLiveGoods, editLive, getLiveInfo, - delLiveGoods, delRoomLiveGoods, } from "@/api/promotion"; import liveGoods from "./liveGoods"; diff --git a/seller/src/views/promotion/live/liveGoods.vue b/seller/src/views/promotion/live/liveGoods.vue index 31fcf0e4..eb2def25 100644 --- a/seller/src/views/promotion/live/liveGoods.vue +++ b/seller/src/views/promotion/live/liveGoods.vue @@ -276,10 +276,10 @@ export default { async saveLiveGoods() { this.saveGoodsLoading = true; let submit = this.liveGoodsData.map((element) => { - console.log(element.priceType); + console.log(element); return { goodsId: element.goodsId, //商品id - goodsImage: element.small, //商品图片 + goodsImage: element.small, //商品图片 必须为 300 * 300 name: element.goodsName, //商品昵称 price: parseInt(element.price), //商品价格 quantity: element.quantity, //库存