From 4e3e08705adfa1370a620f1267f59ec70ff62ba5 Mon Sep 17 00:00:00 2001 From: zhenghuang <236220500@qq.com> Date: Thu, 4 Jun 2020 13:56:12 +0800 Subject: [PATCH 1/4] 1 --- src/pages/activity/selectStoreStep.vue | 6 +- src/pages/shop/IncreaseWelcomeEdit.vue | 300 +++++++++++++++---------- src/pages/shop/IncreaseWelcomeList.vue | 33 ++- 3 files changed, 211 insertions(+), 128 deletions(-) diff --git a/src/pages/activity/selectStoreStep.vue b/src/pages/activity/selectStoreStep.vue index 01c0977..cf11fe8 100644 --- a/src/pages/activity/selectStoreStep.vue +++ b/src/pages/activity/selectStoreStep.vue @@ -2,7 +2,7 @@
@@ -69,6 +69,10 @@ export default { isModify: { type: Boolean, default: false + }, + title: { + type: String, + default: "使用活动" } }, watch: { diff --git a/src/pages/shop/IncreaseWelcomeEdit.vue b/src/pages/shop/IncreaseWelcomeEdit.vue index 4ae5617..7efe419 100644 --- a/src/pages/shop/IncreaseWelcomeEdit.vue +++ b/src/pages/shop/IncreaseWelcomeEdit.vue @@ -2,167 +2,227 @@
-
- - + + + - +
- 标题 {{ index + 1 }} + 标题 {{ index + 1 }} - + - APPID {{ index + 1 }} + APPID {{ index + 1 }} - + - URI {{ index + 1 }} + URI {{ index + 1 }} - + - MediaId{{ index + 1 }} + MediaId{{ index + 1 }} - +
- 标题 {{ index + 1 }} - - + 标题 {{ index + 1 }} + + - URL {{ index + 1 }} - - + URL {{ index + 1 }} + +
- {{ item.name }}{{ index + 1 }} + {{ item.name }}{{ index + 1 }} - +
- +
- + - {{ welcome.stores[0].name }}等{{ welcome.stores.length }}家店铺 - + {{ welcome.stores[0].name }}等{{ welcome.stores.length }}家店铺 + - +
- + - +
- +
- + - +
- -
- - + + + + - - + +
- - + +
- -
- - + + + + - - + + - - + + - +
请上传图片 - +
- - + +
- +
@@ -181,7 +241,7 @@ const validateUrl = (rule, value, callback) => { } }; export default { - data() { + data () { return { showStoreCheck: false, showWeb: false, @@ -226,7 +286,7 @@ export default { }, watch: { welcome: { - handler() { + handler () { store.commit("SET_useData", { ...store.getters.useData, ...this.welcome @@ -236,7 +296,7 @@ export default { deep: true } }, - created() { + created () { this.id = this.$route.query.id; // store.commit("SET_useData", { ...store.getters.useData, ...this.welcome }); console.log(this.$route); @@ -248,14 +308,14 @@ export default { selectStoreStep }, methods: { - doShow() { + doShow () { this.showStoreCheck = false; this.welcome = store.getters.useData; }, - onExceededSize() { + onExceededSize () { console.log("失败"); }, - getDetail(instanceId) { + getDetail (instanceId) { let _this = this; ActivityManager.instanceDetail( { @@ -270,7 +330,7 @@ export default { } ); }, - showStores() { + showStores () { console.log({ ...store.getters.useData, ...this.welcome }); store.commit("SET_useData", { ...this.welcome, @@ -278,16 +338,16 @@ export default { }); this.showStoreCheck = true; }, - uploadImgSuccess(res, file) {}, - miniUploadImgSuccess(res, file) {}, - cancelWeb() { + uploadImgSuccess (res, file) { }, + miniUploadImgSuccess (res, file) { }, + cancelWeb () { this.showWeb = false; }, - doShowWeb() { + doShowWeb () { this.showWeb = true; this.webForm = { url: "", title: "" }; }, - doShowMini() { + doShowMini () { this.showMini = true; this.miniForm = { appid: "", @@ -297,10 +357,10 @@ export default { key: "" }; }, - cancelMini() { + cancelMini () { this.showMini = false; }, - okWeb() { + okWeb () { let _this = this; this.$refs["webForm"].validate(valid => { if (valid) { @@ -320,7 +380,7 @@ export default { } }); }, - okMini() { + okMini () { let _this = this; this.$refs["miniForm"].validate(valid => { if (valid) { @@ -340,11 +400,11 @@ export default { } }); }, - delActivityInput(index) { + delActivityInput (index) { this.welcome.params.splice(index, 1); this.$forceUpdate(); }, - handleBeforeUploadMini(res) { + handleBeforeUploadMini (res) { const me = this; let data = new FormData(); data.append("file", res); @@ -358,7 +418,7 @@ export default { headers: { "Content-Type": "multipart/form-data" } - }).then(function(res) { + }).then(function (res) { me.imageUploading = false; if (res.data.success) { // me.formValidate.logo = res.data.results; @@ -369,7 +429,7 @@ export default { }); return false; }, - handleBeforeUpload(res) { + handleBeforeUpload (res) { const me = this; let data = new FormData(); data.append("file", res); @@ -383,7 +443,7 @@ export default { headers: { "Content-Type": "multipart/form-data" } - }).then(function(res) { + }).then(function (res) { me.imageUploading = false; if (res.data.success) { // me.formValidate.logo = res.data.results; @@ -403,7 +463,7 @@ export default { }); return false; }, - submit() { + submit () { let _this = this; if (this.welcome.stores.length <= 0) { _this.$Message.error("请至少选择一个店铺"); diff --git a/src/pages/shop/IncreaseWelcomeList.vue b/src/pages/shop/IncreaseWelcomeList.vue index 7141655..ca09543 100644 --- a/src/pages/shop/IncreaseWelcomeList.vue +++ b/src/pages/shop/IncreaseWelcomeList.vue @@ -17,12 +17,16 @@ size="small"> - + From 91db056057a208103d85b0fc63c2d7d63c0a0502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E7=9A=87?= <236220500@qq.com> Date: Thu, 4 Jun 2020 17:55:25 +0800 Subject: [PATCH 2/4] 1 --- src/pages/shop/IncreaseWelcomeEdit.vue | 311 +++++++++++-------------- 1 file changed, 133 insertions(+), 178 deletions(-) diff --git a/src/pages/shop/IncreaseWelcomeEdit.vue b/src/pages/shop/IncreaseWelcomeEdit.vue index 7efe419..b1e80e6 100644 --- a/src/pages/shop/IncreaseWelcomeEdit.vue +++ b/src/pages/shop/IncreaseWelcomeEdit.vue @@ -2,227 +2,178 @@
-
- - + + + - +
- 标题 {{ index + 1 }} + 标题 {{ index + 1 }} - + - APPID {{ index + 1 }} + APPID {{ index + 1 }} - + - URI {{ index + 1 }} + URI {{ index + 1 }} - + - MediaId{{ index + 1 }} + MediaId{{ index + 1 }} - +
- 标题 {{ index + 1 }} + 标题 {{ index + 1 }} - + - URL {{ index + 1 }} + URL {{ index + 1 }} - +
- {{ item.name }}{{ index + 1 }} + {{ item.name }}{{ index + 1 }} - +
- +
- + - {{ welcome.stores[0].name }}等{{ welcome.stores.length }}家店铺 - + {{ welcome.stores[0].name }}等{{ welcome.stores.length }}家店铺 + - +
- + - +
- +
- + - +
- -
- - + + + + - - + +
- - + +
- -
- - + + + + - - + + - - + + - +
请上传图片 - +
- - + +
- +
@@ -241,7 +192,7 @@ const validateUrl = (rule, value, callback) => { } }; export default { - data () { + data() { return { showStoreCheck: false, showWeb: false, @@ -249,6 +200,7 @@ export default { id: 0, showMessageTypes: false, imageUploading: false, + loading: false, welcome: { content: "", params: [], @@ -286,7 +238,7 @@ export default { }, watch: { welcome: { - handler () { + handler() { store.commit("SET_useData", { ...store.getters.useData, ...this.welcome @@ -296,7 +248,7 @@ export default { deep: true } }, - created () { + created() { this.id = this.$route.query.id; // store.commit("SET_useData", { ...store.getters.useData, ...this.welcome }); console.log(this.$route); @@ -308,14 +260,14 @@ export default { selectStoreStep }, methods: { - doShow () { + doShow() { this.showStoreCheck = false; this.welcome = store.getters.useData; }, - onExceededSize () { + onExceededSize() { console.log("失败"); }, - getDetail (instanceId) { + getDetail(instanceId) { let _this = this; ActivityManager.instanceDetail( { @@ -330,7 +282,7 @@ export default { } ); }, - showStores () { + showStores() { console.log({ ...store.getters.useData, ...this.welcome }); store.commit("SET_useData", { ...this.welcome, @@ -338,16 +290,16 @@ export default { }); this.showStoreCheck = true; }, - uploadImgSuccess (res, file) { }, - miniUploadImgSuccess (res, file) { }, - cancelWeb () { + uploadImgSuccess(res, file) {}, + miniUploadImgSuccess(res, file) {}, + cancelWeb() { this.showWeb = false; }, - doShowWeb () { + doShowWeb() { this.showWeb = true; this.webForm = { url: "", title: "" }; }, - doShowMini () { + doShowMini() { this.showMini = true; this.miniForm = { appid: "", @@ -357,10 +309,10 @@ export default { key: "" }; }, - cancelMini () { + cancelMini() { this.showMini = false; }, - okWeb () { + okWeb() { let _this = this; this.$refs["webForm"].validate(valid => { if (valid) { @@ -380,7 +332,7 @@ export default { } }); }, - okMini () { + okMini() { let _this = this; this.$refs["miniForm"].validate(valid => { if (valid) { @@ -400,11 +352,11 @@ export default { } }); }, - delActivityInput (index) { + delActivityInput(index) { this.welcome.params.splice(index, 1); this.$forceUpdate(); }, - handleBeforeUploadMini (res) { + handleBeforeUploadMini(res) { const me = this; let data = new FormData(); data.append("file", res); @@ -418,7 +370,7 @@ export default { headers: { "Content-Type": "multipart/form-data" } - }).then(function (res) { + }).then(function(res) { me.imageUploading = false; if (res.data.success) { // me.formValidate.logo = res.data.results; @@ -429,7 +381,7 @@ export default { }); return false; }, - handleBeforeUpload (res) { + handleBeforeUpload(res) { const me = this; let data = new FormData(); data.append("file", res); @@ -443,7 +395,7 @@ export default { headers: { "Content-Type": "multipart/form-data" } - }).then(function (res) { + }).then(function(res) { me.imageUploading = false; if (res.data.success) { // me.formValidate.logo = res.data.results; @@ -463,10 +415,12 @@ export default { }); return false; }, - submit () { + submit() { let _this = this; + _this.loading = true; if (this.welcome.stores.length <= 0) { _this.$Message.error("请至少选择一个店铺"); + _this.loading = false; return false; } this.$refs["welcomeForm"].validate(valid => { @@ -481,6 +435,7 @@ export default { "Content-Type": "applications/json" } }).then(res => { + _this.loading = false; _this.$router.push("/shop/increase/welcome/list"); }); } From 18a18687efb4b8e5682fdcff85fbe29d5e2f27e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E7=9A=87?= <236220500@qq.com> Date: Thu, 4 Jun 2020 22:50:03 +0800 Subject: [PATCH 3/4] 1 --- src/pages/activity/ActivityManager.vue | 92 ++++---- src/pages/activity/ActivityPlan.vue | 299 +++++++++++++------------ src/pages/activity/addActivity.vue | 14 +- src/pages/activity/useTable.vue | 119 +++++----- src/pages/shop/IncreaseWelcomeEdit.vue | 54 ++++- 5 files changed, 325 insertions(+), 253 deletions(-) diff --git a/src/pages/activity/ActivityManager.vue b/src/pages/activity/ActivityManager.vue index 9eb70d0..8f255bf 100644 --- a/src/pages/activity/ActivityManager.vue +++ b/src/pages/activity/ActivityManager.vue @@ -1,19 +1,20 @@ @@ -52,16 +49,16 @@ import useTable from "./useTable"; import addActivity from "./addActivity"; import ActivityManager from "../../services/ActivityManager/ActivityManager"; -import store from '../../store'; +import store from "../../store"; export default { name: "ActivityManager", components: { useTable, - addActivity, + addActivity }, inject: ["setMenuName"], - data () { + data() { return { showUse: false, addActivityModal: false, @@ -73,72 +70,75 @@ export default { roleCode: "" }; }, - created () { - store.commit("RSET_useData") + created() { + store.commit("RSET_useData"); }, - mounted () { + mounted() { this.setMenuName("活动管理", "活动池"); this.getActivityTable(); this.roleCode = sessionStorage.getItem("roleCode"); }, methods: { - doShow (show) { + doShow(show) { this.showUse = show; }, - getActivityData (id) { + getActivityData(id) { let that = this; let data = { - instanceId: id, + instanceId: id }; that.loading = true; - ActivityManager.getActivityInfo(data, function (data) { + ActivityManager.getActivityInfo(data, function(data) { that.inputActivityList = []; - data.data.results.params.forEach((item) => { + data.data.results.params.forEach(item => { that.inputActivityList.push({ value1: item.name, - value2: item.description, + value2: item.description }); }); this.useModal = true; that.loading = false; }); }, - getActivityTable () { + getActivityTable() { let that = this; - ActivityManager.getActivityList({ categoryCode: "promotion" }, function (data) { + ActivityManager.getActivityList({ categoryCode: "promotion" }, function( + data + ) { that.activityList = data.data.results; }); }, - disPlayUseTable (item) { + disPlayUseTable(item) { + console.log("disPlayUseTable"); let that = this; let data = { - id: item.id, + id: item.id }; // let data = new FormData() // data.append('instanceId', item.id) - ActivityManager.getActivityInfo(data, function (data) { + ActivityManager.getActivityInfo(data, function(data) { that.useSchedule = data.data.results; that.showUse = true; - that.$forceUpdate() + that.$forceUpdate(); }); }, - dispalyAddActivity (id) { + dispalyAddActivity(id) { this.addActivityModal = true; this.id = id.toString(); }, - dispalyuseModal (displayModalFlag, isCancle) { + dispalyuseModal(displayModalFlag, isCancle) { this.useModal = displayModalFlag; if (isCancle === true) { this.getActivityTable(); } }, - dispalyAddActivityModal (displayModalFlag, isCancle) { + dispalyAddActivityModal(displayModalFlag, isCancle) { this.addActivityModal = displayModalFlag; if (isCancle === true) { this.getActivityTable(); } - }, - }, + } + } }; diff --git a/src/pages/activity/ActivityPlan.vue b/src/pages/activity/ActivityPlan.vue index cc36071..f6d4ebb 100644 --- a/src/pages/activity/ActivityPlan.vue +++ b/src/pages/activity/ActivityPlan.vue @@ -1,129 +1,128 @@