Commit 730076f0 by zhangmeng

fix:文本编辑器问题

parent ce04cdbf
<!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.fb3c085590e7ba52d09fdaeba6bfb4dd.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.b52e32600f8f7c7becf9.js></script><script type=text/javascript src=/marketing/static/js/app.761192a4fc8b722548de.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.e529d9a4669f8784b4fcb4045027197b.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.b52e32600f8f7c7becf9.js></script><script type=text/javascript src=/marketing/static/js/app.7b165f103d2e73c29747.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.
......@@ -18,7 +18,7 @@
<el-input v-model="urlInfo.url" class="w300" @blur="checkUrl" placeholder="请输入网址 http或https开头"></el-input>
</div>
</el-tab-pane>
<el-tab-pane label="小程序链接" name="1">
<el-tab-pane label="小程序链接" name="1" v-if="showWxApp">
<p class="pt10 pl20 pb20">已选择链接:{{urlInfo.url || '--'}}</p>
<linktoolspage ref="childlinktoolspage" :isWx="true" :activeName="true" :showType="2" @linkSelect="linkSelect"/>
</el-tab-pane>
......@@ -87,6 +87,10 @@ export default {
appendToBody: {
type:Boolean,
default:false
},
showWxApp:{
type:Boolean,
default:true
}
},
watch:{
......
......@@ -18,9 +18,9 @@
</div>
<a @click="removeLink" class="iconfont icon-17" title="变量" slot="reference"></a>
</el-popover>
<span class="fr gray fz13">还可以输入{{300-textLength}}字,按下回车键换行</span>
<span class="fr gray fz13">最多可输入300字,按下回车键换行</span>
</div>
<my-dialog :show.sync="dialogShow" @urlInfo="getUrlInfo" :urlType.sync="urlType" :jumpUrlInfo.sync="jumpUrlInfo"></my-dialog>
<my-dialog :showWxApp="showWxApp" :show.sync="dialogShow" @urlInfo="getUrlInfo" :urlType.sync="urlType" :jumpUrlInfo.sync="jumpUrlInfo"></my-dialog>
</section>
</template>
......@@ -56,6 +56,10 @@ export default {
isSupportVar:{
type:Boolean,
default:false
},
showWxApp:{
type:Boolean,
default:true
}
},
watch:{
......@@ -160,24 +164,18 @@ export default {
this.$emit('update:value',this.textarea);
},
computedTextLength() {
// if (this.$refs.myTextarea) {
// this.textLength = this.$refs.myTextarea.innerHTML.length;
// } else {
// this.textLength = 0;
// }
const reg = /<(?!(a|\/a|div|\/div|br)).*?>/img ; // 只保留a 和 div 标签
let text = this.$refs.myTextarea.innerHTML.replace(reg,"");
text = text.replace(/<\/div>|&nbsp;/g,"").replace(/<((div)).*?>/g,"<br>").split('<br>').filter(v=>v).join('<br>');
let textContent = this.$refs.myTextarea.innerText;
console.log(text.length,textContent.length);
if(this.textLength >= 300){
this.$message.error('最多300个字符');
}
},
emitValue() {
// this.textarea = this.$refs.myTextarea.innerHTML;
return new Promise((resolve,reject) => {
var textContent = strLength.getByteVal2(this.$refs.myTextarea.innerText);
var textNum = strLength.getZhLen(textContent);
console.log(textNum);
if(textNum >= 300){
this.$message.error('最多300个字符哦');
resolve(false);
} else {
resolve(true);
}
});
}
}
}
......
......@@ -594,7 +594,7 @@ export default {
this.$tips({type:'warning',message:'固定期限不能为空'});
return;
}
if (this.toggleTag && !this.getSaveData ) {
if (this.form.memberType === 0 && this.toggleTag && !this.getSaveData ) {
this.$tips({type:'warning',message:'人群筛选未保存条件'})
return;
}
......
......@@ -73,20 +73,26 @@ export default {
this.$emit('update:show',false);
},
addItem() {
const that = this;
this.$refs.wxText.getTextValue();
this.$nextTick(_ => {
if (!this.value) {
this.$message({type:'warning',message:'请输入内容'});
return;
}
this.$emit('sendItem',{
comName:'text',
content:this.value,
ecmMarketingTypeRelationId:this.ecmMarketingTypeRelationId,
urlType:this.urlType,
jumpUrlInfo:this.jumpUrlInfo
});
this.$emit('update:show',false);
async function asyncFunc () {
let flag = await that.$refs.wxText.computedTextLength();
if (!flag) return;
if (!that.value) {
that.$message({type:'warning',message:'请输入内容'});
return;
}
that.$emit('sendItem',{
comName:'text',
content:that.value,
ecmMarketingTypeRelationId:that.ecmMarketingTypeRelationId,
urlType:that.urlType,
jumpUrlInfo:that.jumpUrlInfo
});
that.$emit('update:show',false);
};
asyncFunc();
})
}
}
......
......@@ -389,6 +389,15 @@ export default {
// this.tableList = gameInfo.prizeList;
// 自定义背景音乐
if (this.form.musicType && gameInfo.gameMusic) {
this.customMusic = {
code:gameInfo.gameMusic.musicFieldCode || '',
url:gameInfo.gameMusic.musicUrl || '',
name:gameInfo.gameMusic.musicName || '',
isPlay:false
}
}
this.$nextTick(_ => {
this.$refs.ptyxSkin.init();
})
......@@ -417,7 +426,6 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
// gameData
gameInfo.gameActivityId = this.form.gameActivityId || '';
gameInfo.gameName = this.form.gameName || '';
gameInfo.puzzleImgFieldCode = this.form.puzzleImg.code || '';
......@@ -497,10 +505,10 @@ export default {
/** 自定义音乐主键ID **/
gameMusicId:'',
/** 音乐名称 **/
musicName:'',
musicName:this.customMusic.name,
/** 音乐链接 **/
musicUrl:'',
musicFieldCode:''
musicUrl:this.customMusic.url,
musicFieldCode:this.customMusic.code
})
};
......
......@@ -52,7 +52,7 @@
<dm-img-box v-show="info.contentType === 2" :mediaId="info.mediaId" @get-data="getImgData"></dm-img-box>
<div v-show="info.contentType === 1">
<!-- <wxText :msgText="info.content" @listenWxText="getWxText"></wxText> -->
<wx-text :appendToBody="true" :value.sync="info.content" :urlType.sync="info.urlType" :jumpUrlInfo.sync="info.jumpUrlInfo" :isSupportVar="false" ref="wxText"></wx-text>
<wx-text :showWxApp="false" :appendToBody="true" :value.sync="info.content" :urlType.sync="info.urlType" :jumpUrlInfo.sync="info.jumpUrlInfo" :isSupportVar="false" ref="wxText"></wx-text>
</div>
</div>
</section>
......@@ -208,6 +208,7 @@ export default {
} else if (this.info.memberType === 2) {
this.defaltSelected = res.result.tagGroupList || [];
}
}
},
async wechatImageTextEdit(){
......@@ -244,7 +245,7 @@ export default {
// this.info.content = data.textarea;
// this.info.imageMediaId = data.imageMediaId;
// },
submit() {
async submit() {
console.log(this.info);
if (!this.info.memberType && this.toggleTag && !this.getSaveData ) {
this.$tips({type:'warning',message:'人群筛选未保存条件'})
......@@ -269,9 +270,10 @@ export default {
this.$tips({type:'warning',message:'会员分组不能为空'});
return;
}
// if (this.info.contentType === 1 ) {
// this.info.content = str3
// }
if (this.info.contentType === 1 ) {
let flag = await this.$refs.wxText.computedTextLength();
if (!flag) return;
}
this.checkMessageSendCount();
},
......
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