Selaa lähdekoodia

呼叫时获取对方名字

gcz 3 vuotta sitten
vanhempi
commit
dee7ca51ff
1 muutettua tiedostoa jossa 25 lisäystä ja 11 poistoa
  1. 25 11
      src/components/search-user/index.vue

+ 25 - 11
src/components/search-user/index.vue

@@ -37,7 +37,7 @@
 <script>
 import { mapState } from "vuex";
 import { getSearchHistory } from "../../utils";
-import { memberinfo } from "../../api";
+import { memberinfo,companyInfo } from "../../api";
 
 export default {
   name: "SearchUser",
@@ -111,16 +111,30 @@ export default {
   },
   methods: {
     getmemberinfo() {
-      memberinfo({ veteMemberId: this.searchInput }).then((res) => {
-        if (res.data.code == "200") {
-          this.veteMemberName = res.data?.data?.data?.veteName;
-        } else {
-          this.veteMemberName = "";
-        }
-        // console.log("res.code", res.data.code);
-        // console.log("this.veteMemberName", this.veteMemberName);
-        // console.log("getmemberinfo", res.data.data.data.veteName);
-      });
+      if(this.$route.query.from=='company'){//如果是企业端则读取退役军人信息
+        memberinfo({ veteMemberId: this.searchInput }).then((res) => {
+          if (res.data.code == "200") {
+            this.veteMemberName = res.data?.data?.data?.veteName;
+          } else {
+            this.veteMemberName = "";
+          }
+          // console.log("res.code", res.data.code);
+          // console.log("this.veteMemberName", this.veteMemberName);
+          // console.log("getmemberinfo", res.data.data.data.veteName);
+        });
+      }else if(this.$route.query.from=='veterans'){//如果是企业端则读取退役军人信息
+        companyInfo({ companyId: this.searchInput }).then((res) => {
+          if (res.data.code == "200") {
+            this.veteMemberName = res.data?.data?.data?.companyName;
+          } else {
+            this.veteMemberName = "";
+          }
+          // console.log("res.code", res.data.code);
+          // console.log("this.veteMemberName", this.veteMemberName);
+          // console.log("getmemberinfo", res.data.data.data.veteName);
+        });
+      }
+      
     },
     handleCallBtnClick: function (param) {
       if (param === this.loginUserInfo.userId) {