quanwei
2025-11-11 0d04d60f456b1902c1e27b9586652649df3963d4
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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
<template>
    <view class="login-container">
        <view class="p30">
            <view class="group-bd">
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">账户名称:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.account" placeholder="请输入账户名称" /></view>
                </view>
 
                <picker class="" value="2" @change="changeSelect($event)"
                    :range="business_type_list">
                    <view class="certification_head_body_item d-b-c">
                        <text class="orange">*</text>
                        <view class="make-item input-box flex-1" v-if="business_type_active">{{business_type_active}}</view>
                        <view class="make-item input-box flex-1" style="color: #777777;" v-else>请选择客户类型</view>
                        <view class="icon iconfont icon-jiantou" style="font-size: 24rpx;"></view>
                    </view>
                </picker>
                
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">营业执照号:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.license_no" placeholder="请输入营业执照号" /></view>
                </view>
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">营业执照名称:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.license_name" placeholder="请输入营业执照名称" /></view>
                </view>
                <view class="certification_body" v-if="formData.business_type == 1">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传营业执照</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('license_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="license_photo!=''" class="img">
                                    <image :src="license_photo"></image>
                                </view>
                                <view v-if="license_photo==''">点击上传营业执照</view>
                                <input style="display:none" name="license_photo" v-model="form.license_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">法人姓名:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.legal_person_name" placeholder="企业填营业执照法人姓名/个人填持卡人姓名" /></view>
                </view>
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">法人证件号:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.legal_person_id_card_no" placeholder="企业填营业执照法人号码/个人填持卡人身份证" /></view>
                </view>
                <view class="certification_body">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传法人证件正面照片</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('legal_person_id_card_front_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="legal_person_id_card_front_photo!=''" class="img">
                                    <image :src="legal_person_id_card_front_photo"></image>
                                </view>
                                <view v-if="legal_person_id_card_front_photo==''">点击上传法人证件正面照片</view>
                                <input style="display:none" name="legal_person_id_card_front_photo" v-model="form.legal_person_id_card_front_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                <view class="certification_body">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传法人证件反面照片</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('legal_person_id_card_back_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="legal_person_id_card_back_photo!=''" class="img">
                                    <image :src="legal_person_id_card_back_photo"></image>
                                </view>
                                <view v-if="legal_person_id_card_back_photo==''">点击上传法人证件反面照片</view>
                                <input style="display:none" name="legal_person_id_card_back_photo" v-model="form.legal_person_id_card_back_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                
                <picker class="" value="1" @change="changeIdCardSelect($event)"
                    :range="id_card_type_list" v-if="formData.business_type == 1">
                    <view class="certification_head_body_item d-b-c">
                        <text class="orange">*</text>
                        <view class="make-item input-box flex-1" v-if="id_card_type_active">{{id_card_type_active}}</view>
                        <view class="make-item input-box flex-1" style="color: #777777;" v-else>请选择结算人证件类型</view>
                        <view class="icon iconfont icon-jiantou" style="font-size: 24rpx;"></view>
                    </view>
                </picker>
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">结算人证件号:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.id_card_no" placeholder="请填写结算人证件号" /></view>
                </view>
                <view class="certification_body" v-if="formData.business_type == 1">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传结算人证件正面照片</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('settlement_person_id_card_front_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="settlement_person_id_card_front_photo!=''" class="img">
                                    <image :src="settlement_person_id_card_front_photo"></image>
                                </view>
                                <view v-if="settlement_person_id_card_front_photo==''">点击上传结算人证件正面照片</view>
                                <input style="display:none" name="settlement_person_id_card_front_photo" v-model="form.settlement_person_id_card_front_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                <view class="certification_body" v-if="formData.business_type == 1">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传结算人证件反面照片</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('settlement_person_id_card_back_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="settlement_person_id_card_back_photo!=''" class="img">
                                    <image :src="settlement_person_id_card_back_photo"></image>
                                </view>
                                <view v-if="settlement_person_id_card_back_photo==''">点击上传结算人证件反面照片</view>
                                <input style="display:none" name="settlement_person_id_card_back_photo" v-model="form.settlement_person_id_card_back_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                <picker class="" value="1" @change="changeAccountSelect($event)"
                    :range="account_type_list" v-if="formData.business_type == 1">
                    <view class="certification_head_body_item d-b-c">
                        <text class="orange">*</text>
                        <view class="make-item input-box flex-1" v-if="account_type_active">{{account_type_active}}</view>
                        <view class="make-item input-box flex-1" style="color: #777777;" v-else>请选择结算账户类型</view>
                        <view class="icon iconfont icon-jiantou" style="font-size: 24rpx;"></view>
                    </view>
                </picker>
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">结算银行卡号:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.account_no" placeholder="请输入结算银行卡号" /></view>
                </view>
                <view class="certification_body">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传结算银行卡照片</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('bank_card_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="bank_card_photo!=''" class="img">
                                    <image :src="bank_card_photo"></image>
                                </view>
                                <view v-if="bank_card_photo==''">点击上传结算银行卡照片</view>
                                <input style="display:none" name="bank_card_photo" v-model="form.bank_card_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">结算银行卡开户名:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.account_name" placeholder="请输入结算银行卡开户名" /></view>
                </view>
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">开户总行:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.bank_name" placeholder="请输入开户总行,如中国建设银行" /></view>
                </view>
                <view class="form-level d-s-c" v-if="formData.account_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">联行号:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.bank_no" placeholder="请输入联行号" /></view>
                </view>
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">预留手机号:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.bank_cell_phone" placeholder="请输入预留手机号,用于提现失败通知等" /></view>
                </view>
                <view class="certification_body" v-if="formData.business_type == 1">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传门头照</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('store_front_img_url')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="store_front_img_url!=''" class="img">
                                    <image :src="store_front_img_url"></image>
                                </view>
                                <view v-if="store_front_img_url==''">点击上传门头照</view>
                                <input style="display:none" name="store_front_img_url" v-model="form.store_front_img_url" />
                            </view>
                        </view>
                    </view>
                </view>
                <view class="certification_body" v-if="formData.business_type == 1">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传收银台照片</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('store_cash_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="store_cash_photo!=''" class="img">
                                    <image :src="store_cash_photo"></image>
                                </view>
                                <view v-if="store_cash_photo==''">点击上传结收银台照片</view>
                                <input style="display:none" name="store_cash_photo" v-model="form.store_cash_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                <view class="certification_body" v-if="formData.business_type == 1">
                    <view class="login_index_updata_name">
                        <text style="color:red;">*</text>
                        <text style="">请上传店内环境照</text>
                    </view>
                    <view class="login_index_updata_updata">
                        <view class="login_index_updata_updata_item2" @click="openUpload('store_env_photo')">
                            <view class="login_index_updata_updata_item_body">
                                <view v-if="store_env_photo!=''" class="img">
                                    <image :src="store_env_photo"></image>
                                </view>
                                <view v-if="store_env_photo==''">点击上传店内环境照</view>
                                <input style="display:none" name="store_env_photo" v-model="form.store_env_photo" />
                            </view>
                        </view>
                    </view>
                </view>
                <picker mode="multiSelector" @change="bindAreasPickerChange($event)" @columnchange="bindAreasPickerColumnChange($event)" class="" :value="areasIndex"
                    :range="areasArray" v-if="formData.business_type == 1">
                    <view class="certification_head_body_item d-b-c">
                        <text class="orange">*</text>
                        <view class="make-item input-box flex-1" v-if="formData.area_name">{{formData.province_name}}{{formData.city_name}}{{formData.area_name}}</view>
                        <view class="make-item input-box flex-1" style="color: #777777;" v-else>请选择地区</view>
                        <view class="icon iconfont icon-jiantou" style="font-size: 24rpx;"></view>
                    </view>
                </picker>
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">详细地址:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.street_address" placeholder="请输入详细地址" /></view>
                </view>
                <picker mode="multiSelector" @change="bindMultiPickerChange($event)" @columnchange="bindMultiPickerColumnChange($event)" class="" :value="multiIndex"
                    :range="multiArray" v-if="formData.business_type == 1">
                    <view class="certification_head_body_item d-b-c">
                        <text class="orange">*</text>
                        <view class="make-item input-box flex-1" v-if="formData.unity_category_name">{{formData.unity_category_name}}</view>
                        <view class="make-item input-box flex-1" style="color: #777777;" v-else>请选择行业类目</view>
                        <view class="icon iconfont icon-jiantou" style="font-size: 24rpx;"></view>
                    </view>
                </picker>
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">户籍地址:</text>
                    </view>
                    <view class="val flex-1"><input type="text" v-model="formData.residence_address" placeholder="企业填法人户籍地址,个人填写结算人户籍地址" /></view>
                </view>
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">法人身份证开始时间:</text>
                    </view>
                    <view class="val flex-1">
                        <picker class="datapicker" mode="date" value="" @change="getDateFunc($event,'legal_person_lic_stt')">
                            <view class="make-item selectpicker input-box">{{formData.legal_person_lic_stt || '请选择法人身份证开始时间'}}</view>
                        </picker>
                    </view>
                </view>
                <view class="form-level d-s-c">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">法人身份证结束时间:</text>
                    </view>
                    <view class="val flex-1">
                        <picker class="datapicker" mode="date" value="" @change="getDateFunc($event,'legal_person_lic_ent')">
                            <view class="make-item selectpicker input-box">{{formData.legal_person_lic_ent || '请选择法人身份证结束时间'}}</view>
                        </picker>
                    </view>
                </view>
                <picker class="" value="0" @change="changeLegalSelect($event)"
                    :range="legal_effect_list">
                    <view class="certification_head_body_item d-b-c">
                        <text class="orange">*</text>
                        <view class="make-item input-box flex-1" v-if="formData.legal_person_lic_effect">{{formData.legal_person_lic_effect}}</view>
                        <view class="make-item input-box flex-1" style="color: #777777;" v-else>请选择法人身份证是否长期有效</view>
                        <view class="icon iconfont icon-jiantou" style="font-size: 24rpx;"></view>
                    </view>
                </picker>
                
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">结算人身份证开始时间:</text>
                    </view>
                    <view class="val flex-1">
                        <picker class="datapicker" mode="date" value="" @change="getDateFunc($event,'settlement_person_lic_stt')">
                            <view class="make-item selectpicker input-box">{{formData.settlement_person_lic_stt || '请选择结算人身份证开始时间'}}</view>
                        </picker>
                    </view>
                </view>
                <view class="form-level d-s-c" v-if="formData.business_type == 1">
                    <view class="d-s-c field-name">
                        <text class="orange">*</text>
                        <text class="gray3">结算人身份证结束时间:</text>
                    </view>
                    <view class="val flex-1">
                        <picker class="datapicker" mode="date" value="" @change="getDateFunc($event,'settlement_person_lic_ent')">
                            <view class="make-item selectpicker input-box">{{formData.settlement_person_lic_ent || '请选择结算人身份证结束时间'}}</view>
                        </picker>
                    </view>
                </view>
                <picker class="" value="0" @change="changeSettlementSelect($event)"
                    :range="settlement_effect_list" v-if="formData.business_type == 1">
                    <view class="certification_head_body_item d-b-c">
                        <text class="orange">*</text>
                        <view class="make-item input-box flex-1" v-if="formData.settlement_person_lic_effect">{{formData.settlement_person_lic_effect}}</view>
                        <view class="make-item input-box flex-1" style="color: #777777;" v-else>请选择结算人身份证是否长期有效</view>
                        <view class="icon iconfont icon-jiantou" style="font-size: 24rpx;"></view>
                    </view>
                </picker>
                    
            </view>
        </view>
        
 
        <view class="btns p30"><button type="default" @click="formSubmit">提交</button></view>
        <Upload v-if="isupload" :isupload="isupload" :type="type" @getImgs="getImgsFunc">上传图片</Upload>
    </view>
</template>
 
<script>
import Upload from '@/components/upload/upload';
export default {
    components: {
        /*编辑组件*/
        Upload,
    },
    data() {
        return {
            /*表单数据对象*/
            formData: {
                account: '',/*账户名称*/
                /*客户类型*/
                business_type: '',//选中的下标数
                license_no:'',
                license_name:'',
                license_photo:'',//加密的图片链接
                license_photo_id:'',//图片ID
                legal_person_name:'',//法人姓名
                legal_person_id_card_type:'IDCARD',//证件类型,默认身份证
                legal_person_id_card_no:'',//证件号
                legal_person_id_card_front_photo:'',//法人证件照正面,注:人像面
                legal_person_id_card_front_photo_id:'',//法人证件照正面,注:人像面
                legal_person_id_card_back_photo:'',//法人证件照反面,注:国徽面
                legal_person_id_card_back_photo_id:'',//法人证件照反面,注:国徽面
                id_card_type:'',//结算人证件类型 IDCARD 身份证、LICENSE 营业执照
                id_card_no:'',//结算人证件号
                settlement_person_id_card_front_photo:'',//结算人证件照正面,注:人像面
                settlement_person_id_card_front_photo_id:'',//结算人证件照正面,注:人像面
                settlement_person_id_card_back_photo:'',//结算证件照正面,注:人像面
                settlement_person_id_card_back_photo_id:'',//结算证件照正面,注:人像面
                account_type:'2',//结算账户类型:1对公、2对私  注:默认是对私,因为个人不能选择
                account_no:'',//结算银行卡号
                bank_card_photo:'',//结算银行卡照片
                bank_card_photo_id:'',//结算银行卡照片
                account_name:'',//结算银行卡开户名
                bank_name:'',//开户总行,如中国建设银行
                bank_no:'',//联行号,对公必填
                bank_cell_phone:'',//预留手机号
                store_front_img_url:'',//门头照
                store_front_img_url_id:'',//门头照
                store_cash_photo:'',//收银台照
                store_cash_photo_id:'',//收银台照
                store_env_photo:'',//店内环境照
                store_env_photo_id:'',//店内环境照
                province_code:'',//省份编码
                city_code:'',//城市编码
                area_code:'',//区域编码
                province_name:'',//省份名称
                city_name:'',//城市名称
                area_name:'',//区域名称
                area_index:'',//选中的下标
                street_address:'',//详细地址
                unity_category_id:'',//行业类目id
                unity_category_name:'',//行业类目名称
                residence_address:'',//户籍地址
                legal_person_lic_stt:'',//法人身份证开始时间,如2019-01-30
                legal_person_lic_ent:'',//法人身份证结束时间,如2019-01-30
                legal_person_lic_effect:'',//法人身份证是否长期有效 YES 是 NO 否
                settlement_person_lic_stt:'',//结算人身份证开始时间,如2019-01-30
                settlement_person_lic_ent:'',//结算人身份证结束时间,如2019-01-30
                settlement_person_lic_effect:'',//结算人身份证是否长期有效 YES 是 NO 否
            },
            isupload: false,
            type:'',
            business_type_list: ['','企业','个人'], //列表名字
            business_type_active:'',//选中的名称
            id_card_type_list: ['','身份证','营业执照'], //结算人证件列表
            id_card_type_value: ['','IDCARD','LICENSE'], //结算人证件列表
            id_card_type_active:'',//选中的名称
            account_type_list: ['','对公','对私'], //结算账户类型列表
            account_type_active:'',//选中的名称
            license_photo:'',//没加密的图片链接
            legal_person_id_card_front_photo:'',//没加密的图片链接
            legal_person_id_card_back_photo:'',//没加密的图片链接
            settlement_person_id_card_front_photo:'',//没加密的图片链接
            settlement_person_id_card_back_photo:'',//没加密的图片链接
            bank_card_photo:'',//没加密的图片链接
            store_front_img_url:'',//门头照
            store_cash_photo:'',//收银台照
            store_env_photo:'',//店内环境照
            unity_category_list:'', //行业类目列表
            unity_category_first:'', //行业类目第一级
            multiArray: [[], []],
            multiIndex: [0, 0],
            legal_effect_list: ['YES','NO'], //法人身份证是否长期有效
            settlement_effect_list: ['YES','NO'], //结算人身份证是否长期有效
            areas_list:'', //城市列表
            areasArray: [[], [],[]],
            areasIndex: [0, 0, 0],
        };
    },
    onLoad() {
        /*获取数据*/
        this.getData();
        //获取行业类目
        this.getCategory();
        //获取地区
        this.getAreas();
    },
    methods: {
        /*获取数据*/
        getData() {
            let self = this;
            uni.showLoading({
                title: '加载中'
            });
            self._get('user.auth/detail', {}, function(res) {
                if(res.code == 1){
                  var data = res.data.data;
                  self.formData = data;
                  self.legal_person_id_card_front_photo = data.idCardFrontPhoto.file_path;
                  self.legal_person_id_card_back_photo =  data.idCardBackPhoto.file_path;
                  if(data.licensePhoto){
                    self.license_photo = data.licensePhoto.file_path;  
                  }
                  if(data.settlementIdCardFrontPhoto){
                     self.settlement_person_id_card_front_photo = data.settlementIdCardFrontPhoto.file_path; 
                  }
                  if(data.settlementIdCardBackPhoto){
                      self.settlement_person_id_card_back_photo = data.settlementIdCardBackPhoto.file_path;                  
                  }
                  if(data.bankCardPhoto){
                       self.bank_card_photo = data.bankCardPhoto.file_path;                  
                  }
                  if(data.storeFrontPhoto){
                      self.store_front_img_url = data.storeFrontPhoto.file_path;                  
                  }
                  if(data.storeCashPhoto){
                      self.store_cash_photo = data.storeCashPhoto.file_path;                  
                  }
                  if(data.storeEnvPhoto){
                      self.store_env_photo = data.storeEnvPhoto.file_path;                  
                  } 
                  var business_type_list = self.business_type_list;
                  self.business_type_active = business_type_list[data.business_type];
                }
                uni.hideLoading();
            });
        },
        //类目改变
        bindMultiPickerChange(e) { 
             var unity_category_list = this.unity_category_list;
             var val = e.detail.value;
             this.multiIndex= val;
             this.formData.unity_category_name = unity_category_list[val[0]]['children'][val[1]]['name'];
             this.formData.unity_category_id = unity_category_list[val[0]]['children'][val[1]]['code'];
        },
        bindMultiPickerColumnChange(e) {
              var self = this;
              var val = e.detail.value;
              //只滚动第一列
              if(e.detail.column > 0){
                  return;
              }
              var unity_category_list = this.unity_category_list;
              
              var childdata = unity_category_list[val]['children'];//获取第一个的下级
              var arr2 = [];
              //只获取数组的名称
              childdata.forEach(function(vv) {
                  arr2.push(vv.name);
              }); 
              self.multiIndex= [val, 0];  
              self.multiArray= [this.unity_category_first, arr2];  
              
         }, 
         //地区改变
         bindAreasPickerChange(e) {
              var areas_list = this.areas_list;
              var val = e.detail.value;
             this.areasIndex= val; 
             this.formData.area_index= val; 
              this.formData.province_code = areas_list[val[0]]['code'];
             this.formData.province_name = areas_list[val[0]]['name'];
             this.formData.city_code = areas_list[val[0]]['children'][val[1]]['code'];
             this.formData.city_name = areas_list[val[0]]['children'][val[1]]['name'];
             this.formData.area_code = areas_list[val[0]]['children'][val[1]]['children'][val[2]]['code'];
             this.formData.area_name = areas_list[val[0]]['children'][val[1]]['children'][val[2]]['name'];
         },
         bindAreasPickerColumnChange(e) {
               var self = this;
               var val = e.detail.value;
               var areas_list = this.areas_list;
              if(e.detail.column == 0){
                  //滑动省
                  var childdata = areas_list[val]['children'];//获取第一个的下级
                  var sondata = areas_list[val]['children'][0]['children'];//获取第二个的下级
                  var arr2 = [];
                  var arr3 = [];
                  //只获取数组的名称
                  childdata.forEach(function(vv) {
                      arr2.push(vv.name);
                  }); 
                  //只获取数组的名称
                  sondata.forEach(function(val) {
                      arr3.push(val.name);
                  }); 
                  self.areasIndex= [val, 0, 0];  
                  self.areasArray= [this.areasArray[0], arr2, arr3]; 
              }else if(e.detail.column == 1){
                  //滑动市
                  var childdata = areas_list[this.areasIndex[0]]['children'];//获取第一个的下级
                  var sondata = areas_list[this.areasIndex[0]]['children'][val]['children'];//获取第二个的下级
                  var arr2 = [];
                  var arr3 = [];
                  //只获取数组的名称
                  childdata.forEach(function(vv) {
                      arr2.push(vv.name);
                  }); 
                  //只获取数组的名称
                  sondata.forEach(function(vv) {
                      arr3.push(vv.name);
                  }); 
                  self.areasIndex= [this.areasIndex[0], val, 0];  
                  self.areasArray= [this.areasArray[0],arr2, arr3];   
              }
          }, 
        /* 下拉框 */
        changeSelect(e) {
            this.formData.business_type= e.detail.value;
            this.business_type_active= this.business_type_list[e.detail.value];
            //如选择个人,则结算账户类型改为对私
            if(e.detail.value == 1){
                this.formData.account_type= 2;
            }
        },
        /* 结算人证件下拉框 */
        changeIdCardSelect(e) {
            this.formData.id_card_type = this.id_card_type_value[e.detail.value];
            this.id_card_type_active = this.id_card_type_list[e.detail.value];
        },
        /* 结算账户类型下拉框 */
        changeAccountSelect(e) {
            this.formData.account_type= e.detail.value;
            this.account_type_active= this.account_type_list[e.detail.value];
        },
        /* 行业类目下拉框 */
        getCategory() {
            let self = this;
            let url="http://lifecircle-ark-public.oss-cn-hangzhou.aliyuncs.com/openapi/categories.json";
            uni.request({
                url: url,
                method: 'GET',
                success: (res) => {
                    if(res.data.success){
                        var data = res.data.data;
                        var childdata = data[0]['children'];//获取第一个的下级
                        self.unity_category_list = data;
                        var arr1=[];
                        var arr2=[];
                        //只获取数组的名称
                        data.forEach(function(val) {
                            arr1.push(val.name);
                        });
                        //只获取数组的名称
                        childdata.forEach(function(vv) {
                            arr2.push(vv.name);
                        });
                        self.unity_category_first = arr1;
                        self.multiArray = [arr1,arr2];
                    }else{
                        uni.showToast({
                            title: '获取行业类目失败,请稍后再试!',
                            duration: 2000,
                            icon: 'none'
                        });
                        return;
                    }
                },
            });
        
        },
        /* 获取地区 */
        getAreas() {
            let self = this;
            let url="http://lifecircle-ark-public.oss-cn-hangzhou.aliyuncs.com/openapi/areas.json";
            uni.request({
                url: url,
                method: 'GET',
                success: (res) => {
                    if(res.data.success){
                        var data = res.data.data;
                        var childdata = data[0]['children'];//获取第一个的下级
                        var sondata = data[0]['children'][0]['children'];//获取第二个的下级
                        self.areas_list = data;
                        var arr1=[];
                        var arr2=[];
                        var arr3=[];
                        //只获取数组的名称
                        data.forEach(function(val) {
                            arr1.push(val.name);
                        });
                        //只获取数组的名称
                        childdata.forEach(function(vv) {
                            arr2.push(vv.name);
                        });
                        //只获取数组的名称
                        sondata.forEach(function(vv) {
                            arr3.push(vv.name);
                        });
                        self.areasArray = [arr1,arr2,arr3];
                    }else{
                        uni.showToast({
                            title: '获取城市列表失败,请稍后再试!',
                            duration: 2000,
                            icon: 'none'
                        });
                        return;
                    }
                },
            });
        
        },
        /* 法人证件是否长期有效 */
        changeLegalSelect(e) {
            this.formData.legal_person_lic_effect= this.legal_effect_list[e.detail.value];
        },
        /* 结算人证件是否长期有效 */
        changeSettlementSelect(e) {
            this.formData.settlement_person_lic_effect= this.settlement_effect_list[e.detail.value];
        },
        /*上传*/
        openUpload(e) {
            this.type = e;
            this.isupload = true;
        },
        
        /*获取图片*/
        getImgsFunc(e) {
            if (e != null && e.length > 0) {
                var self = this;
                uni.showLoading({
                    title:'上传中'
                })
                var type = this.type;
                var type_id = this.type+"_id"
                this[type] = e[0].file_path;//展示的图片
                this.formData[type_id]  = e[0].file_id;//存数据库的图片ID
                 if (type == 'bank_card_photo') {
                    var buy_type = 'bankCard';//银行卡
                }else if(type == 'legal_person_id_card_front_photo' || type == 'legal_person_id_card_back_photo' || type == 'settlement_person_id_card_front_photo' || type == 'settlement_person_id_card_back_photo'){
                    var buy_type = 'idCard';//身份证
                }else if(type == 'license_photo'){
                    var buy_type = 'license';//营业执照
                }else if(type == 'store_front_img_url' || type == 'store_cash_photo' || type == 'store_env_photo'){
                    var buy_type = 'store';//门店
                }else{
                    var buy_type = 'other';//其他
                }
                wx.getFileSystemManager().readFile({
                             filePath: e.beforeFilePath, //选择图片返回的相对路径
                             encoding: 'base64', //编码格式
                             success: res => {
                              //成功的回调
                               //console.log('data:image/png;base64,' + res.data)
                               var img= 'data:image/png;base64,' + res.data;
                               this._post('file.upload/imageFbEncryption', {
                                   img: img,
                                bus_type:buy_type
                               }, function(res) {
                                   uni.hideLoading()
                                   if(res.code == 1){
                                       self.formData[self.type] =res.data;//加密的图片
                                   }else{
                                       uni.showToast({
                                            title: '图片加密失败',
                                            duration: 2000
                                       });
                                   }
                                      
                               })    
                               false,
                               () => {
                                       uni.hideLoading();
                               }
                             }
                })
            }
            this.isupload = false;
        },
        /*获取时间*/
        getDateFunc(e, index) {
           this.formData[index] = e.detail.value;
        },
        /*提交*/
        formSubmit() {
            let self = this;
            uni.showLoading({
                title: '正在提交'
            });
            uni.navigateBack();
            self._post(
                'user.auth/save',
                self.formData,
                result => {
                     if(result.code == 1){
                        uni.showToast({
                            title: '提交成功',
                            duration: 2000
                        });
                        setTimeout(function(){
                            // 执行回调函数
                            uni.navigateBack();
                        }, 2000);
                    }else{
                        uni.showToast({
                            title: '提交失败',
                            duration: 2000
                        });
                    } 
                    
                },
                false,
                () => {
                    uni.hideLoading();
                }
            );
        },
 
        
    }
};
</script>
 
<style lang="scss" scoped>
.login-container {
    background: #ffffff;
}
.login-container input {
    height: 88rpx;
    line-height: 88rpx;
}
.wechatapp {
    padding: 80rpx 0 48rpx;
    border-bottom: 1rpx solid #e3e3e3;
    margin-bottom: 72rpx;
    text-align: center;
}
 
.wechatapp .header {
    width: 190rpx;
    height: 190rpx;
    border: 2px solid #fff;
    margin: 0rpx auto 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 1px 0px 5px rgba(50, 50, 50, 0.3);
}
 
.auth-title {
    color: #585858;
    font-size: 34rpx;
    margin-bottom: 40rpx;
}
 
.auth-subtitle {
    color: #888;
    margin-bottom: 88rpx;
    font-size: 28rpx;
}
 
.login-btn {
    padding: 0 20rpx;
}
 
.login-btn button {
    height: 88rpx;
    line-height: 88rpx;
    background: #04be01;
    color: #fff;
    font-size: 30rpx;
    border-radius: 999rpx;
    text-align: center;
}
 
.no-login-btn {
    margin-top: 20rpx;
    padding: 0 20rpx;
}
 
.no-login-btn button {
    height: 88rpx;
    line-height: 88rpx;
    background: #dfdfdf;
    color: #fff;
    font-size: 30rpx;
    border-radius: 999rpx;
    text-align: center;
}
 
.get-code-btn {
    width: 200rpx;
    height: 80rpx;
    line-height: 76rpx;
    padding: 0rpx 30rpx;
    border-radius: 40rpx;
    white-space: nowrap;
    border: 1rpx solid $dominant-color;
    color: $dominant-color;
    font-size: 30rpx;
}
.get-code-btn[disabled='true'] {
    border: 1rpx solid #cccccc;
}
 
.btns button {
    height: 90rpx;
    line-height: 90rpx;
    font-size: 34rpx;
    border-radius: 45rpx;
    background: $dominant-color;
    color: #ffffff;
}
.certification_head_body_item {
        width: 100%;
        height: 100rpx;
        display: flex;
        align-items: center;
}
.certification_head_body_item view {
        margin-right: 10rpx;
}
.certification_head_body_item button {
        width: 172rpx;
        height: 56rpx;
        line-height: 56rpx;
        border: 1rpx #E2231A solid;
        border-radius: 40rpx;
        font-size: 26rpx;
        color: #E2231A;
        padding: 0 20rpx;
}
.login_index_updata_updata {
        width: 90%;
        height: 360rpx;
        margin: 0 auto;
        margin: 10rpx 0 30rpx;
}
 
.login_index_updata_updata_item2 {
        width: 100%;
        height: 360rpx;
        border: 1rpx #9a9a9a dotted;
        border-radius: 15rpx;
        text-align: center;
        
}
 
.login_index_updata_updata_item_body {
        width: 150rpx;
        height: 360rpx;
        text-align: center;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
}
 
.img image {
        width: 554rpx;
        height: 360rpx;
        position: relative;
}    
.selectpicker {
        width: auto;
        height: 88rpx;
        line-height: 88rpx;
        box-sizing: border-box;
        color: #575757;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
 
    
</style>