From 9e270f2849fd6f02de7bb0e9e38b6625cf7f0a03 Mon Sep 17 00:00:00 2001
From: miaojiale <1123971748@qq.com>
Date: Mon, 22 Jan 2024 14:22:03 +0800
Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=8D=B7H5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/pages/questionnaire.vue | 38 ++++++++++++++++++++-----------------
 src/router/index.js         |  2 +-
 vue.config.js               |  2 +-
 3 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/src/pages/questionnaire.vue b/src/pages/questionnaire.vue
index 87412ee..da69584 100644
--- a/src/pages/questionnaire.vue
+++ b/src/pages/questionnaire.vue
@@ -38,22 +38,27 @@ export default {
     }
   },
   methods: {
-    login() {
-      this.$API.login().then((res) => {
-        console.log(res)
-      })
-    },
+    // login() {
+    //   this.$API.login().then((res) => {
+    //     console.log(res)
+    //   })
+    // },
     getPatientInfo() {
+      // let data = 'NfQ4zQ+wWuvnPfQQgL6wHMQb5XGNtIbxXUiYHs5NmhnI7tSHpQob3FCUx59D/nPWbmKlW7pp5d00I/P9L0q9skLoGpXaf10EAwXJjyT8JFWwu5FFapdBHsjV0KLq+erWns7g70e4wYH2eTxQHpMwxj7+GOuPL5LtPR0x2RLJDyY='
+      // data = data.replaceAll("+", "%2B")
       let params = {
-        idCard: 111111111,
-        patientName: "张三",
-        phone: 18888888888
+        // data: data
+        data: this.$route.query.data
       }
       this.$API
         .getPatientInfo(params)
         .then((res) => {
-          this.baseInfo = {
-            ...res.data
+          if (res.code == 1) {
+            this.baseInfo = {
+              ...res.data
+            }
+            this.getQuestionList()
+            this.getQuestionnaireRecords()
           }
         })
         .catch(() => {
@@ -84,7 +89,7 @@ export default {
     getQuestionnaireRecords() {
       this.$API
         .getQuestionnaireRecords({
-          patientId: 1
+          patientId: this.baseInfo.id
         })
         .then((res) => {
           if (res.code == 1) {
@@ -125,13 +130,12 @@ export default {
     }
   },
   created() {
-    this.login()
-    this.getPatientInfo()
-    this.getQuestionList()
-  },
-  mounted() {
-    this.getQuestionnaireRecords()
+    // this.login()
+    if (this.$route.query.data) {
+      this.getPatientInfo()
+    }
   },
+  mounted() {},
   watch: {}
 }
 </script>
diff --git a/src/router/index.js b/src/router/index.js
index 9a5013d..56a593a 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -20,7 +20,7 @@ const page = [
     component: () => import("@/pages/feedback")
   },
   {
-    path: `/questionnaire/:id`,
+    path: `/questionnaire`,
     meta: { index: 2, keepAlive: false },
     name: "questionnaire",
     component: () => import("@/pages/questionnaire")
diff --git a/vue.config.js b/vue.config.js
index 5ffa793..34c32a7 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -65,7 +65,7 @@ module.exports = {
     proxy: {
       "/api": {
         // target: "https://ds.cixincloud.com/songjiang-api",
-        target: "http://192.168.0.105:11999/",
+        target: "http://192.168.0.200:11999/",
         // target: 'http://localhost:8201/',
         // target: 'http://192.168.3.221/8201/',
         changeOrigin: true,
-- 
2.22.0