From da400f96eb15dacda411bcfac122aa14cad4e01e Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 28 八月 2025 17:24:03 +0800
Subject: [PATCH] 前端

---
 small-program/pages/employment-certification/employment-certification.vue |  119 +++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 86 insertions(+), 33 deletions(-)

diff --git a/small-program/pages/employment-certification/employment-certification.vue b/small-program/pages/employment-certification/employment-certification.vue
index 5b178d8..b0b3a56 100644
--- a/small-program/pages/employment-certification/employment-certification.vue
+++ b/small-program/pages/employment-certification/employment-certification.vue
@@ -1,6 +1,12 @@
 <template>
 	<view class="box">
-		<view class="box-head" :style="{ backgroundImage: 'url(' + bgImg + ')' }">
+		<view class="box-head">
+			<!-- 鐢ㄥ伐 -->
+			<image class="box-head-bg" src="@/static/image/bg_renzheng_yonggong@2x.png" mode="widthFix" v-if="title === '鐢ㄥ伐璁よ瘉'"></image>
+			<!-- 璐ц繍 -->
+			<image class="box-head-bg" src="@/static/image/bg_renzheng_huoyun@2x.png" mode="widthFix" v-if="title === '璐ц繍璁よ瘉'"></image>
+			<!-- 鐢ㄩ -->
+			<image class="box-head-bg" src="@/static/image/bg_renzheng_gongcan@2x.png" mode="widthFix" v-if="title === '渚涢璁よ瘉'"></image>
 			<view class="box-head-info">
 				<text>{{title}}</text>
 				<text>璇锋寜瑕佹眰濉啓璁よ瘉淇℃伅</text>
@@ -78,8 +84,8 @@
 					</view>
 					<view class="item-upload" v-if="flag==0">
 						<view class="item-upload-item1" @click="uploadImg(1)">
-							<view class="image">
-								<image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix">
+							<view class="image":style="form.img1Full?'background-image:url('+form.img1Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -90,8 +96,8 @@
 							</view>
 						</view>
 						<view class="item-upload-item1" @click="uploadImg(2)">
-							<view class="image">
-								<image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix">
+							<view class="image":style="form.img2Full?'background-image:url('+form.img2Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -103,10 +109,10 @@
 					</view>
 					<view class="item-upload" v-if="flag==1">
 						<view class="item-upload-item1" @click="uploadImg(1)">
-							<view class="image">
-								<image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix">
+							<view class="image" :style="form.img1Full?'background-image:url('+form.img1Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix">
 								</image>
-								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
+								<image  src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
 							</view>
 							<view class="info">
@@ -115,8 +121,8 @@
 							</view>
 						</view>
 						<view class="item-upload-item1" @click="uploadImg(2)">
-							<view class="image">
-								<image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix">
+							<view class="image" :style="form.img2Full?'background-image:url('+form.img2Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -127,8 +133,8 @@
 							</view>
 						</view>
 						<view class="item-upload-item1" @click="uploadImg(3)">
-							<view class="image">
-								<image v-if="form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix">
+							<view class="image":style="form.img3Full?'background-image:url('+form.img3Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -140,8 +146,8 @@
 					</view>
 					<view class="item-upload" v-if="flag==2">
 						<view class="item-upload-item1" @click="uploadImg(1)">
-							<view class="image">
-								<image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix">
+							<view class="image":style="form.img1Full?'background-image:url('+form.img1Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -152,8 +158,8 @@
 							</view>
 						</view>
 						<view class="item-upload-item1" @click="uploadImg(2)">
-							<view class="image">
-								<image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix">
+							<view class="image":style="form.img2Full?'background-image:url('+form.img2Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -164,8 +170,8 @@
 							</view>
 						</view>
 						<view class="item-upload-item1" @click="uploadImg(3)">
-							<view class="image">
-								<image v-if="form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix">
+							<view class="image":style="form.img3Full?'background-image:url('+form.img3Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -176,8 +182,8 @@
 							</view>
 						</view>
 						<view class="item-upload-item1" @click="uploadImg(4)">
-							<view class="image">
-								<image v-if="form.img4Full && form.img4Full !=''" :src=" form.img4Full" mode="widthFix">
+							<view class="image":style="form.img4Full?'background-image:url('+form.img4Full+') ;background-size: 100% 100%;':''">
+								<image v-if="1==2&&form.img4Full && form.img4Full !=''" :src=" form.img4Full" mode="widthFix">
 								</image>
 								<image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image>
 								<text>鐐瑰嚮涓婁紶</text>
@@ -205,11 +211,13 @@
 		},
 		data() {
 			return {
-				bgImg: require('@/static/image/bg_renzheng_yonggong@2x.png'),
+				bgImg: null,
 				title: '鐢ㄦ埛璁よ瘉',
 				flag: null,
-				isCompany: false,
-				loading: false,
+ 
+				isCompany:false,
+				loading:false,
+				info: {}, 
 				form: {
 					"companyName": "",
 					authType: 0,
@@ -240,7 +248,8 @@
 			var flag = options.flag
 			this.flag = flag
 			this.initFormData()
-			switch (flag) {
+			this.getApplyData()
+			switch(flag){ 
 				case '1':
 					this.title = '璐ц繍璁よ瘉'
 					this.bgImg = require('@/static/image/bg_renzheng_huoyun@2x.png')
@@ -273,6 +282,7 @@
 				return false
 			},
 			applySubmit() {
+				console.log(this.loading)
 				if (this.loading) {
 					return
 				}
@@ -283,6 +293,7 @@
 					this.inNullParam(this.form.lgt) ||
 					this.inNullParam(this.form.location) ||
 					this.inNullParam(this.form.telephone)) {
+						
 					uni.showToast({
 						title: '瀵逛笉璧凤紝璇锋寜瑕佹眰濉啓鐢宠淇℃伅1锛�',
 						icon: "none",
@@ -337,23 +348,26 @@
 					param.img2 = this.form.img21
 				}
 				uni.requestSubscribeMessage({
-					tmplIds: ['4H9ztG4E9BxJLwMuYSZ6oiM7yb4KX7u7bYhkhYJP0-Y'],
+					tmplIds: ['VJho7-lf-4_WZFfOzenDndgwNDIA0EvCiE6vqBnExpQ'],
 					success(res) {
 						console.log('鎻愪氦鍙傛暟锛�', param)
-						this.$u.api.applyForIdentity(param).then(res => {
+						that.$u.api.applyForIdentity(param).then(res => {
 							if (res.code === 200) {
 								uni.showToast({
 									title: res.message || '鐢宠鎴愬姛 ',
 									icon: "none",
 									duration: 2000
 								});
-								uni.navigateBack({
-									delta: 1
+								uni.switchTab({
+									url:'/pages/mine/mine'
 								});
 							}
 						}).finally(() => {
 							that.loading = false
 						})
+					},
+					fail(err) {
+						console.log(err)
 					}
 				})
 			},
@@ -362,7 +376,7 @@
 				uni.chooseLocation({
 					success: (res) => {
 						console.log(res);
-						this.form.location = res.address
+						this.form.location = res.name || res.address
 						this.form.lat = res.latitude
 						this.form.lgt = res.longitude
 					},
@@ -430,9 +444,38 @@
 						})
 					}
 				})
+			}, 
+			getApplyData(){
+				var that = this 
+				var param ={ type:that.flag}
+				this.$u.api.getIdentityInfo(param).then(res =>{
+					if(res.code ===200){
+						if(res.data && res.data.id){
+							that.info = res.data
+							for (const key in that.form) {
+							  that.form[key] = that.info[key]
+							}
+							if(that.info.authType == 1){
+								that.form.img1Full = that.info.imgList.length>0?that.info.imgList[0]:null
+								that.form.img2Full = that.info.imgList.length>1?that.info.imgList[1]:null
+								that.form.img3Full = that.info.imgList.length>2?that.info.imgList[2]:null
+								that.form.img4Full = that.info.imgList.length>3?that.info.imgList[3]:null
+							}else{
+								that.form.img1= null
+								that.form.img1 = null
+								that.form.img2 = null
+								that.form.img2Full = null
+								that.form.img11 = that.info.img1
+								that.form.img11Full = that.info.imgList.length>0?that.info.imgList[0]:null
+								that.form.img21 = that.info.img2
+								that.form.img21Full = that.info.imgList.length>1?that.info.imgList[1]:null
+							}
+						}
+					}
+				 }) 
 			},
-			uploadImg(index) {
-				var that = this
+			uploadImg(index){
+				var that =this 
 				uni.chooseImage({
 					count: 1, // 榛樿9
 					sizeType: ['original', 'compressed'],
@@ -546,8 +589,18 @@
 			height: 300rpx;
 			padding: 34rpx 40rpx 0 40rpx;
 			box-sizing: border-box;
-			background-repeat: no-repeat;
-			background-size: 100% 100%;
+			// background-repeat: no-repeat;
+			// background-size: 100% 100%;
+			position: relative;
+			
+			.box-head-bg {
+				width: 100%;
+				height: 300rpx;
+				position: absolute;
+				top: 0;
+				left: 0;
+				z-index: -1;
+			}
 
 			.box-head-botton {
 				width: 100%;

--
Gitblit v1.9.3