Commit 11f7c78a authored by Mac's avatar Mac
parents d2ea69cd f56b6376
......@@ -16,9 +16,6 @@
<div style="margin-right: 15px;width: auto;-webkit-box-flex: 0;flex-shrink: 0;flex-grow: 0;">
<el-button @click="addGroup" style="margin-bottom: 12px;" type="primary" size="small">添加分组</el-button>
<div style="border: 1px solid rgb(227, 227, 227);width:250px">
<!-- <div style="margin:20px 0">
<el-input v-model="val" style="width:90%;margin:0 5%" placeholder="请输入分类名称搜索" size="small"></el-input>
</div> -->
<div class="el-scrollbar" style="width: 100%;height:670px">
<div class="el-scrollbar__wrap" style="margin-bottom: -8px; margin-right: -8px;">
<div class="el-scrollbar__view">
......@@ -77,7 +74,6 @@
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div style="border: 1px solid rgb(227, 227, 227);height:674px">
<div class="basefix app-attachment-list">
......@@ -88,7 +84,6 @@
:show-file-list="false" :http-request="UploadImage" multiple>
<i class="el-icon-upload"></i>
</el-upload>
</div>
</div>
<el-tooltip v-for="(item,index) in PageList" :key="index" class="item" effect="dark"
......@@ -112,7 +107,8 @@
<div class="material-item material-upload">
<div class="app-upload" flex="main:center cross:center" style="width: 140px; height: 140px;">
<el-upload class="avatar-uploader" action="" :before-upload="beforeAvatarUpload"
accept="video/mp4,video/ogg,video/webm" :show-file-list="false" :http-request="UploadImage" multiple>
accept="video/mp4,video/ogg,video/webm" :show-file-list="false" :http-request="UploadVideo"
multiple>
<i class="el-icon-upload"></i>
</el-upload>
</div>
......@@ -121,8 +117,10 @@
:content="item.Name" placement="top-start">
<div @click="PageSelect(item,index)" :class="item.Selected ? 'selected' :''"
class="el-tooltip item material-item ">
<img :src="getIconLink(item.Path)+'?x-oss-process=video/snapshot,t_9,f_jpg,w_299,h_0,m_fast'"
class="material-img" style="width: 140px; height: 140px;">
<div class="material-video-info"><i class="el-icon-video-play"></i>
<span>{{Time(item.VideoTime)}}</span></div>
<div flex="dir:left" style="margin-top: 5px;">
......@@ -137,8 +135,6 @@
</div>
</el-tooltip>
</template>
</div>
<div style="padding-right:10px">
<el-pagination style="text-align:right" background :current-page="currentPage4"
......@@ -149,13 +145,10 @@
</div>
</div>
</div>
</div>
</div>
<video style="display:none;" controls="controls" id="aa" oncanplaythrough="myFunction(this)">
</video>
</div>
<!-- 新增分组 -->
<el-dialog title="分组管理" :visible.sync="addGroupMsgDig" width="400px">
......@@ -187,11 +180,12 @@
<el-button size="small" type="primary" @click="pagesubmitForm('addpageMsg')">确 定</el-button>
</span>
</el-dialog>
<video width="320" height="240" controls id="upvideo" style="display:none">
</video>
<img :src="testImg" style="width:120px;height:60px;border:1px solid red;" />
<canvas id='mycanvas' ></canvas>
</div>
</template>
<script>
export default {
name: 'ChooseImg',
......@@ -255,7 +249,7 @@
checkList: [],
checkAllList: [],
checkAll: false,
testImg: ""
}
},
created() {
......@@ -263,9 +257,33 @@
this.GetPageList();
},
mounted() {
this.findvideocover("http://192.168.2.214:8130/Upload/Video/20200901114120428.mp4")
},
methods: {
//获取视频封面
findvideocover(videoUrl) {
let _this = this;
this.$nextTick(() => {
let video = document.getElementById("upvideo");
let source = document.createElement("source");
source.src = videoUrl;
source.type = "video/mp4";
video.appendChild(source);
video.addEventListener("loadeddata", function() {
var canvas = document.createElement("canvas");
canvas.width = "320";
canvas.height = "320";
canvas
.getContext("2d")
.drawImage(video, 0, 0, canvas.width, canvas.width);
console.log("video",video);
var img = document.createElement("img");
let imgsrc = canvas.toDataURL("image/png");
_this.testImg=imgsrc
});
});
},
Time(value) {
var theTime = parseInt(value); // 秒
var middle = 0; // 分
......@@ -477,12 +495,25 @@
}
})
},
//上传视频
UploadVideo(file) {
var that = this;
this.UploadSelfFile(this.FileType().Video, file.file, res => {
if (res.resultCode == 1) {
if (that.addpageMsg.Type == 2) {
that.addpageMsg.Image = res.FileUrl;
}
that.addpageMsg.Path = res.FileUrl;
that.addpageMsg.Name = res.FileName;
that.addPageList();
}
})
},
// 新增素材信息
addPageList() {
this.apipost("/api/product/SetMaterialInfo", this.addpageMsg, res => {
if (res.data.resultCode == 1) {
this.GetPageList();
}
})
},
......
......@@ -88,7 +88,7 @@
return {
msg: {
pageIndex: 1,
pageSize: 1000,
pageSize: 10,
Source: 0,
StartDate: '',
EndDate: '',
......
This diff is collapsed.
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