<template xmlns="http://www.w3.org/1999/html">
  <b-page @bPageLoaded="voiceCallback"></b-page>
  <count-down times=300 bottomOffset="0" rightOffset="10" fontSize="16" ref="child"></count-down>

    <div class="inquiryUnemployment">
      <div style="padding-top: 18%;">
        <div style="margin-top: 45px;">
          <font size="6" color="#FFFFFF">失业原因为"被单位辞退"或"劳动合同到期"才能办理失业金申领！<br><br>
            若您的失业原因符合要求，请您点击下一步！<br><br>
            若您的失业原因不符合要求，请您点击取消！</font>
        </div>
        <div style="position: absolute;margin-left: 248px;margin-top: 170px;">
          <img style="width: 90%;" src="../assets/images/btn/btnCancel.png" @click="quit" id="confirm">
        </div>
        <div style="position: absolute;margin-left: 600px;margin-top: 170px;">
          <img style="width: 90%;" src="../assets/images/btn/btnNext.png" @click="nextClick" id="cancel">
        </div>
      </div>
    </div>

</template>
<style scoped>
.inquiryUnemployment{
  background-image: url('../assets/images/background.png');
  background-repeat: no-repeat;
  background-size: cover;
  overflow:auto;
  margin-bottom: 20px;
  padding: 0 70px;
  height:100%;
}
</style>
<script>
import BPage from "@/components/registerVoice";
export default{
  components: {
    BPage,
  },
  data() {
    return {
      projectId: '',//事项ID
      serviceId: '',//机器人ID
      projectName:'',//事项名称
    }
  },
  created() {
    this.projectId = this.$route.query.projectId;
    this.serviceId = this.$route.query.serviceId;
    this.projectName = this.$route.query.projectName;
    this.playAudio();
  },
  methods:{
    playAudio(){
      if(robotType){
        robotsdk.playAudio({
          cmd: "cmd",
          animation: 0,
          videocontent: "失业原因为被单位辞退或劳动合同到期才能办理失业金申领。若您的失业原因符合要求，请您点击下一步。若您的失业原因不符合要求，请您点击取消。",
          callback: ""
        })
      }
    },

    //点击下一步
    nextClick(){
      if(robotType){
        this.$router.push({ path: '/userSelect',query: {projectId: this.projectId ,serviceId:this.serviceId, projectName:this.projectName}});//转跳身份选择页面
      }
    },

    //点击取消
    quit(){
      if(robotType){
        robotsdk.closeExternalApp({
          mode:0
        });
      }
    },

    //语音回调（只处理下一步和退出）
    voiceCallback(res){
      if (res=="nextStep"){
        this.nextClick();
      }

      if (res=="quit"){
        if(robotType){
          robotsdk.closeExternalApp({
            mode:0
          });
        }
      }
    }
  }
}
</script>