<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" http-equiv="Cache-Control" content="public, max-age=3600">
<title>订单信息</title>

<!--  外部  -->
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/crypto-js/4.1.1/crypto-js.min.js"></script> 
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/jquery/3.3.1/jquery.min.js"></script> 
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/sweetalert/1.1.3/sweetalert.min.js"></script>
<link href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-y/sweetalert/1.1.3/sweetalert.min.css" type="text/css" rel="stylesheet">
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-y/Swiper/3.4.0/js/swiper.jquery.min.js"></script>
<link href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-y/Swiper/3.4.0/css/swiper.min.css" type="text/css" rel="stylesheet">

<!--  内部  -->
<!-- <script src="./statics/js/crypto-js.min.js"></script>  -->
<!-- <script src="./statics/js/jquery-3.3.1.min.js"></script>  -->
<!-- <script src="./statics/js/sweetalert.min.js"></script> -->
<!-- <link href="./statics/css/sweetalert.min.css" type="text/css" rel="stylesheet"> -->
<!-- <script src="./statics/js/swiper-3.4.0.jquery.min.js"></script> -->
<!-- <link href="./statics/css/swiper-3.2.7.min.css" type="text/css" rel="stylesheet"> -->

<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 20px;
        background-color: #f4f4f4;
        color: #333;
    }
    /* 顶部切换标签 */
    .swiper-container {
        position: sticky;
        top: 0;
        z-index: 6666;
        background: white;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        display: flex;
        border-radius: 5px;
        justify-content: space-around;
    }
    
    /* 新插入的内容样式 */
    .category {
        margin-bottom: 3px;
        background: white;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    .category-header {
        width: calc(98vw - 40px);
        padding: 5px 5px;
        background: #f8f9fa;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #eee;
    }

    .category-header h2 {
        font-size: 12px;
        font-weight: 600;
        margin-left: 5px;
        color: #2c3e50;
        display: flex;
        align-items: center;
    }

    .category-header .badge {
        background: #e9ecef;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 12px;
        margin-left: 8px;
        color: #666;
    }

    .category-content {
        background-color: #f4f4f4;
        padding: 3px;
        display: none;
    }

    .category.active .category-content {
        display: block;
    }
    
    .arrow {
        font-size: 10px;
        transition: transform 0.3s ease;
        margin-right: 5px;
    }

    .category.active .arrow {
        transform: rotate(180deg);
    }

    .container {
        display: flex;
        justify-content: center; /* 水平居中 */
        align-items: center; /* 垂直居中 */
        text-align: center; /* 单行文本居中 */
    }
    .card-container {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    .card {
        position: relative; /* 相对定位以便在右上角放置勾选框 */
        background: white;
        border-radius: 15px;
        padding: 15px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s;
        margin-top: 10px;
    }
    .card:hover {
        transform: scale(1.01);
    }
    .card h2 {
        font-size: 15px;
        margin: 0 0 10px 0;
    }
    .card p {
        font-size: 15px;
        margin: 8px 0;
    }
    /* 复选框 */
    .checkbox-container {
        position: absolute;
        top: 10px;
        right: 10px;
        transform: scale(1.3); /* 放大复选框 1.5 倍 */
    }
    .custom-checkbox {
        display: flex; 
    }
    
    
      
    .link {
        font-size: 12px;
        text-decoration: none; /* 去掉下划线 */
        color: #007BFF; /* 链接颜色 */
        padding: 2px 3px; /* 内边距 */
        border: 1px solid #007BFF; /* 边框 */
        border-radius: 3px; /* 圆角 */
        transition: background-color 0.3s; /* 动画过渡 */
    }
    
    .link:hover {
        background-color: #007BFF; /* 鼠标悬停时背景颜色 */
        color: white; /* 鼠标悬停时文字颜色 */
    }
        
    .receiverAddr {
        font-size: 8px;
        margin-top: 5px;
    }	
    .status {
        font-weight: bold;
        margin-top: 5px;
    }
    .pagination {
        margin-top: 20px;
        display: none;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }
    
    .reservationbutton {
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        padding: 10px 15px;
        width: 100%;
        cursor: pointer;
        transition: background-color 0.3s;
    }
    button {
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        padding: 10px 15px;
        cursor: pointer;
        transition: background-color 0.3s;
    }
    button:hover {
        background-color: #0056b3;
    }
    
    /* @media (max-width: 600px) {
    .card {
        width: calc(100% - 30px);
    }
    } */
    
    /* @media (min-width: 601px) and (max-width: 900px) {
    .card {
        width: calc(50% - 30px);
    }
    } */
    
    /* 等待效果 */
    .loader {
        display: none;
        position: fixed;
        background-color: rgba(0,0,0,0.2);
        bottom: 0;
        left: 0;
        overflow: hidden;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 99999;
    }
    .loader-inner p {
        position: absolute;
        bottom: 0;
        left: 0%;
        right: 0%;
        font-size: 20px;
        color: white;
    }
    .loader-inner {
        bottom: 0;
        height: 140px;
        left: 0;
        margin: auto;
        position: absolute;
        right: 0;
        top: 0;
        width: 100px;
        transform: scale(0.7, 0.7);
        text-align: center;
    }
    .loader-line-wrap {
        animation: spin 2000ms cubic-bezier(.175, .885, .32, 1.275) infinite;
        box-sizing: border-box;
        height: 50px;
        left: 0;
        overflow: hidden;
        position: absolute;
        top: 0;
        transform-origin: 50% 100%;
        width: 100px;
    }
    .loader-line {
        border: 4px solid transparent;
        border-radius: 100%;
        box-sizing: border-box;
        height: 100px;
        left: 0;
        margin: 0 auto;
        position: absolute;
        right: 0;
        top: 0;
        width: 100px;
    }
    .loader-line-wrap:nth-child(1) {
        animation-delay: -50ms;
    }
    .loader-line-wrap:nth-child(2) {
        animation-delay: -100ms;
    }
    .loader-line-wrap:nth-child(3) {
        animation-delay: -150ms;
    }
    .loader-line-wrap:nth-child(4) {
        animation-delay: -200ms;
    }
    .loader-line-wrap:nth-child(5) {
        animation-delay: -250ms;
    }
    .loader-line-wrap:nth-child(1) .loader-line {
        border-color: hsl(0, 80%, 60%);
        height: 90px;
        width: 90px;
        top: 7px;
    }
    .loader-line-wrap:nth-child(2) .loader-line {
        border-color: hsl(60, 80%, 60%);
        height: 76px;
        width: 76px;
        top: 14px;
    }
    .loader-line-wrap:nth-child(3) .loader-line {
        border-color: hsl(120, 80%, 60%);
        height: 62px;
        width: 62px;
        top: 21px;
    }
    .loader-line-wrap:nth-child(4) .loader-line {
        border-color: hsl(180, 80%, 60%);
        height: 48px;
        width: 48px;
        top: 28px;
    }
    .loader-line-wrap:nth-child(5) .loader-line {
        border-color: hsl(240, 80%, 60%);
        height: 34px;
        width: 34px;
        top: 35px;
    }
    @keyframes spin {
        0%, 15% {
            transform: rotate(0);
        }
        100% {
            transform: rotate(360deg);
        }
    }
    
    .swiper1 {
        width: 100%;
    }
    .swiper1 .selected {
        color: #ec5566;
        border-bottom: 2px solid #ec5566;
    }
    .swiper1 .swiper-slide {
        text-align: center;
        font-size: 12px;
        height: 50px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
        cursor: pointer;
    }
    .swiper2 {
        width: 100%;
    }
    .swiper2 .swiper-slide {
        height: calc(100vh - 50px);
        background-color: #ccc;
        color: #fff;
        text-align: center;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        
    }
    
    /* -------------------------------- 
    底部菜单样式
    -------------------------------- */
    ol, ul {
        list-style: none;
    }
    a {
      color: #e84a64;
      text-decoration: none;
    }
    #cd-nav ul {
      
      position: fixed;
      /* 设置展出宽度 */
      width: 30%;
      max-width: 400px;
      right: 5%;
      bottom: 110px;
      border-radius: 0.25em;
      box-shadow: 0 0 10px rgba(232, 74, 100, 0.4);
      background: white;
      visibility: hidden;
      /* remove overflow:hidden if you want to create a drop-down menu - but then remember to fix/eliminate the list items animation */
      overflow: hidden;
      z-index: 1;
      /* Force Hardware Acceleration in WebKit */
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      -webkit-transform: scale(0);
      -moz-transform: scale(0);
      -ms-transform: scale(0);
      -o-transform: scale(0);
      transform: scale(0);
      -webkit-transform-origin: 100% 100%;
      -moz-transform-origin: 100% 100%;
      -ms-transform-origin: 100% 100%;
      -o-transform-origin: 100% 100%;
      transform-origin: 100% 100%;
      -webkit-transition: -webkit-transform 0.3s, visibility 0s 0.3s;
      -moz-transition: -moz-transform 0.3s, visibility 0s 0.3s;
      transition: transform 0.3s, visibility 0s 0.3s;
    }
    #cd-nav ul li {
      /* Force Hardware Acceleration in WebKit */
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
    }
    #cd-nav ul.is-visible {
    
      /* 去掉默认的内边距 */
      list-style-type: none;
      padding: 0; 
      margin: 0;
    
      visibility: visible;
      -webkit-transform: scale(1);
      -moz-transform: scale(1);
      -ms-transform: scale(1);
      -o-transform: scale(1);
      transform: scale(1);
      -webkit-transition: -webkit-transform 0.3s, visibility 0s 0s;
      -moz-transition: -moz-transform 0.3s, visibility 0s 0s;
      transition: transform 0.3s, visibility 0s 0s;
    }
    #cd-nav ul.is-visible li:nth-child(1) {
      /* list items animation */
      -webkit-animation: cd-slide-in 0.2s;
      -moz-animation: cd-slide-in 0.2s;
      animation: cd-slide-in 0.2s;
    }
    #cd-nav ul.is-visible li:nth-child(2) {
      -webkit-animation: cd-slide-in 0.3s;
      -moz-animation: cd-slide-in 0.3s;
      animation: cd-slide-in 0.3s;
    }
    #cd-nav ul.is-visible li:nth-child(3) {
      -webkit-animation: cd-slide-in 0.4s;
      -moz-animation: cd-slide-in 0.4s;
      animation: cd-slide-in 0.4s;
    }
    #cd-nav ul.is-visible li:nth-child(4) {
      -webkit-animation: cd-slide-in 0.5s;
      -moz-animation: cd-slide-in 0.5s;
      animation: cd-slide-in 0.5s;
    }
    #cd-nav ul.is-visible li:nth-child(5) {
      -webkit-animation: cd-slide-in 0.6s;
      -moz-animation: cd-slide-in 0.6s;
      animation: cd-slide-in 0.6s;
    }
    #cd-nav li a {
      display: block;
      font-size: 15px;
      padding: 0.5em;
      border-bottom: 1px solid #eff2f6;
    }
    #cd-nav li:last-child a {
      border-bottom: none;
    }
    @media only screen and (min-width: 1170px) {
      #cd-nav ul {
        /* the navigation moves to the top */
        position: absolute;
        width: auto;
        max-width: none;
        bottom: auto;
        top: 36px;
        background: transparent;
        visibility: visible;
        box-shadow: none;
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -ms-transform: scale(1);
        -o-transform: scale(1);
        transform: scale(1);
        -webkit-transition: all 0s;
        -moz-transition: all 0s;
        transition: all 0s;
      }
      #cd-nav li {
        display: inline-block;
      }
      #cd-nav li a {
        opacity: 1;
        padding: .1em;
        margin-left: 1.6em;
        border-bottom: none;
      }
      #cd-nav li a:hover {
        color: #00bd9b;
      }
      #cd-nav.is-fixed ul {
        /* when the user scrolls down, the navigation moves to the bottom right in Fixed position - as on touch devices */
        position: fixed;
        width: 90%;
        max-width: 400px;
        bottom: 20px;
        top: auto;
        background: white;
        visibility: hidden;
        box-shadow: 0 0 10px rgba(232, 74, 100, 0.4);
        -webkit-transform: scale(0);
        -moz-transform: scale(0);
        -ms-transform: scale(0);
        -o-transform: scale(0);
        transform: scale(0);
      }
      #cd-nav.is-fixed ul li {
        display: block;
      }
      #cd-nav.is-fixed ul li a {
        padding: 1.6em;
        margin-left: 0;
        border-bottom: 1px solid #eff2f6;
      }
      #cd-nav ul.has-transitions {
        /* this class is used to bring back transitions when the navigation moves at the bottom right */
        -webkit-transition: -webkit-transform 0.3s, visibility 0s 0.3s;
        -moz-transition: -moz-transform 0.3s, visibility 0s 0.3s;
        transition: transform 0.3s, visibility 0s 0.3s;
      }
      #cd-nav ul.is-visible {
        /* this class is used to bring back the navigation animation - as on touch devices */
        visibility: visible;
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -ms-transform: scale(1);
        -o-transform: scale(1);
        transform: scale(1);
        -webkit-transition: -webkit-transform 0.3s, visibility 0s 0s;
        -moz-transition: -moz-transform 0.3s, visibility 0s 0s;
        transition: transform 0.3s, visibility 0s 0s;
      }
      #cd-nav ul.is-hidden {
        /* this class is used to animate the scale down the navigation when the user scrolls down with the navigation still open */
        -webkit-transform: scale(0);
        -moz-transform: scale(0);
        -ms-transform: scale(0);
        -o-transform: scale(0);
        transform: scale(0);
        -webkit-transition: -webkit-transform 0.3s;
        -moz-transition: -moz-transform 0.3s;
        transition: transform 0.3s;
      }
    }
    
    .cd-nav-trigger {
      position: fixed;
      bottom: 60px;
      right: 5%;
      width: 44px;
      height: 44px;
      background: white;
      border-radius: 0.25em;
      box-shadow: 0 0 10px rgba(232, 74, 100, 0.4);
      /* image replacement */
      overflow: hidden;
      text-indent: 100%;
      white-space: nowrap;
      z-index: 2;
    }
    .cd-nav-trigger span {
      /* the span element is used to create the menu icon */
      position: absolute;
      display: block;
      width: 20px;
      height: 2px;
      background: #e84a64;
      top: 50%;
      margin-top: -1px;
      left: 50%;
      margin-left: -10px;
      -webkit-transition: background 0.3s;
      -moz-transition: background 0.3s;
      transition: background 0.3s;
    }
    .cd-nav-trigger span::before, .cd-nav-trigger span::after {
      content: '';
      position: absolute;
      left: 0;
      background: inherit;
      width: 100%;
      height: 100%;
      /* Force Hardware Acceleration in WebKit */
      -webkit-transform: translateZ(0);
      -moz-transform: translateZ(0);
      -ms-transform: translateZ(0);
      -o-transform: translateZ(0);
      transform: translateZ(0);
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      -webkit-transition: -webkit-transform 0.3s, background 0s;
      -moz-transition: -moz-transform 0.3s, background 0s;
      transition: transform 0.3s, background 0s;
    }
    .cd-nav-trigger span::before {
      top: -6px;
      -webkit-transform: rotate(0);
      -moz-transform: rotate(0);
      -ms-transform: rotate(0);
      -o-transform: rotate(0);
      transform: rotate(0);
    }
    .cd-nav-trigger span::after {
      bottom: -6px;
      -webkit-transform: rotate(0);
      -moz-transform: rotate(0);
      -ms-transform: rotate(0);
      -o-transform: rotate(0);
      transform: rotate(0);
    }
    .cd-nav-trigger.menu-is-open {
      box-shadow: none;
    }
    .cd-nav-trigger.menu-is-open span {
      background: rgba(232, 74, 100, 0);
    }
    .cd-nav-trigger.menu-is-open span::before, .cd-nav-trigger.menu-is-open span::after {
      background: #e84a64;
    }
    .cd-nav-trigger.menu-is-open span::before {
      top: 0;
      -webkit-transform: rotate(135deg);
      -moz-transform: rotate(135deg);
      -ms-transform: rotate(135deg);
      -o-transform: rotate(135deg);
      transform: rotate(135deg);
    }
    .cd-nav-trigger.menu-is-open span::after {
      bottom: 0;
      -webkit-transform: rotate(225deg);
      -moz-transform: rotate(225deg);
      -ms-transform: rotate(225deg);
      -o-transform: rotate(225deg);
      transform: rotate(225deg);
    }
    @media only screen and (min-width: 1170px) {
      .cd-nav-trigger {
        /* the the menu triger is hidden by default on desktop devices */
        visibility: hidden;
        -webkit-transform: scale(0);
        -moz-transform: scale(0);
        -ms-transform: scale(0);
        -o-transform: scale(0);
        transform: scale(0);
        -webkit-transition: -webkit-transform 0.3s, visibility 0s 0.3s;
        -moz-transition: -moz-transform 0.3s, visibility 0s 0.3s;
        transition: transform 0.3s, visibility 0s 0.3s;
      }
      .is-fixed .cd-nav-trigger {
        visibility: visible;
        -webkit-transition: all 0s;
        -moz-transition: all 0s;
        transition: all 0s;
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -ms-transform: scale(1);
        -o-transform: scale(1);
        transform: scale(1);
        -webkit-animation: cd-bounce-in 0.3s linear;
        -moz-animation: cd-bounce-in 0.3s linear;
        animation: cd-bounce-in 0.3s linear;
      }
    }
    
    #cd-gallery-items li {
      margin-bottom: 1.5em;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
      border-radius: 0.25em;
    }
    #cd-gallery-items li img {
      width: 100%;
      display: block;
      border-radius: 0.25em;
    }
    @media only screen and (min-width: 768px) {
      #cd-gallery-items li {
        width: 48%;
        float: left;
        margin-bottom: 2em;
        margin-right: 4%;
      }
      #cd-gallery-items li:nth-child(2n) {
        margin-right: 0;
      }
    }
    @media only screen and (min-width: 1170px) {
      #cd-gallery-items li {
        width: 31%;
        float: left;
        margin-bottom: 2.5em;
        margin-right: 3.5%;
      }
      #cd-gallery-items li:nth-child(2n) {
        margin-right: 3.5%;
      }
      #cd-gallery-items li:nth-child(3n) {
        margin-right: 0;
      }
    }
    
    @-webkit-keyframes cd-slide-in {
      0% {
        -webkit-transform: translateX(100px);
      }
    
      100% {
        -webkit-transform: translateY(0);
      }
    }
    @-moz-keyframes cd-slide-in {
      0% {
        -moz-transform: translateX(100px);
      }
    
      100% {
        -moz-transform: translateY(0);
      }
    }
    @keyframes cd-slide-in {
      0% {
        -webkit-transform: translateX(100px);
        -moz-transform: translateX(100px);
        -ms-transform: translateX(100px);
        -o-transform: translateX(100px);
        transform: translateX(100px);
      }
    
      100% {
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        -ms-transform: translateY(0);
        -o-transform: translateY(0);
        transform: translateY(0);
      }
    }
    @-webkit-keyframes cd-bounce-in {
      0% {
        -webkit-transform: scale(0);
      }
    
      60% {
        -webkit-transform: scale(1.2);
      }
    
      100% {
        -webkit-transform: scale(1);
      }
    }
    @-moz-keyframes cd-bounce-in {
      0% {
        -moz-transform: scale(0);
      }
    
      60% {
        -moz-transform: scale(1.2);
      }
    
      100% {
        -moz-transform: scale(1);
      }
    }
    @keyframes cd-bounce-in {
      0% {
        -webkit-transform: scale(0);
        -moz-transform: scale(0);
        -ms-transform: scale(0);
        -o-transform: scale(0);
        transform: scale(0);
      }
    
      60% {
        -webkit-transform: scale(1.2);
        -moz-transform: scale(1.2);
        -ms-transform: scale(1.2);
        -o-transform: scale(1.2);
        transform: scale(1.2);
      }
    
      100% {
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -ms-transform: scale(1);
        -o-transform: scale(1);
        transform: scale(1);
      }
    }

    /* -------------------------------- 
    底部选项弹出菜单
    -------------------------------- */
      .bottom-menu {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
       /* 白色背景 */
        color: #333;
       /* 深色文本 */
        text-align: center;
        padding: 10px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out, visibility 0s linear 0.3s, opacity 0.3s;
        z-index: 7777;
      }
      
      .bottom-menu.active {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
      }
      
      .bottom-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
      }
      
      .bottom-menu ul li {
        padding: 10px 20px;
        cursor: pointer;
        transition: background-color 0.3s ease-in-out;
      }
      
      .bottom-menu ul li:hover {
        background-color: #f4f4f4;
       /* 浅灰色背景 */
      }
      
      .bottom-menu ul li a {
        color: #333;
       /* 深色文本链接 */
        text-decoration: none;
      }
      
      .bottom-menu::before,
      .bottom-menu::after {
        content: none;
      }
      
      .bottom-menu::before {
        border-bottom-color: #fff;
       /* 白色伪元素 */
      }
      
      .bottom-menu::after {
        border-top-color: #fff;
       /* 白色伪元素 */
      }
      
      .bottom-menu.active::before {
        border-bottom-color: #f4f4f4;
       /* 浅灰色伪元素 */
      }
      
      .bottom-menu.active::after {
        border-top-color: #f4f4f4;
       /* 浅灰色伪元素 */
      }
      
      .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 7776;
      }
      
      .show {
        display: flex;
      }
      
      .overlay.show {
        display: block;
      }
      
      /* 移动端适配 */
      @media (max-width: 768px) {
        .bottom-menu {
          position: fixed;
          transform: translateY(100%);
        }
      }
      
      /* 电脑端适配 */
      @media (min-width: 769px) {
        .bottom-menu {
          position: absolute;
        }
      }
    
    /* -------------------------------- 
    弹出选项悬浮窗
    -------------------------------- */
    .modalfloat button {
          background-color: #007bff;
          color: white;
          border: none;
          padding: 10px 20px;
          border-radius: 5px;
          cursor: pointer;
          font-size: 15px;
          display: block;
          margin: 0 auto;
      }
      .modalfloat button:hover {
          background-color: #0056b3;
      }
      .modalfloat {
          display: none; 
          position: fixed; 
          z-index: 9999; 
          left: 0;
          top: 0;
          width: 100%; 
          height: 100%; 
          background-color: rgba(0,0,0,0.7); 
      }

    
      /* margin: 70% auto;  */
      .modalfloat .modal-content {
          background-color: #fff;
          position: relative;
          margin: 10% auto;
          top: 200px;
          padding: 20px;
          border: 1px solid #888;
          width: 50%; 
          max-width: 400px;
          border-radius: 10px;
          box-shadow: 0 4px 8px rgba(0,0,0,0.2);
      }
    
      
      .modalfloat .modal-content h3 {
        font-size: 12px;
        text-align: center;
        color: #333;
      }
    
      .modalfloat .close {
          color: #aaa;
          float: right;
          font-size: 28px;
          font-weight: bold;
          margin-top: -20px;
          margin-right: -10px;
      }
      .modalfloat .close:hover,
      .modalfloat .close:focus {
          color: black;
          text-decoration: none;
          cursor: pointer;
      }
      .modalfloat label {
          display: block;
          margin: 10px 0;
          font-size: 15px;
      }
      .modalfloat input[type="checkbox"] {
          margin-right: 10px;
      }
      .modalfloat button[type="submit"] {
          background-color: #28a745;
          margin-top: 20px;
          width: 100%;
      }
      .modalfloat button[type="submit"]:hover {
          background-color: #218838;
      }
    

      .modalfloat select{
          width: 100%;
          padding: 10px;
          margin: 10px 0;
          border: 1px solid #ccc;
          border-radius: 4px;
          font-size: 14px;
          }
          
    .modalfloat input[type="text"] {
          width: 100%;
          padding: 10px;
          margin: 10px 0;
          border: 1px solid #ccc;
          border-radius: 4px;
          font-size: 14px;
          box-sizing: border-box;
      }
    

    /* -------------------------------- 
    预约进度条样式
    -------------------------------- */

    .progress-float {
          display: none; 
          position: fixed; 
          z-index: 9999; 
          left: 0;
          top: 0;
          width: 100%; 
          height: 100%; 
          background-color: rgba(0,0,0,0.7); 
      }

        /* 进度条容器样式 */
        .progress-container {
            position: relative; /* 确保子元素（关闭按钮）相对于容器定位 */
            width: 60%; 
            top: 300px;
            left: 15%; 
            max-width: 400px; /* 设置最大宽度，避免过大 */
            background-color: #e0e0e0; /* 灰色背景 */
            border-radius: 10px; /* 圆角让元素更柔和 */
            box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
            padding: 15px 20px; /* 内边距 */
            text-align: center; /* 中心对齐文字 */ 
        }
        /* 标题样式 */
        .progress-title {
            font-size: 14px;
            font-weight: bold;
            color: #333; /* 深灰色字体 */
            /* margin-bottom: 10px; */
        }
        /* 标题样式 */
        .progress-subtitle {
            font-size: 10px;
            font-weight: bold;
            color: #333; /* 深灰色字体 */
            margin-bottom: 10px;
        }
        /* 具体的进度条 */
        .progress-bar-container {
            width: 100%; /* 占满容器宽度 */
            background-color: #f1f1f1; /* 灰色背景条 */
            height: 20px; /* 高度设置为 20px */
            border-radius: 10px; /* 圆角风格 */
            overflow: hidden; /* 防止溢出 */
        }
        .progress-bar {
            height: 100%; /* 填充整个背景条的高度 */
            width: 0%; /* 初始宽度为0 */
            background: linear-gradient(90deg, #4caf50, #81c784); /* 渐变绿色 */
            border-radius: inherit; /* 继承父容器的圆角 */
            transition: width 0.4s ease; /* 进度平滑动画 */
        }
        /* 百分比文字 */
        .progress-text {
            margin-top: 10px;
            font-size: 14px;
            color: #666; /* 字体颜色 */
        }

        /* 关闭按钮样式 */
        .close-button {
          color: #aaa;
          float: right;
          font-size: 28px;
          font-weight: bold;
          margin-top: -20px;
          margin-right: -10px;
      }
      .close-button:hover,
      .close-button:focus {
          color: black;
          text-decoration: none;
          cursor: pointer;
      }



    /* -------------------------------- 
    快递轨迹
    -------------------------------- */
      .express-float {
          display: none; 
          position: fixed; 
          z-index: 9999; 
          left: 0;
          top: 0;
          width: 100%; 
          height: 100%; 
          background-color: rgba(0,0,0,0.7); 
      	}

        .express-container {
            position: fixed;
            right: 5%;
            top: 50%;
            transform: translateY(-50%);
            width: 90%;
            height: 80%;
            background: white;
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            z-index: 1000;
        }

        .express-header {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .express-header h2 {
            margin: 0;
            font-size: 14px;
            display: flex;
            align-items: center;}

        .express-header i {
            margin-right: 10px;
        }

        .express-body {
            flex-grow: 1;
            overflow-y: auto;
            padding: 5px;
            position: relative;
        }

        .express-body::-webkit-scrollbar {
            width: 6px;
        }

        .express-body::-webkit-scrollbar-track {
            background: transparent;
        }

        .express-body::-webkit-scrollbar-thumb {
            background-color: rgba(0,0,0,0.2);
            border-radius: 3px;
        }

        .trace-item {
            background: #f9f9f9;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
            position: relative;
        }

        .trace-item:hover {
            transform: scale(1.02);
            box-shadow: 0 6px 15px rgba(0,0,0,0.1);
        }

        .trace-time {
            color: #888;
            font-size: 12px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
        }

        .trace-time i {
            margin-right: 8px;
            color: #2575fc;
        }

        .trace-name {
            font-weight: bold;
            color: #333;
            margin-bottom: 5px;
            font-size: 14px;
        }

        .trace-desc {
            color: #666;
            font-size: 13px;
        }

        .trace-location {
            color: #888;
            font-size: 12px;
            margin-top: 8px;display: flex;
            align-items: center;
        }

        .trace-location i {
            margin-right: 8px;
            color: #2575fc;
        }

        .status-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            padding: 3px 8px;
            border-radius: 20px;
            font-size: 12px;
        }

        .status-processing {
            background-color: #1890ff;
            color: white;
        }

        .status-completed {
            background-color: #52c41a;
            color: white;
        }

        .express-float .close {
          color: #aaa;
          float: right;
          font-size: 25px;
          font-weight: bold;
        }
        .express-float .close:hover,
        .express-float .close:focus {
            color: black;
            text-decoration: none;
            cursor: pointer;
        }

        .exchange-badge {
            position: absolute;
            left: 100px;
            padding: 3px 8px;
            border-radius: 5px;
            font-size: 10px;
            background-color: #1890ff7a;
            color: white;
        }


          /* -------------------------------- 
            重写swal样式
          -------------------------------- */

        /* .sweet-alert p {
            color: #797979;
            font-size: 14px;
            text-align: center;
            font-weight: 300;
            position: relative;
            text-align: inherit;
            float: none;
            margin: 0;
            padding: 0;
            line-height: normal
          }
        
          .sweet-alert {
            background-color: white;
            padding: 5px;
            width: 70%;
            margin-left: 9%;
            border-radius: 5px;
            text-align: center;
            position: fixed;
            overflow: hidden;
            display: none;
            z-index: 99999
          }
          .sweet-alert button {
            background-color: #8cd4f5;
            color: white;
            border: 0;
            box-shadow: none;
            font-size: 14px;
            -webkit-border-radius: 4px;
            border-radius: 5px;
            padding: 10px 32px;
            margin: 5px;
            cursor: pointer
          }
          .sweet-alert fieldset {
            border: 0;
            position: relative;
            display: none;
          } */

    /*底部导航栏*/
    .footerdhl_f{width:100%;height:52px;background:#fff;border-top:1px solid #3DB1FA;position:fixed;bottom:0;left:0;overflow:hidden}
    .footerdhl_f a{display:block; width:25%;height:46px;float:left; margin-top:6px;}
    .footerdhl_f a b{display:block; width:22px;height:22px;overflow:hidden; margin:0 auto;}
    .footerdhl_f a b img{display:block; width:22px;height:44px;}
    .footerdhl_f a b.movek_f img{ margin-top:-22px;}
    .footerdhl_f a p{margin:0;display:block; width:100%;height:24px; line-height:24px; font-size:14px; text-align:center;color:#868689;}
</style>
    
</head>
    
    <body>
    <!-- 等待效果组件 -->
    <div class="loader" id="toast">
      <div class="loader-inner">
        <div class="loader-line-wrap">
          <div class="loader-line"></div>
        </div>
        <div class="loader-line-wrap">
          <div class="loader-line"></div>
        </div>
        <div class="loader-line-wrap">
          <div class="loader-line"></div>
        </div>
        <div class="loader-line-wrap">
          <div class="loader-line"></div>
        </div>
        <div class="loader-line-wrap">
          <div class="loader-line"></div>
        </div>
        <p>处理中</p>
      </div>
    </div>
    
    <!-- 顶部标签栏 -->
    <div class="swiper-container swiper1">
      <div class="swiper-wrapper">
        <div class="swiper-slide selected" id="finsh">已下段</div>
        <div class="swiper-slide" id="unfeedback">未反馈</div>
        <div class="swiper-slide" id="feeded">已妥投</div>
        <div class="swiper-slide" id="unfeed">未妥投</div>
        <div class="swiper-slide" id="Standard">标准快递</div>
        <div class="swiper-slide" id="Ordinary">快递包裹</div>
        <div class="swiper-slide" id="E-commerce">电商标快</div>
        <div class="swiper-slide" id="Other">其他邮件</div>
      </div>
    </div>

    <!-- 底部上页-下页标签栏 -->
    <div class="container" id="text-container"></div>

    <div id="card-container" class="card-container">

    <!-- 标准快递 -->
    <div class="category">
        <div class="category-header" onclick="toggleCategory(this)">
            <h2>标准快递 <span class="badge">2个包裹</span></h2>
            <span class="arrow">▼</span>
        </div>
        <div id="Standard-badge" class="category-content">

          
        </div>
       
    </div>

    <!-- 快递包裹 -->
    <div class="category">
      <div class="category-header" onclick="toggleCategory(this)">
          <h2>快递包裹 <span class="badge">2个包裹</span></h2>
          <span class="arrow">▼</span>
      </div>
      <div id="Express-badge" class="category-content">

        
      </div>
    </div>

    <!-- 电商标快 -->
    <div class="category">
      <div class="category-header" onclick="toggleCategory(this)">
          <h2>电商标快 <span class="badge">2个包裹</span></h2>
          <span class="arrow">▼</span>
      </div>
      <div id="Quick-badge" class="category-content">

        
      </div>
    </div>

    <!-- 其他邮件 -->
    <div class="category">
      <div class="category-header" onclick="toggleCategory(this)">
          <h2>其他邮件 <span class="badge">2个包裹</span></h2>
          <span class="arrow">▼</span>
      </div>
      <div id="Other-badge" class="category-content">

      </div>
    </div>

  </div>


    <div id="prev-next" class="pagination">
      <button id="prevBtn">上一页</button>
      <span id="pageInfo"></span>
      <button id="nextBtn">下一页</button>
    </div>

    </div>

    
    
    <div style="height: 50px;"></div>
    
    
    
    <!-- 弹出选项卡 -->
    <div id="myModal1" class="modalfloat">
      <div class="modal-content">
          <span id="myModalclose1" class="close">&times;</span>
          <h3></h3>
          <form id="optionsForm">
              <div id="optionsContainer"></div> <!-- 用于放置动态生成的选项 -->
              <button type="submit">确定</button>
          </form>
      </div>
    </div>
    

     <!-- 妥投选项卡 -->
    <div id="myModal2" class="modalfloat">
      <div class="modal-content">
          <span id="myModalclose2" class="close">&times;</span>
          <h3>妥投类型</h3>
          <form id="SignForm">
              <!-- 第一个选项 -->
              <select id="option1" onchange="toggleFields()">
                  <option value="self">本人签收</option>
                  <option value="other">他人签收</option>
                  <option value="unity">单位收发室</option>
                  <option value="Management">物业代收</option>
                  <option value="PostStation">村邮站签收</option>
                  <option value="Self_pickuppoint">自提点签收</option>
                  <option value="PackageCabinet">包裹柜签收</option>
              </select>
          
               <!-- 输入框，默认隐藏 -->
               <div id="input-container">
                  <input type="text" id="inputField" placeholder="请输入签收人">
               </div>
           
              <!-- 第二个选项，默认隐藏 -->
              <div id="option2-container">
                  <select id="option2">
                  </select>
              </div>
          
              <button type="submit">提交</button>
          </form>
      </div>
    </div>
    
    <!-- 预约进度条 -->
    <div id="progress-float" class="progress-float">
      <div class="progress-container" id="progress-container">
        <span id="close-button" class="close-button">&times;</span>
        <div class="progress-title">初始化中</div>
        <div class="progress-subtitle"></div>
        <div class="progress-bar-container">
            <div class="progress-bar" id="progress-bar"></div>
        </div>
        <div class="progress-text" id="progress-text">0%</div>
      </div>
    </div>

    <!-- 快递轨迹 -->
    <div id="express-float" class="express-float">
    	<div class="express-container">
    	    <div class="express-header">
    	        <h2>🚚 快递轨迹 </h2>  <span id="exchange-badge" class="exchange-badge">切换</span>  <span id="expressclose" class="close">&times;</span>
    	    </div>
    	    <div class="express-header" style="background: #f4f4f4; color: #333; font-size: 14px;">
    	        <span id="expressInfo"></span>
    	    </div>
    	    <div id="expressTraces" class="express-body"></div>
    	</div>
  </div>
  
    <!-- 底部菜单栏 -->
    <div id="cd-nav">
      <a href="javascript:void(0)" class="cd-nav-trigger"><span></span></a>
      <nav id="cd-main-nav">
        <ul>
          <li><a href="javascript:void(0)" onclick="find()">搜索订单</a></li>
          <li><a href="javascript:void(0)" onclick='Set_Call("1")'>批量预约</a></li>
          <li><a href="javascript:void(0)" onclick='Set_Call("0")'>批量重约</a></li>
          <li><a href="javascript:void(0)" onclick="Set_Tomorrowfeed()">批量再投</a></li>
          <li><a href="javascript:void(0)" onclick="Set_sign()">批量签收</a></li>
          <li><a href="javascript:void(0)" onclick="checkprogress()">查询进度</a></li>
          </ul>
      </nav>
    </div>
    
    <!--底部导航栏-->
    <div class="footerdhl_f">
        <a id="yy-link" href="">
            <b class="movek_f"><img src="./statics/images/yy.png"/></b>
            <p>预约</p>
        </a>
        <a id="dk-link" href="">
            <b><img src="./statics/images/dk.png"/></b>
            <p>打卡</p>
        </a>
        <a id="xd-link" href="">
            <b><img src="./statics/images/hc.png"/></b>
            <p>下段</p>
        </a>
        <a id="gr-link" href="">
            <b><img src="./statics/images/gr.png"/></b>
            <p>个人</p>
        </a>
    </div>
    
    </body>
    
    
    <script>
    let iv = "2134123412ABCDEF";
    let secret_key = "BACDEF1234123412";
    function parse(string) {
      return CryptoJS.enc.Utf8.parse(string);
    }
    function decrypt(code) {
      return CryptoJS.AES.decrypt(code, parse(secret_key), {
        iv: parse(iv),
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
      }).toString(CryptoJS.enc.Utf8);
    }
    function encrypt(data) {
      // Encrypt   
      return CryptoJS.AES.encrypt(parse(data), parse(secret_key), {
        iv: parse(iv),
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
      }).toString();
    }
    //查看ID是否合规，不符合即404
    function GetQueryString(name) {
      // 获取当前网页链接str
      var LocString = String(window.document.location.href);
      var rs = new RegExp("(^|)" + name + "=([^&]*)(&|$)", "gi").exec(LocString), tmp;
      if (tmp = rs) {
        return decodeURI(tmp[2]);
      }
      return "";
    }
    function isValidJsonObject(jsonObj) {
      // 确保输入是一个对象且不是 null
      if (jsonObj && typeof jsonObj === 'object') {
        // 获取对象的键数组
        const keys = Object.keys(jsonObj);
        // 检查对象是否有键，并且键的数量大于1
        return keys.length > 0;
      }
      // 处理非对象或 null 的情况
      return false;
    }
    function isValidJSON(str) {
      try {
        JSON.parse(str);
      } catch (error) {
        return false;
      }
      return true;
    }
    
    
    
    
    
    
    
    
    const cardsPerPage = 20;
    let currentPage = 1;
    
    var 当前页面数组 = []
    var 已下段数组 = []
    var 已妥投数组 = []
    var 未反馈数组 = []
    var 未妥投数组 = []
    var 标准快递数组 = []
    var 快递包裹数组 = []
    var 电商标快数组 = []
    var 其他邮件数组 = []
    
    var 当前勾选合集 = []
    
    var 订单信息 = ''
    var 已下段总数 = 0
    var 未妥投总数 = 0
    var 已妥投总数 = 0
    var 未反馈总数 = 0
    var 标准快递总数 = 0
    var 快递包裹总数 = 0
    var 电商标快总数 = 0
    var 其他邮件总数 = 0
    
    
    var id_en = GetQueryString('id')
    
    
    document.getElementById('yy-link').href = './call?id=' + encodeURIComponent(id_en);
    document.getElementById('dk-link').href = './sign?id=' + encodeURIComponent(id_en);
    document.getElementById('xd-link').href = './scan?id=' + encodeURIComponent(id_en);
    document.getElementById('gr-link').href = './info?id=' + encodeURIComponent(id_en);
    
    // var id = decrypt(decodeURIComponent(id_en));
    var httpRequest = new XMLHttpRequest();
    toast.style.display = "flex";
    httpRequest.open('GET', './zy_login_check?id=' + encodeURIComponent(id_en), true);
    httpRequest.send();
    httpRequest.onreadystatechange = function () {
      if (httpRequest.readyState == 4) {// 请求已完成
        if (httpRequest.status === 200) { // 请求成功
          var 凭证 = httpRequest.responseText;
          if ((凭证 || "").indexOf('有效') > -1) {
            httpRequest.open('GET', './zy_info?id=' + encodeURIComponent(id_en), true);
            // 设置请求头，确保 Accept-Encoding 包含 gzip
            // httpRequest.setRequestHeader('Accept-Encoding', 'gzip');
            httpRequest.send();
            httpRequest.onreadystatechange = function () {
              if (httpRequest.readyState == 4) {
                      toast.style.display = "none";
                if (httpRequest.status == 200) {
    
                  订单信息 = httpRequest.responseText;
                  
                  var 数组 ={};
                  if (isValidJSON(订单信息)) {
                    数组 = JSON.parse(订单信息);
                    if (isValidJsonObject(数组)) {
                      var cardcontainer = document.getElementById("prev-next");
                      cardcontainer.style.display = 'flex';
                    }
                  } else {
                    var textContainer = document.getElementById('text-container');
                    textContainer.textContent = 订单信息; //"暂无订单信息！"
                      
                    var cardcontainer = document.getElementById("prev-next");
                    cardcontainer.style.display = 'none';
                  }
                  
    
                        //已下段分类订单，优先显示未电话预约的
                  for (var 订单号 in 数组) {
                    if (数组[订单号].manOutCall == "") {
                      已下段总数 = 已下段总数 + 1
                      var 单体信息 = {
                        No: 数组[订单号].waybillNo,
                        receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                        waybillNo: `[${已下段总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                        status: "未电联"
                      }
                      已下段数组.push(单体信息)
                    }
                  }
    
                  for (var 订单号 in 数组) {
                    if (数组[订单号].manOutCall !== "") {
                      已下段总数 = 已下段总数 + 1
                      var 单体信息 = {
                        No: 数组[订单号].waybillNo,
                        receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                        waybillNo: `[${已下段总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                        status: 数组[订单号].manOutCall
                      }
                      已下段数组.push(单体信息)
                    }
                  }
                  var textContainer = document.getElementById('finsh');
                  textContainer.innerHTML = "已下段<br>("+已下段数组.length+")";
    
                  //已妥投分类订单
                  for (var 订单号 in 数组) {
                    if (数组[订单号].dlvState == "1") {
                      已妥投总数 = 已妥投总数 + 1
                      var 单体信息 = {
                        No: 数组[订单号].waybillNo,
                        receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                        waybillNo: `[${已妥投总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                        status: 数组[订单号].manOutCall
                      }
                      已妥投数组.push(单体信息)
                    }
                  }
                  var textContainer = document.getElementById('feeded');
                  textContainer.innerHTML = "已妥投<br>("+已妥投数组.length+")";
    
                  //未妥投分类订单
                  for (var 订单号 in 数组) {
                    if (数组[订单号].dlvState == "0") {
                      //优先显示未预约
                      if (数组[订单号].manOutCall == "") {
                        未妥投总数 = 未妥投总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${未妥投总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: "未电联"
                        }
                        未妥投数组.push(单体信息)
                      }
                    }
                  }
    
                  for (var 订单号 in 数组) {
                    if (数组[订单号].dlvState == "0") {
                      if (数组[订单号].manOutCall !== "") {
                        未妥投总数 = 未妥投总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${未妥投总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: 数组[订单号].manOutCall
                        }
                        未妥投数组.push(单体信息)
                      }
                    }
                  }
                  var textContainer = document.getElementById('unfeed');
                  textContainer.innerHTML = "未妥投<br>("+未妥投数组.length+")";
    
                  //未反馈分类订单
                  for (var 订单号 in 数组) {
                    if (数组[订单号].dlvState == "2") {
                      //优先显示未预约
                      if (数组[订单号].manOutCall == "") {
                        未反馈总数 = 未反馈总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${未反馈总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: "未电联"
                        }
                        未反馈数组.push(单体信息)
                      }
                    }
                  }
    
                  for (var 订单号 in 数组) {
                    if (数组[订单号].dlvState == "2") {
                      if (数组[订单号].manOutCall !== "") {
                        未反馈总数 = 未反馈总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${未反馈总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: 数组[订单号].manOutCall
                        }
                        未反馈数组.push(单体信息)
                      }
                    }
                  }
                  var textContainer = document.getElementById('unfeedback');
                  textContainer.innerHTML = "未反馈<br>("+未反馈数组.length+")";
    
    
                  //标准快递分类订单
                  for (var 订单号 in 数组) {
                    if ((数组[订单号].waybillNo).startsWith("1")) {
                      if (数组[订单号].manOutCall == "") {
                        标准快递总数 = 标准快递总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${标准快递总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: "未电联"
                        }
                        标准快递数组.push(单体信息)
                      }
                    }
                  }
    
                  for (var 订单号 in 数组) {
                    if ((数组[订单号].waybillNo).startsWith("1")) {
                      if (数组[订单号].manOutCall !== "") {
                        标准快递总数 = 标准快递总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${标准快递总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: 数组[订单号].manOutCall
                        }
                        标准快递数组.push(单体信息)
                      }
                    }
                  }
                  var textContainer = document.getElementById('Standard');
                  textContainer.innerHTML = "标准快递<br>("+标准快递数组.length+")";
    
    
                  //快递包裹分类订单
                  for (var 订单号 in 数组) {
                    if ((数组[订单号].waybillNo).startsWith("9")) {
                      if (数组[订单号].manOutCall == "") {
                        快递包裹总数 = 快递包裹总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${快递包裹总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: "未电联"
                        }
                        快递包裹数组.push(单体信息)
                      }
                    }
                  }
    
                  for (var 订单号 in 数组) {
                    if ((数组[订单号].waybillNo).startsWith("9")) {
                      if (数组[订单号].manOutCall !== "") {
                        快递包裹总数 = 快递包裹总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${快递包裹总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: 数组[订单号].manOutCall
                        }
                        快递包裹数组.push(单体信息)
                      }
                    }
                  }
                  var textContainer = document.getElementById('Ordinary');
                  textContainer.innerHTML = "快递包裹<br>("+快递包裹数组.length+")";
    
    
                  //电商标快分类订单
                  for (var 订单号 in 数组) {
                    if ((数组[订单号].waybillNo).startsWith("8")) {
                      if (数组[订单号].manOutCall == "") {
                        电商标快总数 = 电商标快总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${电商标快总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: "未电联"
                        }
                        电商标快数组.push(单体信息)
                      }
                    }
                  }
    
                  for (var 订单号 in 数组) {
                    if ((数组[订单号].waybillNo).startsWith("8")) {
                      if (数组[订单号].manOutCall !== "") {
                        电商标快总数 = 电商标快总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${电商标快总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: 数组[订单号].manOutCall
                        }
                        电商标快数组.push(单体信息)
                      }
                    }
                  }
    
    
                  var textContainer = document.getElementById('E-commerce');
                  textContainer.innerHTML = "电商标快<br>("+电商标快数组.length+")";
    
                  //其他邮件分类订单
                  for (var 订单号 in 数组) {
                    if (!(数组[订单号].waybillNo).startsWith("1") && !(数组[订单号].waybillNo).startsWith("9") && !(数组[订单号].waybillNo).startsWith("8")) {
                      if (数组[订单号].manOutCall == "") {
                        其他邮件总数 = 其他邮件总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${其他邮件总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: "未电联"
                        }
                        其他邮件数组.push(单体信息)
                      }
                    }
                  }
    
                  for (var 订单号 in 数组) {
                    if (!(数组[订单号].waybillNo).startsWith("1") && !(数组[订单号].waybillNo).startsWith("9") && !(数组[订单号].waybillNo).startsWith("8")) {
                      if (数组[订单号].manOutCall !== "") {
                        其他邮件总数 = 其他邮件总数 + 1
                        var 单体信息 = {
                          No: 数组[订单号].waybillNo,
                          receiverAddr: `${数组[订单号].receiverAddr}&nbsp&nbsp${数组[订单号].receiverMobile}`, 
                          waybillNo: `[${其他邮件总数}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                          status: 数组[订单号].manOutCall
                        }
                        其他邮件数组.push(单体信息)
                      }
                    }
                  }
                  var textContainer = document.getElementById('Other');
                  textContainer.innerHTML = "其他邮件<br>("+其他邮件数组.length+")";
    
                  当前页面数组=已下段数组
                  
                  // 初始化显示第一页的卡片
                  displayCards(currentPage);
                }
              }
              
            };
          } else {
            toast.style.display = "none";
            window.location = './login'
            // window.location = 'https://gz.360300.xyz/?redirect=1&id='+encodeURIComponent(id_en)
          }
    
        } else {
          toast.style.display = "none";
          swal("", "网络繁忙,请重试!", "warning");
        }
      }
    };
    

    function toggleCategory(header) {
            const category = header.parentElement;
            category.classList.toggle('active');
        }

    function displayCards(page) {
      const start = (page - 1) * cardsPerPage;
      const end = start + cardsPerPage;
      const Standard_badge = document.getElementById('Standard-badge');
      Standard_badge.innerHTML = ''; // 清空当前的卡片

      const Express_badge = document.getElementById('Express-badge');
      Express_badge.innerHTML = ''; // 清空当前的卡片

      const Quick_badge = document.getElementById('Quick-badge');
      Quick_badge.innerHTML = ''; // 清空当前的卡片


      const Other_badge = document.getElementById('Other-badge');
      Other_badge.innerHTML = ''; // 清空当前的卡片


      const cardsToDisplay = 当前页面数组.slice(start, end);
    



      //没有订单
      if (cardsToDisplay.length == 0) {
        var textContainer = document.getElementById('text-container');
        textContainer.textContent = "暂无订单信息！";
        var prev_next = document.getElementById("prev-next");
        prev_next.style.display = 'none';
    
      } else {



        // const category = document.createElement('category-content');



        var textContainer = document.getElementById('text-container');
        textContainer.textContent = "";
    
        var prev_next = document.getElementById("prev-next");
        prev_next.style.display = 'flex';
    
        for (var i = 0; i < cardsToDisplay.length; i++) {

          
          const card = document.createElement('div');
          card.className = 'card';
          if (cardsToDisplay[i].status == '未电联') {
            card.innerHTML = `
            <div class="checkbox-container">
                <input type="checkbox" id="${cardsToDisplay[i].No}" class="custom-checkbox" onchange="checkboxClicked('${cardsToDisplay[i].No}')" />
                <label for="${cardsToDisplay[i].No}"></label>
            </div>
            <h2>${cardsToDisplay[i].waybillNo}</h2>
            <p class="receiverAddr" style="font-size: 15px;">地址: &nbsp${cardsToDisplay[i].receiverAddr}</p>
            <p class="status">状态: &nbsp<font color="red">${cardsToDisplay[i].status}</font></p>
            <a href="javascript:void(0)" onclick="waybillNo_action('${cardsToDisplay[i].No}','Call')" class="link">电话预约</a>
            <a href="javascript:void(0)" onclick="waybillNo_action('${cardsToDisplay[i].No}','againfeed')" class="link">次日再投</a>
            <a href="javascript:void(0)" onclick="Expressdelivery('${cardsToDisplay[i].No}')" class="link">快递轨迹</a>
            `;
            // <a href="javascript:void(0)" onclick="change_phone('${cardsToDisplay[i].No}')" class="link">改手机号</a>
          } else if (cardsToDisplay[i].status == '已妥投') {
            card.innerHTML = `
            <div class="checkbox-container">
                <input type="checkbox" id="${cardsToDisplay[i].No}" class="custom-checkbox" onchange="checkboxClicked('${cardsToDisplay[i].No}')" />
                <label for="${cardsToDisplay[i].No}"></label>
            </div>
            <h2>${cardsToDisplay[i].waybillNo}</h2>
            <p class="receiverAddr" style="font-size: 15px;" >地址: &nbsp${cardsToDisplay[i].receiverAddr}</p>
            <p class="status">状态: &nbsp${cardsToDisplay[i].status}</p>
            <a href="javascript:void(0)" onclick="waybillNo_action('${cardsToDisplay[i].No}','Call')" class="link">电话预约</a>
            <a href="javascript:void(0)" onclick="Expressdelivery('${cardsToDisplay[i].No}')" class="link">快递轨迹</a>
            `;
          } else{
            card.innerHTML = `
            <div class="checkbox-container">
                <input type="checkbox" id="${cardsToDisplay[i].No}" class="custom-checkbox" onchange="checkboxClicked('${cardsToDisplay[i].No}')" />
                <label for="${cardsToDisplay[i].No}"></label>
            </div>
            <h2>${cardsToDisplay[i].waybillNo}</h2>
            <p class="receiverAddr" style="font-size: 15px;" >地址: &nbsp${cardsToDisplay[i].receiverAddr}</p>
            <p class="status">状态: &nbsp${cardsToDisplay[i].status}</p>
            <a href="javascript:void(0)" onclick="waybillNo_action('${cardsToDisplay[i].No}','Call')" class="link">电话预约</a>
            <a href="javascript:void(0)" onclick="waybillNo_action('${cardsToDisplay[i].No}','againfeed')" class="link">次日再投</a>
            <a href="javascript:void(0)" onclick="Expressdelivery('${cardsToDisplay[i].No}')" class="link">快递轨迹</a>
            <a href="javascript:void(0)" onclick="waybillNo_Signaction('${cardsToDisplay[i].No}')" class="link">妥投签收</a>
            `;
            // <a href="javascript:void(0)" onclick="change_phone('${cardsToDisplay[i].No}')" class="link">改手机号</a>
          }
          if ((cardsToDisplay[i].No).startsWith("1")) {
            Standard_badge.appendChild(card);
          }else if ((cardsToDisplay[i].No).startsWith("9")) {
            Express_badge.appendChild(card);
          }else if ((cardsToDisplay[i].No).startsWith("8")) {
            Quick_badge.appendChild(card);
          }else {
            Other_badge.appendChild(card);
          }
        }
      }
      document.getElementById('pageInfo').textContent = `第 ${page}/${Math.ceil(当前页面数组.length / cardsPerPage)}页，共${当前页面数组.length}单`;
    }
    
    //顶部标签栏显示
    $(function () {
        function setCurrentSlide(ele, index) {
          $(".swiper1 .swiper-slide").removeClass("selected");
          ele.addClass("selected");
          //swiper1.initialSlide=index;
        }
        //设置slider容器能够同时显示的slides数量(carousel模式)。
        //可以设置为number或者 'auto'则自动根据slides的宽度来设定数量。
        //loop模式下如果设置为'auto'还需要设置另外一个参数loopedSlides。
        var swiper1 = new Swiper('.swiper1', {
          slidesPerView: 5.5,
          paginationClickable: true,//此参数设置为true时，点击分页器的指示点分页器会控制Swiper切换。
          spaceBetween: 8,//slide之间的距离（单位px）。
          freeMode: true,//默认为false，普通模式：slide滑动时只滑动一格，并自动贴合wrapper，设置为true则变为free模式，slide会根据惯性滑动且不会贴合。
          loop: false,//是否可循环
          onTab: function (swiper) {
            var n = swiper1.clickedIndex;
          }
        });
        swiper1.slides.each(function (index, val) {
          var ele = $(this);
          ele.on("click", function () {
            setCurrentSlide(ele, index);
            // 获取当前滑块的文本内容
            var slideText = ele.text();
            当前勾选合集 =[]
            switch (index) {
              //已下段
              case 0:
                var textContainer = document.getElementById('finsh');
                textContainer.innerHTML = "已下段<br>("+已下段数组.length+")";
                当前页面数组 = 已下段数组;
                break;
    
              //未反馈
              case 1:
                var textContainer = document.getElementById('unfeedback');
                textContainer.innerHTML = "未反馈<br>("+未反馈数组.length+")";
                当前页面数组 = 未反馈数组;
                break;
    
              //已妥投
              case 2:
                var textContainer = document.getElementById('feeded');
                textContainer.innerHTML = "已妥投<br>("+已妥投数组.length+")";
                当前页面数组 = 已妥投数组;
                break;
    
              //未妥投
              case 3:
                var textContainer = document.getElementById('unfeed');
                textContainer.innerHTML = "未妥投<br>("+未妥投数组.length+")";
                当前页面数组 = 未妥投数组;
                break;
    
              //标准快递
              case 4:
                var textContainer = document.getElementById('Standard');
                textContainer.innerHTML = "标准快递<br>("+标准快递数组.length+")";
                当前页面数组 = 标准快递数组;
                break;
              
              //快递包裹
              case 5:
                var textContainer = document.getElementById('Ordinary');
                textContainer.innerHTML = "快递包裹<br>("+快递包裹数组.length+")";
                当前页面数组 = 快递包裹数组;
                break;
    
              //电商标快
              case 6:
                var textContainer = document.getElementById('E-commerce');
                textContainer.innerHTML = "电商标快<br>("+电商标快数组.length+")";
                当前页面数组 = 电商标快数组;
                break;
    
              //其他邮件
              case 7:
                var textContainer = document.getElementById('Other');
                textContainer.innerHTML = "其他邮件<br>("+其他邮件数组.length+")";
                当前页面数组 = 其他邮件数组;
                break;
            }
            let currentPage = 1;
            displayCards(currentPage);
            // console.log("当前滑块的文本: ", slideText);
          });
        });
    });
    
    //菜单函数
    $(function () {
        // browser window scroll (in pixels) after which the "menu" link is shown
        var offset = 0;
    
        var navigationContainer = $('#cd-nav'),
            mainNavigation = navigationContainer.find('#cd-main-nav ul');
    
        //hide or show the "menu" link
        checkMenu();
        $(window).scroll(function () {
            checkMenu();
        });
    
        //open or close the menu clicking on the bottom "menu" link
        $('.cd-nav-trigger').on('click', function () {
            $(this).toggleClass('menu-is-open');
            //we need to remove the transitionEnd event handler (we add it when scolling up with the menu open)
            mainNavigation.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend').toggleClass('is-visible');
    
        });
    
        function checkMenu() {
            if ($(window).scrollTop() > offset && !navigationContainer.hasClass('is-fixed')) {
                navigationContainer.addClass('is-fixed').find('.cd-nav-trigger').one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function () {
                    mainNavigation.addClass('has-transitions');
                });
            } else if ($(window).scrollTop() <= offset) {
                //check if the menu is open when scrolling up
                if (mainNavigation.hasClass('is-visible') && !$('html').hasClass('no-csstransitions')) {
                    //close the menu with animation
                    mainNavigation.addClass('is-hidden').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function () {
                        //wait for the menu to be closed and do the rest
                        mainNavigation.removeClass('is-visible is-hidden has-transitions');
                        navigationContainer.removeClass('is-fixed');
                        $('.cd-nav-trigger').removeClass('menu-is-open');
                    });
                    //check if the menu is open when scrolling up - fallback if transitions are not supported
                } else if (mainNavigation.hasClass('is-visible') && $('html').hasClass('no-csstransitions')) {
                    mainNavigation.removeClass('is-visible has-transitions');
                    navigationContainer.removeClass('is-fixed');
                    $('.cd-nav-trigger').removeClass('menu-is-open');
                    //scrolling up with menu closed
                } else {
                    navigationContainer.removeClass('is-fixed');
                    mainNavigation.removeClass('has-transitions');
                }
            }
        }
    });
    
    
    //上一页
    document.getElementById('prevBtn').addEventListener('click', () => {
      if (currentPage > 1) {
        currentPage--;
        displayCards(currentPage);
      }
    });
    //下一页
    document.getElementById('nextBtn').addEventListener('click', () => {
      if (currentPage < Math.ceil(当前页面数组.length / cardsPerPage)) {
        currentPage++;
        displayCards(currentPage);
      }
    });
    //选择快递分类关闭按钮
    document.getElementById('myModalclose1').addEventListener('click', () => {
      document.getElementById("myModal1").style.display = "none";
    });
    //快递轨迹关闭按钮
    document.getElementById('expressclose').addEventListener('click', () => {
      document.getElementById("express-float").style.display = "none";
    });
    // 关闭进度条按钮
    document.getElementById('close-button').addEventListener('click', () => {
      const progressContainer = document.getElementById('progress-float');
      progressContainer.style.display = 'none'; // 隐藏整个进度条
    });
    

    
    
    //搜索订单
    function find() {
      //关闭菜单
      var navigationContainer = $('#cd-nav'),mainNavigation = navigationContainer.find('#cd-main-nav ul');
      mainNavigation.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend').toggleClass('is-visible');
      $('.cd-nav-trigger').toggleClass('menu-is-open');
    
      swal({
            title: "",
            text: "输入外网订单号可查物流轨迹",
            type: "input",
            showCancelButton: true,
            closeOnConfirm: false,
            inputPlaceholder: "订单后6位或完整订单号"
        },
        function(waybillNo) {
            if (waybillNo === false) return false;
          if (waybillNo.length < 6) {
            swal.showInputError("至少输入6位数字!");
            return false;
          }
       
           // 立即关闭 SweetAlert
          swal.close();
          
          toast.style.display = "flex";
          httpRequest.open('GET', './zy_checkwaybillNo?id=' + encodeURIComponent(id_en)+"&waybillNos=" + encodeURIComponent(encrypt(waybillNo)), true);
          httpRequest.send();
          httpRequest.onreadystatechange = function () {
            if (httpRequest.readyState == 4) {// 请求已完成
              toast.style.display = "none";
              if (httpRequest.status === 200) { // 请求成功
                var 查询订单 = httpRequest.responseText;
                var 指定订单数组=[]
                var 订单序号 = 0
                var 数组 = JSON.parse(查询订单);
                if (isValidJsonObject(数组)) {
                  //分类订单
                  for (var 订单号 in 数组) {
                    订单序号++
                    var 单体信息 = {
                      No: 数组[订单号].waybillNo,
                      receiverAddr: 数组[订单号].receiverAddr,
                      waybillNo: `[${订单序号}]&nbsp单号:&nbsp${数组[订单号].waybillNo}`,
                      status: (数组[订单号].manOutCall === "") ? "未电联" : 数组[订单号].manOutCall 
                    }
                    指定订单数组.push(单体信息)
                  }
                  当前页面数组=指定订单数组
                  displayCards(1);
                } else {
                  if (waybillNo.length === 13) {
                    Expressdelivery(waybillNo);
                  }else{
                    swal("", "无该订单信息", "warning");
                  }
                }
              } else {
                swal("", "网络繁忙,请重试!", "warning");
              }
            }
          };
        
            });
    
    }
    
    //修改手机号
    function change_phone(waybillNo) {
      swal({
            title: "",
            text: "请输入新手机号码",
            type: "input",
            showCancelButton: true,
            closeOnConfirm: false,
            inputPlaceholder: "13422130018"
        },
        function(phone) {
            if (phone === false) return false;
          if (phone.length !== 11) {
            swal.showInputError("手机号格式有误!");
            return false;
          }
           // 立即关闭 SweetAlert
          swal.close();
          toast.style.display = "flex";
          httpRequest.open('GET', './zy_change_phone?id=' + encodeURIComponent(id_en)+"&phone="+ encodeURIComponent(encrypt(phone)) +"&waybillNo="+ encodeURIComponent(encrypt(waybillNo)), true);
          httpRequest.send();
          httpRequest.onreadystatechange = function () {
            if (httpRequest.readyState == 4) {// 请求已完成
              toast.style.display = "none";
              if (httpRequest.status === 200) { // 请求成功
                var 更新进度 = httpRequest.responseText;
                swal("", 更新进度, "success");
              } else {
                swal("", "网络繁忙,请重试!", "warning");
              }
            }
          };
            });
    }
    
    //订单预约
    function Set_Call(unphoned) {
    
      //关闭菜单
      var navigationContainer = $('#cd-nav'),mainNavigation = navigationContainer.find('#cd-main-nav ul');
      mainNavigation.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend').toggleClass('is-visible');
      $('.cd-nav-trigger').toggleClass('menu-is-open');
    
      if(unphoned=="1"){
        document.querySelector('.modal-content h3').textContent = '对未电联的单号进行预约';
      }else{
        document.querySelector('.modal-content h3').textContent = '对已电联的单号进行再次预约';
      }
      
      // 选项数据
      const options = [
          { value: "wfk", label: "未反馈快递" },
          { value: "bk", label: "标准快递" },
          { value: "kb", label: "快递包裹" },
          { value: "ds", label: "电商标快" },
          { value: "other", label: "其他" }
      ];
      const optionsContainer = document.getElementById('optionsContainer');
    
      // 移除所有的 label 元素
      const labels = optionsContainer.getElementsByTagName('label');
      while (labels.length > 0) {
          optionsContainer.removeChild(labels[0]);
      }
    
      // 动态生成label和checkbox
      options.forEach(option => {
          const label = document.createElement('label');
          const checkbox = document.createElement('input');
    
          checkbox.type = 'checkbox';
          checkbox.name = 'option';
          checkbox.value = option.value;
          checkbox.checked = true; // 设置为默认勾选
    
          label.appendChild(checkbox);
          label.appendChild(document.createTextNode(option.label));
          optionsContainer.appendChild(label);
      });
    
      document.getElementById("myModal1").style.display = "block";
    
      //选项卡监听
      document.getElementById("optionsForm").onsubmit = function(event) {
        event.preventDefault(); // 防止表单默认提交
        const selectedOptions = Array.from(document.querySelectorAll('input[name="option"]:checked')).map(checkbox => checkbox.value);
        // alert('您选择的选项：' + selectedOptions.join('@'));
        document.getElementById("myModal1").style.display = "none"; // 提交后关闭弹窗
    
        const remarks = selectedOptions.join('@');
        toast.style.display = "flex";
        httpRequest.open('GET', './zy_callcustomize?id=' + encodeURIComponent(id_en)+"&unphoned="+ unphoned+"&remarks="+ encodeURIComponent(encrypt(remarks)), true);
        httpRequest.send();
        httpRequest.onreadystatechange = function () {
          if (httpRequest.readyState == 4) {// 请求已完成
            toast.style.display = "none";
            if (httpRequest.status === 200) { // 请求成功
              // 开始更新进度条
              updateProgressBar();
            } else {
              swal("", "网络繁忙,请重试!", "warning");
            }
          }
        };
      }
    
    
    }
    
    
    // 模拟网络请求，并更新进度
    function fetchProgress() {
      return new Promise(resolve => {
          setTimeout(() => {
            httpRequest.open('GET', './zy_checkprogress?id=' + encodeURIComponent(id_en), true);
            httpRequest.send();
            httpRequest.onreadystatechange = function () {
              if (httpRequest.readyState == 4) {// 请求已完成
                if (httpRequest.status === 200) { // 请求成功
                  var 更新进度 = httpRequest.responseText;
                  resolve(更新进度);
                } else {
                  resolve('');
                }
              }
            };
          }, 700); // 模拟获取延迟
      });
    }
    // 从字符串中提取数字，并计算进度百分比
    function calculateProgress(progressString) {
        const regex = /(\d+)\/(\d+)/; // 匹配字符串中的 "12/126" 这样的形式
        const match = progressString.match(regex); // 提取出符合正则表达式的部分
    
        // 如果匹配到了内容
        if (match) {
            const signed = parseInt(match[1], 10); // 已签收数量 (12)
            const total = parseInt(match[2], 10); // 总数量 (126)
        
            // 计算百分比
            const percentage = Math.floor((signed / total) * 100);
        
            return percentage; // 返回百分比形式
        }
        // 如果未能成功解析，返回错误提示
        return 0;
    }
    
    // 更新进度条的方法
    async function updateProgressBar() {

        const progressBar = document.getElementById('progress-bar'); // 进度条元素
        const progressText = document.getElementById('progress-text'); // 百分比文本
        const progressTitle = document.querySelector('.progress-title'); // 标题文本
        const progressSubtitle = document.querySelector('.progress-subtitle'); // 标题文本
        
        document.getElementById("progress-float").style.display = "block";

        // 当前进度值
        var currentProgress = 0;
    
        while (currentProgress < 100) {
            try {
                // 获取进度
                Progress_txt = await fetchProgress();
                if ((Progress_txt || "").indexOf("预约") > -1) {
                  progressTitle.textContent = "正在预约中";
                  progressSubtitle.textContent = "关闭该页面不影响预约操作";
                }else if ((Progress_txt || "").indexOf("再投") > -1) {
                  progressTitle.textContent = "正在再投中";
                  progressSubtitle.textContent = "关闭该页面不影响再投操作";
                }else if ((Progress_txt || "").indexOf("签收") > -1) {
                  progressTitle.textContent = "正在签收中";
                  progressSubtitle.textContent = "关闭该页面不影响签收操作";
                }
                
        
                currentProgress=calculateProgress(Progress_txt);

                // 更新进度条宽度
                progressBar.style.width = `${currentProgress}%`;
            
                // 显示当前百分比
                progressText.textContent = `${Progress_txt}`;
            
                // 如果完成，显示完成状态并退出循环
                if (currentProgress >= 100 ) {
                    progressTitle.textContent = "操作完成!请刷新页面查看结果";
                    break;
                }

                if ((Progress_txt || "").indexOf("不处于") > -1) {
                  progressTitle.textContent = "操作完成!请刷新页面查看结果";
                  progressSubtitle.textContent = "";
                  progressBar.style.width = `100%`;
                  progressText.textContent = "100%";
                  break;
                }

                // 等待3秒后继续
                await new Promise(resolve => setTimeout(resolve, 3000));
            } catch (error) {
                // console.error('更新进度失败：', error);
                break;
            }
        }
    }
    
    //订单再投
    function Set_Tomorrowfeed() {
    
      //关闭菜单
      var navigationContainer = $('#cd-nav'),mainNavigation = navigationContainer.find('#cd-main-nav ul');
      mainNavigation.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend').toggleClass('is-visible');
      $('.cd-nav-trigger').toggleClass('menu-is-open');
    
      document.querySelector('.modal-content h3').textContent = '对未妥投的单号进行次日再投';
    
      // 选项数据
      const options = [
          { value: "bk", label: "标准快递" },
          { value: "kb", label: "快递包裹" },
          { value: "ds", label: "电商标快" },
          { value: "other", label: "其他" }
      ];
      const optionsContainer = document.getElementById('optionsContainer');
    
      // 移除所有的 label 元素
      const labels = optionsContainer.getElementsByTagName('label');
      while (labels.length > 0) {
          optionsContainer.removeChild(labels[0]);
      }
    
      // 动态生成label和checkbox
      options.forEach(option => {
          const label = document.createElement('label');
          const checkbox = document.createElement('input');
    
          checkbox.type = 'checkbox';
          checkbox.name = 'option';
          checkbox.value = option.value;
          checkbox.checked = true; // 设置为默认勾选
    
          label.appendChild(checkbox);
          label.appendChild(document.createTextNode(option.label));
          optionsContainer.appendChild(label);
      });
    
      document.getElementById("myModal1").style.display = "block";
    
      //选项卡监听
      document.getElementById("optionsForm").onsubmit = function(event) {
        event.preventDefault(); // 防止表单默认提交
        const selectedOptions = Array.from(document.querySelectorAll('input[name="option"]:checked')).map(checkbox => checkbox.value);
        // alert('您选择的选项：' + selectedOptions.join('@'));
        document.getElementById("myModal1").style.display = "none"; // 提交后关闭弹窗
        
        const remarks = selectedOptions.join('@');
        //弹出菜单提示选择
        const menuContainerele = document.getElementById('menuContainer');
        if (menuContainerele) {
          document.body.removeChild(menuContainerele);
        }
        const overlayele = document.getElementById('overlay');
        if (overlayele) {
          document.body.removeChild(overlayele);
        }
    
        const overlay = document.createElement('div');
        overlay.className = 'overlay';
        overlay.id = 'overlay';
        document.body.appendChild(overlay);
    
        const menuContainer = document.createElement('nav');
        menuContainer.className = 'bottom-menu';
        menuContainer.id = 'menuContainer';
    
    
        menuContainer.innerHTML = `
            <ul>
              <li data-id="NotAvailable"><a>1.电话无法接通</a></li>
              <li data-id="Other"><a>16.其他</a></li>
            </ul> 
        `;
        document.body.appendChild(menuContainer);
    
          
        var overlayElement = document.getElementById('overlay');
        var menuContainerElement = document.getElementById('menuContainer');
        menuContainerElement.classList.add('active');
        menuContainerElement.style.visibility = 'visible';
        overlayElement.classList.add('show');
    
        overlay.addEventListener('click', () => {
          menuContainer.style.visibility = 'hidden';
          overlay.classList.remove('show');
        });
    
    
        document.querySelector('.bottom-menu').addEventListener('click', function(event) {
          var liElement = event.target.closest('li');
    
          if(liElement.dataset.id=="NotAvailable"){
            toast.style.display = "flex";
            httpRequest.open('GET', './zy_againfeedcustomize?id=' + encodeURIComponent(id_en)+"&action=" + encodeURIComponent(encrypt(liElement.dataset.id))+"&remarks="+encodeURIComponent(encrypt(remarks))+"&stype=", true);
            httpRequest.send();
            httpRequest.onreadystatechange = function () {
              if (httpRequest.readyState == 4) {// 请求已完成
                toast.style.display = "none";
                if (httpRequest.status === 200) { // 请求成功
                  var 更新进度 = httpRequest.responseText;
                  swal("", 更新进度, "success");
                } else {
                  swal("", "网络繁忙,请重试!", "warning");
                }
              }
            };
    
          }else if(liElement.dataset.id=="Other"){
    
            swal({
                     title: "",
                    text: "请输入备注信息:",
                    type: "input",
                    showCancelButton: true,
                    closeOnConfirm: false,
                    animation: "slide-from-top",
                    inputPlaceholder: "菜鸟驿站/家人签收等"
                },
                function(inputValue) {
                    if (inputValue === false) return false;
                    if (inputValue == "") {
                        swal.showInputError("输入不能为空!");
                        return false;
                    }
    
                swal.close();
                    toast.style.display = "flex";
                httpRequest.open('GET', './zy_againfeedcustomize?id=' + encodeURIComponent(id_en)+"&action=" + encodeURIComponent(encrypt(liElement.dataset.id))+"&remarks="+encodeURIComponent(encrypt(remarks))+"&stype="+ encodeURIComponent(encrypt(inputValue)), true);
                httpRequest.send();
                httpRequest.onreadystatechange = function () {
                  if (httpRequest.readyState == 4) {// 请求已完成
                    toast.style.display = "none";
                    if (httpRequest.status === 200) { // 请求成功
                      var 更新进度 = httpRequest.responseText;
                      swal("", 更新进度, "success");
                    } else {
                      swal("", "网络繁忙,请重试!", "warning");
                    }
                  }
                };
            });
          }
    
          menuContainerElement.style.visibility = 'hidden';
          overlayElement.classList.remove('show');
          menuContainerElement.classList.remove('active');
        });
      }
    
    }
    
    
    //订单签收
    function Set_sign() {
        //关闭菜单
        var navigationContainer = $('#cd-nav'), mainNavigation = navigationContainer.find('#cd-main-nav ul');
        mainNavigation.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend').toggleClass('is-visible');
        $('.cd-nav-trigger').toggleClass('menu-is-open');
    
        document.querySelector('.modal-content h3').textContent = '对未妥投、未反馈的单号进行签收';
    
        // 选项数据
        const options = [
            { value: "wfk", label: "未反馈快递" },
            { value: "bk", label: "标准快递" },
            { value: "kb", label: "快递包裹" },
            { value: "ds", label: "电商标快" },
            { value: "other", label: "其他" }
        ];
        const optionsContainer = document.getElementById('optionsContainer');
    
        // 移除所有的 label 元素
        const labels = optionsContainer.getElementsByTagName('label');
        while (labels.length > 0) {
            optionsContainer.removeChild(labels[0]);
        }
    
        // 动态生成label和checkbox
        options.forEach(option => {
            const label = document.createElement('label');
            const checkbox = document.createElement('input');
    
            checkbox.type = 'checkbox';
            checkbox.name = 'option';
            checkbox.value = option.value;
            checkbox.checked = true; // 设置为默认勾选
    
            label.appendChild(checkbox);
            label.appendChild(document.createTextNode(option.label));
            optionsContainer.appendChild(label);
        });
    
        document.getElementById("myModal1").style.display = "block";
    
        //选项卡监听
        document.getElementById("optionsForm").onsubmit = function (event) {
            event.preventDefault(); // 防止表单默认提交
            const selectedOptions = Array.from(document.querySelectorAll('input[name="option"]:checked')).map(checkbox => checkbox.value);
            //alert('您选择的选项：' + selectedOptions.join('@'));
    
            document.getElementById("myModal1").style.display = "none"; // 提交后关闭弹窗
    
    
            const remarks = selectedOptions.join('@');


            //显示选项窗
            document.getElementById("myModal2").style.display = "block";
            document.getElementById('myModalclose2').addEventListener('click', () => {
                document.getElementById("myModal2").style.display = "none";
            });
          
            toggleFields()
          

            //批量妥投时移走密码件妥投
            var selectElement = document.getElementById('option1');
            for (var i = 0; i < selectElement.options.length; i++) {
                if (selectElement.options[i].value === "PasswordPackage") {
                    selectElement.remove(i);
                    break;  // 移除后退出循环
                }
            }

            //签收提交按钮监听
            document.getElementById("SignForm").onsubmit = function(event) {
              event.preventDefault(); // 防止表单默认提交

              document.getElementById("myModal2").style.display = "none"; // 提交后关闭弹窗
              var option1Value = document.getElementById('option1').value;
              var inputValue  = document.getElementById('inputField').value;; 
            
              var SelfPickup_Code ="";
              var SelfPickup_Name ="";

              if (option1Value == 'Self_pickuppoint') {

                var select = document.getElementById('option2'); // 获取 <select> 元素
                SelfPickup_Code = select.value; // 获取选中项的 value
                SelfPickup_Name = select.options[select.selectedIndex].text; // 获取选中项的文本内容

              }else{
                if (inputValue.trim() === '') { 
                    swal("", "请输入签收人！", "warning");
                    return;
                }

              }

              //提交妥投
              toast.style.display = "flex";
              httpRequest.open('GET', './zy_signcustomize?id=' + encodeURIComponent(id_en) + "&action=" + encodeURIComponent(encrypt(option1Value)) + "&remarks=" + encodeURIComponent(encrypt(remarks)) + "&remark="+ encodeURIComponent(encrypt(inputValue))+ "&SelfPickup_Code="+ encodeURIComponent(encrypt(SelfPickup_Code))+ "&SelfPickup_Name="+ encodeURIComponent(encrypt(SelfPickup_Name)), true);
              httpRequest.send();
              httpRequest.onreadystatechange = function () {
                  if (httpRequest.readyState == 4) {// 请求已完成
                      toast.style.display = "none";
                      if (httpRequest.status === 200) { // 请求成功
                          // 开始更新进度条
                          updateProgressBar();
                      } else {
                          swal("", "网络繁忙,请重试!", "warning");
                      }
                  }
              };

        };
    }
  } 


    // 动态添加自提点信息
    function addOptions(jsonData) {
        const select = document.getElementById('option2'); // 获取 <select> 元素
        // 清空之前的 <option>，如果需要
        select.innerHTML = "";
        // 遍历 JSON 数据，动态添加 <option>
        jsonData.forEach(item => {
            const newOption = document.createElement('option'); // 创建 <option> 元素
            if(item.networkCode!=="勿选"){
              newOption.value = item.networkCode; // 设置 value 属性
              newOption.textContent = item.networkName; // 设置显示文本
              select.appendChild(newOption); // 添加到 <select> 中
            }
        });
    }


    // 根据第一个选项的选择显示或隐藏第二个选项和输入框
    async function toggleFields() {
        var option1Value = document.getElementById('option1').value;
        var option2Container = document.getElementById('option2-container');
        var inputContainer = document.getElementById('input-container')
        if (option1Value === 'Self_pickuppoint') {

          inputContainer.style.display = 'none';
          option2Container.style.display = 'block';

          toast.style.display = "flex";
          httpRequest.open('GET', './zy_Self_pickuppoint_info?id=' + encodeURIComponent(id_en), true);
          httpRequest.send();
          httpRequest.onreadystatechange = function () {
            if (httpRequest.readyState == 4) {// 请求已完成
              toast.style.display = "none";
              if (httpRequest.status === 200) { // 请求成功
                var 自提信息 = httpRequest.responseText;
                if(自提信息!==""){
                  addOptions(JSON.parse(自提信息))
                }else{
                  swal("", "信息获取失败,请重试!", "warning");
                }
              } else {
                swal("", "网络繁忙,请重试!", "warning");
              }
            }
          };
        } else if (option1Value === 'PasswordPackage') {
            inputContainer.style.display = 'block';
            option2Container.style.display = 'none';
            document.getElementById('inputField').placeholder = '避免违规,建议填入家人'; // 动态设置 placeholder
        } else {
            inputContainer.style.display = 'block';
            option2Container.style.display = 'none';
            document.getElementById('inputField').placeholder = '请输入签收人'; // 动态设置 placeholder
        }
    }

    //妥投签收
    function waybillNo_Signaction(waybillNo) {
      var waybillNos="";
      if(当前勾选合集.length > 0){
        waybillNos = 当前勾选合集.join('&');
        swal({
          title: '',
          text: '已勾选多个单号，是否进行妥投?',
          // type: 'warning',
          showCancelButton: true,
          confirmButtonColor: "#DD6B55", //可有可无
          confirmButtonText: "确定",   //可有可无
          closeOnConfirm: false    //必须设置为false
        }, function (isConfirm) {
          if (isConfirm) {
            swal.close();
            Signaction(waybillNos);
          } 
        })

      }else{
        Signaction(waybillNo);
      }
    }

   
    //妥投签收
    function Signaction(waybillNo) {
        //显示选项窗
        document.getElementById("myModal2").style.display = "block";
        document.getElementById('myModalclose2').addEventListener('click', () => {
            document.getElementById("myModal2").style.display = "none";
        });

        toggleFields()

        const select = document.getElementById('option1'); // 获取 <select> 元素

        //先移走后添加避免重复生成
        for (var i = 0; i < select.options.length; i++) {
          if (select.options[i].value === "PasswordPackage") {
            select.remove(i);
          }
        }

        const newOption = document.createElement('option'); // 创建 <option> 元素
        newOption.value = 'PasswordPackage'; // 设置 value 属性
        newOption.textContent = '密码件签收'; // 设置显示文本
        select.appendChild(newOption); // 添加到 <select> 中
        
        //签收提交按钮监听
        document.getElementById("SignForm").onsubmit = function(event) {
          event.preventDefault(); // 防止表单默认提交
          
          document.getElementById("myModal2").style.display = "none"; // 提交后关闭弹窗
          var option1Value = document.getElementById('option1').value;
          var inputValue  = document.getElementById('inputField').value;; 

          var SelfPickup_Code ="";
          var SelfPickup_Name ="";

          if (option1Value == 'Self_pickuppoint') {
            
            var select = document.getElementById('option2'); // 获取 <select> 元素
            SelfPickup_Code = select.value; // 获取选中项的 value
            SelfPickup_Name = select.options[select.selectedIndex].text; // 获取选中项的文本内容
          }else{
            if (inputValue.trim() === '') {
                swal("", "请输入签收人！", "warning");
                return;
            }
            
            if (option1Value == 'PasswordPackage' && (waybillNo || "").indexOf('&') > -1) {
              swal("", "密码件仅支持单个操作！", "warning");
              return;
            }

          }


          toast.style.display = "flex";
          httpRequest.open('GET', './zy_feed_select?id=' + encodeURIComponent(id_en) + "&waybillNos=" + encodeURIComponent(encrypt(waybillNo)) + "&action=" + encodeURIComponent(encrypt(option1Value)) + "&remarks="+ encodeURIComponent(encrypt(inputValue))+ "&SelfPickup_Code="+ encodeURIComponent(encrypt(SelfPickup_Code))+ "&SelfPickup_Name="+ encodeURIComponent(encrypt(SelfPickup_Name)), true);
          httpRequest.send();
          httpRequest.onreadystatechange = function () {
              if (httpRequest.readyState == 4) {// 请求已完成
                  toast.style.display = "none";
                  if (httpRequest.status === 200) { // 请求成功
                    swal("", httpRequest.responseText, "success");
                  } else {
                    swal("", "网络繁忙,请重试!", "warning");
                  }
              }
          };



        }

    }

    //小按钮点击
    function waybillNo_action(waybillNo,action) {
     
      var text_str=""
      var url_str=""
      switch (action) {
      case "Call":
        text_str = "预约"
        url_str="zy_call_select"
        break;
      case "againfeed":
        text_str = "再投"
        url_str="zy_againfeed_select"
        break;
      }
      
    
      if(当前勾选合集.length > 0){
    
        swal({
          title: '',
          text: '已勾选多个单号，是否进行'+text_str+'?',
          type: 'warning',
          showCancelButton: true,
          confirmButtonColor: "#DD6B55", //可有可无
          confirmButtonText: "确定",   //可有可无
          closeOnConfirm: false    //必须设置为false
        }, function (isConfirm) {
          if (isConfirm) {
    
            swal.close();
            waybillNo = 当前勾选合集.join('&');
            if (action == "againfeed" || action == "feed") {
              //与下面代码一样
              const menuContainerele = document.getElementById('menuContainer');
              if (menuContainerele) {
                  document.body.removeChild(menuContainerele);
              }
              const overlayele = document.getElementById('overlay');
              if (overlayele) {
                  document.body.removeChild(overlayele);
              }
            
              const overlay = document.createElement('div');
              overlay.className = 'overlay';
              overlay.id = 'overlay';
              document.body.appendChild(overlay);
            
              const menuContainer = document.createElement('nav');
              menuContainer.className = 'bottom-menu';
              menuContainer.id = 'menuContainer';
            
              switch (action) {
                  case "againfeed":
                      menuContainer.innerHTML = `
                  <ul>
                    <li data-id="NotAvailable"><a>1.电话无法接通</a></li>
                    <li data-id="Other"><a>16.其他</a></li>
                  </ul> 
              `;
                      document.body.appendChild(menuContainer);
                      break;
                
                  case "feed":
                      menuContainer.innerHTML = `
                  <ul>
                    <li data-id="Cainiao"><a>1.菜鸟驿站</a></li>
                    <li data-id="Other"><a>16.其他</a></li>
                  </ul> 
              `;
                      document.body.appendChild(menuContainer);
                
                      break;
              }
            
            
              var overlayElement = document.getElementById('overlay');
              var menuContainerElement = document.getElementById('menuContainer');
              menuContainerElement.classList.add('active');
              menuContainerElement.style.visibility = 'visible';
              overlayElement.classList.add('show');
            
              overlay.addEventListener('click', () => {
                  menuContainer.style.visibility = 'hidden';
                  overlay.classList.remove('show');
              });
            
            
              document.querySelector('.bottom-menu').addEventListener('click', function (event) {
                  var liElement = event.target.closest('li');
              
                  if (liElement.dataset.id == "NotAvailable" || liElement.dataset.id == "Cainiao") {
                      toast.style.display = "flex";
                      httpRequest.open('GET', './' + url_str + '?id=' + encodeURIComponent(id_en) + "&waybillNos=" + encodeURIComponent(encrypt(waybillNo)) + "&action=" + encodeURIComponent(encrypt(liElement.dataset.id)) + "&remarks=", true);
                      httpRequest.send();
                      httpRequest.onreadystatechange = function () {
                          if (httpRequest.readyState == 4) {// 请求已完成
                              toast.style.display = "none";
                              if (httpRequest.status === 200) { // 请求成功
                                  // 开始更新进度条
                                  updateProgressBar();
                              } else {
                                  swal("", "网络繁忙,请重试!", "warning");
                              }
                          }
                      };
                    
                  } else if (liElement.dataset.id == "Other") {
                  
                      swal({
                          title: "",
                          text: "请输入备注信息:",
                          type: "input",
                          showCancelButton: true,
                          closeOnConfirm: false,
                          animation: "slide-from-top",
                          inputPlaceholder: "菜鸟驿站/家人签收等"
                      },
                          function (inputValue) {
                              if (inputValue === false) return false;
                              if (inputValue == "") {
                                  swal.showInputError("输入不能为空!");
                                  return false;
                              }
                            
                              swal.close();
                              toast.style.display = "flex";
                              httpRequest.open('GET', './' + url_str + '?id=' + encodeURIComponent(id_en) + "&waybillNos=" + encodeURIComponent(encrypt(waybillNo)) + "&action=" + encodeURIComponent(encrypt(liElement.dataset.id)) + "&remarks=" + encodeURIComponent(encrypt(inputValue)), true);
                              httpRequest.send();
                              httpRequest.onreadystatechange = function () {
                                  if (httpRequest.readyState == 4) {// 请求已完成
                                      toast.style.display = "none";
                                      if (httpRequest.status === 200) { // 请求成功
                                          // 开始更新进度条
                                          updateProgressBar();
                                      } else {
                                          swal("", "网络繁忙,请重试!", "warning");
                                      }
                                  }
                              };
                          });
                  }
                
                  menuContainerElement.style.visibility = 'hidden';
                  overlayElement.classList.remove('show');
                  menuContainerElement.classList.remove('active');
              });
            } else {
              toast.style.display = "flex";
              httpRequest.open('GET', './' + url_str + '?id=' + encodeURIComponent(id_en) + "&waybillNos=" + encodeURIComponent(encrypt(waybillNo)), true);
              httpRequest.send();
              httpRequest.onreadystatechange = function () {
                  if (httpRequest.readyState == 4) {// 请求已完成
                      toast.style.display = "none";
                      if (httpRequest.status === 200) { // 请求成功
                          // 开始更新进度条
                          updateProgressBar();
                      } else {
                          swal("", "网络繁忙,请重试!", "warning");
                      }
                  }
              };
            }
    
          } 
        })
        //单个操作
      }else{
          if(action=="againfeed"){
    
    
            const menuContainerele = document.getElementById('menuContainer');
            if (menuContainerele) {
              document.body.removeChild(menuContainerele);
            }
            const overlayele = document.getElementById('overlay');
            if (overlayele) {
              document.body.removeChild(overlayele);
            }
    
            const overlay = document.createElement('div');
            overlay.className = 'overlay';
            overlay.id = 'overlay';
            document.body.appendChild(overlay);
    
            const menuContainer = document.createElement('nav');
            menuContainer.className = 'bottom-menu';
            menuContainer.id = 'menuContainer';
            // console.log(action)
            switch (action) {
              case "againfeed":
                menuContainer.innerHTML = `
                    <ul>
                      <li data-id="NotAvailable"><a>1.电话无法接通</a></li>
                      <li data-id="Other"><a>16.其他</a></li>
                    </ul> 
                `;
                document.body.appendChild(menuContainer);
                break;
    
              case "feed":
                menuContainer.innerHTML = `
                    <ul>
                      <li data-id="Cainiao"><a>1.菜鸟驿站</a></li>
                      <li data-id="Other"><a>16.其他</a></li>
                    </ul> 
                `;
                document.body.appendChild(menuContainer);
                break;
            }
    
       
            var overlayElement = document.getElementById('overlay');
            var menuContainerElement = document.getElementById('menuContainer');
            menuContainerElement.classList.add('active');
            menuContainerElement.style.visibility = 'visible';
            overlayElement.classList.add('show');
    
            overlay.addEventListener('click', () => {
              menuContainer.style.visibility = 'hidden';
              overlay.classList.remove('show');
            });
    
    
            document.querySelector('.bottom-menu').addEventListener('click', function(event) {
              var liElement = event.target.closest('li');
    
              if(liElement.dataset.id=="NotAvailable"||liElement.dataset.id=="Cainiao"){
                toast.style.display = "flex";
                httpRequest.open('GET', './'+url_str+'?id=' + encodeURIComponent(id_en)+"&waybillNos=" + encodeURIComponent(encrypt(waybillNo))+"&action=" + encodeURIComponent(encrypt(liElement.dataset.id))+"&remarks=", true);
                httpRequest.send();
                httpRequest.onreadystatechange = function () {
                  if (httpRequest.readyState == 4) {// 请求已完成
                    toast.style.display = "none";
                    if (httpRequest.status === 200) { // 请求成功
                      var 更新进度 = httpRequest.responseText;
                      swal("", 更新进度, "success");
                    } else {
                      swal("", "网络繁忙,请重试!", "warning");
                    }
                  }
                };
    
              }else if(liElement.dataset.id=="Other"){
    
                swal({
                         title: "",
                        text: "请输入备注信息:",
                        type: "input",
                        showCancelButton: true,
                        closeOnConfirm: false,
                        animation: "slide-from-top",
                        inputPlaceholder: "菜鸟驿站/家人签收等"
                    },
                    function(inputValue) {
                        if (inputValue === false) return false;
                        if (inputValue == "") {
                            swal.showInputError("输入不能为空!");
                            return false;
                        }
                    
                    swal.close();
                        toast.style.display = "flex";
                    httpRequest.open('GET', './'+url_str+'?id=' + encodeURIComponent(id_en)+"&waybillNos=" + encodeURIComponent(encrypt(waybillNo))+"&action=" + encodeURIComponent(encrypt(liElement.dataset.id))+"&remarks=" + encodeURIComponent(encrypt(inputValue)), true);
                    httpRequest.send();
                    httpRequest.onreadystatechange = function () {
                      if (httpRequest.readyState == 4) {// 请求已完成
                        toast.style.display = "none";
                        if (httpRequest.status === 200) { // 请求成功
                          var 更新进度 = httpRequest.responseText;
                          swal("", 更新进度, "success");
                        } else {
                          swal("", "网络繁忙,请重试!", "warning");
                        }
                      }
                    };
                });
              }
    
              menuContainerElement.style.visibility = 'hidden';
              overlayElement.classList.remove('show');
              menuContainerElement.classList.remove('active');
            });
    
          }else{
            toast.style.display = "flex";
            httpRequest.open('GET', './'+url_str+'?id=' + encodeURIComponent(id_en)+"&waybillNos=" + encodeURIComponent(encrypt(waybillNo)), true);
            httpRequest.send();
            httpRequest.onreadystatechange = function () {
              if (httpRequest.readyState == 4) {// 请求已完成
                toast.style.display = "none";
                if (httpRequest.status === 200) { // 请求成功
                  var 更新进度 = httpRequest.responseText;
                  swal("", 更新进度, "success");
                } else {
                  swal("", "网络繁忙,请重试!", "warning");
                }
              }
            };
          }
      }
    };
    
    // 渲染快递轨迹
    function renderTraces(traces,waybillNo) {
      const tracesContainer = document.getElementById('expressTraces');
      const expressInfo = document.getElementById('expressInfo');
      tracesContainer.innerHTML ="";

      //动态生成“切换”按钮
      const exchangeBadge = document.getElementById('exchange-badge');
      exchangeBadge.onclick = function() {
          Express_exchange(waybillNo);
      };

      traces.forEach((item, index) => {
          const traceItem = document.createElement('div');
          traceItem.className = 'trace-item';
          // 判断状态
          const statusClass = index === 0 ? 'status-processing' : 'status-completed';
          if ((item.opName || "").indexOf("收寄计费信息") > -1) { 
              expressInfo.textContent = `${item.opDesc}`;
          }else{
              traceItem.innerHTML = `
                  <div class="trace-time">
                      <i class="far fa-clock"></i>
                      ${item.opTime}
                  </div>
                  <div class="trace-name">${item.opName}</div>
                  <div class="trace-desc">${item.opDesc || '暂无详细描述'}</div>
                  <div class="trace-location">
                      <i class="fas fa-map-marker-alt"></i>
                      ${item.opOrgProvName} ${item.opOrgCity || ''}
                  </div>
                  <div class="status-badge ${statusClass}">
                      ${index === 0 ? '进行中' : '已完成'}
                  </div>
              `;
              tracesContainer.appendChild(traceItem);
          }
      });
      document.getElementById("express-float").style.display = "flex";
    }
    

    // 渲染快递轨迹
    function renderTraces2(traces,waybillNo) {
      const tracesContainer = document.getElementById('expressTraces');
      const expressInfo = document.getElementById('expressInfo');
      tracesContainer.innerHTML ="";

      //动态生成“切换”按钮
      const exchangeBadge = document.getElementById('exchange-badge');
      exchangeBadge.onclick = function() {
        Expressdelivery(waybillNo);
      };

      // 反转轨迹数据
      traces.reverse();
      traces.forEach((item, index) => {
          const traceItem = document.createElement('div');
          traceItem.className = 'trace-item';
          // 判断状态
          const statusClass = index === 0 ? 'status-processing' : 'status-completed';
          traceItem.innerHTML = `
              <div class="trace-time">
                  <i class="far fa-clock"></i>
                  ${item.handleTime}
              </div>
              <div class="trace-name">${item.handleOrgName +"-"+ item.handleName || '暂无详细描述'}</div>
              <div class="status-badge ${statusClass}">
                  ${index === 0 ? '进行中' : '已完成'}
              </div>
          `;
          tracesContainer.appendChild(traceItem);
          
      });
      document.getElementById("express-float").style.display = "flex";
    }
    


    //轨迹查询
    function Expressdelivery(waybillNo) {
      toast.style.display = "flex";
      httpRequest.open('GET', './zy_Expressdelivery_check?id=' + encodeURIComponent(id_en)+"&waybillNos=" + encodeURIComponent(encrypt(waybillNo)), true);
      httpRequest.send();
      httpRequest.onreadystatechange = function () {
        if (httpRequest.readyState == 4) {// 请求已完成
          toast.style.display = "none";
          if (httpRequest.status === 200) { // 请求成功
            var 轨迹信息 = httpRequest.responseText;
            if ((轨迹信息||"").indexOf('opName') > -1) {
              var json = JSON.parse(轨迹信息);
              // 渲染数据
              renderTraces(json.data[0].data,waybillNo);
            }else{
              swal("", "暂无物流信息", "success");
            }    
          } else {
            swal("", "网络繁忙,请重试!", "warning");
          }
        }
      };
    }
    
    //轨迹切换查看
    function Express_exchange(waybillNo) {
      toast.style.display = "flex";
      httpRequest.open('GET', './zy_Expressdelivery_check2?id=' + encodeURIComponent(id_en)+"&waybillNos=" + encodeURIComponent(encrypt(waybillNo)), true);
      httpRequest.send();
      httpRequest.onreadystatechange = function () {
        if (httpRequest.readyState == 4) {// 请求已完成
          toast.style.display = "none";
          if (httpRequest.status === 200) { // 请求成功
            var 轨迹信息 = httpRequest.responseText;
            if(轨迹信息!==""){
              var obj = JSON.parse(轨迹信息);
              var 物流 =obj.traceInfo.list
              // 渲染数据
              renderTraces2(物流,waybillNo);
            }else{
              swal("", "暂无物流信息", "success");
            }    
          } else {
            swal("", "网络繁忙,请重试!", "warning");
          }
        }
      };
    }
    
    //查看进度
    function checkprogress() {
      //关闭菜单
      var navigationContainer = $('#cd-nav'),mainNavigation = navigationContainer.find('#cd-main-nav ul');
      mainNavigation.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend').toggleClass('is-visible');
      $('.cd-nav-trigger').toggleClass('menu-is-open');
    
      // 开始更新进度条
      updateProgressBar();

    };
    
    
    //当前勾选合集
    function checkboxClicked(checkboxId) {
        const checkbox = document.getElementById(checkboxId);
        if(checkbox.checked){
          //加入数组
          当前勾选合集.push(checkboxId)
        }else{
          //删除数组
          当前勾选合集 = 当前勾选合集.filter(item => item !== checkboxId);
        }
        // console.log(当前勾选合集);
    }
    </script>
    


</html>