ann0707
2018-08-16 c9bc8ec61cff4076132f6396d99d383a2cdf5a03
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
<template>
    <div class="loan-info-box">
        <x-header slot="header" style="width:100%;height:46px;background-color: #ec6758" :title="'证明材料'"
                  :left-options="{backText: '', preventGoBack:true}" @on-click-back="goBackPage"></x-header>
        <flow class="progressState">
            <flow-state state="1" title="个人信息" is-done></flow-state>
            <flow-line is-done></flow-line>
            <flow-state state="2" title="工作及居住信息" is-done></flow-state>
            <flow-line is-done></flow-line>
            <flow-state state="3" title="绑定银行卡" is-done></flow-state>
            <flow-line is-done></flow-line>
            <flow-state state="4" title="证明材料" class="currentStep"></flow-state>
        </flow>
        <group>
            <group-title slot="title">
                <div class="groupTitle">
                    <span>*</span>
                    <label>身份证照片</label>
                </div>
                <div style="font-size: 12px;padding-left: 6px;">请拍摄并上传您的身份证原件照片</div>
            </group-title>
        </group>
        <flexbox class="IDcardFlexbox">
            <flexbox-item>
                <div class="flex-demo">
                    <img-upload butName="上传人像面" defaultImg="./static/Idcardf.jpg" :currentImg="Idcard.positive"
                                v-on:select-complete="secelted('IDFront', $event)"></img-upload>
                </div>
            </flexbox-item>
            <flexbox-item>
                <div class="flex-demo">
                    <img-upload butName="上传国徽面" defaultImg="./static/Idcardz.jpg" :currentImg="Idcard.reverse"
                                v-on:select-complete="secelted('IDBack', $event)"></img-upload>
                </div>
            </flexbox-item>
        </flexbox>
        <!--身份证拍摄要求-->
        <group class="IDcardsampleGroup">
            <cell is-link :border-intent="false" :arrow-direction="showIDcardSample ? 'up' : 'down'"
                  @click.native="showIDcardSample = !showIDcardSample">
                <div slot="title" class="IDcardsampleINfo">身份证照片拍摄要求</div>
            </cell>
            <flexbox class="IDcardSampleList animate" v-if="showIDcardSample">
                <flexbox-item>
                    <span class="cardsampleItem">
                        <img src="../../assets/img/ok.png" alt="">
                        <p>正常拍摄</p>
                    </span>
                </flexbox-item>
                <flexbox-item>
                    <span class="cardsampleItem">
                        <img src="../../assets/img/error1.png" alt="">
                        <p>边框缺失</p>
                    </span>
                </flexbox-item>
                <flexbox-item>
                    <span class="cardsampleItem">
                        <img src="../../assets/img/error2.png" alt="">
                        <p>照片迷糊</p>
                    </span>
                </flexbox-item>
                <flexbox-item>
                    <span class="cardsampleItem">
                        <img src="../../assets/img/error3.png" alt="">
                        <p>闪光强烈</p>
                    </span>
                </flexbox-item>
            </flexbox>
        </group>
 
        <group>
            <group-title slot="title">
                <div class="groupTitle">
                    <span>*</span>
                    <label>手持身份证照片</label>
                </div>
                <div class="groupSmallTitle">请保持身份证与头像清晰</div>
            </group-title>
        </group>
        <div class="photoItem">
            <div class="handIDItem figureBlock">
                <img src="../../assets/img/handID.jpg" alt="">
            </div>
            <div class="handIDItem">
                <img @click="MaximizeImg(handIDImg)" :src=handIDImg v-if="handIDImg" alt="">
                <icon type="clear" class="closePhoto " v-if="handIDImg"
                      @click.native="deleteAssignImg(handIDImg,'handID')"></icon>
            </div>
            <div class="handIDItem cameraIcon">
                <div class="cameraIconDiv">
                    <i class="iconfont icon-camerafill"></i>
                    <input class="PhotoChangeInput" type="file" @change="handIDPhotoChange($event)" capture="camera"
                           accept="image/*">
                </div>
            </div>
        </div>
        <!--工作证明-->
        <group>
            <group-title slot="title">
                <div class="groupTitle">
                    <span>*</span>
                    <label>工作证明</label>
                </div>
                <div class="groupSmallTitle">单位盖章文件</div>
            </group-title>
        </group>
        <div class="photoItem">
            <div class="handIDItems">
                <scroller lock-y :scrollbar-x=false>
                    <div class="handIDItemsbox">
                        <div v-for="(workItem, index) in workCertImages" class="workPhtotoItem">
                            <img @click="MaximizeImg(workItem)" :src=workItem alt="">
                            <icon type="clear" class="closePhoto" v-if="workItem"
                                  @click.native="deleteCurrentImg($event,index)"></icon>
                        </div>
                    </div>
                </scroller>
            </div>
            <div class="workPhtotoLoadBut cameraIcon">
                <div class="cameraIconDiv">
                    <i class="iconfont icon-camerafill"></i>
                    <input class="PhotoChangeInput" type="file" @change="workPhotoChange($event)" capture="camera"
                           accept="image/*">
                </div>
            </div>
        </div>
        <!--居住证明-->
        <group>
            <group-title slot="title">
                <div class="groupTitle">
                    <span>*</span>
                    <label>居住证明</label>
                </div>
                <div class="groupSmallTitle">电子发票/红旗小票/居委会证明/租房协议/房产证</div>
            </group-title>
        </group>
        <div class="photoItem">
            <div class="handIDItem">
                <img @click="MaximizeImg(residenceCertImage)" :src=residenceCertImage v-if="residenceCertImage" alt="">
                <icon type="clear" class="closePhoto" v-if="residenceCertImage"
                      @click.native="deleteAssignImg(residenceCertImage,'residenceCert')"></icon>
            </div>
 
            <div class="handIDItem cameraIcon">
                <div class="cameraIconDiv" @click="lifePhotoChangeClick($event)">
                    <i class="iconfont icon-camerafill"></i>
                    <input class="PhotoChangeInput" type="file" @change="lifePhotoChange($event)" capture="camera"
                           accept="image/*">
                </div>
            </div>
        </div>
        <div style="height: 20px"></div>
        <div style="margin: 0 15px" class="photoDivFooter">
            <x-button class="photoSubBut" @click.native="photoInfoSubmit">提交</x-button>
        </div>
        <div style="height: 20px"></div>
        <div>
            <x-dialog v-model="showImageMaximize" class="MaximizeImgdialog" hide-on-blur>
                <div class="img-box">
                    <img @click="showImageMaximize=false" :src="currentMaximize" style="max-width:100%">
                </div>
            </x-dialog>
        </div>
        <div>
            <x-dialog v-model="imageSync" class="MaximizeImgdialog" hide-on-blur>
 
            </x-dialog>
        </div>
    </div>
</template>
 
<script>
    import upload from '../../components/upload/uploadImg.vue';
    import EXIF from 'exif-js';
    import store from '../../store/index';
    import SystApi from '../../api/api';
    import statusCodeManage from '../../api/statusCodeManage';
    import {
        Scroller,
        XHeader,
        Group,
        GroupTitle,
        Cell,
        XInput,
        XButton,
        Flexbox,
        Flow,
        FlowState,
        FlowLine,
        FlexboxItem,
        XImg,
        XDialog,
        Icon
    } from 'vux';
 
    export default {
        name: 'photoinfo',
        data() {
            return {
                imageSync: false, // 图片同步模态窗显示
                showImageMaximize: false, // 做大化图片Dialog 对象
                currentMaximize: '', // 当前最大化图片对象
                showIDcardSample: false,
                Idcard: {
                    reverse: '', // 反面国徽面
                    positive: '' // 正面头像面
                },
                handIDImg: '', // 手持身份证照
                residenceCertImage: '', // 居住证明
                workCertImages: [] // 工作证明
            };
        },
        methods: {
            goBackPage: function () {
                //        store.commit('updateDirection', {direction: 'out'})
                this.$router.back();
            },
            validateTip(errorMsg) {
                return this.$vux.toast.show({
                    width: 'auto',
                    type: 'text',
                    text: errorMsg,
                    time: 2000,
                    position: 'middle'
                });
            },
            //       图片最大化模态 显示
            MaximizeImg: function (imgobj) {
                this.currentMaximize = imgobj;
                this.showImageMaximize = true;
            },
            //      删除固定图片
            deleteAssignImg: function (url, type) {
                // 删除指定图片对象
                let _this = this;
                let par = {
                    prodId: this.$route.query.prodId,
                    fileType: type,
                    fileUrl: url
                };
                SystApi.deleteImageFile(par).then(
                    function (res) {
                        if (res.errorCode === 0) {
                            if (type === 'residenceCert') {
                                _this.residenceCertImage = null;
                            } else if (type === 'handID') {
                                _this.handIDImg = null;
                            }
                        }
                    },
                    function (error) {
                        statusCodeManage.showTipOfStatusCode(error, _this);
                    }
                );
            },
            photoInfoSubmit: function () {
                // 提交图片按钮
                let _this = this;
                let submitInfo = {
                    prodId: this.$route.query.prodId
                };
                SystApi.incomeSubmit(submitInfo).then(
                    response => {
                        if (response.errorCode === 0) {
                            _this.$router.push({
                                path: '/incomeLoan/auditResults',
                                query: {prodId: this.$route.query.prodId}
                            });
                        }
                    },
                    error => {
                        statusCodeManage.showTipOfStatusCode(error);
                    }
                );
            },
            //      手持身份证上传
            handIDPhotoChange: function (evt) {
                // 手持身份证图片上传
                if (this.handIDImg) {
                    this.validateTip('最多上传 1 张');
                    return false;
                }
                // loading 显示加载中
                store.commit('updateLoadingStatus', {isLoading: true});
                const files = Array.prototype.slice.call(evt.target.files);
                let that = this;
                files.forEach(function (file, i) {
                    var orientation;
                    if (!/\/(?:jpeg|png|gif)/i.test(file.type)) return;
                    // 读取图片的元信息
                    EXIF.getData(file, function () {
                        orientation = EXIF.getTag(this, 'Orientation');
                    });
                    let reader = new FileReader();
                    reader.onload = function () {
                        // 使用exif
                        that.getImgData(this.result, orientation, function (data) {
                            // 这里可以使用校正后的图片data了
                            var img = new Image();
                            img.src = data;
                            // 图片加载完毕之后进行压缩,然后上传
                            if (img.complete) {
                                callback();
                            } else {
                                img.onload = callback;
                            }
 
                            function callback() {
                                let data = that.compress(img);
                                let post = {
                                    file: data,
                                    extName: 'jpeg',
                                    oldFileUrl: that.handIDImg
                                };
                                //                that.handIDImg = data;
                                that.uploadImgByUnified('handID', post);
                                // 发送后台请求
                            }
                        });
                    };
                    reader.readAsDataURL(file);
                });
            },
            //       工作照上传
            workPhotoChange: function (evt) {
                // 工作证件图片上传
                if (this.workCertImages.length > 4) {
                    this.validateTip('最多上传 5 张');
                    return false;
                }
                const files = Array.prototype.slice.call(evt.target.files);
                let that = this;
                files.forEach(function (file, i) {
                    let orientation;
                    if (!/\/(?:jpeg|png|gif)/i.test(file.type)) return;
                    // 读取图片的元信息
                    EXIF.getData(file, function () {
                        orientation = EXIF.getTag(this, 'Orientation');
                    });
                    let reader = new FileReader();
                    reader.onload = function () {
                        // 使用exif
                        that.getImgData(this.result, orientation, function (data) {
                            // 这里可以使用校正后的图片data了
                            let img = new Image();
                            img.src = data;
                            // 图片加载完毕之后进行压缩,然后上传
                            if (img.complete) {
                                callback();
                            } else {
                                img.onload = callback;
                            }
 
                            function callback() {
                                var data = that.compress(img);
                                let post = {
                                    file: data,
                                    extName: 'jpeg',
                                    oldFileUrl: ''
                                };
                                //                that.workCertImages.push(data);
                                that.uploadImgByUnified('workCert', post);
                                // 发送后台请求
                            }
                        });
                    };
                    reader.readAsDataURL(file);
                });
            },
            //        删除当前选择的图片
            deleteCurrentImg: function (evt, index) {
                // 删除图片
                let _this = this;
                let par = {
                    prodId: this.$route.query.prodId,
                    fileType: 'workCert',
                    fileUrl: _this.workCertImages[index]
                };
                SystApi.deleteImageFile(par).then(
                    function (res) {
                        if (res.errorCode === 0) {
                            _this.workCertImages.splice(index, 1);
                        }
                    },
                    function (error) {
                        if (error.response) {
                        }
                    }
                );
            },
            lifePhotoChangeClick: function (evt) {
                let htmlNode = evt.target.getElementsByTagName('input')[0];
                if (htmlNode) {
                    htmlNode.click();
                }
                //        console.log(evt.target.getElementsByTagName("input")[0].click());
                //        this.$refs._testFile.dispatchEvent(new MouseEvent('click'))
            },
            //    居住证明
            lifePhotoChange: function (evt) {
                // 居住证件图片上传
                if (this.residenceCertImage) {
                    this.validateTip('最多上传 1 张');
                    return false;
                }
                // loading 显示加载中
                store.commit('updateLoadingStatus', {isLoading: true});
                const files = Array.prototype.slice.call(evt.target.files);
                let that = this;
                files.forEach(function (file, i) {
                    let orientation;
                    if (!/\/(?:jpeg|png|gif)/i.test(file.type)) return;
                    // 读取图片的元信息
                    EXIF.getData(file, function () {
                        orientation = EXIF.getTag(this, 'Orientation');
                    });
                    let reader = new FileReader();
                    reader.onload = function () {
                        // 使用exif
                        that.getImgData(this.result, orientation, function (data) {
                            // 这里可以使用校正后的图片data了
                            var img = new Image();
                            img.src = data;
                            // 图片加载完毕之后进行压缩,然后上传
                            if (img.complete) {
                                callback();
                            } else {
                                img.onload = callback;
                            }
 
                            function callback() {
                                var data = that.compress(img);
                                let post = {
                                    file: data,
                                    extName: 'jpeg',
                                    oldFileUrl: that.residenceCertImage
                                };
                                //                that.residenceCertImage = data;
                                that.uploadImgByUnified('residenceCert', post);
                                // 发送后台请求
                            }
                        });
                    };
                    reader.readAsDataURL(file);
                });
            },
            secelted: function (type, imgobj) {
                // 跳转到下一步
                if (type === 'IDFront') {
                    imgobj.oldFileUrl = this.Idcard.positive;
                } else if (type === 'IDBack') {
                    imgobj.oldFileUrl = this.Idcard.reverse;
                }
                this.uploadImgByUnified(type, imgobj);
            },
            uploadImgByUnified: function (type, par) {
                let _this = this;
                _this.imageSync = true;
                par.fileType = type;
                par.extName = 'jpeg';
                par.file = par.file.split(',')[1];
                par.prodId = this.$route.query.prodId;
                SystApi.upLoadImg(par).then(
                    function (res) {
                        _this.imageSync = false;
                        store.commit('updateLoadingStatus', {isLoading: false});
                        if (res.errorCode === 0) {
                            if (type === 'IDFront') {
                                _this.Idcard.positive = res.body;
                            } else if (type === 'IDBack') {
                                _this.Idcard.reverse = res.body;
                            } else if (type === 'handID') {
                                _this.handIDImg = res.body;
                            } else if (type === 'residenceCert') {
                                _this.residenceCertImage = res.body;
                            } else if (type === 'workCert') {
                                _this.workCertImages.push(res.body);
                            }
                        }
                    },
                    function (error) {
                        _this.imageSync = false;
                        store.commit('updateLoadingStatus', {isLoading: false});
                        statusCodeManage.showTipOfStatusCode(error);
                    }
                );
            },
            // 图片旋转处理
            getImgData: function (img, dir, next) {
                // @param {string} img 图片的base64
                // @param {int} dir exif获取的方向信息
                // @param {function} next 回调方法,返回校正方向后的base64
                var image = new Image();
                let canvas = document.createElement('canvas');
                let ctx = canvas.getContext('2d');
                image.onload = function () {
                    let resultWidth = 0;
                    let resultHeight = 0;
                    let maxWidthOrHeight = 1024;
                    let drawWidth = this.naturalWidth;
                    let drawHeight = this.naturalHeight;
                    // 以下改变图片大小,控制最大宽度为1024
                    var maxSide = Math.max(drawWidth, drawHeight);
                    if (maxSide > maxWidthOrHeight) {
                        let minSide = Math.min(drawWidth, drawHeight);
                        minSide = minSide / maxSide * maxWidthOrHeight;
                        maxSide = maxWidthOrHeight;
                        if (drawWidth > drawHeight) {
                            resultWidth = maxSide;
                            resultHeight = minSide;
                        } else {
                            resultWidth = minSide;
                            resultHeight = maxSide;
                        }
                    }
                    if (dir === 3) {
                        canvas.width = resultWidth;
                        canvas.height = resultHeight;
                        ctx.translate(resultWidth, resultHeight);
                        ctx.rotate(Math.PI);
                    } else if (dir === 6) {
                        canvas.width = resultHeight;
                        canvas.height = resultWidth;
                        ctx.translate(resultHeight, 0);
                        ctx.rotate(Math.PI / 2);
                    } else if (dir === 8) {
                        canvas.width = resultHeight;
                        canvas.height = resultWidth;
                        ctx.translate(0, resultWidth);
                        ctx.rotate(-Math.PI / 2);
                    } else {
                        canvas.width = resultWidth;
                        canvas.height = resultHeight;
                    }
                    ctx.drawImage(this, 0, 0, resultWidth, resultHeight);
                    // 返回校正图片
                    next(canvas.toDataURL('image/jpeg', 0.8));
                };
                image.src = img;
            },
            // 压缩图片
            compress: function (img) {
                // 用于压缩图片的canvas
                let canvas = document.createElement('canvas');
                let ctx = canvas.getContext('2d');
                //    瓦片canvas
                var tCanvas = document.createElement('canvas');
                var tctx = tCanvas.getContext('2d');
                let width = img.width;
                let height = img.height;
                // 如果图片大于四百万像素,计算压缩比并将大小压至400万以下
                var ratio;
                if ((ratio = width * height / 4000000) > 1) {
                    ratio = Math.sqrt(ratio);
                    width /= ratio;
                    height /= ratio;
                } else {
                    ratio = 1;
                }
                canvas.width = width * 2;
                canvas.height = height * 2;
                // 铺底色
                ctx.fillStyle = '#fff';
                ctx.fillRect(0, 0, canvas.width, canvas.height);
                // 如果图片像素大于100万则使用瓦片绘制
                var count;
                if ((count = width * height / 1000000) > 1) {
                    count = ~~(Math.sqrt(count) + 1); // 计算要分成多少块瓦片
                    // 计算每块瓦片的宽和高
                    var nw = ~~(width / count);
                    var nh = ~~(height / count);
                    tCanvas.width = nw;
                    tCanvas.height = nh;
                    for (var i = 0; i < count; i++) {
                        for (var j = 0; j < count; j++) {
                            tctx.drawImage(
                                img,
                                i * nw * ratio,
                                j * nh * ratio,
                                nw * ratio * 2,
                                nh * ratio * 2,
                                0,
                                0,
                                nw,
                                nh
                            );
                            ctx.drawImage(tCanvas, i * nw, j * nh, nw * 2, nh * 2);
                        }
                    }
                } else {
                    ctx.drawImage(img, 0, 0, width * 2, height * 2);
                }
                // 进行最小压缩
                let ndata = canvas.toDataURL('image/jpeg', 0.8);
                return ndata;
            },
            inItPage: function () {
                let _this = this;
                let submitInfo = {
                    prodId: this.$route.query.prodId
                };
                SystApi.initMaterialInfo(submitInfo).then(
                    response => {
                        if (response.errorCode === 0) {
                            let _body = response.body;
                            _this.Idcard.positive = _body.idFrontImage;
                            _this.Idcard.reverse = _body.idBackImage;
                            _this.handIDImg = _body.handIDImage;
                            _this.residenceCertImage = _body.residenceCertImage;
                            _this.workCertImages = _body.workCertImages
                                ? _body.workCertImages
                                : [];
                        }
                    },
                    error => {
                        statusCodeManage.showTipOfStatusCode(error, _this);
                    }
                );
            }
        },
        components: {
            Scroller,
            XHeader,
            Group,
            GroupTitle,
            Cell,
            XInput,
            XButton,
            Flexbox,
            FlexboxItem,
            FlowLine,
            XImg,
            Flow,
            FlowState,
            XDialog,
            Icon,
            'img-upload': upload
        },
        activated: function () {
            store.commit('updateDirection', {direction: 'in'});
            this.inItPage();
        }
    };
</script>
 
<style lang="less">
    @import '../../style/mixin.less';
 
    .loan-info-box {
        .vux-header {
            .color-linear-gradient(@color-primary-light, @color-primary, 90deg);
            .vux-header-left {
                .left-arrow:before {
                    border: solid 1px @color-white;
                    border-width: 2px 0 0 2px;
                }
            }
        }
        background-color: @color-background-default;
        .closePhoto {
            position: absolute;
            top: -10px;
            right: -10px;
            font-size: 20px;
            color: #ff4d53;
            background: transparent;
        }
 
        .progressState div p {
            font-size: @font-size-tiny;
        }
        .weui-wepay-flow__state {
            width: 16px;
            height: 16px;
            top: -1px;
            padding-top: 1px;
        }
        .currentStep .weui-wepay-flow__state {
            width: 16px;
            height: 16px;
            padding-top: 1px;
            border: 1px solid @color-primary;
            color: @color-primary;
            border-radius: 50%;
            background-color: @color-white;
        }
        .weui-input {
            height: 28px;
            line-height: 28px;
        }
        .weui-wepay-flow,
        .weui-wepay-flow-auto {
            padding: 10px 40px 30px;
            background: @color-white;
        }
        .weui-wepay-flow__li_done .weui-wepay-flow__state,
        .weui-wepay-flow__process {
            background-color: @color-primary;
        }
        .IDCardUpLoadBut {
            font-size: @font-size-small;
            border-radius: 15px;
        }
    }
 
    .header-space {
        height: 46px;
    }
 
    .left-arrow:before {
        border-color: @color-white !important;
    }
 
    .weui-btn_default {
        color: @color-white !important;
    }
 
    .weui-wepay-flow__title-bottom {
        font-size: 12px !important;
    }
 
    .IDcardbgDiv {
        height: 80px;
    }
 
    .loan-info-box .weui-cell_select .weui-select {
        padding-right: 2.5rem;
        direction: rtl;
    }
 
    .loan-info-box .weui-input {
        text-align: right;
    }
 
    .loan-info-box .weui-btn_primary {
        .color-linear-gradient(@color-primary-light, @color-primary, 90deg);
    }
 
    .IDcardFlexbox {
        background-color: @color-white;
        padding-top: 15px;
    }
 
    .upload {
        width: 66%;
        margin-left: 17%;
    }
 
    .IDcardSampleList {
        box-sizing: border-box;
        padding: 0 12px;
    }
 
    .IDcardSampleList img {
        width: 90%;
    }
 
    .figureBlock {
        vertical-align: top;
    }
 
    .IDcardsampleGroup .weui-cells {
        margin-top: 0;
        padding-top: 6px;
    }
 
    .IDcardsampleGroup .weui-cells:before {
        display: none;
    }
 
    .IDcardsampleGroup .weui-cell_access .weui-cell__ft {
        right: 27%;
    }
 
    .IDcardsampleGroup .weui-cell_access .weui-cell__ft:after {
        border-color: @color-primary;
    }
 
    .IDcardsampleGroup .weui-cell_access .weui-cell__ft {
        right: 20%;
        margin-top: -3px;
    }
 
    .IDcardsampleINfo {
        text-align: center;
        font-size: 16px;
        color: @color-primary;
    }
 
    .groupTitle {
        font-size: 14px;
    }
 
    .groupTitle span {
        color: @color-text-placeholder-red;
    }
 
    .groupSmallTitle {
        font-size: 10px;
        padding-left: 6px;
    }
 
    .cardsampleItem {
        display: inline-block;
        text-align: center;
        font-size: 10px;
        width: 85%;
    }
 
    .handIDItemsbox {
        height: 90px;
        width: 450px;
        position: relative;
        top: 10px;
    }
 
    .handIDItems {
        display: inline-block;
        width: 70%;
    }
 
    .workPhtotoItem {
        position: relative;
        float: left;
        display: inline-block;
        margin-left: 10px;
        width: 80px;
        height: 80px;
    }
 
    .workPhtotoItem:nth-child(1) {
        margin-left: 0;
    }
 
    .workPhtotoItem img {
        width: 80px;
        height: 80px;
    }
 
    .workPhtotoLoadBut {
        display: inline-block;
        width: 80px;
        padding-top: 10px;
        text-align: center;
    }
 
    .handIDItem {
        width: 80px;
        margin-top: 10px;
        /*height: ;*/
    }
 
    .handIDItem img {
        width: 100%;
        max-height: 80px;
    }
 
    .handIDItem div {
        text-align: center;
    }
 
    .photoItem {
        height: 100px;
        padding: 10px 15px;
        background-color: @color-white;
    }
 
    .photoItem .handIDItem {
        position: relative;
        display: inline-block;
    }
 
    .cameraIcon {
        float: right;
        /*padding-top: 10px;*/
    }
 
    .cameraIcon .cameraIconDiv {
        position: relative;
        height: 80px;
        width: 80px;
        line-height: 80px;
        vertical-align: middle;
        border: 1px dashed @color-primary;
    }
 
    .PhotoChangeInput {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        /*width: 1px;*/
        /*height: 1px;*/
        opacity: 0;
    }
 
    .cameraIcon .icon-camerafill {
        font-size: 30px;
        color: @color-primary;
    }
 
    .photoDivFooter .photoSubBut {
        color: #fff;
        .color-linear-gradient(@color-primary-light, @color-primary, 90deg);
    }
 
    .MaximizeImgdialog .weui-dialog {
        background-color: transparent;
    }
</style>