diff --git a/buyer/src/pages/home/userCenter/MoneyManagement.vue b/buyer/src/pages/home/userCenter/MoneyManagement.vue index f57011b3..9ebd1f13 100644 --- a/buyer/src/pages/home/userCenter/MoneyManagement.vue +++ b/buyer/src/pages/home/userCenter/MoneyManagement.vue @@ -188,10 +188,10 @@ export default { }, formValidate: { price: [ - { required: true, message: '请输入大于0小于9999的合法充值金额' }, + { required: true, message: '请输入大于等于1小于9999的合法充值金额' }, { pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/, - message: '请输入大于0小于9999的合法充值金额', + message: '请输入大于等于1小于9999的合法充值金额', trigger: 'change' } ] @@ -200,11 +200,13 @@ export default { logColumns: [ { title: '时间', + width: 190, key: 'createTime' }, { title: '金额', key: 'money', + width: 180, render: (h, params) => { if (params.row.money > 0) { return h('div', [ @@ -241,20 +243,29 @@ export default { logColumnsData: {}, // 余额日志 // 充值记录 rechargeListColumns: [ + { + title: '充值时间', + key: 'createTime', + width: 168 + }, { title: '支付单号', key: 'rechargeSn', width: 200 }, - { - title: '支付方式', - key: 'rechargeWay' - }, { title: '充值金额', key: 'rechargeMoney', render: (h, params) => { - return h('div', [h('span', this.$options.filters.unitPrice(params.row.rechargeMoney, '¥'))]); + if (params.row.payStatus === 'PAID') { + return h('div', [h('span', { + style: { + color: 'green' + } + }, this.$options.filters.unitPrice(params.row.rechargeMoney, '+ ¥'))]); + } else { + return h('div', [h('span', this.$options.filters.unitPrice(params.row.rechargeMoney, '¥'))]); + } } }, { @@ -268,29 +279,60 @@ export default { } } }, + { + title: '支付方式', + key: 'rechargeWay', + render: (h, params) => { + if (params.row.rechargeWay === 'ALIPAY') { + return h('div', [h('span', {}, '支付宝')]); + } else if (params.row.rechargeWay === 'WECHAT') { + return h('div', [h('span', {}, '微信')]); + } else if (params.row.rechargeWay === 'BANK_TRANSFER') { + return h('div', [h('span', {}, '线下转账')]); + } else { + return h('div', [h('span', {}, '')]); + } + } + }, { title: '支付时间', - key: 'payTime' + key: 'payTime', + width: 180 } ], rechargeListData: {}, // 充值记录数据 // 提现记录 withdrawApplyColumns: [ + { + title: '申请时间', + key: 'createTime', + width: 168 + }, { title: '提现单号', key: 'sn', - width: 215 + width: 200 }, { title: '提现金额', key: 'applyMoney', + width: 110, render: (h, params) => { - return h('div', [h('span', this.$options.filters.unitPrice(params.row.applyMoney, '¥'))]); + if (params.row.applyStatus === 'VIA_AUDITING') { + return h('div', [h('span', { + style: { + color: 'green' + } + }, this.$options.filters.unitPrice(params.row.applyMoney, '+ ¥'))]); + } else { + return h('div', [h('span', this.$options.filters.unitPrice(params.row.applyMoney, '¥'))]); + } } }, { title: '提现状态', key: 'applyStatus', + width: 95, render: (h, params) => { if (params.row.applyStatus === 'APPLY') { return h('div', [h('span', {}, '申请中')]); @@ -302,12 +344,14 @@ export default { } }, { - title: '提现时间', - key: 'inspectTime' + title: '审核时间', + key: 'inspectTime', + width: 168 }, { title: '审核备注', key: 'inspectRemark' + } ], withdrawApplyColumnsListData: {} // 提现记录 diff --git a/buyer/src/plugins/request.js b/buyer/src/plugins/request.js index c5457098..3e5e1e9e 100644 --- a/buyer/src/plugins/request.js +++ b/buyer/src/plugins/request.js @@ -69,7 +69,7 @@ service.interceptors.request.use( config.headers['accessToken'] = accessToken; // 解析当前token时间 let jwtData = JSON.parse( - decodeURIComponent(escape(window.atob(accessToken.split('.')[1]))) + decodeURIComponent(escape(window.atob(accessToken.split('.')[1].replace(/-/g, '+').replace(/_/g, '/')))) ); if (jwtData.exp < Math.round(new Date() / 1000)) { refresh(config) diff --git a/buyer/yarn.lock b/buyer/yarn.lock index afd75933..dc4f8959 100644 --- a/buyer/yarn.lock +++ b/buyer/yarn.lock @@ -2621,12 +2621,12 @@ dom-serializer@0: domelementtype "^2.0.1" entities "^2.0.0" -dom7@^3.0.0: - version "3.0.0" - resolved "https://registry.npm.taobao.org/dom7/download/dom7-3.0.0.tgz#b861ce5d67a6becd7aaa3ad02942ff14b1240331" - integrity sha1-uGHOXWemvs16qjrQKUL/FLEkAzE= +dom7@^2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/dom7/-/dom7-2.1.5.tgz#a79411017800b31d8400070cdaebbfc92c1f6377" + integrity sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA== dependencies: - ssr-window "^3.0.0-alpha.1" + ssr-window "^2.0.0" domain-browser@^1.1.1: version "1.2.0" @@ -7487,10 +7487,10 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" -ssr-window@^3.0.0, ssr-window@^3.0.0-alpha.1: - version "3.0.0" - resolved "https://registry.npm.taobao.org/ssr-window/download/ssr-window-3.0.0.tgz#fd5b82801638943e0cc704c4691801435af7ac37" - integrity sha1-/VuCgBY4lD4MxwTEaRgBQ1r3rDc= +ssr-window@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-2.0.0.tgz#98c301aef99523317f8d69618f0010791096efc4" + integrity sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A== ssri@^5.2.4: version "5.3.0" @@ -7753,14 +7753,13 @@ svgo@^1.0.0: unquote "~1.1.1" util.promisify "~1.0.0" -swiper@^6.4.1: - version "6.4.1" - resolved "https://registry.npm.taobao.org/swiper/download/swiper-6.4.1.tgz?cache=0&sync_timestamp=1607518804170&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fswiper%2Fdownload%2Fswiper-6.4.1.tgz#6d4e9252ed4226821d4005e77924e929848de8af" - integrity sha1-bU6SUu1CJoIdQAXneSTpKYSN6K8= +swiper@^5.2.0: + version "5.4.5" + resolved "https://registry.yarnpkg.com/swiper/-/swiper-5.4.5.tgz#a350f654bf68426dbb651793824925512d223c0f" + integrity sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA== dependencies: - dom7 "^3.0.0" - ssr-window "^3.0.0" - tslib "^2.0.0" + dom7 "^2.1.5" + ssr-window "^2.0.0" table@4.0.2: version "4.0.2" @@ -7942,11 +7941,6 @@ tslib@^1.10.0: resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.14.1.tgz?cache=0&sync_timestamp=1602286724979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha1-zy04vcNKE0vK8QkcQfZhni9nLQA= -tslib@^2.0.0: - version "2.0.3" - resolved "https://registry.npm.taobao.org/tslib/download/tslib-2.0.3.tgz?cache=0&sync_timestamp=1602286724979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" - integrity sha1-jgdBrEX8DCJuWKF7/D5kubxsphw= - tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.npm.taobao.org/tty-browserify/download/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" diff --git a/manager/src/api/other.js b/manager/src/api/other.js index 645b2faf..7dd0ab29 100644 --- a/manager/src/api/other.js +++ b/manager/src/api/other.js @@ -86,4 +86,9 @@ export const getMemberFeedbackDetail = (id) => { return getRequest(`/feedback/${id}`); }; +//管理员获取发送详情列表 +export const getMemberMessage = (params) => { + return getRequest(`/message/member`, params); +}; + diff --git a/manager/src/views/member/advance/recharge.vue b/manager/src/views/member/advance/recharge.vue index 6d2b893d..26c2be83 100644 --- a/manager/src/views/member/advance/recharge.vue +++ b/manager/src/views/member/advance/recharge.vue @@ -122,6 +122,17 @@ title: "充值方式", key: "rechargeWay", width: 120, + render: (h, params) => { + if (params.row.rechargeWay === 'ALIPAY') { + return h('div', [h('span', {}, '支付宝')]); + } else if (params.row.rechargeWay === 'WECHAT') { + return h('div', [h('span', {}, '微信')]); + } else if (params.row.rechargeWay === 'BANK_TRANSFER') { + return h('div', [h('span', {}, '线下转账')]); + } else { + return h('div', [h('span', {}, '')]); + } + } }, { title: "支付状态", @@ -137,6 +148,13 @@ } }, }, + { + title: "充值时间", + key: "createTime", + align: "left", + width: 190, + sortable: false, + }, { title: "支付时间", key: "payTime", diff --git a/manager/src/views/member/advance/walletLog.vue b/manager/src/views/member/advance/walletLog.vue index 3de776e4..3f2da047 100644 --- a/manager/src/views/member/advance/walletLog.vue +++ b/manager/src/views/member/advance/walletLog.vue @@ -78,7 +78,7 @@ export default { color: "red", }, }, - this.$options.filters.unitPrice(params.row.money, "¥") + this.$options.filters.unitPrice(-params.row.money, "- ¥") ), ]); } diff --git a/manager/src/views/promotion/coupon/couponPublish.vue b/manager/src/views/promotion/coupon/couponPublish.vue index 7b06efec..2247a931 100644 --- a/manager/src/views/promotion/coupon/couponPublish.vue +++ b/manager/src/views/promotion/coupon/couponPublish.vue @@ -39,9 +39,11 @@ +
如果发放数量为0时,则代表不限制发放数量
+
如果领取数量为0时,则代表不限制领取数量
diff --git a/manager/src/views/promotion/couponActivity/coupon.vue b/manager/src/views/promotion/couponActivity/coupon.vue index aac1d820..afb89d0a 100644 --- a/manager/src/views/promotion/couponActivity/coupon.vue +++ b/manager/src/views/promotion/couponActivity/coupon.vue @@ -44,7 +44,7 @@ export default { // 搜索框初始化对象 pageNumber: 0, // 当前页数 pageSize: 10, // 页面大小 - sort: "startTime", // 默认排序字段 + sort: "createTime", // 默认排序字段 order: "desc", // 默认排序方式 }, form: { diff --git a/manager/src/views/sys/message/noticeMessageTemplate.vue b/manager/src/views/sys/message/noticeMessageTemplate.vue index cd7e8a08..1dbb7d67 100644 --- a/manager/src/views/sys/message/noticeMessageTemplate.vue +++ b/manager/src/views/sys/message/noticeMessageTemplate.vue @@ -35,16 +35,18 @@ -
+ +
+
-
+ +
+
-
- #{{{item}}} -
+
+ #{{{item}}} +
- + - +
@@ -137,24 +142,34 @@ :title="messageModalTitle" v-model="messageModalVisible" :mask-closable="false" - :width="500" + :width="800" >
- + + + + + 会员 + 商家 + + + 全站 - 指定商家 + 指定商家 + 指定会员 @@ -165,6 +180,17 @@ + + +
+ +
+
+
+ + +
@@ -180,7 +206,7 @@ :title="modalTitle" v-model="messageDetailModalVisible" :mask-closable="false" - :width="700" + :width="800" >
@@ -195,30 +221,65 @@ style="max-height:60vh;overflow:auto;width: 50%" /> + + + 会员 + 商家 + + 全站 - 指定商家 + 指定商家 + 指定会员 - -
+ + +
+
+ +
+ + +
+
+ + { + return h("div", params.row.mobile || "暂未填写"); + }, + }, + { + 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); + }, + }, + }, + "删除" + ); + }, + }, + ], noticeData: [], // 表单数据 noticeDataTotal: 0, // 表单数据总数 messageColumns: [ @@ -427,7 +539,22 @@ minWidth: 350, tooltip: true }, - + { + title: "发送对象", + key: "messageClient", + width: 100, + render: (h, params) => { + if (params.row.messageClient == "member") { + return h('div', [ + h('span', {}, '会员'), + ]); + } else if (params.row.messageClient == "store") { + return h('div', [ + h('span', {}, '商家'), + ]); + } + } + }, { title: "发送类型", key: "messageRange", @@ -439,7 +566,11 @@ ]); } else if (params.row.messageRange == "APPOINT") { return h('div', [ - h('span', {}, '指定用户'), + h('span', {}, '指定商家'), + ]); + } else if (params.row.messageRange == "MEMBER") { + return h('div', [ + h('span', {}, '指定会员'), ]); } } @@ -499,7 +630,7 @@ } }, ], - messageData: [], // 表单数据 + messageData: [], // 表单数据 messageDataTotal: 0, // 表单数据总数 messageDetailColumns: [ { @@ -518,17 +649,47 @@ key: "status", render: (h, params) => { if (params.row.status == "ALREADY_READY") { - return h( "Badge", {props: { status: "success",text: "已读" } }) + return h("Badge", {props: {status: "success", text: "已读"}}) } else if (params.row.status == "UN_READY") { - return h( "Badge", {props: { status: "processing",text: "未读" } }) - }else{ - return h( "Badge", {props: { status: "processing",text: "回收站" } }) + return h("Badge", {props: {status: "processing", text: "未读"}}) + } else { + return h("Badge", {props: {status: "processing", text: "回收站"}}) } } }, ], shopMessageData: [], // 发送给店铺的消息数据 shopMessageDataTotal: 0, // 发送给店铺的消息数据总数 + + memberMessageDetailColumns: [ + { + title: "会员ID", + key: "memberId", + maxWidth: 300, + sortable: false, + }, + { + title: "会员名称", + key: "memberName", + sortable: false, + }, + { + title: "是否已读", + key: "status", + maxWidth: 120, + render: (h, params) => { + if (params.row.status == "ALREADY_READY") { + return h("Badge", {props: {status: "success", text: "已读"}}) + } else if (params.row.status == "UN_READY") { + return h("Badge", {props: {status: "processing", text: "未读"}}) + } else { + return h("Badge", {props: {status: "processing", text: "回收站"}}) + } + } + }, + ], + memberMessageData: [], // 发送给店铺的消息数据 + memberMessageDataTotal: 0, // 发送给店铺的消息数据总数 }; }, methods: { @@ -536,6 +697,41 @@ this.getMessage(); }, + // 返回已选择的用户 + callbackSelectUser(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.reSelectMember(); + }, + + // 删除选择的会员 + delUser(index) { + this.selectedMember.splice(index, 1); + this.reSelectMember(); + }, + //更新选择的会员 + reSelectMember() { + this.form.memberDTOS = this.selectedMember.map((item) => { + return { + nickName: item.nickName, + id: item.id + } + }); + }, + //获取全部商家 getShopList() { this.loading = true; @@ -548,6 +744,13 @@ this.loading = false; }, + // 添加指定用户 + addVip() { + this.checkUserList = true; + this.$nextTick(() => { + this.$refs.memberLayout.selectedMember = true; + }); + }, paneChange(v) { if (v == "SETTING") { this.getNoticeMessage() @@ -582,6 +785,42 @@ this.getMessage(); this.clearSelectAll(); }, + + //会员消息每页条数发生变化 + memberMessageChangePageSize(v) { + this.searchMemberMessageForm.pageSize = v; + this.messageDetail(); + }, + //会员消息页数变化 + memberMessageChangePage(v) { + this.searchMemberMessageForm.pageNumber = v; + this.messageDetail(); + this.clearSelectAll(); + }, + //会员消息 + memberMessageChangeSort(e) { + this.searchMemberMessageForm.sort = e.key; + this.searchMemberMessageForm.order = e.order; + this.messageDetail() + }, + + //店铺消息每页条数发生变化 + shopMessageChangePageSize(v) { + this.searchShopMessageForm.pageSize = v; + this.messageDetail(); + }, + //店铺消息页数变化 + shopMessageChangePage(v) { + this.searchShopMessageForm.pageNumber = v; + this.messageDetail(); + this.clearSelectAll(); + }, + //店铺消息 + shopMessageChangeSort(e) { + this.searchShopMessageForm.sort = e.key; + this.searchShopMessageForm.order = e.order; + this.messageDetail() + }, //消息 messageChangeSort(e) { this.searchMessageForm.sort = e.key; @@ -622,7 +861,7 @@ }) }, //删除站内信 - delete(id){ + delete(id) { console.warn(id) this.$Modal.confirm({ title: "确认删除", @@ -647,9 +886,11 @@ this.messageModalVisible = true this.messageModalTitle = "发送站内信" this.shopShow = false + this.memberShow = false this.messageSendForm = { messageRange: "ALL", + messageClient: "member", content: "", title: "", userIds: [], @@ -658,6 +899,18 @@ }, //管理员发送站内信提交 sendMessageSubmit() { + let userIds = []; + let userNames = []; + console.warn(this.selectedMember) + if (this.messageSendForm.messageClient == 'member' && this.messageSendForm.messageRange == 'MEMBER'){ + this.selectedMember.forEach(function(item, index) { + userIds.push(item.id) + userNames.push(item.username) + }) + this.messageSendForm.userIds = userIds + this.messageSendForm.userNames = userNames + } + if (this.messageSendForm.userIds.length <= 0 && this.messageSendForm.messageRange == "APPOINT") { this.$Message.error("请选择发送对象"); return @@ -677,14 +930,27 @@ }) }, + //发送对象选择 + selectObject(v) { + this.messageSendForm.messageRange = "ALL" + this.shopShow = false + this.memberShow =false + }, //弹出选择商家的框 selectShop(v) { if (v == "APPOINT") { this.getShopList() this.shopShow = true + this.memberShow = false } if (v == "ALL") { this.shopShow = false + this.memberShow = false + } + if (v == "MEMBER") { + this.shopShow = false + this.memberShow = true + this.selectedMember = [] } }, //获取管理员发送列表 @@ -715,9 +981,9 @@ handleSubmit() { this.$refs.form.validate((valid) => { if (valid) { - let params ={ - noticeContent:this.form.noticeContent, - noticeTitle:this.form.noticeTitle + let params = { + noticeContent: this.form.noticeContent, + noticeTitle: this.form.noticeTitle } API_Setting.editNoticeMessage(this.form.id, params).then((res) => { this.submitLoading = false; @@ -731,19 +997,38 @@ }); }, //消息详情 - detail(v) { - this.searchShopMessageForm.messageId = v.id - API_Other.getShopMessage(this.searchShopMessageForm).then((res) => { - if (res.success) { - this.messageDetailModalVisible = true; - this.modalTitle = "消息详情" - this.messageSendForm = v - this.shopMessageData = res.result.records; - this.shopMessageDataTotal = res.result.total; - } - }); + messageDetail() { + if (this.messageSendForm.messageClient == 'member') { + API_Other.getMemberMessage(this.searchMemberMessageForm).then((res) => { + if (res.success) { + this.memberMessageData = res.result.records; + this.memberMessageDataTotal = res.result.total; + } + }); + } else { + console.warn(this.searchShopMessageForm) + API_Other.getShopMessage(this.searchShopMessageForm).then((res) => { + if (res.success) { + this.shopMessageData = res.result.records; + this.shopMessageDataTotal = res.result.total; + } + }); + } }, + //消息详情弹出框 + detail(v) { + console.warn(this.searchShopMessageForm) + this.messageSendForm = v + if (this.messageSendForm.messageClient == 'member') { + this.searchMemberMessageForm.messageId = v.id + } else { + this.searchShopMessageForm.messageId = v.id + } + this.messageDetail(); + this.messageDetailModalVisible = true; + this.modalTitle = "消息详情" + }, edit(v) { API_Setting.getNoticeMessageDetail(v.id).then((res) => { if (res.success) { @@ -755,7 +1040,7 @@ }, //禁用站内信模板 disable(v) { - API_Setting.updateMessageStatus(v.id,"CLOSE").then((res) => { + API_Setting.updateMessageStatus(v.id, "CLOSE").then((res) => { if (res.success) { this.$Message.success("禁用成功"); this.getNoticeMessage(); @@ -764,7 +1049,7 @@ }, //启用站内信模板 enable(v) { - API_Setting.updateMessageStatus(v.id,"OPEN").then((res) => { + API_Setting.updateMessageStatus(v.id, "OPEN").then((res) => { if (res.success) { this.$Message.success("启用成功"); this.getNoticeMessage(); diff --git a/seller/src/store/modules/app.js b/seller/src/store/modules/app.js index 8e896575..6d1d4525 100644 --- a/seller/src/store/modules/app.js +++ b/seller/src/store/modules/app.js @@ -7,6 +7,7 @@ import Vue from 'vue'; const app = { state: { shipTemplates:"", + regions:[], //此处是在地区选择器时赋值一次 styleStore:"", //移动端楼层装修中选择风格存储 loading: false, // 全局加载动画 added: false, // 加载路由标识 diff --git a/seller/src/views/lili-components/multiple-region.vue b/seller/src/views/lili-components/multiple-region.vue index 34b78ed7..fe01cabf 100644 --- a/seller/src/views/lili-components/multiple-region.vue +++ b/seller/src/views/lili-components/multiple-region.vue @@ -44,23 +44,27 @@ export default { */ open(val, index) { if (val) { + // console.warn(val); //已选中的地址 let checkedData = this.$store.state.shipTemplate; + // console.warn(this.$store.state.shipTemplate); // 禁止选中的地址 let disabledData = checkedData.filter((item, i) => { return i != index; }); - disabledData.forEach((dis) => { + console.log(dis) // 循环出已经选中的地址id dis.areaId.split(",").forEach((ids) => { // 循环出省份 this.data.forEach((item) => { // 如果当前省份下市区全部选中则选中该省份 + if (dis.selectedAll) { dis.area.split(",").forEach((area) => { if (area == item.name) { + console.log(item.name +"选中") this.$set(item, "disabled", true); } }); @@ -99,7 +103,11 @@ export default { // 筛选出当前选中的市 sort.forEach((sortItem, sortIndex) => { - if (item.level != "province" && sortItem.id == item.parentId && !item.disabled) { + if ( + item.level != "province" && + sortItem.id == item.parentId && + !item.disabled + ) { sortItem.selectedList.push({ ...item, }); @@ -147,6 +155,7 @@ export default { this.selectedWay.push({ name: data.title, id: data.id }); }); console.log(this.data); + this.$store.state.regions = this.data; } }); }, diff --git a/seller/src/views/promotion/coupon/couponPublish.vue b/seller/src/views/promotion/coupon/couponPublish.vue index e9daf0da..76d1c966 100644 --- a/seller/src/views/promotion/coupon/couponPublish.vue +++ b/seller/src/views/promotion/coupon/couponPublish.vue @@ -6,22 +6,10 @@

基本信息

- + - + - - + + 请输入0-10之间数字,可以输入一位小数 - - + + - - + + +
如果发放数量为0时,则代表不限制发放数量

使用限制

- + - - + + +
如果领取限制为0时,则代表不限制领取数量
- + @@ -109,34 +57,14 @@ - +
- - + +
- +
@@ -147,35 +75,17 @@
- +
- - + +
- +
@@ -212,7 +122,7 @@ export default { callback(); } }; - + return { modalType: 0, // 判断是新增还是编辑优惠券 0 新增 1 编辑 categoryId: 0, // 分类id @@ -232,6 +142,7 @@ export default { getType: "FREE", promotionGoodsList: [], scopeIdGoods: [], + rangeDayType: "FIXEDTIME", }, id: this.$route.query.id, submitLoading: false, // 添加或编辑提交状态 @@ -392,7 +303,11 @@ export default { params.endTime = this.$options.filters.unixToDate( this.form.rangeTime[1] / 1000 ); - delete params.rangeTime + if (params.getType == "ACTIVITY") { + params.couponLimitNum = 0; + params.publishNum = 0; + } + delete params.rangeTime; let scopeId = []; if ( params.scopeType == "PORTION_GOODS" && @@ -465,12 +380,13 @@ export default { name: "coupon", }); }, - openSkuList() { // 显示商品选择器 + openSkuList() { + // 显示商品选择器 this.$refs.skuSelect.open("goods"); - let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList)) - data.forEach(e => { - e.id = e.skuId - }) + let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList)); + data.forEach((e) => { + e.id = e.skuId; + }); this.$refs.skuSelect.goodsData = data; }, changeSelect(e) { @@ -507,15 +423,15 @@ export default { // 回显已选商品 let list = []; item.forEach((e) => { - list.push({ - goodsName: e.goodsName, - price: e.price, - originalPrice: e.price, - quantity: e.quantity, - storeId: e.storeId, - sellerName: e.sellerName, - skuId: e.id, - }); + list.push({ + goodsName: e.goodsName, + price: e.price, + originalPrice: e.price, + quantity: e.quantity, + storeId: e.storeId, + sellerName: e.sellerName, + skuId: e.id, + }); }); this.form.promotionGoodsList = list; }, @@ -598,11 +514,15 @@ h4 { margin-left: 10px; color: #999; } -.ivu-form-item{ +.ivu-form-item { margin-bottom: 24px !important; } -.wrapper{ +.wrapper { min-height: 1000px; } +.tips { + font-size: 12px; + color: #999; +} diff --git a/seller/src/views/promotion/live/addLive.vue b/seller/src/views/promotion/live/addLive.vue index 5f4b3295..7c2e9993 100644 --- a/seller/src/views/promotion/live/addLive.vue +++ b/seller/src/views/promotion/live/addLive.vue @@ -97,7 +97,7 @@
- + @@ -259,10 +259,14 @@ export default { * 删除直播间商品 */ async deleteGoods(val, index) { + this.$Spin.show(); let res = await delRoomLiveGoods(this.liveForm.roomId, val.liveGoodsId); if (res.success) { this.$Message.success("删除成功!"); this.liveData.splice(index, 1); + this.$Spin.hide(); + } else { + this.$Spin.hide(); } }, /** @@ -325,35 +329,19 @@ export default { * 回调的商品选择数据 */ callBackData(way) { - this.$set(this, "liveData", way); - }, - - /** - * 提交直播间商品 - */ - addGoods() { + console.log(way); + this.liveGoodsVisible = false; + this.$Spin.show(); addLiveGoods({ roomId: this.$route.query.roomId, - liveGoodsId: item.liveGoodsId, - }); - }, - - /** - * dialog点击确定时判断 - */ - addGoods() { - this.liveData.forEach((item) => { - if (this.commodityList.length == 1 && this.liveData.length == 1) { - addLiveGoods({ - roomId: this.$route.query.roomId, - liveGoodsId: item.liveGoodsId, - }); + liveGoodsId: way.liveGoodsId, + }).then((res) => { + if (res.success) { + this.liveData.push(way); + this.$Spin.hide(); + console.log(this.liveData); } else { - this.commodityList.forEach((oldVal, i) => { - // 如果商品里面没有商品,以及添加商品为第一次的话 - if (oldVal.liveGoodsId != item.liveGoodsId) { - } - }); + this.$Spin.hide(); } }); }, diff --git a/seller/src/views/promotion/live/liveGoods.vue b/seller/src/views/promotion/live/liveGoods.vue index eb2def25..230712c0 100644 --- a/seller/src/views/promotion/live/liveGoods.vue +++ b/seller/src/views/promotion/live/liveGoods.vue @@ -208,20 +208,20 @@ export default { * 回调参数补充 */ selectedLiveGoods(val, index) { - if (!val.___selected) { - val.___selected = true; - this.$set(this.liveGoodsData[index], "___selected", true); - this.selectedGoods.push(this.liveGoodsData[index]); - } else { - this.$nextTick(() => { - val.___selected = false; + // if (!val.___selected) { + // val.___selected = true; + // this.$set(this.liveGoodsData[index], "___selected", true); + // this.selectedGoods.push(this.liveGoodsData[index]); + // } else { + // this.$nextTick(() => { + // val.___selected = false; - this.$set(this.liveGoodsData[index], "___selected", true); - this.selectedGoods.splice(index, 1); - }); - } + // this.$set(this.liveGoodsData[index], "___selected", true); + // this.selectedGoods.splice(index, 1); + // }); + // } - this.$emit("selectedGoods", this.selectedGoods); + this.$emit("selectedGoods", val); }, /** * 解决radio数据不回显问题 @@ -279,7 +279,7 @@ export default { console.log(element); return { goodsId: element.goodsId, //商品id - goodsImage: element.small, //商品图片 必须为 300 * 300 + goodsImage: element.small, //商品图片 最大为 300 * 300 name: element.goodsName, //商品昵称 price: parseInt(element.price), //商品价格 quantity: element.quantity, //库存 diff --git a/seller/src/views/shop/ship/shipTemplate.vue b/seller/src/views/shop/ship/shipTemplate.vue index 813c4664..fc7f227b 100644 --- a/seller/src/views/shop/ship/shipTemplate.vue +++ b/seller/src/views/shop/ship/shipTemplate.vue @@ -95,8 +95,8 @@
- - + + @@ -104,7 +104,7 @@ - + @@ -135,7 +135,7 @@ - @@ -163,7 +163,7 @@ export default { data() { return { - selectedIndex:0, //选中的地址模板下标 + selectedIndex: 0, //选中的地址模板下标 item: "", //运费模板子模板 shipInfo: {}, // 运费模板数据 title: "添加运费模板", // 模态框标题 @@ -195,6 +195,11 @@ export default { }, }; }, + computed: { + regions() { + return this.$store.state.regions; + }, + }, methods: { init() { this.getData(); @@ -224,7 +229,7 @@ export default { firstPrice: "", continuedCompany: "1", continuedPrice: "", - selectedAll:false + selectedAll: false, }, ], }; @@ -240,12 +245,24 @@ export default { this.form = item; }, //选择地区 - editRegion(item,index) { - this.selectedIndex = index + editRegion(item, index) { + this.selectedIndex = index; this.item = item; - this.$store.state.shipTemplate = this.form.freightTemplateChildList - this.$refs.region.open(item,index); + this.regions.forEach((addr) => { + this.form.freightTemplateChildList.forEach((child) => { + child.area.split(",").forEach((area) => { + if (addr.name == area) { + addr.selectedAll = true; + this.$set(child, "selectedAll", true); + } + }); + }); + }); + + this.$store.state.shipTemplate = this.form.freightTemplateChildList; + + this.$refs.region.open(item, index); }, //刷细数据 refresh() { @@ -273,9 +290,11 @@ export default { if (child.selectedList != "") { // 只显示省份 - if(child.selectedAll ){ - area += child.name + "," - this.form.freightTemplateChildList[this.selectedIndex].selectedAll = true + if (child.selectedAll) { + area += child.name + ","; + this.form.freightTemplateChildList[ + this.selectedIndex + ].selectedAll = true; } child.selectedList.forEach((son) => { @@ -302,11 +321,16 @@ export default { this.$refs.form.validate((valid) => { const regNumber = /^\+?[1-9][0-9]*$/; - const regMoney = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; + const regMoney = + /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; if (valid) { - if (this.form.pricingMethod != 'FREE') { + if (this.form.pricingMethod != "FREE") { //校验运费模板详细信息 - for (let i = 0; i < this.form.freightTemplateChildList.length; i++) { + for ( + let i = 0; + i < this.form.freightTemplateChildList.length; + i++ + ) { if ( this.form.freightTemplateChildList[i].area == "" || this.form.freightTemplateChildList[i].firstCompany == "" || @@ -324,8 +348,9 @@ export default { regNumber.test( this.form.freightTemplateChildList[i].continuedCompany ) == false || - regMoney.test(this.form.freightTemplateChildList[i].firstPrice) == - false || + regMoney.test( + this.form.freightTemplateChildList[i].firstPrice + ) == false || regMoney.test( this.form.freightTemplateChildList[i].continuedPrice ) == false @@ -335,7 +360,6 @@ export default { } } } - if (this.operation == "ADD") { API_Shop.addShipTemplate(this.form, headers).then((res) => { @@ -372,7 +396,7 @@ export default { firstPrice: "", continuedCompany: "1", continuedPrice: "", - selectedAll:false + selectedAll: false, }; this.form.freightTemplateChildList.push(params); },