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 @@
-
-
+
-
+
-
+
-
+
-
+
-
-
@@ -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 @@
-
加载中...
+
加载中...
-
+
-
+
+
![]()
+
{{ item.name }}
{{ item.description }}
@@ -21,30 +22,26 @@
-
-
@@ -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 @@
-
加载中...
-
+ 加载中...
+
-
-
+
+
-
-
-
-
-
+
+
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
-
+
-
-
-
+
+
+
-
+
{{this.showStoreName}}
-
+
-
+
@@ -143,7 +142,7 @@ export default {
useTable,
planDetail
},
- data () {
+ data() {
const _this = this;
return {
showStoreName: "",
@@ -162,14 +161,14 @@ export default {
shopList: [],
showUse: false,
activityInstance: {},
- qrCodeImage: '',
+ qrCodeImage: "",
formValidate: {
date: null,
organizationId: null,
storeId: null,
status: 2,
startDate: null,
- endDate: null,
+ endDate: null
},
startDateOptions: {},
endDateOptions: {},
@@ -204,7 +203,7 @@ export default {
width: 60,
align: "center",
title: "序号",
- render (h, params) {
+ render(h, params) {
let num = parseInt(params.index) + 1;
console.log(_this.pageSize);
if (_this.pageSize > 1) {
@@ -220,7 +219,7 @@ export default {
{
title: "活动类型",
key: "scheduleVO.name",
- render (h, params) {
+ render(h, params) {
return h("span", params.row["params"][0]["name"]);
}
},
@@ -228,54 +227,54 @@ export default {
title: "活动时间",
key: "beginTime",
width: 230,
- render (h, params) {
+ render(h, params) {
return h("span", params.row.beginTime + " - " + params.row.endTime);
}
},
{
title: "零售公司",
key: "shop",
- render (h, params) {
+ render(h, params) {
return h(
"span",
params.row.companyName +
- "等" +
- (params.row.companyCount || 0) +
- "家公司"
+ "等" +
+ (params.row.companyCount || 0) +
+ "家公司"
);
}
},
{
title: "店铺",
key: "shop",
- render (h, params) {
+ render(h, params) {
return h(
"span",
params.row.storeName +
- "等" +
- (params.row.storeCount || 0) +
- "家店铺"
+ "等" +
+ (params.row.storeCount || 0) +
+ "家店铺"
);
}
},
{
title: "添加好友数",
key: "addFriendNum",
- render (h, params) {
+ render(h, params) {
return h("span", (params.row.friends || 0) + "人");
}
},
{
title: "参与活动客户数",
key: "joinActivityClientNum",
- render (h, params) {
+ render(h, params) {
return h("span", (params.row.friends || 0) + "人");
}
},
{
title: "活动码",
- slot: 'qrCodeAction',
- className: 'table-width-80',
+ slot: "qrCodeAction",
+ className: "table-width-80"
// render (h, p) {
// return h(
// "Button",
@@ -290,7 +289,7 @@ export default {
{
title: "活动状态",
key: "status",
- render (h, p) {
+ render(h, p) {
const status = p.row.status;
if (status === 1) return h("span", "未开始");
if (status === 2) return h("span", "进行中");
@@ -300,8 +299,8 @@ export default {
},
{
title: "操作",
- slot: 'action',
- width: 200,
+ slot: "action",
+ width: 200
// render (h, p) {
// let r = [
// h(
@@ -333,30 +332,30 @@ export default {
]
};
},
- mounted () {
+ mounted() {
this.setMenuName("活动管理", "活动计划");
this.getCompanyInfo();
this.getShopInfo();
this.searchTable();
},
methods: {
- doShow (show) {
+ doShow(show) {
this.showUse = show;
this.searchTable();
},
- showDetail (detail) {
+ showDetail(detail) {
let _this = this;
this.getDetail(detail.id).then(res => {
_this.detail = res;
_this.isShowDetail = true;
});
},
- getCompanyInfo () {
+ getCompanyInfo() {
let that = this;
let data = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
};
- ActivityManager.getCompany(data, function (data) {
+ ActivityManager.getCompany(data, function(data) {
that.companyList = [];
data.data.results.forEach(element => {
that.companyList.push({
@@ -366,18 +365,18 @@ export default {
});
});
},
- selectCompany (value) {
+ selectCompany(value) {
this.customerId = value;
this.getShopInfo();
},
- getShopInfo () {
+ getShopInfo() {
let that = this;
let data = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
customerIds: this.customerId,
scheduleId: null
};
- ActivityManager.getShop(data, function (data) {
+ ActivityManager.getShop(data, function(data) {
that.shopList = [];
data.data.results.forEach(element => {
that.shopList.push({
@@ -387,11 +386,14 @@ export default {
});
});
},
- handlePage: function (value) {
+ handlePage: function(value) {
this.pageNum = value;
this.searchTable();
},
- stop (instance) {
+ stop(instance) {
+ if (instance.status > 2) {
+ return;
+ }
let _this = this;
this.$Modal.confirm({
title: "您确认要终止?",
@@ -410,10 +412,10 @@ export default {
}
);
},
- onCancel: () => { }
+ onCancel: () => {}
});
},
- getDetail (instanceId) {
+ getDetail(instanceId) {
return new Promise((resolve, reject) => {
ActivityManager.instanceDetail(
{
@@ -425,7 +427,7 @@ export default {
);
});
},
- modify (instance) {
+ modify(instance) {
let _this = this;
this.getDetail(instance.id).then(res => {
store.commit("SET_useData", res);
@@ -433,13 +435,14 @@ export default {
_this.showUse = true;
});
},
- navigateCode (instance) {
+ navigateCode(instance) {
+ return;
this.$router.push({
path: "/activity/plan/code",
query: { instanceId: instance.id }
});
},
- searchTable (params = {}) {
+ searchTable(params = {}) {
this.loading = true;
if (
this.formValidate.date !== null &&
@@ -463,7 +466,7 @@ export default {
if (params.status == 0) {
params.status = undefined;
}
- params.categoryCode = "promotion"
+ params.categoryCode = "promotion";
params.date = undefined;
http.get("/activity/instance/list", params).then(res => {
const data = res.data.results.this || {};
@@ -472,46 +475,53 @@ export default {
this.loading = false;
});
},
- startDateChange: function (e) {
+ startDateChange: function(e) {
//设置开始时间
this.endDateOptions = {
disabledDate: date => {
- let startTime = this.formValidate.startDate ? new Date(this.formValidate.startDate).valueOf() : '';
- return date && (date.valueOf() < startTime)
+ let startTime = this.formValidate.startDate
+ ? new Date(this.formValidate.startDate).valueOf()
+ : "";
+ return date && date.valueOf() < startTime;
}
- }
+ };
},
- endDateChange: function (e) {
+ endDateChange: function(e) {
//设置结束时间
- let endTime = this.formValidate.endDate ? new Date(this.formValidate.endDate).valueOf() - 1 * 24 * 60 * 60 * 1000 : '';
+ let endTime = this.formValidate.endDate
+ ? new Date(this.formValidate.endDate).valueOf() -
+ 1 * 24 * 60 * 60 * 1000
+ : "";
this.startDateOptions = {
disabledDate: date => {
- return date && (date.valueOf() > endTime);
+ return date && date.valueOf() > endTime;
}
- }
+ };
},
- show: function (index) {
+ show: function(index) {
this.isShow = true;
this.showStoreName = index.name;
this.qrCodeImage = index.qrCodeAction;
this.rowData = index;
},
- hide: function () {
+ hide: function() {
this.isShow = false;
},
// 下载二维码
- download: function (index) {
- debugger
+ download: function(index) {
+ debugger;
let fileName = index.name + "-门店码";
- http.downloadImg({
- url: index.qrCodeAction
- }, fileName, function (/*data*/) {
-
- })
+ http.downloadImg(
+ {
+ url: index.qrCodeAction
+ },
+ fileName,
+ function(/*data*/) {}
+ );
},
- ok: function () {
+ ok: function() {
this.isShow = false;
- },
+ }
}
};
@@ -528,6 +538,9 @@ export default {
color: #3496eb !important;
margin-left: -15px;
}
+.router-btn.disable {
+ color: #999 !important;
+}
.table-img-qr-code {
margin-left: 5px;
margin-top: 5px;
diff --git a/src/pages/activity/addActivity.vue b/src/pages/activity/addActivity.vue
index c99ad5e..6487540 100644
--- a/src/pages/activity/addActivity.vue
+++ b/src/pages/activity/addActivity.vue
@@ -1,5 +1,12 @@
-
+
配置活动
@@ -176,6 +183,11 @@ export default {
this.formValidate.params.splice(index, 1);
this.$forceUpdate();
},
+ visibleChange(show) {
+ if (!show) {
+ this.$emit("dispalyAddActivityModal", false, false);
+ }
+ },
cancel() {
this.$emit("dispalyAddActivityModal", false, false);
},
diff --git a/src/pages/activity/useTable.vue b/src/pages/activity/useTable.vue
index 96eb9f7..ea43047 100644
--- a/src/pages/activity/useTable.vue
+++ b/src/pages/activity/useTable.vue
@@ -1,49 +1,46 @@
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
@@ -55,20 +52,21 @@ import useActivityStepThree from "./useActivityStepThree";
import useActivityStepFoure from "./useActivityStepFoure";
import ActivityManager from "../../services/ActivityManager/ActivityManager";
import store from "../../store/index";
-import { formatDate } from '../../utils/Common';
+import { formatDate } from "../../utils/Common";
export default {
name: "useTable",
components: {
useActivityStepOne,
useActivityStepTwo,
useActivityStepThree,
- useActivityStepFoure,
+ useActivityStepFoure
},
- data () {
+ inject: ["setMenuName"],
+ data() {
return {
currentStep: 0,
modal_loading: false,
- showUse: false,
+ showUse: false
};
},
props: {
@@ -85,26 +83,27 @@ export default {
}
},
watch: {
- show () {
+ show() {
this.showUse = this.show;
},
- schedule () {
+ schedule() {
store.getters.useData.scheduleId = this.schedule.id;
- },
+ }
},
- mounted () { },
+ created() {
+ this.setMenuName("活动管理", "活动计划");
+ },
+ mounted() {},
methods: {
- cancel () {
- this.currentStep = 0;
- },
- cancel () {
+ visibleChange(show) {},
+ cancel() {
store.commit("RSET_useData");
this.$emit("doShow", false);
this.modal_loading = false;
this.showUse = false;
this.currentStep = 0;
},
- next () {
+ next() {
let data = store.getters.useData;
data.name = this.schedule.name;
if (this.currentStep === 0) {
@@ -143,19 +142,19 @@ export default {
if (typeof data.endTime == "object") {
data.endTime = formatDate(data.endTime);
}
- console.log("data", data)
+ console.log("data", data);
store.commit("SET_useData", data);
this.currentStep = this.currentStep + 1;
},
- back () {
+ back() {
this.currentStep = this.currentStep - 1;
},
- finish () {
+ finish() {
let that = this;
let data = store.getters.useData;
data.isGetActivityInfo = true;
this.modal_loading = true;
- ActivityManager.saveActivityData(store.getters.useData, function (data) {
+ ActivityManager.saveActivityData(store.getters.useData, function(data) {
store.commit("RSET_useData");
that.$emit("doShow", false);
that.$router.push("/activity/plan");
@@ -163,8 +162,8 @@ export default {
that.modal_loading = false;
that.showUse = false;
});
- },
- },
+ }
+ }
};
diff --git a/src/pages/shop/IncreaseWelcomeEdit.vue b/src/pages/shop/IncreaseWelcomeEdit.vue
index b1e80e6..9fde391 100644
--- a/src/pages/shop/IncreaseWelcomeEdit.vue
+++ b/src/pages/shop/IncreaseWelcomeEdit.vue
@@ -85,7 +85,7 @@
-
+
-
+
-
+
@@ -260,6 +260,21 @@ export default {
selectStoreStep
},
methods: {
+ webFilter() {
+ return (
+ this._.filter(this.welcome.params, item => item.type == 2).length < 1
+ );
+ },
+ imageFilter() {
+ return (
+ this._.filter(this.welcome.params, item => item.type == 1).length < 1
+ );
+ },
+ miniFilter() {
+ return (
+ this._.filter(this.welcome.params, item => item.type == 3).length < 1
+ );
+ },
doShow() {
this.showStoreCheck = false;
this.welcome = store.getters.useData;
@@ -423,6 +438,39 @@ export default {
_this.loading = false;
return false;
}
+ // let params = this.welcome.params;
+ // let imageCount = 0;
+ // let webCount = 0;
+ // let miniCount = 0;
+ // for (const key in params) {
+ // if (params.hasOwnProperty(key)) {
+ // const element = params[key];
+ // if (element.type == 1) {
+ // imageCount++;
+ // }
+ // if (element.type == 2) {
+ // webCount++;
+ // }
+ // if (element.type == 3) {
+ // miniCount++;
+ // }
+ // }
+ // }
+ // if (imageCount > 1) {
+ // _this.loading = false;
+ // _this.$Message.error("图片消息只能一个");
+ // return false;
+ // }
+ // if (webCount > 1) {
+ // _this.loading = false;
+ // _this.$Message.error("网页消息只能一个");
+ // return false;
+ // }
+ // if (miniCount > 1) {
+ // _this.loading = false;
+ // _this.$Message.error("小程序消息只能一个");
+ // return false;
+ // }
this.$refs["welcomeForm"].validate(valid => {
if (valid) {
let data = _this.welcome;
From f86657a7e90b93d1bbf7cf00bbbb276d1320fc9f Mon Sep 17 00:00:00 2001
From: liuyang <396235408@qq.com>
Date: Thu, 4 Jun 2020 23:10:06 +0800
Subject: [PATCH 4/4] 1
---
src/pages/activity/ActivityPlan.vue | 8 +++-
src/pages/recruit/BulletinIndex.vue | 69 +++++++++++++++++++++++------
src/services/recruit/Bulletin.js | 5 +++
3 files changed, 67 insertions(+), 15 deletions(-)
diff --git a/src/pages/activity/ActivityPlan.vue b/src/pages/activity/ActivityPlan.vue
index cc36071..a6608a9 100644
--- a/src/pages/activity/ActivityPlan.vue
+++ b/src/pages/activity/ActivityPlan.vue
@@ -74,7 +74,8 @@
slot-scope="{row}">
@@ -528,6 +529,11 @@ export default {
color: #3496eb !important;
margin-left: -15px;
}
+.router-btn-gray {
+ border: none;
+ color: #666 !important;
+ margin-left: -15px;
+}
.table-img-qr-code {
margin-left: 5px;
margin-top: 5px;
diff --git a/src/pages/recruit/BulletinIndex.vue b/src/pages/recruit/BulletinIndex.vue
index 04d3de3..a5fbbfd 100644
--- a/src/pages/recruit/BulletinIndex.vue
+++ b/src/pages/recruit/BulletinIndex.vue
@@ -11,7 +11,7 @@
修改
-
+
开启
关闭
@@ -52,8 +52,9 @@ import selectStoreStep from '../activity/selectStoreStep'
import store from '../../store'
import bulletinService from '../../services/recruit/Bulletin'
import http from '../../services/CommonHttp';
+import axios from "axios";
export default {
-
+ inject:['reload'],
components: {
selectStoreStep,
},
@@ -69,7 +70,9 @@ export default {
inidData:{},
showUpload:false,
btnStr:'编辑',
- imgUrl:''
+ imgUrl:'',
+ onWitch:false,
+ uploadUrl:""
};
},
mounted: function() {
@@ -79,15 +82,17 @@ export default {
this.initData();
},
methods: {
+ witchChange(status) {
+ this.onWitch = status;
+ },
initData(){
let that = this;
bulletinService.getDetail({}, function (data) {
console.log(data);
- data.data.results.scheduleVO.params.forEach(item => {
- item.defaultVal = http.getBaseUrl() + item.defaultVal;
- });
+ if(data.data.results.scheduleVO.params.length>0){
+ that.imgUrl = http.getBaseUrl() + data.data.results.scheduleVO.params[0].defaultVal;
+ }
that.initData = data.data.results;
- that.imgUrl = that.initData.scheduleVO.params[0].defaultVal
}, function (err) {
that.$Message.error("网络异常,请重试");
@@ -97,10 +102,7 @@ export default {
doShow () {
this.showStoreCheck = false
this.welcome = store.getters.useData
- console.log(this.welcome)
- },
- change (status) {
- this.$Message.info('开关状态:' + status);
+ console.log(this.welcome);
},
showStores () {
console.log({ ...store.getters.useData, ...this.welcome })
@@ -108,8 +110,44 @@ export default {
this.showStoreCheck = true
},
onEdit(){
- this.showUpload = true;
- this.btnStr = '保存'
+ if(this.btnStr == '编辑'){
+ this.showUpload = true;
+ this.btnStr = '保存'
+ }else{
+ this.initData.isGetActivityInfo = true;
+ try{
+ if(this.welcome.stores.length>0){
+ this.initData.stores = this.welcome.stores;
+ }
+ }catch(e){
+ console.log(e);
+ }
+ if(this.onWitch){
+ this.initData.status = 1;
+ this.initData.stores.forEach(item => {
+ item.status = 1;
+ })
+ }else{
+ this.initData.status = 3;
+ this.initData.stores.forEach(item => {
+ item.status = 2;
+ })
+ }
+ if(this.uploadUrl != ""){
+ this.initData.scheduleVO.params.forEach(item => {
+ item.defaultVal = item.description = this.uploadUrl;
+
+ })
+ }
+ let that = this;
+ bulletinService.dosave(this.initData, function (data) {
+ console.log(data);
+ that.reload();
+ }, function (err) {
+ that.$Message.error("网络异常,请重试");
+ that.setNoLoading();
+ });
+ }
},
onCancel(){
this.showUpload = false;
@@ -119,7 +157,7 @@ export default {
this.imageName = file.name;
},
handleBeforeUpload (res) {
- const me = this;
+ const _this = this;
let data = new FormData();
data.append("file", res);
axios({
@@ -131,6 +169,9 @@ export default {
},
}).then(function (res) {
if (res.data.success) {
+ console.log(res);
+ _this.uploadUrl = res.data.results.localPath;
+ _this.imgUrl = http.getBaseUrl() + res.data.results.localPath;
}
});
return false;
diff --git a/src/services/recruit/Bulletin.js b/src/services/recruit/Bulletin.js
index d511b9d..4f4da1c 100644
--- a/src/services/recruit/Bulletin.js
+++ b/src/services/recruit/Bulletin.js
@@ -5,6 +5,11 @@ export function getDetail(params, call) {
return http.get('/fission/detail', params).then(call)
}
+export function dosave(params, call) {
+ return http.post('/fission/save', params).then(call)
+}
+
export default {
getDetail,
+ dosave
}