<template>
  <view class="container">
    <view class="content">
      <image :src="iconUrl.homePage_topBg" class="topBg_img"></image>
      <view class="top_box">
        <view class="topBox_title"
          :style="`margin-top: ${statusBarHeight}px; height: 44px; line-height: 44px;color: #fff;`">{{ hosName }}
        </view>
        <view class="search displayFlexBetween" @click="jumSearch">
          <view class="search_box displayFlexRow">
            <image class="search_icon" :src="iconUrl.homePage_serch"></image>
            <view class="search_input">请输入医生姓名/科室/服务名称</view>
          </view>
          <!-- <image class="remove_icon" src="{{iconUrl.homePage_san}}" catchtap="focusFn"></image> -->
        </view>
        <view class="userBox">
          <!-- 无绑定就诊人 -->
          <view class="no_userBox displayFlexCol" v-if="!currentUser?.memberId">
            <image :src="iconUrl.home_noBindBG" class="home_noBindBG"></image>
            <view class="no_userBox_title"> 就医请先添加就诊人</view>
            <view class="no_userBox_btn " @click="jumpAddMember">
              <image class="home_noBindBtn" :src="iconUrl.home_noBindBtn"></image>
              <view class="btnText displayFlexRow">
                <image class="icon_WhiteAdd" :src="iconUrl.icon_WhiteAdd"></image>
                <text>去添加</text>
              </view>
            </view>
          </view>
          <!-- 有绑定就诊人 -->
          <view class="yes_userBox" v-if="currentUser?.memberId">
            <view class="user_info_box displayFlexBetween">
              <view class="user_info_content ">
                <view class="member_box displayFlexLeft">
                  <view class="memberName">{{ currentUser.memberName }}</view>
                  <view class="memberTip" v-if="!homePageConfig.medicalBtn" @click="codeStateChange"
                    :data-item="currentUser">
                    <image class="homePage_userTip" :src="iconUrl.homePage_userTip"></image>
                    <view class="QRCode_box displayFlexRow">
                      <image class="homePage_qrCode" :src="iconUrl.homePage_qrCode"></image>
                      电子就诊码
                    </view>
                  </view>
                  <view class="electronMedical displayFlexCol" @click="clickElectronMedical"
                    v-if="currentUser.memberType == 1">
                    <image class="electronMedical_img" :src="iconUrl.dzybpz"></image>
                    <view class="electronMedical_txt">刷医保码</view>
                  </view>
                </view>
                <view class="memberInfo_cardInfo ellipsis">
                  {{ currentUser.cardType == 14 ? "住院号" : "就诊卡号" }}：{{ currentUser.cardNo ? currentUser.cardNo : "无" }}
                </view>
              </view>
              <view class="choice_patient_btn" @click="jumpChoosPatient">
                换个就诊人
              </view>
            </view>
            <view class="msg_list_box">
              <view class="non_msg_box" v-if="!showProgress">
                <image class="imgCom homeTop_noyygh" :src="iconUrl.homeTop_noyygh"></image>
                <progress percent="90" active stroke-width="3" color="var(--dominantColor)" class="progress" />
              </view>
              <template v-else>
                <!-- 无预约记录时展示 -->
                <view class="non_msg_box" v-if="lastMsgList.length == 0">
                  <image class="imgCom homeTop_noyygh" :src="iconUrl.homeTop_noyygh"></image>
                  <view class=" register_remind_box displayFlexBetween">
                    <view class="displayFlexCol" style="align-items: flex-start;">
                      <text class="titel">预约挂号</text>
                      <text class="colorCustom_F08">包含预约挂号及当日挂号</text>
                    </view>
                    <text class="register_remind_btn backgroundCustom_F08" @click="goToRegister">去挂号</text>
                  </view>
                </view>
                <!-- 有预约记录时展示 -->
                <template v-if="lastMsgList.length > 0">
                  <activeFlow v-if="lastMsgList.length > 0" :flowList="lastMsgList" pageType="homePage">
                  </activeFlow>
                </template>
              </template>
            </view>
          </view>
        </view>
      </view>
      <view class="content_inner pb-100">
        <!-- 我的医生 -->
        <view class="floot myDoctor_box">
          <view class="floot_top displayFlexBetween">
            <view class="floot_title">
              <view class="floot_titleName">我的医生</view>
            </view>
            <view class="floot_tip displayFlexRow" v-if="doctorList.length > 0" @click="seeMoreDoctor">
              <text>更多</text>
              <image class="icon_right" :src="iconUrl.icon_right"></image>
            </view>
          </view>
          <view class="floot_lineFeed" :class="doctorList.length >= 3 ? 'displayFlexBetween' : 'displayFlexLeft'">
            <view v-if="doctorList.length > 0">
              <view class="floot_list myDoctor_item displayFlexCol" v-for="(item, index) in doctorList.slice(0, 3)" :key="index"
                :item="item" @click="clickDoctor">
                <image class="iconDoctor" :src="item.Url || iconUrl.icon_doctor"></image>
                <text class="doctorName">{{ item.DoctorName }}</text>
                <text class="doctorTitle">{{ item.DoctorTitle }}</text>
              </view>
            </view>
            <view class="flootNoTip" v-else>暂无医生</view>
          </view>
        </view>
        <!-- 就医服务 -->
        <view class="floot menuServices_box">
          <view class="floot_top displayFlexBetween">
            <view class="floot_title">
              <view class="floot_titleName">就医服务</view>
            </view>
            <view class="floot_tip displayFlexRow" @click="moreClick">
              <text>更多</text>
              <image class="icon_right" :src="iconUrl.icon_right"></image>
            </view>
          </view>
          <view class="floot_lineFeed displayFlexLeft">
            <view class="floot_list menuList" :class="{ 'fw_25': item.IsShow == '1' }"
              v-for="(item, index) in menuObj?.Children[0].Children" :key="index" @click="menuClickFn(item)">
              <view v-if="item.IsShow == '1'" class="displayFlexCol">
                <image class="menuIcon" :src="item.Icon"></image>
                <text class="menuText">{{ item.MenuName }}</text>
              </view>
            </view>
          </view>
        </view>
        <!-- 热点资讯 -->
        <view class="floot">
          <view class="floot_top displayFlexBetween">
            <view class="floot_title">
              <view class="floot_titleName">热点资讯</view>
            </view>
          </view>
          <view class="hotspot_info">
            <!-- 进度条 -->
            <view class="pro_msg_box" v-if="!showSeekProgress">
              <progress :percent="90" active stroke-width="3" color="var(--dominantColor)" class="progress" />
            </view>
            <template v-else>
              <template v-if="articleList.length > 0">
                <view class="hotspot_infoItem" v-for="(item, index) in articleList" :key="index" @click="hotspotDetail"
                  :data-id="item.Id">
                  <view class="hotspot_infoItem_title">{{ item.CreatorName }}</view>
                  <view class="hotspot_infoItem_text">{{ item.Title }}</view>
                </view>
              </template>
              <view class="flootNoTip" v-else>暂无最新热点资讯</view>
            </template>
          </view>
        </view>
        <!-- 医院风采 -->
        <view class="floot">
          <view class="floot_top displayFlexBetween">
            <view class="floot_title">
              <view class="floot_titleName">医院风采</view>
            </view>
          </view>
          <view class="hosMenuInfo">
            <view v-for="(item, index) in menuObj.Children[1].Children" :key="index" @click="menuClickFn" :item="item"
              :class="`${index >= 1 ? 'hosInfoBox_item' : 'hosInfoBox_item_fir'} ${index == 2 ? 'hosInfoBox_itemT' : ''}`">
              <view v-if="item?.IsShow == '1'">
                <image class="hosInfoBox_itemImg" :src="item.Icon"></image>
                <view class="hosInfoBox_itemText">
                  <view class="name">{{ item.MenuName }}</view>
                  <view>查看详情</view>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 医保电子凭证弹窗 -->
    <view class="public_dialog" v-if="codeIsShow">
      <view class="code_inner">
        <image class="code_img_out" :src="iconUrl.icon_whiteClose" @click="codeStateChange" :data-item="''">
        </image>
        <image class="code_img" :src="iconUrl.icon_codeBgTop"></image>
        <view class="code_tit">{{ codeInfo.memberName }}-电子就诊码</view>
        <view class="code_con">
          <image :src="codeInfo.imagesApi"></image>
          <!-- <canvas class='qr_code' canvas-id='canvas'></canvas> -->
        </view>
      </view>
    </view>
    <view class="tip_x p_flexBetween" v-if="hasSlb">
      <view class="tip_ p_flexBetween">
        <view class="tip_cell">进入长辈版</view>
        <view class="tip_cell" @click="toSlb" data-type="sec">点击进入</view>
      </view>
      <image class="tip_back" :src="iconUrl.home_tipBk_slb"></image>
      <image class="tip_right" :src="iconUrl.home_tipBk_right_slb"></image>
    </view>
    <view class="modal_mark p_flexCenter" v-if="hasSlb && showSlbTip">
      <view class="modal_slb">
        <image class="modal_home_bk" :src="iconUrl.home_bk_slb"></image>
        <image class="modal_home_ld" :src="iconUrl.bell_slb"></image>
        <view class="modal_con">
          <view class="modal_tit">长辈版已上线</view>
          <view class="modal_txt">图标字体更大操作更方便，有需要的用户可以点击切换使用。</view>
          <view class="modal_btns p_flexBetween">
            <view class="modal_btn" @click="slbTipChange">知道啦</view>
            <view class="modal_btn" @click="toSlb">进入长辈版</view>
          </view>
        </view>
      </view>
    </view>
    <!-- 隐私政策 -->
    <privacyDialog v-if="currentUser" :currentUser="currentUser" :hosName="hosName" :articleId="''">
    </privacyDialog>
  </view>

  <!-- AI数智客服入口-->
  <ai-customer-entry :currentUser="currentUser"></ai-customer-entry>
</template>

<script lang="ts" setup>
import { getCurrentInstance, nextTick, ref } from 'vue';
import { useDomain, useOnLoad, usePreserMember, queryMemberCardList_V3 } from '../../../../../hook';
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { common, menuClick } from '@/utils';
import icon from '@/utils/icon';
import store from '@/store';
import { articleTypeListUrl, topArticleListUrl, getMemberLastMsg, queryHistoryBaseDoctor } from '../../../service/base';


import activeFlow from '@/pages/st1/components/pageActive/st1/components/activeFlow/activeFlow.vue';
import aiCustomerEntry from '@/pages/st1/components/pagesAICustomerService/st1/components/aiCustomerEntry/aiCustomerEntry.vue';

const { proxy } = getCurrentInstance();
const app = getApp();

const iconUrl = ref(icon)
const currentUser = ref({})
const menuObj = ref({})
const lastMsgList = ref([])
const showBalance = ref(false)
const homePageConfig = ref({})
const articleList = ref([])
const codeIsShow = ref(false)
const codeInfo = ref({})
const showSlbTip = ref(false)
const statusBarHeight = ref("")
const hosName = ref("")
const hasSlb = ref("")
const showSeekProgress = ref(false)
const doctorList = ref([])
const showProgress = ref(false)

/** 页面初始加载 */
useOnLoad((options) => {
  console.log('logSuccess');
  console.log("app.globalData=====", app.globalData)
  console.log('loadFn', options, store.state);
  console.log("getAuthorize=====",common)
  loadFn(options);
});

const loadFn = async (options) => {
  /**H5回跳后重新登录 */
  if (options.h5Login) {
    await app.main()
  }
  main()
}

const main = async () => {
  let homePageConfigData = common.deepCopy(app.globalData.config.pageConfiguration.homePage_config)
  let menuList = uni.getStorageSync('menuList')
  //深拷贝 否则影响morePage更多页面
  let menuObjData = {};
  if (!common.isEmpty(menuList)) {
    menuObjData = common.deepCopy(menuList.filter(item => item.MenuName == 'HomePage')[0], {})
  }
  menuObj.value = menuObjData
  homePageConfig.value = homePageConfigData
  statusBarHeight.value = JSON.parse(app.globalData.smallPro_systemInfo).statusBarHeight || 20
  hosName.value = app.globalData.hospitalInfo.HospitalAlias
  hasSlb.value = app.globalData.hasSlb
  // 获取热点资讯
  articleTypeListUrlFn()
}

/**
 * 首先要上最新的统一内容管理(要有这个功能版本需求)，没有就个性化隐藏
 * java,   2.1.10-RELEASES.jar
 * 后台ui,  1.0.20-RELEASES.jar
 */
const articleTypeListUrlFn = async () => {
  let {resp,resData} = await articleTypeListUrl({
    ChannelId: app.globalData.channelId,
    eqTitle: '热点资讯'
  });
  if (common.isNotEmpty(resp)) {
    let {resp:articleList} = await topArticleListUrl({
      ChannelId: app.globalData.channelId,
      PSize: 3,
      RootTypeId: resp[0].Id
    })
    if (common.isNotEmpty(articleList)) {
      articleList.value = articleList || []
    }
    showSeekProgress.value = true
  }
}
/** 菜单点击 */
const menuClickFn = (item) => {
  menuClick(item, proxy)
}

/** 点击更多 */
const moreClick = () => {
  common.goToUrl("/pages/st1/business/tabbar/more/more")
}

/** 去挂号 */
const goToRegister = () => {
  let menuItem = {}
  menuObj.value.Children[0].Children.forEach((item) => {
    if (item.MenuName == "预约挂号") {
      menuItem = item
    }
  })
  common.goToUrl(menuItem.Url)
}

/** 生命周期函数--监听页面显示 */
onShow(() => {
  eliminateData()
  if (app.globalData.logSuccess) {
    getMember()
  } else {
    app.loginReadyCallBack_getMenu = () => {
      getMember()
    }
  }
})

/** 统一清空进入首页时，逻辑存储数据 */
const eliminateData = () => {
  /**当前的业务类型，006表示互联网医院   空表示普通的挂号业务 */
  app.globalData.sourceType = ""
  /**点击menu时进入添加就诊人 会设置toUrl 如果后退  需清空  否则从个人中心进入添加就诊人后  会进入toUrl页面 */
  app.globalData.toUrl = ""
  // 适老版
  uni.setStorageSync('wx_Slb', '');
}

/** 页面下拉刷新 */
onPullDownRefresh(async () => {
  // 重新查询一下就诊人
  await usePreserMember()
  await getMember()
  uni.stopPullDownRefresh();
})

/** 获取就诊人 */
const getMember = async () => {
  let currentUserData = null
  let memberList = store.state.memberList || []
  if (common.isEmpty(memberList)) {
    await usePreserMember()
    memberList = store.state.memberList
  }
  if (common.isNotEmpty(memberList)) {
    let memberLists = memberList.filter(item => item.userMemberList[0].isDefaultMember == 1)
    // 判断过滤默认操作人 : 没有默认操作人查询人列表第一条
    currentUserData = common.isNotEmpty(memberLists) ? memberLists[0] : memberList[0]
    if (common.isNotEmpty(currentUserData)) {
      // 获取就诊人memberOtherInfo 获取，默认就诊卡
      let cardInfo = typeof currentUserData.memberOtherInfo == 'object' ? currentUserData.memberOtherInfo : JSON.parse(currentUserData.memberOtherInfo)
      // 判断当前默认就诊人是否有默认就诊卡数据，没有在查询一遍
      if (common.isEmpty(cardInfo.defaultCard)) {
        let cardResp = await queryMemberCardList_V3(currentUserData.memberId)
        cardInfo = cardResp.filter(item => item.cardType == 1)[0]
      } else {
        cardInfo = cardInfo.defaultCard
      }
      currentUserData = {
        ...currentUserData,
        cardNo: cardInfo.cardNo || '',
        encryptionStore: cardInfo.cardEncryptionStore || cardInfo.encryptionStore || '',
        cardType: '1' //返回的默认就诊卡都为就诊卡类型
      }

      app.globalData.currentUser = currentUserData
      // 查询主动式服务-最新消息
      getMemberLastMsgFn(currentUserData)

      queryHistoryBaseDoctorFn(currentUserData)
      chkEnableSeniorVersion();
    }
  }
  showBalance.value = false
  currentUser.value = currentUserData
}

/** 主动式服务-获取患者最新一条主动式服务消息 */
const getMemberLastMsgFn = async (currentUser) => {
  var reqData = {
    OrgId: '',
    MemberId: currentUser.memberId,
    cardEncryptionStore: currentUser.encryptionStore || '',
    memberEncryptionStore: currentUser.baseMemberEncryptionStore || '',
    ChannelId: app.globalData.channelId,
  }
  let lastMsgListData = []
  let {resp,resData} = await getMemberLastMsg(reqData)
  if (common.isNotEmpty(resp)) {
    if (resp[0].IsOpenService === 0) {
      if (common.isNotEmpty(resp[0].ActiveNodeServiceList)) {
        resp[0].ActiveNodeServiceList = resp[0].ActiveNodeServiceList.filter(ele => ele.PatientChannel.indexOf(app.globalData.hosId) != -1)
        resp[0].ActiveNodeServiceList.map(item => {
          item.Btns = common.isJSON(item.Btns) ? JSON.parse(item.Btns) : item.Btns
        })
      }
    }
    lastMsgListData = resp
  }
  lastMsgList.value = lastMsgListData,
  showProgress.value = true
}

/** 查询我的医生当前就诊人历史预约医生 */
const queryHistoryBaseDoctorFn = async (currentUser) => {
  let doctorListData = []
  let queryData = {
    HosId: app.globalData.districtId || app.globalData.hosId,
    HasSch: '0',//默认查询本地，0:本地，1:his
    QueryLocal: "1",
    MemberIds: currentUser.memberId,
  }
  let {resp,resData} = await queryHistoryBaseDoctor(queryData)
  if (common.isNotEmpty(resp)) {
    doctorListData = resp
  }
  doctorList.value = doctorListData
}

/** 添加就诊人 */
const jumpAddMember = () => {
  common.goToUrl(`/pagesPersonal/st1/business/patientManagement/selecteBindCardMode/selecteBindCardMode`)
}

/** 选择就诊卡 */
const jumpChoosPatient = () => {
  common.goToUrl(`/pagesPersonal/st1/business/patientManagement/selecteCardOrHos/selecteCardOrHos?type=card&pageType=home`)
}

/** 进入历史我的医生 */
const seeMoreDoctor = () => {
  common.goToUrl(`/pagesPatient/st1/business/yygh/yyghHistoryDoctor/yyghHistoryDoctor`)
}

/** 历史医生跳转越狱挂号 */
const clickDoctor = (e) => {
  app.globalData.queryBean = e.currentTarget.dataset.item;
  app.globalData.currentUser = currentUser.value;
  common.goToUrl(`/pagesPatient/st1/business/yygh/yyghClinicMsg/yyghClinicMsg`)
}

/** 搜索 */
const jumSearch = (e) => {
  common.goToUrl('/pages/st1/business/tabbar/homeSearch/homeSearch')
}

/** 热点资讯详情 */
const hotspotDetail = (e) => {
  let { id } = e.currentTarget.dataset
  common.goToUrl(`/pagesAdmin/article/st1/business/article/detail/detail?id=${id}`)
}

/** 改变二维码显隐状态 */
const codeStateChange = (e) => {
  let item = e.currentTarget.dataset.item || "";
  if (common.isNotEmpty(item)) {
    item.imagesApi = `${useDomain()}/api/340/340/createQrCode.do?content=${item.memberId}`
  }

  codeInfo.value = item || {}
  codeIsShow.value = !codeIsShow.value
}

/** 前往适老版 */
const toSlb = (e) => {
  let { type } = e.currentTarget.dataset;
  if (!type) {
    slbTipChange()
  }
  common.goToUrl(`/pagesSlb/st1/business/tabbar/index/index`, { skipWay: "reLaunch" })
  uni.setStorageSync('wx_Slb', true)
}

/** 适老版显示弹窗显示切换 */
const slbTipChange = () => {
  showSlbTip.value = !showSlbTip.value
}

/** 判断是否提示切换适老版 */
const chkEnableSeniorVersion = () => {
  const { hasAlreadySlb, currentUser } = app.globalData;
  if (hasAlreadySlb) {  // 是否已经开启过适老版切换弹窗
    return;
  }
  if (currentUser && currentUser.age >= 60) {
    app.globalData.hasAlreadySlb = true; // 默认 一次进入小程序只弹一次适老版切换弹窗
    slbTipChange();
  }
}

/** 打开医保电子凭证 */
const clickElectronMedical = () => {
  uni.navigateToMiniProgram({
    appId: "wxb032bc789053daf4",
    path: "pages/esscard/scancode-nhsa/main?channel=AAEQHg2Pe4b-JhLqiIyHf2g0&cityCode=350000",
  })
}
</script>

<style lang="scss" scoped>
.container,
.content {
  background-color: #f6f7f8;
}

.topBg_img {
  width: 100%;
  height: 376upx;
  position: fixed;
  top: 0;
  left: 0;
}

.top_box {
  position: relative;
  z-index: 1;
  padding: 0 30upx;
}

.topBox_title {
  width: 100%;
  font-size: 32upx;
  font-family: Source Han Sans CN;
  font-weight: 500;
  color: #000000;
  text-align: center;
}

/* ================ */
/* 搜索框 */
.search {
  margin: 30upx 0;
  background-color: #fff;
  height: 72upx;
  line-height: 72upx;
  border-radius: 36upx;
}

.search_input {
  font-size: 28upx;
  font-family: PingFang SC;
  color: #8A8A99;
  line-height: 40upx;
}

.search_icon {
  width: 26upx;
  height: 25upx;
  margin: 0 20upx;
}

.search_box {
  width: 100%;
}

.remove_icon {
  width: 32rpx;
  height: 32rpx;
  margin: 20rpx 30rpx;
  padding-left: 30rpx;
  box-sizing: content-box;
  border-left: 1px solid #E6E6E6;
}

/* ================ */

.userBox .no_userBox {
  width: 690upx;
  height: 300upx;
  position: relative;
  padding-top: 20upx;
}

.userBox .no_userBox .home_noBindBG {
  position: absolute;
  top: 0;
  left: 0;
}

.userBox .no_userBox .no_userBox_title {
  font-size: 32upx;
  font-family: PingFang SC;
  font-weight: 800;
  color: #222326;
  position: relative;
}

.userBox .no_userBox .no_userBox_btn {
  width: 180upx;
  height: 64upx;
  font-size: 28upx;
  font-family: PingFang SC;
  font-weight: bold;
  color: #FFFFFF;
  position: relative;
  margin-top: 28upx;
}

.userBox .no_userBox .home_noBindBtn {
  position: absolute;
  top: 0;
  left: 0;
}

.userBox .no_userBox .icon_WhiteAdd {
  width: 20upx;
  height: 20upx;
  margin-right: 8upx;
}

.userBox .no_userBox .btnText {
  position: relative;
  width: 180upx;
  height: inherit;
}

.userBox .no_login {
  width: 690rpx;
  height: 240rpx;
  position: relative;
}

.userBox .no_login .home_noBindBG {
  position: absolute;
  top: 0;
  left: 0;
}

.unlogin {
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 40rpx 20rpx 20rpx;
}

.unlogin image {
  width: 120rpx;
  height: 120rpx;
  min-width: 120rpx;
  min-height: 120rpx;
  margin: 0 40rpx;
}

.unlogin button {
  background-color: transparent;
  text-align: left;
  color: #fff;
}

/* ====================== */
.yes_userBox {
  background: linear-gradient(-45deg, #8CC63F 0%, #74B72F 100%);
  border-radius: 24upx;
  position: relative;
}

.yes_userBox .user_info_box {
  padding: 30upx;
  color: #fff;
}

.yes_userBox .user_info_box .member_box .memberName {
  font-size: 36upx;
  font-family: PingFang SC;
  color: #FAFAFA;
}

.yes_userBox .user_info_box .memberTip {
  position: relative;
  width: 180upx;
  height: 40upx;
  line-height: 40upx;
  margin-left: 24upx;
}

.yes_userBox .user_info_box .memberTip .homePage_userTip {
  position: absolute;
  height: inherit;
  line-height: inherit;
  width: 100%;
  top: 0;
  left: 0;
}

.yes_userBox .user_info_box .memberTip .QRCode_box {
  position: absolute;
  width: 100%;
  z-index: 1;
  font-size: 22upx;
  font-family: PingFang SC;
  height: inherit;
  line-height: inherit;
}

.yes_userBox .user_info_box .memberTip .homePage_qrCode {
  width: 20upx;
  height: 20upx;
  margin-right: 7upx;
}

.yes_userBox .user_info_box .memberInfo_cardInfo {
  font-size: 28upx;
  font-family: PingFang SC;
  color: #FAFAFA;
  margin-top: 24upx;
}

.yes_userBox .user_info_box .choice_patient_btn {
  width: 188upx;
  height: 63upx;
  line-height: 63upx;
  border: 2rpx solid #FFFFFF;
  border-radius: 32upx;
  font-size: 28upx;
  font-family: PingFang SC;
  color: #FAFAFA;
  text-align: center;
}

.yes_userBox .electronMedical {
  position: absolute;
  right: 242upx;
  top: 20upx;
}

.yes_userBox .electronMedical_img {
  width: 104upx;
  height: 104upx;
}

.yes_userBox .electronMedical_txt {
  margin-top: -10upx;
  color: #fff;
  font-size: 20upx;
}

/* ================================= */

/* 主动式服务 */

.msg_list_box {
  position: relative;
  z-index: 3;
  padding: 0 24upx 30upx;
}

.non_msg_box {
  height: 180upx;
}

.msg_list_box .imgCom {
  position: absolute;
  top: 0;
  left: 16upx;
}

/* .msg_list_box {
  padding: 0 16rpx 24rpx;
  margin-top: 40rpx;
  border-radius: 30rpx;
} */
.register_remind_btn {
  width: 148upx;
  height: 64upx;
  line-height: 64upx;
  text-align: center;
  border-radius: 32upx;
}

.register_remind_box {
  position: relative;
  padding: 56upx 24upx 32upx;
  font-size: 28upx;
}

.homeTop_noyygh {
  width: 658upx;
  height: 165upx;
}

.homeTop_yesyygh {
  width: 658upx;
  height: 416upx;
}

.register_remind_box .titel {
  font-size: 32upx;
  font-family: PingFang SC;
  font-weight: 800;
  color: #222326;
  margin-bottom: 20upx;
}

.register_remind_btn {
  width: 148upx;
  height: 64upx;
  line-height: 64upx;
  text-align: center;
  border-radius: 32upx;
}

.progress {
  position: absolute;
  width: 90%;
  top: 50upx;
  left: 20px;
}

/* ================================= */
.floot {
  margin: 30upx;
  background-color: #fff;
  border-radius: 24upx;
}

.floot_top {
  padding: 37upx 30upx 0 34upx;
}

.floot_title {
  position: relative;
  font-size: 32upx;
  font-family: PingFang SC;
  font-weight: 800;
  color: #222326;
}

.floot_title::after {
  content: "";
  position: absolute;
  left: -10upx;
  top: 0;
  width: 38upx;
  height: 38upx;
  background: linear-gradient(229deg, #FFFFFF 0%, #74B72F 100%);
  opacity: 0.6;
  border-radius: 50%;
}

.floot_titleName {
  position: relative;
  z-index: 1;
}

.floot_tip {
  font-size: 28upx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #8A8A99;
}

.floot_tip text {
  line-height: initial;
}

.icon_right {
  width: 11upx;
  height: 19upx;
  margin-left: 10upx;
}

.flootNoTip {
  text-align: center;
  width: 100%;
  font-size: 30upx;
  margin: 30upx 0;
  color: #43434A;
}

/* 常用功能 */
.menuServices_box .menuList {
  margin: 40upx 0 36upx;
}

.fw_25 {
  width: 25%;
}

.menuIcon {
  width: 78upx;
  height: 84upx;
  margin-bottom: 20upx;
}

.menuText {
  font-size: 26upx;
  font-family: PingFang SC;
  color: #222326;
}

/* 我的医生 */
.myDoctor_box .floot_lineFeed {
  padding: 0 30upx;
}

.myDoctor_box .myDoctor_item {
  width: 196upx;
  height: 202upx;
  background: #FFFFFF;
  box-shadow: 0rpx 0rpx 98rpx 0rpx rgba(100, 100, 100, 0.1);
  border-radius: 20upx;
  margin: 30upx 0 46upx 0;
}

.myDoctor_box .floot_lineFeed.displayFlexLeft .myDoctor_item {
  margin: 30upx 30upx 46upx 0;
}

.myDoctor_box .iconDoctor {
  width: 80upx;
  height: 80upx;
  border-radius: 50%;
}

.myDoctor_box .doctorName {
  text-align: center;
  font-size: 28upx;
  font-family: PingFang SC;
  font-weight: bold;
  color: #222326;
  margin: 17upx 0 9upx;
}

.myDoctor_box .doctorTitle {
  font-size: 22upx;
  font-family: PingFang SC;
  color: #999999;
}

/* 热点资讯 */
.hotspot_info {
  position: relative;
  padding: 30upx 0 30upx 30upx;
  white-space: nowrap;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.hotspot_infoItem {
  width: 310upx;
  height: 170upx;
  margin-right: 16upx;
  display: inline-flex;
  flex-direction: column;
  padding: 24upx 20upx;
  background: #e9f6d2;
  border-radius: 20rpx;
  color: #5D9C36;
}

.hotspot_infoItem:nth-child(2n) {
  background: #FBEBC2;
  color: #EC8413;
}

.hotspot_info .hotspot_infoItem_title {
  font-size: 28upx;
  font-family: PingFang SC;
  font-weight: bold;
  margin-bottom: 24upx;
}

.hotspot_info .hotspot_infoItem_text {
  font-size: 22upx;
  font-family: PingFang SC;
  font-weight: 500;
  line-height: 32upx;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap;
}

/* =============== */
/* 医院风采 */
.hosMenuInfo {
  margin: 30upx 30upx 0;
  padding: 0 0 30upx;
  align-items: end;
  position: relative;
}

.hosInfoBox_item_fir {
  width: 48%;
  float: left;
  height: 256upx;
  margin-right: 16upx;
  position: relative;
}

.hosInfoBox_item {
  width: 48%;
  height: 120upx;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.hosInfoBox_itemT {
  margin-top: 16upx;
}

.hosInfoBox_itemImg {
  position: absolute;
  top: 0;
  left: 0;
}

.hosInfoBox_itemText {
  position: absolute;
  z-index: 1;
  top: 30upx;
  left: 30upx;
  font-size: 24upx;
  font-family: PingFang SC;
  color: #AAADBD;
  line-height: 44upx;
}

.hosInfoBox_itemText .name {
  font-size: 28upx;
  font-family: PingFang SC;
  font-weight: bold;
  color: #43434A;
  margin-bottom: 16upx;
}

/* 进度条 */
.progress {
  position: absolute;
  width: 90%;
  top: 50rpx;
  left: 20px;
}

/* 主动式插件样式覆盖 */
.active-service-process {
  clip-path: none !important;
}


/* 二维码 */
.public_dialog {
  background-color: rgba(1, 1, 1, 0.6);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code_inner {
  width: 600upx;
  border-radius: 24upx;
  position: relative;
  background-color: #fff;
  padding-bottom: 50upx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.code_img_out {
  width: 24upx;
  height: 24upx;
  position: absolute;
  right: 30upx;
  top: 30upx;
  z-index: 1;
}

.code_img {
  width: 100%;
  height: 200upx;
  position: absolute;
  top: 0;
  left: 0;
}

.code_tit {
  font-size: 40upx;
  font-weight: 500;
  height: 200upx;
  line-height: 210upx;
  position: relative;
  color: #fff;
}

.code_card {
  font-size: 28upx;
  font-family: Arial;
  font-weight: 400;
  color: rgba(255, 255, 255, 1);
  margin: 23upx 0 107upx;
  position: relative;
}

.code_subtit {
  font-size: 28upx;
}

.code_con {
  margin: 37upx 0 30upx;
  width: 340upx;
  height: 340upx;
}

.code_tip {
  font-size: 26upx;
  color: #58AB56;
}

.qr_code {
  box-sizing: content-box;
  width: 340upx;
  height: 340upx;
  padding: 10upx 0;
}

.tip_x {
  width: 100%;
  height: 88upx;
  position: fixed;
  left: 0;
  bottom: 0;
  font-size: 36upx;
  font-family: PingFang-SC, PingFang-SC;
  font-weight: bold;
  color: #814B01;
  line-height: 32upx;
  padding: 0 60upx 0 30upx;
  z-index: 1111;
}

.tip_ {
  width: 100%;
  position: relative;
  z-index: 1;
}

.tip_back {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

.tip_right {
  position: absolute;
  width: 20upx;
  height: 32upx;
  top: 0;
  bottom: 0;
  margin: auto 0;
  right: 32upx;
}

.modal_mark {
  background-color: rgba(0, 0, 0, 0.4);
  position: fixed;
  z-index: 1111;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
}

.modal_slb {
  width: 560rpx;
  position: relative;
  background-color: #fff;
  border-radius: 14px;
  padding-bottom: 60rpx;
}

.modal_home_bk {
  width: 100%;
  height: 172rpx;
  position: absolute;
  left: 0;
  top: 0;
}

.modal_home_ld {
  position: absolute;
  width: 158rpx;
  height: 109rpx;
  left: 50%;
  transform: translateX(-50%);
  top: -47rpx;
}

.modal_con {
  position: relative;
  padding-top: 90rpx;
}

.modal_tit {
  font-size: 40rpx;
  font-family: PingFang-SC, PingFang-SC;
  font-weight: bold;
  color: #000000;
  line-height: 32rpx;
  text-align: center;
}

.modal_txt {
  font-size: 36rpx;
  font-family: PingFang-SC, PingFang-SC;
  font-weight: bold;
  color: #000000;
  line-height: 36rpx;
  width: 445rpx;
  margin: 33rpx auto 39rpx auto;
}

.modal_btns {
  padding: 0 40rpx;
}

.modal_btn {
  padding: 26rpx 50rpx;
  border-radius: 50px;
  font-size: 32rpx;
  font-family: PingFang-SC, PingFang-SC;
  font-weight: bold;
  color: #FFFFFF;
  line-height: 36rpx;
  background: var(--dominantColor);
}

.pb-100 {
  padding-bottom: 100rpx;
}
</style>
