liangjin
2021-04-01 ffcc13c38517386aee4f1b629b0be25a951cd2c2
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!--
 * @Author: 小明丶
 * @Date: 2020-08-10 15:48:30
 * @LastEditors: 小明丶
 * @LastEditTime: 2021-01-04 15:45:07
 * @Description: 
-->
<template>
  <div class="tonglian-open-res-page">
    <!-- <v-navbar title="开通通联通道"></v-navbar> -->
    <van-nav-bar
      title="开通通联通道"
      left-arrow
      @click-left="onClickLeft"
      fixed
      style="line-height: 43px"
    >
      <i
        class="iconfont iconzuojiantou"
        slot="left"
        style="font-size: 25px"
      ></i>
    </van-nav-bar>
    <div class="res-box" v-show="showContent || $route.query.nck">
      <img
        v-if="status == 0"
        src="../../../../../static/img/post_agree.png"
        alt="提交成功"
      />
      <img
        v-if="status == 1 || status == 4"
        src="../../../../../static/img/img_refuse.png"
        alt="审核失败或签约失败"
      />
      <img
        v-if="status == 2 || status == 6"
        src="../../../../../static/img/img_auditing.png"
        alt="审核中"
      />
      <img
        v-if="status == 3 || status == 7"
        src="../../../../../static/img/img_agree.png"
        alt="审核通过"
      />
      <img
        v-if="status == 5"
        src="../../../../../static/img/img_reupload.png"
        alt="图片不清晰"
      />
      <img
        v-if="status == 8"
        src="../../../../../static/img/paying.png"
        alt="打款中"
      />
      <p>{{ openResText }}</p>
      <p v-if="status == 8" style="padding: 0 15%;line-height:20px">我们将向您的对公结算银行卡进行一笔小额转账以确保银行卡信息准确无误</p>
      <p v-if="status == 0 || status == 5">{{ tipText }}</p>
      <!-- || status != 7 && verificationDone == 'done' -->
      <button @click="getRefresh" v-if="status != 7 && status != 8">
        {{ btnTextOfFunction }}
      </button>
      <button v-if="status == 0 || status == 7" @click="goNext">
        {{ btnTextOfRouter }}
      </button>
      <div class="dk-bankNo" v-if="status==8">
        <p>打款银行卡号:{{bankCard}}</p>
      </div>
    </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { Dialog,Toast } from 'vant';
 
// 全局注册
Vue.use(Toast);
Vue.use(Dialog);
export default {
  data() {
    return {
      uploadFileTypes:[],//动态显示数组
      timer:'',//跳转定时器
      timer2:"",
      show:false,
      showContent: false,
      openResText: "",//状态文字解释
      btnTextOfRouter: "",
      btnTextOfFunction: "",
      tipText: "",
      status: '', //开通状态0-提交成功,1-审核失败,2-初审中,3-初审通过 4-签约失败 5-图片不清晰 6-终审中 7-审核成功 打款中-8 9-打款验证
      merType:"",//商户类型
      canGoverification:1, //是否可以前往打款验证  0-不是  1-是
      verificationDone:'',
      bankCard:'',//打款银行卡号
    };
  },
  created() {
    this.verificationDone = this.$route.query.verificationDone
    this.getStatus();
  },
  methods: {
    /**
     * @description 打款验证失败弹窗确认
     * @returns void
     * **/ 
    onconfirm(){
      this.$router.push({
        path:'/tonglian/verification'
      })
    },
    onClickLeft(){
      if(this.$route.query.isApp == 1){
        this.$router.push({
            path:'/app/home'
        });
      }else{
        this.$router.push({
            path:'/main/mine'
        });
      }
        
    },
    /**
     * @description:去首页
     * @returns void
     * **/
    goNext() {
      if(this.$route.query.isApp == 1){
        this.$router.push("/app/home");
      }else{
        this.$router.push("/main/mine");
      }
    },
    /**
     * @description:刷新按钮
     * @return void
     * **/
    getRefresh() {
      if (this.status == 0 || this.status == 2) {
        this.getStatus();
      } else if (this.status == 3) {
        // 跳转签约页面
        this.$api.tltMerOpenQueryElectUrl().then(res=>{
          window.location.href = res.body
        })
      } else if (this.status == 1) {
        this.$api.tltMerOpenReOpenMer().then(res=>{
            this.$router.push("/tonglian/startOpen");
        })
      } else if (this.status == 5) {
        this.$router.push({
            path:"/tonglian/store-pictures",
            query:{
                merType:this.merType,
                isUploadAgain:1,
                zfbVersion: 5,
                uploadFileTypes:JSON.stringify(this.uploadFileTypes)
            }
        });
      } else if (this.status == 4) {
        // 跳转签约页面重新签约
        this.$api.tltMerOpenQueryElectUrl().then(res=>{
            window.location.href = res.body
        })
      }else if (this.status == 6) {
        this.getStatus();
      } else if (this.status == 7) {
        // 跳转办单页面
        if(this.$route.query.isApp == 1){
          this.$router.push("/app/home");
        }else{
          this.$router.push("/main/mine");
        }
        
      }
    },
    /**
     * @description:获取状态
     * @return void
     * **/
    getStatus() {
      clearInterval(this.timer)
      this.$api
        .tltMerOpenFindOpenSts()
        .then((res) => {
          this.merType = res.body.merType
          this.status = res.body.pageNum
          this.uploadFileTypes = res.body.uploadFileTypes
          this.canGoverification = res.body.payStatus
          
          switch (this.status) {
            case 0:
              this.openResText = "提交成功";
              this.tipText = "申请已提交请耐心等待";
              this.btnTextOfFunction = "刷新";
              this.btnTextOfRouter = "返回首页";
              break;
            case 1:
              this.openResText = "审核失败";
              this.btnTextOfFunction = "重新开通";
              break;
            case 2:
              this.openResText = "初审中";
              this.btnTextOfFunction = "刷新";
              break;
            case 3:
              this.openResText = "审核通过";
              this.btnTextOfFunction = "去签约";
              break;
            case 4:
              this.openResText = "签约失败";
              this.btnTextOfFunction = "重新签约";
              break;
            case 5:
              this.openResText = "图片不清晰";
              this.tipText = "请重新上传图片";
              this.btnTextOfFunction = "上传图片";
              break;
            case 6:
              this.openResText = "终审中";
              this.btnTextOfFunction = "刷新";
              break;
            case 7:
              this.openResText = "审核通过";
              this.btnTextOfRouter = "返回首页";
              break;
            case 8:
              this.bankCard = res.body.bankCard
              this.openResText = "打款中,请稍后"
              this.timer = setInterval(()=>{
                this.getStatus()
              },5000)
              break;
            case 9:
              this.$router.push({
                path:'/tonglian/verification',
                query:{
                  ...this.$route.query
                }
              })
              break;
          }
          this.showContent = true;
        })
        .catch((err) => {});
    },
  },
  beforeRouteLeave (to, from, next) {
    // ...
    Toast.clear()
    clearInterval(this.timer)
    clearInterval(this.timer2)
    next()
  }
};
</script>
<style lang="less" scoped>
.tonglian-open-res-page {
  & {
    min-height: 100vh;
    background: #f5f5f7;
    padding-top: 54px;
  }
  .res-box {
    width: 96vw;
    height: 365px;
    //margin-top: 56px;
    margin-left: 2vw;
    background: #fff;
    text-align: center;
    padding-top: 35px;
    img {
      width: 115px;
      height: 106px;
    }
    p:nth-of-type(1) {
      margin-top: 20px;
      font-size: 16px;
      font-family: PingFang SC;
      font-weight: 500;
      color: rgba(58, 58, 58, 1);
    }
    p:nth-of-type(2) {
      margin-top: 8px;
      font-size: 12px;
      font-family: PingFang SC;
      font-weight: 500;
      color: rgba(153, 153, 153, 1);
    }
    button:nth-of-type(1) {
      width: 320px;
      height: 44px;
      background: rgba(137, 110, 219, 1);
      border-radius: 22px;
      outline: none;
      border: 0;
      color: #fff;
      margin-top: 50px;
      margin-bottom: 20px;
    }
    button:nth-of-type(2) {
      width: 320px;
      height: 44px;
      background: rgba(255, 255, 255, 1);
      border: 1px solid rgba(137, 110, 219, 1);
      border-radius: 22px;
      color: rgba(137, 110, 219, 1);
    }
    .dk-bankNo{
      margin-top: 13px;
      display: inline-block;
      width: 262px;
      height: 28px;
      background: #FFFFFF;
      border: 1px solid #EEEEEE;
      border-radius: 14px;
      text-align: center;
      p{
        color: #666666;        
        font-size: 12px;
        margin-top: 0;
        line-height: 30px;
      }
    }
  }
}
</style>