zhouhao
2022-01-06 8c26da112a49b7ef734c2e8aed7d5a22c0b356da
src/views/main/addBankcard.vue
@@ -1,7 +1,7 @@
<template>
  <div class='text-main'>
    <van-nav-bar  :title="title"  left-arrow  @click-left="onClickLeft" />
    <!-- <van-nav-bar  :title="title"  left-arrow  @click-left="onClickLeft" /> -->
    <van-form validate-first ref="credRef">
      <div  class="bes-title"><div> 分销个人</div></div>
      <!-- <van-field v-model.trim="dataForm.bankCardNo" label="银行卡号" placeholder="请输入银行卡号" :rules="bankId" name="bankId" clearable>
@@ -10,20 +10,24 @@
        </template>
      </van-field> -->
      <!-- <van-field readonly clickable name="noName" :value="bankName" label="银行名称" placeholder="请选择银行名称" @click="showPicker = true"  :rules="noName"  right-icon="arrow"/> -->
      <div>
      <van-field v-model.trim="dataForm.bankCardMblNo"   label="姓名:"    readonly/>
      <van-field v-model.trim="dataForm.bankCardMblNo"  label="身份证号:"  readonly/>
      <div v-if="this.bizType==0 && this.dataInfo.status==0 || this.dataInfo.status==0 && this.bizType==1">
      <van-field v-model.trim="dataForm.name"   label="姓名:"    readonly/>
      <van-field v-model.trim="dataForm.idNo"  label="身份证号:"  readonly/>
      </div>
      <!-- <van-field v-model.trim="dataForm.verCode" center clearable label="短信验证码" :rules="codeRules" placeholder="请输入短信验证码" >
      <div v-else>
      <van-field v-model.trim="dataForm.name"   label="企业名称:"    readonly/>
      <van-field v-model.trim="dataForm.idNo"   label="负责人姓名:"  readonly/>
      <van-field v-model.trim="dataForm.idNo"   label="负责人姓名:"  readonly/>
      </div>
      <van-field v-model.trim="dataForm.verCode" center clearable label="短信验证码" :rules="codeRules" placeholder="请输入短信验证码" >
        <template #button>
          <van-button size="small" color="#E43A28" @click.stop="getCode"  native-type="button" :disabled="isdisabled">{{codeText}}</van-button>
          <van-button size="small" color="#6cc3bb" @click.stop="getCode"  native-type="button" :disabled="isdisabled">{{codeText}}</van-button>
        </template>
      </van-field> -->
      </van-field>
      <div class="index-title">
        <van-checkbox v-model="checked" style="height:30px; margin-right:5px" checked-color="#6cc3bb"></van-checkbox>
        <div  v-if="orderType==1"> 阅读并同意<span  style="border-bottom:1px solid #00F; color:#00F"  @click="show=true">《信息授权函》</span>的签订</div>
        <div  v-if="orderType==2"> 阅读并同意<span  style="border-bottom:1px solid #00F; color:#00F"  @click="showx=true">《保理付款服务合同》</span>的签订</div>
        <div  v-if="bizType==0 && $route.query.types!=1"  style="color:#999999;font-size:12px"> 阅读并同意<span  style="border-bottom:1px solid #00F; color:#00F"  @click="show=true">《信息授权函》</span>的签订</div>
        <div  v-if="bizType==1 && $route.query.types!=1"  style="color:#999999;font-size:12px"> 阅读并同意<span  style="border-bottom:1px solid #00F; color:#00F"  @click="showx=true">《保理付款服务合同》</span>的签订</div>
      </div>
      <div style="margin: 16px;margin-top:30px">
        <van-button round block  color="#6cc3bb" @click="onFailed" native-type="submit">确认</van-button>
@@ -66,9 +70,8 @@
    //这里存放数据
    return {
      dataForm: {
        bankCode:'',
        bankCardNo:''
      },
      dataInfo:{},
      ishowFile:true,
      dataObj :{},
      showPicker: false,
@@ -80,9 +83,8 @@
      show: false,
      showx: false,
      bankName:'',
      orderId:this.$route.query.orderId,   //订单编号
      orderType:this.$route.query.orderType,  //订单类型
      title:this.$route.query.orderType==1?'授信信息确认':'签约信息确认',
      bizId:this.$route.query.bizId,   //订单编号
      bizType:this.$route.query.bizType,  //订单类型
      codeText: '获取验证码',
      noName: [
        {
@@ -157,29 +159,17 @@
  //方法集合
  methods: {
    bankCardNoInit() {
         console.log(this.orderId)
         console.log(this.orderType)
      // this.$api.bankCardInit({ orderId: this.orderId}).then(res => {
      //   if (res.body.orderStatus==0){  // 待绑卡
      //    this.dataForm.bankCardMblNo =res.body.mblNo
      //    this.dataObj =res.body
      //    this.agreementextw = repstrw(this.dataObj.userName,this.dataObj.idNo);
      //    this.agreementext = repstr(this.dataObj.userName,this.dataObj.idNo);
      //   }else if(res.body.orderStatus==1){ //待活体签约
      //                 this.$api.faceIdUrl({orderId: this.orderId}).then(res => {
      //               window.location.href =res.body.url
      //       })
      //   }else if(res.body.orderStatus==2){ //待审批状态
      //          this.$router.push({path:'/main/queryres',query:{orderId: this.orderId}})
      //   }else if(res.body.orderStatus==3){ //已拒绝
      //       this.$router.push({path:'/main/queryres',query:{orderNo: this.$route.query.orderId,orderStatus:3}})
      //   }else if(res.body.orderStatus==4){ //待签约
      //       this.$router.push({path:'/main/findPre',query:{orderId: this.$route.query.orderId}})
      //   }
      //   else if(res.body.orderStatus==5){//待支付首期款
      //   }
      // })
        let  objForm ={bizId:this.bizId,bizType:this.bizType}
          this.$api.getBizStatus(objForm).then(res=>{
             this.dataInfo  =res.body
            if (this.dataInfo.status==0){
                this.$api.getFrontData(objForm).then(res=>{
                     this.dataForm  =res.body
                })
            }else if(this.dataInfo.status==1 &&  Number(this.bizType)==0 || this.dataInfo.status==1 && Number(this.bizType)==1 || this.dataInfo.status==4 && Number(this.bizType)==1){
                this.$router.push({path:'/main/queryres',query:{...objForm}})
            }
          })
    },
    onClickLeft(){
     
@@ -192,6 +182,16 @@
    onFailed() {
      let mes  = `请阅读并同意${this.orderType==1?'信息授权函':'保理付款服务合同'}`
       if (!this.checked) return this.$notify(mes)
             let objUrl
            if (process.env.NODE_ENV === "development") {  //开发环境
             objUrl = `https://t.finlean.com/comn_business/#/main/queryres?bizId=${this.bizId}&bizType=${this.bizType}`
            }  else{  //生产
              objUrl = `${window.location.origin}/comn_business/#/main/queryres?bizId=${this.bizId}&bizType=${this.bizType}`
            }
            const objForm ={bizId:this.bizId,bizType:this.bizType,callbackUrl:objUrl}
             this.$api.getFaceUrl(objForm).then(res=>{
                 window.location.href=res.body.faceUrl
             })
      // this.$refs.credRef.validate().then(() => {
      //   // 验证通过
      //   if (this.dataForm.verCode ==undefined || this.dataForm.verCode =='') return this.$notify('请输入验证码')
@@ -310,6 +310,7 @@
  },
  //生命周期 - 创建完成(可以访问当前this实例)
  created() {
    console.log(process.env.NODE_ENV )
    this.bankCardNoInit()
  },
  //生命周期 - 挂载完成(可以访问DOM元素)