xsc 1 год назад
Родитель
Сommit
e88400959e
2 измененных файлов с 64 добавлено и 46 удалено
  1. 57 43
      pages/mine/shenbaoDetail.vue
  2. 7 3
      pages/mine/upload.vue

+ 57 - 43
pages/mine/shenbaoDetail.vue

@@ -6,7 +6,7 @@
 			</view>
 			<text>查看申报</text>
 		</view>
-		<view class="tabbar" v-if="msg.extra.total_time">
+		<view class="tabbar" v-if="msg.extra && msg.extra.total_time">
 			<view @click="tabbar(0)" :class="index==0 ? 'active' : ''">
 				<text>附件</text>
 			</view>
@@ -14,10 +14,10 @@
 				<text>证明材料</text>
 			</view>
 		</view>
-		<div v-if="msg.extra.total_time" class="nav">
+		<div v-if=" msg.extra && msg.extra.total_time" class="nav">
 			<iframe :src="uploadPdf" frameborder="0" class="iframe"></iframe>
 		</div>
-		<div v-if="!msg.extra.total_time" class="nav1">
+		<div v-else class="nav1">
 			<iframe :src="uploadPdf" frameborder="0" class="iframe"></iframe>
 		</div>
 	</view>
@@ -31,43 +31,50 @@
 	export default {
 		data() {
 			return {
-				msg:'',
-				uploadPdf:'',
-				index:0
+				msg: '',
+				uploadPdf: '',
+				index: 0
 			}
 		},
 		components: {
 			navBar
 		},
-		onLoad(options) {
-			if(options.id){
-				app.request('/examine/examine-detail',{examine_question_id:options.id},'post').then(res=>{
-					console.log(res)
-					var msg = res.data.data
-					if(msg instanceof Array){
-						this.msg = res.data.data[0]
-					}else{
-						this.msg = res.data.data
+		onLoad(options) {
+			console.log(options)
+			if (options.id) {
+				app.request('/examine/examine-detail', {
+					examine_question_id: options.id
+				}, 'post').then(res => {
+					console.log(res,'res')
+					var msg = res.data.data
+					if (msg instanceof Array) {
+						this.msg = res.data.data[0]
+					} else {
+						this.msg = res.data.data
 					}
-					console.log(this.msg)
-					var obj = this.msg.extra.resource_ids[0]
-					// var arr = Object.values(obj);
-					this.uploadPdf = obj
-				})
-			}else{
-					this.uploadPdf = options.url
+					console.log(this.msg)
+					var obj = this.msg.resources
+					var arr = Object.values(obj);
+					this.uploadPdf = arr[0]
+					console.log(this.uploadPdf)
+				})
+			} 
+			if(options.url){
+				this.uploadPdf = options.url
 			}
 		},
 		methods: {
-			backLast(){
+			backLast() {
 				uni.navigateBack()
 			},
-			tabbar(index){
+			tabbar(index) {
 				this.index = index
 				console.log(index)
-				if(index==0){
-					this.uploadPdf = this.msg.extra.resource_ids[0]
-				}else{
+				if (index == 0) {
+					var obj = this.msg.resources
+					var arr = Object.values(obj);
+					this.uploadPdf = arr[0]
+				} else {
 					this.uploadPdf = this.msg.extra.prove_files[0]
 				}
 			}
@@ -76,31 +83,35 @@
 </script>
 
 <style lang="scss">
-.nav{
+	.nav {
 		width: 100%;
 		height: 100%;
 		position: fixed;
 		z-index: 222;
 		top: 200upx;
 		left: 0;
-		iframe{
+
+		iframe {
 			width: 100%;
 			height: 100%;
 		}
 	}
-	.nav1{
+
+	.nav1 {
+		width: 100%;
+		height: 100%;
+		position: fixed;
+		z-index: 222;
+		top: 100upx;
+		left: 0;
+
+		iframe {
 			width: 100%;
 			height: 100%;
-			position: fixed;
-			z-index: 222;
-			top: 100upx;
-			left: 0;
-			iframe{
-				width: 100%;
-				height: 100%;
-			}
 		}
-	.tabbar{ 
+	}
+
+	.tabbar {
 		width: 100%;
 		height: 100upx;
 		position: fixed;
@@ -110,7 +121,8 @@
 		display: flex;
 		align-items: center;
 		border: 1upx solid #EFF1F6;
-		view{
+
+		view {
 			width: 50%;
 			display: flex;
 			align-items: center;
@@ -118,10 +130,12 @@
 			height: 100%;
 			color: black;
 		}
-		.active{
+
+		.active {
 			color: blue;
 		}
 	}
+
 	.navbar {
 		font-size: 32upx;
 		height: 100upx;
@@ -135,7 +149,7 @@
 		background-color: #FFFFFF;
 		text-align: center;
 		border-bottom: solid 2upx #EFF1F6;
-	
+
 		.back {
 			height: 100upx;
 			width: 100upx;
@@ -147,4 +161,4 @@
 			font-size: 32upx;
 		}
 	}
-</style>
+</style>

+ 7 - 3
pages/mine/upload.vue

@@ -27,12 +27,12 @@
 							<image class="img" src="/static/images/pdf.png" @click="imgPreview(index)"></image>
 							<view class="htz-image-upload-Item-del" @click="imgDel_cailiao(index)">×</view>
 						</view>
-						<view class="htz-image-upload-Item htz-image-upload-Item-add" @click="upload_cailiao" v-if="pdfUrl.length < 9">
+						<view class="htz-image-upload-Item htz-image-upload-Item-add" @click="upload_cailiao" v-if="pdfUrl.length < number">
 							+
-						</view>
+						</view> 
 					</view>
 				</view>
-				<view class="table" v-if="item.key!='resource_ids' && item.key!='prove_files'">
+				<view class="table" v-if="item.key!='resource_ids' && item.key!='prove_files' && item.key!='grade_id' && item.key!='award_day' && item.key!='position_grade'">
 					<view class="text-box">
 						<text class="input-key">{{item.name}}:</text><input type="text" v-model="item.fenshu" class="input-val" placeholder-style="color:darkgray;"
 							:placeholder="'请输入'+item.name" />
@@ -114,6 +114,10 @@
 			}
 			if(options.number!='undefined'){
 				this.number = Number(options.number)
+			}else{
+				if(options.id==5){
+					this.number = 1
+				}
 			}
 			console.log(this.extra)
 			console.log(this.verification)