<template>
  <div class="wrap" >
    <div class="navBar">
      <van-nav-bar
          title="已售电瓶"
          left-arrow
          left-arrow-color="#FFFFFF"
          :border="false"
          :fixed="true"
          :safe-area-inset-top="true"
          @click-left="h5GoBack"
      > </van-nav-bar>
    </div>
    <div class="container" v-if="batteryDetailList && batteryDetailList.length>0">
      <div class="itemWrap" v-for="(item,index) in batteryDetailList" :key="index">
        <div>
          <span class="halfOpci">设备号</span>
          <span class="allOpci">{{ item.productNo }}</span>
        </div>
        <div>
          <span class="halfOpci">品牌</span>
          <span class="allOpci">{{ item.brand }}</span>
        </div>
        <div>
          <span class="halfOpci">型号</span>
          <span class="allOpci">{{ item.model }}</span>
        </div>
        <div>
          <span class="halfOpci">售卖人员</span>
          <span class="allOpci">{{ item.saleName }}</span>
        </div>
        <div>
          <span class="halfOpci">售卖时间</span>
          <span class="allOpci">{{ item.createTime }}</span>
        </div>
      </div></div>
  </div>
</template>

<script>

import {myMixins} from "@/utils/myMixins"
import {batteryDetailList} from  "@/api/order"
export default {
  name: "batteryDetail",
  mixins:[myMixins],
  data(){
    return{
      batteryDetailList:[],
      isLoading: false,
      loading: false,
      brand: '',
      model:'',
    }
  },
  async mounted() {
    this.brand = this.$route.params.brand;
    this.model = this.$route.params.model;
    await this.getDetailList()
  },
  methods:{
    async getDetailList(){
      let res = await batteryDetailList({
        brand:this.brand,
        model:this.model,
      })
      this.batteryDetailList=res.data.reverse();
    },
  }
}
</script>

<style scoped lang="scss">
@import '@/styles/mixin.scss';
@import "@/styles/common.scss";

.wrap {
  background: #F4F5F7;
  @include wh(100%, 100%);
}
.navBar{
  margin-bottom: 46px;
  .rightWrap{
    @include wh(50px,20px);
    border-radius: 10px;
    opacity: 0.7;
    border: 1px solid #FFFFFF;
    @include flexTwoCenter;
    img{
      @include widHeiMar(9px,8px,4px);
    }
    .addTxt{
      @include fontWeightSize(bolder,11px);
      @include colorOpa( #FFFFFF,0.7);
    }
  }
}
.container{
  @include wh(100%, calc(100% - 56px));
  overflow-y: auto;
  @include sizingPadding(13px,13px);
}
.itemWrap {
  @include wh(100%, 104px);
  @include radiusSizing(6px);
  @include fontWeightSize(400, 12px);
  @include flexBetween;
  background: #FFFFFF;
  box-shadow: 0px 2px 10px 0px rgba(216, 216, 216, 0.5);
  margin-bottom: 10px;
  padding: 11px 13px 9px 15px;
  position: relative;
  .halfOpci {
    display: inline-block;
    width: 60px;
    opacity: .5;
    margin-right: 5px;
  }
  .allOpci {
    opacity: 1;
  }
  .statusNo {
    color: #FF0000;
  }
  .statusYes {
    color: #09B820
  }
  .img{
    width: 20px;
    height: 20px;
    position: absolute;
    right: 10px;
    top: 35%;
    cursor: pointer;
  }
}

</style>
