Commit c962580b by zhangmeng

发布

parent 136870bd
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/marketing/static/css/app.a5e1c09a2ae0ab1c3621b70a4d086fc9.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/marketing/static/js/manifest.0a85049e489e85ac5f0a.js></script><script type=text/javascript src=/marketing/static/js/vendor.381a376baaa65b5cbeb9.js></script><script type=text/javascript src=/marketing/static/js/app.fa00b9230392cea410f3.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/marketing/static/css/app.0262d50895396ef22ed3455d47e439f0.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/marketing/static/js/manifest.0a85049e489e85ac5f0a.js></script><script type=text/javascript src=/marketing/static/js/vendor.381a376baaa65b5cbeb9.js></script><script type=text/javascript src=/marketing/static/js/app.75a42f29e9eb4a1327c1.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,8 +20,7 @@ import vueGicStoreGroup from '@gic-test/vue-gic-store-group'
import vueGicPeople from '@gic-test/vue-gic-people'
import vueGicConfirmPeople from '@gic-test/vue-gic-confirm-people/src/lib'
import vueGicImgPreview from '@gic-test/vue-gic-img-preview'
import vueGicMarketingEvent from '@gic-test/vue-gic-marketing-event'
Vue.use(vueGicMarketingEvent)
// import vueGicMarketingEvent from '@gic-test/vue-gic-marketing-event'
import packele from 'packele'
Vue.config.productionTip = false
......@@ -37,6 +36,7 @@ Vue.use(vueGicStoreGroup)
Vue.use(vueGicPeople)
Vue.use(vueGicConfirmPeople)
Vue.use(vueGicImgPreview)
// Vue.use(vueGicMarketingEvent)
Vue.prototype.axios = axios;
Vue.prototype.axios.withCredentials = true
Object.keys(directives).map(item => Vue.directive(item, directives[item]));
......
......@@ -48,7 +48,7 @@ export default {
}
},
{
path: 'currentlist',
path: 'currentlist/:id/:name',
name: '实时发送记录',
component: currentList,
meta: {
......
......@@ -14,8 +14,8 @@ export const deleteEcm = (params) => requests(PREFIX + 'delete-ecm', params);
//智能营销--ECM营销引擎-- 新建/修改 回显智能引擎计划信息 TODO
export const getEcmInfo = (params) => requests(PREFIX + 'deprecate/get-ecm-info', params);
// 智能营销--ECM营销引擎-- 新建/修改 [保存]计划信息
export const saveEcmInfo = (params) => requests(PREFIX + 'save-update-ecm', params);
// 智能营销--ECM营销引擎-- 新建/修改 [保存]计划信息 TODO
export const saveEcmInfo = (params) => requests(PREFIX + 'deprecate/save-update-ecm', params);
// 智能营销--下线 TODO
export const offlineEcmPlan = (params) => requests(PREFIX + 'deprecate/ecm-plan-offline', params);
......@@ -31,3 +31,8 @@ export const ecmCurrentSendInfos = (params) => requests(PREFIX + 'deprecate/ecm-
// 智能营销--实时发送人员列表 TODO
export const ecmCurrentSendDetails = (params) => requests(PREFIX + 'deprecate/ecm-current-send-details', params);
// 智能营销--记录--批次人员列表 导出csv TODO
export const exportBatchSendDetails = config.api + PREFIX + 'deprecate/export-batch-send-details';
......@@ -54,7 +54,7 @@
</section>
<section class="dm-form__wrap">
<h3 class="dm-title__label">营销方式</h3>
<vue-gic-marketing-event v-if="ecmPlanId" :ecmPlanId="ecmPlanId" :code="code"></vue-gic-marketing-event>
<marketing-event v-if="ecmPlanId" :ecmPlanId="ecmPlanId" :code="code"></marketing-event>
</section>
<div class="btn-wrap_fixed" :class="{'on':asideShow}">
<el-button type="primary" @click="submit('form')">保 存</el-button>
......@@ -73,13 +73,16 @@ import cardTemp from '@/components/libs/cardTemp'
import config from '@/config'
import wxText from '@/components/wxText/wxText'
import {checkMessageSendCount} from '@/service/api/messageApi.js';
import marketingEvent from './marketing-event/index.vue';
export default {
data () {
return {
ecmPlanId:'', // 必传,
code:'1001',
loading:false,
effectActionOptions:[{value:'subscribe',label:'关注触发'},{value:'authentication',label:'认证触发'},{value:'consume',label:'消费触发'}],
effectActionOptions:[{value:'subscribe',label:'关注触发'},{value:'authentication',label:'认证触发'}],
// {value:'consume',label:'消费触发'}
dayOptions:[
{value:0,label:'0:00'},
{value:1,label:'1:00'},
......@@ -149,11 +152,7 @@ export default {
}
},
components:{
smsTemp,
dmImgText,
dmImgBox,
cardTemp,
wxText
'marketing-event':marketingEvent
},
computed: {
asideShow() {
......
......@@ -5,6 +5,7 @@
<el-select class="dm-select" clearable v-model="listParams.success" placeholder="所有条件" @change="search">
<el-option v-for="(v,i) in successOptions" :key="i" :label="v.label" :value="v.value"></el-option>
</el-select>
<el-button icon="iconfont icon-icon_yunxiazai" class="fr" type="primary" @click="exportBatchSendDetails"> 导出列表</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%" v-loading="loading" element-loading-text="拼命加载中" >
<el-table-column type="index" width="50px" label="序号"></el-table-column>
......@@ -23,7 +24,7 @@
</el-dialog>
</template>
<script>
import {ecmBatchSendDetails} from '@/service/api/ecmApi.js';
import {ecmBatchSendDetails,exportBatchSendDetails} from '@/service/api/ecmApi.js';
import {formateDateTimeByType} from '@/utils/index.js'
export default {
name: 'ecm-batch-list',
......@@ -35,6 +36,14 @@ export default {
id:{
type:String,
default:''
},
ecmPlanName:{
type:String,
default:''
},
execTime:{
type:String,
default:''
}
},
data () {
......@@ -91,6 +100,9 @@ export default {
},
close() {
this.$emit('update:show',false);
},
exportBatchSendDetails() {
window.location = `${exportBatchSendDetails}?memberInfo=${this.listParams.memberInfo}&success=${this.listParams.success}&ecmPlanName=${this.ecmPlanName}&execTime=${this.execTime}&ecmPlanQuartzLogId=${this.id}&requestProject=gic-web`;
}
}
}
......
......@@ -22,7 +22,7 @@
</el-table-column>
</el-table>
<el-pagination v-show="tableList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
<batch-dialog :show.sync="dialogShow" :id="dialogId"></batch-dialog>
<batch-dialog :show.sync="dialogShow" :id="dialogId" :execTime="dialogExecTime" :ecmPlanName="dialogEcmPlanName"></batch-dialog>
</section>
</template>
<script>
......@@ -71,12 +71,14 @@ export default {
],
tableList:[],
dialogShow:false,
dialogId:''
dialogId:'',
dialogExecTime:'',
dialogEcmPlanName:'',
}
},
created() {
this.ecmBatchSendInfos();
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'智能营销',path:'/ecm'},{name:this.$route.params.name + ' - 批次记录',path:'/ecm'}]);
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'智能营销',path:'/ecm'},{name:this.$route.params.name + ' - 批次记录',path:''}]);
},
methods: {
search() {
......@@ -109,6 +111,8 @@ export default {
toDialog(row){
this.dialogShow = true;
this.dialogId = row.ecmPlanQuartzLogId;
this.dialogEcmPlanName = this.$route.params.name;
this.dialogExecTime = formateDateTimeByType(row.execTime,'yyyy-MM-dd-HH-mm-ss');
console.log(this.dialogId)
}
}
......
import qs from 'qs';
import axios from 'axios';
const host = window.location.origin;
const PREFIX = '/api-marketing/'
const PLUG_PREFIX = '/api-plug/'
// 加载最小时间
const MINI_TIME = 300
// 超时时间
let TIME_OUT_MAX = 20000
// 环境value
let _isDev = process.env.NODE_ENV === 'development'
// 请求接口host
let _apiHost = host.indexOf('localhost') !== -1 ? 'http://gicdev.demogic.com' : host
// 请求组(判断当前请求数)
let _requests = []
//创建一个请求实例
const instance = axios.create({
baseURL: _apiHost,
timeout: TIME_OUT_MAX,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
withCredentials: true // 允许携带cookie
})
/**
* 添加请求,显示loading
* @param {请求配置} config
*/
function pushRequest(config) {
console.log(`${config.url}--begin`)
_requests.push(config)
}
/**
* 移除请求,无请求时关闭loading
* @param {请求配置} config
*/
function popRequest(config) {
console.log(`${config.url}--end`)
let _index = _requests.findIndex(r => {
return r === config
})
if (_index > -1) {
_requests.splice(_index, 1)
}
}
/**
* 错误的处理
* @param {*} code
* @param {string} [message='请求错误']
*/
function handlerErr(code, message = '请求错误') {
switch (code) {
case 404:
message = '404,错误请求'
router.push('/404')
break;
case 401:
message = '登录失效'
break;
case 403:
message = '禁止访问'
router.push('/403')
break;
case 408:
message = '请求超时'
break;
case 500:
message = '服务器内部错误'
// router.push('/500')
break;
case 501:
message = '功能未实现'
break;
case 503:
message = '服务不可用'
break;
case 504:
message = '网关错误'
break;
}
this.$message({ type: 'warning', message: message })
}
/**
* 请求地址,请求数据,是否静默,请求方法
*/
const requests = (url, data = {}, contentTypeIsJSON = false, isSilence = false, method = 'POST') => {
let _opts = { method, url }
const _query = {}
let _timer = null
if (method.toLocaleUpperCase() === 'POST') {
if (contentTypeIsJSON) {
_opts.data = data;
_opts.headers = { 'Content-Type': 'application/json' };
_opts.url += '?requestProject=marketing';
} else {
_opts.data = qs.stringify(Object.assign({ requestProject: 'gic-web' }, data))
}
} else {
_opts.params = _query
}
return new Promise((resolve, reject) => {
let _random = { stamp: Date.now(), url: `${_apiHost + url}` }
if (!isSilence) {
_timer = setTimeout(() => {
pushRequest(_random)
}, MINI_TIME)
}
instance(_opts)
.then(res => {
clearTimeout(_timer)
popRequest(_random)
if (res.data.errorCode !== 0) {
reject(res);
handlerErr(res.data.errorCode, res.data.message);
} else {
resolve(res.data)
}
})
.catch(res => {
clearTimeout(_timer)
popRequest(_random)
if (res) {
handlerErr(res.response.status, '接口异常')
}
reject(res)
})
})
}
// 获取营销事件配置信息(类型, 最大条数)
export const getMarketingEvent = (params) => requests(PREFIX + 'get-marketing-event', params);
//素材库 图文 图文分页列表
export const loadImgTextList = (params) => requests(PREFIX + 'page-marketing-wechat-image-text', params);
//获取卡券列表
export const getCardList = (params) => requests(PLUG_PREFIX + 'get-coupon-list', params);
//素材库--图片--图片分页列表
export const loadImgList = (params) => requests(PREFIX + 'page-marketing-wechat-image', params);
//素材库--图片--编辑图片名称
export const updateImgName = (params) => requests(PREFIX + 'update-marketing-wechat-image-titlename', params);
//素材库--图片--新建图片分组
export const addGroupService = (params) => requests(PREFIX + 'save-marketing-wechat-image-group', params);
// 智能营销--ECM营销引擎-- 新建/修改 --回显营销事件类型详情 TODO
export const getMarketingTypeDetails = (params) => requests(PREFIX + 'deprecate/get-marketing-type-details', params);
// 智能营销--新增/修改营销事件类型
export const saveUpdateMarketingType = (params) => requests(PREFIX + 'deprecate/save-update-marketing-type', params);
// 智能营销 --删除营销事件
export const deleteMarketingType = (params) => requests(PREFIX + 'deprecate/delete-marketing-Type', params);
//模板库--分页列表 (有效)
export const LoadTempList = (params) => requests(PREFIX + 'load-message-templateList', params);
\ No newline at end of file
"use strict";
exports.__esModule = true;
function _broadcast(componentName, eventName, params) {
this.$children.forEach(function (child) {
var name = child.$options.componentName;
if (name === componentName) {
child.$emit.apply(child, [eventName].concat(params));
} else {
_broadcast.apply(child, [componentName, eventName].concat([params]));
}
});
}
exports.default = {
methods: {
dispatch: function dispatch(componentName, eventName, params) {
var parent = this.$parent || this.$root;
var name = parent.$options.componentName;
while (parent && (!name || name !== componentName)) {
parent = parent.$parent;
if (parent) {
name = parent.$options.componentName;
}
}
if (parent) {
parent.$emit.apply(parent, [eventName].concat(params));
}
},
broadcast: function broadcast(componentName, eventName, params) {
_broadcast.call(this, componentName, eventName, params);
}
}
};
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg fill="#909399" class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M180.224 610.304c0 76.8-56.32 142.336-132.608 153.088v134.144h928.256v-134.144c-76.288-10.752-133.12-76.288-133.12-153.088s56.32-142.336 133.12-153.088V323.072H47.616v134.144c76.288 10.752 132.608 76.288 132.608 153.088zM3.584 477.696V300.544c0-6.144 2.048-11.264 6.656-15.872 4.096-4.096 9.728-6.656 15.872-6.656H998.4c6.144 0 11.264 2.048 15.872 6.656 4.096 4.096 6.656 9.728 6.656 15.872v176.64c0 6.144-2.048 11.264-6.656 15.872-4.096 4.096-9.728 6.656-15.872 6.656-60.928 0-110.592 49.664-110.592 110.592s49.664 110.592 110.592 110.592c6.144 0 11.264 2.048 15.872 6.656 4.096 4.096 6.656 9.728 6.656 15.872v176.64c0 6.144-2.048 11.264-6.656 15.872-4.096 4.096-9.728 6.656-15.872 6.656H25.6c-6.144 0-11.264-2.048-15.872-6.656-4.096-4.096-6.656-9.728-6.656-15.872v-176.64c0-6.144 2.048-11.264 6.656-15.872 4.096-4.096 9.728-6.656 15.872-6.656 60.928 0 110.592-49.664 110.592-110.592 0-60.928-49.664-110.592-110.592-110.592-6.144 0-11.264-2.048-15.872-6.656-4.096-4.096-6.144-9.728-6.144-15.36z m377.856-223.744c-11.776 3.072-24.064-4.096-27.136-15.872-3.072-11.776 4.096-24.064 15.872-27.136l467.968-124.928c11.776-3.072 24.064 4.096 27.136 15.872l26.112 98.304c3.072 11.776-4.096 24.064-15.872 27.136-11.776 3.072-24.064-4.096-27.136-15.872l-20.48-76.8-446.464 119.296zM666.112 389.12c0-12.288 9.728-22.016 22.016-22.016s22.016 9.728 22.016 22.016v88.576c0 12.288-9.728 22.016-22.016 22.016s-22.016-9.728-22.016-22.016V389.12z m0 176.64c0-12.288 9.728-22.016 22.016-22.016s22.016 9.728 22.016 22.016v88.576c0 12.288-9.728 22.016-22.016 22.016s-22.016-9.728-22.016-22.016v-88.576z m0 176.64c0-12.288 9.728-22.016 22.016-22.016s22.016 9.728 22.016 22.016v88.576c0 12.288-9.728 22.016-22.016 22.016s-22.016-9.728-22.016-22.016V742.4z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="155.50px" viewBox="0 0 1317 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M438.857143 819.2 131.657143 512 29.257143 614.4 438.857143 1024 1316.571429 146.285714 1214.171429 43.885714Z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" fill="#909399" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M913.903509 128.089283l-805.853631 0c-38.792515 0-70.352301 31.559786-70.352301 70.352301l0 626.775047c0 38.792515 31.559786 70.352301 70.352301 70.352301l805.853631 0c38.792515 0 70.352301-31.559786 70.352301-70.352301l0-626.775047C984.255811 159.64907 952.696024 128.089283 913.903509 128.089283zM108.049878 179.254593l805.853631 0c10.579963 0 19.186991 8.607028 19.186991 19.186991l0 321.058227-236.495272-236.496296c-27.431769-27.429723-72.062246-27.429723-99.494015 0L445.901583 434.20417l-53.064566-52.707432c-27.430746-27.430746-72.063269-27.430746-99.494015 0L88.862887 585.977875l0-387.53629C88.862887 187.861622 97.469915 179.254593 108.049878 179.254593zM913.903509 844.403622l-805.853631 0c-10.579963 0-19.186991-8.607028-19.186991-19.186991L88.862887 658.33688l240.660128-240.661152c7.480368-7.482415 19.653619-7.481392 27.195386 0.061398l322.30666 320.137251c4.990664 4.956895 11.510148 7.432273 18.027585 7.432273 6.576789 0 13.151531-2.520403 18.151405-7.554046 9.956769-10.024308 9.902534-26.222221-0.121773-36.178991L482.20337 470.261387l151.077857-151.077857c7.480368-7.480368 19.652596-7.482415 27.13501 0l272.675286 272.675286 0 233.357815C933.090501 835.796594 924.483472 844.403622 913.903509 844.403622z" /></svg>
\ No newline at end of file
<svg height="200" fill="#909399" viewBox="0 0 1024 1024" width="200" xmlns="http://www.w3.org/2000/svg"><path d="m893.686 171.345h-763.374c-55.326 0-100.6 45.272-100.6 100.601v526.064c0 55.328 45.272 100.603 100.6 100.603h763.374c55.328 0 100.603-45.274 100.603-100.603v-526.064c-.001-55.329-45.275-100.601-100.603-100.601m37.723 626.663c0 9.968-3.954 19.404-11.13 26.587-7.185 7.185-16.629 11.137-26.594 11.137h-763.373c-9.965 0-19.41-3.952-26.592-11.137-7.177-7.183-11.13-16.619-11.13-26.587v-526.062c0-9.967 3.954-19.412 11.13-26.594 7.182-7.175 16.626-11.131 26.592-11.131h763.374c9.965 0 19.412 3.956 26.594 11.131 7.178 7.182 11.133 16.628 11.133 26.594v526.062z"/><path d="m815.983 326.708-295.53 221.65-295.529-221.65c-13.883-10.416-33.594-7.6-44.01 6.288-10.417 13.893-7.603 33.597 6.287 44.013l314.394 235.797c.007.008.02.014.025.019.69.516 1.399 1.002 2.126 1.457.016.013.04.026.066.037a30.93 30.93 0 0 0 1.949 1.124c.15.076.294.152.444.227.666.341 1.338.666 2.028.954.126.056.254.096.378.148a35.8 35.8 0 0 0 1.682.624c.293.104.587.192.886.288.415.127.835.245 1.255.354.299.079.593.164.895.234.637.144 1.277.271 1.927.387.294.045.582.082.876.119.454.065.904.118 1.355.161.275.023.551.056.828.071.666.045 1.324.071 1.99.079.043 0 .085.006.127.006h.055c.04 0 .085-.006.127-.006a35.323 35.323 0 0 0 1.985-.079c.275-.016.553-.048.828-.071.457-.043.906-.096 1.361-.161.293-.037.582-.074.875-.119.648-.11 1.291-.24 1.934-.387.293-.07.59-.155.883-.234.42-.109.846-.228 1.261-.359.294-.091.587-.18.88-.283.572-.19 1.135-.399 1.693-.629.118-.048.245-.088.367-.144.689-.288 1.361-.61 2.033-.954.15-.071.293-.147.443-.227.654-.35 1.301-.715 1.938-1.111l.085-.056a31.568 31.568 0 0 0 2.104-1.443.105.105 0 0 1 .037-.024l314.396-235.797c13.889-10.417 16.702-30.123 6.279-44.012-10.419-13.886-30.121-16.707-44.013-6.291"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" fill="#909399" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M903.9 916.4H123.4c-61.2 0-111.1-49.8-111.1-111.1V219.7c0-61.2 49.8-111.1 111.1-111.1h780.5c61.2 0 111.1 49.8 111.1 111.1v585.6c0 61.3-49.8 111.1-111.1 111.1zM123.4 169.2c-27.8 0-50.5 22.6-50.5 50.5v585.6c0 27.8 22.6 50.5 50.5 50.5h780.5c27.8 0 50.5-22.6 50.5-50.5V219.7c0-27.8-22.6-50.5-50.5-50.5H123.4z" /><path d="M327.1 591.6H213c-39 0-70.7-31.7-70.7-70.7V341.8c0-39 31.7-70.7 70.7-70.7h114.1c39 0 70.7 31.7 70.7 70.7v179.1c0 39-31.7 70.7-70.7 70.7zM213 331.7c-5.5 0-10.1 4.6-10.1 10.1v179.1c0 5.5 4.6 10.1 10.1 10.1h114.1c5.5 0 10.1-4.6 10.1-10.1V341.8c0-5.5-4.6-10.1-10.1-10.1H213z" /><path d="M172.6 723.7h649.7" /><path d="M822.3 754H172.6c-16.7 0-30.3-13.6-30.3-30.3s13.6-30.3 30.3-30.3h649.7c16.7 0 30.3 13.6 30.3 30.3S839 754 822.3 754z" /><path d="M562.4 528.8h259.9" /><path d="M822.3 559.1H562.4c-16.7 0-30.3-13.6-30.3-30.3s13.6-30.3 30.3-30.3h259.9c16.7 0 30.3 13.6 30.3 30.3s-13.6 30.3-30.3 30.3z" /><path d="M562.4 333.9h259.9" /><path d="M822.3 364.2H562.4c-16.7 0-30.3-13.6-30.3-30.3s13.6-30.3 30.3-30.3h259.9c16.7 0 30.3 13.6 30.3 30.3s-13.6 30.3-30.3 30.3z" /></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" fill="#909399" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M762.8 1024l-5.6-0.1c-125.5-6.4-290.5-119.2-442.2-301.8l-54-64.9C106.7 471.6 29.5 294.9 49.1 172.3 64.9 74 199.1 0 278.4 0c51.1 0 71.1 29.2 77.8 43.7 37.2 66.2 88.6 189 88.9 241l0.1 9-3.3 8.5c-12.4 32.6-39.7 48-57.8 58.2-16.4 9.2-18.8 11.3-19.5 15.6 2 6.6 15.2 40.1 94.8 137.8l41.1 49.3c80.8 94.9 110.8 113.2 116.4 116 5.1 0.5 7.7-1 21-15.5 13.9-15.2 34.9-38.1 70-43.2l8.7-1.2 8.4 1.8c51.6 10.8 164.6 85.7 223.9 135.2 21.5 15.3 38.4 48.3 23.1 96.5-22.3 69.7-114.9 171.3-209.2 171.3zM278.4 63.6c-54.1 0-156.8 58.7-166.4 118.7-16.3 101.4 59.6 267.8 197.9 434.2l54 64.9C502.4 848.1 654 954.9 759.4 960.3h3.6c59.6-0.2 132.3-77 148.3-127.2 5.4-16.9 2.3-24 0.6-25.3l-2.8-2.1c-61.2-51.3-159.1-112.5-194.6-122-10.6 2.4-18.4 10.4-29.7 22.8-15.9 17.3-37.7 41.1-78.9 35.3-11.5-1.6-41.9-5.9-154.1-137.8l-41.5-49.8C298.1 416.6 300 387 300.8 374.3c2.7-41.7 30-57 51.9-69.3 14.5-8.1 24-14 28.6-23.1-2.6-36-43.8-142-81.3-208.2l-1.6-3.1c-2.6-6.3-14.9-7-20-7z m339.4 615.9zM364.2 374.7z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" fill="#909399" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M170.496 179.2h683.52v106.496h-683.52z" /><path d="M458.752 179.2h106.496v683.52h-106.496z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M511.858139 0.60441c-282.494127 0-511.500488 229.006361-511.500488 511.500488s229.006361 511.500488 511.500488 511.500487 511.500488-229.006361 511.500487-511.500487a511.500488 511.500488 0 0 0-511.500487-511.500488z m256.466544 459.737038a151.813744 151.813744 0 0 1-87.262783 65.675863 83.16978 83.16978 0 0 1-24.449123 4.092004c-16.045331 0-29.053627-13.007298-29.053628-29.052628s13.007298-29.053627 29.053628-29.053627c2.210841 0.05095 4.407696-0.367641 6.444706-1.227801a91.353787 91.353787 0 0 0 55.855454-40.920039 75.190572 75.190572 0 0 0 11.049209-39.589339c0-45.933143-42.45454-83.78418-94.21799-83.78418a105.1643 105.1643 0 0 0-51.150049 13.400914 81.840078 81.840078 0 0 0-43.68334 70.383266V634.250615c-0.516496 50.330849-28.33433 96.405854-72.633069 120.304515a159.486252 159.486252 0 0 1-79.692176 20.460019c-84.294681 0-153.450146-63.42606-153.450146-141.890435a136.05913 136.05913 0 0 1 19.744718-69.768866 151.813744 151.813744 0 0 1 87.261783-65.675864 85.830181 85.830181 0 0 1 24.450123-4.092004c16.045331 0 29.052628 13.007298 29.052628 29.052629 0 16.04633-13.007298 29.053627-29.052628 29.053627a15.651715 15.651715 0 0 0-6.444706 1.227801 95.855391 95.855391 0 0 0-55.855454 40.920039 75.190572 75.190572 0 0 0-11.04921 39.589339c0 45.933143 42.45454 83.78418 94.83239 83.784179a105.1643 105.1643 0 0 0 51.150049-13.400913 81.840078 81.840078 0 0 0 43.579442-70.383266V390.572581c0.566447-50.37081 28.413253-96.468792 72.735969-120.407414a151.097444 151.097444 0 0 1 79.077776-21.483021c84.294681 0 153.450146 63.42606 153.450146 141.890435a136.05913 136.05913 0 0 1-19.743719 69.768867z" fill="#24AF41" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" fill="#909399" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M691.198707 135.809293c121.069899 0 219.59499 91.010586 219.59499 203.733333 0 35.069414-10.016323 69.302303-28.387556 100.196849-27.552323 45.08703-71.801535 78.491152-125.240888 94.354101-14.197657 4.172283-25.051798 5.845333-35.069415 5.845333-23.378747 0-41.74998-18.368646-41.749979-41.748687s18.371232-41.751273 41.749979-41.751273c1.664 0 5.008808 0 9.182384-1.664 35.905939-10.025374 64.293495-30.895838 80.155152-58.455919 10.860606-17.533414 15.869414-36.732121 15.869414-56.775111 0-65.966545-60.956444-120.233374-135.267556-120.233374-25.885737 0-50.937535 6.681859-73.48105 19.198708-39.24299 22.552566-62.621737 60.121212-62.621738 101.035959v349.862788c0 70.963717-39.241697 136.092444-104.370424 172.833616-35.068121 20.04299-74.317576 30.060606-114.395798 30.060606C216.096323 892.302222 117.569939 801.286465 117.569939 688.571475c0-35.070707 10.017616-69.308768 28.388849-100.199435 27.549737-45.094788 71.808-78.491152 125.248646-94.352808 15.026424-4.173576 25.04404-5.84404 35.069414-5.84404 23.38004 0 41.742222 18.369939 41.742223 41.748687s-18.362182 41.74998-41.742223 41.74998c-1.671758 0-5.017859 0-9.190141 1.664-35.904646 10.854141-64.293495 31.734949-80.153859 58.448161-10.854141 17.536-15.862949 36.743758-15.862949 56.785455 0 65.956202 60.947394 120.230788 136.096323 120.230788 25.885737 0 50.937535-6.67798 73.481051-19.205172 39.241697-22.542222 62.621737-60.112162 62.621737-101.025616V339.542626c0-70.975354 39.241697-136.104081 104.370424-172.834909 34.231596-20.880808 73.481051-30.898424 113.559273-30.898424zM34.909091 512.466747" /></svg>
\ No newline at end of file
/* reset样式 */
.w100 {
width: 100px;
}
.w200 {
width: 200px;
}
.w240 {
width: 240px;
}
.w400{
width: 400px;
}
.w500{
width: 500px;
}
.inline-block {
vertical-align: middle;
display:inline-block!important;
}
.block{
display: block!important;
}
.gray-color,.gray{
color:#909399;
}
.pb22 {
padding-bottom:22px;
}
.pb10 {
padding-bottom:10px;
}
.pl20 {
padding-left: 20px;
}
.pl10{
padding-left:10px;
}
.pr10{
padding-right:10px;
}
.fz13 {
font-size: 13px;
}
.fz12 {
font-size: 12px;
}
.fl {
float: left;
}
.fr {
float: right;
}
.clearfix:after{
display: block;
clear: both;
content: '';
visibility: hidden;
height: 0;
}
.clearfix{
zoom: 1;
}
.vertical-middle {
vertical-align: middle;
}
.block{
display: block;
overflow: hidden;
}
.ellipsis{
max-height:20px;
line-height:20px;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-line-clamp:1;
-webkit-box-orient:vertical
}
.ellipsis-l2{
max-height:40px;
line-height:20px;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient:vertical
}
.ellipsis-l3{
max-height:60px;
line-height:20px;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical
}
.blue {
color: #1890ff;
cursor: pointer;
}
.label-hidden .el-checkbox__label, .label-hidden .el-radio__label {
opacity: 0;
position: absolute;
}
.dm-pagination {
text-align: right;
margin: 24px 0 10px 0;
}
.text-left {
text-align: left;
}
/* reset样式end */
.dm-marketing__opt{
background: #FFFFFF;
border: 1px solid rgba(235,238,245,1);
box-shadow: 0px 1px 20px 0px rgba(0,0,0,0.15);
padding:0 20px;
}
.dm-marketing__opt--label{
vertical-align: middle;
color:#303133;
font-size:14px;
}
.dm-marketing__opt--icon,.dm-marketing__opt--icon--bottom {
display:inline-block;
font-size:20px;
padding:8px;
margin:0 10px;
color:#909399;
border:1px solid #E4E7ED;
border-radius:50%;
vertical-align: middle;
cursor: pointer;
}
.dm-marketing__opt--icon:hover,.dm-marketing__opt--icon--bottom:hover {
color:#1890ff;
border:1px solid #1890ff;
}
.dm-marketing__opt--icon.el-icon-delete:hover {
color:#f56c6c;
border:1px solid #f56c6c;
}
.dm-marketing__opt--icon--bottom{
margin:20px 0 0 60px;
}
.dm-marketing__opt__item {
display:inline-block;
height:36px;
line-height:36px;
margin-right:30px;
cursor: pointer;
}
.dm-marketing__opt__item > img {
vertical-align: middle;
height: 17px;
width: auto;
color: #909399;
}
.dm-marketing__opt__item > span {
vertical-align: middle;
color: #606266;
font-size:14px;
}
.dm-marketing__content--label{
position: relative;
top: 40px;
left: 0;
}
.dm-marketing__content--wrap{
margin-top:30px;
max-width:1200px;
}
.dm-marketing__content{
margin-left:70px;
}
.dm-marketing__content__item{
padding: 20px 0 0 0;
min-width: 950px;
}
.dm-marketing__content__item::after {
content: '';
height: 1px;
width: 100%;
background: #E4E7ED;
display: block;
margin-left: 48px;
margin-top: 20px;
}
.dm-marketing__content--index{
display:inline-block;
width:24px;
height:24px;
line-height:24px;
text-align:center;
vertical-align:middle;
border:1px solid #E4E7ED;
border-radius:50%;
padding:4px;
color:#606266;
}
/* item */
.dm-imgText__item__wrap{
display: inline-block;
position: relative;
width: 320px;
/* height: 290px; */
margin:0 10px;
vertical-align: middle;
background: #fff;
border:1px solid #E4E7ED;
border-radius:4px;
box-shadow: 0px 2px 8px 0px rgba(0,0,0,0.10);
}
.dm-imgText__item__mask{
position: absolute;
top: 0;
left: 0;
width: 320px;
height: 100%;
border-radius:4px;
background: rgba(0,0,0,0.5);
text-align: center;
color: #fff;
line-height: 290px;
cursor: pointer;
z-index:9;
}
.dm-imgText__item__other__mask {
position: absolute;
top: 0;
left: 0;
width: 320px;
height: 100%;
border-radius:4px;
background: rgba(0,0,0,0.5);
text-align: center;
color: #fff;
line-height: 290px;
cursor: pointer;
z-index:9;
}
.dm-imgText__item{
position: relative;
padding:15px;
}
.dm-imgText__item > img{
display: inline-block;
width: 290px;
height: 163px;
margin: 20px 0 20px;
}
.dm-imgText__item__other{
position: relative;
border-top: 1px solid #E4E7ED;
padding:15px;
}
.dm-imgText__item__other > img{
float: left;
width: 60px;
height: 60px;
margin-right: 10px;
}
.dm-imgText__item__other > p{
float: left;
width: 210px;
}
.dm-text__wrap{
width: 500px;
margin-left: 10px;
}
.dm-image__item__wrap{
display: inline-block;
margin-left: 10px;
vertical-align: middle;
text-align: center;
/* width: 180px; */
height: 122px;
border: 1px solid rgba(228,231,237,1);
border-radius: 2px;
}
.dm-image__item__wrap > img {
width: auto;
height: 100%;
}
.dm-wxa__item__wrap{
display: inline-block;
position: relative;
width: 320px;
height: 347px;
margin:0 10px;
vertical-align: middle;
background: #fff;
border:1px solid #E4E7ED;
border-radius:4px;
box-shadow: 0px 2px 8px 0px rgba(0,0,0,0.10);
}
.dm-wxa__item{
padding:15px;
}
.dm-wxa__avatar {
padding-bottom:15px;
}
.dm-wxa__avatar > img {
width: 50px;
height: 50px;
border-radius: 50%;
vertical-align: middle;
}
.dm-wxa__avatar > span {
vertical-align: middle;
max-width: 100px;
line-height: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
.dm-wxa__item > img{
display: inline-block;
width: 290px;
height: 163px;
margin: 20px 0 15px;
}
.dm-wxa__item--bottom > img {
width: 14px;
height: 14px;
vertical-align: middle;
}
.dm-wxa__item--bottom > span {
vertical-align: middle;
color: #909399;
font-size: 12px;
}
/* card */
.dm-card__item__wrap{
display: inline-block;
position: relative;
width: 298px;
height: 142px;
margin:0 10px;
vertical-align: middle;
border: 1px solid rgba(228,231,237,1);
border-radius: 4px;
}
.dm-card__item {
padding:0 15px;
background: rgba(72,170,3,0.85);
height:106px;
line-height: 106px;
}
.dm-card__item__avatar {
width: 60px;
height: 60px;
border-radius: 50%;
vertical-align: middle;
}
.dm-card__item__title {
vertical-align: middle;
margin-left: 8px;
max-width: 100px;
font-size: 16px;
font-weight: 500;
line-height: 30px;
color: #fff;
overflow: hidden;
text-overflow: ellipsis;
}
.dm-card__item__desc{
vertical-align: middle;
margin-left: 8px;
max-width: 100px;
font-size: 12px;
line-height: 20px;
color: #fff;
overflow: hidden;
text-overflow: ellipsis;
}
.dm-card__item--bottom {
vertical-align: middle;
line-height: 106px;
color: #909399;
font-size: 12px;
line-height: 36px;
padding-left: 15px;
}
/* teltask message */
.dm-message__item__wrap,.dm-teltask__item__wrap{
width: 760px;
height: 94px;
margin:0 10px;
border: 1px solid rgba(228,231,237,1);
border-radius: 4px;
display: inline-block;
vertical-align: middle;
}
.dm-message__item,.dm-teltask__item{
padding: 15px;
display: inline-block;
vertical-align: middle;
}
.dm-message__item--title,.dm-teltask__item--title {
font-size: 16px;
max-height: 36px;
line-height: 36px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.dm-message__item--content,.dm-teltask__item--content {
font-size: 14px;
color: #606266;
max-height: 30px;
line-height: 30px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
/**
* 补零
* @param {String/Number} num
*/
export const fillZero = (num) => {
num = num * 1;
if (num < 10) {
return '0' + num;
} else {
return num;
}
}
/**
* @param {*时间} date
* @param {*转换的格式} type
*/
export const formateDateTimeByType = (date, type = 'yyyy-MM-dd-HH-mm-ss') => {
if (!date){return ''}
if (typeof date === 'number') {
date = new Date(date);
}
if (typeof date === 'string') {
return date
} else {
var year = type.indexOf('yyyy') >= 0 ? (fillZero(date.getFullYear())) : '';
var month = type.indexOf('MM') >= 0 ? ('-' + fillZero(date.getMonth() + 1)) : '';
var day = type.indexOf('dd') >= 0 ? ('-' + fillZero(date.getDate())+'') : '';
var hours = type.indexOf('HH') >= 0 ? (' ' + fillZero(date.getHours())) : '';
var min = type.indexOf('mm') >= 0 ? (':' + fillZero(date.getMinutes())) : '';
var sec = type.indexOf('ss') >= 0 ? (':' + fillZero(date.getSeconds())) : '';
// console.log(year+month+day+hours+min+sec);
return year + month + day + hours + min + sec;
}
}
/*
* 限制字数用, 一个汉字算一个字,两个英文/字母算一个字
*/
export const getByteVal = (val, max) =>{
var returnValue = '';
var byteValLen = 0;
for (var i = 0; i < val.length; i++) {
if (val[i].match(/[^\x00-\xff]/ig) != null)
byteValLen += 1;
else
byteValLen += 0.5;
if (byteValLen > max)
break;
returnValue += val[i];
}
return returnValue;
};
/*
* 一个汉字算一个字,一个英文字母或数字算半个字
*/
export const getZhLen = (val) => {
var len = 0;
for (var i = 0; i < val.length; i++) {
var a = val.charAt(i);
if (a.match(/[^\x00-\xff]/ig) != null) {
len += 1;
}
else {
len += 0.5;
}
}
return Math.ceil(len);
};
/*
* 一个汉字算一个字,两个英文/字母算一个字
*/
export const getByteVal2 = (val) => {
var returnValue = '';
var byteValLen = 0;
for (var i = 0; i < val.length; i++) {
if (val[i].match(/[^\x00-\xff]/ig) != null)
byteValLen += 1;
else
byteValLen += 0.5;
returnValue += val[i];
}
return returnValue;
}
<template>
<el-popover class="el-button el-button--text"
placement="top"
width="160"
v-model="visible">
<p style="line-height:1.5;padding:10px 10px 20px;color:#606266;">{{tips}}</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="cancel">取消</el-button>
<el-button type="primary" size="mini" @click="confirm">确定</el-button>
</div>
<span slot="reference"><slot></slot></span>
</el-popover>
</template>
<script>
export default {
name:'dm-delete',
props:{
tips:{
type:String,
default:'是否删除?'
},
},
data() {
return {
visible: false,
};
},
methods:{
cancel() {
this.visible = false
},
confirm() {
this.visible = false
this.$emit('confirm')
}
}
}
</script>
<template>
<div class="dm-input" :class="{'disabled':disabled}">
<el-input
ref="elInput"
v-model="currentValue"
:placeholder="placeholder"
:size="size"
:resize="resize"
:name="name"
:form="form"
:id="id"
:maxlength="maxlength"
:minlength="minlength"
:readonly="readonly"
:autofocus="autofocus"
:disabled="disabled"
:type="type"
:autosize="autosize"
:rows="rows"
:autoComplete="autoComplete"
:max="max"
:min="min"
:step="step"
:validateEvent="validateEvent"
:suffixIcon="suffixIcon"
:prefixIcon="prefixIcon"
:label="label"
:clearable="clearable"
:tabindex="tabindex"></el-input>
<div class="dm-input__counter" :class="{'text-area':type === 'textarea'}">
<div class="dm-input__counter--inner">
<span class="cur">{{currentValue.length}}</span>
<span class="split"> / </span>
<span class="max">{{maxlength||0}}</span>
</div>
</div>
</div>
</template>
<script>
import emitter from '../assets/emitter.js';
export default {
name: 'dm-input',
props: {
// 自定义属性
// maxLength: Number,
// 原生属性
value: [String, Number],
placeholder: String,
size: String,
resize: String,
name: String,
form: String,
id: String,
maxlength: Number,
minlength: Number,
readonly: Boolean,
autofocus: Boolean,
disabled: Boolean,
type: {
type: String,
default: 'text'
},
autosize: {
type: [Boolean, Object],
default: false
},
rows: {
type: Number,
default: 2
},
autoComplete: {
type: String,
default: 'off'
},
max: {},
min: {},
step: {},
validateEvent: {
type: Boolean,
default: true
},
suffixIcon: String,
prefixIcon: String,
label: String,
clearable: {
type: Boolean,
default: false
},
tabindex: String
},
data() {
return {
currentValue: this.value,
};
},
// computed: {
// readonly() {
// return this.currentValue.length >= this.maxlength;
// }
// },
watch: {
value(val) {
if (val !== this.currentValue) {
this.currentValue = val;
}
},
currentValue(val) {
let value = '';
if (val.length > this.maxlength) {
value = val.slice(0, maxlength - 1);
} else {
value = val;
}
this.$emit('input', value);
this.dispatch('ElFormItem', 'el.form.change', [val]);
}
},
mixins: [emitter],
}
</script>
<style lang="scss" scoped>
.dm-input {
display: inline-block;
background: #fff;
width: 100%;
position: relative;
&.disabled {
background: #f5f7fa;
}
&__counter {
position: absolute;
bottom: 1px;
right: 10px;
height: 28px;
line-height: 12px;
font-size: 12px;
background: inherit;
opacity: 0.9;
&--inner{
display: flex;
align-items: center;
height: 100%;
& > span {
color:#909399;
}
}
}
&__counter.text-area {
bottom: -20px;
height: 20px;
right: 0;
}
}
</style>
<template>
<div class="dm-card__item__wrap">
<div class="dm-card__item" :style="{background:item.cardColor}">
<img class="dm-card__item__avatar" :src="item.brandLogo || loadErrorImg" alt="">
<div class="inline-block">
<p class="dm-card__item__title">{{item.cardName}}</p>
<p class="dm-card__item__desc" v-if="item.cardEffectiveMode !== 0">领取后第{{item.startDay+1}}-{{item.limitDay+item.startDay}}</p>
<p class="dm-card__item__desc" v-if="item.cardEffectiveMode === 0">{{formateDateTimeByType(item.beginDate,'yyyy-MM-dd')}}{{formateDateTimeByType(item.endDate,'yyyy-MM-dd')}}</p>
</div>
</div>
<p class="dm-card__item--bottom">
<span>适用{{item.storeMode === 0 ? "所有门店" : (item.storeMode === 1 ? "部分分组" : "部分门店")}}</span>
</p>
</div>
</template>
<script>
import {formateDateTimeByType} from '../assets/utils.js'
export default {
name:'item-card',
data(){
return {
formateDateTimeByType,
loadErrorImg:require('../assets/img/loaderror.png')
}
},
props:{
item:{
type: Object,
default() {
return {}
}
}
}
}
</script>
<template>
<span class="dm-image__item__wrap">
<img :src="item.qcloudImageUrl || loadErrorImg" alt="">
</span>
</template>
<script>
export default {
name: 'item-image',
props: {
item: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
loadErrorImg:require('../assets/img/loaderror.png')
}
}
}
</script>
<template>
<span class="dm-message__item__wrap">
<div class="dm-message__item">
<p class="dm-message__item--title">{{item.title}}</p>
<p class="dm-message__item--content">{{item.content}}</p>
</div>
</span>
</template>
<script>
export default {
name: 'item-message',
props: {
item: {
type: Object,
default() {
return {}
}
}
}
}
</script>
<template>
<div class="dm-imgText__item__wrap" >
<div v-for="(v,i) in item.itemList" :key="i">
<div class="dm-imgText__item" v-if="i === 0" @mouseover="v.maskShow = true" @mouseout="v.maskShow = false">
<div v-show="v.maskShow" class="dm-imgText__item__mask" @click="window.open(v.mediaUrl)">预览文章</div>
<p class="ellipsis-l2">{{v.titleName}}</p>
<img :src="v.qcloudImageUrl || loadErrorImg" alt="" srcset="">
<p class="ellipsis fz13 gray-color">{{v.remark}}</p>
</div>
<div class="dm-imgText__item__other clearfix" v-else @mouseover="v.maskShow = true" @mouseout="v.maskShow = false">
<div v-show="v.maskShow" class="dm-imgText__item__other__mask" @click="window.open(v.mediaUrl)">预览文章</div>
<img :src="v.qcloudImageUrl || loadErrorImg" alt="" srcset="">
<p class="ellipsis-l2">{{v.titleName}}</p>
</div>
</div>
</div>
</template>
<script>
export default {
name:'item-teletext',
data(){
return {
maskShow:false,
loadErrorImg:require('../assets/img/loaderror.png')
}
},
props:{
item:{
type: Object,
default() {
return {
itemList:[]
}
}
}
},
created() {
if (this.item.itemList instanceof Array) {
this.item.itemList.forEach(v => {
v.maskShow = false
})
}
}
}
</script>
<template>
<span class="dm-teltask__item__wrap">
<div class="dm-teltask__item">
<p class="dm-teltask__item--title">{{item.title}} <span class="fz13 gray-color">任务逾期判定{{item.lateDays}}天之后</span></p>
<p class="dm-teltask__item--content">{{item.content}}</p>
</div>
</span>
</template>
<script>
export default {
name: 'item-teltask',
props: {
item: {
type: Object,
default() {
return {}
}
}
}
}
</script>
<template>
<span class="dm-text__wrap ellipsis-l2 inline-block" v-html="item.content"></span>
</template>
<script>
export default {
name: 'item-text',
props: {
item: {
type: Object,
default() {
return {}
}
}
}
}
</script>
<template>
<div class="dm-wxa__item__wrap" @mouseover="maskShow = true" @mouseout="maskShow = false">
<div class="dm-wxa__item">
<div class="dm-wxa__avatar">
<img :src="item.brandLogo || loadErrorImg" alt="">
<span>{{item.brandName}}</span>
</div>
<p class="ellipsis-l2">{{item.title}}</p>
<img :src="item.imageUrl || loadErrorImg" alt="" srcset="">
<p class="dm-wxa__item--bottom"><img src="../assets/img/wxa-circle.svg" alt="" srcset=""><span> 小程序</span></p>
</div>
</div>
</template>
<script>
export default {
name:'item-wxa',
data(){
return {
maskShow:false,
loadErrorImg:require('../assets/img/loaderror.png')
}
},
props:{
item:{
type: Object,
default() {
return {}
}
}
}
}
</script>
<template>
<el-dialog title="选择卡券" :visible.sync="show" width="800px" :before-close="close">
<div class="clearfix pb22">
<div class="fl">
<span>{{total}}</span>
<el-input v-model="listParams.searchParam" class="w200" clearable placeholder="请输入卡券名称" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<span class="fz12 gray pl20">{{limitTips}} </span>
</div>
<div class="fr">
<el-button type="primary" @click="add">新建卡券</el-button>
<el-button @click="refresh">刷新列表</el-button>
</div>
</div>
<el-table tooltipEffect="light" :data="tableList" :height="360" style="width: 100%" v-loading="loading" @row-click="rowClick">
<el-table-column :show-overflow-tooltip="false" width="60" align="center" prop="coupCardId">
<template slot-scope="scope">
<div class="sms-record_left label-hidden">
<el-radio v-model="selectedData" :label="scope.row" class="pr10"></el-radio>
</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="false" align="left" prop="cardName" label="卡券名称"></el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="100" align="left" prop="cardLimit" label="领取限制"></el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="120" align="left" prop="storeMode" label="适用门店">
<template slot-scope="scope">
{{scope.row.storeMode === 0?'所有门店':(scope.row.storeMode === 1?'部分分组':'部分门店')}}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="100" align="left" prop="couponStock" label="库存"></el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" prop="subName" label="描述"></el-table-column>
</el-table>
<el-pagination v-show="tableList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
<el-button type="primary" @click="addItem">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {getCardList} from '../assets/api.js';
export default {
name:'lib-card',
props:{
show:{
type:Boolean,
default:false
},
cardLimitType:{
type:Number,
default:1
}
},
computed:{
limitTips() {
if (this.cardLimitType === 2) {
return '领取限制领取 1~100的卡券,系统已过滤。';
} else if (this.cardLimitType === 3) {
return '领取限制领取>=100 的卡券,系统已过滤。';
} else {
return '领取限制>1的卡券不支持选择,系统已过滤。';
}
}
},
data(){
return{
listParams:{
searchParam:'',
currentPage:1,
pageSize:10,
requestProject:'gic-web',
cardLimitType:this.cardLimitType,
cardType:''
},
total:0,
tableList:[],
selectedData:{}
}
},
created(){
this.getCardList();
},
methods:{
handleSizeChange(val) {
this.listParams.pageSize = val;
this.getCardList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.getCardList();
},
getCardList() {
this.loading = true;
getCardList(this.listParams).then(res => {
if (res.errorCode === 0) {
this.tableList = res.result.result || [];
this.total = res.result.totalCount;
}
this.loading = false;
})
},
reset() {
this.listParams.searchParams = '';
this.getCardList();
},
close() {
this.$emit('update:show',false);
},
rowClick(row) {
row.comName = 'card';
this.selectedData = row;
},
addItem() {
if (!this.selectedData.comName) {
this.$message({type:'warning',message:'未选择卡券'});
return;
}
this.$emit('sendItem',this.selectedData);
this.close();
},
add() {
winodw.open('/marketing/#/card/add');
},
refresh() {
this.listParams.currentPage = 1;
this.getCardList();
}
}
}
</script>
<template>
<el-dialog title="选择图片" :visible.sync="show" width="800px" :before-close="close">
<div class="dm-ilib clearfix">
<nav class="fl">
<h4 class="text-left pl10" ><el-button style="font-weight: 500;" size="small" type="text" icon="el-icon-plus" @click.stop="addGroup">新建分组</el-button></h4>
<ul class="dm-ilib-category">
<li v-for="(v,i) in groupsList" :key="i" @click="changeGroup(v)" :class="{'active':listParams.wechatImageGroupId===v.wechatImageGroupId}"><span class="ellipsis-80">{{v.groupName}}</span><span class="fz10 gray"> ({{v.imageCount}})</span></li>
</ul>
</nav>
<article class="fr">
<div class="dm-ilib-header">
<h4>{{listParams.wechatImageGroupId?currentGroup.groupName:'所有图片'}}</h4>
<div class="dm-ilib-opt_right">
<span class="fz12 gray pr10">大小不超过2M</span>
<label class="el-button el-button--primary el-button--small" :class="{'is-disabled':upLoadDisabled}">{{upLoadDisabled?'上传中...':'上传图片'}}
<input type="file" style="display:none;" :disabled="upLoadDisabled" accept="image/gif, image/jpeg,image/png" ref="uploader" v-imglibupload='this'>
</label>
</div>
</div>
<el-checkbox-group v-loading="loading" v-model="selectedId" :max="1" class="clearfix img-item__wrap">
<label :name="v.imageId" class="dm-img-item" v-for="(v,i) in imgList" :key="i" :item="v" @click.stop.prevent="rowClick(v)">
<div class="dm-img-item_top">
<img :src="v.qcloudImageUrl" alt="" srcset="">
</div>
<div class="dm-img-item_center">
<el-checkbox :label="v.imageId">{{v.imageTitle}}</el-checkbox>
</div>
</label>
</el-checkbox-group>
<el-pagination v-show="imgList.length" background class="dm-pagination imglib-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
</article>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
<el-button type="primary" @click="addItem">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {loadImgList,addGroupService} from '../assets/api.js';
export default {
name:'lib-img',
props:{
show:{
type:Boolean,
default:false
},
},
created(){
this.loadImgList();
},
data() {
return {
upLoadDisabled:false,
imgList:[],
listParams:{
currentPage:1,
pageSize:12,
wechatImageGroupId:''
},
total:0,
selectedData:{},
selectedId:[],
groupsList:[],
groupsMoveList:[],
loading:true,
currentGroup:{groupName:''},
moveImgVal:'',
fileList: [],
}
},
methods:{
handleSizeChange(val) {
this.listParams.pageSize = val;
this.loadImgList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.loadImgList();
},
loadImgList() {
this.loading = true;
loadImgList(this.listParams).then(res => {
if (res.errorCode === 0) {
this.total = res.result.page.totalCount;
this.currentGroup = res.result.currentGroup;
this.groupsMoveList = Object.assign([],res.result.groups);
this.groupsList = res.result.groups;
this.groupsList.unshift({wechatImageGroupId: "",groupName: "所有图片",imageCount: res.result.totalPicsCount })
this.imgList = [];
if (res.result.page.result) {
const resList = res.result.page.result;
this.$nextTick(_ => {
resList.map(v => {
this.imgList.push(v)
})
})
} else {
this.imgList = [];
}
}
this.loading = false;
}).catch(err => {
this.$message({type:'warning',message:'获取图片列表错误'});
})
},
changeGroup(v){
this.listParams.wechatImageGroupId = v.wechatImageGroupId;
this.loadImgList();
},
addGroup() {
this.$prompt('', '新增分组', {
confirmButtonText: '确定',
cancelBUttonText: '取消',
inputPattern: /\S/,
inputPlaceholder:'请输入分组名称',
inputErrorMessage: '名称不能为空',
inputValue:'新分组',
}).then(({ value }) => {
this.addGroupService(value);
}).catch(err => {
console.log(err)
});
},
addGroupService(val) {
addGroupService({groupName:val}).then(res => {
if (res.errorCode === 0) {
this.$message({type: 'success',message: '新增成功'});
this.loadImgList();
} else {
this.$message({type: 'error',message: '新增失败'});
}
}).catch(err => {
this.$message({type: 'error',message: '新增失败'});
})
},
close() {
this.$emit('update:show',false);
},
rowClick(row) {
row.comName = 'image';
row.title = row.imageTitle;
this.selectedId = [row.imageId];
this.selectedData = row;
},
addItem() {
if (!this.selectedData.comName) {
this.$message({type:'warning',message:'未选择图片'});
return;
}
this.$emit('sendItem',this.selectedData);
this.close();
}
}
}
</script>
<style lang="scss" scoped>
.dm-ilib{
border: 1px solid #DCDFE6;
border-radius: 2px;
&>article{
position:relative;
width: calc(80% - 1px);
border-left: 1px solid #DCDFE6;
border-radius:0 2px 2px 0;
height:400px;
.dm-ilib-header{
display: flex;
justify-content: space-between;
padding:0 16px;
align-items: center;
border-bottom: 1px solid #DCDFE6;
}
h4{
height: 50px;
line-height: 50px;
font-size: 16px;
i{
font-size: 20px;
padding-left:10px;
cursor: pointer;
}
}
}
.img-item__wrap {
height: 290px;
margin-left: 6px;
overflow-y:auto;
}
&>nav{
width: 20%;
h4{
height: 50px;
line-height: 50px;
padding-right: 20px;
font-size: 16px;
border-bottom: 1px solid #DCDFE6;
cursor: pointer;
}
.dm-ilib-category{
height: 348px;
overflow-y: scroll;
cursor: pointer;
li{
height: 40px;
line-height: 40px;
padding-left: 10px;
&.active{
background: #f4f5f9;
}
&:hover{
background: #f4f5f9;
}
}
}
}
&-opt{
background: #f4f5f9;
display: flex;
justify-content: space-between;
align-items: center;
height: 60px;
padding:0 20px;
}
}
.ellipsis-80{
text-overflow: ellipsis;
overflow: hidden;
max-width: 80px;
white-space: nowrap;
word-wrap: normal;
width: auto;
display: inline-block;
vertical-align: middle;
}
.dm-upload{
display: inline-block;
position: relative;
}
.imglib-pagination{
padding-right:20px;
}
.dm-img-item{
width: 168px;
margin: 20px 10px 0 10px;
float: left;
border: 1px solid #e4e7ed;
border-radius: 2px;
overflow: hidden;
cursor: pointer;
&:hover{
border: 1px solid #1890ff;
}
&_top{
width: 168px;
height: 168px;
position: relative;
img{
width: 100%;
height: 100%;
}
}
&_center{
border-top:1px solid #e4e7ed;
height: 32px;
display: flex;
justify-content: left;
align-items: center;
padding-left: 10px;
/deep/ .el-checkbox__label{
text-overflow: ellipsis;
overflow: hidden;
max-width: 130px;
white-space: nowrap;
word-wrap: normal;
vertical-align: middle;
padding-left: 10px;
}
}
&_bottom{
border-top:1px solid #e4e7ed;
height: 32px;
display: flex;
justify-content: space-around;
align-items: center;
background: #f4f5f9;
}
}
</style>
<template>
<el-dialog title="选择短信" :visible.sync="show" width="800px" :before-close="close">
<div class="pb22 clearfix">
<div class="fl"><span class="pr10">{{total}}</span><el-input clearable v-model="listParams.search" class="w200" placeholder="请输入标题/作者" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input></div>
<div class="fr">
<el-button type="primary" @click="add">新建短信</el-button>
<el-button @click="refresh">刷新列表</el-button>
</div>
</div>
<el-table tooltipEffect="light" :data="smsTempList" style="width: 100%" v-loading="loading" @row-click="rowClick">
<el-table-column :show-overflow-tooltip="false" :width="60" align="center" prop="smsTemplateId">
<template slot-scope="scope">
<div class="label-hidden">
<el-radio v-model="selectedData" :label="scope.row" class="pr10"></el-radio>
</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="200" :min-width="200" align="left" prop="title" label="模板名称"></el-table-column>
<el-table-column :show-overflow-tooltip="false" :width="200" :min-width="200" align="left" prop="content" label="模板类型">
<template slot-scope="scope">
<p class="gray">{{scope.row.type === 0 ?'普通短信' :(scope.row.type === 1?'营销短信':'验证码')}}</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="false" :min-width="200" align="left" prop="content" label="模板内容">
<template slot-scope="scope">
<div class="ellipsis-l3">{{scope.row.content}}</div>
</template>
</el-table-column>
</el-table>
<el-pagination v-show="smsTempList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
<el-button type="primary" @click="addItem">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import { LoadTempList } from '../assets/api.js';
export default {
name:'lib-message',
props:{
show:{
type:Boolean,
default:false
}
},
data(){
return{
listParams:{
search:'',
currentPage:1,
pageSize:20
},
total:0,
smsTempList:[],
selectedData:{}
}
},
created(){
this.LoadTempList();
},
methods:{
handleSizeChange(val) {
this.listParams.pageSize = val;
this.LoadTempList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.LoadTempList();
},
LoadTempList() {
this.loading = true;
LoadTempList(this.listParams).then(res => {
if (res.errorCode === 0) {
this.smsTempList = res.result && res.result.result || [];
this.total = res.result && res.result.totalCount;
}
this.loading = false;
})
},
rowClick(row) {
row.comName = 'message';
this.selectedData = row;
},
addItem() {
if (!this.selectedData.comName) {
this.$message({type:'warning',message:'未选择短信'});
return;
}
this.$emit('sendItem',this.selectedData);
this.close();
},
close() {
this.$emit('update:show',false);
},
add() {
winodw.open('/marketing/#/message/temp/add');
},
refresh() {
this.listParams.currentPage = 1;
this.LoadTempList();
}
}
}
</script>
<template>
<el-dialog title="选择图文" :visible.sync="show" width="800px" :before-close="close">
<div class="pb22 clearfix">
<div class="fl">图文消息(共{{total}}条) <el-input v-model="listParams.searchName" clearable class="w200 ml10" placeholder="请输入标题/作者" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input></div>
<div class="fr">
<el-button type="primary" @click="add">新建图文</el-button>
<el-button @click="refresh">刷新列表</el-button>
</div>
</div>
<el-radio-group class="dm-imgtext-list" v-model="selectedData" v-loading="loading">
<el-table tooltipEffect="light" :data="textImgList" height="360" style="width: 100%" @row-click="rowClick">
<el-table-column label="" align="center" width="55px">
<template slot-scope="scope" >
<div class="label-hidden"><el-radio :label="scope.row"></el-radio></div>
</template>
</el-table-column>
<el-table-column label="图片" align="left" width="120px">
<template slot-scope="scope" >
<img width="100" height="50" :src="scope.row.itemList.length?(scope.row.itemList[0].qcloudImageUrl || ''):''" alt="">
</template>
</el-table-column>
<el-table-column label="图文标题" align="left" min-width="100px">
<template slot-scope="scope" >
<a class="blue ellipsis-l3" :href="scope.row.itemList.length?(scope.row.itemList[0].mediaUrl || ''):''" target="_blank">{{scope.row.itemList.length?(scope.row.itemList[0].titleName || ''):''}}</a>
</template>
</el-table-column>
<el-table-column label="作者" prop="updateTimeStr" align="left" width="120px">
<template slot-scope="scope" >
<p>{{scope.row.itemList.length?(scope.row.itemList[0].authorName || '--'):''}}</p>
</template>
</el-table-column>
<el-table-column label="更新时间" prop="updateTimeStr" align="left" width="160px">
<template slot-scope="scope" >
{{scope.row.updateTimeStr}}
</template>
</el-table-column>
</el-table>
</el-radio-group>
<el-pagination v-show="textImgList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
<el-button type="primary" @click="addItem">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {loadImgTextList} from '../assets/api.js';
import {formateDateTimeByType} from '../assets/utils.js'
export default {
name:'lib-teletext',
props:{
show:{
type:Boolean,
default:false
}
},
created(){
this.loadImgTextList();
},
data() {
return {
textImgList:[],
listParams:{
currentPage:1,
pageSize:20,
searchName:''
},
total:0,
loading:false,
selectedData:{}
}
},
methods:{
loadImgTextList() {
this.loading = true;
loadImgTextList(this.listParams).then(res => {
if (res.errorCode === 0) {
this.textImgList = res.result.result || [];
this.total = res.result.totalCount;
this.textImgList.map(v => {
v.createTimeStr = formateDateTimeByType(v.createTime,'yyyy-MM-dd-HH-mm')
v.updateTimeStr = formateDateTimeByType(v.updateTime,'yyyy-MM-dd-HH-mm')
})
}
this.loading = false;
})
},
rowClick(row) {
row.comName = 'teletext';
row.title = row.itemList[0] && row.itemList[0].titleName;
console.log(row)
this.selectedData = row;
},
addItem() {
if (!this.selectedData.comName) {
this.$message({type:'warning',message:'未选择图文消息'});
return;
}
this.$emit('sendItem',this.selectedData);
this.close();
},
close() {
this.$emit('update:show',false);
},
add() {
window.open('/marketing/#/wechat/editor');
},
refresh() {
this.listParams.currentPage = 1;
this.loadImgTextList();
},
handleSizeChange(val) {
this.listParams.pageSize = val;
this.loadImgTextList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.loadImgTextList();
}
}
}
</script>
<style lang="scss" scoped>
.dm-imgtext-list {
width: 100%;
}
</style>
<template>
<el-dialog title="编辑话务" :visible.sync="show" width="600px" :before-close="close">
<el-form ref="form" :model="form" label-width="110px" :rules="rules" v-loading="loading" >
<el-form-item label="话务任务标题" class="pb10" prop="title">
<dm-input class="w400" v-model="form.title" placeholder="限制20个字符" :maxlength="20"></dm-input>
</el-form-item>
<el-form-item label="话务任务内容" class="pb10" prop="content">
<dm-input class="w400" :rows="4" type="textarea" v-model="form.content" placeholder="限制200个字符" :maxlength="200"></dm-input>
</el-form-item>
<el-form-item label="任务逾期判定" prop="lateDays">
<el-input-number controls-position="right" class="w400" v-model="form.lateDays"></el-input-number> 天之后
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
<el-button type="primary" @click="addItem">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {getCardList} from '../assets/api.js';
import dmInput from './dm-input.vue';
export default {
name:'lib-tel',
components:{
'dm-input':dmInput,
},
props:{
item:{
type:Object,
default(){
return {}
}
},
show:{
type:Boolean,
default:false
}
},
data(){
return{
form:{
title:'',
lateDays:'',
content:'',
},
rules:{
title:{required:true,type:'string',message:'话务任务标题不能为空',trigger:'blur'},
content:{required:true,type:'string',message:'话务任务内容不能为空',trigger:'blur'},
lateDays:{required:true,type:'number',message:'任务逾期判定不能为空',trigger:'blur'}
},
loading:false
}
},
watch:{
show(val) {
this.form = {
title:'',
lateDays:'',
content:'',
};
if (val && this.item.ecmMarketingTypeRelationId) {
console.log('编辑')
this.form = JSON.parse(JSON.stringify(this.item))
}
}
},
methods:{
close() {
this.$refs.form.resetFields();
this.$emit('update:show',false);
},
addItem() {
this.form.comName = 'teltask';
if (!this.form.title || !this.form.content) {
this.$message({type:'warning',message:'话务未填写完整'});
return;
}
this.$emit('sendItem',this.form);
this.close();
},
}
}
</script>
<template>
<el-dialog title="添加小程序链接" :visible.sync="show" width="600px" class="add-replay-content" :before-close="close">
<el-form label-position="right" ref="form" :model="form" label-width="100px">
<el-form-item class="text-content" label="文本内容">
<el-input v-model="form.title" @keyup.native="toInput(form.title,$event)" ></el-input>
<span class="text-num">{{inputNum}}/{{inputLength}}</span>
</el-form-item>
<div class="content-wrap">
<div class="xcx-content-wrap">
<el-form-item label="上传图片">
<div class="upload-content">
<el-upload
class="avatar-uploader"
action="123"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="form.imageUrl" :src="form.imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p>请上传长宽比为5:4的图片</p>
</div>
</el-form-item>
<el-form-item label="链接类型" class="url-link-wrap" style="margin-bottom: 0">
<el-select @change="changePreValue" v-model="preValue" class="w200" placeholder="请选择" style="margin-right: 6px;">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-if="preValue" @change="changeNextValue" class="w200" v-model="nextValue" placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.linkId"
:label="item.name"
:value="item.linkId">
</el-option>
</el-select>
</el-form-item>
</div>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
<el-button type="primary" @click="addItem">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {getByteVal,getZhLen} from '../assets/utils.js';
let qs = require('qs');
export default {
name:'lib-wxa',
props:{
show:{
type:Boolean,
default:false
},
item:{
type:Object,
default(){
return {}
}
},
},
data(){
return {
form: {
title:'',
linkStyle:'0',
url:'',
imageUrl: '',
mediaId:''
},
inputNum: 0, // 输入文字个数(两个字母/汉字算一个字)
inputLength: 20, // 限制最大字数
preValue: '',
nextValue: '',
options1: [{
value: 3,
label: '导航tabber页'
}, {
value: 4,
label: '二级功能页'
}],
options2:[],
wechatContent:{},
}
},
watch:{
show(val) {
this.form = {
title:'',
linkStyle:'0',
url:'',
imageUrl: '',
mediaId:''
}
this.preValue = '';
this.nextValue = '';
this.wechatContent = {};
if (val && this.item.ecmMarketingTypeRelationId) {
this.form = JSON.parse(JSON.stringify(this.item));
console.log('编辑',this.item)
const pagePath = this.form.pagePath ? JSON.parse(this.form.pagePath) : {};
this.wechatContent.type = pagePath.type;
this.wechatContent.objId = '';
this.wechatContent.title = pagePath.title;
this.wechatContent.pageType = pagePath.pageType;
this.preValue = pagePath.pageType;
this.getNextList(this.preValue).then(res => {
this.nextValue = pagePath.type;
})
}
}
},
methods:{
toInput(value,e) { // 控制字符数量
var that = this;
that.form.title = getByteVal(e.target.value,that.inputLength);
that.inputNum = getZhLen(that.form.title);
},
handleAvatarSuccess(res, file) {
},
beforeAvatarUpload(file) {
// console.log(file)
let fd = new FormData();
fd.append('file', file);
fd.append('requestProject', 'gic-web');
this.axios.post('/api-admin/marketing-wechat-image-save', fd).then((res)=> {//成功后回调
var data = res.data;
// console.log(data);
if(data.errorCode==0){
this.form.imageUrl = data.result.qcloudImageUrl;
this.form.mediaId = data.result.imageMediaId;
this.$message({
type:'success',
message:'上传成功'
})
} else {
this.$message({
type:'error',
message:data.message
})
}
})
return true
},
// 链接类型
changePreValue(val){
// val==3 导航tabber页 val==4 二级功能页
if(val){
this.nextValue = '';
this.getNextList(val)
}
},
changeNextValue(val){
if(val){
let obj = {};
obj = this.options2.find((style) => {
return style.linkId === val;
})
this.wechatContent.type = obj.linkId;
this.wechatContent.objId = '';
this.wechatContent.title = obj.name;
this.wechatContent.pageType = this.preValue;
}
},
// 获得链接类型的二级
getNextList(type){
return new Promise((resolve,reject) => {
this.axios.post('/api-plug/list-link-data', qs.stringify({
requestProject: 'gic-web',
linkScene:parseInt(type)
})).then((res)=> {//成功后回调
var data = res.data;
console.log(data);
if(data.errorCode==0){
this.options2 = data.result;
resolve();
} else {
this.$message({
type:'error',
message:data.message
})
}
})
})
},
addItem() {
let sendData = {
ecmMarketingTypeRelationId:this.item.ecmMarketingTypeRelationId,
comName:'wxa',
title:this.form.title,
mediaId:this.form.mediaId,
pagePath:JSON.stringify(this.wechatContent),
}
if (!sendData.title) {
this.$message({type:'warning',message:'简介未填写'});
return;
}
if (!sendData.mediaId) {
this.$message({type:'warning',message:'图片未上传'});
return;
}
if (!sendData.pagePath) {
this.$message({type:'warning',message:'链接选择'});
return;
}
this.$emit('sendItem',sendData);
this.close();
},
close() {
this.$emit('update:show',false);
},
}
}
</script>
<style lang="scss" scoped>
.add-replay-content{
.text-content{
position: relative;
width: 400px;
.text-num{
position: absolute;
right: 10px;
bottom: 2px;
color: #c0c4cc;
font-size: 12px;
background: #fff;
height: 28px;
line-height: 28px;
padding-left: 10px;
}
}
.link-url-warning{
color: #909399;
font-size: 12px;
line-height: 1;
padding-top: 4px;
margin-top: 3px;
position: absolute;
top: 100%;
left: 0;
}
}
.xcx-content-wrap{
width: 100%;
.upload-content{
> p{
height: 36px;
line-height: 36px;
font-size: 12px;
color: #b8b8b8
}
}
}
.avatar-uploader{
width: 152px;
height: 152px;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
&:hover {
border-color: #1890ff;
}
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 150px;
height: 150px;
line-height: 150px;
text-align: center;
}
.avatar {
width: 150px;
height: 150px;
display: block;
}
.upload-content /deep/ .avatar-uploader .el-upload{
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.upload-content /deep/ .avatar-uploader .el-upload:hover{
border-color: #1890ff;
}
</style>
<template>
<div class="inline-block dm-marketing__opt">
<span v-for="(v,i) in options" :key="i" class="dm-marketing__opt__item" @click="addItem(v)">
<img :src="v.img" alt="" srcset=""><span> {{v.name}}</span>
</span>
</div>
</template>
<script>
export default {
name:'opt',
props:{
options:{
type:Array,
default() {
return []
}
}
},
methods:{
addItem(item) {
this.$emit('addItem',item);
}
}
}
</script>
import marketingEvent from "./index.vue";
const gicMarketingEvent = {
install(Vue, options) {
Vue.component(marketingEvent.name, marketingEvent)
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(gicMarketingEvent);
}
export default gicMarketingEvent;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment