<template>
        <!--<van-nav-bar @click-right="unbind()"  :title="title" right-text="解绑" />-->
</template>

<script>
    export default {
        name: "headerNav",
        props: {
            "iccid": String,
            "openid": String,
            "cardType":String,
             "balance":Number,
             "title":String
        },
        mounted() {
        },
        data(){
          return{

          }
        },
        methods:{
            unbind(){
              let _this=this

              //解绑当前iccid
              //_this.iccid=_this.$store.state.iccid
              /*if(_this.openid==null){
                      _this.openid=_this.$store.state.openid
              }
              if(_this.cardType==null){
                      _this.cardType=_this.$store.state.cardType
              }
              if(_this.appid==null){
                      _this.appid=_this.$store.state.appid
              }*/
              _this.$ajax.post(process.env.VUE_APP_SERVER+"/web/un-bind",{
                  "iccid":_this.iccid,
                  "openid":_this.openid
              }).then(res=>{
                  if(res.data.code==="0"){
                      sessionStorage.clear()
                      _this.$toast.success(res.data.data)
                      _this.$router.push({
                          name:"bind",
                          params:{
                              "openid":_this.openid,
                              "appid":_this.appid
                          }
                      })
                  }else{
                      _this.$toast.fail(res.data.msg)
                  }

              })
            },

        }
    }
</script>

<style scoped>

</style>