Ver Fonte

PlaylistView.vue 页面添加删除视频稿件接口

reghao há 1 ano atrás
pai
commit
0cd6f5418b
1 ficheiros alterados com 49 adições e 2 exclusões
  1. 49 2
      src/views/home/PlaylistView.vue

+ 49 - 2
src/views/home/PlaylistView.vue

@@ -55,7 +55,7 @@
                 type="danger"
                 size="mini"
                 icon="el-icon-delete"
-                @click="deleteVideo(video.videoId)"
+                @click="deleteVideo(video)"
               >
                 <span>删除</span>
               </el-button>
@@ -369,7 +369,50 @@ export default {
     // 用户点击收藏
     collection(videoId) {
     },
-    deleteVideo(videoId) {
+    deleteVideo(video) {
+      this.$confirm('确定要删除 ' + video.title + '?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+        customClass: 'msgbox'
+      }).then(() => {
+        const videoId = video.videoId
+        const errorReportForm = {
+          videoId: videoId,
+          errorCode: 4
+        }
+
+        videoErrorDelete(errorReportForm).then(resp => {
+          if (resp.code === 0) {
+            this.errorReportForm.errorCode = null
+            this.$notify({
+              title: '提示',
+              message: '视频错误已提交',
+              type: 'warning',
+              duration: 3000
+            })
+          } else {
+            this.$notify({
+              title: '提示',
+              message: resp.msg,
+              type: 'warning',
+              duration: 3000
+            })
+          }
+        }).catch(error => {
+          this.$notify({
+            title: '提示',
+            message: error.message,
+            type: 'warning',
+            duration: 3000
+          })
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        })
+      })
     },
     submitAccessCodeWrapper() {
     },
@@ -549,6 +592,10 @@ export default {
     padding-left: 0.5%;
     padding-right: 0.5%;
   }
+
+  .msgbox{
+    width: 320px !important;
+  }
 }
 
 .movie-list {