Переглянути джерело

fix: bugs of works intro profile

arvin 6 роки тому
батько
коміт
c2aadb85d1

+ 6 - 2
components/editor.vue

@@ -35,12 +35,16 @@ if (process.browser) {
 }
 import hljs from "hljs";
 export default {
-  props: ["content"],
+  props: ["content", "hideImage"],
   components: {
     // quillEditor
     // Editor
   },
   data() {
+    const extra = ["link"];
+    if (!this.hideImage) {
+      extra.push("image");
+    }
     return {
       editorOption: {
         theme: "snow",
@@ -60,7 +64,7 @@ export default {
             [{ color: [] }, { background: [] }],
             [{ align: [] }],
             ["clean"],
-            ["link", "image"]
+            extra
           ],
           syntax: {
             highlight: text => hljs.highlightAuto(text).value

+ 21 - 2
components/sign/intro.vue

@@ -2,7 +2,12 @@
   <div class="intro">
     <h3>
       完善个人简历后,才能申请签约开发者进行接单
-      <span class="status success">已通过签约</span>
+      <span
+        v-if="this.userInfo.realname_re == '2'"
+        class="status success"
+      >已通过签约</span>
+      <span v-else-if="this.userInfo.realname_re == '1'" class="status info">待审核</span>
+      <span v-else class="status warning">拒绝</span>
     </h3>
     <p>
       成为程序员客栈签约开发者后,才能在平台接单,包括平台派单类项目、雇佣项目等,并
@@ -17,7 +22,21 @@
 </template>
 
 <script>
-export default {};
+export default {
+  head: {},
+  components: {},
+  data() {
+    return {
+      userInfo: {}
+    };
+  },
+  computed: {},
+  async mounted() {
+    // realname_re, 1是待审核,2已签约,3是拒绝
+    this.userInfo = await this.getUserInfo();
+  },
+  methods: {}
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
components/sign/profile.vue

@@ -11,7 +11,7 @@
       </div>
     </header>
     <div v-if="editing" class="edit">
-      <editor :content="content" @change="handleChange"></editor>
+      <editor :hideImage="true" :content="content" @change="handleChange"></editor>
     </div>
     <div v-else class="show" v-html="content"></div>
   </div>

+ 5 - 2
components/sign/works.vue

@@ -146,9 +146,10 @@ export default {
         type: "warning"
       })
         .then(async () => {
+          console.log(work);
           if (work) {
             const res = await this.$axios.$post(`/api/user_works/delete`, {
-              id: delWork.wid
+              id: work.wid
             });
             if (res.status === 1) {
               this.$message.success(res.info);
@@ -162,7 +163,8 @@ export default {
             }
           }
         })
-        .catch(() => {
+        .catch(err => {
+          console.log(err);
           this.$message({
             type: "info",
             message: "已取消删除"
@@ -209,6 +211,7 @@ export default {
       }
     }
     .image {
+      margin-right: 10px;
       width: 100px;
       height: 100px;
     }

+ 4 - 2
pages/sign/new.vue

@@ -9,7 +9,7 @@
     <skills></skills>
     <works></works>
     <social></social>
-    <el-button @click="signNow" class="sign-btn">申请签约开发者</el-button>
+    <el-button v-if="this.userInfo.realname_re == '3'" @click="signNow" class="sign-btn">申请签约开发者</el-button>
   </div>
 </template>
 
@@ -48,12 +48,14 @@ export default {
   // mixins: [getDeviceType],
   data() {
     return {
-      sign: null
+      sign: null,
+      userInfo: {}
     };
   },
   computed: {},
   async mounted() {
     this.needLogin();
+    // realname_re, 1是待审核,2已签约,3是拒绝
     this.userInfo = await this.getUserInfo();
   },
   methods: {