<template>
  <view class="container">
    <view class="content" v-if="showCon">
      <view class="userInfoTopFixe">
        <userInfo :userInfo="currentUser" :type="withoutCard ? 'member' : 'card'" bgClass="bgLinGra"></userInfo>
      </view>
      <view class="content_inner" v-if="doctorItem.DoctorName">
        <view class="content_inner_item">
          <view class="doctor_item">
            <view class="doctor_item_nav" @click="doctorInfoClick">
              <view class="doctor_item_nav_img">
                <image :src="doctorItem.PhotoUrl || iconUrl.icon_doctor" mode="widthFix"></image>
              </view>
              <view class="doctor_item_nav_tit">
                <view class="doctor_item_nav_subtit">
                  <text class="doctor_item_nav_subtit_val">{{ doctorItem.DoctorName }}</text>
                  <text v-if="doctorItem.DoctorTitle || doctorItem.Title" class="doctor_item_nav_subtit_txt">{{ doctorItem.DoctorTitle || doctorItem.Title }}</text>
                </view>
                <view v-if="doctorItem.Spec" class="doctor_item_nav_info">
                  {{ doctorItem.Spec }}
                </view>
              </view>
            </view>
            <view class="other_dept_box" v-if="!doctorItem.ShowDeptSwitch">
              <view class="displayFlexRow border_top displayFlexBetween">
                <text>本院所有科室排班</text>
                <switch color="var(--dominantColor)" class="public_switch" @change="queryScheduleList" />
              </view>
            </view>
          </view>
        </view>

        <view class="content_inner_item" v-for="(schedulItem, schedulIndex) in doctorItem.Scheduling" :key="schedulIndex">
          <view class="scheduling_dept_box displayFlexBetween" @click="foldList(schedulIndex)">
            <view class="scheduling_deptName_box displayFlexRow">
              <view class="backgroundCustom "></view>
              <text>{{ schedulItem.DeptName }}</text>
            </view>
            <image class="arrow" :class="{ 'transform_rotate_90': schedulItem.Check }" :src="iconUrl.icon_right"></image>
          </view>
          <block v-if="schedulItem.Check">
            <view class="time_list">
              <view v-for="(item, index) in schedulItem.Data_1" :key="index" @click="timeClick(item, index, schedulIndex)" class="time_item displayFlexCol" :class="{ 'backgroundCustom': item.ScheduleId == dateInfoSelected.ScheduleId, 'time_item_stop': item.IsHalt == 7 || item.IsHalt == 2 }">
                <view>{{ item.RegDateDiy }}</view>
                <view style="margin-top: 12upx;">{{ item.WeekName }} {{ item.TimeSliceStr }}</view>
                <image v-if="item.IsHalt == 7" class="time_item_img" :src="iconUrl.full2"></image>
                <image v-if="item.IsHalt == 2" class="time_item_img" :src="iconUrl.stop"></image>
                <image v-if="item.IsHalt == 7 && item.WaitLeaveCount > 0" class="time_item_img" :src="iconUrl.yyghWait"></image>
              </view>
            </view>
            <view class="content_inner_item_tit">
              <view style="margin-right: 18upx;">诊查费：
                <text class="colorCustom_F08">{{ (dateInfoSelected.RegFee - 0) / 100 }}元</text>
              </view>
              <view v-if="numberList.length > 0">剩余号源数
                <text class="colorCustom_F08"> {{ numberList.length }}</text>
              </view>
            </view>
            <!-- 候补 -->
            <block v-if="dateInfoSelected.IsHalt == 7 && dateInfoSelected.WaitStatus == 1">
              <view class="wait_con">
                <view class="wait_head_con">
                  <view class="wait_head">当前排班支持候补登记，剩余候补名额{{ dateInfoSelected.WaitLeaveCount }}个</view>
                </view>
                <view class="wait_list">
                  <view class="wait_item">1、当医生排班标识为“候补”状态时，表明该医生当前 排班已被约满，但支持候补登记，而且当前尚存在候补 名额；</view>
                  <view class="wait_item">2、当约满排班存在候补名额时，患者可进行候补登记，系统将根据补登记时间自动生成候补队列次序；</view>
                  <view class="wait_item">3、候补登陆成功后，如果在候补截止期前，出现预约 成功患者退号，则系统将根据候补队列次序，为候补者 自动完成预约挂号，并短信通知候补者如期就诊；
                  </view>
                  <view class="wait_item">4、用户可在“我的”-“候补记录”中，取消候补登记。</view>
                </view>
              </view>
              <view class="public_btn" :class="dateInfoSelected.WaitLeaveCount > 0 ? 'backgroundCustom' : 'backgroundCustom_D9'" @click="waitRegistration">候补登记</view>
            </block>
            <block v-else>
              <!-- 方块 -->
              <view class="number_list" v-if="pageConfig.numberType == 1">
                <view class="number_item" :class="{ 'backgroundCustom': item.SourceCode == numberInfoSelected.SourceCode && item.CommendTime == numberInfoSelected.CommendTime }" v-for="(item, index) in numberList" :key="index" @click="numberClick(index)">
                  <view>{{ item.SqNo ? item.SqNo + '号' : '' }}</view>
                  <view class="number_item_time">{{ item.StartTime ? item.StartTime : item.StartTime + '-' + item.EndTime }}</view>
                </view>
              </view>
              <!-- 列表 -->
              <view class="number_list_sec" v-else>
                <view class="number_item_sec border_top" v-for="(item, index) in numberList" :key="index" @click="numberClick(index)">
                  <view class="flexCenter">
                    <image class="circle" :src="item.SourceCode == numberInfoSelected.SourceCode && item.CommendTime == numberInfoSelected.CommendTime ? iconUrl.circle_active : iconUrl.circle"></image>
                    {{ item.EndTime ? item.StartTime + '-' + item.EndTime : item.StartTime }}
                  </view>
                  <view class="number_item_time">余号：{{ dateInfoSelected.LeaveCount }}</view>
                </view>
              </view>
              <view class="public_btn" :class="numberList.length > 0 ? 'backgroundCustom_F08' : 'backgroundCustom_D9'" @click="confirmClick">立即预约</view>
            </block>

          </block>

        </view>
      </view>
    </view>
    <view v-if="showNoData" class="noData">
      <noData :value="noDataValue"></noData>
    </view>
    <overduePerson :currentUser="currentUser" BusinessType="1101"></overduePerson>
    <doctorInfo :doctorInfoIsShow="doctorInfoIsShow" :doctorInfo="doctorInfo"></doctorInfo>
    
    <!-- AI数智客服入口-->
    <aiCustomerEntry :currentUser="currentUser"></aiCustomerEntry>
  </view>
</template>

<script setup lang="ts">
import { ref, reactive, toRefs } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { common, pagesPatientFn, publicFn } from '@/utils';
import icon from '@/utils/icon';
import { REQUEST_CONFIG } from '@/config';
import { 
  queryClinicBaseDoctor, 
  queryNumbers, 
  queryClinicDoctorSchedule, 
  lockOrder, 
  bookService, 
  unlock, 
  queryScheduleList, 
  checkBeforeAddWaitList 
} from '@/pagesPatient/service/yygh';
import { addOrderLocal } from '@/pagesPatient/service/pay';
import { useGetMember } from '@/utils/hooks/useGetMember';

const app = getApp();
const iconUrl = ref(icon);
const withoutCard = ref(false); //是否可以无卡预约
const noDataValue = ref('当前医生暂无排班'); //医生是否有排班
const doctorItem = ref<any>({});
const dateInfoSelected = ref<any>({}); //当前选择的排班时间
const showCon = ref(false);
const showNoData = ref(false);
const numberList = ref<any[]>([]); //预约时段 
const numberInfoSelected = ref<any>({}); //当前选中的预约时段
const currentUser = ref<any>({});
const doctorInfoIsShow = ref(false);
const doctorInfo = ref<any>({}); //医生详情信息
const doctorListConfig = ref<any>({}); //医生列表页配置
const serviceId = ref('');
const options = ref<any>({});
const queryBean = ref<any>({});
const pageConfig = ref<any>({});
const reducibleOnly = ref(false);

onLoad(async (opt: any) => {
  let qBean = app.globalData.queryBean || {};
  /**医生列表页配置 */
  let dListConfig = common.deepCopy(app.globalData.config.pageConfiguration.yyghDoctorList_config);
  /**当前页面配置 */
  let pConfig = common.deepCopy(app.globalData.config.pageConfiguration.yyghClinicMsg_config);
  let dInfoSelected = {};
  /**通过上级页面传的item和点击的排班Index 取到当前点击的排班时间  如果是从预约挂号页面进来的  则取挂号排班时间*/
  if (opt?.schedule) {
    dInfoSelected = common.parse(opt?.schedule);
  } else if (qBean.Data_1 && opt.selectedIndex) {
    dInfoSelected = qBean.Data_1[opt.selectedIndex];
  }
  opt?.deptCode && (qBean.DeptCode = opt?.deptCode);
  opt?.doctorCode && (qBean.DoctorCode = opt?.doctorCode);

  options.value = opt;
  serviceId.value = opt.serviceId || '';
  queryBean.value = qBean;
  dateInfoSelected.value = dInfoSelected;
  doctorListConfig.value = dListConfig;
  pageConfig.value = pConfig;
  withoutCard.value = app.globalData.withoutCard;
});

useOnShow(() => {
  main();
});

const main = async () => {
  currentUser.value = app.globalData.currentUser;
  let sNoData = true;
  /**获取医生信息 */
  await setterDoctorList();
  if (!common.isEmpty(doctorItem.value)) {
    sNoData = false;
    /**获取预约时间段 */
    await queryNumbersFn();
  }
  showCon.value = true;
  showNoData.value = sNoData;
};

/**
 * 医生详情点击
 */
const doctorInfoClick = async () => {
  let dItem = doctorItem.value;
  let queryData = {
    HosId: app.globalData.districtId || app.globalData.hosId,
    DeptCode: dItem.DeptCode || '',
    DoctorCode: dItem.DoctorCode || '',
    DoctorName: ''
  };
  let resp = await queryClinicBaseDoctor(queryData);
  if (!common.isEmpty(resp)) {
    doctorInfoIsShow.value = true;
    doctorInfo.value = resp[0];
  }
};

/**
 * 预约时段点击
 */
const numberClick = (index: number) => {
  numberInfoSelected.value = numberList.value[index];
};

/**
 * 日期选择
 */
const timeClick = (item: any, index: number, schedulIndex: number) => {
  if ((item.IsHalt == 7 && item.WaitLeaveCount <= 0) || item.IsHalt == '2') {
    return;
  }
  numberList.value = [];
  dateInfoSelected.value = item;
  // 判断不等于约满或者不等于停诊查询号源
  if (item.IsHalt != 7 && item.IsHalt != '2') {
    queryNumbersFn();
  }
};

/**
 * 获取号源列表
 */
const queryNumbersFn = async () => {
  let dInfoSelected = dateInfoSelected.value;
  let queryData = {
    HosId: app.globalData.districtId || app.globalData.hosId,
    DeptCode: dInfoSelected.DeptCode,
    DoctorCode: dInfoSelected.DoctorCode,
    RegDate: dInfoSelected.RegDate,
    TimeSlice: dInfoSelected.TimeSlice,
    ScheduleId: dInfoSelected.ScheduleId,
    TransactionCode: 2002,
  };
  let nList = await queryNumbers(queryData);
  let nInfoSelected = {};
  if (!common.isEmpty(options.value?.number)) {
    nInfoSelected = common.parse(options.value?.number);
  } else {
    nInfoSelected = nList && nList[0] || {};
  }
  numberList.value = nList || [];
  numberInfoSelected.value = nInfoSelected; //默认选中第一个号源
};

/**
 * 处理医生列表返回值
 */
const setterDoctorList = async () => {
  let qBean = queryBean.value;
  let dInfoSelected = dateInfoSelected.value;
  let hasAllSchedules = doctorListConfig.value.hasAllSchedules;
  let queryData: any = {
    HosId: app.globalData.districtId || app.globalData.hosId,
    DeptCode: qBean.DeptCode,
    DoctorCode: qBean.DoctorCode,
    WorkDateStart: hasAllSchedules ? "" : dInfoSelected.RegDate,
    WorkDateEnd: hasAllSchedules ? "" : dInfoSelected.RegDate,
    TitleCode: "",
    OrderByDoc: '1',
    WaitRule: '1'
  };
  // 判断为当日挂号
  if (serviceId.value == '009') {
    queryData.WorkDateStart = common.getDate();
    queryData.WorkDateEnd = common.getDate();
    queryData.ServiceId = serviceId.value;
  }
  let resp = await queryClinicDoctorSchedule(queryData);
  if (!common.isEmpty(resp)) {
    let dItem = resp[0];
    /**如果医生头像没有域名 添加域名 */
    if (dItem.PhotoUrl && dItem.PhotoUrl.indexOf('http') == '-1') {
      dItem.PhotoUrl = REQUEST_CONFIG.BASE_URL + dItem.PhotoUrl;
    }
    if (dItem.PhotoUrl) {
        dItem.PhotoUrl = dItem.PhotoUrl.replace(/\\/g, '/');
    }
    
    dItem.Data_1.map((item: any) => {
      item.RegDateDiy = item.RegDate.substring(5);
      item.WeekName = item.RegDate == common.newDay() ? '今天' : item.WeekName;
      item.DeptName = dItem.DeptName;
      item.DeptCode = dItem.DeptCode;
      item.DoctorName = dItem.DoctorName;
      item.DoctorCode = dItem.DoctorCode;
    });

    // 数据处理 医生多科室
    let obj = [{
      Check: true,
      DeptName: dItem.DeptName,
      DeptCode: dItem.DeptCode,
      DoctorName: dItem.DoctorName,
      DoctorCode: dItem.DoctorCode,
      Data_1: dItem.Data_1,
    }];
    dItem.Scheduling = obj;
    /**重新赋值当前项   否则提交订单后后退不刷新值 */
    let dInfoSelectedNew = resp.filter((item: any) => item && item.ScheduleId == dateInfoSelected.value.ScheduleId)[0] || dateInfoSelected.value;
    
    doctorItem.value = dItem;
    /**历史医生进入  无ScheduleId 重新赋值  */
    dateInfoSelected.value = dateInfoSelected.value.ScheduleId ? dInfoSelectedNew : dItem && dItem.Data_1 && dItem.Data_1[0] || {};
  }
};

const switchChange = (e: any) => {
  let value = e.detail.value;
  reducibleOnly.value = value;
  main();
};

/**
 * 立即预约点击
 */
const confirmClick = async (e: any) => {
  // 注意：Vue 中没有 formId
  let formId = ''; // e.detail.formId
  let dInfoSelected = dateInfoSelected.value;
  let nInfoSelected = numberInfoSelected.value;
  let dItem = doctorItem.value;

  // 查询当前用户 是否被授权
  if (await publicFn.isCurrentUserAuth(currentUser.value, 'Book', true)) return;
  
  /**是否存在待支付订单 */
  if (await pagesPatientFn.hasOrderToBePaid('0,009')) return;

  common.throttle(async () => {
    if (common.isEmpty(dateInfoSelected.value)) {
      common.showToast('请选择预约日期');
      return;
    }
    if (common.isEmpty(numberInfoSelected.value)) {
      common.showToast('请选择预约时间');
      return;
    }

    /**锁号 */
    let queryData: any = {
      HosId: app.globalData.districtId || app.globalData.hosId,
      ScheduleId: dInfoSelected.ScheduleId,
      DeptCode: dInfoSelected.DeptCode,
      DoctorCode: dInfoSelected.DoctorCode,
      RegType: '1',
      RegDate: dInfoSelected.RegDate,
      TimeSlice: dInfoSelected.TimeSlice,
      SqNo: nInfoSelected.SqNo,
      CommendTime: nInfoSelected.EndTime ? `${nInfoSelected.StartTime}-${nInfoSelected.EndTime}` : nInfoSelected.StartTime,
      SourceCode: nInfoSelected.SourceCode,
      MemberId: currentUser.value.memberId,
      CardType: '1',
      CardNo: currentUser.value.cardNo || '',
      MemberStore: {
        cardEncryptionStore: currentUser.value.encryptionStore || '',
        baseMemberEncryptionStore: currentUser.value.baseMemberEncryptionStore
      },
      Store: {
        cardEncryptionStore: currentUser.value.encryptionStore || '',
        baseMemberEncryptionStore: currentUser.value.baseMemberEncryptionStore
      }
    };
    let lockResp = await lockOrder(queryData);
    if (!common.isEmpty(lockResp)) {
      /**锁号成功 */

      /**本地下单 */
      let addorderData = {
        HosId: app.globalData.hosId,
        OrderId: lockResp[0].OrderId,
        PrescNo: '',
        PayMoney: lockResp[0].Fee,
        TotalMoney: lockResp[0].Fee,
        IsOnlinePay: lockResp[0].IsOnlinePay,
        PriceName: '挂号支付',
        OperatorId: uni.getStorageSync('openid'),
        ServiceId: '0',
        PayFeeItem: '0',
        EqptType: '1',
        BankCardNo: '',
        BankSeqNo: '',
        ChargeSource: '',
        MemberId: currentUser.value.memberId,
        OperatorName: currentUser.value.MemberName,
        Store: {
          cardEncryptionStore: currentUser.value.encryptionStore || '',
          baseMemberEncryptionStore: currentUser.value.baseMemberEncryptionStore
        },
        Data_1: {
          DoctorCode: dInfoSelected.DoctorCode || dItem.DoctorCode,
          DoctorName: dInfoSelected.DoctorName || dItem.DoctorName,
          DeptCode: dInfoSelected.DeptCode || dItem.DeptCode,
          DeptName: dInfoSelected.DeptName || dItem.DeptName,
          RegDate: dInfoSelected.RegDate,
          CommendTime: nInfoSelected.CommendTime,
          scene_id: formId,
          FeeInfo: lockResp[0].FeeInfo,
          scene_type: '1',
          TransactionCode: '6001'
        }
      };
      let addOrderResp = await addOrderLocal(addorderData);
      if (!common.isEmpty(addOrderResp)) {
        /**本地下单成功 */
        let url = `/pagesPatient/st1/business/pay/payState/payState?pageType=yygh&orderId=${lockResp[0].OrderId}`;
        if (lockResp[0].IsOnlinePay == '1') {
          /**在线支付 */
          url = `/pagesPatient/st1/business/pay/payMent/payMent?orderId=${lockResp[0].OrderId}`;
        } else if (lockResp[0].IsOnlinePay == '2') {
          /**不支付 boockService挂号 */
          let queryData = {
            HosId: app.globalData.districtId || app.globalData.hosId,
            OrderId: lockResp[0].OrderId,
            OperatorId: uni.getStorageSync('openid'),
            TransactionCode: "3003",
            MemberId: currentUser.value.memberId,
            SourceType: 0,
            Store: {
              cardEncryptionStore: currentUser.value.encryptionStore || '',
              baseMemberEncryptionStore: currentUser.value.baseMemberEncryptionStore
            },
          };
          let { resp, resData } = await yygh.bookService(queryData);
          if (resData.RespCode != 10000) {
            await yygh.unlock({ OrderId: lockResp[0].OrderId });
            return;
          }
        }
        common.goToUrl(url);
      }
    }
  });
};

/**
 * 查询医生其它科室排班
 */
const queryScheduleList = async (e: any) => {
  let hasAllSchedules = doctorListConfig.value.hasAllSchedules;
  let dInfoSelected = dateInfoSelected.value;
  let dItem = doctorItem.value;
  let querData = {
    workDateEnd: hasAllSchedules ? "" : dInfoSelected.RegDate,
    workDateStart: hasAllSchedules ? "" : dInfoSelected.RegDate,
    doctorCode: dItem.DoctorCode,
    deptCode: dItem.DeptCode,
    hosId: app.globalData.districtId || app.globalData.hosId,
    WaitRule: '1'
  };
  let res = await queryScheduleList(querData);
  if (common.isNotEmpty(res)) {
    let scheduleList: any[] = [];
    res.map(async (item: any, index: number) => {
      // 转换返回数据 小写转大写
      item.hisQueryClinicSchedules = common.changeObj(item.hisQueryClinicSchedules);
      item.hisQueryBaseDoctor = common.changeObj(item.hisQueryBaseDoctor);
      if (item.hisQueryClinicSchedules.length > 0) {
        // 判断是否多数据处理 星期 时间 上下午
        if (item.hisQueryClinicSchedules.length > 0) {
          item.hisQueryClinicSchedules.map((ele: any) => {
            ele.WeekName = ele.RegDate == common.newDay() ? '今天' : common.weekDay(ele.RegDate, 1);
            ele.RegDateDiy = ele.RegDate.substring(5);
            ele.TimeSliceStr = ele.TimeSlice == 1 ? '上午' : ele.TimeSlice == 2 ? '下午' : '全天';
          });
        }
        scheduleList.push({
          Check: item.hisQueryBaseDoctor.DeptCode == dItem.DeptCode ? true : false,
          DeptName: item.hisQueryBaseDoctor.DeptName,
          DeptCode: item.hisQueryBaseDoctor.DeptCode,
          DoctorName: dItem.DoctorName,
          DoctorCode: dItem.DoctorCode,
          Data_1: item.hisQueryClinicSchedules,
          showAllSchedu: item.showAllSchedu,
        });
      }
    });
    // 给当前查询的医生新加列表
    dItem.Scheduling = scheduleList;
  }
  // 查询过的医生 不展示switch
  dItem.ShowDeptSwitch = true;
  doctorItem.value = dItem;
};

/**
 * 折叠列表
 */
const foldList = (schedulIndex: number) => {
  let dItem = doctorItem.value;
  // 当前点击的科室是打开的状态，则进行关闭，不查号源
  if (dItem.Scheduling[schedulIndex].Check) {
    dItem.Scheduling[schedulIndex].Check = false;
    doctorItem.value = dItem;
  } else {
    let dInfoSelected = {};
    // 全部遍历关闭展开数据信息
    dItem.Scheduling.map((item: any) => item.Check = false);
    // 当前打开
    dItem.Scheduling[schedulIndex].Check = true;
    // 过滤当前打开的排班信息 获取到未满未停诊的排班
    let dateInfoSelecteds = dItem.Scheduling[schedulIndex].Data_1.filter((item: any) => item.IsHalt != '7' || item.IsHalt != '2');
    // 判断过滤条件是否为空 为空踢提示
    if (common.isEmpty(dateInfoSelecteds)) {
      common.showToast("查询号源失败，请选择一个排班信息");
    } else {
      // 否者查询号源
      dInfoSelected = dateInfoSelecteds[0];
    }
    dateInfoSelected.value = dInfoSelected;
    doctorItem.value = dItem;
    queryNumbersFn();
  }
};

// 候补登记
const waitRegistration = async () => {
  let cUser = currentUser.value;
  let dInfoSelected = dateInfoSelected.value;
  let dItem = doctorItem.value;
  if (dInfoSelected.WaitLeaveCount <= 0) return;
  let queryData = {
    HosId: app.globalData.districtId || app.globalData.hosId,
    OpenId: uni.getStorageSync("openid"),
    MemberId: cUser.memberId,
    ScheduleId: dInfoSelected.ScheduleId,
    DeptCode: dItem.DeptCode,
    DoctorCode: dItem.DoctorCode,
    RegDate: dInfoSelected.RegDate,
    WeekId: dInfoSelected.WeekId,
    TimeId: dInfoSelected.TimeSlice,
    Store: {
      cardEncryptionStore: cUser.encryptionStore || '',
      baseMemberEncryptionStore: cUser.baseMemberEncryptionStore
    }
  };
  let { resp, resData } = await checkBeforeAddWaitList(queryData);
  if (resData.RespCode == '10000') {
    dItem.Intro = '';
    dItem.Data_1 = '';
    dItem.Scheduling = '';
    let querBen = encodeURIComponent(JSON.stringify({
      doctorItem: dItem,
      dateInfoSelected: dInfoSelected
    }));
    common.goToUrl(`/pagesPatient/st1/business/yygh/waitRegistration/waitRegistration?querBen=${querBen}`);
  }
};
</script>

<style scoped>
.container {
  /* background-color: #F8F8F8; */
  min-height: 100vh;
}

.content_inner {
  padding: 200upx 30upx 0;
  display: inline-block;
  width: 100%;
}

.content_inner_item {
  margin: 30upx 0;
  padding: 30upx 0;
  border-radius: 24upx;
  background: #fff;
  overflow: hidden;
}
.content_inner_item_tit {
  height: 110upx;
  display: flex;
  align-items: center;
  padding: 0 30upx;
  font-size: 32upx;
}

.doctor_item {
  padding: 0 30upx;
}

.doctor_item_nav {
  display: flex;
  position: relative;
  padding: 20upx 0;
}

.doctor_item_nav_img {
  width: 110upx;
  height: 103upx;
  border-radius: 50%;
  margin-right: 23upx;
  overflow: hidden;
}

.doctor_item_nav_tit {
  width: 82%;
}


.doctor_item_nav_subtit_val {
  font-size: 32upx;
  font-family: PingFang SC;
  font-weight: 800;
  color: #222326;
  margin-right: 12upx;
}

.doctor_item_nav_subtit_txt {
  height: 36upx;
  line-height: 28upx;
  font-size: 24upx;
  font-family: PingFang SC;
  color: var(--auxiliaryColor);
  padding: 0upx 7upx;
  position: relative;
  display: inline-block;
  background: #FFFBF4;
  border: 1upx solid #FADAB2;

}

.doctor_item_nav_info {
  font-size: 28upx;
  font-family: Source Han Sans CN;
  font-weight: 500;
  color: #62626D;
  line-height: 40upx;
  margin-top: 10upx;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.time_list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 30upx;
}

.time_item {
  margin: 23upx 2% 0 0;
  width: 32%;
  height: 110upx;
  line-height: 110upx;
  background: #F1F1F6;
  border-radius: 20upx;
  font-size: 28upx;
  color: #222326;
  text-align: center;
  position: relative;
}
.time_item:nth-child(3n){
  margin-right: 0;
}

.time_item_img {
  width: 61upx;
  height: 54upx;
  position: absolute;
  right: 0;
  top: 0;
}
.time_item_stop view{
  color: #8A8A99;
}

.price {
  font-size: 32upx;
  color: #fa4844;
}

.subtit {
  color: #a6a6a6;
  font-size: 28upx;
}

.number_list {
  display: flex;
  align-items: center;
  flex-wrap: wrap; 
  padding: 0 30upx 12upx;
  -webkit-overflow-scrolling: touch;
}

.number_item {
  font-size: 28upx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #43434A;
  width: 23%;
  height: 110upx;
  margin: 0 2.5% 22upx 0;
  background: #F1F1F6;
  border-radius: 20upx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.number_item:nth-child(4n){
  margin-right: 0;
}

.number_item_time {
  margin-top: 6upx;
  text-align: center;
}
/* 列表号源 */
.number_list_sec{
  -webkit-overflow-scrolling: touch;
}
.number_item_sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30upx;
  height: 100upx;
  font-size: 32upx;
  color: rgba(85, 85, 85, 1); 
}

.circle {
  margin-right: 22upx;
  width: 42upx;
  height: 42upx;
}
.border:before{
  border-radius: 0;
}

/* 查询 switch*/
.other_dept_box view {
  width: 100%;
  padding-top: 28upx ;
  margin-top: 23upx;
  box-sizing: border-box;
  justify-content: space-between;
}

.other_dept_box view text {
  font-size: 32upx;
  color: #333;
}

/* 多科室 */
.scheduling_dept_box {
  margin: 8upx 0 12upx;
  padding-left: 30upx;
}

.scheduling_deptName_box view {
  width: 14upx;
  height: 14upx;
  border-radius: 14upx;
  margin-right: 20upx;
}

.scheduling_deptName_box text {
  font-size: 32upx;
  color: #333;
}

.scheduling_dept_box image {
  transform: rotate(270deg);
}

.scheduling_list {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.transform_rotate_90 {
  transform: rotate(90deg) !important;
}

.transform_rotate_180 {
  transform: rotate(180deg) !important;
}

.public_btn{
  margin: 0 30upx;
  height: 88upx;
  line-height: 88upx;
}



/* 候补 */
.wait_con{
  padding:0 30upx;
}
.wait_head {
  margin: 0 auto;
  background: #f8f4ea;
  border-radius: 10upx 10upx 0px 0px;
  padding: 30upx 45upx;
  font-size: 30upx;
  font-family: PingFang SC;

  color: #d18e09;
  line-height: 40upx;
  position: relative;
  transform-style: preserve-3d;
}

.wait_head::before,
.wait_head::after {
  content: "";
  display: block;
  width: 16upx;
  height: 16upx;
  border-radius: 50px;
  background-color: #f6e8ce;
  position: absolute;
  bottom: 0;
  transform: translateZ(-1px);
}

.wait_head::before {
  left: -8upx;
}

.wait_head::after {
  right: -8upx;
}

.wait_list {
  padding: 20upx 0;
  background-color: #fff;
}

.wait_item {
  font-size: 28upx;
  font-family: PingFang SC;
  color: #999;
  line-height: 54upx;
}
</style>