
import {getImageUrl} from "../../../utils/publicMethods.js"
export default {
    data(){
        return{
          
            activeName:"1",
        }
    },
    mounted(){
        
        // if (this.$route.query.coin) {
        //     this.activeCoin = this.$route.query.coin
        //     // this.currencyPath = this.$route.query.imgUrl
        //     this.imgUrl = this.$route.query.imgUrl
        //     this.currencyPath= this.$route.query.imgUrl
        //     this.params.coin = this.$route.query.coin
        //     this.$addStorageEvent(1,`activeCoin`,JSON.stringify(this.activeCoin))
        //     this.activeItem = this.currencyList.find(item=>{return item.value==this.params.coin})
        // }



        // let activeCoin=localStorage.getItem("activeCoin")
        // this.activeCoin= JSON.parse(activeCoin)
        // window.addEventListener("setItem", () => {
        //     let activeCoin=localStorage.getItem("activeCoin")
        //     this.activeCoin= JSON.parse(activeCoin)
        // });

        // console.log(this.activeCoin,"鸡脚低端局");
        

        // if ( !this.activeCoin ) {
        //     this.activeCoin ="nexa"
        //     this.imgUrl = `https://test.m2pool.com/img/nexa.png`
        //     this.currencyPath= `https://test.m2pool.com/img/nexa.png`
        //     this.params.coin ="nexa"
        //     this.$addStorageEvent(1,`activeCoin`,JSON.stringify(this.activeCoin))
        //     this.openAPI =true
        // }else if(this.activeCoin==`nexa` || this.activeCoin==`rxd`){

        //     this.openAPI =true
        //    try {
        //     this.pageTitle = this.currencyList.find(item => item.value == this.activeCoin).name
        //     this.imgUrl = this.currencyList.find(item => item.value == this.activeCoin).imgUrl
        //    } catch (error) {
        //         console.log(error);
                
        //    }
          
        // }else{
        //     this.openAPI =false
        // }
   

        

        
    },
    methods:{
        getImageUrl(path) {
            return getImageUrl(path);
          },
        clickJump(item){ 
           
            this.activeCoin=item.value
            this.pageTitle = item.name
            this.imgUrl = item.imgUrl
            this.$addStorageEvent(1,`activeCoin`,JSON.stringify(item.value))
            // this.$router.push(item.url)
            console.log(this.activeCoin);
        },
        clickCopy(value){
            navigator.clipboard.writeText(value).then(() => {
                this.$message({
                    showClose: true,
                    message: this.$t(`personal.copySuccessful`),
                    type: 'success',
                
                });
              }).catch(err => {
                console.log('复制失败', err);
                this.$message({
                    showClose: true,
                    message: this.$t(`personal.copyFailed`),
                    type: 'error',
                   
                });
              });
        },
   
       
    },
    

}