浏览代码

1、个人介绍格式优化;2、作品保存流程优化;

huan-jie 4 年之前
父节点
当前提交
0d5cf91701
共有 4 个文件被更改,包括 31 次插入8 次删除
  1. 2 2
      components/sign/profile.vue
  2. 1 1
      components/sign/works.vue
  3. 15 1
      components/works/editor.vue
  4. 13 4
      pages/sign/new.vue

+ 2 - 2
components/sign/profile.vue

@@ -14,8 +14,8 @@
     <div v-else-if="editing" class="edit">
       <editor :hideImage="true" :content="content" @change="handleChange"></editor>
     </div>
-    <div v-else class="show" v-html="content"></div>
-    <!-- <div v-else class="show ql-snow ql-editor" v-html="content"></div> -->
+    <!-- <div v-else class="show" v-html="content"></div> -->
+    <div v-else class="show ql-snow ql-editor" v-html="content"></div>
   </div>
 </template>
 

+ 1 - 1
components/sign/works.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="works">
+  <div class="works" id="works">
     <header>
       <h5>作品</h5>
       <span>

+ 15 - 1
components/works/editor.vue

@@ -183,6 +183,7 @@
        * 发布项目作品
        */
       publish() {
+        const self = this;
         //防止快速连点
         if (this.isPublishing) {
           return;
@@ -215,6 +216,13 @@
             }
             if (res.status === 1) {
               this.$message.success("编辑成功!");
+              setTimeout(() => {
+                // this.$router.go(-1);
+                self.$router.push({
+                  path: '/sign/new',
+                  query: { from: 'works' }
+                })
+              }, 1200);
               // window.location.href = res.data.work_url;
             } else {
               this.$message.error("编辑提交失败,请重试");
@@ -229,7 +237,13 @@
             }
             if (res.status === 1) {
               this.$message.success("发布成功!");
-              this.$router.go(-1);
+              setTimeout(() => {
+                // this.$router.go(-1);
+                self.$router.push({
+                  path: '/sign/new',
+                  query: { from: 'works' }
+                })
+              }, 1200);
             }
             this.isPublishing = false;
           });

+ 13 - 4
pages/sign/new.vue

@@ -73,11 +73,12 @@
     },
     computed: {},
     async mounted() {
+      console.log('sign new mounted')
+      this.setFrom()
+
       this.needLogin();
       // realname_re, 1是待审核,2已签约,3是拒绝
       this.userInfo = await this.getUserInfo();
-
-      this.setFrom()
     },
     methods: {
       async signNow() {
@@ -93,7 +94,8 @@
       },
       setFrom() {
         let doc = "";
-        const from = this.$route.query.from;
+        let from = this.$route.query.from || this.$route.params.from;
+        console.log("run setFrom: ", from);
         switch (from) {
           case "wo_intro":
             doc = document.getElementById("profile");
@@ -107,9 +109,16 @@
           case "wo_skill":
             doc = document.getElementById("skill");
             break;
+          case "works":
+            doc = document.getElementById("works");
+            break;
         }
-        if (doc) doc.scrollIntoView();
         console.log("执行!!!!");
+        if (doc) {
+          setTimeout(() => {
+            doc.scrollIntoView();
+          }, 600);
+        }
       },
       jumpToCredit() {
         location.href = "/credit/pages"