Kaynağa Gözat

修改粮商身份

wangchao 3 yıl önce
ebeveyn
işleme
f99cf8ed81

+ 6 - 3
pageD/identity/companyIdentity.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="center">
 		<view v-if='!status' class="top">
-			<text @click='consent' v-bind:class="switchs1">公司</text>
-			<text @click='consent' v-bind:class="switchs2">个人</text>
+			<text @click='consent' v-bind:class="switchs1" v-if="consentStatus">公司</text>
+			<text @click='consent' v-bind:class="switchs2" v-if="consentStatus1">个人</text>
 		</view>
 		<view class="content">
 			<view v-if="consentStatus == true">
@@ -80,6 +80,7 @@
 		name: "buy",
 		data() {
 			return {
+				isShowPerson:false,
 				action: this.$uploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				btnLoading: false, //防止重复点击
@@ -118,17 +119,19 @@
 				id1: "../../static/img/authentication/identityup(3).png",
 				id2: "../../static/img/authentication/identitylow(3).png",
 				identityImgs1: {},
-status:false,
+				status:false,
 				identityAuthenticationInfo: {},
 				tempFilePaths: [],
 				businessLicenseAddressUrl: "",
 				certificates: true,
+				isEdit:false
 			};
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		onLoad(options) {
+			// this.isEdit = options.isEdit;
 			if(options.status){
 				this.status=true
 				this.consentStatus = false

+ 182 - 64
pageD/identity/companyIdentityThree.vue

@@ -2,20 +2,21 @@
 	<view class="center">
 		<view>
 			<!-- 上传银行卡正面 -->
-			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
-				:size-type="['compressed']" @on-success="getImgUrl"  @on-remove="onRemove"
+			<upload class="upload" :file-list='payeeAddressUrlList[0]' ref="upload" :action="action" :max-size="maxSize"
+				:max-count="1" :size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions"
 				:custom="uploadCustom"></upload>
 			<!-- 上传银行卡反面 -->
-			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
-				:size-type="['compressed']" @on-success="getImgUrl1"  @on-remove="onRemove"
+			<upload class="upload" :file-list='payeeAddressUrlList[1]' ref="upload" :action="action" :max-size="maxSize"
+				:max-count="1" :size-type="['compressed']" @on-success="getImgUrl1" @on-remove="onRemove"
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions1"
-				:custom="uploadCustom" ></upload>
+				:custom="uploadCustom"></upload>123456
 		</view>
 		<view class="c-row b-b">
 			<text class="tit">银行卡号</text>
 			<view class="con-list">
-				<input type='number' placeholder="请填写银行卡号" name="input" v-model="identityAuthenticationInfo.bankCard"></input>
+				<input type='number' placeholder="请填写银行卡号" name="input"
+					v-model="identityAuthenticationInfo.bankCard"></input>
 			</view>
 		</view>
 		<view class="c-row b-b">
@@ -129,6 +130,7 @@
 				zhihangStatus: true,
 				verification: true,
 				identityAuthenticationInfos: {},
+				payeeAddressUrlList: []
 			}
 		},
 		computed: {
@@ -140,6 +142,16 @@
 				this.identityAuthenticationInfo.payeeName = this.identityAuthenticationInfo.customerName
 				this.identityAuthenticationInfo.payeeNumberCard = this.identityAuthenticationInfo.customerNumberCard
 			}
+			if (this.identityAuthenticationInfo.payeeAddressUrl) {
+				let _lsit = []
+				_lsit = this.identityAuthenticationInfo.payeeAddressUrl.split(',')
+				this.payeeAddressUrlList[0] = [{
+					url: _lsit[0]
+				}]
+				this.payeeAddressUrlList[1] = [{
+					url: _lsit[0]
+				}]
+			}
 		},
 		methods: {
 			filterFileType(index, lists) {
@@ -321,15 +333,15 @@
 					// 	return
 					// }
 				} else if (this.identityAuthenticationInfo.customerTypeFlag == 2) {
-					// if (!this.identityAuthenticationInfo.compAddress) {
-					// 	this.$api.msg('公司地址不能为空')
-					// 	return
-					// }
-					// if (this.identityAuthenticationInfo.compAddress.length < 2 || this.identityAuthenticationInfo
-					// 	.compAddress.length > 20) {
-					// 	this.$api.msg('公司地址输入错误')
-					// 	return
-					// }
+					if (!this.identityAuthenticationInfo.compAddress) {
+						this.$api.msg('公司地址不能为空')
+						return
+					}
+					if (this.identityAuthenticationInfo.compAddress.length < 2 || this.identityAuthenticationInfo
+						.compAddress.length > 20) {
+						this.$api.msg('公司地址输入错误')
+						return
+					}
 				}
 				this.amendprice()
 
@@ -348,23 +360,26 @@
 					showCancel: true,
 					confirmText: '确定',
 					success: function(res) {
+
+						console.log('confirmInfo', that.identityAuthenticationInfo)
 						if (res.confirm) {
 							uni.showLoading({
-								title:"正在提交",
-								mask:true
+								title: "正在提交",
+								mask: true
 							})
 							that.$api.doRequest('get', '/commonUser/loginVerifyCode', {
 									phone: that.identityAuthenticationInfo.customerPhone,
 									verifyCode: that.verifyCode
 								}).then(res => {
-									console.log("loginVerifyCode:",res)
+									console.log("loginVerifyCode:", res)
 									if (res.data.code == 200) {
 										if (that.userInfo) {
 											that.identityAuthenticationInfo.commonId = that.userInfo.id
 										} else {
 											that.identityAuthenticationInfo.commonId = res.data.data.id
 										}
-										that.identityAuthenticationInfo.payeeAddressUrl = that.bankid.toString()
+										that.identityAuthenticationInfo.payeeAddressUrl = that.bankid
+											.toString()
 										// that.identityAuthenticationInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
 										that.identityAuthenticationInfos.customerPhone = that
 											.identityAuthenticationInfo.customerPhone
@@ -372,63 +387,164 @@
 												'/identityAuthenticationInfo/selectPhone', that
 												.identityAuthenticationInfos)
 											.then(res => {
-												console.log("selectPhone:",res)
+												console.log("selectPhone:", res)
 												if (res.data.code == '11018') {
 													uni.showModal({
 														title: '提示',
 														content: '该手机号已认证过个人粮商,再次认证将覆盖之前的认证信息,是否确定认证?',
 														success: function(res) {
 															if (res.confirm) {
-																that.$api.doRequest('post',
-																		'/identityAuthenticationInfo/api/addIdentityAuthenticationInfo',
-																		that
-																		.identityAuthenticationInfo
+																if (that
+																	.identityAuthenticationInfo
+																	.id) {
+																	that.$api.doRequest(
+																			'post',
+																			'/identityAuthenticationInfo/api/editIdentityAuthenticationInfo',
+																			that
+																			.identityAuthenticationInfo,
+																			'application/json;charset=UTF-8'
+																		).then(res => {
+																			console
+																				.log(
+																					"成功连接"
+																				)
+																			if (!that
+																				.identityAuthenticationInfo
+																				.goodsName
+																			) {
+																				that.$api
+																					.msg(
+																						'修改成功!'
+																					)
+																				uni.navigateTo({
+																					url: `/pages/attestation/index`
+																				})
+																				return
+																			}
+
+
+																		})
+																		.catch(res => {
+																			if (res
+																				.errmsg
+																			) {
+																				uni.showToast({
+																					title: res
+																						.errmsg,
+																					icon: 'none',
+																					duration: 2000
+																				})
+																			} else {
+																				uni.showToast({
+																					title: "系统异常,请联系管理员",
+																					icon: 'none',
+																					duration: 2000
+																				})
+																			}
+																		});
+
+
+																} else {
+																	that.$api.doRequest(
+																			'post',
+																			'/identityAuthenticationInfo/api/addIdentityAuthenticationInfo',
+																			that
+																			.identityAuthenticationInfo
 																		)
-																	.then(res => {
-																		if (res.data.code ==200) {
-																			uni.showToast({
-																				title: '提交成功',
-																				icon: 'none',
-																				duration: 2000
-																			})
-																			setTimeout(()=>{uni.navigateBack({
-																				delta: 3
-																			})},2000);
-																		}
-																	})
+																		.then(res => {
+																			if (res
+																				.data
+																				.code ==
+																				200) {
+																				uni.showToast({
+																					title: '提交成功',
+																					icon: 'none',
+																					duration: 2000
+																				})
+																				setTimeout
+																					(() => {
+																							uni.navigateBack({
+																								delta: 3
+																							})
+																						},
+																						2000
+																					);
+																			}
+																		})
+																}
 															}
 														}
 													});
 												} else if (res.data.code == 200) {
-													that.$api.doRequest('post',
-															'/identityAuthenticationInfo/api/addIdentityAuthenticationInfo',
-															that.identityAuthenticationInfo)
-														.then(res => {
-															console.log("addIdentityAuthenticationInfo:",res)
-															if (res.data.code == 200) {
-																uni.showToast({
-																	title: '提交成功',
-																	icon: 'none',
-																	duration: 2000
-																})
-																setTimeout(()=>{uni.navigateBack({
-																	delta: 3
-																})},2000);
-																
-															}
-															else{
-																console.log("异常1:",res)
-																uni.showToast({
-																	title: "系统异常,请联系管理员",
-																	icon: 'none',
-																	duration: 2000
+													if (that.identityAuthenticationInfo.id) {
+														that.$api.doRequest('post',
+																'/identityAuthenticationInfo/api/editIdentityAuthenticationInfo',
+																that.identityAuthenticationInfo,
+																'application/json;charset=UTF-8').then(
+																res => {
+																	console.log("成功连接")
+																	if (!that
+																		.identityAuthenticationInfo
+																		.goodsName) {
+																		that.$api.msg('修改成功!')
+																		uni.navigateTo({
+																			url: `/pages/attestation/index`
+																		})
+																		return
+																	}
+
 																})
-															}
-														})
+															.catch(res => {
+																if (res.errmsg) {
+																	uni.showToast({
+																		title: res.errmsg,
+																		icon: 'none',
+																		duration: 2000
+																	})
+																} else {
+																	uni.showToast({
+																		title: "系统异常,请联系管理员",
+																		icon: 'none',
+																		duration: 2000
+																	})
+																}
+															});
+
+													} else {
+														that.$api.doRequest('post',
+																'/identityAuthenticationInfo/api/addIdentityAuthenticationInfo',
+																that.identityAuthenticationInfo)
+															.then(res => {
+																console.log(
+																	"addIdentityAuthenticationInfo:",
+																	res)
+																if (res.data.code == 200) {
+																	uni.showToast({
+																		title: '提交成功',
+																		icon: 'none',
+																		duration: 2000
+																	})
+																	setTimeout(() => {
+																		uni.navigateBack({
+																			delta: 3
+																		})
+																	}, 2000);
+
+																} else {
+																	console.log("异常1:", res)
+																	uni.showToast({
+																		title: "系统异常,请联系管理员",
+																		icon: 'none',
+																		duration: 2000
+																	})
+																}
+															})
+													}
+
 												}
 												uni.hideLoading()
 											}).catch(res => {
-												console.log("异常:",res)
+												console.log("异常:", res)
 												uni.showToast({
 													title: "系统异常,请联系管理员",
 													icon: 'none',
@@ -457,13 +573,13 @@
 									uni.hideLoading()
 									return false
 								});
-							
+
 						} else if (res.cancel) {
 							// console.log('用户点击取消');
 						}
 					}
 				})
-				
+
 			},
 			getcode() {
 				var that = this
@@ -591,10 +707,12 @@
 		top: -150px;
 		text-align: center;
 	}
+
 	.upload {
 		margin: 20rpx 0;
 	}
-	.tit_red{
+
+	.tit_red {
 		color: #E54D42;
 	}
 </style>

+ 10 - 2
pageD/identity/companyIdentityTwo.vue

@@ -2,12 +2,12 @@
 	<view class="center">
 		<view>
 			<!-- 个人身份证正面 -->
-			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
+			<upload class="upload" :file-list='cardAddressUrlList[0]' ref="upload" :action="action" :max-size="maxSize" :max-count="1"
 				:size-type="['compressed']" @on-success="getImgUrl1"  @on-remove="onRemove"
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions1"
 				:custom="uploadCustom1" ></upload>
 			<!-- 个人身份证反面 -->
-			<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
+			<upload class="upload" :file-list='cardAddressUrlList[1]' ref="upload" :action="action" :max-size="maxSize" :max-count="1"
 				:size-type="['compressed']" @on-success="getImgUrl2"  @on-remove="onRemove"
 				@on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions2"
 				:custom="uploadCustom1" ></upload>
@@ -45,6 +45,7 @@
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				btnLoading: false, //防止重复点击
 				isAdd: true,
+				cardAddressUrlList:[],
 				imgUrls: [],
 				uploadCustom1: true,
 				uploadCustom2: true,
@@ -68,6 +69,12 @@
 		onLoad(options) {
 			this.identityAuthenticationInfo = JSON.parse(options.identityAuthenticationInfo)
 			console.log(this.identityAuthenticationInfo)
+			if (this.identityAuthenticationInfo.cardAddressUrl) {
+				let _lsit = []
+				_lsit = this.identityAuthenticationInfo.cardAddressUrl.split(',')
+				this.cardAddressUrlList[0] = [{url:_lsit[0]}]
+				this.cardAddressUrlList[1] = [{url:_lsit[0]}]
+			}
 		},
 		methods: {
 			filterFileType(index, lists) {
@@ -152,6 +159,7 @@
 				this.imgUrls.splice(index, 1);
 			},
 			jumpUrl() {
+				
 				this.identityAuthenticationInfo.cardAddressUrl = this.id.toString()
 				// if (this.id[0] == '' || this.id[0] == null) {
 				// 	this.$api.msg('请上传身份证正面')

+ 2 - 1
pages/attestation/indexTwo.vue

@@ -450,8 +450,9 @@
 				})
 			},
 			companyEdit(item) {
+				
 				uni.navigateTo({
-					url: `/pageD/identity/companyIdentity?id=${item.id}`
+					url: `/pageD/identity/companyIdentity?isEdit=${true}&id=${item.id}`
 				})
 			},
 		}