宜呗小程序--微信小程序
Lzk
2025-08-05 b7bcaf556aa2424e808b6e6426ab22df9cfe11c1
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
<template>
  <view  style="background: #F7F7F7;">
    <view class="content">
      <steps style="margin-bottom: 10rpx;" :active="1"></steps>
      <view class="info">
        <view class="title">资质信息</view>
        <uv-form  :labelStyle='lstyle'     labelWidth="100" style="padding:0 36rpx;">
          <uv-form-item label="学历" prop="educationStr" borderBottom @click="openPicker('education')">
            <uv-input v-model="userInfo.educationStr" disabled border="none" disabledColor="none" placeholder="请选择"></uv-input>
            <template v-slot:right>
              <uv-icon name="arrow-down" size="12"></uv-icon>
            </template>
          </uv-form-item>
          <uv-form-item label="婚姻状况" prop="maritalStatus"  @click="openPicker('maritalStatus')">
            <uv-input v-model="userInfo.maritalStatusStr" disabled border="none" disabledColor="none" placeholder="请选择"></uv-input>
            <template v-slot:right>
              <uv-icon name="arrow-down" size="12"></uv-icon>
            </template>
          </uv-form-item>
 
 
 
 
 
 
        </uv-form>
 
      </view>
      <view class="info" style="margin-top: 10rpx;">
        <view class="title">亲属联系人</view>
        <uv-form  :labelStyle='lstyle' :model="userInfo"    labelWidth="100" style="padding:0 36rpx;">
          <uv-form-item label="亲属关系" prop="relationStr" borderBottom @click="openPicker('relation')">
            <uv-input v-model="userInfo.relationStr" disabled border="none" disabledColor="none" placeholder="请选择"></uv-input>
            <template v-slot:right>
              <uv-icon name="arrow-down" size="12"></uv-icon>
            </template>
          </uv-form-item>
          <uv-form-item label="姓名" prop="relationName" borderBottom>
            <uv-input v-model="userInfo.relationName" border="none" placeholder="请输入姓名"></uv-input>
          </uv-form-item>
 
 
          <uv-form-item label="手机号" prop="relationPhone" borderBottom>
            <uv-input maxlength="11" type="tel" v-model="userInfo.relationPhone" border="none" placeholder="请输入手机号"></uv-input>
          </uv-form-item>
          <uv-form-item v-if="userInfo.relation=='01'" label="配偶身份证" prop="certNo" borderBottom>
            <uv-input maxlength="18" type="idcard" v-model="userInfo.certNo" border="none" placeholder="请输入配偶身份证信息"></uv-input>
          </uv-form-item>
          <uv-form-item v-if="userInfo.relation=='01'" label="配偶公司" prop="contactCompany" >
            <uv-input type="tel" v-model="userInfo.contactCompany" border="none" placeholder="请输入配偶公司"></uv-input>
          </uv-form-item>
        </uv-form>
 
      </view>
 
      <view class="info" style="margin-top: 10rpx;">
        <view class="title">一般联系人</view>
        <uv-form  :labelStyle='lstyle' :model="userInfo"    labelWidth="100" style="padding:0 36rpx;">
          <uv-form-item label="姓名" prop="contactName" borderBottom>
            <uv-input v-model="userInfo.contactName" border="none" placeholder="请输入姓名"></uv-input>
          </uv-form-item>
 
 
          <uv-form-item label="手机号" prop="contactPhone" >
            <uv-input maxlength="11" type="tel" v-model="userInfo.contactPhone" border="none" placeholder="请输入手机号"></uv-input>
          </uv-form-item>
 
        </uv-form>
 
 
      </view>
 
      <view class="agreement"  style="margin-top: 12rpx;">
        <uv-checkbox-group
            v-model="protocolChecked">
          <uv-checkbox :name="1" size="14">
            <view style="display: flex;flex-direction: row;font-size: 24rpx">
              我已阅读并同意<text class="protocol" @click="openAgreement">《平台服务协议》</text>
            </view>
          </uv-checkbox>
        </uv-checkbox-group>
 
      </view>
      <uv-button
          :disabled="loading"
          :loading="loading"
          color="linear-gradient(104deg, #6d89ff 0%, #2865f2 100%), linear-gradient(270deg, #4766fe 0%, #7d9fff 100%)"
          shape="circle"  type="primary"  text="下一步" customStyle="margin-top: 54rpx;height:100rpx" @click="submit"></uv-button>
    </view>
 
 
 
 
 
    <loanUsage ref="loanUsage"   @confirm="getValueLoanUsage"></loanUsage>
    <education ref="education"   @confirm="getValueEducation"></education>
    <maritalStatus ref="maritalStatus"   @confirm="getValueMaritalStatus"></maritalStatus>
    <relation ref="relation"   @confirm="getValueRelation"></relation>
    <agreement ref="agreement"></agreement>
    <sfkef></sfkef>
  </view>
</template>
<script>
import { mobile, idCard } from '@/uni_modules/uv-ui-tools/libs/function/test.js';
import debounce from '@/uni_modules/uv-ui-tools/libs/function/debounce.js';
import loanUsage from "@/components/picker/loanUsage.vue";
import steps from "@/components/steps/index.vue";
import {appFourAddRelationInfo, checkUserStatus} from "@/api/modules/user";
import agreement from "@/components/agreement/index.vue";
import Education from "@/components/picker/education.vue";
import maritalStatus from "@/components/picker/maritalStatus.vue";
import relation from '@/components/picker/relation.vue'
import sfkef from "@/components/sfkef/index.vue";
export default {
  components: {
    steps,loanUsage,agreement,Education,maritalStatus,relation,sfkef
  },
  data() {
    return {
 
      loading:false,
      protocolChecked:[1],
      lstyle:{
        color:'#252938',
        fontSize:'28rpx',
        fontWeight:'800'
      },
      userInfo: {
        education: '',
        educationStr: '',
        maritalStatus: '',
        maritalStatusStr: '',
        relation: '',
        relationStr: '',
        relationName: '',
        relationPhone: '',
        certNo: '',
        contactCompany: '',
        phone: '',
 
      },
 
    }
  },
  created() {
    checkUserStatus().then(res=>{uni.setStorageSync('customerId', res.customerId);});
  },
  methods: {
    openAgreement() {
      this.$refs.agreement.open();
    },
 
 
 
    // 获取Picker的值
 
 
    getValueLoanUsage(e){
      this.userInfo.loanUsageStr = e['value'][0].text
      this.loanUsageStrBox = e
    },
    getValueEducation(e){
      this.userInfo.educationStr = e['value'][0].text
      this.userInfo.education = e['value'][0].value
      this.educationStrBox = e
    },
    getValueMaritalStatus(e){
      this.userInfo.maritalStatusStr = e['value'][0].text;
      this.userInfo.maritalStatus = e['value'][0].value;
      this.maritalStatusStrBox = e
    },
    getValueRelation(e){
      this.userInfo.relationStr = e['value'][0].text;
      this.userInfo.relation = e['value'][0].value;
      this.relationStrBox = e
    },
 
    // 提交
    submit() {
 
      console.log(uni.getSystemInfoSync());
      if(!this.protocolChecked[0]){
        uni.showToast({icon: 'none', title: '请先阅读并同意《用户隐私协议》'})
        return
      }
 
      if(!this.userInfo.education){
        uni.showToast({icon: 'none', title: '请选择学历'})
        return;
      }
      if(!this.userInfo.maritalStatus){
        uni.showToast({icon: 'none', title: '请选择婚姻状况'})
        return;
      }
      if (!this.userInfo.relation){
        uni.showToast({icon: 'none', title: '请选择亲属关系'})
        return;
      }
      if (!this.userInfo.relationName){
        uni.showToast({icon: 'none', title: '请输入亲属姓名'})
        return;
      }
      if (!this.userInfo.relationPhone){
        uni.showToast({icon: 'none', title: '请输入亲属手机号'})
        return;
      }
      if(!mobile(this.userInfo.relationPhone)){
        uni.showToast({icon: 'none', title: '请输入正确的亲属手机号'})
        return;
      }
      if (!this.userInfo.certNo && this.userInfo.relation=='01'){
        uni.showToast({icon: 'none', title: '请输入配偶身份证'})
        return;
      }
      if (!idCard(this.userInfo.certNo) && this.userInfo.relation=='01'){
        uni.showToast({icon: 'none', title: '请输入正确的配偶身份证'})
        return;
      }
 
 
      if (!this.userInfo.contactCompany && this.userInfo.relation=='01'){
        uni.showToast({icon: 'none', title: '请输入配偶公司'})
        return;
      }
 
 
      if (!this.userInfo.contactName){
        uni.showToast({icon: 'none', title: '请输入联系人姓名'})
        return;
      };
      if (!this.userInfo.contactPhone){
        uni.showToast({icon: 'none', title: '请输入联系人手机号'})
        return;
      }
      if(!mobile(this.userInfo.contactPhone)){
        uni.showToast({icon: 'none', title: '请输入正确的联系人手机号'})
        return;
      }
      if(this.userInfo.contactPhone==this.userInfo.relationPhone){
        uni.showToast({icon: 'none', title: '联系人手机号不能与亲属手机号相同'})
        return;
      }
 
 
      this.loading = true
      debounce(()=>{
 
        appFourAddRelationInfo({
          phone: uni.getStorageSync('phone'),
          id: uni.getStorageSync('customerId'),
 
          education: this.userInfo.education, // 学历
          maritalStatus: this.userInfo.maritalStatus, // 婚姻状况
 
 
          relationship: this.userInfo.relation,  // 亲属关系
          relationshipPhone: this.userInfo.relationPhone,  // 亲属手机号码
          relationshipName: this.userInfo.relationName,  // 亲属姓名
          certNo: this.userInfo.certNo, // 配偶身份证
          contactCompany: this.userInfo.contactCompany, // 配偶公司名称
 
 
          contactName: this.userInfo.contactName, // 配偶公司名称
          contactPhone: this.userInfo.contactPhone, // 配偶公司名称
 
          loanAmount: 180000, loanTerm: 36,
 
 
 
        }).then(res=>{
          uni.navigateTo({
            url: '/pages/apply/steps-c'
          })
 
        }).catch(err=>{
          this.loading = false
        })
      })
 
 
    },
 
 
 
    // 打开Picker
    openPicker(dom){
      this.$refs[dom].open()
    },
 
 
  },
 
}
</script>
<style scoped lang="scss">
.content{
  margin: 30rpx;
  .info{
    background: #fff;
    border-radius: 16rpx;
    padding-top: 40rpx;
    .title{
      font-size: 34rpx;
      color: #252938;
      font-weight: bold;
      position: relative;
      padding-left: 36rpx;
      &:after{
        content: '';
        position: absolute;
        bottom: -10rpx;
        left: 0;
        width: 6rpx;
        height: 100%;
        background: #2865F2;
        border-radius: 0rpx 0rpx 0rpx 0rpx;
      }
    }
  }
}
 
.protocol{
 
  font-size: 24rpx;color: #207ef5;
}
.agreement{
  display: flex;
  flex-direction: row;
  justify-content: center;
  .protocol{
    font-size: 24rpx;color: #207ef5;
  }
}
</style>