Commit 25c14bed authored by Mac's avatar Mac

1

parent 5260fd5e
......@@ -12,9 +12,9 @@
label="小程序路径" style="margin-top: 20px;" />
<div style="display: flex;align-items: center;margin: 10px 0 ;">
展示方式:
<q-radio v-model="msg.type" val="1" label="文字" />
<q-radio v-model="msg.type" val="2" label="图片" />
<q-radio v-model="msg.type" val="3" label="小程序卡片" />
<q-radio v-model="msg.type" val="1" label="文字" />
<q-radio v-if="type!=2" v-model="msg.type" val="2" label="图片" />
<q-radio v-if="type!=2" v-model="msg.type" val="3" label="小程序卡片" />
</div>
<q-input v-if="msg.type==1" clearable standout="bg-primary text-white" v-model="msg.title"
@input="$forceUpdate()" label="文字内容" style="margin-top: 20px;" />
......@@ -43,7 +43,7 @@
<span>{{msg.title}}</span>
<div style="width: 240px;height: 180px;border: 1px dashed #E3E4E5;display: flex;flex-direction: column;align-items: center;justify-content: center;background: #FFF;margin-top: 10px;"
v-if="msg.imgUrl==''">
<p style="padding: 0 10px;text-align: center;">建议图片尺寸为5:4,大小不超过10M,暂不支持动图。</p>
<p style="padding: 0 10px;text-align: center;">图片尺寸为1080*864像素,大小不超过10M,暂不支持动图。</p>
<q-btn class="q-mr-md" label="从图库选择" @click="getChoice()" />
</div>
<div style="width: 240px;height: 180px;margin-top: 10px;" v-if="msg.imgUrl!=''"
......@@ -159,7 +159,7 @@
} else {
this.$q.notify({
type: 'negative',
message: `请上传图片尺寸为5:4,`,
message: `请上传图片尺寸为1080*864像素,`,
position: 'top'
})
}
......@@ -173,7 +173,10 @@
img.onload = function () {
// 打印
let qualified = false
if (Number(img.height) / img.width == 0.8) {
// if (Number(img.height) / img.width == 0.8) {
// qualified = true
// }
if (img.width == 1080 && img.height==864) {
qualified = true
}
callback({ qualified: qualified })
......
......@@ -95,6 +95,12 @@
<q-btn push label="小程序" @click="getapplet" />
</q-btn-group>
</div>
<div style="width: 100%;display: flex;align-items: center;justify-content: center;" v-if="addMsg.Type==2">
<q-btn-group push>
<q-btn push label="小程序" @click="getapplet" />
</q-btn-group>
</div>
<q-input clearable filled v-model="addMsg.Title" label="标题" maxlength="64" counter
v-if="this.addMsg.Type != 2 && this.addMsg.Type != 5" style="margin-top: 20px;" />
<q-input clearable filled v-model="addMsg.Author" label="作者" maxlength="8" counter v-if="addMsg.Type == 1"
......@@ -128,7 +134,7 @@
<q-btn color="accent" class="q-mr-md" label="替换素材" @click="getChoice(2),iscover=true" size="sm"
style="margin-left: 30px;" />
</div>
</div>
<!-- 图片 -->
<div v-if="addMsg.Type == 5">
......@@ -166,7 +172,7 @@
<q-btn color="accent" class="q-mr-md" label="提交并审核" @click="savemove(1)" style="width: 120px;"
:loading="loading" />
<q-btn class="q-mr-md" label="返回" @click="goblck()" style="width: 60px;" />
<q-btn class="q-mr-md" label="推送" @click="tuisong()" style="width: 60px;" />
<!-- <q-btn class="q-mr-md" label="推送" @click="tuisong()" style="width: 60px;" /> -->
</div>
<!-- 是管理端 -->
<div v-if="isManage==true" style="margin-top: 20px;">
......@@ -221,8 +227,6 @@
:options="platTypeList" label="发布平台" :dense="false" emit-value map-options />
<q-input v-if='IsPreview==1' clearable filled v-model="TagId" label="输入微信号" maxlength="30"
style="margin-top: 20px;" />
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
......@@ -235,7 +239,6 @@
</q-dialog>
</div>
</template>
<script>
import contributionUE from './ue/contributionUE'
import ChooseImg from '../components/ChooseImg'
......@@ -425,7 +428,7 @@
if (this.iscover == true) {//选择的音频
this.audiourl = obj[0].Path;
this.addMsg.VideoMediumId = obj[0].Id;
this.addMsg.Title = obj[0].MediaGroupName
this.addMsg.Title = obj[0].MediaName
} else {//选择音频插入富文本
this.$refs.UE_cb.insertaudio(data)
}
......@@ -454,52 +457,7 @@
this.$refs.UE_cb.instertImage(data)
}
},
getcontnet(data, length) {
if (this.addMsg.Type == 2) {
this.addMsg.Description = data
} else {
this.addMsg.Content = data
// var reg = /data-time="(.*?)"/g;
// let _arr = []
// _arr = data.match(reg)
// console.log(data)
// if (_arr && _arr.length > 0) {
// var _res = []; //
// _arr.sort();
// for (var i = 0; i < _arr.length;) {
// var count = 0;
// for (var j = i; j < _arr.length; j++) {
// if (_arr[i] == _arr[j]) {
// count++;
// }
// }
// _res.push([_arr[i], count]);
// i += count;
// }
// //_res 二维数维中保存了 值和值的重复数
// var _newArr = [];
// for (var i = 0; i < _res.length; i++) {
// _newArr.push(
// {name:_res[i][0],num:_res[i][1]}
// );
// }
// console.log(_newArr)
// _newArr.forEach(x=>{
// console.log(x)
// if(x.num==1){
// let a = new RegExp(`<mp-miniprogram ${x.name}[^>]*>(.|\n)*<\/mp-miniprogram>`,'g')
// console.log(a)
// this.addMsg.Content = data.replace(a,'')
// // this.$refs.UE_cb.getagain(this.addMsg.Content)
// }
// })
// }
console.log(this.addMsg.Content, '返回数据')
}
},
savemove(type) {//普通的用户保存
this.loading = true
if (this.addMsg.Type == 5) {
......@@ -513,9 +471,6 @@
})
}
this.addMsg.AuditState = type
// let a = JSON.stringify(this.addMsg.Content)
// console.log(a)
setContributeInfo(this.addMsg).then(res => {
this.loading = false
if (res.Code == 1) {
......@@ -577,6 +532,7 @@
} else {//预览 和 群发
this.releasedialog = true
this.IsPreview = type
console.log(this.addMsg)
}
},
closeCourseForm() {
......@@ -645,7 +601,7 @@
},
tuisong() {
setContributeInfoPublish({
ContributeId: 15,
ContributeId: 16,
PlatformId: 1,
IsPreview: 1,
TagId: 'goodluck_cattle',
......@@ -665,7 +621,56 @@
this.$refs.UE_cb.applet(data)
}
},
getcontnet(data, length) {
if (this.addMsg.Type == 2) {
this.addMsg.Description = data.replace(/<\/?p[^>]*>/gi,'')
console.log(this.addMsg.Description)
} else {
this.addMsg.Content = data
let temporary = JSON.parse(JSON.stringify(data))
var reg = /data-time="(.*?)"/g;
let _arr = []
let deleteName = ''
_arr = data.match(reg)
if (_arr && _arr.length > 0) {
var _res = []; //
_arr.sort();
for (var i = 0; i < _arr.length;) {
var count = 0;
for (var j = i; j < _arr.length; j++) {
if (_arr[i] == _arr[j]) {
count++;
}
}
_res.push([_arr[i], count]);
i += count;
}
//_res 二维数维中保存了 值和值的重复数
var _newArr = [];
for (var i = 0; i < _res.length; i++) {
_newArr.push(
{name:_res[i][0],num:_res[i][1]}
);
}
_newArr.forEach(x=>{
console.log(x)
if(x.num==2){
let a = new RegExp(`<mp-miniprogram ${x.name}[^>]*>(.|\n)*<\/mp-miniprogram><span ${x.name}></span>`,'g')
temporary = temporary.replace(a,'')
// this.$refs.UE_cb.getagain(this.addMsg.Content)
}
})
// this.addMsg.Content = temporary
//新增一个存的值
console.log(temporary,'```````````````temporary')
}
console.log(this.addMsg.Content, '返回数据')
}
},
}
}
......
......@@ -116,29 +116,26 @@
let html = '';
//s视频
fileArray.forEach(item => {
html+="<iframe frameborder='0' width='100%' height='200px' src='https://v.qq.com/iframe/player.html?vid=v326875u4ek' allowfullscreen='true'></iframe>"
})
console.log(html)
html += "<iframe frameborder='0' width='100%' height='200px' src='https://v.qq.com/iframe/player.html?vid=v326875u4ek' allowfullscreen='true'></iframe>"
})
if (html && html != '') {
this.ue.execCommand('inserthtml', html);
}
}
},
insertaudio(fileArray) { //插入音频
if (fileArray && fileArray.length) {
let html = '';
//音频
fileArray.forEach(item => {
html+='<p style="text-align:center"><iframe height="62px" width="auto" frameborder="0" allowtransparency="true" ' +
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" ' +
' src="' + this.ViewDomain + '/index.html?fileName=' + item.fileName + '&url=' + item.fileUrl +
'" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>'
html += `<p><audio src="${item.fileUrl}" controls="controls"></audio></p>`
// html += `<mpvoice class="js_editor_audio audio_iframe js_uneditable custom_select_card"
// src="/cgi-bin/readtemplate?t=tmpl/audio_tmpl&amp;name=111111.mp3&amp;play_length=04:47" name="3343434.mp3" play_length="287000"
// voice_encode_fileid="LZ-rcf9d76p-zSl-cKLq1df9pxdAefsq406nXcoz4Zc" data-topic_id="" data-topic_name="" data-pluginname="insertaudio"></mpvoice>`
})
console.log(html)
if (html && html != '') {
this.ue.execCommand('inserthtml', html);
}
......@@ -159,30 +156,33 @@
}
}
},
applet(data){
applet(data) {
let html = '';
if(data.type==1){//文字小程序
html += `<p><a data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.route}" href="">${data.title}</a></p>`;
if (data.type == 1) {//文字小程序
html += `<p><a data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.route}" href="">${data.title}</a></p>`;
}else if(data.type==2){//图片小程序
html+=`<p><a data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.route}" href=""><img src="${data.imgUrl}" alt="" data-width="null" ></a></p>`
}else if(data.type==3){
} else if (data.type == 2) {//图片小程序
html += `<p><a data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.route}" href=""><img src="${data.imgUrl}" alt="" data-width="null" ></a></p>`
} else if (data.type == 3) {
let dataTime = Date.parse(new Date())
// 给公众号的写法
html+=`<mp-miniprogram data-time="${dataTime}" data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.route}" data-miniprogram-title="${data.title}" data-miniprogram-imageurl="http://mmbiz.qpic.cn/mmbiz_jpg/iamUJ3Ot9utFjb5RP6Fr0ECTbQDnicewkS38JbPCsoFZPUzibXuIj6IhaHOPudWSG0ZxldLIj70QtHVSbwrBaP85g/0?wx_fmt=jpeg" data-miniprogram-type="card" data-miniprogram-servicetype="0"></mp-miniprogram>`
html += `<mp-miniprogram data-time="${dataTime}" data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.route}"
data-miniprogram-title="${data.title}"
data-miniprogram-imageurl="http://mmbiz.qpic.cn/mmbiz_jpg/iamUJ3Ot9utFjb5RP6Fr0ECTbQDnicewkS38JbPCsoFZPUzibXuIj6IhaHOPudWSG0ZxldLIj70QtHVSbwrBaP85g/0?wx_fmt=jpeg"
data-miniprogram-type="card" data-miniprogram-servicetype="0"></mp-miniprogram><span data-time="${dataTime}"></span>`
//自己看的写法
html += '<p><iframe height="320" width="auto" data-time='+ dataTime +' data-miniprogram-appid='+ data.appletmsg.AppID +' frameborder="0" allowtransparency="true" ' +
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" ' +
' src="http://localhost:8181/#/teacher/contribution/graphicType?Name=' + data.appletmsg.Name + '&Image=' +
data.appletmsg.Image + '&title=' +data.title+ '&imgUrl=' +data.imgUrl+
'" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>';
html += '<p><iframe height="320" width="auto" data-time=' + dataTime + ' data-miniprogram-appid=' + data.appletmsg.AppID + ' frameborder="0" allowtransparency="true" ' +
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" ' +
' src="http://localhost:8181/#/teacher/contribution/graphicType?Name=' + data.appletmsg.Name + '&Image=' +
data.appletmsg.Image + '&title=' + data.title + '&imgUrl=' + data.imgUrl +
'" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>';
console.log(html)
}
if (html && html != '') {
this.ue.execCommand('inserthtml', html);
}
this.ue.execCommand('inserthtml', html);
}
},
......@@ -260,7 +260,7 @@
});
this.ue.addListener('contentChange', (editor, e) => {
this.isInputChange = true;
this.$emit('input', this.ue.getContent(),this.ue.getContentTxt().length);
this.$emit('input', this.ue.getContent(), this.ue.getContentTxt().length);
});
this.ue.addListener('blur', editor => {
this.isInputChange = true;
......@@ -284,4 +284,4 @@
</script>
<style scoped>
</style>
</style>
\ 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