applypage3.vue 7.68 KB
Newer Older
王建威's avatar
王建威 committed
1 2
<template>
	<view class="page3_content">
zhengxiuming's avatar
zhengxiuming committed
3
		<TopBar title="采购分期"/>
王建威's avatar
王建威 committed
4 5 6 7 8 9 10
		<view class="page3_tips">其他补充信息(选填)</view>
		<view class="apply_data_content">
			<view :style="{'margin-top':'40rpx'}">
				<view class="apply_title">资产证明补充</view>
				<view class="apply_desc">上传更多的资产证明可以更快认证您的资质</view>
			</view>
			<view class="apply_data_item">
王建威's avatar
王建威 committed
11
				<view v-if="!params.house_property" class="apply_upload" @click="uploadImage('house_property')">
王建威's avatar
王建威 committed
12 13 14
					<text class="eosfont icons">&#xe60d;</text>
					<text class="upload_font">房产证明照片</text>
				</view>
王建威's avatar
王建威 committed
15 16 17 18 19
				<view v-if="params.house_property" class="apply_upload">
					<text class="close_icon" @click="clearParams('house_property')"></text>
					<image class="preview_img" :src="params.house_property"></image>
				</view>
				<view v-if="!params.deposit_certificate" class="apply_upload" @click="uploadImage('deposit_certificate')">
王建威's avatar
王建威 committed
20 21 22
					<text class="eosfont icons">&#xe60d;</text>
					<text class="upload_font">存款或理财照片/截图</text>
				</view>
王建威's avatar
王建威 committed
23 24 25 26 27
				<view v-if="params.deposit_certificate" class="apply_upload">
					<text class="close_icon" @click="clearParams('deposit_certificate')"></text>
					<image class="preview_img" :src="params.deposit_certificate"></image>
				</view>
				<view v-if="!params.user_sesame_level" class="apply_upload" @click="uploadImage('user_sesame_level')">
王建威's avatar
王建威 committed
28 29 30
					<text class="eosfont icons">&#xe60d;</text>
					<text class="upload_font">法人芝麻信用照片/截图</text>
				</view>
王建威's avatar
王建威 committed
31 32 33 34 35
				<view v-if="params.user_sesame_level" class="apply_upload">
					<text class="close_icon" @click="clearParams('user_sesame_level')"></text>
					<image class="preview_img" :src="params.user_sesame_level"></image>
				</view>
				<view v-if="!params.business_sesame_level" class="apply_upload" @click="uploadImage('business_sesame_level')">
王建威's avatar
王建威 committed
36 37 38
					<text class="eosfont icons">&#xe60d;</text>
					<text class="upload_font">企业芝麻信用照片/截图</text>
				</view>
王建威's avatar
王建威 committed
39 40 41 42
				<view v-if="params.business_sesame_level" class="apply_upload">
					<text class="close_icon" @click="clearParams('business_sesame_level')"></text>
					<image class="preview_img" :src="params.business_sesame_level"></image>
				</view>
王建威's avatar
王建威 committed
43 44 45 46 47
			</view>
			<view :style="{'margin-top':'60rpx'}">
				<view class="apply_title">其他补充证明</view>
			</view>	
			<view class="apply_data_item">
王建威's avatar
王建威 committed
48
				<view v-if="!params.vehicle_license" class="apply_upload" @click="uploadImage('vehicle_license')">
王建威's avatar
王建威 committed
49 50 51
					<text class="eosfont icons">&#xe60d;</text>
					<text class="upload_font">机动车驾驶证照片</text>
				</view>
王建威's avatar
王建威 committed
52 53 54 55
				<view v-if="params.vehicle_license" class="apply_upload">
					<text class="close_icon" @click="clearParams('vehicle_license')"></text>
					<image class="preview_img" :src="params.vehicle_license"></image>
				</view>
王建威's avatar
王建威 committed
56 57
			</view>
			<view class="apply_btn_box">
王建威's avatar
王建威 committed
58 59
				<view class="apply_btn" @click="backup()">上一步</view>
				<view class="apply_btn next_btn" @click="submit()">下一步</view>
王建威's avatar
王建威 committed
60 61 62 63 64 65
			</view>
		</view>
	</view>
</template>

<script>
王建威's avatar
王建威 committed
66
	import TopBar from '@/components/TopBar/TopBar.vue';
王建威's avatar
王建威 committed
67 68 69
	export default {
		data() {
			return {
王建威's avatar
王建威 committed
70 71 72 73 74 75
				params: {
					house_property: '', //房产证
					deposit_certificate: '', //存款理财
					user_sesame_level: '', //法人芝麻信用
					business_sesame_level: '', //企业芝麻信用
					vehicle_license: '', //机动车
王建威's avatar
王建威 committed
76 77
				},
				submitFlag: true,
王建威's avatar
王建威 committed
78 79
				data: null,
				qualification_id: ''
王建威's avatar
王建威 committed
80 81
			}
		},
王建威's avatar
王建威 committed
82
		onLoad(option) {
王建威's avatar
王建威 committed
83
				const d = uni.getStorageSync('installment');
王建威's avatar
王建威 committed
84
				uni.request({
王建威's avatar
王建威 committed
85
					url: `/uni/api/userqualification/GetUserQualification/${d.property_id}/${d.equipment_id}`,
王建威's avatar
王建威 committed
86 87 88 89 90 91 92
					method: 'GET',
					success: (res) => {
						const d = res.data.data;
						Object.keys(this.params).forEach((item, index) => {
							this.params[item] = d[item]
						});
						this.data = {
王建威's avatar
王建威 committed
93
							contract_no: option.contract_no,
王建威's avatar
王建威 committed
94 95 96 97 98 99
							equipment_id: d.equipment_id,
							property_id: d.property_id
						},
						this.qualification_id = d.qualification_id
						uni.setStorage({
							key: 'installment',
王建威's avatar
王建威 committed
100
							data: this.data
王建威's avatar
王建威 committed
101 102 103
						});
					}
				});
王建威's avatar
王建威 committed
104
		},
王建威's avatar
王建威 committed
105 106 107
		methods: {
			uploadImage(key) {
				uni.chooseImage({
王建威's avatar
王建威 committed
108
					sizeType: ['compress'],
王建威's avatar
王建威 committed
109
					count:1,
王建威's avatar
王建威 committed
110
					success: (res) => {
王建威's avatar
王建威 committed
111 112
						uni.showLoading({
							title: '上传中'
王建威's avatar
王建威 committed
113
						})
王建威's avatar
王建威 committed
114 115 116 117 118 119 120 121
						const tempFilePaths = res.tempFilePaths
						uni.uploadFile({
							url: '/uni/api/resources',
							filePath: tempFilePaths[0],
							name: 'file',
							success: (uploadFileRes) => {
								const data = JSON.parse(uploadFileRes.data)
								this.params[key] = data.data;
王建威's avatar
王建威 committed
122
								uni.hideLoading();
王建威's avatar
王建威 committed
123 124 125 126 127 128 129
							}
						});
					}
				})
			},
			clearParams(key) {
				this.params[key] = '';
王建威's avatar
王建威 committed
130 131 132 133 134 135 136
			},
			backup() {
				this.$backup();
			},
			submit() {
				if(!this.submitFlag) return
				this.submitFlag = false;
王建威's avatar
王建威 committed
137 138
				uni.showToast({
					title: '提交中',
王建威's avatar
王建威 committed
139 140
					icon: 'none',
					duration: 90000
王建威's avatar
王建威 committed
141
				})
王建威's avatar
王建威 committed
142
				uni.request({
王建威's avatar
王建威 committed
143
					url: '/uni/api/userqualification/EditUserQualification/third',
王建威's avatar
王建威 committed
144 145 146
					method: 'PUT',
					data: {
						...this.params,
王建威's avatar
王建威 committed
147 148
						...this.data,
						qualification_id: this.qualification_id
王建威's avatar
王建威 committed
149 150
					},
					success: (res) => {
王建威's avatar
王建威 committed
151
						this.submitFlag = true;
王建威's avatar
王建威 committed
152 153
						if(res.data.code === 0) {
							uni.navigateTo({
王建威's avatar
王建威 committed
154
								url: `/pages/theRights/theRights`
王建威's avatar
王建威 committed
155 156
							});
						} else {
王建威's avatar
王建威 committed
157
							uni.hideToast();
王建威's avatar
王建威 committed
158 159
							uni.showToast({
								icon: 'none',
王建威's avatar
王建威 committed
160
								title: res.data.message
王建威's avatar
王建威 committed
161 162 163 164
							})
						}
					}
				});
王建威's avatar
王建威 committed
165
			}
王建威's avatar
王建威 committed
166 167 168
		},
		components: {
			TopBar
王建威's avatar
王建威 committed
169 170 171 172 173 174 175
		}
	}
</script>

<style lang="less" scoped>
	.page3_content {
		background: #fff;
王建威's avatar
王建威 committed
176
		padding-top: 80rpx;
王建威's avatar
王建威 committed
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
		.apply_data_content {
			background: #fff;
			padding: 0 36rpx;
			box-sizing: border-box;
			width: 100%;
			.apply_data_item {
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;
				.apply_upload {
					margin-top: 40rpx;
					width: 328rpx;
					height: 200rpx;
					background: rgba(248,248,248,1);
					border-radius: 16rpx;
					.icons {
						width: 36rpx;
						height: 36rpx;
						color: #AEAEAE;
						display: block;
						margin: 72rpx auto 10rpx;
					}
					.upload_font {
						font-size: 24rpx;
						color: #AEAEAE;
						display: block;
						text-align: center;
					}
王建威's avatar
王建威 committed
205 206 207 208 209 210 211 212 213 214 215 216 217 218
					.preview_img {
						width: 100%;
						height: 100%;
					}
					.close_icon {
						width: 28rpx;
						height: 28rpx;
						position: absolute;
						top: -14rpx;
						right: -14rpx;
						background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAYFBMVEUhISFVSRlWSRlpWBZxXxWfgw6jhg30xAH38Ob38ef38ej49O369vH69vL7+PT8+/n+/v3+/v7/zQD/zQL/1Cb/2T7/4GT/43H/43L/54f/88P/9Mj/+eX//ff//v7///+7HAjXAAAA3ElEQVQoz4XSWRKDIAwAUKFW4tIqQS2uvf8tK4iAojZ/5DFMEhJ9byLyD9M4TufYy1ogilr2AQ4N2miGHc6dQC9ENzucWzxEO1vsMIhuw0GEKAaDupYkZmuaxYmuasVe5+KIaGUkinWi1yjRJJUyai6h1FijU2dYK5y2cpQSayimBUdb4aLOEMc/yP1n6eFZ7hVEGSO7gkrXCmW2I9NKYYdAtyE87BAyHozvaccH75vBQ1pdfxlAzi8/GwBel2sCSvnFgimEvHKr+fFWUyOkb3621GAiK0q+XOA+/gCtlj2I+YoKDQAAAABJRU5ErkJggg==') no-repeat;
						background-size: 100% 100%;
						z-index: 10;
					}
王建威's avatar
王建威 committed
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
				}
			}
			.apply_btn_box {
				display: flex;
				justify-content: space-between;
				width: 678rpx;
				margin: 60rpx 0;
				.apply_btn {
					width:328rpx;
					height:80rpx;
					background:rgba(245,245,245,1);
					border-radius:16rpx;
					background: #f5f5f5;
					line-height: 80rpx;
					font-size: 28rpx;
					text-align: center;
				}
				.next_btn {
					background: #FFCD00;
				}
			}
		}
		.page3_tips {
			color: #7C7C7C;
			font-size: 32rpx;
			width: 678rpx;
			margin: 36rpx auto 0;
		}
		.apply_title {
			font-size:32rpx;
			font-family:PingFangSC-Medium,PingFang SC;
			font-weight:500;
			line-height: 44rpx;
			color: #212121;
		}
		.apply_desc {
			font-size:24rpx;
			line-height: 34rpx;
			color: #979797;
			margin-top: 8rpx;
		}
	}
</style>