Browse Source

优化核酸方面的内容

lighter 3 years ago
parent
commit
63912606e9

+ 1 - 1
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'

+ 6 - 8
src/utils/validate.js

@@ -154,16 +154,17 @@ export function validateDepressionAnswer(answer) {
 }
 
 export function validateCovid19Answer(answer) {
+  if (!answer.patientId) {
+    return '请先绑定就诊卡!'
+  }
   if (!answer.name) {
-    return '请填写姓名!'
+    return '请先绑定就诊卡!'
   }
   if (!isValidPhone(answer.phone)) {
     return '请填写正确的手机号!'
   }
-  if (!answer.patientId) {
-    if (!isValidIdcard(answer.idcard)) {
-      return '请填写正确的身份证号!'
-    }
+  if (!isValidIdcard(answer.idcard)) {
+    return '请绑定正确的身份证号码!'
   }
   if (!answer.temperature) {
     return '请选择体温选项!'
@@ -171,9 +172,6 @@ export function validateCovid19Answer(answer) {
   if (answer.temperature === '2' && !answer.feverNumber) {
     return '体温为发烧时请填写具体温度!'
   }
-  // if (!answer.addrAdditional) {
-  //   return "请填写地址(街道、小区、门牌号)!";
-  // }
   if (answer.item5 === 51 && answer.symptoms.length < 1) {
     return '请选择症状!'
   }

+ 26 - 24
src/utils/wx-pay.js

@@ -1,31 +1,33 @@
-import { Toast } from 'vant'
 import { createPayOrder, queryOrderState } from '../api/wx-jsapi'
-import router from '../router'
 import store from '../store'
 
 export function wxPay(param) {
-  createPayOrder(param).then((res) => {
-    if (res.yjReqNo) {
-      store.commit('SET_YJREQNO', null)
-    }
-    WeixinJSBridge.invoke(
-      'getBrandWCPayRequest',
-      {
-        appId: res.appId,
-        timeStamp: res.timeStamp,
-        nonceStr: res.serialNo,
-        package: 'prepay_id=' + res.prepayId,
-        signType: res.signType,
-        paySign: res.paySign,
-        totalFee: res.totalFee,
-      },
-      function (res2) {
-        console.log(res2)
-        queryOrderState(res.tradeNo).then((res3) => {
-          Toast.success(res3)
-          router.push('/hospitalService')
-        })
+  return new Promise((resolve, reject) => {
+    createPayOrder(param).then((res) => {
+      if (res.yjReqNo) {
+        store.commit('SET_YJREQNO', null)
       }
-    )
+      WeixinJSBridge.invoke(
+        'getBrandWCPayRequest',
+        {
+          appId: res.appId,
+          timeStamp: res.timeStamp,
+          nonceStr: res.serialNo,
+          package: 'prepay_id=' + res.prepayId,
+          signType: res.signType,
+          paySign: res.paySign,
+          totalFee: res.totalFee,
+        },
+        function () {
+          queryOrderState(res.tradeNo).then((response) => {
+            if (response instanceof Object && response.tradeNo) {
+              resolve(response)
+            } else {
+              reject(response)
+            }
+          })
+        }
+      )
+    })
   })
 }

+ 10 - 0
src/views/hospital-service/appointment/PayAppointmentFee.vue

@@ -47,6 +47,8 @@ import store from '../../../store'
 import { reactive } from 'vue'
 import { getLocalOpenId } from '../../../utils/check-patient-id'
 import { wxPay } from '../../../utils/wx-pay'
+import { Toast } from 'vant'
+import router from '../../../router'
 export default {
   name: 'PayAppointmentFee',
   setup() {
@@ -67,6 +69,14 @@ export default {
         mzyRequestId: data.appointment.mzyRequestId,
       }
       wxPay(param)
+        .then((result) => {
+          Toast.success(result)
+          router.push('/hospitalService')
+        })
+        .catch((result) => {
+          Toast.success(result)
+          router.push('/hospitalService')
+        })
     }
     return {
       data,

+ 19 - 7
src/views/hospital-service/assessments/Covid19Assessment.vue

@@ -2,9 +2,10 @@
   <back-nav></back-nav>
   <div style="height: 20px"></div>
   <div id="question-body">
-    <van-field v-model="answer.name" type="text" label="姓名" placeholder="请输入姓名" />
+    <van-field v-model="answer.name" type="text" label="姓名" disabled />
+    <van-field v-model="answer.idcard" type="text" label="身份证" disabled />
     <van-field v-model="answer.phone" type="tel" label="电话" placeholder="请输入手机号" />
-    <van-field
+    <!-- <van-field
       readonly
       clickable
       v-model="answer.idcard"
@@ -12,8 +13,8 @@
       label="身份证"
       placeholder="请输入身份证"
       @click="answer.showIdKeyboard = true"
-    />
-    <van-number-keyboard
+    /> -->
+    <!-- <van-number-keyboard
       v-model="answer.idcard"
       title="身份证键盘"
       theme="custom"
@@ -22,7 +23,7 @@
       close-button-text="完成"
       @blur="answer.showIdKeyboard = false"
       @input="onInputIdcard"
-    />
+    /> -->
     <van-field
       readonly
       clickable
@@ -191,14 +192,25 @@ export default {
         Dialog.alert({
           title: '提示',
           message: message,
+        }).then(() => {
+          if (message.startsWith('请先绑定')) {
+            router.push('/myPatientIdCards')
+          }
         })
       }
     }
 
     onMounted(() => {
       const patientId = router.currentRoute.value.params.patientId
-      from.value = router.currentRoute.value.params.from
-      if (patientId && patientId !== ':patientId') {
+      if (!patientId || patientId === ':patientId') {
+        Dialog.alert({
+          message: '请先绑定就诊卡!',
+          title: '提示',
+        }).then(() => {
+          router.push('/myPatientIdCards')
+        })
+      } else {
+        from.value = router.currentRoute.value.params.from
         answer.patientId = patientId
         getPatientInfo(patientId).then((res) => {
           answer.name = res.name

+ 10 - 3
src/views/hospital-service/inpatient-service/DisplayPrepaid.vue

@@ -70,10 +70,9 @@
 
 <script>
 import { ref } from 'vue'
-import { useRouter } from 'vue-router'
 import { getLocalOpenId } from '../../../utils/check-patient-id'
 import { wxPay } from '../../../utils/wx-pay'
-import { Dialog } from 'vant'
+import { Dialog, Toast } from 'vant'
 export default {
   setup() {
     const router = useRouter()
@@ -115,6 +114,14 @@ export default {
         admissTimes: params.admissTimes,
       }
       wxPay(param)
+        .then((result) => {
+          Toast.success(result)
+          router.push('/hospitalService')
+        })
+        .catch((result) => {
+          Toast.success(result)
+          router.push('/hospitalService')
+        })
     }
     return {
       params,
@@ -143,4 +150,4 @@ export default {
   transition: opacity 0.2s ease 0s;
   appearance: none;
 }
-</style>
+</style>

+ 29 - 0
src/views/hospital-service/pay-mz-fee/UnPaidDetail.vue

@@ -37,6 +37,23 @@
     </div>
     <div style="height: 10px"></div>
     <van-button block type="primary" @click="wechatPay">微信支付(¥ {{ makePrice(params.totalAmt) }})</van-button>
+
+    <van-dialog
+      v-model:show="showBillInfo"
+      title="缴费成功提醒"
+      show-confirm-button
+      :show-cancel-button="false"
+      @closed="router.push('/hospitalService')"
+    >
+      <div style="height: 12px"></div>
+      <van-cell title="用户姓名" :value="params.patName" />
+      <van-cell title="订单号" :value="params.hisOrdNum" />
+      <van-cell title="缴费金额" :value="makePrice(params.totalAmt)" />
+      <van-cell title="医生" :value="params.doctorName" />
+      <van-cell title="科室" :value="params.deptName" />
+      <van-cell title="医院" value="湖南泰和医院" />
+      <van-cell title="缴费时间" :value="params.paytime" />
+    </van-dialog>
   </window-size>
 </template>
 
@@ -47,12 +64,14 @@ import { onMounted, ref } from 'vue'
 import { getLocalOpenId } from '../../../utils/check-patient-id'
 import { wxPay } from '../../../utils/wx-pay'
 import store from '../../../store'
+import { Toast } from 'vant'
 export default {
   name: 'UnPaidDetail',
   setup() {
     const router = useRouter()
     const params = router.currentRoute.value.params
     const fees = ref([])
+    const showBillInfo = ref(false)
     const wechatPay = () => {
       let bodyText = '门诊缴费'
       if (fees.value.length === 1) {
@@ -68,6 +87,14 @@ export default {
         yjReqNo: store.state.yjReqNo,
       }
       wxPay(param)
+        .then((result) => {
+          params.paytime = result.payDatetime
+          showBillInfo.value = true
+        })
+        .catch((result) => {
+          Toast.success(result)
+          router.push('/hospitalService')
+        })
     }
     onMounted(() => {
       getUnPaidDetail(params.patientId, params.hisOrdNum).then((res) => {
@@ -75,8 +102,10 @@ export default {
       })
     })
     return {
+      router,
       params,
       fees,
+      showBillInfo,
       makePrice,
       wechatPay,
     }