Просмотр исходного кода

合伙人-贷款产品、签约

panyong 4 лет назад
Родитель
Сommit
9a7add3f3e

+ 4 - 2
htmldev/loan/src/router/index.js

@@ -235,10 +235,12 @@ const routes = [
     props: true
   },
   {
-    path: '/partner/compact/:id', // 签约
+    path: '/partner/compact', // 签约
     name: 'partnerCompact',
     component: () => import(/* webpackChunkName: "partner_compact" */ '../views/partner/compact'),
-    props: true
+    props: (route) => ({
+      id: route.query.id
+    })
   },
   {
     path: '/partner/privacy', // 隐私协议

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

@@ -1,5 +1,12 @@
 import request from '@/api/request'
 
+// 查询是否签署协议
+export const getAgreement = () => request({
+  method: 'GET',
+  url: '/partner/agreement'
+})
+
+// 签署协议
 export const submitAgreement = (id) => request({
   method: 'POST',
   url: '/partner/submitAgreement',

+ 28 - 2
htmldev/loan/src/views/partner/compact/index.vue

@@ -1,23 +1,49 @@
 <template>
   <div class="wrapper">
     <div class="footer">
-      <a class="btn-apply" href="javascript:;" @click="funSubmitAgreement">我同意条款内容并签约</a>
+      <a class="btn-apply" href="javascript:;" @click="funSubmitAgreement" v-if="!contractFlag">我同意条款内容并签约</a>
     </div>
   </div>
 </template>
 
 <script>
   import { Toast } from 'vant'
-  import { submitAgreement } from './api'
+  import { getAgreement, submitAgreement } from './api'
 
   export default {
     name: 'compact',
     props: ['id'],
+    data () {
+      return {
+        contractFlag: true, // 是否签署协议(true签署false未签署)
+        partnerName: '', // 签署姓名
+        contractStartTime: '', // 合同开始时间
+        contractEndTime: '' // 合同终止时间
+      }
+    },
+    created () {
+      this.funFetchAgreement()
+    },
     async mounted () {
       await this.$nextTick()
       this.$refreshTitle('成为合伙人')
     },
     methods: {
+      funFetchAgreement () {
+        getAgreement().then(res => {
+          if (res.status) {
+            const { contractEndTime, contractFlag, contractStartTime, partnerName } = res.data
+            this.contractEndTime = contractEndTime
+            this.contractFlag = contractFlag
+            this.contractStartTime = contractStartTime
+            this.partnerName = partnerName
+          } else {
+            Toast(res.msg)
+          }
+        }).catch(err => {
+          Toast(err)
+        })
+      },
       funSubmitAgreement () {
         const id = this.id
         const myToast = Toast.loading({

+ 1 - 1
htmldev/loan/src/views/partner/detail/index.vue

@@ -38,7 +38,7 @@
                 <span style="color: #4BD863;" v-if="checks[2].checkStatus === 1">(通过审核)</span>
               </template>
             </p>
-            <router-link class="jump-compact" :to="{path: '/partner/compact/' + id}" v-if="checks[1].checkStatus === 1">
+            <router-link class="jump-compact" :to="{path: '/partner/compact?id=' + id}" v-if="checks[1].checkStatus === 1">
               在线签约
             </router-link>
             <template v-if="checks[1].checkStatus === 2">

+ 84 - 23
htmldev/loan/src/views/partner/goods/index.vue

@@ -5,9 +5,20 @@
     </div>
     <div class="better-scroll wrapper" ref="wrapper">
       <ul>
-        <li class="list" v-for="(item, index) in listData" :key="index" @click="funJumpDetail(item)">
-          <p class="name">{{ item.productName }}</p>
-          <p class="description">最高:{{ item.productPrice / 10000 }}万</p>
+        <li class="list bg-1" v-for="(item, index) in listData" :key="index" @click="funJumpDetail(item)">
+          <div class="top">
+            <div class="left-wrap">
+              <img :src="item.productLogUrl" alt="">
+            </div>
+            <div class="right-wrap">
+              <p>{{ item.productName }}</p>
+              <p>
+                <span>最高:</span>
+                <span class="col-1">{{ item.productPrice / 10000 }}</span>
+                <span class="col-1">万元</span>
+              </p>
+            </div>
+          </div>
         </li>
         <li class="load-status" v-if="listData.length && booFetchData">
           <p>{{ arrFetchStatus[numFetchStatus] }}</p>
@@ -131,8 +142,7 @@
         })
       },
       funJumpDetail (item) {
-        const { id } = item
-        this.$router.push({ path: `/loan/explain/${id}?partnerId=${this.partnerId}&partnerName=${this.partnerName}&partnerImgUrl=${this.partnerImgUrl}` })
+        // const { id } = item
       }
     }
   }
@@ -180,35 +190,86 @@
   }
 
   .list {
+    position: relative;
+    left: 0;
+    top: 0;
     display: flex;
     flex-direction: column;
     align-items: center;
     width: 343px;
-    min-height: 130px;
-    padding-top: 35px;
-    margin-top: 37px;
+    margin-bottom: 26px;
     border-radius: 4px;
-    background: #F2F2F2;
 
-    &:nth-of-type(1) {
-      margin-top: 24px;
+    &.bg-0 {
+      background: linear-gradient(270deg, #E2E2E2 0%, #C7C7C7 100%);
+    }
+
+    &.bg-1 {
+      background: linear-gradient(90deg, #44403B 0%, #93806B 100%);
     }
   }
 
-  .name {
-    width: 311px;
-    line-height: 20px;
-    font-size: 15px;
-    font-weight: 500;
-    color: #333;
+  .top {
+    display: flex;
+    align-items: center;
+    width: 297px;
+    padding: 18px 0 12px;
   }
 
-  .description {
-    width: 311px;
-    margin-top: 6px;
-    line-height: 20px;
-    font-size: 15px;
-    color: #333;
+  .left-wrap {
+    width: 60px;
+    height: 60px;
+    border-radius: 4px;
+    overflow: hidden;
+
+    img {
+      display: block;
+      width: 100%;
+    }
+  }
+
+  .right-wrap {
+    margin-left: 18px;
+
+    p:nth-of-type(1) {
+      line-height: 25px;
+      font-size: 18px;
+      font-weight: 500;
+      color: #fff;
+    }
+
+    p:nth-of-type(2) {
+      display: flex;
+      align-items: flex-end;
+
+      span:nth-of-type(1) {
+        padding-bottom: 5px;
+        line-height: 20px;
+        font-size: 15px;
+        color: #fff;
+      }
+
+      span:nth-of-type(2) {
+        line-height: 33px;
+        font-size: 24px;
+        font-weight: bold;
+      }
+
+      span:nth-of-type(3) {
+        padding-bottom: 4px;
+        line-height: 20px;
+        font-size: 15px;
+        font-weight: bolder;
+      }
+
+      .col-0 {
+        color: #A7A7A7;
+      }
+
+      .col-1 {
+        color: #D6BDA1;
+      }
+    }
   }
 
   .load-status {