Browse Source

整合新建卡和绑卡

lighter 3 years ago
parent
commit
605f569f29

+ 3 - 3
src/components/select-card/index.vue

@@ -24,9 +24,9 @@
     show-cancel-button
   >
     <div style="padding: 20px">
-      <van-button type="primary" block to="/bindPatientCard">绑定就诊卡</van-button>
+      <van-button type="primary" block to="/createPatientCard/1">绑定自己的就诊卡</van-button>
       <div style="height: 10px"></div>
-      <van-button type="primary" plain block to="/createPatientCard">新建就诊卡</van-button>
+      <van-button type="primary" plain block to="/createPatientCard/2">绑定他人的就诊卡</van-button>
     </div>
   </van-dialog>
 </template>
@@ -61,4 +61,4 @@ export default {
     }
   },
 }
-</script>
+</script>

+ 1 - 1
src/router/index.js

@@ -46,7 +46,7 @@ export const constantRoutes = [
     meta: { title: '添加就诊人' },
   },
   {
-    path: '/createPatientCard',
+    path: '/createPatientCard/:isDefault',
     component: () => import('../views/mine/patient-id-cards/CreatePatientCard.vue'),
     meta: { title: '新建就诊人' },
   },

+ 2 - 2
src/utils/dev-prod.js

@@ -1,5 +1,5 @@
 // 测试
-export const apiUrl = 'http://172.16.30.26:8805/wxserver/'
+// export const apiUrl = 'http://172.16.30.26:8805/wxserver/'
 
 // 线上
-// export const apiUrl = 'http://218.104.151.241:8805/wxserver'
+export const apiUrl = 'http://218.104.151.241:8805/wxserver'

+ 3 - 3
src/views/hospital-service/appointment/AppointmentConfirm.vue

@@ -50,9 +50,9 @@
       show-cancel-button
     >
       <div style="padding: 20px">
-        <van-button type="primary" block to="/bindPatientCard">绑定就诊卡</van-button>
+        <van-button type="primary" block to="/createPatientCard/1">绑定自己的就诊卡</van-button>
         <div style="height: 10px"></div>
-        <van-button type="primary" plain block to="/createPatientCard">新建就诊卡</van-button>
+        <van-button type="primary" plain block to="/createPatientCard/2">绑定他人的就诊卡</van-button>
       </div>
     </van-dialog>
   </window-size>
@@ -148,4 +148,4 @@ export default {
     }
   },
 }
-</script>
+</script>

+ 2 - 2
src/views/hospital-service/covid-vaccinate/SelectCovidVaccinatePatient.vue

@@ -25,9 +25,9 @@
       show-cancel-button
     >
       <div style="padding: 20px">
-        <van-button type="primary" block to="/bindPatientCard">绑定就诊卡</van-button>
+        <van-button type="primary" block to="/createPatientCard/1">绑定自己的就诊卡</van-button>
         <div style="height: 10px"></div>
-        <van-button type="primary" plain block to="/createPatientCard">新建就诊卡</van-button>
+        <van-button type="primary" plain block to="/createPatientCard/2">绑定他人的就诊卡</van-button>
       </div>
     </van-dialog>
   </window-size>

+ 14 - 9
src/views/mine/patient-id-cards/CreatePatientCard.vue

@@ -24,7 +24,7 @@
       width="90%"
       title="请补充以下信息"
       show-cancel-button
-      confirm-button-text="新建卡"
+      confirm-button-text="绑定"
       :before-close="beforeClose"
     >
       <div style="padding: 20px">
@@ -62,7 +62,7 @@
 </template>
 
 <script>
-import { computed, reactive, ref } from 'vue'
+import { computed, onMounted, reactive, ref } from 'vue'
 import store from '../../../store'
 import capImg from '../../../assets/capture-img.png'
 import allArea from '../../../utils/area'
@@ -118,6 +118,7 @@ export default {
 
     const inputInfo = reactive({
       openId: getLocalOpenId(),
+      relation: 1,
       name: null,
       socialNo: null,
       phone: null,
@@ -204,13 +205,12 @@ export default {
           }
           setTimeout(() => {
             readInput(inputInfo)
-              .then(() => {
-                Toast.success('建卡成功!')
+              .then((res) => {
+                Toast.success('绑卡成功!')
+                console.log(res)
+                store.commit('SET_PATIENTCARDS', res.cards)
                 resolve(true)
-                getPatientIdByOpenId(getLocalOpenId()).then((res) => {
-                  store.commit('SET_PATIENTCARDS', res)
-                  router.go(-1)
-                })
+                router.go(-1)
               })
               .catch(() => {
                 resolve(false)
@@ -218,6 +218,11 @@ export default {
           }, 500)
         }
       })
+
+    onMounted(() => {
+      inputInfo.relation = router.currentRoute.value.params.isDefault
+    })
+
     return {
       uploadWidth,
       uploadHeight,
@@ -250,4 +255,4 @@ export default {
   margin-left: 10px;
   color: orangered;
 }
-</style>
+</style>

+ 3 - 3
src/views/mine/patient-id-cards/MyPatientIdCards.vue

@@ -11,9 +11,9 @@
       show-cancel-button
     >
       <div style="padding: 20px">
-        <van-button type="primary" block to="/bindPatientCard">绑定就诊卡</van-button>
+        <van-button type="primary" block to="/createPatientCard/1">绑定自己的就诊卡</van-button>
         <div style="height: 10px"></div>
-        <van-button type="primary" plain block to="/createPatientCard">新建就诊卡</van-button>
+        <van-button type="primary" plain block to="/createPatientCard/2">绑定他人的就诊卡</van-button>
       </div>
     </van-dialog>
   </window-size>
@@ -37,4 +37,4 @@ export default {
     }
   },
 }
-</script>
+</script>