|
@@ -3,27 +3,36 @@
|
|
<h2 class="title">轮播图热点内容</h2>
|
|
<h2 class="title">轮播图热点内容</h2>
|
|
<div class="upload-height">
|
|
<div class="upload-height">
|
|
<div class="upload-area">
|
|
<div class="upload-area">
|
|
|
|
+ <!-- 上传按钮 -->
|
|
|
|
+ <div class="imageUpload">
|
|
|
|
+ <el-upload ref="pictureCardRef" action="#" list-type="picture-card" :multiple="true" :show-file-list="false"
|
|
|
|
+ :http-request="uploadGCPImg" accept="video/mp4,video/avi,video/x-msvideo">
|
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 视频或图片 -->
|
|
<div class="image-list">
|
|
<div class="image-list">
|
|
- <div v-for="(file, index) in fileList" :key="index" :class="`${!file.loading ? 'image-item-hover' : ''} image-item`">
|
|
|
|
|
|
+ <div v-for="(file, index) in fileList" :key="index"
|
|
|
|
+ :class="`${!file.loading ? 'image-item-hover' : ''} image-item`">
|
|
<img :src="require('../../assets/image/yunketang.png')" class="cert-image" @click="previewImage(index)">
|
|
<img :src="require('../../assets/image/yunketang.png')" class="cert-image" @click="previewImage(index)">
|
|
<div class="image-actions" v-if="!file.loading">
|
|
<div class="image-actions" v-if="!file.loading">
|
|
<el-button type="danger" icon="el-icon-delete" circle @click.stop="removeImage(index)"></el-button>
|
|
<el-button type="danger" icon="el-icon-delete" circle @click.stop="removeImage(index)"></el-button>
|
|
- <el-button type="primary" icon="el-icon-view" circle></el-button>
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-view" circle @click.stop="previewingVideo(index)"></el-button>
|
|
</div>
|
|
</div>
|
|
<div class="image-actions-loging" v-if="file.loading">
|
|
<div class="image-actions-loging" v-if="file.loading">
|
|
文件上传中...
|
|
文件上传中...
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!-- 上传按钮 -->
|
|
|
|
- <div class="imageUpload">
|
|
|
|
- <el-upload ref="pictureCardRef" action="#" list-type="picture-card" :multiple="true"
|
|
|
|
- :show-file-list="false" :http-request="uploadGCPImg" accept="video/mp4,video/avi,video/x-msvideo">
|
|
|
|
- <i class="el-icon-plus"></i>
|
|
|
|
- </el-upload>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <!-- 预览视频 -->
|
|
|
|
+ <el-dialog title="预览视频" append-to-body :visible.sync="previewingVideoVisable" width="900px" top="6.5vh" :before-close="handleClose">
|
|
|
|
+ <div class="previewingVideo">
|
|
|
|
+ <video :src="previewVideoSrc" :poster="require('../../assets/image/yunketang.png')" controls></video>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -36,9 +45,16 @@ export default {
|
|
fileList: [],
|
|
fileList: [],
|
|
imageList: [],
|
|
imageList: [],
|
|
imageListTime: null,
|
|
imageListTime: null,
|
|
|
|
+ previewingVideoVisable: false,
|
|
|
|
+ previewVideoSrc: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ previewingVideo(index) {
|
|
|
|
+ const row = this.fileList[index]
|
|
|
|
+ this.previewVideoSrc = row.url
|
|
|
|
+ this.previewingVideoVisable = true
|
|
|
|
+ },
|
|
uploadGCPImg(file) {
|
|
uploadGCPImg(file) {
|
|
this.imageList.unshift(file.file)
|
|
this.imageList.unshift(file.file)
|
|
if (this.imageListTime) {
|
|
if (this.imageListTime) {
|
|
@@ -117,6 +133,10 @@ export default {
|
|
padding: 20px;
|
|
padding: 20px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.imageUpload {
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+}
|
|
|
|
+
|
|
.title {
|
|
.title {
|
|
text-align: center;
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
margin-bottom: 30px;
|
|
@@ -143,7 +163,6 @@ export default {
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
gap: 20px;
|
|
gap: 20px;
|
|
margin-bottom: 30px;
|
|
margin-bottom: 30px;
|
|
- margin-right: 20px;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
.image-item {
|
|
.image-item {
|