index.js 7.76 KB
Newer Older
1 2 3 4
/*
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-24 12:34:06
786817560's avatar
786817560 committed
5
 * @LastEditTime: 2019-10-17 11:02:08
6 7
 * @LastEditors: Please set LastEditors
 */
李晓兵's avatar
李晓兵 committed
8 9 10 11 12 13 14 15 16 17
import Vue from 'vue'
import Router from 'vue-router'

import Guide from '@/pages/guide/guide'
import Login from '@/pages/login'
import Regiester from '@/pages/regiester'
import PwdForgot from '@/pages/pwd-forgotten'
import FingerLogin from '@/pages/finger-login'
import Home from '@/pages/home'
import Tab from '@/pages/tab'
786817560's avatar
786817560 committed
18
import HomePage from '@/pages/home/home-page'
786817560's avatar
786817560 committed
19 20
// 定位
import Location from '@/pages/home/location'
李晓兵's avatar
李晓兵 committed
21 22 23 24 25 26 27

// 我的
import MyInfo from '@/pages/myInfo/my-info'

// test工具类
import HlsPopup from '@/pages/hlsPopup'

李晓兵's avatar
李晓兵 committed
28 29 30 31
// 用户绑定
import UserBind from '@/pages/userBind/userBind'
import NaturePerson from '@/pages/userBind/np/naturePerson'
import Enterprise from '@/pages/userBind/org/enterprise'
李晓兵's avatar
李晓兵 committed
32 33 34
// 用户绑定查询
import NaturePersonReadOnly from '@/pages/userBind/npReadOnly/naturePersonReadOnly'
import EnterpriseReadOnly from '@/pages/userBind/orgReadOnly/enterpriseReadOnly'
35 36
// 进件审批
import Base from '@/pages/intoApproval/intoApproval/base'
linxin's avatar
linxin committed
37
import IntoList from '@/pages/intoApproval/intoList'
linxin's avatar
linxin committed
38
import Refund from '@/pages/intoApproval/intoApproval/refund'
39
// 经销商签约
786817560's avatar
786817560 committed
40 41
import ContractList from '@/pages/distributorSign/contract-list'
import ContractDetails from '@/pages/distributorSign/contract-details'
786817560's avatar
786817560 committed
42 43 44
import FinancDetails from '@/pages/distributorSign/financ-details' // 还款计划
import FinancingTrial from '@/pages/distributorSign/financing-trial'
import FinancingDetails from '@/pages/distributorSign/financing-details' // 融资明细
24776's avatar
24776 committed
45 46 47 48 49
// 合同签约
import ContractSigning from '../pages/contractSigning/contract-signing'
import ContractDetail from '@/pages/ContractSigning/contract-detail'
import ContractContent from '@/pages/ContractSigning/contract-content'
import EntryInfo from '@/pages/ContractSigning/entry-info'
24776's avatar
24776 committed
50 51 52 53 54 55 56 57 58 59 60
// 首付款支付
import FirstPay from '../pages/pay/firstPay/first-pay'
import PayEntry from '@/pages/pay/firstPay/pay-entry'
import ContractRecord from '@/pages/pay/firstPay/contract-record'
// 款项支付
import PaymentFirstPay from '../pages/pay/payment/first-pay'
import PaymentPayEntry from '@/pages/pay/payment/pay-entry'
import PaymentContractRecord from '@/pages/pay/payment/contract-record'
// 保证金支付
import MarginFirstPay from '../pages/pay/marginPay/first-pay'
import MarginPayEntry from '../pages/pay/marginPay/pay-entry'
786817560's avatar
786817560 committed
61 62
// 产品查询
import QueryHome from '@/pages/productQuery/query-home'
786817560's avatar
786817560 committed
63
import ProDetailed from '@/pages/productQuery/product-detailed'
linxin's avatar
linxin committed
64 65
// 消息中心
import InfoCenter from '@/pages/infoCenter/infoList'
786817560's avatar
786817560 committed
66
import ProductList from '@/pages/productQuery/product-list'
李晓兵's avatar
李晓兵 committed
67 68 69 70 71 72 73
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: to => {
李晓兵's avatar
李晓兵 committed
74 75
        return {name: 'Login'}
      /*  if (!window.localStorage.needGuid || window.localStorage.needGuid === 'true') {
李晓兵's avatar
李晓兵 committed
76 77 78 79 80 81 82 83
          return {name: 'Guide'}
        } else {
          if (window.localStorage.isOpenFingerLogin) {
            return {name: 'FingerLogin'}
          } else {
            // if none of the above states are matched, use this as the fallback
            return {name: 'Login'}
          }
李晓兵's avatar
李晓兵 committed
84
        } */
李晓兵's avatar
李晓兵 committed
85 86 87 88 89 90
      },
    },
    {
      path: '/tab',
      component: Tab,
      name: 'Tab',
786817560's avatar
786817560 committed
91
      redirect: '/tab/home-page',
李晓兵's avatar
李晓兵 committed
92 93
      meta: {keepAlive: true},
      children: [
786817560's avatar
786817560 committed
94
        {path: '/tab/home-page', component: HomePage, name: 'HomePage', meta: {keepAlive: false}},
李晓兵's avatar
李晓兵 committed
95
        {path: '/tab/my-info', component: MyInfo, name: 'MyInfo', meta: {keepAlive: true}},
linxin's avatar
linxin committed
96
        {path: '/tab/info-center', component: InfoCenter, name: 'InfoCenter', meta: {keepAlive: true}},
李晓兵's avatar
李晓兵 committed
97 98 99
      ],
    },

786817560's avatar
786817560 committed
100 101 102 103
    {
      path: '/home-page',
      component: HomePage,
      name: 'HomePage',
786817560's avatar
786817560 committed
104
      meta: {keepAlive: false},
786817560's avatar
786817560 committed
105
    },
786817560's avatar
786817560 committed
106 107 108 109 110 111
    {
      path: '/location',
      component: Location,
      name: 'Location',
      meta: {keepAlive: false},
    },
786817560's avatar
786817560 committed
112

李晓兵's avatar
李晓兵 committed
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
    {
      path: '/guide',
      component: Guide,
      name: 'Guide',
      meta: {keepAlive: true},
    },
    {
      path: '/login',
      component: Login,
      name: 'Login',
      meta: {keepAlive: true},
    },
    {
      path: '/regiester',
      component: Regiester,
      name: 'Regiester',
      meta: {keepAlive: false},
    },
    {
      path: '/finger-login',
      component: FingerLogin,
      name: 'FingerLogin',
      meta: {keepAlive: true},
    },
    {path: '/pwd-forgot', component: PwdForgot, name: 'PwdForgot', meta: {keepAlive: true}},

    // test工具类
    {path: '/hls-popup', component: HlsPopup, name: 'HlsPopup', meta: {keepAlive: false}},
李晓兵's avatar
李晓兵 committed
141 142 143 144
    // 用户绑定
    {path: '/user-bind', component: UserBind, name: 'UserBind', meta: {keepAlive: false}},
    {path: '/nature-person', component: NaturePerson, name: 'NaturePerson', meta: {keepAlive: false}},
    {path: '/enterprise', component: Enterprise, name: 'Enterprise', meta: {keepAlive: false}},
李晓兵's avatar
李晓兵 committed
145 146 147
    // 用户绑定查询
    {path: '/nature-person-readonly', component: NaturePersonReadOnly, name: 'NaturePersonReadOnly', meta: {keepAlive: false}},
    {path: '/enterprise-readonly', component: EnterpriseReadOnly, name: 'EnterpriseReadOnly', meta: {keepAlive: false}},
148
    // 进件审批
linxin's avatar
linxin committed
149
    {path: '/base', component: Base, name: 'Base', meta: {keepAlive: false}},
linxin's avatar
linxin committed
150
    {path: '/refund', component: Refund, name: 'Refund', meta: {keepAlive: false}},
linxin's avatar
linxin committed
151
    {path: '/intoList', component: IntoList, name: 'IntoList', meta: {keepAlive: false}},
152
    // 经销商签约
李晓兵's avatar
李晓兵 committed
153
    {path: '/contract-list', component: ContractList, name: 'ContractList', meta: {keepAlive: false}},
786817560's avatar
786817560 committed
154
    {path: '/contract-details', component: ContractDetails, name: 'ContractDetails', meta: {keepAlive: false}},
786817560's avatar
786817560 committed
155
    {path: '/financ-details', component: FinancDetails, name: 'FinancDetails', meta: {keepAlive: true}},
786817560's avatar
786817560 committed
156 157
    {path: '/financing-trial', component: FinancingTrial, name: 'FinancingTrial', meta: {keepAlive: false}},
    {path: '/financing-details', component: FinancingDetails, name: 'FinancingDetails', meta: {keepAlive: false}},
24776's avatar
24776 committed
158 159 160 161 162
    // 合同签约
    {path: '/contract-signing', component: ContractSigning, name: 'ContractSigning', meta: {keepAlive: true}},
    {path: '/contract-detail', component: ContractDetail, name: 'ContractDetail', meta: {keepAlive: true}},
    {path: '/contract-content', component: ContractContent, name: 'ContractContent', meta: {keepAlive: true}},
    {path: '/entry-info', component: EntryInfo, name: 'EntryInfo', meta: {keepAlive: true}},
24776's avatar
24776 committed
163 164 165 166 167 168 169 170 171 172 173
    // 首付款支付
    {path: '/first-pay', component: FirstPay, name: 'FirstPay', meta: {keepAlive: true}},
    {path: '/pay-entry', component: PayEntry, name: 'PayEntry', meta: {keepAlive: true}},
    {path: '/contract-record', component: ContractRecord, name: 'ContractRecord', meta: {keepAlive: true}},
    // 款项支付
    {path: '/payment-first-pay', component: PaymentFirstPay, name: 'PaymentFirstPay', meta: {keepAlive: true}},
    {path: '/payment-pay-entry', component: PaymentPayEntry, name: 'PaymentPayEntry', meta: {keepAlive: true}},
    {path: '/payment-contract-record', component: PaymentContractRecord, name: 'PaymentContractRecord', meta: {keepAlive: true}},
    // 保证金支付
    {path: '/margin-first-pay', component: MarginFirstPay, name: 'MarginFirstPay', meta: {keepAlive: true}},
    {path: '/margin-pay-entry', component: MarginPayEntry, name: 'MarginPayEntry', meta: {keepAlive: true}},
786817560's avatar
786817560 committed
174 175
    // 产品查询
    {path: '/query-home', component: QueryHome, name: 'QueryHome', meta: {keepAlive: true}},
786817560's avatar
786817560 committed
176
    {path: '/product-detailed', component: ProDetailed, name: 'ProDetailed', meta: {keepAlive: false}},
786817560's avatar
786817560 committed
177
    {path: '/product-list', component: ProductList, name: 'ProductList', meta: {keepAlive: true}},
李晓兵's avatar
李晓兵 committed
178 179 180 181 182 183 184 185 186
  ],
  scrollBehavior (to, from, savedPosition) {
    if (to.hash) {
      return {
        selector: to.hash,
      }
    }
  },
})