|
@@ -62,8 +62,6 @@
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
>
|
|
|
- <el-table-column align="center" type="index" />
|
|
|
-
|
|
|
<el-table-column
|
|
|
label="视频ID"
|
|
|
min-width="100"
|
|
@@ -75,8 +73,20 @@
|
|
|
label="视频标题"
|
|
|
min-width="150"
|
|
|
align="center"
|
|
|
- prop="actAmount"
|
|
|
+ prop="videoTitle"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="视频封面"
|
|
|
+ min-width="110"
|
|
|
+ align="center"
|
|
|
+ prop="videoImg"
|
|
|
>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="video" @click="handlePlay(scope.row)">
|
|
|
+ <img :src="scope.row.videoImg" class="video-img" />
|
|
|
+ <i class="el-icon-video-play" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="SKU" min-width="100" align="center" prop="sku" />
|
|
|
|
|
@@ -86,48 +96,51 @@
|
|
|
align="center"
|
|
|
prop="skuId"
|
|
|
/>
|
|
|
- <!-- <el-table-column
|
|
|
+ <el-table-column
|
|
|
label="审核状态"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- prop="reserveAmount"
|
|
|
- />
|
|
|
+ prop="reviewStatus"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getValueByKey(scope.row.reviewStatus, auditStatus) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
label="审核时间"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- prop="reserveAmount"
|
|
|
+ prop="reviewTime"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="审核人"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- prop="reserveAmount"
|
|
|
+ prop="reviewer"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="发布状态"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- prop="reserveAmount"
|
|
|
- />
|
|
|
+ prop="publishStatus"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getValueByKey(scope.row.publishStatus, auditStatus) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="发布时间"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- prop="reserveAmount"
|
|
|
+ prop="publishTime"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="发布人"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
- prop="reserveAmount"
|
|
|
+ prop="publisher"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- label="审核状态"
|
|
|
- min-width="100"
|
|
|
- align="center"
|
|
|
- prop="reserveAmount"
|
|
|
- /> -->
|
|
|
<el-table-column
|
|
|
label="关联热词"
|
|
|
min-width="100"
|
|
@@ -141,12 +154,12 @@
|
|
|
align="center"
|
|
|
prop="liveTime"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
label="直播场次"
|
|
|
min-width="100"
|
|
|
align="center"
|
|
|
prop="liveSession"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
<el-table-column
|
|
|
label="直播中控"
|
|
|
min-width="120"
|
|
@@ -174,25 +187,41 @@
|
|
|
align="center"
|
|
|
prop="createTime"
|
|
|
/>
|
|
|
- <el-table-column label="操作" align="center" min-width="80" fixed="right">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ min-width="250"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- size="mini"
|
|
|
- @click="handleDownload(scope.row)"
|
|
|
- >
|
|
|
- 下载
|
|
|
- </el-button>
|
|
|
- <el-button type="danger" size="mini" @click="handlePlay(scope.row)">
|
|
|
- 播放
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- size="mini"
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
+ <div class="button">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="
|
|
|
+ scope.row && scope.row.id
|
|
|
+ ? downloadingRows[scope.row.id]
|
|
|
+ : false
|
|
|
+ "
|
|
|
+ size="mini"
|
|
|
+ @click="handleDownload(scope.row)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ size="mini"
|
|
|
+ @click="handlePlay(scope.row)"
|
|
|
+ >
|
|
|
+ 播放
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ size="mini"
|
|
|
+ @click="handleDelete(scope.row.id)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -206,13 +235,22 @@
|
|
|
pos="btmRight"
|
|
|
@retPage="retPage"
|
|
|
/>
|
|
|
+ <!-- 视频播放 -->
|
|
|
+ <video-player
|
|
|
+ ref="videoPlayer"
|
|
|
+ :video-url="currentVideoUrl"
|
|
|
+ :video-title="currentVideoTitle"
|
|
|
+ @close="handlePlayerClose"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import waves from "@/directive/waves";
|
|
|
import swPage from "@/views/common/swPage";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
+import { auditStatus } from "@/constants/index";
|
|
|
+import { getValueByKey } from "@/utils/index";
|
|
|
+// import { getToken } from "@/utils/auth";
|
|
|
import { fetchOralVideoList, deleteOralVideoList } from "@/api/video";
|
|
|
import downloadUtil from "@/utils/downloadUtil";
|
|
|
import VideoPlayer from "@/components/VideoPlayer";
|
|
@@ -228,52 +266,33 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ auditStatus,
|
|
|
tableKey: 0,
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
listLoading: false,
|
|
|
- uploadVisible: false,
|
|
|
- uploadData: {
|
|
|
- warehouseCode: ""
|
|
|
- },
|
|
|
- //TODO 下载路径
|
|
|
- uploadUrl: process.env.VUE_APP_OMS_API + "/inventory/uploadExcel",
|
|
|
+ downloadingRows: {},
|
|
|
listQuery: {
|
|
|
page: 1,
|
|
|
limit: 20,
|
|
|
- skuCode: "",
|
|
|
- partnumber: "",
|
|
|
- warehouseId: null
|
|
|
+ videoTitle: null
|
|
|
},
|
|
|
- //仓库列表
|
|
|
- warehouses: [],
|
|
|
- dataWarehouses: [],
|
|
|
- baseURL: process.env.VUE_APP_OMS_API //把url前面的域名拿出来
|
|
|
+ currentVideoUrl: null,
|
|
|
+ currentVideoTitle: null
|
|
|
};
|
|
|
},
|
|
|
//页面创建的时候执行
|
|
|
created() {
|
|
|
- // this.getList();
|
|
|
- // this.getWareHouseInfo();
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // 计算属性的 getter
|
|
|
- headers: function() {
|
|
|
- return {
|
|
|
- "X-Token": getToken()
|
|
|
- };
|
|
|
- }
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ getValueByKey,
|
|
|
getList() {
|
|
|
this.listLoading = true;
|
|
|
- if (!this.listQuery.warehouseId) {
|
|
|
- this.listQuery.warehouseId = null;
|
|
|
- }
|
|
|
fetchOralVideoList(this.listQuery).then(res => {
|
|
|
if (200 == res.code) {
|
|
|
this.total = res.data.total;
|
|
|
- this.list = res.data.list;
|
|
|
+ this.list = res.data.rows;
|
|
|
}
|
|
|
this.listLoading = false;
|
|
|
});
|
|
@@ -288,22 +307,31 @@ export default {
|
|
|
},
|
|
|
// 视频下载
|
|
|
async handleDownload(row) {
|
|
|
- const { videoUrl, videoName } = row;
|
|
|
+ const { videoUrl, videoTitle, id, sku } = row;
|
|
|
+ this.$set(this.downloadingRows, id, true);
|
|
|
try {
|
|
|
- await downloadUtil.videoDownload(videoUrl, videoName);
|
|
|
- this.$message.success("下载成功");
|
|
|
+ const title = sku ? videoTitle + "_" + sku : videoTitle;
|
|
|
+ const res = await downloadUtil.videoDownload(videoUrl, title);
|
|
|
+ if (res) {
|
|
|
+ this.$message.success("下载成功");
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
this.$message.error(error.message);
|
|
|
+ } finally {
|
|
|
+ this.$set(this.downloadingRows, id, false);
|
|
|
}
|
|
|
},
|
|
|
// 视频播放
|
|
|
handlePlay(row) {
|
|
|
- if (!row.videoUrl) {
|
|
|
+ const { videoUrl, videoTitle } = row;
|
|
|
+ ``;
|
|
|
+ if (!videoUrl) {
|
|
|
this.$message.error("视频地址不存在");
|
|
|
return;
|
|
|
}
|
|
|
- this.currentVideoUrl = row.videoUrl;
|
|
|
- this.currentVideoTitle = row.videoTitle || "视频播放";
|
|
|
+ this.currentVideoUrl =
|
|
|
+ "https://cdn.shopify.com/videos/c/o/v/a1f2197c35ed4c4985f953af47cb68f0.mp4";
|
|
|
+ this.currentVideoTitle = videoTitle;
|
|
|
this.$refs.videoPlayer.show();
|
|
|
},
|
|
|
handlePlayerClose() {
|
|
@@ -312,12 +340,13 @@ export default {
|
|
|
},
|
|
|
handleDelete(row) {
|
|
|
//删除
|
|
|
- this.$confirm("是否删除该记录?", "提示", {
|
|
|
+ this.$confirm("是否删除该视频?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- deleteOralVideoList(row.id).then(() => {
|
|
|
+ const { id } = row;
|
|
|
+ deleteOralVideoList({ idList: [id] }).then(() => {
|
|
|
this.$notify({
|
|
|
title: "成功",
|
|
|
message: "删除成功",
|
|
@@ -335,4 +364,41 @@ export default {
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
@import "../../styles/layout.scss";
|
|
|
+.button {
|
|
|
+ .el-button {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ &:last-child {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.video {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-content: center;
|
|
|
+ justify-content: center;
|
|
|
+ &-img {
|
|
|
+ width: 60px;
|
|
|
+ height: 60px;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ object-fit: cover;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ i {
|
|
|
+ width: 60px;
|
|
|
+ height: 60px;
|
|
|
+ position: absolute;
|
|
|
+ top: 85%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ae8877;
|
|
|
+ opacity: 0;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|