فهرست منبع

推荐人挂号

lighter 3 ماه پیش
والد
کامیت
6d9416ee4f
3فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 10 2
      src/views/Home.vue
  2. 2 0
      src/views/hospital-service/appointment/AppointmentConfirm.vue
  3. 1 0
      src/views/public-pages/Cashier.vue

+ 10 - 2
src/views/Home.vue

@@ -25,7 +25,12 @@ const executeNavigate = () => {
     if (pathInfo.length === 1) {
       router.push('/' + to)
     } else if (pathInfo.length === 2) {
-      router.push('/' + pathInfo[0] + '/' + pathInfo[1])
+      if (pathInfo[0] === 'appointment' && pathInfo[1].startsWith('recStaff')) {
+        Cookies.set('recStaff', pathInfo[1].split('-')[1])
+        router.push('/appointment')
+      } else {
+        router.push('/' + pathInfo[0] + '/' + pathInfo[1])
+      }
     } else if (pathInfo.length === 3)  {
       router.push('/' + pathInfo[0] + '/' + pathInfo[1] + '/' + pathInfo[2])
     } else {
@@ -36,10 +41,13 @@ const executeNavigate = () => {
 
 const onAppStart = () => {
   return new Promise((resolve, reject) => {
+    const code = router.currentRoute.value.params.code
+    if (code && code.length > 0) {
+      Cookies.set('recStaff', '')
+    }
     if (Cookies.get('token')) {
       resolve()
     } else {
-      const code = router.currentRoute.value.params.code
       getToken(code).then((r) => {
         Cookies.set('token', r)
         resolve()

+ 2 - 0
src/views/hospital-service/appointment/AppointmentConfirm.vue

@@ -60,6 +60,7 @@ import {computed, onMounted, ref} from 'vue'
 import {checkAppointmentRequirements, getGhFee} from '@/api/appointment'
 import router from '@/router'
 import {showConfirmDialog, showToast} from 'vant'
+import Cookies from 'js-cookie'
 
 const disableGhBtn = ref(true)
 const appointment = store.state.appointmentInfo
@@ -130,6 +131,7 @@ function toCashier() {
   createOrderRequest.acctpayAmt = 0
   createOrderRequest.couponAmt = 0
   createOrderRequest.cashpayAmt = appointment.fee
+  createOrderRequest.recStaff = Cookies.get('recStaff')
   store.dispatch({
     type: 'storeCreateOrderRequest',
     createOrderRequest,

+ 1 - 0
src/views/public-pages/Cashier.vue

@@ -192,6 +192,7 @@ onMounted(() => {
       unusableCoupons.value = res.unusableCoupons
     });
   }
+  console.log(createOrderRequest)
 })
 </script>