Commit 83d0f6e4 authored by Mac's avatar Mac

修改

parent d84505a4
This diff is collapsed.
<style>
.editOrderDrawerTop {
width: 100%;
height: 50px;
display: flex;
justify-content: space-between;
background-color: #f0f5fb;
padding: 5px 10px;
align-items: center;
}
.disableStatus {
opacity: 0.3 !important;
cursor: auto;
}
.imgstyle {
width: 100%;
height: 126px;
border-radius: 4px;
}
/* .avatar-uploader .el-upload {
border-radius: 6px;
cursor: pointer;
width: 100%;
height: 100%;
color: #8c939d;
position: relative;
overflow: hidden;
} */
.addDutyMain {
display: inline-block;
width: 118px;
height: 118px;
font-size: 40px;
border: 1px dashed #d9d9d9;
line-height: 118px;
}
.up-box {
width: 90px;
height: 90px;
border: 1px dashed #ccc;
text-align: center;
line-height: 80px;
font-size: 50px;
cursor: pointer;
}
</style>
<template>
<div>
<q-dialog v-model="IsShow" persistent>
<q-card style="width: 800px; max-width: 80vw;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">视频</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none">
<el-form ref="addMsg" :model="addMsg" label-width="120px">
<el-form-item label="添加方式:">
<q-radio v-model="Addtype" val="1" label="新建" />
<q-radio v-model="Addtype" val="2" label="导入" />
</el-form-item>
<div v-if="Addtype ==1 ">
<el-form-item label="素材分组:">
<q-select filled stack-label option-value="Id" option-label="Name" style="width: 80%;"
v-model="addMsg.MediaGroupId" ref="Id" :options="classifyList" label="分组" :dense="false" emit-value map-options />
</el-form-item>
<el-form-item label="视频上传:">
<video width="320" height="240" controls="controls" v-if="addMsg.VideoModel.VideoPath!=''">
<source :src="addMsg.VideoModel.VideoPath" type="video/mp4" />
</video>
<div style="margin-top: 15px;">
<el-upload class="avatar-uploader " action="" :before-upload="uploadFile"
:show-file-list="false">
<q-btn color="accent" size="sm" class="q-mr-md" icon="cloud_upload" label="上传">
</q-btn>
</el-upload>
<div style="margin-top: 20px;">
(视频上传大小不超过10M,支持MP4格式)
</div>
</div>
</el-form-item>
</div>
<div v-if="Addtype ==2 ">
<el-form-item label="视频:" required>
<q-btn color="accent" class="q-mr-md" label="选择视频" @click="selectimg(5)" />
</el-form-item>
</div>
</el-form>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="closeEditOrder" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="saveOrderInfo()" />
</q-card-actions>
</q-card>
</q-dialog>
<!-- 图片 -->
<selectMaterial v-if="isshowselectMaterial" :materialType="materialType" :saveobj='Selectobj' :classifyList='classifyList'
@close="getclose()" @success='getsuccess'>
</selectMaterial>
</div>
</template>
<script>
import {
wechatUploadSelfFile
} from "../../api/common/common"; //上传图片
import {
UploadSelfFile
} from "../../api/common/common"; //上传图片
import {
setWeChatMediumInfo,//新增素材
} from '../../api/system/wechat';
import selectMaterial from "./selectMaterial"
export default {
props: {
saveobj: {
type: Object,
default: null,
},
classifyList: {
type: Array,
default: [],
},
},
components: {
selectMaterial,
},
data() {
return {
IsShow: true,
Addtype: "1",//添加方式 1为新建
addMsg: {
Id: 0,
Type: 5,
Is_Sync: 1,
MediaGroupId: '',
VideoModel:{
VideoName: '',
VideoPath: '',
}
},
materialType: 2,
Selectobj: {},
isshowselectMaterial: false,
}
},
created() {
},
mounted() {
},
watch: {
},
methods: {
//关闭弹窗
closeEditOrder() {
this.$emit('close')
},
selectimg(type) {//素材选择 图片模式
this.materialType = type;
this.isshowselectMaterial = true;
},
getclose() {//素材关闭
this.isshowselectMaterial = false
},
getsuccess(data) {//选择数据回来
if(this.materialType==2){
this.addMsg.AppletModel.ImageName = data.ImageModel.ImageName
this.addMsg.AppletModel.ImagePath = data.ImageModel.ImagePath
}else{
this.$emit('success', data)
}
this.addMsg.CoverImage = data.img
this.isshowselectMaterial = false
},
setWeChat(){
setWeChatMediumInfo(this.addMsg).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.Selectobj = JSON.parse(JSON.stringify(this.addMsg))
this.Selectobj.Id = res.Data
this.$emit('success', this.Selectobj)
})
},
uploadFile(files) {//图片上传
// 文件类型进行判断
const isLt10M = files.size / 1024 / 1024 < 10;
if (['video/mp4'].indexOf(files.type) == -1) {
this.$q.notify({
type: 'negative',
message: `请上传正确的视频格式!`,
position: 'top'
})
return false;
}
if (!isLt10M) {
this.$q.notify({
type: 'negative',
message: `上传视频大小不能超过10MB哦!`,
position: 'top'
})
return false;
}
wechatUploadSelfFile('wechatcatalogue', files, res => {
if (res.Code == 1) {
this.addMsg.VideoModel.VideoName = res.FileName;
this.addMsg.VideoModel.VideoPath = res.FileUrl;
this.$forceUpdate();
}
})
},
saveOrderInfo() {
if (this.addMsg.MediaGroupId == '') {
this.$q.notify({
type: 'negative',
message: `请选择分组选择`,
position: 'top'
})
return
}
if(this.addMsg.VideoModel.VideoPath==''){
this.$q.notify({
type: 'negative',
message: `请上传视频`,
position: 'top'
})
return
}
this.setWeChat()
},
}
}
</script>
\ No newline at end of file
...@@ -40,6 +40,17 @@ ...@@ -40,6 +40,17 @@
background: #FFF !important; background: #FFF !important;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85); box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
} }
.addwelcome .icon-excel,
.addwelcome .icon-pdf,
.addwelcome .icon-txt,
.addwelcome .icon-wenjian,
.addwelcome .icon-yasuobao,
.addwelcome .icon-shipin,
.addwelcome .icon-word {
font-size: 38px;
color: green;
line-height: 75px;
}
</style> </style>
<template> <template>
...@@ -76,6 +87,15 @@ ...@@ -76,6 +87,15 @@
</div> </div>
</div>
<div v-if="item.Type==5" style="width: 1px; flex:1">
<video width="300" height="200" controls="controls" v-if="item.VideoModel && item.VideoModel.VideoPath">
<source :src="item.VideoModel.VideoPath" type="video/ogg" />
<source :src="item.VideoModel.VideoPath" type="video/mp4" />
<source :src="item.VideoModel.VideoPath" type="video/webm" />
</video>
</div> </div>
<div v-if="item.Type==6" style="width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;"> <div v-if="item.Type==6" style="width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div>{{item.AppletModel.Title}}</div> <div>{{item.AppletModel.Title}}</div>
...@@ -84,6 +104,23 @@ ...@@ -84,6 +104,23 @@
</q-img> </q-img>
</div>
<div v-if="item.Type==7" style="width: 1px; flex:1;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div style="display: flex;align-items: flex-start;justify-content: space-between;" @click="showUpLoadFile(item.FileModel)">
<div style="width: 1px;flex:1">
{{item.FileModel.FileName}}
</div>
<div style="width: 50px;text-align: right;margin-left: 10px;">
<i v-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='PDF'" class="iconfont icon-pdf"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='TXT'" class="iconfont icon-txt"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOCX' ||
item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOC'
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
</div>
</div> </div>
</div> </div>
...@@ -107,13 +144,15 @@ ...@@ -107,13 +144,15 @@
</div> </div>
</div> </div>
<q-btn color="white" text-color="black" label="+添加图片/图文/小程序" size='md'> <q-btn color="white" v-if='addMsg.MediumModel && addMsg.MediumModel.length<9' text-color="black" label="+添加图片/图文/小程序/视频/文件" size='md'>
<q-popup-proxy ref='popupproxy'> <q-popup-proxy ref='popupproxy'>
<q-banner> <q-banner>
<q-btn-group push> <q-btn-group push>
<q-btn label="图片" icon="images" @click="selectimg()" /> <q-btn label="图片" icon="images" @click="selectimg()" />
<q-btn label="图文" icon="visibility" @click="selecttextimg()" /> <q-btn label="图文" icon="visibility" @click="selecttextimg()" />
<q-btn label="小程序" icon="update" @click="selectxcx()" /> <q-btn label="小程序" icon="update" @click="selectxcx()" />
<q-btn label="视频" icon="update" @click="selectvideo()" />
<q-btn label="文件" icon="update" @click="selectfiled()" />
</q-btn-group> </q-btn-group>
</q-banner> </q-banner>
</q-popup-proxy> </q-popup-proxy>
...@@ -135,6 +174,10 @@ ...@@ -135,6 +174,10 @@
<!-- 小程序 --> <!-- 小程序 -->
<appletform v-if="isshowapplet" @close="getxcxclose()" @success='getxcxsuccess' :classifyList='classifyList'> <appletform v-if="isshowapplet" @close="getxcxclose()" @success='getxcxsuccess' :classifyList='classifyList'>
</appletform> </appletform>
<!-- 视频 -->
<videofrom v-if="issvideofrom" @close="getxcxclose()" @success='getvideosuccess' :classifyList='classifyList'> </videofrom>
<!-- 文件 -->
<filefrom v-if="isfilefrom" @close="getxcxclose()" @success='getfilesuccess' :classifyList='classifyList'> </filefrom>
</div> </div>
</template> </template>
...@@ -147,6 +190,8 @@ ...@@ -147,6 +190,8 @@
import selectMaterial from "./selectMaterial" import selectMaterial from "./selectMaterial"
import imagetextform from "./imagetext-form" import imagetextform from "./imagetext-form"
import appletform from "./applet-form" import appletform from "./applet-form"
import videofrom from "./video-from"
import filefrom from "./file-from"
import { import {
queryEmployee queryEmployee
...@@ -157,6 +202,8 @@ ...@@ -157,6 +202,8 @@
selectMaterial, selectMaterial,
imagetextform,//图文 imagetextform,//图文
appletform,//小程序 appletform,//小程序
videofrom,
filefrom,
}, },
props: { props: {
welcomeindex: { welcomeindex: {
...@@ -203,6 +250,8 @@ ...@@ -203,6 +250,8 @@
isshowimagetext: false, isshowimagetext: false,
isshowapplet: false, isshowapplet: false,
classifyList: [], classifyList: [],
issvideofrom:false,
isfilefrom:false
} }
}, },
created() { created() {
...@@ -342,14 +391,35 @@ ...@@ -342,14 +391,35 @@
this.$refs.popupproxy.hide() this.$refs.popupproxy.hide()
} }
}, },
selectvideo(){//视频打开
this.issvideofrom = true;
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
selectfiled(){//文件
this.isfilefrom = true
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
getxcxclose() {//小程序 关闭 getxcxclose() {//小程序 关闭
this.isshowapplet = false; this.isshowapplet = false;
this.issvideofrom = false;
this.isfilefrom = false
}, },
getxcxsuccess(data) {//小程序 关闭 getxcxsuccess(data) {//小程序 关闭
this.ISidentical(data) this.ISidentical(data)
this.isshowapplet = false this.isshowapplet = false
}, },
getvideosuccess(data){
this.ISidentical(data)
this.issvideofrom = false;
},
getfilesuccess(data){
this.ISidentical(data)
this.isfilefrom = false;
},
getType(row, name) { getType(row, name) {
let title = '' let title = ''
...@@ -363,6 +433,13 @@ ...@@ -363,6 +433,13 @@
} else if (row.Type == 6) { } else if (row.Type == 6) {
title = row.AppletModel.Title title = row.AppletModel.Title
content = row.AppletModel.ImagePath content = row.AppletModel.ImagePath
} else if (row.Type == 5) {
title = row.VideoModel.VideoName
content = row.VideoModel.VideoPath
}
else if (row.Type == 7) {
title = row.FileModel.FileName
content = row.FileModel.FilePath
} }
if (name == 'title') { if (name == 'title') {
return title return title
...@@ -376,7 +453,28 @@ ...@@ -376,7 +453,28 @@
gettrigger(){//文本触发时 gettrigger(){//文本触发时
this.$emit('success', this.addMsg, this.welcomeindex,this.childrenindex,this.welcomename) this.$emit('success', this.addMsg, this.welcomeindex,this.childrenindex,this.welcomename)
} },
showUpLoadFile(i) {
// 文件类型进行判断
if (
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "PDF" ||
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "TXT"
) {
this.previewPDF(i.Url);
} else {
window.open(
"https://view.officeapps.live.com/op/view.aspx?src=" + i.FilePath
);
}
},
......
...@@ -40,6 +40,17 @@ ...@@ -40,6 +40,17 @@
background: #FFF !important; background: #FFF !important;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85); box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
} }
.addwelcome .icon-excel,
.addwelcome .icon-pdf,
.addwelcome .icon-txt,
.addwelcome .icon-wenjian,
.addwelcome .icon-yasuobao,
.addwelcome .icon-shipin,
.addwelcome .icon-word {
font-size: 38px;
color: green;
line-height: 75px;
}
</style> </style>
<template> <template>
...@@ -76,6 +87,15 @@ ...@@ -76,6 +87,15 @@
</div> </div>
</div>
<div v-if="item.Type==5" style="width: 1px; flex:1">
<video width="300" height="200" controls="controls" v-if="item.VideoModel && item.VideoModel.VideoPath">
<source :src="item.VideoModel.VideoPath" type="video/ogg" />
<source :src="item.VideoModel.VideoPath" type="video/mp4" />
<source :src="item.VideoModel.VideoPath" type="video/webm" />
</video>
</div> </div>
<div v-if="item.Type==6" style="width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;"> <div v-if="item.Type==6" style="width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div>{{item.AppletModel.Title}}</div> <div>{{item.AppletModel.Title}}</div>
...@@ -84,6 +104,23 @@ ...@@ -84,6 +104,23 @@
</q-img> </q-img>
</div>
<div v-if="item.Type==7" style="width: 1px; flex:1;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div style="display: flex;align-items: flex-start;justify-content: space-between;" @click="showUpLoadFile(item.FileModel)">
<div style="width: 1px;flex:1">
{{item.FileModel.FileName}}
</div>
<div style="width: 50px;text-align: right;margin-left: 10px;">
<i v-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='PDF'" class="iconfont icon-pdf"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='TXT'" class="iconfont icon-txt"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOCX' ||
item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOC'
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
</div>
</div> </div>
</div> </div>
...@@ -124,13 +161,15 @@ ...@@ -124,13 +161,15 @@
</div> </div>
</div> </div>
<q-btn color="white" text-color="black" label="+添加图片/图文/小程序" size='md'> <q-btn color="white" v-if='MediumModel.length<9' text-color="black" label="+添加图片/图文/小程序/视频/文件" size='md'>
<q-popup-proxy ref='popupproxy'> <q-popup-proxy ref='popupproxy'>
<q-banner> <q-banner>
<q-btn-group push> <q-btn-group push>
<q-btn label="图片" icon="images" @click="selectimg()" /> <q-btn label="图片" icon="images" @click="selectimg()" />
<q-btn label="图文" icon="visibility" @click="selecttextimg()" /> <q-btn label="图文" icon="visibility" @click="selecttextimg()" />
<q-btn label="小程序" icon="update" @click="selectxcx()" /> <q-btn label="小程序" icon="update" @click="selectxcx()" />
<q-btn label="视频" icon="update" @click="selectvideo()" />
<q-btn label="文件" icon="update" @click="selectfiled()" />
</q-btn-group> </q-btn-group>
</q-banner> </q-banner>
</q-popup-proxy> </q-popup-proxy>
...@@ -178,8 +217,12 @@ ...@@ -178,8 +217,12 @@
<!-- 图文 --> <!-- 图文 -->
<imagetextform v-if="isshowimagetext" @close="gettwclose()" @success='gettwsuccess' :classifyList='classifyList'></imagetextform> <imagetextform v-if="isshowimagetext" @close="gettwclose()" @success='gettwsuccess' :classifyList='classifyList'></imagetextform>
<!-- 小程序 --> <!-- 小程序 -->
<appletform v-if="isshowapplet" @close="getxcxclose()" @success='getxcxsuccess' :classifyList='classifyList'> <appletform v-if="isshowapplet" @close="getxcxclose()" @success='getxcxsuccess' :classifyList='classifyList'> </appletform>
</appletform> <!-- 视频 -->
<videofrom v-if="issvideofrom" @close="getxcxclose()" @success='getvideosuccess' :classifyList='classifyList'> </videofrom>
<!-- 文件 -->
<filefrom v-if="isfilefrom" @close="getxcxclose()" @success='getfilesuccess' :classifyList='classifyList'> </filefrom>
</div> </div>
</template> </template>
...@@ -192,7 +235,9 @@ ...@@ -192,7 +235,9 @@
import selectMaterial from "../../components/enterprise/selectMaterial" import selectMaterial from "../../components/enterprise/selectMaterial"
import imagetextform from "../../components/enterprise/imagetext-form" import imagetextform from "../../components/enterprise/imagetext-form"
import appletform from "../../components/enterprise/applet-form" import appletform from "../../components/enterprise/applet-form"
import videofrom from "../../components/enterprise/video-from"
import filefrom from "../../components/enterprise/file-from"
import { import {
queryEmployee queryEmployee
} from '../../api/users/user' } from '../../api/users/user'
...@@ -204,6 +249,8 @@ ...@@ -204,6 +249,8 @@
selectMaterial, selectMaterial,
imagetextform,//图文 imagetextform,//图文
appletform,//小程序 appletform,//小程序
videofrom,//视频
filefrom,//文件
}, },
name: "welcomeList", name: "welcomeList",
data() { data() {
...@@ -233,6 +280,10 @@ ...@@ -233,6 +280,10 @@
isshowapplet: false, isshowapplet: false,
MediumModel: [],//已选的添加内容 MediumModel: [],//已选的添加内容
classifyList: [], classifyList: [],
issvideofrom:false,
isfilefrom:false
} }
}, },
created() { created() {
...@@ -416,13 +467,35 @@ ...@@ -416,13 +467,35 @@
this.$refs.popupproxy.hide() this.$refs.popupproxy.hide()
} }
}, },
selectvideo(){//视频打开
this.issvideofrom = true;
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
selectfiled(){//文件
this.isfilefrom = true
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
getxcxclose() {//小程序 关闭 getxcxclose() {//小程序 关闭
this.isshowapplet = false; this.isshowapplet = false;
this.issvideofrom = false;
this.isfilefrom = false
}, },
getxcxsuccess(data) {//小程序 关闭 getxcxsuccess(data) {//小程序 关闭
this.ISidentical(data) this.ISidentical(data)
this.isshowapplet = false this.isshowapplet = false
}, },
getvideosuccess(data){
this.ISidentical(data)
this.issvideofrom = false;
},
getfilesuccess(data){
this.ISidentical(data)
this.isfilefrom = false;
},
savemove() {//保存 savemove() {//保存
if (this.membertype == 1) { if (this.membertype == 1) {
this.addMsg.UserIdList = ["-1"]; this.addMsg.UserIdList = ["-1"];
...@@ -494,6 +567,13 @@ ...@@ -494,6 +567,13 @@
} else if (row.Type == 6) { } else if (row.Type == 6) {
title = row.AppletModel.Title title = row.AppletModel.Title
content = row.AppletModel.ImagePath content = row.AppletModel.ImagePath
} else if (row.Type == 5) {
title = row.VideoModel.VideoName
content = row.VideoModel.VideoPath
}
else if (row.Type == 7) {
title = row.FileModel.FileName
content = row.FileModel.FilePath
} }
if (name == 'title') { if (name == 'title') {
return title return title
...@@ -503,7 +583,27 @@ ...@@ -503,7 +583,27 @@
}, },
deleteModel(index){ deleteModel(index){
this.MediumModel.splice(index,1) this.MediumModel.splice(index,1)
} },
showUpLoadFile(i) {
// 文件类型进行判断
if (
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "PDF" ||
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "TXT"
) {
this.previewPDF(i.Url);
} else {
window.open(
"https://view.officeapps.live.com/op/view.aspx?src=" + i.FilePath
);
}
},
......
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