From e83a02fb9e75221828cd9ddfb5f258d8c9bdf4d7 Mon Sep 17 00:00:00 2001
From: zhenghuang <236220500@qq.com>
Date: Fri, 5 Jun 2020 09:20:49 +0800
Subject: [PATCH 01/10] 1
---
src/pages/shop/IncreaseWelcomeEdit.vue | 328 ++++++++++++++-----------
1 file changed, 183 insertions(+), 145 deletions(-)
diff --git a/src/pages/shop/IncreaseWelcomeEdit.vue b/src/pages/shop/IncreaseWelcomeEdit.vue
index 9fde391..531cf9b 100644
--- a/src/pages/shop/IncreaseWelcomeEdit.vue
+++ b/src/pages/shop/IncreaseWelcomeEdit.vue
@@ -2,178 +2,228 @@
-
-
+
-
-
+
+
-
+
-
+
-
+
-
-
@@ -192,7 +242,7 @@ const validateUrl = (rule, value, callback) => {
}
};
export default {
- data() {
+ data () {
return {
showStoreCheck: false,
showWeb: false,
@@ -238,7 +288,7 @@ export default {
},
watch: {
welcome: {
- handler() {
+ handler () {
store.commit("SET_useData", {
...store.getters.useData,
...this.welcome
@@ -248,7 +298,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);
@@ -260,29 +310,17 @@ 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
- );
+ paramFilter () {
+ return this.welcome.params.length < 1;
},
- doShow() {
+ doShow () {
this.showStoreCheck = false;
this.welcome = store.getters.useData;
},
- onExceededSize() {
+ onExceededSize () {
console.log("失败");
},
- getDetail(instanceId) {
+ getDetail (instanceId) {
let _this = this;
ActivityManager.instanceDetail(
{
@@ -297,7 +335,7 @@ export default {
}
);
},
- showStores() {
+ showStores () {
console.log({ ...store.getters.useData, ...this.welcome });
store.commit("SET_useData", {
...this.welcome,
@@ -305,16 +343,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: "",
@@ -324,10 +362,10 @@ export default {
key: ""
};
},
- cancelMini() {
+ cancelMini () {
this.showMini = false;
},
- okWeb() {
+ okWeb () {
let _this = this;
this.$refs["webForm"].validate(valid => {
if (valid) {
@@ -347,7 +385,7 @@ export default {
}
});
},
- okMini() {
+ okMini () {
let _this = this;
this.$refs["miniForm"].validate(valid => {
if (valid) {
@@ -367,11 +405,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);
@@ -385,7 +423,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;
@@ -396,7 +434,7 @@ export default {
});
return false;
},
- handleBeforeUpload(res) {
+ handleBeforeUpload (res) {
const me = this;
let data = new FormData();
data.append("file", res);
@@ -410,7 +448,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;
@@ -430,7 +468,7 @@ export default {
});
return false;
},
- submit() {
+ submit () {
let _this = this;
_this.loading = true;
if (this.welcome.stores.length <= 0) {
From 9589780eb71b46b9879479f9118f91ae7728db9e Mon Sep 17 00:00:00 2001
From: zhenghuang <236220500@qq.com>
Date: Fri, 5 Jun 2020 09:34:48 +0800
Subject: [PATCH 02/10] 1
---
src/pages/Home.vue | 672 +++++++++++++++++---------------
src/pages/activity/useTable.vue | 104 ++---
2 files changed, 403 insertions(+), 373 deletions(-)
diff --git a/src/pages/Home.vue b/src/pages/Home.vue
index 35fa918..f1f5001 100644
--- a/src/pages/Home.vue
+++ b/src/pages/Home.vue
@@ -1,341 +1,367 @@
-
-
-
+
+
+
-
-
-
-
-
-
退出登录
-

-
-
-
-
优客后台管理
-
+
+
+
+
+
+
退出登录
+

+
+
+
+
优客后台管理
+
-
-
-
-
-
-
- {{selectedMenu}}
- {{selectedSubMenu}}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{selectedMenu}}
+ {{selectedSubMenu}}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/activity/useTable.vue b/src/pages/activity/useTable.vue
index ea43047..41dce79 100644
--- a/src/pages/activity/useTable.vue
+++ b/src/pages/activity/useTable.vue
@@ -1,46 +1,50 @@
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
@@ -62,7 +66,7 @@ export default {
useActivityStepFoure
},
inject: ["setMenuName"],
- data() {
+ data () {
return {
currentStep: 0,
modal_loading: false,
@@ -83,27 +87,26 @@ export default {
}
},
watch: {
- show() {
+ show () {
this.showUse = this.show;
},
- schedule() {
+ schedule () {
store.getters.useData.scheduleId = this.schedule.id;
}
},
- created() {
- this.setMenuName("活动管理", "活动计划");
+ created () {
},
- mounted() {},
+ mounted () { },
methods: {
- visibleChange(show) {},
- 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) {
@@ -146,17 +149,18 @@ export default {
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.setMenuName("活动管理", "活动计划");
that.$router.push("/activity/plan");
that.currentStep = 0;
that.modal_loading = false;
From 5e47dd1240078902f6df40c02baf938f8575dd3b Mon Sep 17 00:00:00 2001
From: cuijie
Date: Fri, 5 Jun 2020 17:01:20 +0800
Subject: [PATCH 03/10] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=B1=A0=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/flexible.js | 118 +++++++++++++++++++++++++
src/main.js | 3 +-
src/pages/shop/IncreaseWelcomeList.vue | 2 +-
3 files changed, 120 insertions(+), 3 deletions(-)
create mode 100644 src/flexible.js
diff --git a/src/flexible.js b/src/flexible.js
new file mode 100644
index 0000000..3e046c7
--- /dev/null
+++ b/src/flexible.js
@@ -0,0 +1,118 @@
+
+;(function(win, lib) {
+ var doc = win.document;
+ var docEl = doc.documentElement;
+ var metaEl = doc.querySelector('meta[name="viewport"]');
+ var flexibleEl = doc.querySelector('meta[name="flexible"]');
+ var dpr = 0;
+ var scale = 0;
+ var tid;
+ var flexible = lib.flexible || (lib.flexible = {});
+
+ if (metaEl) {
+ console.warn('将根据已有的meta标签来设置缩放比例');
+ var match = metaEl.getAttribute('content').match(/initial\-scale=([\d\.]+)/);
+ if (match) {
+ scale = parseFloat(match[1]);
+ dpr = parseInt(1 / scale);
+ }
+ } else if (flexibleEl) {
+ var content = flexibleEl.getAttribute('content');
+ if (content) {
+ var initialDpr = content.match(/initial\-dpr=([\d\.]+)/);
+ var maximumDpr = content.match(/maximum\-dpr=([\d\.]+)/);
+ if (initialDpr) {
+ dpr = parseFloat(initialDpr[1]);
+ scale = parseFloat((1 / dpr).toFixed(2));
+ }
+ if (maximumDpr) {
+ dpr = parseFloat(maximumDpr[1]);
+ scale = parseFloat((1 / dpr).toFixed(2));
+ }
+ }
+ }
+
+ if (!dpr && !scale) {
+ var isAndroid = win.navigator.appVersion.match(/android/gi);
+ var isIPhone = win.navigator.appVersion.match(/iphone/gi);
+ var devicePixelRatio = win.devicePixelRatio;
+ if (isIPhone) {
+ // iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案
+ if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
+ dpr = 3;
+ } else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)){
+ dpr = 2;
+ } else {
+ dpr = 1;
+ }
+ } else {
+ // 其他设备下,仍旧使用1倍的方案
+ dpr = 1;
+ }
+ scale = 1 / dpr;
+ }
+
+ docEl.setAttribute('data-dpr', dpr);
+ if (!metaEl) {
+ metaEl = doc.createElement('meta');
+ metaEl.setAttribute('name', 'viewport');
+ metaEl.setAttribute('content', 'initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
+ if (docEl.firstElementChild) {
+ docEl.firstElementChild.appendChild(metaEl);
+ } else {
+ var wrap = doc.createElement('div');
+ wrap.appendChild(metaEl);
+ doc.write(wrap.innerHTML);
+ }
+ }
+
+ function refreshRem(){
+ var width = docEl.getBoundingClientRect().width;
+ if (width / dpr > 540) {
+ width = width * dpr;
+ }
+ var rem = width / 10;
+ docEl.style.fontSize = rem + 'px';
+ flexible.rem = win.rem = rem;
+ }
+
+ win.addEventListener('resize', function() {
+ clearTimeout(tid);
+ tid = setTimeout(refreshRem, 300);
+ }, false);
+ win.addEventListener('pageshow', function(e) {
+ if (e.persisted) {
+ clearTimeout(tid);
+ tid = setTimeout(refreshRem, 300);
+ }
+ }, false);
+
+ if (doc.readyState === 'complete') {
+ doc.body.style.fontSize = 12 * dpr + 'px';
+ } else {
+ doc.addEventListener('DOMContentLoaded', function(e) {
+ doc.body.style.fontSize = 12 * dpr + 'px';
+ }, false);
+ }
+
+
+ refreshRem();
+
+ flexible.dpr = win.dpr = dpr;
+ flexible.refreshRem = refreshRem;
+ flexible.rem2px = function(d) {
+ var val = parseFloat(d) * this.rem;
+ if (typeof d === 'string' && d.match(/rem$/)) {
+ val += 'px';
+ }
+ return val;
+ }
+ flexible.px2rem = function(d) {
+ var val = parseFloat(d) / this.rem;
+ if (typeof d === 'string' && d.match(/px$/)) {
+ val += 'rem';
+ }
+ return val;
+ }
+
+})(window, window['lib'] || (window['lib'] = {}));
diff --git a/src/main.js b/src/main.js
index 0f8ceaa..a2e4a34 100644
--- a/src/main.js
+++ b/src/main.js
@@ -7,14 +7,13 @@ import axios from "axios";
import QS from "qs";
import "./iview";
import "./vcharts";
-import "lib-flexible/flexible";
+import "./flexible";
import _ from "lodash";
Vue.prototype.$axios = axios;
Vue.prototype.$qs = QS;
Vue.prototype.$moment = moment;
Vue.config.productionTip = false;
-Vue.prototype.$moment = moment;
Vue.prototype._ = _;
import echarts from "echarts";
diff --git a/src/pages/shop/IncreaseWelcomeList.vue b/src/pages/shop/IncreaseWelcomeList.vue
index ca09543..326ac2e 100644
--- a/src/pages/shop/IncreaseWelcomeList.vue
+++ b/src/pages/shop/IncreaseWelcomeList.vue
@@ -204,6 +204,6 @@ export default {
height: 30px;
}
button:hover {
- background: inherit !important;
+ /*background: inherit !important;*/
}
From 439620fdb6afc1b0f27484926ad7ef25eba79cc4 Mon Sep 17 00:00:00 2001
From: liuyang <396235408@qq.com>
Date: Fri, 5 Jun 2020 21:07:14 +0800
Subject: [PATCH 04/10] 1
---
src/pages/recruit/BulletinIndex.vue | 12 +++++++++---
src/pages/recruit/CheckList.vue | 5 ++++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/pages/recruit/BulletinIndex.vue b/src/pages/recruit/BulletinIndex.vue
index a5fbbfd..75eaa5e 100644
--- a/src/pages/recruit/BulletinIndex.vue
+++ b/src/pages/recruit/BulletinIndex.vue
@@ -7,7 +7,7 @@
便于门店进行推广员招募
- 使用范围:26家零售公司,785家店铺
+ 使用范围:{{welcome.company.length || 0}}家零售公司,{{welcome.stores.length || 0}}家店铺
修改
@@ -54,7 +54,6 @@ import bulletinService from '../../services/recruit/Bulletin'
import http from '../../services/CommonHttp';
import axios from "axios";
export default {
- inject:['reload'],
components: {
selectStoreStep,
},
@@ -72,7 +71,8 @@ export default {
btnStr:'编辑',
imgUrl:'',
onWitch:false,
- uploadUrl:""
+ uploadUrl:"",
+ oldImg:""
};
},
mounted: function() {
@@ -81,6 +81,7 @@ export default {
created() {
this.initData();
},
+ inject: ['reload'],
methods: {
witchChange(status) {
this.onWitch = status;
@@ -91,6 +92,7 @@ export default {
console.log(data);
if(data.data.results.scheduleVO.params.length>0){
that.imgUrl = http.getBaseUrl() + data.data.results.scheduleVO.params[0].defaultVal;
+ that.oldImg = http.getBaseUrl() + data.data.results.scheduleVO.params[0].defaultVal;
}
that.initData = data.data.results;
@@ -142,6 +144,9 @@ export default {
let that = this;
bulletinService.dosave(this.initData, function (data) {
console.log(data);
+ that.$Message.info("保存成功");
+ that.btnStr = '编辑'
+ that.showUpload = false;
that.reload();
}, function (err) {
that.$Message.error("网络异常,请重试");
@@ -151,6 +156,7 @@ export default {
},
onCancel(){
this.showUpload = false;
+ this.imgUrl = this.oldImg;
this.btnStr = '编辑'
},
uploadImgSuccess (res, file) {
diff --git a/src/pages/recruit/CheckList.vue b/src/pages/recruit/CheckList.vue
index ea5b0be..59faa41 100644
--- a/src/pages/recruit/CheckList.vue
+++ b/src/pages/recruit/CheckList.vue
@@ -29,7 +29,7 @@
+ @click="() => {passShow(row)}">通过审核
Date: Mon, 8 Jun 2020 10:23:42 +0800
Subject: [PATCH 07/10] 1
---
src/pages/activity/addActivity.vue | 187 +++++++++++++++++------------
vue.config.js | 56 ++++-----
2 files changed, 137 insertions(+), 106 deletions(-)
diff --git a/src/pages/activity/addActivity.vue b/src/pages/activity/addActivity.vue
index 6487540..ae682e0 100644
--- a/src/pages/activity/addActivity.vue
+++ b/src/pages/activity/addActivity.vue
@@ -1,96 +1,124 @@
-
-
+
+
配置活动
基本配置
-
+
-
-
-
+
+
+
请上传图片
-
![]()
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
活动类型
-
+
类型{{ index + 1 }}
-
+
-
+
- 删除
+ 删除
- +添加活动类型
+ +添加活动类型
- 取消
- 确定
+ 取消
+ 确定
@@ -99,7 +127,7 @@ import ActivityManager from "../../services/ActivityManager/ActivityManager";
import axios from "axios";
export default {
name: "addActivity",
- data() {
+ data () {
return {
dispalyModal: false,
currentStep: 0,
@@ -114,6 +142,7 @@ export default {
description: [
{ required: true, message: "活动描述不能为空", trigger: "blur" }
],
+ title: [{ required: true, message: "请输入标题", trigger: "blur" }],
appId: [{ required: true, message: "appId不能为空", trigger: "blur" }],
uri: [{ required: true, message: "URI不能为空", trigger: "blur" }],
welcome: [{ required: true, message: "请输入欢迎语", trigger: "blur" }]
@@ -128,7 +157,7 @@ export default {
id: String
},
watch: {
- addActivityModal(val) {
+ addActivityModal (val) {
this.dispalyModal = val;
if (val === true && this.id) {
this.getActivityData();
@@ -157,9 +186,9 @@ export default {
this.$forceUpdate();
}
},
- mounted() {},
+ mounted () { },
methods: {
- addActivityInput() {
+ addActivityInput () {
let params = [...this.formValidate.params];
params.push({
defaultVal: "",
@@ -175,7 +204,7 @@ export default {
this.$set(this.formValidate, "params", params);
this.$forceUpdate();
},
- delActivityInput(index) {
+ delActivityInput (index) {
if (this.formValidate.params.length <= 1) {
this.$Message.error("至少需要填写一个活动类型!");
return;
@@ -183,30 +212,31 @@ export default {
this.formValidate.params.splice(index, 1);
this.$forceUpdate();
},
- visibleChange(show) {
+ visibleChange (show) {
if (!show) {
this.$emit("dispalyAddActivityModal", false, false);
}
},
- cancel() {
+ cancel () {
this.$emit("dispalyAddActivityModal", false, false);
},
- getActivityData() {
+ getActivityData () {
let that = this;
let data = {
id: that.id
};
- ActivityManager.getActivityInfo(data, function(data) {
+ ActivityManager.getActivityInfo(data, function (data) {
that.formValidate = data.data.results;
});
},
- uploadImgSuccess(res, file) {
+ uploadImgSuccess (res, file) {
this.imageName = file.name;
},
- handleBeforeUpload(res) {
+ handleBeforeUpload (res) {
const me = this;
let data = new FormData();
data.append("file", res);
+ data.append("needMediaId", true)
axios({
method: "post",
url: "/upload",
@@ -214,16 +244,17 @@ export default {
headers: {
"Content-Type": "multipart/form-data"
}
- }).then(function(res) {
+ }).then(function (res) {
if (res.data.success) {
// me.formValidate.logo = res.data.results;
me.$set(me.formValidate, "logo", res.data.results.localPath);
+ me.$set(me.formValidate, "mediaId", res.data.results.mediaId);
console.log(me.formValidate.logo);
}
});
return false;
},
- save() {
+ save () {
let that = this;
that.modal_loading = true;
let i = 0;
@@ -263,7 +294,7 @@ export default {
let data = { ...that.formValidate, isGetActivityInfo: true };
data.categoryId = 0;
data.categoryCode = "promotion";
- ActivityManager.addOreditActivity(data, function(data) {
+ ActivityManager.addOreditActivity(data, function (data) {
that.addActivityModal = false;
that.formValidate = {};
that.modal_loading = false;
diff --git a/vue.config.js b/vue.config.js
index 87242cc..b52ccd4 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -5,32 +5,32 @@ module.exports = {
/* 用于默认#模式 */
// publicPath: process.env.NODE_ENV === 'production' ? '/public/' : './',
- /* history模式 */
- publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
- /* 输出文件目录:在npm run build时,生成文件的目录名称 */
- outputDir: 'dist',
- /* 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录 */
- assetsDir: "assets",
- /* 是否在构建生产包时生成 sourceMap 文件,false将提高构建速度 */
- productionSourceMap: false,
- /* 默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存,你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变) */
- filenameHashing: false,
- /* 代码保存时进行eslint检测 */
- lintOnSave: true,
- /* webpack-dev-server 相关配置 */
- devServer: {
- /* 自动打开浏览器 */
- open: true,
- /* 设置为0.0.0.0则所有的地址均能访问 */
- host: '0.0.0.0',
- port: 8311,
- https: false,
- hotOnly: false,
- disableHostCheck: true,
- /* 使用代理 后台接口路径 */
- // proxy: 'http://192.168.1.123:8312/'
- // proxy: 'http://192.168.31.177:8312/'
- proxy: 'http://localhost:8312/'
- // proxy: 'http://jdxdev.vipgz4.idcfengye.com/'
- }
+ /* history模式 */
+ publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
+ /* 输出文件目录:在npm run build时,生成文件的目录名称 */
+ outputDir: 'dist',
+ /* 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录 */
+ assetsDir: 'assets',
+ /* 是否在构建生产包时生成 sourceMap 文件,false将提高构建速度 */
+ productionSourceMap: false,
+ /* 默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存,你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变) */
+ filenameHashing: false,
+ /* 代码保存时进行eslint检测 */
+ lintOnSave: true,
+ /* webpack-dev-server 相关配置 */
+ devServer: {
+ /* 自动打开浏览器 */
+ open: true,
+ /* 设置为0.0.0.0则所有的地址均能访问 */
+ host: '0.0.0.0',
+ port: 8311,
+ https: false,
+ hotOnly: false,
+ disableHostCheck: true,
+ /* 使用代理 后台接口路径 */
+ // proxy: 'http://192.168.1.123:8312/'
+ // proxy: 'http://192.168.31.177:8312/'
+ proxy: 'http://localhost:8080/',
+ // proxy: 'http://jdxdev.vipgz4.idcfengye.com/'
+ },
}
From 7d0fd31ba252e2ea8b86688d6c50fa5fb1f59d55 Mon Sep 17 00:00:00 2001
From: liuyang <396235408@qq.com>
Date: Mon, 8 Jun 2020 10:29:47 +0800
Subject: [PATCH 08/10] 1
---
src/pages/recruit/BulletinIndex.vue | 44 ++++++++++++++---------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/src/pages/recruit/BulletinIndex.vue b/src/pages/recruit/BulletinIndex.vue
index 75eaa5e..6f7ad69 100644
--- a/src/pages/recruit/BulletinIndex.vue
+++ b/src/pages/recruit/BulletinIndex.vue
@@ -104,7 +104,7 @@ export default {
doShow () {
this.showStoreCheck = false
this.welcome = store.getters.useData
- console.log(this.welcome);
+ console.log('@',this.welcome);
},
showStores () {
console.log({ ...store.getters.useData, ...this.welcome })
@@ -116,41 +116,41 @@ export default {
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);
- }
+ let _this = this;
+ this.initData.stores = this.welcome.stores;
+ this.initData.company = this.welcome.company;
+ let param = this.initData
+ if (param.stores.length <= 0) {
+ _this.$Message.error("请至少选择一个店铺");
+ _this.loading = false;
+ return false;
+ }
+ param.isGetActivityInfo = true;
if(this.onWitch){
- this.initData.status = 1;
- this.initData.stores.forEach(item => {
+ param.status = 1;
+ param.stores.forEach(item => {
item.status = 1;
})
}else{
- this.initData.status = 3;
- this.initData.stores.forEach(item => {
+ param.status = 3;
+ param.stores.forEach(item => {
item.status = 2;
})
}
if(this.uploadUrl != ""){
- this.initData.scheduleVO.params.forEach(item => {
+ param.scheduleVO.params.forEach(item => {
item.defaultVal = item.description = this.uploadUrl;
})
}
- let that = this;
- bulletinService.dosave(this.initData, function (data) {
+ bulletinService.dosave(param, function (data) {
console.log(data);
- that.$Message.info("保存成功");
- that.btnStr = '编辑'
- that.showUpload = false;
- that.reload();
+ _this.$Message.info("保存成功");
+ _this.btnStr = '编辑'
+ _this.showUpload = false;
}, function (err) {
- that.$Message.error("网络异常,请重试");
- that.setNoLoading();
+ _this.$Message.error("网络异常,请重试");
+ _this.setNoLoading();
});
}
},
From cb5ec12b4c3449870caa9addb4488ebf0ade52ae Mon Sep 17 00:00:00 2001
From: zhenghuang <236220500@qq.com>
Date: Tue, 9 Jun 2020 08:51:35 +0800
Subject: [PATCH 09/10] 1
---
src/pages/recruit/BulletinIndex.vue | 145 +++++++++++++++-------------
1 file changed, 80 insertions(+), 65 deletions(-)
diff --git a/src/pages/recruit/BulletinIndex.vue b/src/pages/recruit/BulletinIndex.vue
index 6f7ad69..ec759de 100644
--- a/src/pages/recruit/BulletinIndex.vue
+++ b/src/pages/recruit/BulletinIndex.vue
@@ -3,47 +3,62 @@
- 招募令
- 便于门店进行推广员招募
+ 招募令
+ 便于门店进行推广员招募
- 使用范围:{{welcome.company.length || 0}}家零售公司,{{welcome.stores.length || 0}}家店铺
- 修改
+ 使用范围:{{welcome.company.length || 0}}家零售公司,{{welcome.stores.length || 0}}家店铺
+ 修改
-
- 开启
- 关闭
-
+
+ 开启
+ 关闭
+
招募海报
-
![]()
-
+
![]()
+
-
- 上传
-
+
+ 上传
+
- {{btnStr}}
- 取消
+ {{btnStr}}
+ 取消
+ :schedule="welcome"
+ :show="showStoreCheck">
@@ -57,7 +72,7 @@ export default {
components: {
selectStoreStep,
},
- data() {
+ data () {
return {
showStoreCheck: false,
welcome: {
@@ -66,78 +81,78 @@ export default {
company: [],
stores: [],
},
- inidData:{},
- showUpload:false,
- btnStr:'编辑',
- imgUrl:'',
- onWitch:false,
- uploadUrl:"",
- oldImg:""
+ inidData: {},
+ showUpload: false,
+ btnStr: '编辑',
+ imgUrl: '',
+ onWitch: false,
+ uploadUrl: "",
+ oldImg: ""
};
},
- mounted: function() {
-
- },
- created() {
+ mounted: function () {
+
+ },
+ created () {
this.initData();
},
inject: ['reload'],
methods: {
- witchChange(status) {
+ witchChange (status) {
this.onWitch = status;
},
- initData(){
+ initData () {
let that = this;
bulletinService.getDetail({}, function (data) {
console.log(data);
- if(data.data.results.scheduleVO.params.length>0){
+ if (data.data.results.scheduleVO.params.length > 0) {
that.imgUrl = http.getBaseUrl() + data.data.results.scheduleVO.params[0].defaultVal;
that.oldImg = http.getBaseUrl() + data.data.results.scheduleVO.params[0].defaultVal;
}
that.initData = data.data.results;
-
+ that.welcome = { ...that.initData, company: [...that.initData.organizations] };
}, function (err) {
- that.$Message.error("网络异常,请重试");
- that.setNoLoading();
+ that.$Message.error("网络异常,请重试");
+ that.setNoLoading();
});
},
doShow () {
this.showStoreCheck = false
this.welcome = store.getters.useData
- console.log('@',this.welcome);
+ console.log('@', this.welcome);
},
showStores () {
- console.log({ ...store.getters.useData, ...this.welcome })
- store.commit('SET_useData', { ...store.getters.useData, ...this.welcome })
+ console.log(this.welcome, { ...store.getters.useData, ...this.welcome, ...this.initData })
+ store.commit('SET_useData', { ...store.getters.useData, ...this.welcome, ...this.initData })
this.showStoreCheck = true
},
- onEdit(){
- if(this.btnStr == '编辑'){
+ onEdit () {
+ if (this.btnStr == '编辑') {
this.showUpload = true;
this.btnStr = '保存'
- }else{
- let _this = this;
- this.initData.stores = this.welcome.stores;
- this.initData.company = this.welcome.company;
+ } else {
+ let _this = this;
+ this.initData.stores = this.welcome.stores;
+ this.initData.company = this.welcome.company;
let param = this.initData
- if (param.stores.length <= 0) {
- _this.$Message.error("请至少选择一个店铺");
- _this.loading = false;
- return false;
- }
+ if (param.stores.length <= 0) {
+ _this.$Message.error("请至少选择一个店铺");
+ _this.loading = false;
+ return false;
+ }
param.isGetActivityInfo = true;
- if(this.onWitch){
+ if (this.onWitch) {
param.status = 1;
param.stores.forEach(item => {
item.status = 1;
})
- }else{
+ } else {
param.status = 3;
param.stores.forEach(item => {
item.status = 2;
})
}
- if(this.uploadUrl != ""){
+ if (this.uploadUrl != "") {
param.scheduleVO.params.forEach(item => {
item.defaultVal = item.description = this.uploadUrl;
@@ -147,15 +162,15 @@ export default {
console.log(data);
_this.$Message.info("保存成功");
_this.btnStr = '编辑'
- _this.showUpload = false;
+ _this.showUpload = false;
}, function (err) {
- _this.$Message.error("网络异常,请重试");
- _this.setNoLoading();
+ _this.$Message.error("网络异常,请重试");
+ _this.setNoLoading();
});
}
},
- onCancel(){
- this.showUpload = false;
+ onCancel () {
+ this.showUpload = false;
this.imgUrl = this.oldImg;
this.btnStr = '编辑'
},
From 357bd60f79c309f7ea8790084fdf48361c1bab57 Mon Sep 17 00:00:00 2001
From: zhenghuang <236220500@qq.com>
Date: Tue, 9 Jun 2020 14:52:45 +0800
Subject: [PATCH 10/10] 1
---
src/pages/activity/ActivityPlan.vue | 249 ++++++++++++++--------------
1 file changed, 124 insertions(+), 125 deletions(-)
diff --git a/src/pages/activity/ActivityPlan.vue b/src/pages/activity/ActivityPlan.vue
index f6d4ebb..7d1e0ff 100644
--- a/src/pages/activity/ActivityPlan.vue
+++ b/src/pages/activity/ActivityPlan.vue
@@ -1,128 +1,128 @@
-
加载中...
-
+ 加载中...
+
-
-
+
+
-
-
-
-
-
+
+
+
-
+
-
+
- {pageNum = 1;searchTable()}">查询
+ {pageNum = 1;searchTable()}">查询
-
-
-
+
+
+
-
+
- {stop(row)}"
- >终止
+ {stop(row)}">终止
- {modify(row)}">修改
+ {modify(row)}">修改
-
+
-
-
-
+
+
+
-
+
{{this.showStoreName}}
-
+
- 下载
+ 下载
@@ -142,7 +142,7 @@ export default {
useTable,
planDetail
},
- data() {
+ data () {
const _this = this;
return {
showStoreName: "",
@@ -203,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) {
@@ -219,7 +219,7 @@ export default {
{
title: "活动类型",
key: "scheduleVO.name",
- render(h, params) {
+ render (h, params) {
return h("span", params.row["params"][0]["name"]);
}
},
@@ -227,47 +227,47 @@ 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) + "人");
}
},
@@ -289,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", "进行中");
@@ -332,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({
@@ -365,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({
@@ -386,11 +386,11 @@ export default {
});
});
},
- handlePage: function(value) {
+ handlePage: function (value) {
this.pageNum = value;
this.searchTable();
},
- stop(instance) {
+ stop (instance) {
if (instance.status > 2) {
return;
}
@@ -412,10 +412,10 @@ export default {
}
);
},
- onCancel: () => {}
+ onCancel: () => { }
});
},
- getDetail(instanceId) {
+ getDetail (instanceId) {
return new Promise((resolve, reject) => {
ActivityManager.instanceDetail(
{
@@ -427,7 +427,7 @@ export default {
);
});
},
- modify(instance) {
+ modify (instance) {
let _this = this;
this.getDetail(instance.id).then(res => {
store.commit("SET_useData", res);
@@ -435,14 +435,13 @@ export default {
_this.showUse = true;
});
},
- navigateCode(instance) {
- return;
+ navigateCode (instance) {
this.$router.push({
path: "/activity/plan/code",
query: { instanceId: instance.id }
});
},
- searchTable(params = {}) {
+ searchTable (params = {}) {
this.loading = true;
if (
this.formValidate.date !== null &&
@@ -475,7 +474,7 @@ export default {
this.loading = false;
});
},
- startDateChange: function(e) {
+ startDateChange: function (e) {
//设置开始时间
this.endDateOptions = {
disabledDate: date => {
@@ -486,11 +485,11 @@ export default {
}
};
},
- endDateChange: function(e) {
+ endDateChange: function (e) {
//设置结束时间
let endTime = this.formValidate.endDate
? new Date(this.formValidate.endDate).valueOf() -
- 1 * 24 * 60 * 60 * 1000
+ 1 * 24 * 60 * 60 * 1000
: "";
this.startDateOptions = {
disabledDate: date => {
@@ -498,17 +497,17 @@ export default {
}
};
},
- 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) {
+ download: function (index) {
debugger;
let fileName = index.name + "-门店码";
http.downloadImg(
@@ -516,10 +515,10 @@ export default {
url: index.qrCodeAction
},
fileName,
- function(/*data*/) {}
+ function (/*data*/) { }
);
},
- ok: function() {
+ ok: function () {
this.isShow = false;
}
}