liangjin
2021-03-23 eb9443b959ad490ac735f2c04e4dee743d7365c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!--
 * @Author: 小明丶
 * @Date: 2020-08-10 14:02:37
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-10-23 09:47:15
 * @Description: 通联通道开通
-->
<template>
  <div class="tonglian-open-page">
    <v-navbar title="开通通联通道"></v-navbar>
    <div class="info-box">
      <van-cell-group>
        <van-field
          label-class="label-class"
          label-width="200px"
          input-align="right"
          maxlength="11"
          disabled
          v-model="legalMblNo"
          label="法人手机号"
        />
        <van-field
          v-model="authCode"
          input-align="right"
          center
          clearable
          maxlength="6"
          label="验证码"
          placeholder="请输入短信验证码"
        >
          <template #button>
            <button class="code-btn" :disabled="btnDis" @click="getCode">{{btnText}}</button>
          </template>
        </van-field>
      </van-cell-group>
    </div>
    <p style="font-size:12px;color:#666;padding:20px 1vw">您正在开通网商银行订单账款服务,开通后可使用和微分钱包服务。请点击合同查看并确认后勾选以提交申请。</p>
 
    <van-checkbox v-model="checked" icon-size="16px" checked-color="#896EDB" style="padding:0 2vw">
      <span style="font-size:12px;color:#896EDB" @click.stop="ShowAgreen = true">《网商银行订单账款合同》</span>
    </van-checkbox>
 
 
 
 
    <van-button
      round
      size="large"
      @click="goNext"
      color="#896EDB"
      style="width:86vw;margin-left:7vw;margin-top:60px"
    >提交申请</van-button>
    <van-popup v-model="ShowAgreen">
      <div class="agreenBox">
        <div class="agreen-html" v-html="Agreend"></div>
          <div class="close-agreen" @click="ShowAgreen = false">
            <van-icon name="close" />
          </div>
        </div>
    </van-popup>
  </div>
</template>
<script>
import Vue from "vue";
import { Field, Toast } from "vant";
import { mapState } from "vuex";
Vue.use(Toast);
Vue.use(Field);
export default {
  data() {
    return {
      btnDis: false,
      btnText: "发送验证码",
      authCode: "",
      timer: "",
      hasGetCode:1,
      ShowAgreen:true,
      checked:'',
    };
  },
  computed: {
    ...mapState(['userinfo']),
    legalMblNo() {
      return JSON.parse(sessionStorage.getItem(`sib_tl_openInfo_${this.userinfo.orgId}`)).detailInfo
        .legalMblNo;
    },
  },
  created(){
    this.Agreend = agreement4
  },
  methods: {
    /**
     * @description:下一步跳转
     * @return void
     * **/
    goNext() {
      if(this.authCode==''){
        Toast.fail('请输入验证码');
        return  false
      }
      if(!this.checked){
        Toast.fail('请阅读并勾选《网商银行订单账款合同》');
        return  false
      }
      let obj = JSON.parse(sessionStorage.getItem(`sib_tl_openInfo_${this.userinfo.orgId}`));
 
      let picIdList = {
        licencePhotos: obj.detailInfo.licencePhotos,
        cardFrontPhotos: obj.detailInfo.cardFrontPhotos,
        cardBackPhotos: obj.detailInfo.cardBackPhotos,
        handCardPhotos: obj.detailInfo.handCardPhotos,
        storeInnerPhotos: obj.detailInfo.storeInnerPhotos,
        storeSignPhotos: obj.detailInfo.storeSignPhotos,
        industryLicensePhotos: obj.detailInfo.industryLicensePhotos
      };
      // for (let i in this.uploadObj) {
      //   this.uploadObj[i].forEach(item => {
      //     picIdList[i].push(item.id + "");
      //   });
      // }
      if(this.hasGetCode==2){
        this.$api
        .tltMerOpenOpen({
          ...obj.detailInfo,
          authCode:this.authCode
        })
        .then((res) => {
          sessionStorage.removeItem(`sib_tl_openInfo_${this.userinfo.orgId}`)
          sessionStorage.removeItem(`sib_tl_pic_${this.userinfo.orgId}`)
          this.$router.push({
            path: "/tonglian/open-result",
            query: {
              ...this.$route.query,
              nck:true
            },
          });
        });
      }else{
        Toast.fail('请获取验证码');
      }
 
    },
    /**
     * @description:获取验证码
     * @return void
     * **/
    getCode() {
      this.$api
        .tltMerOpenSendSmsCode({
          mblNo: this.legalMblNo,
        })
        .then((res) => {
          this.hasGetCode = 2
          this.btnDis = true;
          this.btnText = 60;
          this.timer = setInterval(() => {
            if (this.btnText == 1) {
              this.btnText = "重新获取";
              this.btnDis = false;
              clearInterval(this.timer);
            } else {
              this.btnText = --this.btnText;
            }
          }, 1000);
        });
    },
  },
};
</script>
<style lang="less" scoped>
.tonglian-open-page {
  & {
    min-height: 100vh;
    background: #f5f5f7;
  }
  /deep/.label-class{
    font-size: 16px;
    color: #333;
  }
  .info-box {
    margin-top: 10px;
    width: 98vw;
    margin-left: 1vw;
  }
  .code-btn {
    border: 0;
    border-left: 1px solid #e6e6e6;
    background: #fff;
    outline: none;
    color: #896edb;
    padding-right: 0;
    text-align: right;
  }
  .agreenBox {
    width: 80vw;
    height: 70vh;
    padding: 60px 20px 30px 20px;
    position: relative;
  }
  .agreen-html {
    width: 100%;
    height: 100%;
    overflow: scroll;
    box-sizing: border-box;
  }
  .close-agreen {
    .lh(30px);
    .flex(center, center);
 
    .van-icon {
      font-size: @font-16;
    }
  }
}
</style>