<view class="toptip {{tipStaus}} text-white {{tipType}}" style='top:{{CustomBar}}px;'>{{tipText}}</view>
<cu-custom bgColor="bg-color" isBack="{{true}}" title="订单信息"></cu-custom>
<view>
  <view class="detailsItem" style="{{isAll ? 'margin-bottom:20rpx': 'margin-bottom:0'}}">
    <view class="query_item_txt">
      <text class="query_item_label">订单号:</text>
      <text>{{transportOrder.code}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">下单日期:</text>
      <text>{{transportOrder.orderTime}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">发运日期:</text>
      <text>{{transportOrder.startTime}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">产品名称:</text>
      <text>{{transportOrder.goodsName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">生产厂家:</text>
      <text>{{transportOrder.manufac}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">客户名称:</text>
      <text>{{transportOrder.cusName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">运抵省份:</text>
      <text>{{transportOrder.province}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">承运商:</text>
      <text>{{transportOrder.transportName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">运输方式:</text>
      <text>{{transportOrder.transportType}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">车牌:</text>
      <text>{{transportOrder.plateNum}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">送货地点:</text>
      <text>{{transportOrder.sendAreaName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">运抵目的地:</text>
      <text>{{transportOrder.desti}}</text>
    </view>
  </view>
</view>
<view>
  <view class="detailsItem" style="{{isAll ? '' :'display:none'}}">
    <view class="query_item_txt">
      <text class="query_item_label">冷链名称：</text>
      <text>{{details.chainName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">编号：</text>
      <text>{{details.chainCode}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">包装类型：</text>
      <text>{{details.packageTypeName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">产品：</text>
      <text>{{details.productName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">数量：</text>
      <text>{{details.num}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">开始时间：</text>
      <text>{{details.startTime}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">运输方式：</text>
      <text>{{details.transportTypeName}}</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">运输状态：</text>
      <text class="{{details.status == 00 ? 'query_zc': details.status == 10 ? 'query_jb': 'query_wx'}}" wx:if="{{details.transportStatus == 00}}">在库</text>
      <text class="{{details.status == 00 ? 'query_zc': details.status == 10 ? 'query_jb': 'query_wx'}}" wx:if="{{details.transportStatus == 10}}">运输中</text>
      <text class="{{details.status == 00 ? 'query_zc': details.status == 10 ? 'query_jb': 'query_wx'}}" wx:if="{{details.transportStatus == 20}}">已结束</text>
    </view>
    <view class="query_item_txt">
      <text class="query_item_label">负责人：</text>
      <text>{{details.userName}}</text>
    </view>
    <view class="query_item_txt itemFlex">
      <view>
        <text class="query_item_label">追溯码：</text>
        <text>{{details.sourceCode || 'N/A'}}</text>
      </view>
      <view>
        <view class="setCode" bindtap="chainCode" wx:if="{{!details.sourceCode}}" data-id="{{details.chainId}}" data-type="sourceCode">
          <text>添加</text>
          <image src="../../img/scan.png"></image>
        </view>
        <view class="operCode" wx:else>
          <text class="copyCode" bindtap="copyCode" data-code="{{details.sourceCode}}">复制</text>
          <text class="line">|</text>
          <text class="editCode" bindtap="chainCode" data-code="{{details.sourceCode}}" data-type="sourceCode" data-id="{{details.chainId}}">修改</text>
        </view>
      </view>
    </view>
    <view class="query_item_txt itemFlex">
      <view>
        <text class="query_item_label">物流码：</text>
        <text>{{details.logisticsCode || 'N/A'}}</text>
      </view>
      <view>
        <view class="setCode" bindtap="chainCode" wx:if="{{!details.logisticsCode}}" data-type="logisticsCode" data-id="{{details.chainId}}">
          <text>添加</text>
          <image src="../../img/scan.png"></image>
        </view>
        <view class="operCode" wx:else>
          <text class="copyCode" bindtap="copyCode" data-code="{{details.logisticsCode}}">复制</text>
          <text class="line">|</text>
          <text class="editCode" bindtap="chainCode" data-type="logisticsCode" data-id="{{details.chainId}}" data-code="{{details.logisticsCode}}">修改</text>
        </view>
      </view>
    </view>
    <view class="query_item_txt itemFlex">
      <view>
        <text class="query_item_label">箱码：</text>
        <text>{{details.packageCode || 'N/A'}}</text>
      </view>
      <view>
        <view class="setCode" bindtap="chainCode" data-type="packageCode" wx:if="{{!details.packageCode}}" data-id="{{details.chainId}}">
          <text>添加</text>
          <image src="../../img/scan.png"></image>
        </view>
        <view class="operCode" wx:else>
          <text class="copyCode" bindtap="copyCode" data-code="{{details.packageCode}}">复制</text>
          <text class="line">|</text>
          <text class="editCode" bindtap="chainCode" data-code="{{details.packageCode}}" data-type="packageCode" data-id="{{details.chainId}}">修改</text>
        </view>
      </view>
    </view>
    <view class="{{ispdfBut ? 'query_item_txt pdfFlex':'query_item_txt'}}">
      <view>
        <text class="query_item_label">电话：</text>
        <text>{{details.telephone}}</text>
      </view>
      <!-- <view class="pdfclick" wx:if="{{ispdfBut}}" bindtap="goPdf" data-id="{{details.chainId}}">
        <image src="../../img/goPdf.png"></image>
        <text>获取报告</text>
      </view> -->
    </view>
  </view>
  <view bindtap="onAll" class="onAll">
    <text>{{allActive}}</text>
  </view>
  <view>
    <view class="detailsTitle">
      <text>设备与子冷链</text>
    </view>
    <view class="detailsCode">
      <view>
        <view wx:for="{{boundDevice}}" wx:for-item='item' wx:key="key" wx:for-index='key'>
          <view wx:if="{{item.length != 0}}">
            <view class="details_title">
              <text>总数量</text>
              <text>></text>
            </view>
            <view wx:if="{{key.indexOf('X') != -1 && key != 'childNum' }}" bindtap="goDetails" data-details="{{item}}" data-devicetype='{{key}}'>
              <view class="details_num">{{item.length}}</view>
              <view class="details_name">{{key}}</view>
            </view>
            <view wx:if="{{key.indexOf('X') == -1 && key != 'childNum'}}" data-devicetype='{{key}}' data-details="{{item}}">
              <view class="details_num">{{item.length}}</view>
              <view class="details_name" wx:if="{{key == '10'}}">追溯标签</view>
              <view class="details_name" wx:if="{{key == '11'}}">全程温控</view>
              <view class="details_name" wx:if="{{key == '20'}}">实时追溯</view>
            </view>
            <view wx:if="{{key == 'childNum'}}" bindtap="goChainCold">
              <view class="details_num">{{item}}</view>
              <view class="details_name">子冷链</view>
            </view>
          </view>
        </view>
      </view>
      <!-- <view>
        <view wx:for="{{10}}">
          <view>
            <view class="details_title">
              <text>总数量</text>
              <text>></text>
            </view>
            <view class="details_num">198</view>
            <view class="details_name">标签X201</view>
          </view>
        </view>
      </view> -->
      <!-- <view>
        <view bindtap="goDetails" data-details="{{boundDevice[10]}}" data-devicetype='10'>
          <image src="/img/dev_img3.png"></image>
          <view>
            <text>{{boundDevice[10].length}}</text>
            <view>追溯标签</view>
          </view>
        </view>
        <view bindtap="goDetails" data-details="{{boundDevice[11]}}" data-devicetype='11'>
          <image src="/img/dev_img4.png"></image>
          <view>
            <text>{{boundDevice[11].length}}</text>
            <view>全程温控</view>
          </view>
        </view>
      </view> -->
      <!-- <view>
        <view bindtap="goDetails" data-details="{{boundDevice[20]}}" data-devicetype='20'>
          <image src="/img/dev_img6.png"></image>
          <view>
            <text>{{boundDevice[20].length}}</text>
            <view>实时追溯</view>
          </view>
        </view>
        <view bindtap="goChainCold">
          <image src="/img/dev_img5.png"></image>
          <view>
            <text>{{boundDevice.childNum}}</text>
            <view>子冷链</view>
          </view>
        </view>
      </view> -->
    </view>
    <view class="dts_data" id="dts_data">
      <view class="dts_data_map">
        <view class="dts_data_map_tit" style="display:flex">
          <view><text></text>全程轨迹</view>
          <view bindtap="isShow" style="position: relative;">
            <view>{{isShowText}}</view>
            <view class="{{isshow ?'isNone':'isBlock'}}">{{deviceCode}}</view>
          </view>
        </view>
        <view class="dts_data_map_con">
          <map id="index_map" class="index_map" latitude="{{latitude}}" longitude="{{longitude}}" polyline="{{polyline}}" markers="{{markers}}">
            <!-- <cover-view class="dingwei" bindtap="setMapCenter">
              <cover-image class="dingwei_img" src="/img/dingwei.png"></cover-image>
            </cover-view> -->
          </map>
        </view>
      </view>
      <view class="dts_data_tmp">
        <view class="dts_data_map_tit">
          <view>
            <text></text>追溯结果
          </view>
          <view bindtap="goTempDetail">查看详情</view>
        </view>
        <view class="index_wd_nav">
          <view class="{{nav==0?'sec':''}}" bindtap="setNav" data-val="0">近7天</view>
          <view class="{{nav==1?'sec':''}}" bindtap="setNav" data-val="1">自定义时间</view>
          <view class="{{nav==2?'sec':''}}" bindtap="setNav" data-val="2">全部</view>
        </view>
        <view class="index_wd_time" wx:if="{{nav==1}}">
          <picker mode="date" value="{{startDate}}" bindchange="startDateChange">
            <view class="picker">
              {{startDate || "起始时间"}}
            </view>
          </picker>
          <view class="index_wd_time_txt">/</view>
          <picker mode="date" value="{{endDate}}" bindchange="endDateChange">
            <view class="picker">
              {{endDate || "结束时间"}}
            </view>
          </picker>
          <view class="index_wd_time_btn" bindtap="submitDate">确认</view>
        </view>
        <view class="index_wd_chart">
          <ec-canvas id="ecDomWen" canvas-id="ecWen" ec="{{ ec }}" wx:if="{{temperature && temperature.length>0}}">
          </ec-canvas>
          <view class="no_data" wx:if="{{!temperature || temperature.length==0}}">
            <image src="/img/nodata_img1.png"></image>
            <view class="no_data_txt">数据正在上传中</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>
<view class="footer">
  <view>
    <view style="position: relative;">
      <view class="allMoer" bindtap="isAllMoer">
        <text>更多</text>
      </view>
      <view class="transportStatus">
        <text wx:if="{{details.transportStatus == 00}}" bindtap="setmodalHidden" data-transportStatus="{{details.transportStatus}}">已入库</text>
        <text wx:if="{{details.transportStatus == 10}}" bindtap="setmodalHidden" data-transportStatus="{{details.transportStatus}}">已出库</text>
        <text wx:if="{{details.transportStatus == 20}}" bindtap="setmodalHidden" data-transportStatus="{{details.transportStatus}}">已结束</text>
      </view>
      <view class="expand" wx:if="{{allMoer}}">
        <view style="display: none;">查看详情</view>
        <view bindtap="showChaWin">绑定标签</view>
        <view wx:if="{{ispdfBut}}" bindtap="goPdf" data-orderId="{{transportOrder.uid}}" data-id="{{details.chainId}}">获取报告</view>
      </view>
    </view>
    <view bindtap="cleanWarning" data-status="{{details.status}}" class="{{details.status == 20 ?'query_clear20':details.status == 10 ? 'query_clear10':'query_clear00'}}">
      <text>解除预警</text>
    </view>
  </view>
</view>
<!--出库入库地址  -->
<view>
  <modal title="填写地址" hidden="{{modalHidden}}" confirm-text="保存" cancel-text="取消" bindconfirm="modalBindaconfirm" bindcancel="modalBindcancel">
    <view class="info_item">
      <view class="info_text">
        <image src="/img/warnAddr.png"></image>
        <view>
          <block>
            <picker mode="selector" bindchange="setType" value="{{deptType}}" range="{{seleteType}}" range-key="transportStatusName">
              <view class="picker">
                <text>{{deptType ?'运输状态选择为：'+seleteType[deptType].transportStatusName :'请选择运输状态'}}</text>
              </view>
            </picker>
          </block>
        </view>
      </view>
      <view class="time">
        <picker mode="region" bindchange="regionChange" value="{{region}}" custom-item="{{customItem}}">
          <view class="picker" wx:if="{{region.length != 0}}">
            {{region[0]}}，{{region[1]}}，{{region[2]}}
          </view>
          <view wx:else>
            请选择地址
          </view>
        </picker>
      </view>
    </view>
    <input type="text" class="modalVal" placeholder="详细地址（如街道、小区、乡镇、村）" value="{{modalVal}}" bindinput="setModalVal"></input>
  </modal>
</view>
<view class="{{showChaType ?'cha_win':''}}" bindtap="closeChaWin">
  <view class="cha_win_con {{showChaType ?'cha_btn_con_transform':''}}">
    <view class="cha_win_tit">
      <text>选择扫描方式</text>
      <view bindtap="goScanSetting">编辑</view>
    </view>
    <view class="cha_win_btn">
      <block wx:for="{{tableCoin}}" wx:for-index='index' wx:index='index' wx:for-item="item">
        <view class="cha_btn_item" bindtap="addChain" data-type="{{item.type}}" wx:if="{{item.status}}">
            <image src="{{item.img}}"></image>
            <view>{{item.name}}</view>
        </view>
      </block>
    </view>
    <view class="cha_win_close" bindtap="closeChaWin">
      <text>×</text>
    </view>
  </view>
</view>
<view class="zan-dialog {{ showDialog ? 'zan-dialog--show' : '' }}">
  <!-- 如果想点击弹窗外不隐藏，取消bindtap点击事件即可 -->
  <view class="zan-dialog__mask" bindtap="toggleDialog" />
  <view class="zan-dialog__container">
    <view class="cha_win_tit">请选择</view>
    <view class="selectInfo">
      <view bindtap="chainBind">
        <image src="/img/X202.png"></image>
        <view>扫描</view>
      </view>
      <!-- <view bindtap="inputBind">
        <image src="/img/input.png"></image>
        <view>手动输入编号</view>
      </view>
      <view bindtap="addChain" data-type="NFC" wx:if="{{devicetype == 'lableX202'}}">
        <image src="/img/x1.png"></image>
        <view>NFC</view>
      </view> -->
    </view>
    <view class="cha_win_close" bindtap="toggleDialog">
      <text>×</text>
    </view>
  </view>
</view>