Commit 44467c9c authored by Mac's avatar Mac

1

parent 5366f857
......@@ -8,7 +8,8 @@
<style type="text/css">
*{margin:0;padding:0;color: #838383;}
table{font-size: 12px;margin: 10px;line-height: 30px}
.txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}
.txt{width:300px;height:36px;line-height:36px;border:1px solid #d7d7d7;margin-bottom: 10px;}
</style>
</head>
<body>
......
......@@ -6923,7 +6923,8 @@ var fillCharReg = new RegExp(domUtils.fillChar, 'g');
'body{margin:8px;font-family:sans-serif;font-size:14px;}' +
//图片最大宽度
'img{max-width: 100%;height:auto;}' +
'a{border-bottom:1px solid #1296db;cursor: pointer;}' +
// 'a{border-bottom:1px solid #1296db;cursor: pointer;}' +
'a{text-decoration:none;cursor: pointer;color: #576b95;}' +
"li::marker{color:#2961fe;font-family:pingfang;font-weight:bold}"+
//设置段落间距
'p{margin:5px 0;}</style>' +
......@@ -77,4 +77,21 @@ export function getContributeInfo(data) {
method: 'post',
data
})
}
// 推送
export function setContributeInfoPublish(data) {
return request({
url: '/QYContribute/SetContributeInfoPublish',
method: 'post',
data
})
}
// 获取小程序列表
export function getContributeAppletList(data) {
return request({
url: '/QYContribute/GetContributeAppletList',
method: 'post',
data
})
}
\ No newline at end of file
<template>
<div class="ChooseApplet">
<q-card style="width: 520px; max-width: 80vw;">
<q-card-section>
<div class="text-h6">选择小程序</div>
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none" style="margin-top: 15px;">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="msg.AppletId"
@input="getroute" ref="ID" :options="AppletList" label="分组" :dense="false" emit-value map-options />
<q-input clearable standout="bg-primary text-white" v-model="msg.route" @input="$forceUpdate()"
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="小程序卡片" />
</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;" />
<div style="margin-top: 15px;display: flex;align-items: flex-start;" v-if="msg.type==2">
<q-btn color="accent" class="q-mr-md" label="从图库选择" @click="getChoice(0)" size="sm"
style="margin-left: 20px;" />
<el-image v-if="msg.imgUrl!=''" style="width: 200px;" :src="msg.imgUrl" fit="contain"></el-image>
</div>
<div v-if='msg.type==3'>
<q-input clearable standout="bg-primary text-white" v-model="msg.title" @input="$forceUpdate()" maxlength="35" counter
label="卡片标题" style="margin-top: 20px;" />
<div style="margin-top: 20px;display: flex;align-items: flex-start" v-if="msg.appletmsg">
<div style="margin-right: 15px;">卡片样式</div>
<div
style="margin-top: 10px;width: 270px;border: 1px solid #E3E4E5;background: #E6E7E8;padding-top: 10px;">
<div style="padding:0 15px;">
<div style="display: flex;align-items: center;">
<el-image v-if="msg.appletmsg.Image"
style="width: 20px;height: 20px;border-radius: 10px;margin-right: 10px;"
:src="msg.appletmsg.Image" fit="cover"></el-image>
<span
style="width: auto;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;word-wrap: normal;font-weight: 400;">{{msg.appletmsg.Name}}</span>
</div>
<span>{{msg.title}}</span>
<div style="width: 240px;height: 180px;border: 1px dashed #E3E4E5;display: flex;align-items: center;justify-content: center;background: #FFF;margin-top: 10px;"
v-if="msg.imgUrl==''">
<q-btn class="q-mr-md" label="从图库选择" @click="getChoice()" />
</div>
<div style="width: 240px;height: 180px;margin-top: 10px;" v-if="msg.imgUrl!=''" @click="getChoice()">
<el-image v-if="msg.imgUrl" style="width: 100%;height: 100%;" :src="msg.imgUrl"
fit="cover"></el-image>
</div>
</div>
<div class="weapp_card_ft">
<span class="weapp_card_logo"><img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAb1BMVEUAAAB4it11h9x2h9x2h9x2htx8j+R8i+B1h9x2h9x3h92Snv91htt2h9x1h9x4h9x1h9x1h9x2idx1h9t2h9t1htt1h9x1h9x1htx2h9x1h912h9x4h913iN17juOOjuN1iNx2h9t4h958i+B1htvejBiPAAAAJHRSTlMALPLcxKcVEOXXUgXtspU498sx69DPu5+Yc2JeRDwbCYuIRiGBtoolAAAA3ElEQVQoz62S1xKDIBBFWYiFYImm2DWF///G7DJEROOb58U79zi4O8iOo8zuCRfV8EdFgbYE49qFQs8ksJInajOA1wWfYvLcGSueU/oUGBtPpti09uNS68KTMcrQ5jce4kmN/HKn9XVPAo702JEdx9hTUrWUqVrI3KwUmM1NhIWMKdwiGvpGMWZOAj1PZuzAxHwhVSplrajoseBnbyDHAwvrtvKKhdqTtFBkL8wO5ijcsS3G1JMNvQ5mdW7fc0x0+ZcnlJlZiflAomdEyFaM7qeK2JahEjy5ZyU7jC/q/Rz/DgqEuAAAAABJRU5ErkJggg=="
alt="" class="icon_weapp_logo_mini"> 小程序</span>
</div>
</div>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="closeDialog()" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="savewb()" />
</q-card-actions>
</q-card>
<!-- 选择文件 -->
<q-dialog title="选择文件" v-model="getImgChoice" width="1200px">
<ChooseImg @SelectId="SelectId" :type="0" @closeDia="getImgChoice=false"></ChooseImg>
</q-dialog>
</div>
</template>
<script>
import {
getContributeAppletList
} from '../../../api/teacher/contribution';
import BenzAMRRecorder from 'benz-amr-recorder'
import ChooseImg from './ChooseImg'
export default {
props: {
type: {
type: String,
default: null
},
},
components: {
ChooseImg,
},
data() {
return {
msg: {
type: '1',//1文字 2图片 3小程序卡片
AppletId: '',
route: '',
title: '',
imgUrl: '',
appletmsg: null
},
AppletList: [],
getImgChoice: false
}
},
created() {
this.getAppletList()
},
computed: {
},
mounted() {
},
methods: {
closeDialog() {
this.$emit('closeDia');
},
savewb() {
if (this.msg.AppletId == '') {
this.$q.notify({
type: 'negative',
message: `请先选择小程序`,
position: 'top'
})
return
}
if (this.msg.type == 1) {
if (this.msg.title == '') {
this.$q.notify({
type: 'negative',
message: `文字内容不能为空`,
position: 'top'
})
return
}
}
this.$emit('getresult', this.msg);
},
getChoice(type) {
this.getImgChoice = true;
},
SelectId(obj) {
this.msg.imgUrl = obj[0].ImageUrl
this.getImgChoice = false;
},
getroute(e) {//选择了小程序 路径赋值
this.AppletList.forEach(x => {
if (x.Id == e) {
this.msg.route = x.Page
this.msg.appletmsg = x
}
})
},
getAppletList() {
getContributeAppletList({}).then(res => {
this.AppletList = res.Data
}).catch(() => {
this.loading = false
})
},
},
}
</script>
<style>
.ChooseApplet {
background: #fff;
width: 520px;
}
.ChooseApplet .weapp_card_ft {
padding: 0 15px;
border-top: 1px solid #E3E4E5;
line-height: 24px;
margin-top: 10px;
}
.ChooseApplet .weapp_card_logo {
color: #7E8081;
font-size: 14px;
}
.ChooseApplet .icon_weapp_logo_mini {
width: 14px;
height: 14px;
vertical-align: middle;
margin-right: .2em;
margin-top: -0.2em;
}
</style>
\ No newline at end of file
......@@ -91,8 +91,8 @@
</q-btn-dropdown>
<q-btn push label="视频" @click="getChoice(3),iscover=false" />
<q-btn push label="音频" @click="getChoice(2),iscover=false" />
<q-btn push label="超链接" @click="hyperlinks" />
<q-btn push label="小程序" />
<!-- <q-btn push label="超链接" @click="hyperlinks" /> -->
<q-btn push label="小程序" @click="getapplet"/>
</q-btn-group>
</div>
<q-input clearable filled v-model="addMsg.Title" label="标题" maxlength="64" counter
......@@ -164,6 +164,7 @@
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove(1)" style="width: 100px;"
: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;" />
</div>
......@@ -172,17 +173,23 @@
<q-dialog title="选择文件" v-model="getImgChoice" width="1200px">
<ChooseImg @SelectId="SelectId" :type="type" @closeDia="getImgChoice=false"></ChooseImg>
</q-dialog>
<!-- 选择小程序 -->
<q-dialog title="选择文件" v-model="getappletChoice" width="650px">
<chooseApplet :type="addMsg.Type" @getresult='getresult' @closeDia="getappletChoice=false"></chooseApplet>
</q-dialog>
</div>
</template>
<script>
import contributionUE from './ue/contributionUE'
import ChooseImg from '../components/ChooseImg'
import chooseApplet from '../components/chooseApplet'
import draggable from "vuedraggable"
import {
setContributeInfo,
getContributeInfo
getContributeInfo,
setContributeInfoPublish
} from '../../../api/teacher/contribution';
export default {
meta: {
......@@ -191,7 +198,8 @@
components: {
contributionUE,
ChooseImg,
draggable
draggable,
chooseApplet
},
data() {
......@@ -209,6 +217,7 @@
importFileUrl2: this.domainManager().UploadFileUrl2,
// this.domainManager().DomainUrl+'/api/upload/UploadImageTextFileToGZH',
getImgChoice: false,
getappletChoice:false,
type: -1,
ContributionType: 1,//进入的类型
addMsg: {
......@@ -408,6 +417,31 @@
path: '/teacher/contribution/imageTextlist',
});
},
tuisong(){
setContributeInfoPublish({
ContributeId:12,
PlatformId:1,
IsPreview:1,
TagId:'goodluck_cattle',
}).then(res => {
}).catch(() => {
this.loading = false
})
},
getapplet(){//小程序弹窗
this.getappletChoice = true
},
getresult(data){//选择小程序的结果
console.log(data)
this.getappletChoice = false
this.$refs.UE_cb.applet(data)
}
}
}
......
......@@ -154,10 +154,10 @@
hyperlinks(fileArray) {
if (fileArray && fileArray.length) {
let html = '';
//音频
//超链接
fileArray.forEach(item => {
html +=
`<p><a target="_self" href="${item.fileUrl}" data-itemshowtype="0" tab="innerlink" style='text-decoration:none;color: #576b95;' _href="${item.fileUrl}">${item.fileName}</a></p>`;
`<p><a class='weapp_text_link' style="color: #576b95;text-decoration: none;" target="_self" href="${item.fileUrl}" data-itemshowtype="0" tab="innerlink" style='text-decoration:none;color: #576b95;' _href="${item.fileUrl}">${item.fileName}</a></p>`;
})
console.log(html)
if (html && html != '') {
......@@ -166,6 +166,20 @@
}
}
},
applet(data){
let html = '';
if(data.type==1){//文字小程序
html += `<p><a data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.appletmsg.Page}" href="">${data.title}</a></p>`;
}else if(data.type==2){//图片小程序
html+=`<p><a data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.appletmsg.Page}" href=""><img src="${data.imgUrl}" alt="" data-width="null" ></a></p>`
}else if(data.type==3){
html+=`<mp-miniprogram data-miniprogram-appid="${data.appletmsg.AppID}" data-miniprogram-path="${data.appletmsg.Page}" data-miniprogram-title="${data.title}" data-miniprogram-imageurl="${data.imgUrl}"></mp-miniprogram>`
}
if (html && html != '') {
this.ue.execCommand('inserthtml', html);
}
},
//获取文件图标和类型
......@@ -265,4 +279,5 @@
</script>
<style scoped>
</style>
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