<template>
  <div class="app-container">
    <div class="header_main">
      种子扫描
      <div class="return_btn" @click="onClickLeft"></div>
      <div class="add_btn" @click="onClickLeft"></div>
      <div class="top_box">
        <div class="top_01">
          <img src="../../../../static/images/lawEnforcement/new/retrospect_icon_10.png">
          <p>码上放心</p>
        </div>
        <img src="../../../../static/images/lawEnforcement/new/retrospect_icon_18.png" class="retrospect_icon" @click="$router.push({name:'lawEnforcementScan'})">
        <p class="tt">产品溯源信息</p>
        <div class="top_02">
          <p><i></i>一物一码</p>
          <p><i></i>扫码验真</p>
          <p><i></i>拒绝假货</p>
        </div>
      </div>
      <div class="jg"></div>
    </div>

    <div class="main">

      <div class="main_box">
        <a style="font-size: 14px;display: block;width: 100%;text-align: center;">{{scanLink}}</a>
      </div>
      <div class="iframe-wrap" v-if="scanLink.indexOf('http')>-1">
        <iframe id="iframe" :src="scanLink" class="iframe" width="100%" frameborder="0"></iframe>
      </div>

<!--      <div class="main_box center_box" style="margin-top: 10px;">-->
<!--        <img src="../../../../static/images/lawEnforcement/new/retrospect_icon_15.png" alt="">-->
<!--        <p>该产品单元识别代码合规</p>-->
<!--        <p>1534565635645126353535335656</p>-->
<!--      </div>-->

<!--      <div class="main_box" style="margin-top: 10px;">-->
<!--        <van-cell :border="false">-->
<!--          <template #title>-->
<!--            <span class="custom-title">草甘膦铵盐</span>-->
<!--          </template>-->
<!--        </van-cell>-->
<!--        <van-cell title="登记证号" :border="false" value="登记证号" />-->
<!--        <van-cell title="有效成分" :border="false" value="有效成分" />-->
<!--        <van-cell title="剂型" :border="false" value="剂型" />-->
<!--        <van-cell title="总含量" :border="false" value="总含量" />-->
<!--        <van-cell title="有效期至" :border="false" value="有效期至" />-->
<!--        <van-cell title="登记持有人" :border="false" value="登记持有人" />-->
<!--      </div>-->

<!--      <div class="main_box" style="margin-top: 10px;">-->
<!--        <van-cell title="防伪追溯网址" :border="false" value="防伪追溯网址" />-->
<!--        <van-cell title="单元识别代码" :border="false" value="单元识别代码" />-->
<!--      </div>-->

    </div>
  </div>
</template>

<script>
  import {getScheme, getSurveyByCaseId} from "@/api/lawEnforcement/index";
  import Cookies from "js-cookie";
  export default {
    name: "programmeDetail",
    data() {
      return {
        showBankType:false,
        showPayeeType:false,
        showPicker:false,
        form:{},

        bankType:'',
        payeeType:'',
        value:'',

        bankTypeOptions:[],
        payeeTypeOptions:[],
        tEnforceSchemeHandlerList:[],
        minDate: new Date(2020, 0, 1),
        maxDate: new Date(2025, 10, 1),
        currentDate: new Date(2021, 0, 17),

        activeNames: ['1'],
        activeNames1: ['1'],
        activeNames2: ['1'],

        scanLink:'',
      };
    },
    created() {
      // this.getDictionaries()
      console.log("aaaaaaaaaa")
    },
    methods: {
      getDictionaries(){
        getScheme(this.$route.query.id).then((response) => {
          this.form = response.data;
        });
      },
    },
    watch: {
      $route (to, from ) {
        // 监听路由变化, 实现类似 小程序的 onShow 事件
        console.log(to.path)
        if (to.path === '/lawEnforcement/retrospectDetail') {
          // do anything you want
          if (Cookies.get('scanLink')){
            alert(Cookies.get('scanLink').indexOf('http')>-1)
            this.scanLink = Cookies.get('scanLink');
            console.log(this.scanLink)
          }
        }
      }
    },
  }
</script>

<style scoped lang="scss">
  .jg{
    height: 80px;
  }
  .app-container {

    height: 100vh;

    overflow: hidden;

  }
  .iframe-wrap{

    position: relative;

    overflow: hidden;

    width: 100%;

    height: calc(100vh - 269PX);

    background: #eee;

  }
  .iframe{

    width: calc(100% + 20PX);

    border: none;

    position: absolute;

    right: -20PX;

    top: 0;

    bottom: 0;

    overflow-x: hidden; overflow-y: scroll;

    height: 100%;

  }
  .retrospect_icon{
    position: absolute;
    top: 0;
    right: 0;
  }
  .top_box{
    line-height: 1;
    text-align: left;
    width: 85%;
    margin: 0 auto;
    padding-bottom: 10PX;
    background: url('../../../../static/images/lawEnforcement/new/retrospect_icon_14.png') no-repeat right bottom;
    position: relative;
    .top_01{
      display: flex;
      align-items: center;
      font-size: 0.4rem;
      margin-top: 15PX;
      img{
        margin-right: 10PX;
      }
    }
    .tt{
      font-size: 0.7rem;
      margin-top: 15PX;
    }
    .top_02{
      display: flex;
      align-items: center;
      font-size: 0.3rem;
      margin-top: 15PX;
      i{
        display: inline-block;
        width: 15PX;
        height: 15PX;
        margin-right: 3PX;
      }
      p{
        display: flex;
        align-items: center;
        margin-right: 10PX;
        &:nth-child(1){
          i{
            background: url('../../../../static/images/lawEnforcement/new/retrospect_icon_11.png') no-repeat center;
            background-size: auto 15PX;
          }
        }
        &:nth-child(2){
          i{
            background: url('../../../../static/images/lawEnforcement/new/retrospect_icon_12.png') no-repeat center;
            background-size: auto 15PX;
          }
        }
        &:nth-child(3){
          i{
            background: url('../../../../static/images/lawEnforcement/new/retrospect_icon_13.png') no-repeat center;
            background-size: auto 15PX;
          }
        }
      }
    }
  }
  .main{
    position: relative;
    top: -30PX;
  }
  .center_box{
    text-align: center;
    padding: 30PX 0!important;
    p{
      margin-top: 15PX;
      &:nth-child(2){
        font-size: 0.4rem;
        color: #59C145;
      }
      &:nth-child(3){
        font-size: 0.4rem;
        color: #B4B0B0;
        display: inline-block;
        background: url('../../../../static/images/lawEnforcement/new/retrospect_icon_16.png') no-repeat left center;
        padding-left: 20PX;
      }
    }
  }
  /deep/ .van-cell{
    padding-bottom: 0;
    padding-top: 0;
    margin-bottom: 10PX;
    &:last-child{
      margin-bottom: 0;
    }
  }
  .header_main{
    height: 225PX;
    background: url('../../../../static/images/lawEnforcement/new/header_bg.png') no-repeat;
    background-size: 100% 100%;
    /*position: fixed;*/
    top: 0;
    left: 0;
    width: 100%;
    font-size: 36px;
    line-height: 116px;
    text-align: center;
    color: #fff;
    z-index: 999;
    .return_btn{
      width: 24px;
      height: 43.2px;
      background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
      background-size: 20px 36px;
      position: absolute;
      left: 38px;
      top: 36px;
    }
    .add_btn{
      width: 56.4px;
      height: 40.8px;
      background: url('../../../../static/images/lawEnforcement/new/retrospect_icon_17.png') center center no-repeat;
      background-size: 47px 34px;
      position: absolute;
      right: 38px;
      top: 36px;
    }
  }
  /deep/ .van-radio--horizontal{
    margin-left: 0.32rem;
    margin-right: 0;
  }
  .peopleList{
    padding-right: 3%;
    .van-row{
      margin-bottom: 10PX;
      .van-col{
        text-align: center;
        font-size: 14PX;
      }
      &:first-child{
        .van-col{
          color: #1D6FE9;
        }
      }
    }
  }
  .main_title{
    font-size: 0.4rem;
    color: #1D6FE9;
    margin: 0.2rem 6%;
    margin-top: 0;
    position: relative;
  }
  .main_box{
    width: 96%;
    height: 58PX;
    margin: 0 auto 15PX;
    border-radius: 10PX;
    box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
    overflow: hidden;
    background-color: #FFF;
    padding: 10PX 0;
    .van-icon{
      vertical-align: middle;
    }
    .custom-title{
      font-size: 17PX;
      color: #333333;
      vertical-align: middle;
      line-height: 1;
      position: relative;
    }
    .tap{
      color: #1D6FE9;
    }
    .bgBlue{
      display: block;
      position: absolute;
      width: 17PX;
      height: 17PX;
      border-radius: 50%;
      background-color: rgba(29,111,233,0.26);
      top: -2PX;
      right: -8PX;
    }
  }
  .submitButton{
    width: 45%;
    margin: 0 auto;
    background-image: linear-gradient(to right, #2E79E9 , #77A6EF);
    text-align: center;
    color: #ffffff;
    height: 70px;
    line-height: 70px;
    border-radius: 8PX;
    margin-top: 25PX;
  }

  .addFamily{
    position: absolute;
    top: -2px;
    right: 0;
    border-radius: 50%;
  }
</style>
