Browse Source

贷款-授权测试

panyong 4 years ago
parent
commit
2bf0d747b7

+ 1 - 1
htmldev/loan/src/api/request.js

@@ -27,7 +27,7 @@ request.interceptors.response.use(response => {
 }, (error) => {
   // Do something with response error
   if (error.response && error.response.status === 301) {
-    location.replace(error.response.data.authorize_url)
+    // location.replace(error.response.data.authorize_url)
   }
   return Promise.reject(error)
 })

+ 18 - 18
htmldev/loan/src/router/index.js

@@ -4,10 +4,10 @@ import VueRouter from 'vue-router'
 Vue.use(VueRouter)
 
 const routes = [
-  {
-    path: '*',
-    redirect: '/404'
-  },
+  // {
+  //   path: '*',
+  //   redirect: '/404'
+  // },
   {
     path: '/404',
     name: '404',
@@ -34,17 +34,17 @@ const routes = [
   },
   {
     path: '/loan/apply', // 基本信息填写
-    name: 'Apply',
+    name: 'loanApply',
     component: () => import(/* webpackChunkName: "loan_apply" */ '../views/loan/apply')
   },
   {
     path: '/loan/attest', // 上传资料
-    name: 'Attest',
+    name: 'loanAttest',
     component: () => import(/* webpackChunkName: "loan_attest" */ '../views/loan/attest')
   },
   {
     path: '/loan/bespeak', // 预约现场办理时间
-    name: 'Bespeak',
+    name: 'loanBespeak',
     component: () => import(/* webpackChunkName: "loan_bespeak" */ '../views/loan/bespeak')
   },
   {
@@ -59,12 +59,12 @@ const routes = [
   },
   {
     path: '/loan/help', // 还款助手
-    name: 'Help',
+    name: 'loanHelp',
     component: () => import(/* webpackChunkName: "loan_help" */ '../views/loan/help')
   },
   {
     path: '/loan/about', // 了解我们
-    name: 'About',
+    name: 'loanAbout',
     component: () => import(/* webpackChunkName: "loan_about" */ '../views/loan/about')
   },
   {
@@ -73,7 +73,7 @@ const routes = [
     children: [
       {
         path: '', // 推广
-        name: 'Marketing',
+        name: 'partnerMarketing',
         component: () => import(/* webpackChunkName: "partner_marketing" */ '../views/partner/marketing'),
         meta: {
           isUseCache: false,
@@ -82,14 +82,14 @@ const routes = [
       },
       {
         path: 'mine', // 我的
-        name: 'Mine',
+        name: 'partnerMine',
         component: () => import(/* webpackChunkName: "partner_mine" */ '../views/partner/mine')
       }
     ]
   },
   {
     path: '/partner/goods', // 贷款产品
-    name: 'Goods',
+    name: 'partnerGoods',
     component: () => import(/* webpackChunkName: "partner_goods" */ '../views/partner/goods'),
     meta: {
       isUseCache: false,
@@ -98,7 +98,7 @@ const routes = [
   },
   {
     path: '/partner/sale', // 放款总额
-    name: 'Sale',
+    name: 'partnerSale',
     component: () => import(/* webpackChunkName: "partner_sale" */ '../views/partner/sale'),
     meta: {
       isUseCache: false,
@@ -107,7 +107,7 @@ const routes = [
   },
   {
     path: '/partner/wallet', // 我的钱包
-    name: 'Wallet',
+    name: 'partnerWallet',
     component: () => import(/* webpackChunkName: "partner_wallet" */ '../views/partner/wallet'),
     meta: {
       isUseCache: false,
@@ -116,7 +116,7 @@ const routes = [
   },
   {
     path: '/partner/business', // 我的合伙人
-    name: 'Business',
+    name: 'partnerBusiness',
     component: () => import(/* webpackChunkName: "partner_business" */ '../views/partner/business'),
     meta: {
       isUseCache: false,
@@ -125,7 +125,7 @@ const routes = [
   },
   {
     path: '/partner/login', // 登录
-    name: 'Login',
+    name: 'partnerLogin',
     component: () => import(/* webpackChunkName: "partner_login" */ '../views/partner/login')
   },
   {
@@ -135,7 +135,7 @@ const routes = [
   },
   {
     path: '/partner/join', // 成为合伙人-申请资料填写
-    name: 'Join',
+    name: 'partnerJoin',
     component: () => import(/* webpackChunkName: "partner_join" */ '../views/partner/join')
   },
   {
@@ -145,7 +145,7 @@ const routes = [
   },
   {
     path: '/partner/compact', // 签约
-    name: 'Compact',
+    name: 'partnerCompact',
     component: () => import(/* webpackChunkName: "partner_compact" */ '../views/partner/compact')
   },
   {

+ 7 - 0
htmldev/loan/src/views/loan/attest/api/index.js

@@ -0,0 +1,7 @@
+import request from '@/api/request'
+
+export const submitData = (data) => request({
+  method: 'POST',
+  url: '/home/applyOrder/submitData',
+  data: data
+})

+ 4 - 3
htmldev/loan/src/views/loan/attest/components/myUploader.vue

@@ -52,8 +52,9 @@
         })
         Promise.all(result).then(res => {
           res.forEach((item, index) => {
-            if (item.Data && item.Data.startsWith('http')) {
-              fileList[index].url = item.Data
+            console.log(item)
+            if (item.filePath && item.filePath.startsWith('http')) {
+              fileList[index].url = item.filePath
             }
             fileList[index].status = ''
             fileList[index].message = ''
@@ -72,7 +73,7 @@
           formData.append('file', file, file.name)
           formData.append('type', 'img')
           uploadFile(formData).then(res => {
-            resolve(res)
+            resolve(res.data)
           }).catch(err => {
             reject(err)
           })

+ 43 - 6
htmldev/loan/src/views/loan/attest/index.vue

@@ -25,12 +25,14 @@
                   :uploadType="uploadType1"
                   @funSetUploadData="funSetUploadData"/>
     </div>
-    <button class="submit" @click="funSubmit">提交</button>
+    <button class="submit disabled" @click="funSubmit">提交</button>
   </div>
 </template>
 
 <script>
   import MyUploader from './components/myUploader'
+  import { submitData } from './api'
+  import { Toast } from 'vant'
 
   export default {
     name: 'attest',
@@ -42,7 +44,8 @@
         uploadType0: 'credit',
         uploadType1: 'house',
         creditReport: [],
-        houseProperty: []
+        houseProperty: [],
+        arrErrorList: []
       }
     },
     async mounted () {
@@ -57,7 +60,33 @@
           this.houseProperty = value
         }
       },
-      funSubmit () {}
+      verifyData () {
+        const { creditReport, houseProperty } = this
+        this.arrErrorList = []
+        if (!creditReport.length) {
+          this.arrErrorList.push('请上传主贷人征信报告')
+        }
+        if (!houseProperty.length) {
+          this.arrErrorList.push('请上传房产信息凭证照片证件')
+        }
+        return this.arrErrorList.length <= 0
+      },
+      funSubmit () {
+        const postData = {
+          id: 0,
+          checkContent1: this.creditReport,
+          checkContent2: this.houseProperty
+        }
+        if (!this.verifyData()) {
+          Toast({
+            message: this.arrErrorList[0],
+            forbidClick: true
+          })
+        }
+        submitData(postData).then(res => {
+          this.$router.replace({ path: '/loan/detail' })
+        })
+      }
     }
   }
 </script>
@@ -137,8 +166,16 @@
     line-height: 20px;
     font-size: 14px;
     font-weight: 500;
-    color: #fff;
-    background: linear-gradient(90deg, #E5C7A5 0%, #CFAA7F 100%);
-    box-shadow: 0 14px 9px -10px rgba(219, 208, 194, 1);
+
+    &.disabled {
+      color: #999;
+      background: #F2F2F2;
+    }
+
+    &.active {
+      color: #fff;
+      background: linear-gradient(90deg, #E5C7A5 0%, #CFAA7F 100%);
+      box-shadow: 0 14px 9px -10px rgba(219, 208, 194, 1);
+    }
   }
 </style>