Pārlūkot izejas kodu

分离疫苗预约到别的服务器

lighter 4 gadi atpakaļ
vecāks
revīzija
d5fdc7e2f1

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

@@ -1,9 +1,9 @@
 // 测试
-// export const apiUrl = 'http://172.16.30.26:8805/wxserver/'
-// export const url8083 = 'ws://172.16.30.26:8805/wxserver/websocket/'
-// export const url8085 = 'ws://172.16.30.26:8805/wxserver/websocket/'
+export const apiUrl = 'http://172.16.30.26:8805/wxserver/'
+export const url8083 = 'ws://172.16.30.26:8805/wxserver/websocket/'
+export const url8085 = 'ws://172.16.30.26:8805/wxserver/websocket/'
 
 // 线上
-export const apiUrl = 'http://218.104.151.241:8805/wxserver'
-export const url8083 = 'ws://218.104.151.241:8083/wxserver/websocket/'
-export const url8085 = 'ws://218.104.151.241:8085/wxserver/websocket/'
+// export const apiUrl = 'http://218.104.151.241:8805/wxserver'
+// export const url8083 = 'ws://218.104.151.241:8083/wxserver/websocket/'
+// export const url8085 = 'ws://218.104.151.241:8085/wxserver/websocket/'

+ 9 - 2
src/views/hospital-service/HospitalServiceHome.vue

@@ -99,6 +99,7 @@ import store from '../../store'
 import { getDate } from '../../utils/date'
 import router from '../../router'
 import axios from 'axios'
+import { apiUrl } from '../../utils/dev-prod'
 export default {
   setup() {
     const windowSize = store.state.windowSize
@@ -176,13 +177,19 @@ export default {
     }
 
     const toVaccinateAppointment = () => {
-      routeTo(filterPath('/covidVaccinate/', '/selectCovidVaccinatePatient'))
+      if (cards.value.length === 1) {
+        window.open('http://www.hnthyy.cn/covidVaccinate/' + cards.value[0].patientId, '_self')
+      } else {
+        router.push('/selectCovidVaccinatePatient')
+      }
     }
+
     const loading = ref(false)
     onMounted(() => {
       if (doctors.value.length === 0) {
         loading.value = true
-        axios('http://218.104.151.241:8805/wxserver/homepage/selectHomePageDoctors').then((res) => {
+        const url = apiUrl + 'homepage/selectHomePageDoctors'
+        axios(url).then((res) => {
           store.commit('SET_HOMEPAGEDOCTORS', res.data.data)
           loading.value = false
         })

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

@@ -1,5 +1,63 @@
 <template>
   <window-size>
-    <select-card to="covidVaccinate"></select-card>
+    <div v-for="item in cards" :key="item.patientId">
+      <van-cell icon="user-o" :label="item.patientId" is-link @click="toVaccinate(item.patientId)">
+        <template #title>
+          <span class="custom-title">{{ item.name }}</span>
+          &nbsp;
+          <van-tag type="primary" plain v-if="item.isDefault === 1">默认</van-tag>
+        </template>
+      </van-cell>
+    </div>
+    <div style="height: 5px"></div>
+    <van-cell
+      v-if="showAddCard"
+      icon="add"
+      title="添加就诊人"
+      :label="addCardText"
+      is-link
+      @click="showCreatedCardMethod = true"
+    ></van-cell>
+    <van-dialog
+      v-model:show="showCreatedCardMethod"
+      title="请选择绑定方式"
+      :show-confirm-button="false"
+      show-cancel-button
+    >
+      <div style="padding: 20px">
+        <van-button type="primary" block to="/bindPatientCard">绑定就诊卡</van-button>
+        <div style="height: 10px"></div>
+        <van-button type="primary" plain block to="/createPatientCard">新建就诊卡</van-button>
+      </div>
+    </van-dialog>
   </window-size>
-</template>
+</template>
+
+<script>
+import store from '../../../store'
+import { computed, ref } from 'vue'
+export default {
+  setup() {
+    const cards = computed(() => {
+      return store.state.patientCards
+    })
+    const showAddCard = computed(() => {
+      return cards.value.length < 5
+    })
+    const addCardText = computed(() => {
+      return '还可添加' + (5 - cards.value.length) + '人'
+    })
+    const showCreatedCardMethod = ref(false)
+    const toVaccinate = (patientId) => {
+      window.open('http://www.hnthyy.cn/covidVaccinate/' + patientId, '_self')
+    }
+    return {
+      cards,
+      showAddCard,
+      addCardText,
+      showCreatedCardMethod,
+      toVaccinate,
+    }
+  },
+}
+</script>