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
 
/**
 * Created by c.k on 2018/5/2.
 * 接口的统一处理
 */
 
export default {
    goBackFun(instanceObj) {
        // 返回产品列表页面
        // console.log(instanceObj.$store.getters.pageRecode);
        if (instanceObj.prodType == 40000006) {    // 大额贷款
            instanceObj.$router.push({path: '/f-loan/f-bank'});
        } else if (instanceObj.prodType == 40000007) {  // 信用卡贷款
            instanceObj.$router.push({path: '/f-loan/f-credit'});
        } else {  // 默认进入小额贷款
            instanceObj.$router.push({path: '/f-loan/f-speed'});
        }
        console.log(instanceObj.prodType);
        // if(instanceObj.isMark){
        //     if(instanceObj.$store.getters.pageRecode.length == 1){
        //         instanceObj.isMark = false;
        //         instanceObj.$router.go(-1);
        //         return;
        //     }
        //
        //     for (let i = 1, j = instanceObj.$store.getters.pageRecode.length; i < j; i++) {
        //         if (instanceObj.$store.getters.pageRecode[0].name == instanceObj.$store.getters.pageRecode[i].name) {
        //             // window.history.go(-i);
        //             instanceObj.$router.push(instanceObj.$store.getters.pageRecode[i+1].fullPath);
        //             break;
        //         }
        //     }
        //     instanceObj.isMark = false;
        // }else{
        //     // 如果之前没有执行返回,这里执行返回 back -1
        //     instanceObj.$router.go(-1);
        // }
    },
    gotoNext(to, from, next) {
        next(vm => {
            console.log(from.path);
            if (from.name != null) {
                let pathArr = ['/f-login', '/f-auth', '/f-register',
                    '/incomeLoan/auditResults',
                    '/incomeLoan/phototInfo',
                    '/incomeLoan/bindcard',
                    '/incomeLoan/houseAndJobInfo',
                    '/incomeLoan/personalInfo'];
                for (let i = 0, j = pathArr.length; i < j; i++) {
                    if (pathArr[i] == from.path) {
                        vm.isMark = true;
                        break;
                    }
                }
            } else {
                vm.isMark = false;
            }
        });
    }
};