Merge remote-tracking branch 'origin/0605' into feature/20200514_version

feature_0521
kevin jiang 6 years ago
commit fc3c3aeffc

@ -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'] = {}));

@ -7,7 +7,7 @@ import axios from "axios";
import QS from "qs"; import QS from "qs";
import "./iview"; import "./iview";
import "./vcharts"; import "./vcharts";
import "lib-flexible/flexible"; import "./flexible";
import _ from "lodash"; import _ from "lodash";
Vue.prototype.$axios = axios; Vue.prototype.$axios = axios;

@ -1,128 +1,128 @@
<template> <template>
<div> <div>
<Spin v-if="saving" fix>加载中...</Spin> <Spin v-if="saving"
<Form ref="formValidate" :model="formValidate" :label-width="80"> fix>加载中...</Spin>
<Form ref="formValidate"
:model="formValidate"
:label-width="80">
<Row :gutter="10"> <Row :gutter="10">
<i-col span="6"> <i-col span="6">
<FormItem label="选择日期" prop> <FormItem label="选择日期"
<Date-picker prop>
style="width: 100%" <Date-picker style="width: 100%"
v-model="formValidate.date" v-model="formValidate.date"
type="daterange" type="daterange"
placement="bottom-end" placement="bottom-end"
placeholder="选择日期区间" placeholder="选择日期区间"></Date-picker>
></Date-picker>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="6"> <i-col span="6">
<FormItem label="零售公司" prop> <FormItem label="零售公司"
<Select prop>
v-model="formValidate.organizationId" <Select v-model="formValidate.organizationId"
filterable filterable
@on-change="selectCompany" @on-change="selectCompany"
placeholder="全部" placeholder="全部"
clearable clearable>
> <Option v-for="(item, index) in companyList"
<Option :key="index"
v-for="(item, index) in companyList" :value="item.value">{{ item.label }}</Option>
:key="index"
:value="item.value"
>{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="6"> <i-col span="6">
<FormItem label="店铺" prop> <FormItem label="店铺"
<Select v-model="formValidate.storeId" filterable placeholder="全部" clearable> prop>
<Option <Select v-model="formValidate.storeId"
v-for="(item, index) in shopList" filterable
:key="index" placeholder="全部"
:value="item.value" clearable>
>{{ item.label }}</Option> <Option v-for="(item, index) in shopList"
:key="index"
:value="item.value">{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="3"> <i-col span="3">
<FormItem label="活动状态" prop> <FormItem label="活动状态"
prop>
<Select v-model="formValidate.status"> <Select v-model="formValidate.status">
<Option <Option v-for="(item, index) in activityStatusList"
v-for="(item, index) in activityStatusList" :key="index"
:key="index" :value="item.value">{{ item.label }}</Option>
:value="item.value"
>{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="3"> <i-col span="3">
<Button type="primary" @click="() => {pageNum = 1;searchTable()}">查询</Button> <Button type="primary"
@click="() => {pageNum = 1;searchTable()}">查询</Button>
</i-col> </i-col>
</Row> </Row>
<Row style="margin-top:50px"> <Row style="margin-top:50px">
<Table <Table :loading="loading"
:loading="loading" border
border @on-row-dblclick="showDetail"
@on-row-dblclick="showDetail" :columns="columns1"
:columns="columns1" :data="data">
:data="data" <template slot-scope="{row}"
> slot="qrCodeAction">
<template slot-scope="{row}" slot="qrCodeAction"> <img :src="require('../../../static/img/qrCode-init.png')"
<img @click="navigateCode(row)"
:src="require('../../../static/img/qrCode-init.png')" class="table-img-qr-code" />
@click="navigateCode(row)"
class="table-img-qr-code"
/>
</template> </template>
<template slot="action" slot-scope="{row}"> <template slot="action"
slot-scope="{row}">
<i-col span="12"> <i-col span="12">
<Button <Button ghost
ghost :class="row.status > 2 ? 'router-btn disable' : 'router-btn'"
:class="row.status > 2 ? 'router-btn disable' : 'router-btn'" @click="() => {stop(row)}">终止</Button>
@click="() => {stop(row)}"
>终止</Button>
</i-col> </i-col>
<i-col span="12"> <i-col span="12">
<Button ghost class="router-btn" @click="() => {modify(row)}">修改</Button> <Button ghost
class="router-btn"
@click="() => {modify(row)}">修改</Button>
</i-col> </i-col>
</template> </template>
</Table> </Table>
<Page <Page :total="totalSize"
:total="totalSize" :current="pageNum"
:current="pageNum" :page-size="pageSize"
:page-size="pageSize" show-elevator
show-elevator show-total
show-total placement="top"
placement="top" @on-change="handlePage"
@on-change="handlePage" class-name="ks-page"></Page>
class-name="ks-page"
></Page>
</Row> </Row>
</Form> </Form>
<useTable <useTable ref="useTable"
ref="useTable" @doShow="doShow"
@doShow="doShow" :show="showUse"
:show="showUse" :isModify="true"
:isModify="true" :schedule="activityInstance.scheduleVO"></useTable>
:schedule="activityInstance.scheduleVO" <Modal v-model="isShowDetail"
></useTable> title="活动计划详情"
<Modal v-model="isShowDetail" title="活动计划详情" width="70%" :footer-hide="true"> width="70%"
<planDetail v-if="isShowDetail" :detail="detail"></planDetail> :footer-hide="true">
<planDetail v-if="isShowDetail"
:detail="detail"></planDetail>
</Modal> </Modal>
<!-- 预览二维码 --> <!-- 预览二维码 -->
<Modal <Modal v-model="isShow"
v-model="isShow" :title="showStoreName"
:title="showStoreName" :footer-hide="true"
:footer-hide="true" width="230"
width="230" class-name="vertical-center-modal"
class-name="vertical-center-modal" @on-ok="ok">
@on-ok="ok"
>
<div slot="header"> <div slot="header">
<p></p> <p></p>
</div> </div>
<p>{{this.showStoreName}}</p> <p>{{this.showStoreName}}</p>
<img :src="qrCodeImage" style="width:200px;height:200px;" /> <img :src="qrCodeImage"
style="width:200px;height:200px;" />
<div style="text-align: center;"> <div style="text-align: center;">
<Button ghost type="primary" @click="download(rowData)"></Button> <Button ghost
type="primary"
@click="download(rowData)">下载</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
@ -142,7 +142,7 @@ export default {
useTable, useTable,
planDetail planDetail
}, },
data() { data () {
const _this = this; const _this = this;
return { return {
showStoreName: "", showStoreName: "",
@ -203,7 +203,7 @@ export default {
width: 60, width: 60,
align: "center", align: "center",
title: "序号", title: "序号",
render(h, params) { render (h, params) {
let num = parseInt(params.index) + 1; let num = parseInt(params.index) + 1;
console.log(_this.pageSize); console.log(_this.pageSize);
if (_this.pageSize > 1) { if (_this.pageSize > 1) {
@ -219,7 +219,7 @@ export default {
{ {
title: "活动类型", title: "活动类型",
key: "scheduleVO.name", key: "scheduleVO.name",
render(h, params) { render (h, params) {
return h("span", params.row["params"][0]["name"]); return h("span", params.row["params"][0]["name"]);
} }
}, },
@ -227,47 +227,47 @@ export default {
title: "活动时间", title: "活动时间",
key: "beginTime", key: "beginTime",
width: 230, width: 230,
render(h, params) { render (h, params) {
return h("span", params.row.beginTime + " - " + params.row.endTime); return h("span", params.row.beginTime + " - " + params.row.endTime);
} }
}, },
{ {
title: "零售公司", title: "零售公司",
key: "shop", key: "shop",
render(h, params) { render (h, params) {
return h( return h(
"span", "span",
params.row.companyName + params.row.companyName +
"等" + "等" +
(params.row.companyCount || 0) + (params.row.companyCount || 0) +
"家公司" "家公司"
); );
} }
}, },
{ {
title: "店铺", title: "店铺",
key: "shop", key: "shop",
render(h, params) { render (h, params) {
return h( return h(
"span", "span",
params.row.storeName + params.row.storeName +
"等" + "等" +
(params.row.storeCount || 0) + (params.row.storeCount || 0) +
"家店铺" "家店铺"
); );
} }
}, },
{ {
title: "添加好友数", title: "添加好友数",
key: "addFriendNum", key: "addFriendNum",
render(h, params) { render (h, params) {
return h("span", (params.row.friends || 0) + "人"); return h("span", (params.row.friends || 0) + "人");
} }
}, },
{ {
title: "参与活动客户数", title: "参与活动客户数",
key: "joinActivityClientNum", key: "joinActivityClientNum",
render(h, params) { render (h, params) {
return h("span", (params.row.friends || 0) + "人"); return h("span", (params.row.friends || 0) + "人");
} }
}, },
@ -289,7 +289,7 @@ export default {
{ {
title: "活动状态", title: "活动状态",
key: "status", key: "status",
render(h, p) { render (h, p) {
const status = p.row.status; const status = p.row.status;
if (status === 1) return h("span", "未开始"); if (status === 1) return h("span", "未开始");
if (status === 2) return h("span", "进行中"); if (status === 2) return h("span", "进行中");
@ -332,30 +332,30 @@ export default {
] ]
}; };
}, },
mounted() { mounted () {
this.setMenuName("活动管理", "活动计划"); this.setMenuName("活动管理", "活动计划");
this.getCompanyInfo(); this.getCompanyInfo();
this.getShopInfo(); this.getShopInfo();
this.searchTable(); this.searchTable();
}, },
methods: { methods: {
doShow(show) { doShow (show) {
this.showUse = show; this.showUse = show;
this.searchTable(); this.searchTable();
}, },
showDetail(detail) { showDetail (detail) {
let _this = this; let _this = this;
this.getDetail(detail.id).then(res => { this.getDetail(detail.id).then(res => {
_this.detail = res; _this.detail = res;
_this.isShowDetail = true; _this.isShowDetail = true;
}); });
}, },
getCompanyInfo() { getCompanyInfo () {
let that = this; let that = this;
let data = { let data = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
}; };
ActivityManager.getCompany(data, function(data) { ActivityManager.getCompany(data, function (data) {
that.companyList = []; that.companyList = [];
data.data.results.forEach(element => { data.data.results.forEach(element => {
that.companyList.push({ that.companyList.push({
@ -365,18 +365,18 @@ export default {
}); });
}); });
}, },
selectCompany(value) { selectCompany (value) {
this.customerId = value; this.customerId = value;
this.getShopInfo(); this.getShopInfo();
}, },
getShopInfo() { getShopInfo () {
let that = this; let that = this;
let data = { let data = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId, userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
customerIds: this.customerId, customerIds: this.customerId,
scheduleId: null scheduleId: null
}; };
ActivityManager.getShop(data, function(data) { ActivityManager.getShop(data, function (data) {
that.shopList = []; that.shopList = [];
data.data.results.forEach(element => { data.data.results.forEach(element => {
that.shopList.push({ that.shopList.push({
@ -386,11 +386,11 @@ export default {
}); });
}); });
}, },
handlePage: function(value) { handlePage: function (value) {
this.pageNum = value; this.pageNum = value;
this.searchTable(); this.searchTable();
}, },
stop(instance) { stop (instance) {
if (instance.status > 2) { if (instance.status > 2) {
return; return;
} }
@ -412,10 +412,10 @@ export default {
} }
); );
}, },
onCancel: () => {} onCancel: () => { }
}); });
}, },
getDetail(instanceId) { getDetail (instanceId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
ActivityManager.instanceDetail( ActivityManager.instanceDetail(
{ {
@ -427,7 +427,7 @@ export default {
); );
}); });
}, },
modify(instance) { modify (instance) {
let _this = this; let _this = this;
this.getDetail(instance.id).then(res => { this.getDetail(instance.id).then(res => {
store.commit("SET_useData", res); store.commit("SET_useData", res);
@ -435,14 +435,13 @@ export default {
_this.showUse = true; _this.showUse = true;
}); });
}, },
navigateCode(instance) { navigateCode (instance) {
return;
this.$router.push({ this.$router.push({
path: "/activity/plan/code", path: "/activity/plan/code",
query: { instanceId: instance.id } query: { instanceId: instance.id }
}); });
}, },
searchTable(params = {}) { searchTable (params = {}) {
this.loading = true; this.loading = true;
if ( if (
this.formValidate.date !== null && this.formValidate.date !== null &&
@ -475,7 +474,7 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
startDateChange: function(e) { startDateChange: function (e) {
// //
this.endDateOptions = { this.endDateOptions = {
disabledDate: date => { disabledDate: date => {
@ -486,11 +485,11 @@ export default {
} }
}; };
}, },
endDateChange: function(e) { endDateChange: function (e) {
// //
let endTime = this.formValidate.endDate let endTime = this.formValidate.endDate
? new Date(this.formValidate.endDate).valueOf() - ? new Date(this.formValidate.endDate).valueOf() -
1 * 24 * 60 * 60 * 1000 1 * 24 * 60 * 60 * 1000
: ""; : "";
this.startDateOptions = { this.startDateOptions = {
disabledDate: date => { disabledDate: date => {
@ -498,17 +497,17 @@ export default {
} }
}; };
}, },
show: function(index) { show: function (index) {
this.isShow = true; this.isShow = true;
this.showStoreName = index.name; this.showStoreName = index.name;
this.qrCodeImage = index.qrCodeAction; this.qrCodeImage = index.qrCodeAction;
this.rowData = index; this.rowData = index;
}, },
hide: function() { hide: function () {
this.isShow = false; this.isShow = false;
}, },
// //
download: function(index) { download: function (index) {
debugger; debugger;
let fileName = index.name + "-门店码"; let fileName = index.name + "-门店码";
http.downloadImg( http.downloadImg(
@ -516,10 +515,10 @@ export default {
url: index.qrCodeAction url: index.qrCodeAction
}, },
fileName, fileName,
function(/*data*/) {} function (/*data*/) { }
); );
}, },
ok: function() { ok: function () {
this.isShow = false; this.isShow = false;
} }
} }

@ -1,96 +1,124 @@
<template> <template>
<Modal <Modal v-model="dispalyModal"
v-model="dispalyModal" width="1000"
width="1000" :loading="true"
:loading="true" :mask-closable="false"
:mask-closable="false" @on-visible-change="visibleChange"
@on-visible-change="visibleChange" @on-cancel="cancel">
@on-cancel="cancel" <p slot="header"
> style="color:#f60;text-align:left">
<p slot="header" style="color:#f60;text-align:left">
<span>配置活动</span> <span>配置活动</span>
</p> </p>
<div>基本配置</div> <div>基本配置</div>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80"> <Form ref="formValidate"
:model="formValidate"
:rules="ruleValidate"
:label-width="80">
<Row> <Row>
<i-col style="text-align: left;" span="8"> <i-col style="text-align: left;"
<FormItem label prop="logo"> span="8">
<Upload <FormItem label
ref="upload" prop="logo">
:show-upload-list="false" <Upload ref="upload"
:on-success="uploadImgSuccess" :show-upload-list="false"
:format="['jpg', 'jpeg', 'png']" :on-success="uploadImgSuccess"
:max-size="2048" :format="['jpg', 'jpeg', 'png']"
:before-upload="handleBeforeUpload" :max-size="2048"
multiple :before-upload="handleBeforeUpload"
type="drag" multiple
action type="drag"
style="display: inline-block;" action
> style="display: inline-block;">
<div style="width: 200px;height:200px;line-height: 200px;"> <div style="width: 200px;height:200px;line-height: 200px;">
<span v-if="!formValidate.logo"></span> <span v-if="!formValidate.logo"></span>
<img <img v-if="formValidate.logo"
v-if="formValidate.logo" :src="`/kiisoo-ic` + formValidate.logo"
:src="`/kiisoo-ic` + formValidate.logo" alt
alt style="width: 100%; height: auto" />
style="width: 100%; height: auto"
/>
</div> </div>
</Upload> </Upload>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="15" offset="1"> <i-col span="15"
<FormItem label="活动名称" prop="name"> offset="1">
<i-input type="text" v-model="formValidate.name" placeholder="请输入活动名称"></i-input> <FormItem label="活动名称"
prop="name">
<i-input type="text"
v-model="formValidate.name"
placeholder="请输入活动名称"></i-input>
</FormItem> </FormItem>
<Form-item label="活动描述" prop="description"> <Form-item label="活动描述"
<i-input prop="description">
v-model="formValidate.description" <i-input v-model="formValidate.description"
type="textarea" type="textarea"
:autosize="{ minRows: 3 }" :autosize="{ minRows: 3 }"
placeholder="请输入活动描述" placeholder="请输入活动描述"></i-input>
></i-input>
</Form-item> </Form-item>
<Form-item label="欢迎语" prop="description"> <Form-item label="欢迎语"
<i-input prop="description">
v-model="formValidate.welcome" <i-input v-model="formValidate.welcome"
type="textarea" type="textarea"
:autosize="{ minRows: 3 }" :autosize="{ minRows: 3 }"
placeholder="请输入欢迎语" placeholder="请输入欢迎语"></i-input>
></i-input>
</Form-item> </Form-item>
<FormItem label="APPID" prop="appId"> <FormItem label="标题"
<i-input type="text" v-model="formValidate.appId" placeholder="请输入appid"></i-input> prop="title">
<i-input type="text"
v-model="formValidate.title"
placeholder="请输入标题"></i-input>
</FormItem> </FormItem>
<FormItem label="URI" prop="uri"> <FormItem label="APPID"
<i-input type="text" v-model="formValidate.uri" placeholder="请输入URI"></i-input> prop="appId">
<i-input type="text"
v-model="formValidate.appId"
placeholder="请输入appid"></i-input>
</FormItem>
<FormItem label="URI"
prop="uri">
<i-input type="text"
v-model="formValidate.uri"
placeholder="请输入URI"></i-input>
</FormItem> </FormItem>
</i-col> </i-col>
</Row> </Row>
</Form> </Form>
<div class="topic">活动类型</div> <div class="topic">活动类型</div>
<Row :gutter="10" class="inputItem" v-for="(item, index) in formValidate.params" :key="index"> <Row :gutter="10"
class="inputItem"
v-for="(item, index) in formValidate.params"
:key="index">
<i-col :span="2">类型{{ index + 1 }}</i-col> <i-col :span="2">类型{{ index + 1 }}</i-col>
<i-col :span="9"> <i-col :span="9">
<i-input class="inputClass" type="text" v-model="item.name" placeholder="请输入活动类型名称"></i-input> <i-input class="inputClass"
type="text"
v-model="item.name"
placeholder="请输入活动类型名称"></i-input>
</i-col> </i-col>
<i-col :span="9"> <i-col :span="9">
<i-input <i-input class="inputClass"
class="inputClass" type="text"
type="text" style="margin-left: 20px"
style="margin-left: 20px" v-model="item.defaultVal"
v-model="item.defaultVal" placeholder="请输入参数"></i-input>
placeholder="请输入参数"
></i-input>
</i-col> </i-col>
<i-col :span="4"> <i-col :span="4">
<Button style="margin-left: 20px" type="error" @click="delActivityInput(index)"></Button> <Button style="margin-left: 20px"
type="error"
@click="delActivityInput(index)">删除</Button>
</i-col> </i-col>
</Row> </Row>
<Button style="margin-top: 10px" type="primary" @click="addActivityInput">+</Button> <Button style="margin-top: 10px"
type="primary"
@click="addActivityInput">+添加活动类型</Button>
<div slot="footer"> <div slot="footer">
<Button type="primary" shape="circle" :loading="modal_loading" @click="cancel"></Button> <Button type="primary"
<Button type="primary" shape="circle" :loading="modal_loading" @click="save"></Button> shape="circle"
:loading="modal_loading"
@click="cancel">取消</Button>
<Button type="primary"
shape="circle"
:loading="modal_loading"
@click="save">确定</Button>
</div> </div>
</Modal> </Modal>
</template> </template>
@ -99,7 +127,7 @@ import ActivityManager from "../../services/ActivityManager/ActivityManager";
import axios from "axios"; import axios from "axios";
export default { export default {
name: "addActivity", name: "addActivity",
data() { data () {
return { return {
dispalyModal: false, dispalyModal: false,
currentStep: 0, currentStep: 0,
@ -114,6 +142,7 @@ export default {
description: [ description: [
{ required: true, message: "活动描述不能为空", trigger: "blur" } { required: true, message: "活动描述不能为空", trigger: "blur" }
], ],
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
appId: [{ required: true, message: "appId不能为空", trigger: "blur" }], appId: [{ required: true, message: "appId不能为空", trigger: "blur" }],
uri: [{ required: true, message: "URI不能为空", trigger: "blur" }], uri: [{ required: true, message: "URI不能为空", trigger: "blur" }],
welcome: [{ required: true, message: "请输入欢迎语", trigger: "blur" }] welcome: [{ required: true, message: "请输入欢迎语", trigger: "blur" }]
@ -128,7 +157,7 @@ export default {
id: String id: String
}, },
watch: { watch: {
addActivityModal(val) { addActivityModal (val) {
this.dispalyModal = val; this.dispalyModal = val;
if (val === true && this.id) { if (val === true && this.id) {
this.getActivityData(); this.getActivityData();
@ -157,9 +186,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
} }
}, },
mounted() {}, mounted () { },
methods: { methods: {
addActivityInput() { addActivityInput () {
let params = [...this.formValidate.params]; let params = [...this.formValidate.params];
params.push({ params.push({
defaultVal: "", defaultVal: "",
@ -175,7 +204,7 @@ export default {
this.$set(this.formValidate, "params", params); this.$set(this.formValidate, "params", params);
this.$forceUpdate(); this.$forceUpdate();
}, },
delActivityInput(index) { delActivityInput (index) {
if (this.formValidate.params.length <= 1) { if (this.formValidate.params.length <= 1) {
this.$Message.error("至少需要填写一个活动类型!"); this.$Message.error("至少需要填写一个活动类型!");
return; return;
@ -183,30 +212,31 @@ export default {
this.formValidate.params.splice(index, 1); this.formValidate.params.splice(index, 1);
this.$forceUpdate(); this.$forceUpdate();
}, },
visibleChange(show) { visibleChange (show) {
if (!show) { if (!show) {
this.$emit("dispalyAddActivityModal", false, false); this.$emit("dispalyAddActivityModal", false, false);
} }
}, },
cancel() { cancel () {
this.$emit("dispalyAddActivityModal", false, false); this.$emit("dispalyAddActivityModal", false, false);
}, },
getActivityData() { getActivityData () {
let that = this; let that = this;
let data = { let data = {
id: that.id id: that.id
}; };
ActivityManager.getActivityInfo(data, function(data) { ActivityManager.getActivityInfo(data, function (data) {
that.formValidate = data.data.results; that.formValidate = data.data.results;
}); });
}, },
uploadImgSuccess(res, file) { uploadImgSuccess (res, file) {
this.imageName = file.name; this.imageName = file.name;
}, },
handleBeforeUpload(res) { handleBeforeUpload (res) {
const me = this; const me = this;
let data = new FormData(); let data = new FormData();
data.append("file", res); data.append("file", res);
data.append("needMediaId", true)
axios({ axios({
method: "post", method: "post",
url: "/upload", url: "/upload",
@ -214,16 +244,17 @@ export default {
headers: { headers: {
"Content-Type": "multipart/form-data" "Content-Type": "multipart/form-data"
} }
}).then(function(res) { }).then(function (res) {
if (res.data.success) { if (res.data.success) {
// me.formValidate.logo = res.data.results; // me.formValidate.logo = res.data.results;
me.$set(me.formValidate, "logo", res.data.results.localPath); me.$set(me.formValidate, "logo", res.data.results.localPath);
me.$set(me.formValidate, "mediaId", res.data.results.mediaId);
console.log(me.formValidate.logo); console.log(me.formValidate.logo);
} }
}); });
return false; return false;
}, },
save() { save () {
let that = this; let that = this;
that.modal_loading = true; that.modal_loading = true;
let i = 0; let i = 0;
@ -263,7 +294,7 @@ export default {
let data = { ...that.formValidate, isGetActivityInfo: true }; let data = { ...that.formValidate, isGetActivityInfo: true };
data.categoryId = 0; data.categoryId = 0;
data.categoryCode = "promotion"; data.categoryCode = "promotion";
ActivityManager.addOreditActivity(data, function(data) { ActivityManager.addOreditActivity(data, function (data) {
that.addActivityModal = false; that.addActivityModal = false;
that.formValidate = {}; that.formValidate = {};
that.modal_loading = false; that.modal_loading = false;

@ -3,47 +3,62 @@
<template> <template>
<Row class="search-row"> <Row class="search-row">
<i-col span="8"> <i-col span="8">
<p class="" style="font-size: 16px;line-height: 22px;margin-top: 10px;margin-left: 20px;margin-right: 20px;">招募令</p> <p class=""
<p class="" style="font-size: 13px;line-height: 32px;margin-left: 20px;margin-right: 20px;">便于门店进行推广员招募</p> style="font-size: 16px;line-height: 22px;margin-top: 10px;margin-left: 20px;margin-right: 20px;">招募令</p>
<p class=""
style="font-size: 13px;line-height: 32px;margin-left: 20px;margin-right: 20px;">便于门店进行推广员招募</p>
</i-col> </i-col>
<i-col span="8"> <i-col span="8">
<span class="">使用范围26家零售公司785家店铺</span> <span class="">使用范围{{welcome.company.length || 0}}家零售公司{{welcome.stores.length || 0}}家店铺</span>
<span class="" style="border: 0px; color: rgb(52, 150, 235); margin-left: 15px; cursor: pointer;" @click="showStores"></span> <span class=""
style="border: 0px; color: rgb(52, 150, 235); margin-left: 15px; cursor: pointer;"
@click="showStores">修改</span>
</i-col> </i-col>
<i-col span="8"> <i-col span="8">
<i-switch size="large" @on-change="witchChange"> <i-switch size="large"
<span slot="open">开启</span> @on-change="witchChange">
<span slot="close">关闭</span> <span slot="open">开启</span>
</i-switch> <span slot="close">关闭</span>
</i-switch>
</i-col> </i-col>
</Row> </Row>
<div> <div>
<p style="margin:10px 0 10px -480px;text-align:center">招募海报</p> <p style="margin:10px 0 10px -480px;text-align:center">招募海报</p>
<div style="text-align: center;"> <div style="text-align: center;">
<img style="width:500px;height:500px" :src="imgUrl" alt=""> <img style="width:500px;height:500px"
:src="imgUrl"
alt="">
</div> </div>
<!-- <div style="margin-top:20px;text-align: center;"><Button ghost type="primary">上传</Button></div> --> <!-- <div style="margin-top:20px;text-align: center;"><Button ghost type="primary">上传</Button></div> -->
<Upload v-show="showUpload" ref="upload" <Upload v-show="showUpload"
:show-upload-list="false" ref="upload"
:on-success="uploadImgSuccess" :show-upload-list="false"
:format="['jpg', 'jpeg', 'png']" :on-success="uploadImgSuccess"
:max-size="2048" :format="['jpg', 'jpeg', 'png']"
:before-upload="handleBeforeUpload" :max-size="2048"
multiple :before-upload="handleBeforeUpload"
action="" multiple
style="padding-top:10px;text-align: center;"> action=""
<Button ghost type="primary">上传</Button> style="padding-top:10px;text-align: center;">
</Upload> <Button ghost
type="primary">上传</Button>
</Upload>
<div style="margin-top:20px;text-align: center;"> <div style="margin-top:20px;text-align: center;">
<Button type="primary" size="large" @click="onEdit" style="margin-right:10px">{{btnStr}}</Button> <Button type="primary"
<Button v-show="showUpload" type="text" size="large" @click="onCancel"></Button> size="large"
@click="onEdit"
style="margin-right:10px">{{btnStr}}</Button>
<Button v-show="showUpload"
type="text"
size="large"
@click="onCancel">取消</Button>
</div> </div>
</div> </div>
</template> </template>
<selectStoreStep @doShow="doShow" <selectStoreStep @doShow="doShow"
:schedule="welcome" :schedule="welcome"
:show="showStoreCheck"></selectStoreStep> :show="showStoreCheck"></selectStoreStep>
</div> </div>
</template> </template>
@ -54,11 +69,10 @@ import bulletinService from '../../services/recruit/Bulletin'
import http from '../../services/CommonHttp'; import http from '../../services/CommonHttp';
import axios from "axios"; import axios from "axios";
export default { export default {
inject:['reload'],
components: { components: {
selectStoreStep, selectStoreStep,
}, },
data() { data () {
return { return {
showStoreCheck: false, showStoreCheck: false,
welcome: { welcome: {
@ -67,90 +81,97 @@ export default {
company: [], company: [],
stores: [], stores: [],
}, },
inidData:{}, inidData: {},
showUpload:false, showUpload: false,
btnStr:'编辑', btnStr: '编辑',
imgUrl:'', imgUrl: '',
onWitch:false, onWitch: false,
uploadUrl:"" uploadUrl: "",
oldImg: ""
}; };
}, },
mounted: function() { mounted: function () {
}, },
created() { created () {
this.initData(); this.initData();
}, },
inject: ['reload'],
methods: { methods: {
witchChange(status) { witchChange (status) {
this.onWitch = status; this.onWitch = status;
}, },
initData(){ initData () {
let that = this; let that = this;
bulletinService.getDetail({}, function (data) { bulletinService.getDetail({}, function (data) {
console.log(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.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.initData = data.data.results;
that.welcome = { ...that.initData, company: [...that.initData.organizations] };
}, function (err) { }, function (err) {
that.$Message.error("网络异常,请重试"); that.$Message.error("网络异常,请重试");
that.setNoLoading(); that.setNoLoading();
}); });
}, },
doShow () { doShow () {
this.showStoreCheck = false this.showStoreCheck = false
this.welcome = store.getters.useData this.welcome = store.getters.useData
console.log(this.welcome); console.log('@', this.welcome);
}, },
showStores () { showStores () {
console.log({ ...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 }) store.commit('SET_useData', { ...store.getters.useData, ...this.welcome, ...this.initData })
this.showStoreCheck = true this.showStoreCheck = true
}, },
onEdit(){ onEdit () {
if(this.btnStr == '编辑'){ if (this.btnStr == '编辑') {
this.showUpload = true; this.showUpload = true;
this.btnStr = '保存' this.btnStr = '保存'
}else{ } else {
this.initData.isGetActivityInfo = true; let _this = this;
try{ this.initData.stores = this.welcome.stores;
if(this.welcome.stores.length>0){ this.initData.company = this.welcome.company;
this.initData.stores = this.welcome.stores; let param = this.initData
} if (param.stores.length <= 0) {
}catch(e){ _this.$Message.error("请至少选择一个店铺");
console.log(e); _this.loading = false;
return false;
} }
if(this.onWitch){ param.isGetActivityInfo = true;
this.initData.status = 1; if (this.onWitch) {
this.initData.stores.forEach(item => { param.status = 1;
param.stores.forEach(item => {
item.status = 1; item.status = 1;
}) })
}else{ } else {
this.initData.status = 3; param.status = 3;
this.initData.stores.forEach(item => { param.stores.forEach(item => {
item.status = 2; item.status = 2;
}) })
} }
if(this.uploadUrl != ""){ if (this.uploadUrl != "") {
this.initData.scheduleVO.params.forEach(item => { param.scheduleVO.params.forEach(item => {
item.defaultVal = item.description = this.uploadUrl; item.defaultVal = item.description = this.uploadUrl;
}) })
} }
let that = this; bulletinService.dosave(param, function (data) {
bulletinService.dosave(this.initData, function (data) {
console.log(data); console.log(data);
that.reload(); _this.$Message.info("保存成功");
_this.btnStr = '编辑'
_this.showUpload = false;
}, function (err) { }, function (err) {
that.$Message.error("网络异常,请重试"); _this.$Message.error("网络异常,请重试");
that.setNoLoading(); _this.setNoLoading();
}); });
} }
}, },
onCancel(){ onCancel () {
this.showUpload = false; this.showUpload = false;
this.imgUrl = this.oldImg;
this.btnStr = '编辑' this.btnStr = '编辑'
}, },
uploadImgSuccess (res, file) { uploadImgSuccess (res, file) {

@ -564,4 +564,7 @@
.search-btn{ .search-btn{
margin-left: 40px; margin-left: 40px;
} }
.ivu-tabs{
overflow :inherit;
}
</style> </style>

@ -2,178 +2,228 @@
<div class> <div class>
<Row> <Row>
<i-col :span="12"> <i-col :span="12">
<Form ref="welcomeForm" :model="welcome" :rules="welcomeRules"> <Form ref="welcomeForm"
<FormItem label="欢迎语内容" prop="content"> :model="welcome"
<i-input :rules="welcomeRules">
v-model="welcome.content" <FormItem label="欢迎语内容"
type="textarea" prop="content">
style="height: 220px" <i-input v-model="welcome.content"
:autosize="{ minRows: 10, maxRows: 10 }" type="textarea"
placeholder="请输入欢迎语内容,最多100个字" style="height: 220px"
></i-input> :autosize="{ minRows: 10, maxRows: 10 }"
placeholder="请输入欢迎语内容,最多100个字"></i-input>
</FormItem> </FormItem>
<Row <Row style="margin-bottom: 10px"
style="margin-bottom: 10px" :gutter="10"
:gutter="10" class="inputItem"
class="inputItem" v-for="(item, index) in welcome.params"
v-for="(item, index) in welcome.params" :key="index">
:key="index"
>
<div v-if="item.type == 3"> <div v-if="item.type == 3">
<i-col style="line-height: 32px" :span="2">标题 {{ index + 1 }}</i-col> <i-col style="line-height: 32px"
:span="2">标题 {{ index + 1 }}</i-col>
<i-col :span="3"> <i-col :span="3">
<i-input class="inputClass" type="text" disabled v-model="item.key"></i-input> <i-input class="inputClass"
type="text"
disabled
v-model="item.key"></i-input>
</i-col> </i-col>
<i-col style="line-height: 32px" :span="2">APPID {{ index + 1 }}</i-col> <i-col style="line-height: 32px"
:span="2">APPID {{ index + 1 }}</i-col>
<i-col :span="3"> <i-col :span="3">
<i-input class="inputClass" type="text" disabled v-model="item.defaultVal"></i-input> <i-input class="inputClass"
type="text"
disabled
v-model="item.defaultVal"></i-input>
</i-col> </i-col>
<i-col style="line-height: 32px" :span="2">URI {{ index + 1 }}</i-col> <i-col style="line-height: 32px"
:span="2">URI {{ index + 1 }}</i-col>
<i-col :span="3"> <i-col :span="3">
<i-input class="inputClass" type="text" disabled v-model="item.description"></i-input> <i-input class="inputClass"
type="text"
disabled
v-model="item.description"></i-input>
</i-col> </i-col>
<i-col style="line-height: 32px" :span="2">MediaId{{ index + 1 }}</i-col> <i-col style="line-height: 32px"
:span="2">MediaId{{ index + 1 }}</i-col>
<i-col :span="3"> <i-col :span="3">
<i-input class="inputClass" type="text" disabled v-model="item.limitLower"></i-input> <i-input class="inputClass"
type="text"
disabled
v-model="item.limitLower"></i-input>
</i-col> </i-col>
</div> </div>
<div v-else-if="item.type == 2"> <div v-else-if="item.type == 2">
<i-col style="line-height: 32px" :span="4">标题 {{ index + 1 }}</i-col> <i-col style="line-height: 32px"
:span="4">标题 {{ index + 1 }}</i-col>
<i-col :span="6"> <i-col :span="6">
<i-input class="inputClass" type="text" disabled v-model="item.description"></i-input> <i-input class="inputClass"
type="text"
disabled
v-model="item.description"></i-input>
</i-col> </i-col>
<i-col style="line-height: 32px" :span="4">URL {{ index + 1 }}</i-col> <i-col style="line-height: 32px"
:span="4">URL {{ index + 1 }}</i-col>
<i-col :span="6"> <i-col :span="6">
<i-input class="inputClass" type="text" disabled v-model="item.defaultVal"></i-input> <i-input class="inputClass"
type="text"
disabled
v-model="item.defaultVal"></i-input>
</i-col> </i-col>
</div> </div>
<div v-else> <div v-else>
<i-col style="line-height: 32px" :span="4">{{ item.name }}{{ index + 1 }}</i-col> <i-col style="line-height: 32px"
:span="4">{{ item.name }}{{ index + 1 }}</i-col>
<i-col :span="16"> <i-col :span="16">
<i-input class="inputClass" type="text" disabled v-model="item.defaultVal"></i-input> <i-input class="inputClass"
type="text"
disabled
v-model="item.defaultVal"></i-input>
</i-col> </i-col>
</div> </div>
<i-col :span="4"> <i-col :span="4">
<Button type="error" @click="delActivityInput(index)"></Button> <Button type="error"
@click="delActivityInput(index)">删除</Button>
</i-col> </i-col>
</Row> </Row>
<FormItem> <FormItem v-if="paramFilter()">
<Button type="text" @click="() => (showMessageTypes = true)" icon="md-add">添加图片/网页/小程序消息</Button> <Button type="text"
@click="() => (showMessageTypes = true)"
icon="md-add">添加图片/网页/小程序消息</Button>
</FormItem> </FormItem>
<FormItem label="配置范围: "> <FormItem label="配置范围: ">
<span <span @click="showStores"
@click="showStores" v-if="welcome.stores.length > 0">{{ welcome.stores[0].name }}{{ welcome.stores.length }}家店铺</span>
v-if="welcome.stores.length > 0" <Button type="text"
>{{ welcome.stores[0].name }}{{ welcome.stores.length }}家店铺</span> v-if="welcome.stores.length <= 0"
<Button @click="showStores"
type="text" icon="md-add">全部店铺</Button>
v-if="welcome.stores.length <= 0"
@click="showStores"
icon="md-add"
>全部店铺</Button>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button <Button type="primary"
type="primary" :loading="loading"
:loading="loading" long
long @click="submit">{{loading ? "保存中" : "确定"}}</Button>
@click="submit"
>{{loading ? "保存中" : "确定"}}</Button>
</FormItem> </FormItem>
</Form> </Form>
</i-col> </i-col>
</Row> </Row>
<Modal v-model="showMessageTypes" title="添加图片/网页/小程序消息" :footer-hide="true"> <Modal v-model="showMessageTypes"
title="添加图片/网页/小程序消息"
:footer-hide="true">
<Row :gutter="24"> <Row :gutter="24">
<i-col :span="8" v-if="imageFilter()"> <i-col :span="8">
<Upload <Upload ref="upload"
ref="upload" :show-upload-list="false"
:show-upload-list="false" :on-success="uploadImgSuccess"
:on-success="uploadImgSuccess" :format="['jpg', 'jpeg', 'png']"
:format="['jpg', 'jpeg', 'png']" :max-size="2048"
:max-size="2048" :on-exceeded-size="onExceededSize"
:on-exceeded-size="onExceededSize" :before-upload="handleBeforeUpload"
:before-upload="handleBeforeUpload" multiple
multiple type="drag"
type="drag" action
action style="width: 100%;">
style="width: 100%;"
>
<div style="width: 100%;"> <div style="width: 100%;">
<Button long type="primary">{{imageUploading ? "上传中..." : "图片"}}</Button> <Button long
type="primary">{{imageUploading ? "上传中..." : "图片"}}</Button>
</div> </div>
</Upload> </Upload>
</i-col> </i-col>
<i-col :span="8"> <i-col :span="8">
<Button long @click="doShowWeb" v-if="webFilter()" type="primary"></Button> <Button long
@click="doShowWeb"
type="primary">网页</Button>
</i-col> </i-col>
<i-col :span="8"> <i-col :span="8">
<Button long @click="doShowMini" v-if="miniFilter()" type="primary"></Button> <Button long
@click="doShowMini"
type="primary">小程序</Button>
</i-col> </i-col>
</Row> </Row>
</Modal> </Modal>
<Modal v-model="showWeb" title="添加网页消息" :loading="true"> <Modal v-model="showWeb"
<Form ref="webForm" :model="webForm" :rules="webFormRules"> title="添加网页消息"
<FormItem label="标题" prop="title"> :loading="true">
<i-input v-model="webForm.title" type="text" placeholder="请输入网页标题"></i-input> <Form ref="webForm"
:model="webForm"
:rules="webFormRules">
<FormItem label="标题"
prop="title">
<i-input v-model="webForm.title"
type="text"
placeholder="请输入网页标题"></i-input>
</FormItem> </FormItem>
<FormItem label="添加网页消息" prop="url"> <FormItem label="添加网页消息"
<i-input v-model="webForm.url" type="text" placeholder="以http或https开头"></i-input> prop="url">
<i-input v-model="webForm.url"
type="text"
placeholder="以http或https开头"></i-input>
</FormItem> </FormItem>
</Form> </Form>
<div slot="footer"> <div slot="footer">
<Button type="primary" @click="cancelWeb"></Button> <Button type="primary"
<Button type="primary" @click="okWeb"></Button> @click="cancelWeb">取消</Button>
<Button type="primary"
@click="okWeb">确定</Button>
</div> </div>
</Modal> </Modal>
<Modal v-model="showMini" title="添加小程序消息" :loading="true"> <Modal v-model="showMini"
<Form ref="miniForm" :model="miniForm" :rules="miniFormRules"> title="添加小程序消息"
<FormItem label="标题" prop="key"> :loading="true">
<i-input v-model="miniForm.key" type="text" placeholder="请输入标题"></i-input> <Form ref="miniForm"
:model="miniForm"
:rules="miniFormRules">
<FormItem label="标题"
prop="key">
<i-input v-model="miniForm.key"
type="text"
placeholder="请输入标题"></i-input>
</FormItem> </FormItem>
<FormItem label="APPID" prop="appid"> <FormItem label="APPID"
<i-input v-model="miniForm.appid" type="text" placeholder="请输入appid"></i-input> prop="appid">
<i-input v-model="miniForm.appid"
type="text"
placeholder="请输入appid"></i-input>
</FormItem> </FormItem>
<FormItem label="URI" prop="uri"> <FormItem label="URI"
<i-input v-model="miniForm.uri" type="text" placeholder="请输入URl"></i-input> prop="uri">
<i-input v-model="miniForm.uri"
type="text"
placeholder="请输入URl"></i-input>
</FormItem> </FormItem>
<FormItem label="封面图"> <FormItem label="封面图">
<Upload <Upload ref="upload"
ref="upload" :show-upload-list="false"
:show-upload-list="false" :on-success="miniUploadImgSuccess"
:on-success="miniUploadImgSuccess" :format="['jpg', 'jpeg', 'png']"
:format="['jpg', 'jpeg', 'png']" :max-size="2048"
:max-size="2048" :before-upload="handleBeforeUploadMini"
:before-upload="handleBeforeUploadMini" multiple
multiple type="drag"
type="drag" action
action style="display: inline-block;">
style="display: inline-block;"
>
<div style="width: 200px;height:200px;line-height: 200px;border:1px dashed #dedede"> <div style="width: 200px;height:200px;line-height: 200px;border:1px dashed #dedede">
<span v-if="!miniForm.limitUpper"></span> <span v-if="!miniForm.limitUpper"></span>
<img <img v-if="miniForm.limitUpper"
v-if="miniForm.limitUpper" :src="`/kiisoo-ic` + miniForm.limitUpper"
:src="`/kiisoo-ic` + miniForm.limitUpper" alt
alt style="width: 100%; height: auto" />
style="width: 100%; height: auto"
/>
</div> </div>
</Upload> </Upload>
</FormItem> </FormItem>
</Form> </Form>
<div slot="footer"> <div slot="footer">
<Button type="primary" @click="cancelMini"></Button> <Button type="primary"
<Button type="primary" @click="okMini"></Button> @click="cancelMini">取消</Button>
<Button type="primary"
@click="okMini">确定</Button>
</div> </div>
</Modal> </Modal>
<selectStoreStep <selectStoreStep :title="'配置范围'"
:title="'配置范围'" :isModify="id>0"
:isModify="id>0" @doShow="doShow"
@doShow="doShow" :schedule="welcome"
:schedule="welcome" :show="showStoreCheck"></selectStoreStep>
:show="showStoreCheck"
></selectStoreStep>
</div> </div>
</template> </template>
@ -192,7 +242,7 @@ const validateUrl = (rule, value, callback) => {
} }
}; };
export default { export default {
data() { data () {
return { return {
showStoreCheck: false, showStoreCheck: false,
showWeb: false, showWeb: false,
@ -238,7 +288,7 @@ export default {
}, },
watch: { watch: {
welcome: { welcome: {
handler() { handler () {
store.commit("SET_useData", { store.commit("SET_useData", {
...store.getters.useData, ...store.getters.useData,
...this.welcome ...this.welcome
@ -248,7 +298,7 @@ export default {
deep: true deep: true
} }
}, },
created() { created () {
this.id = this.$route.query.id; this.id = this.$route.query.id;
// store.commit("SET_useData", { ...store.getters.useData, ...this.welcome }); // store.commit("SET_useData", { ...store.getters.useData, ...this.welcome });
console.log(this.$route); console.log(this.$route);
@ -260,29 +310,17 @@ export default {
selectStoreStep selectStoreStep
}, },
methods: { methods: {
webFilter() { paramFilter () {
return ( return this.welcome.params.length < 1;
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() { doShow () {
this.showStoreCheck = false; this.showStoreCheck = false;
this.welcome = store.getters.useData; this.welcome = store.getters.useData;
}, },
onExceededSize() { onExceededSize () {
console.log("失败"); console.log("失败");
}, },
getDetail(instanceId) { getDetail (instanceId) {
let _this = this; let _this = this;
ActivityManager.instanceDetail( ActivityManager.instanceDetail(
{ {
@ -297,7 +335,7 @@ export default {
} }
); );
}, },
showStores() { showStores () {
console.log({ ...store.getters.useData, ...this.welcome }); console.log({ ...store.getters.useData, ...this.welcome });
store.commit("SET_useData", { store.commit("SET_useData", {
...this.welcome, ...this.welcome,
@ -305,16 +343,16 @@ export default {
}); });
this.showStoreCheck = true; this.showStoreCheck = true;
}, },
uploadImgSuccess(res, file) {}, uploadImgSuccess (res, file) { },
miniUploadImgSuccess(res, file) {}, miniUploadImgSuccess (res, file) { },
cancelWeb() { cancelWeb () {
this.showWeb = false; this.showWeb = false;
}, },
doShowWeb() { doShowWeb () {
this.showWeb = true; this.showWeb = true;
this.webForm = { url: "", title: "" }; this.webForm = { url: "", title: "" };
}, },
doShowMini() { doShowMini () {
this.showMini = true; this.showMini = true;
this.miniForm = { this.miniForm = {
appid: "", appid: "",
@ -324,10 +362,10 @@ export default {
key: "" key: ""
}; };
}, },
cancelMini() { cancelMini () {
this.showMini = false; this.showMini = false;
}, },
okWeb() { okWeb () {
let _this = this; let _this = this;
this.$refs["webForm"].validate(valid => { this.$refs["webForm"].validate(valid => {
if (valid) { if (valid) {
@ -347,7 +385,7 @@ export default {
} }
}); });
}, },
okMini() { okMini () {
let _this = this; let _this = this;
this.$refs["miniForm"].validate(valid => { this.$refs["miniForm"].validate(valid => {
if (valid) { if (valid) {
@ -367,11 +405,11 @@ export default {
} }
}); });
}, },
delActivityInput(index) { delActivityInput (index) {
this.welcome.params.splice(index, 1); this.welcome.params.splice(index, 1);
this.$forceUpdate(); this.$forceUpdate();
}, },
handleBeforeUploadMini(res) { handleBeforeUploadMini (res) {
const me = this; const me = this;
let data = new FormData(); let data = new FormData();
data.append("file", res); data.append("file", res);
@ -385,7 +423,7 @@ export default {
headers: { headers: {
"Content-Type": "multipart/form-data" "Content-Type": "multipart/form-data"
} }
}).then(function(res) { }).then(function (res) {
me.imageUploading = false; me.imageUploading = false;
if (res.data.success) { if (res.data.success) {
// me.formValidate.logo = res.data.results; // me.formValidate.logo = res.data.results;
@ -396,7 +434,7 @@ export default {
}); });
return false; return false;
}, },
handleBeforeUpload(res) { handleBeforeUpload (res) {
const me = this; const me = this;
let data = new FormData(); let data = new FormData();
data.append("file", res); data.append("file", res);
@ -410,7 +448,7 @@ export default {
headers: { headers: {
"Content-Type": "multipart/form-data" "Content-Type": "multipart/form-data"
} }
}).then(function(res) { }).then(function (res) {
me.imageUploading = false; me.imageUploading = false;
if (res.data.success) { if (res.data.success) {
// me.formValidate.logo = res.data.results; // me.formValidate.logo = res.data.results;
@ -430,7 +468,7 @@ export default {
}); });
return false; return false;
}, },
submit() { submit () {
let _this = this; let _this = this;
_this.loading = true; _this.loading = true;
if (this.welcome.stores.length <= 0) { if (this.welcome.stores.length <= 0) {

@ -204,6 +204,6 @@ export default {
height: 30px; height: 30px;
} }
button:hover { button:hover {
background: inherit !important; /*background: inherit !important;*/
} }
</style> </style>

@ -7,7 +7,7 @@ import commonUtils from '../utils/Common'
// http://mf.kiisoo.com:58080/ // http://mf.kiisoo.com:58080/
// axios.defaults.baseURL = 'https://wxtk.bsdits.com/kiisoo-ic/'; // axios.defaults.baseURL = 'https://wxtk.bsdits.com/kiisoo-ic/';
axios.defaults.baseURL = axios.defaults.baseURL =
process.env.NODE_ENV === 'production' ? 'https://wxtk.bsdits.com/kiisoo-ic/' : '/kiisoo-ic' process.env.NODE_ENV === 'production' ? '/kiisoo-ic/' : '/kiisoo-ic'
//响应时间 //响应时间
axios.defaults.timeout = 120000 axios.defaults.timeout = 120000

@ -5,32 +5,32 @@ module.exports = {
/* 用于默认#模式 */ /* 用于默认#模式 */
// publicPath: process.env.NODE_ENV === 'production' ? '/public/' : './', // publicPath: process.env.NODE_ENV === 'production' ? '/public/' : './',
/* history模式 */ /* history模式 */
publicPath: process.env.NODE_ENV === 'production' ? '/dist/' : '/', publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
/* 输出文件目录在npm run build时生成文件的目录名称 */ /* 输出文件目录在npm run build时生成文件的目录名称 */
outputDir: 'dist', outputDir: 'dist',
/* 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录 */ /* 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录 */
assetsDir: "assets", assetsDir: 'assets',
/* 是否在构建生产包时生成 sourceMap 文件false将提高构建速度 */ /* 是否在构建生产包时生成 sourceMap 文件false将提高构建速度 */
productionSourceMap: false, productionSourceMap: false,
/* 默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存,你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变) */ /* 默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存,你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变) */
filenameHashing: false, filenameHashing: false,
/* 代码保存时进行eslint检测 */ /* 代码保存时进行eslint检测 */
lintOnSave: true, lintOnSave: true,
/* webpack-dev-server 相关配置 */ /* webpack-dev-server 相关配置 */
devServer: { devServer: {
/* 自动打开浏览器 */ /* 自动打开浏览器 */
open: true, open: true,
/* 设置为0.0.0.0则所有的地址均能访问 */ /* 设置为0.0.0.0则所有的地址均能访问 */
host: '0.0.0.0', host: '0.0.0.0',
port: 8311, port: 8311,
https: false, https: false,
hotOnly: false, hotOnly: false,
disableHostCheck: true, disableHostCheck: true,
/* 使用代理 后台接口路径 */ /* 使用代理 后台接口路径 */
// proxy: 'http://192.168.1.123:8312/' // proxy: 'http://192.168.1.123:8312/'
// proxy: 'http://192.168.31.177:8312/' // proxy: 'http://192.168.31.177:8312/'
proxy: 'http://localhost:8312/' proxy: 'http://localhost:8080/',
// proxy: 'http://jdxdev.vipgz4.idcfengye.com/' // proxy: 'http://jdxdev.vipgz4.idcfengye.com/'
} },
} }

Loading…
Cancel
Save