Selaa lähdekoodia

优化顶部导航栏

lighter 1 vuosi sitten
vanhempi
commit
7a9be4ebc6

+ 19 - 14
src/components/back-nav/index.vue

@@ -1,23 +1,28 @@
 <template>
-  <van-nav-bar style="height: 45px" :title="title" left-text="返回" left-arrow @click-left="back" @click-right="home">
+  <van-nav-bar v-if="showBackNav" style="height: 45px" :title="title" left-text="返回" left-arrow @click-left="back" @click-right="home">
+    <template #right> <van-icon name="home-o" size="18" /><span style="color: #1989fa">首页</span> </template>
+  </van-nav-bar>
+  <van-nav-bar v-else style="height: 45px" :title="title" @click-right="home">
     <template #right> <van-icon name="home-o" size="18" /><span style="color: #1989fa">首页</span> </template>
   </van-nav-bar>
 </template>
 
-<script>
+<script setup>
 import { useRouter } from 'vue-router'
-export default {
-  name: 'BackNav',
-  setup() {
-    const router = useRouter()
-    const title = router.currentRoute.value.meta.title
-    const back = () => {
-      router.go(-1)
-    }
-    const home = () => {
-      router.push('/hospitalService')
-    }
-    return { title, back, home }
+
+const props = defineProps({
+  showBackNav: {
+    type: Boolean,
+    default: true,
   },
+})
+
+const router = useRouter()
+const title = router.currentRoute.value.meta.title
+const back = () => {
+  router.go(-1)
+}
+const home = () => {
+  router.push('/hospitalService')
 }
 </script>

+ 5 - 1
src/components/window-size/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div :style="screenSize">
-    <back-nav v-show="showBackNav"></back-nav>
+    <back-nav v-show="showTitle" :show-back-nav="showBackNav"></back-nav>
     <div :style="bodyStyle">
       <slot></slot>
     </div>
@@ -16,6 +16,10 @@ const props = defineProps({
     type: Boolean,
     default: true,
   },
+  showTitle: {
+    type: Boolean,
+    default: true
+  },
   offset: {
     type: Number,
     default: 0,

+ 1 - 1
src/views/hospital-info/HospitalIntroduction.vue

@@ -1,5 +1,5 @@
 <template>
-  <window-size :showBackNav="false" :offset="0">
+  <window-size :showTitle="false" :offset="0">
     <van-swipe :autoplay="3000" indicator-color="white" style="height: 170px" vertical>
       <van-swipe-item v-for="image in images" :key="image">
         <van-image :src="image" height="170px" />

+ 1 - 1
src/views/hospital-service/HospitalServiceHome.vue

@@ -1,5 +1,5 @@
 <template>
-  <window-size :showBackNav="false">
+  <window-size :showTitle="false">
     <div class="logo-div">
       <div style="display: flex">
         <div><img src="../../assets/thyy_logo.png" style="height: 60px"/></div>

+ 11 - 16
src/views/hospital-service/pay-mz-fee/UnPaidDetail.vue

@@ -146,22 +146,17 @@ const wechatPay = () => {
     hisOrdNum: params.hisOrdNum,
     yjReqNo: store.state.yjReqNo,
   }
-  if (params.doctorCode === '99999') {
-    router.push('/hospitalService')
-  } else {
-    showRate.value = true
-  }
-  // wxPay(param).then((result) => {
-  //   showToast({
-  //     message: result,
-  //     position: 'top',
-  //   });
-  //   if (params.doctorCode === '99999') {
-  //     router.push('/hospitalService')
-  //   } else {
-  //     showRate.value = true
-  //   }
-  // })
+  wxPay(param).then((result) => {
+    showToast({
+      message: result,
+      position: 'top',
+    });
+    if (params.doctorCode === '99999') {
+      router.push('/hospitalService')
+    } else {
+      showRate.value = true
+    }
+  })
 }
 onMounted(() => {
   getUnPaidDetail(params.patientId, params.hisOrdNum).then((res) => {

+ 1 - 1
src/views/isolations/ChronicDisease.vue

@@ -1,5 +1,5 @@
 <template>
-  <window-size :showBackNav="false">
+  <window-size :showTitle="false">
     <div class="tip-box">
       当前就诊人信息不是我,前往
       <span class="tip-link" @click="toMyCards">我的就诊人</span>

+ 1 - 1
src/views/isolations/StudentInspection.vue

@@ -1,5 +1,5 @@
 <template>
-  <window-size :showBackNav="false">
+  <window-size :showTitle="false">
     <div style="display: flex">
       <div>
         <van-image width="120" height="60" :src="logo"></van-image>

+ 1 - 1
src/views/mine/MineHome.vue

@@ -1,5 +1,5 @@
 <template>
-  <window-size :showBackNav="false" :offset="0">
+  <window-size :showTitle="false" :offset="0">
     <div class="qrcode-card" @click="routeToCard">
       <div class="qr-text-area">
         <div>