<template>


      <div class="">
         <!--图片链接组件2开始-->
         <div class="common_ad_pc_2"><!--使用此组件，请复制此div-->
            <span class="ad-fastlink"><a href="/projectlist?type=pxjh"><img src="../../theme-chalk/src/images/ad-link-pic01.png" alt=""></a></span>
         </div>
         <!--图片链接组件2结束-->
            <el-login ref="child" @setOpen="setOpen" @isphone="isPhone" @isname="isName" @iscard="isCard"  @iscode="isCode" @dataNull="dataNull" :isCard="iscard" :isPhone="isphone" :isName="isname" :isCode="iscode" :open="isOpen"></el-login>

      </div>

</template>

<script>
import formMixin from "../../../src/mixins/formMixin";
import lenye_base from "lenye_base";
import * as $ from "fy-kit";
import login from "../../login";
import msg from "../../message";

export default {
  name: "ElLinks",
  mixins: [formMixin],
  components: {
    login,
    msg
  },
  props: {
    placeholder: {
      type: String,
      default: "总访问量a"
    }
  },
  data() {
    return {
      isWx: true,
      hasWx: true,
      isOpen: false,
      isphone: false,
      iscard:false,
      isname:false,
      iscode: false,
      loginName: "",
      password: "",
      ucIdcard:'',
      ucName: '',
      ucCertNo: '',
    };
  },
  computed: {
    defaultAttrs() {
      return {
        placeholder: this.t("ele-form.input") + this.desc._label
      };
    }
  },
  //common/pageQuery.do
  methods: {
    toLink(){
      $._.default("#pxjh").click();

    },
    query() {
      $.util
        .ajax(
          lenye_base.base_data.getapiUrl() +
            "/cert-service/common/ctUserCert/queryManagePage.do", // 缺common 接口
          lenye_base.base_data.getformatting({
            sites: lenye_base.site_data.getsiteData().siteId,
            ucIdcard:this.ucIdcard,
            ucName: this.ucName,
            ucCertNo: this.ucCertNo,
          })
        )
        .then(res => {
          if (res.success != "1") {
            msg.error(res.message);
          }
        });
    },
    logins() {
      if (!this.loginName) {
        msg.warning("用户名不能为空！");
        return false;
      } else if (!this.password) {
        msg.warning("密码不能为空！");
        return false;
      }
      $.util
        .ajax(
          lenye_base.base_data.getapiUrl() +
            "/base-service/login/passwordLogin.do",
          lenye_base.base_data.getformatting({
            loginName: this.loginName,
            password: this.password
          })
        )
        .then(res => {
          if (res.success === "1") {
            msg.success("登录成功！");
            localStorage.userData =JSON.stringify(res.data);
            lenye_base.user_data.loginSuccess(res.data);
            window.location.reload();
          } else {
            msg.error(res.message);
          }
        });
    },
    setOpen(data) {
      this.isOpen = data;
    },
    regAccount() {
      this.isOpen = true;
      this.$refs.child.clearData();
    },
    isPhone(data) {
      this.isphone = data;
    },
     isName(data) {
      this.isname = data;
    },
    isCode(data) {
      this.iscode = data;
    },
    isCard(data){
      this.iscard = data;
    },
    dataNull(data) {
      this.isphone = data;
      this.iscode = data;
    }
  }
};
</script>
