<ion-view view-title="报修及巡检详情" class="repair">
  <ion-header-bar class="bar-stable header-color">
    <div class="buttons" ng-click="MyRepairDetail.prePage()">
      <button class="button button-icon icon ion-ios-arrow-back">
        <!--<span class="back-button-text">返回</span>-->
      </button>
    </div>
    <h1 class="title">{{MyRepairDetail.detailTitle}}</h1>
  </ion-header-bar>

  <ion-content class="my-repair-detail mine-subfile">
    <div class="cell cell-detail-title" style="padding-left:10px; border-bottom: 1px solid #14a4fa;">
      <div class="hd hd-detail-title">
        <img src="img/repair/gasicon@3x.png" width=25 alt="">
      </div>
      <div class="bd bd-detail-title">
        用户编号：{{MyRepairDetail.detail.gasUserNumber}}
      </div>
      <div class="ft ft-detail-title">
        {{}}
      </div>
    </div>

    <div class="cell cell-detail" ng-repeat="key in MyRepairDetail.keys track by $index">
      <div class="hd hd-detail">
        {{::key.keyLabel}}：
      </div>
      <div class="bd bd-detail"></div>
      <div class="ft ft-detail"
          ng-class="{'color-orange': MyRepairDetail.detail[key.key] === '处理中',
          'color-green': MyRepairDetail.detail[key.key] === '已完成'}">
        {{typeof(MyRepairDetail.detail[key.key]) !== 'undefined' ? MyRepairDetail.detail[key.key] : ''}}
      </div>
    </div>

    <div class="cell cell-detail" style="border: 0px;">
      <div class="hd hd-detail">
        用户备注：
      </div>
    </div>

    <div class="cell cell-detail" style="border-bottom:0;">
      <div class="bd bd-detail">
        {{MyRepairDetail.userNote}}
      </div>
    </div>

    <div ng-if="MyRepairDetail.detail.repairState !== '处理中'">
    <!-- <div> -->
      <div ng-if="MyRepairDetail.detail.repairState == '已出发' || MyRepairDetail.detail.repairState == '已到达'" class="work-info" ng-if="MyRepairDetail.worker">
        <div>
          工号：{{MyRepairDetail.worker.EmpNum}}
        </div>
        <div>
          维修员：{{MyRepairDetail.worker.EmpName}}
          <span style="float:right;">综合服务评分：<span style="color:red;">{{MyRepairDetail.worker.Score}}</span></span>
        </div>
      </div>

      <div ng-if="MyRepairDetail.detail.repairState == '已出发' || MyRepairDetail.detail.repairState == '已到达'"> <!-- trace -->
        <div class="cell" ng-click="MyRepairDetail.showTrace()" style="height:44px; border-top:1px solid #14a4fa; padding:0 16px; line-height:44px;">
          <div class="hd">
            维修员位置信息
          </div>
          <div class="bd">

          </div>
          <div class="ft" ng-if="MyRepairDetail.isShowTrace" style="color:#14a4fa;">
            隐藏<i class="icon ion-chevron-up"></i>
          </div>
          <div class="ft" ng-if="!MyRepairDetail.isShowTrace" style="color:#14a4fa;">
            显示<i class="icon ion-chevron-down"></i>
          </div>
        </div>
        <!-- 轨迹开始才显示 -->
        <div ng-if="!MyRepairDetail.startTime && MyRepairDetail.isShowTrace && MyRepairDetail.unuser">
          <div ng-click="MyRepairDetail.refreshTrace()" style="padding:0 16px 16px 16px; color:gray;">
            {{MyRepairDetail.traceInfoState}}
          </div>
        </div>
        <div class="body-his" ng-if="MyRepairDetail.startTime && MyRepairDetail.isShowTrace && MyRepairDetail.unuser">
          <div class="line-body-his" ng-if="MyRepairDetail.hisLength"></div>

          <div class="item-his" ng-if="MyRepairDetail.startTime">
            <div class="msg-detail-his-not-first">已开始</div>
            <div class="msg-time-his-not-first">{{MyRepairDetail.startTime}}</div>
            <div class="marker-his-not-first"></div>
          </div>

          <div class="item-his" ng-if="h.address" ng-repeat="h in MyRepairDetail.his track by $index">
            <div class="msg-detail-his-not-first">{{h.address}}</div>
            <div class="msg-time-his-not-first">{{h.time}}</div>
            <div class="marker-his-not-first"></div>
          </div>

          <div class="item-his" ng-if="MyRepairDetail.endTime">
            <div class="msg-detail-his-not-first">已到达</div>
            <div class="msg-time-his-not-first">{{MyRepairDetail.endTime}}</div>
            <div class="marker-his-not-first"></div>
          </div>
        </div>
      </div>

      <div ng-if="MyRepairDetail.detail.eval + '' != 'true' && MyRepairDetail.detail.repairState == '已完成'" style="border-top:1px solid #14a4fa;" ng-if="MyRepairDetail.allEvaluate.length > 0 && MyRepairDetail.detail.eval + '' != 'true'">
        <div class="cell" style="height:44px; line-height:44px; margin-left:16px; padding:0 16px 0 0; border-bottom:1px solid #ddd;">
          <div class="hd">
            维修服务评价
          </div>
          <div class="bd">

          </div>
          <div class="ft" ng-if="!MyRepairDetail.canAllFiveStars" ng-click="MyRepairDetail.initFiveStar('empty')" style="color:#14a4fa;">
            重新填写
          </div>
          <div class="ft" ng-if="MyRepairDetail.canAllFiveStars" ng-click="MyRepairDetail.initFiveStar()"  style="color:#14a4fa;">
            五星好评
          </div>
        </div>
        <div ng-if="i.enableFlag == 'Y'" ng-repeat="i in MyRepairDetail.allEvaluate track by $index" ng-init="outerIndex = $index">
          <div class="cell" style="height:44px; margin-left:16px; padding:0 16px 0 0; border-bottom:1px solid #ddd;">
            <div class="hd">
              {{i.dimensionName}}
            </div>
            <div class="bd">

            </div>
            <div class="ft">
              <i ng-click="MyRepairDetail.setStar(outerIndex, $index)" ng-repeat="j in [1,2,3,4,5] track by $index" class="icon" ng-class="{false: 'ion-android-star login-btn-blue', true: 'ion-android-star-outline color-gray'}[MyRepairDetail.currentEvaluate[outerIndex].score < $index + 1]" style="font-size:28px;">
              </i>
            </div>
          </div>
        </div>
      </div>

      <div style="height:30px; width:100%;"></div>
      <button ng-if="MyRepairDetail.detail.eval + '' != 'true' && MyRepairDetail.detail.repairState == '已完成'" ng-click="MyRepairDetail.submit()" class="button btn btn-fill">
        提交
      </button>
    </div>

  </ion-content>
</ion-view>
