diff --git a/buyer/src/api/goods.js b/buyer/src/api/goods.js index b0117058..fb7d8e0f 100644 --- a/buyer/src/api/goods.js +++ b/buyer/src/api/goods.js @@ -36,7 +36,7 @@ export function goodsSkuDetail (params) { return request({ url: `/buyer/goods/sku/${params.goodsId}/${params.skuId}`, method: Method.GET, - needToken: false, + needToken: true, params }); } diff --git a/buyer/src/api/shopentry.js b/buyer/src/api/shopentry.js index 82020595..ae8e6309 100644 --- a/buyer/src/api/shopentry.js +++ b/buyer/src/api/shopentry.js @@ -61,7 +61,7 @@ export function getCateById (id) { // 店铺入驻协议 export function agreement () { return request({ - url: `/buyer/article/get/1349291301250293760`, + url: `/buyer/article/type/STORE_REGISTER`, needToken: true, method: Method.GET }) diff --git a/buyer/src/components/header/Header.vue b/buyer/src/components/header/Header.vue index 55281fbf..d83050d0 100644 --- a/buyer/src/components/header/Header.vue +++ b/buyer/src/components/header/Header.vue @@ -2,26 +2,10 @@
-
+
@@ -116,35 +95,28 @@ @@ -253,7 +227,8 @@ export default { margin-right: 10px; font-weight: bold; } -.nav a,.nav-item { +.nav a, +.nav-item { text-decoration: none; padding-left: 10px; border-left: 1px solid #ccc; @@ -396,7 +371,6 @@ export default { .sign-out p { font-size: 12px; } - .goods-title:hover { color: $theme_color; } diff --git a/buyer/src/components/invoiceModal/index.vue b/buyer/src/components/invoiceModal/index.vue index 7c44115e..e5394fa8 100644 --- a/buyer/src/components/invoiceModal/index.vue +++ b/buyer/src/components/invoiceModal/index.vue @@ -69,8 +69,8 @@ export default { receiptContent: '不开发票', // 发票内容 type: 1 // 1 个人 2 单位 }, - ruleInline: { // 验证规则 - receiptTitle: [{ required: true, message: '请填写公司名称' }], + type: 1, // 1 个人 2 单位 + ruleInline: { taxpayerId: [ { required: true, message: '请填写纳税人识别号' }, { pattern: TINumber, message: '请填写正确的纳税人识别号' } @@ -78,21 +78,11 @@ export default { } }; }, - methods: { - save () { // 保存发票 - if (this.invoiceForm.type === 1) { - // 个人 - let flag = true; - this.receiptItems.forEach((e) => { - if ( - e.receiptTitle === '个人' && - e.receiptContent === this.invoiceForm.receiptContent - ) { - this.$emit('change', e); - flag = false; - this.invoiceAvailable = false; - } - }); + props: ["invoiceData"], + watch: { + invoiceData: { + handler(val) { + this.invoiceForm = { ...val }; if (flag) { let params = { diff --git a/buyer/src/components/nav/cateNav.vue b/buyer/src/components/nav/cateNav.vue index e4fd092c..07a6b4eb 100644 --- a/buyer/src/components/nav/cateNav.vue +++ b/buyer/src/components/nav/cateNav.vue @@ -93,6 +93,11 @@ export default { getCategory(0).then(res => { if (res.success) { this.cateList = res.result; + // 过期时间 + var expirationTime = new Date().setHours(new Date().getHours() + 1); + // 存放过期时间 + localStorage.setItem('category_expiration_time', expirationTime); + // 存放分类信息 localStorage.setItem('category', JSON.stringify(res.result)) } }); @@ -117,7 +122,12 @@ export default { } }, mounted () { - if (localStorage.getItem('category')) { + if (localStorage.getItem('category') && localStorage.getItem('category_expiration_time')) { + // 如果缓存过期,则获取最新的信息 + if (new Date() > localStorage.getItem('category_expiration_time')) { + this.getCate(); + return; + } this.cateList = JSON.parse(localStorage.getItem('category')) } else { this.getCate() diff --git a/buyer/src/pages/Cart.vue b/buyer/src/pages/Cart.vue index fc7c3f0c..3f860097 100644 --- a/buyer/src/pages/Cart.vue +++ b/buyer/src/pages/Cart.vue @@ -59,7 +59,7 @@
{{shop.promotionNotice}}
@@ -544,7 +547,7 @@ export default { width: 70px; height: 70px; } - >div>p { + > div > p { @include content_color($light_content_color); font-size: 13px; text-align: left; @@ -567,12 +570,12 @@ export default { } } } - .error-goods{ + .error-goods { position: absolute; width: 100%; height: 100%; margin-left: -20px; - background-color: rgba($color: #999, $alpha: .5); + background-color: rgba($color: #999, $alpha: 0.5); z-index: 10; display: flex; align-items: center; @@ -603,7 +606,7 @@ export default { .save-price span { color: #000; } - .total-price span { + .total-price div { color: $theme_color; font-size: 20px; } @@ -651,23 +654,31 @@ export default { display: flex; margin-top: 5px; margin-left: 5px; - >span{ + > span { border: 1px solid $theme_color; color: $theme_color; font-size: 12px; border-radius: 2px; padding: 0 2px; } - >p{ + > p { font-size: 12px; margin-left: 10px; color: #999; } } - +.cart-goods-footer > div{ + display: flex; + align-items: center; + overflow: hidden; +} +.total-price{ + display: flex; + align-items: center; +} diff --git a/buyer/src/pages/payment/Pay.vue b/buyer/src/pages/payment/Pay.vue index 0ae2f84d..0c91be7e 100644 --- a/buyer/src/pages/payment/Pay.vue +++ b/buyer/src/pages/payment/Pay.vue @@ -1,203 +1,218 @@ diff --git a/manager/src/views/goods/goods-manage/category.vue b/manager/src/views/goods/goods-manage/category.vue index 4efb51a1..1bcc3217 100644 --- a/manager/src/views/goods/goods-manage/category.vue +++ b/manager/src/views/goods/goods-manage/category.vue @@ -11,7 +11,7 @@ @@ -21,18 +21,22 @@ export default { props: ["res"], mounted() { console.log(this.res); - } + }, }; \ No newline at end of file +.view-height-75 { + .image-mode { + height: 75px; + } +} + diff --git a/manager/src/views/login.vue b/manager/src/views/login.vue index d2ea2e2f..f428e847 100644 --- a/manager/src/views/login.vue +++ b/manager/src/views/login.vue @@ -23,12 +23,7 @@ - +
@@ -48,7 +43,7 @@ import LangSwitch from "@/views/main-components/lang-switch"; import RectLoading from "@/views/my-components/lili/rect-loading"; import CountDownButton from "@/views/my-components/lili/count-down-button"; import util from "@/libs/util.js"; -import verify from '@/views/my-components/verify'; +import verify from "@/views/my-components/verify"; export default { components: { @@ -57,18 +52,20 @@ export default { LangSwitch, Header, Footer, - verify + verify, }, data() { return { loading: false, // 加载状态 - form: { // 表单数据 + form: { + // 表单数据 username: "", password: "", mobile: "", code: "", }, - rules: { // 验证规则 + rules: { + // 验证规则 username: [ { required: true, @@ -88,7 +85,8 @@ export default { }, methods: { mounted() {}, - afterLogin(res) { // 登录成功后处理 + afterLogin(res) { + // 登录成功后处理 let accessToken = res.result.accessToken; let refreshToken = res.result.refreshToken; this.setStore("accessToken", accessToken); @@ -109,28 +107,35 @@ export default { } }); }, - submitLogin() { // 登录操作 + submitLogin() { + // 登录操作 this.$refs.usernameLoginForm.validate((valid) => { if (valid) { this.$refs.verify.show = true; } }); }, - verifyChange (con) { // 拼图验证码回显 + verifyChange(con) { + // 拼图验证码回显 if (!con.status) return; - + this.loading = true; login({ username: this.form.username, password: this.md5(this.form.password), - }).then((res) => { - if (res && res.success) { - this.afterLogin(res); - } else { + }) + .then((res) => { + if (res && res.success) { + this.afterLogin(res); + } else { + this.loading = false; + } + }) + .catch(() => { this.loading = false; - } - }).catch(()=>{this.loading = false}); - } + }); + this.$refs.verify.show = false; + }, }, }; @@ -154,7 +159,7 @@ export default { position: relative; zoom: 1; } - .verify-con{ + .verify-con { position: absolute; top: 90px; z-index: 10; @@ -198,5 +203,4 @@ export default { .flex { justify-content: center; } - diff --git a/manager/src/views/main-components/header.vue b/manager/src/views/main-components/header.vue index dcfef0bd..1eeb107b 100644 --- a/manager/src/views/main-components/header.vue +++ b/manager/src/views/main-components/header.vue @@ -2,7 +2,6 @@
-
@@ -15,13 +14,13 @@ export default { 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/advance/recharge.vue b/manager/src/views/member/advance/recharge.vue index 96759e43..6d2b893d 100644 --- a/manager/src/views/member/advance/recharge.vue +++ b/manager/src/views/member/advance/recharge.vue @@ -131,23 +131,9 @@ sortable: false, render: (h, params) => { if (params.row.payStatus == "PAID") { - return h("div", [ - h("Badge", { - props: { - status: "success", - text: "已付款", - }, - }), - ]); - } else if (params.row.payStatus == "UNPAID") { - return h("div", [ - h("Badge", { - props: { - status: "error", - text: "未付款", - }, - }), - ]); + return h("Tag", {props: {color: "green",},}, "已付款"); + } else { + return h("Tag", {props: {color: "red",},}, "未付款"); } }, }, 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/my-components/lili/editor.vue b/manager/src/views/my-components/lili/editor.vue index bc7811a2..697bc9ed 100644 --- a/manager/src/views/my-components/lili/editor.vue +++ b/manager/src/views/my-components/lili/editor.vue @@ -15,20 +15,8 @@
- - + +
@@ -56,21 +44,21 @@ export default { props: { id: { type: String, - default: "editor" + default: "editor", }, value: String, base64: { type: Boolean, - default: false + default: false, }, showExpand: { type: Boolean, - default: true + default: true, }, openXss: { type: Boolean, - default: false - } + default: false, + }, }, data() { return { @@ -79,16 +67,17 @@ export default { dataEdit: "", // 编辑数据 showHTMLModal: false, // 显示html full: false, // html全屏开关 - fullscreenModal: false // 显示全屏预览 + fullscreenModal: false, // 显示全屏预览 }; }, methods: { + initEditor() { let that = this; // 详见wangeditor3官网文档 https://www.kancloud.cn/wangfupeng/wangeditor3/332599 editor = new E(`#${this.id}`); // 编辑内容绑定数据 - editor.config.onchange = html => { + editor.config.onchange = (html) => { if (this.openXss) { this.data = xss(html); } else { @@ -108,30 +97,30 @@ export default { editor.config.uploadImgServer = uploadFile; // lili如要header中传入token鉴权 editor.config.uploadImgHeaders = { - accessToken: that.getStore("accessToken") + accessToken: that.getStore("accessToken"), }; editor.config.uploadFileName = "file"; editor.config.uploadImgHooks = { - before: function(xhr, editor, files) { + before: function (xhr, editor, files) { // 图片上传之前触发 }, - success: function(xhr, editor, result) { + success: function (xhr, editor, result) { // 图片上传并返回结果,图片插入成功之后触发 }, - fail: function(xhr, editor, result) { + fail: function (xhr, editor, result) { // 图片上传并返回结果,但图片插入错误时触发 that.$Message.error("上传图片失败"); }, - error: function(xhr, editor) { + error: function (xhr, editor) { // 图片上传出错时触发 that.$Message.error("上传图片出错"); }, - timeout: function(xhr, editor) { + timeout: function (xhr, editor) { // 图片上传超时时触发 that.$Message.error("上传图片超时"); }, // 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置 - customInsert: function(insertImg, result, editor) { + customInsert: function (insertImg, result, editor) { if (result.success == true) { let url = result.result; insertImg(url); @@ -139,10 +128,11 @@ export default { } else { that.$Message.error(result.message); } - } + }, }; } - editor.config.customAlert = function(info) { + + editor.config.customAlert = function (info) { // info 是需要提示的内容 // that.$Message.info(info); }; @@ -156,8 +146,8 @@ export default { // type -> 'emoji' / 'image' type: "image", // content -> 数组 - content: sina - } + content: sina, + }, ]; editor.create(); if (this.value) { @@ -187,7 +177,7 @@ export default { editor.txt.html(this.data); this.$emit("input", this.data); this.$emit("on-change", this.data); - } + }, }); }, setData(value) { @@ -200,22 +190,21 @@ export default { this.$emit("input", this.data); this.$emit("on-change", this.data); } - } + }, }, watch: { value(val) { this.setData(val); - } + }, }, mounted() { this.initEditor(); - } + }, }; diff --git a/manager/src/views/page/article-manage/articleList.vue b/manager/src/views/page/article-manage/articleList.vue index 4ba3ddb5..360492c8 100644 --- a/manager/src/views/page/article-manage/articleList.vue +++ b/manager/src/views/page/article-manage/articleList.vue @@ -57,7 +57,7 @@ - + @@ -72,7 +72,7 @@
- + @@ -123,7 +123,7 @@ export default { searchTreeValue: "", // 切换 form: { // 添加或编辑表单对象初始化数据 - openStatus:false, + openStatus: false, title: "", categoryId: "", sort: 1, @@ -380,7 +380,6 @@ export default { //为了在是否展示一列展示开关 需要改一下数据类型,最终提交再次更改 this.data = []; if (res.result.records.length > 0) { - this.data = res.result.records; } } @@ -390,7 +389,6 @@ export default { }, handleSubmit() { - this.$refs.form.validate((valid) => { if (valid) { this.submitLoading = true; @@ -403,7 +401,6 @@ export default { this.$Message.success("操作成功"); this.getDataList(); this.modalVisible = false; - } }); } else { @@ -414,8 +411,6 @@ export default { this.$Message.success("操作成功"); this.getDataList(); this.modalVisible = false; - - } }); } @@ -440,10 +435,25 @@ export default { this.form.categoryId = res.result.categoryId; this.treeValue = data.articleCategoryName; this.form.id = data.id; - this.form.content = res.result.content; + this.form.content = htmlEscape(res.result.content); this.form.title = res.result.title; this.form.sort = res.result.sort; - this.form.openStatus = res.result.openStatus + this.form.openStatus = res.result.openStatus; + } + }); + }, + + htmlEscape(text) { + return text.replace(/[<>"&]/g, function (match, pos, originalText) { + switch (match) { + case "<": + return "<"; + case ">": + return ">"; + case "&": + return "&"; + case '"': + return """; } }); }, diff --git a/manager/src/views/promotion/coupon/coupon.vue b/manager/src/views/promotion/coupon/coupon.vue index 8be37e1a..306a25af 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 @@
- +
- +
@@ -64,11 +59,11 @@ export default { modalTitle: "", // 添加或编辑标题 searchForm: { // 搜索框初始化对象 - pageNumber: 0, // 当前页数 + pageNumber: 1, // 当前页数 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,19 +89,19 @@ export default { { title: "活动名称", key: "promotionName", - + minWidth: 100, fixed: "left", }, { title: "优惠券名称", key: "couponName", - + minWidth: 100, tooltip: true, }, { title: "面额/折扣", key: "price", - width: 120, + width: 100, render: (h, params) => { if (params.row.price) { return h( @@ -122,26 +117,28 @@ export default { { title: "领取数量/总数量", key: "publishNum", - width: 150, + width: 130, render: (h, params) => { return h( "div", params.row.receivedNum + "/" + params.row.publishNum ); }, + }, { title: "优惠券类型", key: "couponType", width: 120, render: (h, params) => { - let text = "未知"; + let text = ""; if (params.row.couponType === "DISCOUNT") { - text = "打折"; + return h("Tag", {props: {color: "blue",},}, "打折"); } else if (params.row.couponType === "PRICE") { - text = "减免现金"; + return h("Tag", {props: {color: "geekblue",},}, "减免现金"); + }else { + return h("Tag", {props: {color: "purple",},}, "未知"); } - return h("div", [text]); }, }, { @@ -164,15 +161,15 @@ 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, }, }); } @@ -188,7 +185,7 @@ export default { color = "red"; if (params.row.promotionStatus == "NEW") { text = "未开始"; - color = "default"; + color = "geekblue"; } else if (params.row.promotionStatus == "START") { text = "已开始"; color = "green"; @@ -211,17 +208,19 @@ export default { ), ]); }, + minWidth: 70, }, { title: "操作", slot: "action", align: "center", fixed: "right", - width: 100, + maxWidth: 140, }, ], data: [], // 表单数据 total: 0, // 表单数据总数 + selectCoupon: [], //本级选中的优惠券 }; }, props: { @@ -233,13 +232,13 @@ export default { //优惠券类型 查询参数 getType: { type: String, - default: '' + default: "", }, //已选择优惠券 - selectList: { + selectedList: { type: Array, - default: [] - } + default: [], + }, }, watch: { $route(to, from) { @@ -250,26 +249,37 @@ export default { }, methods: { // 选中优惠券 父级传值 + selectedList: { + handler(val) { + // 判断是否是父级回调给自己已选择优惠券 + if (val.length != 0) { + this.selectCoupon = val; + } + }, + deep: true, + immediate: true, + }, check() { - this.$emit("selected", this.selectList); + // this.selectCoupon.push(this.selectList) + this.$emit("selected", this.selectCoupon); }, init() { this.getDataList(); }, 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; + this.searchForm.pageNumber = v; this.getDataList(); - this.clearSelectAll(); + // this.clearSelectAll(); }, changePageSize(v) { this.searchForm.pageSize = v; @@ -291,10 +301,37 @@ export default { clearSelectAll() { this.$refs.table.selectAll(false); }, + + /** + * 取消已选择的数据 + */ + cancelSelect(selection, row) { + console.log(row) + let findCoupon = this.selectCoupon.find((item) => { + return item.id == row.id; + }); + // 如果没有则添加 + if (!findCoupon) { + this.selectCoupon.push(row); + } else { + // 有重复数据就删除 + this.selectCoupon.map((item, index) => { + if (item.id == findCoupon.id) { + this.selectCoupon.splice(index, 1); + } + }); + } + }, + /** + * 选择优惠券 + */ changeSelect(e) { + if (this.checked && e.length != 0) { + this.selectCoupon.push(...e); + this.check(); + } this.selectList = e; this.selectCount = e.length; - this.checked ? this.check() : ''; }, getDataList() { this.loading = true; @@ -309,9 +346,18 @@ 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) => { + if (this.selectCoupon.length != 0) { + this.selectCoupon.forEach((child) => { + if (item.id == child.id) { + item.___selected = true; + item._checked = true; + } + }); + } + item.___selected = false; + }); + this.data = res.result.records; this.total = res.result.total; } @@ -353,7 +399,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/coupon.vue b/manager/src/views/promotion/couponActivity/coupon.vue index 0be79c4a..aac1d820 100644 --- a/manager/src/views/promotion/couponActivity/coupon.vue +++ b/manager/src/views/promotion/couponActivity/coupon.vue @@ -4,8 +4,17 @@ - +
+ + +
import { getCouponActivityList, - updatePlatformCouponStatus, + closeActivity, } from "@/api/promotion"; export default { - name: "coupon", + name: "couponActivity", components: {}, data() { return { @@ -148,63 +157,36 @@ export default { default: false, }, }, - watch: { - $route(to, from) { - if (to.fullPath == "/promotion/manager-coupon") { - this.init(); - } - }, - }, methods: { - // 选中优惠券 父级传值 - check(val, index) { - - this.data[index].___selected = !this.data[index].___selected - - this.$emit("selected", val); - }, + //获取数据 初始化 init() { this.getDataList(); }, + //增加券活动 add() { this.$router.push({name: "add-coupon-activity"}); }, - /** 跳转至领取详情页面 */ - receiveInfo(v) { - 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: "coupon-activity-info", query: {id: v.id}}); }, + //跳转页面 changePage(v) { this.searchForm.pageNumber = v - 1; this.getDataList(); - this.clearSelectAll(); }, + //修改分页 changePageSize(v) { this.searchForm.pageSize = v; this.getDataList(); }, + //搜索活动 handleSearch() { this.searchForm.pageNumber = 0; this.searchForm.pageSize = 10; this.getDataList(); }, - changeSort(e) { - this.searchForm.sort = e.key; - this.searchForm.order = e.order; - if (e.order === "normal") { - this.searchForm.order = ""; - } - this.getDataList(); - }, - clearSelectAll() { - this.$refs.table.selectAll(false); - }, - changeSelect(e) { - this.selectList = e; - this.selectCount = e.length; - }, + //数据获取 getDataList() { this.loading = true; if (this.selectDate && this.selectDate[0] && this.selectDate[1]) { @@ -218,133 +200,32 @@ export default { getCouponActivityList(this.searchForm).then((res) => { this.loading = false; if (res.success) { - res.result.records.forEach(item => { - item.___selected = false - }) this.data = res.result.records; this.total = res.result.total; } }); - this.total = this.data.length; this.loading = false; }, - handleSubmit() { - this.$refs.form.validate((valid) => { - if (valid) { - this.submitLoading = true; - if (this.modalType === 0) { - // 添加 避免编辑后传入id等数据 记得删除 - delete this.form.id; - this.postRequest("/coupon/insertOrUpdate", this.form).then( - (res) => { - this.submitLoading = false; - if (res.success) { - this.$Message.success("操作成功"); - this.getDataList(); - this.modalVisible = false; - } - } - ); - } else { - // 编辑 - this.postRequest("/coupon/insertOrUpdate", this.form).then( - (res) => { - this.submitLoading = false; - if (res.success) { - this.$Message.success("操作成功"); - this.getDataList(); - this.modalVisible = false; - } - } - ); - } - } - }); - }, + //跳转编辑 edit(v) { this.$router.push({name: "edit-platform-coupon", query: {id: v.id}}); }, + //下架活动 remove(v) { this.$Modal.confirm({ title: "确认下架", // 记得确认修改此处 - content: "确认要下架此优惠券么?", + content: "确认要下架此优惠券活动么?下架活动只能重新创建", loading: true, onOk: () => { // 删除 - updatePlatformCouponStatus({ - couponIds: v.id, - promotionStatus: "CLOSE", - }) - .then((res) => { - this.$Modal.remove(); - if (res.success) { - this.$Message.success("优惠券已作废"); - this.getDataList(); - } - }) - .catch(() => { - this.$Modal; - }); - }, - }); - }, - delAll() { - if (this.selectCount <= 0) { - this.$Message.warning("您还未选择要下架的优惠券"); - return; - } - this.$Modal.confirm({ - title: "确认下架", - content: "您确认要下架所选的 " + this.selectCount + " 条数据?", - loading: true, - onOk: () => { - let ids = []; - this.selectList.forEach(function (e) { - ids.push(e.id); - }); - let params = { - couponIds: ids.toString(), - promotionStatus: "CLOSE", - }; - // 批量删除 - updatePlatformCouponStatus(params).then((res) => { - this.$Modal.remove(); + closeActivity(v.id).then((res) => { if (res.success) { - this.$Message.success("下架成功"); - this.clearSelectAll(); - this.getDataList(); - } - }); - }, - }); - }, - upAll() { - if (this.selectCount <= 0) { - this.$Message.warning("请选择要上架的优惠券"); - return; - } - this.$Modal.confirm({ - title: "确认上架", - content: "您确认要上架所选的 " + this.selectCount + " 条数据?", - loading: true, - onOk: () => { - let ids = []; - this.selectList.forEach(function (e) { - ids.push(e.id); - }); - let params = { - couponIds: ids.toString(), - promotionStatus: "START", - }; - // 批量上架 - updatePlatformCouponStatus(params).then((res) => { - this.$Modal.remove(); - if (res.success) { - this.$Message.success("上架成功"); - this.clearSelectAll(); + this.$Message.success("优惠券活动已作废"); this.getDataList(); } + }).catch(() => { + this.$Modal; }); }, }); diff --git a/manager/src/views/promotion/couponActivity/couponInfo.vue b/manager/src/views/promotion/couponActivity/couponInfo.vue index 87061b89..2b800adf 100644 --- a/manager/src/views/promotion/couponActivity/couponInfo.vue +++ b/manager/src/views/promotion/couponActivity/couponInfo.vue @@ -3,81 +3,37 @@
-

平台券活动详情

+

优惠券活动详情

- {{ form.promotionName }} + {{ couponActivity.promotionName }} - {{ - getCouponType(form.couponType) - }} + 新人发券 + 精确发券 - - ¥{{ form.price | unitPrice }} + + 全部会员 + 指定会员 - - {{ form.description }} + + {{ couponActivity.startTime }}~{{ couponActivity.endTime }} - - {{ form.publishNum }} - - - {{ form.limitNum }} - - - {{ form.startTime }} - - - {{ - form.consumptionLimit - }} - - - {{ form.startTime }} 至 {{ form.endTime }} - - - {{ - getScopeType(form.scopeType) - }} - - - {{ form.couponName }} - - - {{ - getStatus(form.status) - }} - - - {{ - getType(form.getType) - }} - - - {{ form.createTime }} - - - {{ form.updateTime }} - - - {{ form.updateBy }} - - - {{ form.receivedNum }} - - - {{ form.usedNum }} + + + 新建 + 已开始 + 已结束 + 已废弃
-

适用品类范围

-
-
- - - -
+

优惠券列表

+ +
+

会员列表列表

+ + +
@@ -89,145 +45,78 @@ diff --git a/manager/src/views/promotion/couponActivity/couponSpecify.vue b/manager/src/views/promotion/couponActivity/couponSpecify.vue deleted file mode 100644 index a4553e87..00000000 --- a/manager/src/views/promotion/couponActivity/couponSpecify.vue +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - diff --git a/manager/src/views/promotion/couponActivity/memberReceiveCoupon.vue b/manager/src/views/promotion/couponActivity/memberReceiveCoupon.vue deleted file mode 100644 index 4291c1e3..00000000 --- a/manager/src/views/promotion/couponActivity/memberReceiveCoupon.vue +++ /dev/null @@ -1,250 +0,0 @@ - - - - diff --git a/manager/src/views/promotion/fullCut/full-cut.vue b/manager/src/views/promotion/fullCut/full-cut.vue index b31ad74d..b441ea88 100644 --- a/manager/src/views/promotion/fullCut/full-cut.vue +++ b/manager/src/views/promotion/fullCut/full-cut.vue @@ -132,19 +132,19 @@ export default { minWidth: 60, render: (h, params) => { let text = "未知", - color = "default"; + color = "purple"; if (params.row.promotionStatus == "NEW") { text = "未开始"; - color = "default"; + color = "geekblue"; } else if (params.row.promotionStatus == "START") { text = "已开始"; - color = "green"; + color = "blue"; } else if (params.row.promotionStatus == "END") { text = "已结束"; - color = "blue"; + color = "green"; } else if (params.row.promotionStatus == "CLOSE") { text = "已关闭"; - color = "red"; + color = "volcano"; } return h("div", [ h( 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/manager/src/views/promotion/pintuan/pintuan.vue b/manager/src/views/promotion/pintuan/pintuan.vue index 7d6a44db..a9b3f387 100644 --- a/manager/src/views/promotion/pintuan/pintuan.vue +++ b/manager/src/views/promotion/pintuan/pintuan.vue @@ -122,16 +122,16 @@ export default { color = ""; if (params.row.promotionStatus == "NEW") { text = "未开始"; - color = "default"; + color = "geekblue"; } else if (params.row.promotionStatus == "START") { text = "已开始"; - color = "green"; + color = "blue"; } else if (params.row.promotionStatus == "END") { text = "已结束"; - color = "blue"; + color = "green"; } else if (params.row.promotionStatus == "CLOSE") { text = "已关闭"; - color = "red"; + color = "volcano"; } return h("div", [ h( diff --git a/manager/src/views/promotion/pointsGoods/pointsGoods.vue b/manager/src/views/promotion/pointsGoods/pointsGoods.vue index 975875d2..dd209a87 100644 --- a/manager/src/views/promotion/pointsGoods/pointsGoods.vue +++ b/manager/src/views/promotion/pointsGoods/pointsGoods.vue @@ -92,7 +92,7 @@
{{ row.startTime }}
{{ row.endTime }}
- +