Commit 357ef6b6 by chenxin

fix:build 微信群发 预览

parent 808eed85
......@@ -2,4 +2,4 @@
gio('init','8be12240a3749eab', {});
//custom page code begin here
//custom page code end here
gio('send');</script><link href=/marketing/static/css/main.3031f6eff37da5c44a4283e8fc091b4e.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/element.2.12.0.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.33.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/confirm-people.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.37.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.12.js></script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.1.93.js></script><script type=text/javascript src=/marketing/static/js/manifest.121e6cf8e3222fb83cfd.js></script><script type=text/javascript src=/marketing/static/js/vendor.f6e5442e18ed1c7d4a4d.js></script><script type=text/javascript src=/marketing/static/js/main.4f30d87827032f49d449.js></script></body></html>
\ No newline at end of file
gio('send');</script><link href=/marketing/static/css/main.50525a7cd750dead4f03456f3ae25e00.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/element.2.12.0.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.33.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/confirm-people.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.37.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.12.js></script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.1.93.js></script><script type=text/javascript src=/marketing/static/js/manifest.891a0237975369a2257e.js></script><script type=text/javascript src=/marketing/static/js/vendor.f6e5442e18ed1c7d4a4d.js></script><script type=text/javascript src=/marketing/static/js/main.4f30d87827032f49d449.js></script></body></html>
\ No newline at end of file
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(n,a,c){for(var i,f,u,d=0,s=[];d<n.length;d++)f=n[d],t[f]&&s.push(t[f][0]),t[f]=0;for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);for(r&&r(n,a,c);s.length;)s.shift()();if(c)for(d=0;d<c.length;d++)u=o(o.s=c[d]);return u};var n={},t={12:0};function o(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var r=t[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var n=new Promise(function(n,o){r=t[e]=[n,o]});r[2]=n;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+({0:"game",1:"card",2:"wechat",3:"ewash",4:"evaluation",5:"message",6:"ecm",7:"recharge",8:"msg",9:"calllog"}[e]||e)+"."+{0:"083a5b72add6de59024f",1:"6580764b20e0de8a7374",2:"79f0f83158b83ae0d6d9",3:"1cf02ecf8d2bc783a8cc",4:"82b6062b9f7c9e15698f",5:"040c5edae738dc44ee28",6:"0d37793997c7db318d9a",7:"6dfebb35a2cb22f7489d",8:"bd6f84bb38a1ad84a1c0",9:"925a34b416ed002007fe"}[e]+".js";var i=setTimeout(f,12e4);function f(){c.onerror=c.onload=null,clearTimeout(i);var r=t[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=f,a.appendChild(c),n},o.m=e,o.c=n,o.d=function(e,r,n){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/marketing/",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(n,a,c){for(var f,i,u,d=0,s=[];d<n.length;d++)i=n[d],t[i]&&s.push(t[i][0]),t[i]=0;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(e[f]=a[f]);for(r&&r(n,a,c);s.length;)s.shift()();if(c)for(d=0;d<c.length;d++)u=o(o.s=c[d]);return u};var n={},t={12:0};function o(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var r=t[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var n=new Promise(function(n,o){r=t[e]=[n,o]});r[2]=n;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+({0:"game",1:"card",2:"wechat",3:"ewash",4:"evaluation",5:"message",6:"ecm",7:"recharge",8:"msg",9:"calllog"}[e]||e)+"."+{0:"083a5b72add6de59024f",1:"6580764b20e0de8a7374",2:"5a24e6ce83d42a851e62",3:"1cf02ecf8d2bc783a8cc",4:"82b6062b9f7c9e15698f",5:"ffab842d16f1dfd391a7",6:"0d37793997c7db318d9a",7:"6dfebb35a2cb22f7489d",8:"bd6f84bb38a1ad84a1c0",9:"925a34b416ed002007fe"}[e]+".js";var f=setTimeout(i,12e4);function i(){c.onerror=c.onload=null,clearTimeout(f);var r=t[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=i,a.appendChild(c),n},o.m=e,o.c=n,o.d=function(e,r,n){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/marketing/",o.oe=function(e){throw console.error(e),e}}([]);
\ 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.
......@@ -6,6 +6,9 @@ export const sendRecordList = params => requests(PREFIX + 'page-send-record', pa
//发送记录--新建保存群发
export const sendRecordSaveService = params => requests(PREFIX + 'save-update-wechat-marketing-record', params);
//发送记录--群发预览
export const sendRecordPreview = params => requests(PREFIX + 'wechat-mass-preview', params);
//获取营销场景
export const sceneSettingList = params => requests(PREFIX + 'scene-setting-list', params);
......
......@@ -77,7 +77,8 @@
</el-table>
</section>
<div class="btn-wrap_fixed" :class="{ on: asideShow }">
<el-button type="primary" @click="submit" v-if="!isInfo" :disabled="canSend">提 交</el-button>
<el-button plain type="primary" @click="submit(1)" v-if="!isInfo" :disabled="canSend">预 览</el-button>
<el-button type="primary" @click="submit(2)" v-if="!isInfo" :disabled="canSend">提 交</el-button>
<el-button @click="$router.go(-1)">返 回</el-button>
</div>
</div>
......@@ -88,7 +89,7 @@ import dmImgBox from '@/components/libs/imgTemp/index-box.vue';
import { getIsShowSelf } from '@/service/api/commonApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import { checkMessageSendCount } from '@/service/api/messageApi.js';
import { sceneSettingList, sendRecordSaveService, wechatImageTextEdit, getWechatMarketingDetail } from '@/service/api/wechatApi.js';
import { sceneSettingList, sendRecordSaveService, wechatImageTextEdit, getWechatMarketingDetail, sendRecordPreview } from '@/service/api/wechatApi.js';
// import wxText from '@/components/wxText/wxText'
import wxText from '@/components/wx-text/index.vue';
......@@ -250,7 +251,7 @@ export default {
getImgTextData(val) {
this.info.imageTextId = val.imageTextId;
this.info.imageTextWechatId = val.imageTextWechatId;
console.log(val);
// console.log(val);
},
//获取图片id
getImgData(val) {
......@@ -263,7 +264,8 @@ export default {
// this.info.content = data.textarea;
// this.info.imageMediaId = data.imageMediaId;
// },
async submit() {
// type: 1预览 2提交群发
async submit(type) {
// console.log(this.info);
// // 这里强制获取人群筛选器的配置项
// await this.$refs.peopleFilter.confirmSet();
......@@ -275,29 +277,108 @@ export default {
this.$tips({ type: 'warning', message: '新先选择一个图文' });
return;
} else if (this.info.contentType === 1 && !this.info.content) {
console.log(this.info.content);
this.$tips({ type: 'warning', message: '请填写文本' });
return;
} else if (this.info.contentType === 2 && !this.info.mediaId) {
this.$tips({ type: 'warning', message: '请选择图片' });
return;
}
if (this.info.memberType === 1 && !this.info.openIds) {
this.$tips({ type: 'warning', message: '指定会员不能为空' });
return;
}
if (this.info.memberType === 2 && !this.info.memberGroupIds) {
this.$tips({ type: 'warning', message: '会员分组不能为空' });
return;
if (type === 1) {
// 预览
// 只能选择指定会员
if (this.info.memberType !== 1) {
this.$tips({ type: 'warning', message: '预览只能选择指定会员发送' });
return;
}
if (!this.info.openIds || this.info.openIds.split(',').length !== 1) {
this.$tips({ type: 'warning', message: '请选择一个指定会员发送' });
return;
}
} else {
// 直接提交群发
if (this.info.memberType === 1 && !this.info.openIds) {
this.$tips({ type: 'warning', message: '指定会员不能为空' });
return;
}
if (this.info.memberType === 2 && !this.info.memberGroupIds) {
this.$tips({ type: 'warning', message: '会员分组不能为空' });
return;
}
}
if (this.info.contentType === 1) {
this.info.content = this.info.content.replace(/&amp;/g, '&');
let flag = await this.$refs.wxText.computedTextLength();
if (!flag) return;
}
this.checkMessageSendCount();
if (type === 1) {
this.handleSendRecordPreview();
} else {
checkMessageSendCount();
}
},
// 提交预览
async handleSendRecordPreview() {
this.$confirm('预览将不会保存群发信息, 且只发送一个会员, 每日调用次数100', '提示', {
confirmButtonText: '确定',
cancelBUttonText: '取消',
type: 'warning'
})
.then(() => {
this.loading = true;
let params = {
sceneSettingId: this.info.sceneSettingId,
memberType: this.info.memberType,
contentType: this.info.contentType,
sendType: this.info.sendType,
sendTime: this.info.sendTime,
memberSearchDTO: this.info.memberType ? this.info.memberGroupIds : this.info.memberSearchDTO,
searchJson: this.getSaveData
};
//微信营销主键ID (注意: 新建时null, 修改必传)
if (this.$route.meta.type === 'edit') {
params.wechatTeletextId = this.$route.params.id;
}
//memberType 0:会员筛选 不传; memberType 1:指定会员, 多个会员memberId由逗号隔开
if (this.info.memberType) {
params.openIds = this.info.openIds;
}
if (this.info.contentType === 0) {
params.imageTextId = this.info.imageTextId;
params.imageTextWechatId = this.info.imageTextWechatId;
}
if (this.info.contentType === 1) {
params.wechatTextId = this.info.wechatTextId;
params.content = this.info.content;
}
if (this.info.contentType === 2) {
params.mediaId = this.info.mediaId;
}
if (this.info.sendType) {
params.sendTime = formatDateTimeByType(this.info.sendTime, 'yyyy-MM-dd-HH-mm');
}
sendRecordPreview(params)
.then(res => {
this.loading = false;
if (res.errorCode === 0) {
this.$tips({ type: 'success', message: '操作成功' });
setTimeout(_ => {
this.$router.push('/wechat/record');
});
} else {
this.$tips({ type: 'error', message: '操作失败' });
}
console.log(res);
})
.catch(err => {
this.$tips({ type: 'error', message: '操作失败' });
this.loading = false;
});
})
.catch(() => {
// this.$tips({type: 'info',message: '已取消提交'});
});
},
//提交表单验证人数 只有人员筛选需要
async checkMessageSendCount() {
if (this.info.memberType === 0 || this.info.memberType === 2) {
......
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