import { findDataInfo ,documentsList} from '../../api/documentManagement'
export default {
    data(){
        return{
            rateList:[
                {
                    value:"nexa",
                    label:"nexa",
                    img:`${this.$baseApi}img/nexa.png`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"10000",
                },
                {
                    value:"grs",
                    label:"grs",
                    img:`${this.$baseApi}img/grs.svg`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"1",
                },
                {
                    value:"mona",
                    label:"mona",
                    img:`${this.$baseApi}img/mona.svg`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"1",
                },
                {
                    value:"dgbs",
                    label:"dgb(skein)",
                    img:`${this.$baseApi}img/dgb.svg`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"1",
                },
                {
                    value:"dgbq",
                    label:"dgb(qubit)",
                    img:`${this.$baseApi}img/dgb.svg`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"1",
                },
                {
                    value:"dgbo",
                    label:"dgb(odocrypt)",
                    img:`${this.$baseApi}img/dgb.svg`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"1",
                },
                {
                    value:"rxd",
                    label:"radiant",
                    img:`${this.$baseApi}img/rxd.png`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"100",
                },
                // {
                //     value:"enx",
                //     label:"Entropyx(Enx)",
                //     img:`${this.$baseApi}img/enx.svg`,
                //     rate:"1%",
                //     address:"",
                //     mode:"PPLNS+PROPDIF",
                //     quota:"5000",
                // },
                {
                    value:"alph",
                    label:"alephium(alph)",
                    img:`${this.$baseApi}img/alph.svg`,
                    rate:"1%",
                    address:"",
                    mode:"PPLNS+PROPDIF",
                    quota:"1",
                },
               
               



            ],
            DetailsParams:{
                lang:this.$i18n.locale,             
                childType:2,//1服务条款、2费率、3API文档  childType
                id:'',
            },
            info:"",
            rateLoading:false,
            
            listParams:{
                // type:"1",//挖矿教程
                lang:this.$i18n.locale,
                pageNum:1,
                pageSize:50,
                childType:2,//1服务条款、2费率、3API文档  childType
              },
              navList:[],
              contentShow:false,

        }
    },
    mounted(){
        this.fetchAllList(this.listParams)
        // this.fetchProblemDetails(this.DetailsParams)
    },
    methods:{
        async fetchAllList(params){
            this.setLoading('rateLoading', true);
          const res = await documentsList(params)
          console.log(res,"res");
          
          if (res && res.code === 200) {
            this.navList = res.rows
          
            if (this.$route.query.id) {
                this.DetailsParams.id = this.$route.query.id
               
            }else{
                this.DetailsParams.id = res.rows[0].id;                
            }
            if (this.DetailsParams.id) {
                this.fetchProblemDetails(this.DetailsParams)
            }
            
          }
        
        },
        async fetchProblemDetails(params) {
            this.setLoading('rateLoading', true);
            const res = await findDataInfo(params)
            if(res && res.code === 200){
           
                this.info = res.data.content || ""
                this.contentShow = true
            }
            this.setLoading('rateLoading', false);
        },

        backMenu(){
            this.contentShow = false
        },

        clickJump(item) {
           
            this.DetailsParams.id = item.id
            this.fetchProblemDetails(this.DetailsParams)
          



        },
    }
}