Browse Source

创建作品流程优化;

huan-jie 4 years ago
parent
commit
6274c57464
1 changed files with 31 additions and 4 deletions
  1. 31 4
      components/works/editor.vue

+ 31 - 4
components/works/editor.vue

@@ -80,7 +80,7 @@
     </div>
     <!-- btn group -->
     <footer class="">
-      <el-button type="primary" @click="publish" class="btn-save" v-bind:disabled="isPublishing">保存</el-button>
+      <el-button type="primary" @click="publish" class="btn-save" v-bind:disabled="isPublishing">{{ submitText }}</el-button>
       <!--      <el-button @click="cancel">取消</el-button>-->
     </footer>
   </div>
@@ -139,7 +139,22 @@
       };
     },
     mixins: [oos],
-    computed: {},
+    computed: {
+      /**
+       * 提交保存时的文字:
+       * 1. 没有作品资源时,文案为“保存”
+       * 2. 有作品资源时,文案为“保存并提交审核”
+       */
+      submitText () {
+        let res = '保存'
+
+        if (this.uploadFileList && this.uploadFileList.length) {
+          res = '保存并提交审核'
+        }
+
+        return res
+      }
+    },
     mounted() {
       this.needLogin();
       this.getWorkCate();
@@ -277,7 +292,13 @@
               this.goHome();
             }
             if (res.status === 1) {
-              this.$message.success("编辑作品成功!");
+              if (this.uploadFileList && this.uploadFileList.length) {
+                // 有作品资源时
+                this.$message.success("提交成功,系统将在1-3个工作日完成审核");
+              } else {
+                // 无作品资源时
+                this.$message.success("编辑作品成功!");
+              }
               setTimeout(() => {
                 //window.location.href = `/wo/${self.$store.state.userinfo.uid}/works`;
                 window.location.href = res.data.work_url;
@@ -295,7 +316,13 @@
               this.goHome();
             }
             if (res.status === 1) {
-              this.$message.success("添加作品成功!");
+              if (this.uploadFileList && this.uploadFileList.length) {
+                // 有作品资源时
+                this.$message.success("提交成功,系统将在1-3个工作日完成审核");
+              } else {
+                // 无作品资源时
+                this.$message.success("添加作品成功!");
+              }
               this.wid = res.data.wid || ''
               setTimeout(() => {
                 window.location.href = res.data.work_url;