<template>
	<view>
		<view class="head">
		</view>
		<view class="avatar">
			<u-avatar size="50" src="/static/head.jpg"></u-avatar>
		</view>
		<view class="topdesc">
			“泉科君”很荣幸可以获得了您提供的贵单位的数据，现在“泉科君”凭借有限的书面初步数据，为您提出一些高企诊断报告，请指正哦：
		</view>
		<view class="content" style="margin-top: 140rpx;">
			<block v-if="d.msgs.ys.length>0">
				<view class="d1">贵单位有{{d.msgs.ys.length}}个方面是非常优秀的呢，对高新技术企业申报有一定的优势哦：</view>
				<view class="d2">
					<view class="d2head">
						<text class="d2headc">企业优势</text>
					</view>
					<view class="d2content">
						<view class="d2item" v-for="(item,index) in d.msgs.ys" :key="index">
							<view class="dddd">
								<image mode="widthFix" src="../../static/d.png"></image>
							</view>
							<text class="desc2">
								<!-- <text class="ddd">{{index+1}}.</text> -->{{item.content}}
							</text>
						</view>
					</view>
				</view>
			</block>
			<block v-if="d.msgs.ls.length>0">
				<view class="d1" style="margin-top: 40rpx;">贵单位有{{d.msgs.ls.length}}个方面对于高企的申报要求来说可能是相对薄弱的：</view>
				<view class="d2">
					<view class="d2head">
						<text class="d2headc">企业弱势</text>
					</view>
					<view class="d2content">
						<view class="d2item" v-for="(item,index) in d.msgs.ls" :key="index">
							<view class="dddd">
								<image mode="widthFix" src="../../static/d.png"></image>
							</view>
							<text class="desc2" :class="item.type==2?'red':''">
								<!-- <text class="ddd">{{index+1}}.</text> -->{{item.content}}
							</text>
						</view>
					</view>
				</view>
			</block>
			<view class="d2" style="padding-bottom: 0rpx; padding-left: 0rpx; padding-right: 0rpx;">
				<view class="d2head">
					<text class="d2headc">诊断分数</text>
				</view>
				<view class="d2content">
					<uni-table border stripe emptyText="暂无更多数据" :stripe="true">
						<!-- 表头行 -->
						<uni-tr>
							<uni-th align="center" width="20%">项目</uni-th>
							<uni-th align="center">总分/理想分/中肯分</uni-th>
						</uni-tr>
						<!-- 表格数据行 -->
						<uni-tr v-for="(item,index) in d.source" :key="index">
							<uni-td align="center">{{item.title}}</uni-td>
							<uni-td align="center">{{item.source}}/{{item.idealScore}}/{{item.pertinentScore}}</uni-td>
						</uni-tr>
					</uni-table>
				</view>
			</view>
		</view>
		<view class="content" style="margin-top: 40rpx; color: #666;">
			<view>以上是“泉科君”给您的贵单位高企申报条件初步诊断建议，由于都是表面数据，暂时无法深层了解贵单位情况，没有给贵单位更深层次的建议，但是可以做个初步的参照呢。“泉科君”也给您一个比较粗略的自评分： <text
					class="source">{{d.idealScore}}</text> 分。（温馨提醒：71分通过国家高新技术企业申报哦！）</view>
			<view>希望“泉科君”的诊断报告能够给您一点帮助哦，如有偏差的地方，欢迎您指正哈。</view>
			<view class="step">
				<button class="reset" style="font-size: 28rpx; padding: 4rpx 40rpx;" size="mini"
					@click="reset">重新开始</button>
				<button class="youqi" style="font-size: 28rpx; padding: 4rpx 40rpx;" size="mini" @click=""
					open-type="share">邀请朋友填写</button>
			</view>
		</view>
		<u-loading-page :loading="showloading" loading-text="智能分析诊断中..."></u-loading-page>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				d: {},
				showloading: false
			}
		},
		onLoad: function(e) {
			this.showloading = true
			setTimeout(res => {
				uni.$u.http.post('/diacrisis/show', {
					id: e.id
				}).then(res => {
					this.showloading = false
					this.d = res
				}).catch(err => {
					//this.msg(data.msg)
				})
			}, 1000);

		},

		methods: {
			reset() {
				uni.showModal({
					title: '提示',
					content: '是否保留已经填写好的数据?',
					confirmText: "是",
					cancelText: "否",
					success: (res) => {
						if (res.confirm) {

							this.jump("/pages/index/index")
						} else if (res.cancel) {
							this.jump("/pages/index/index?clear=1")
						}
					}
				});
			}
		}
	}
</script>
<style>
	.youqi {
		background-color: #df7b2e;
		color: #ffffff
	}

	.reset {
		background-color: rgb(239, 242, 247);
		color: #df7b2e
	}

	.step {
		display: flex;
		justify-content: space-between;
		width: 100%;
		margin: 40rpx auto;
	}

	.source {
		color: #df7b2e;
		font-size: 50rpx;
	}

	.dddd {
		width: 20rpx;
		position: relative;
		top: 0rpx;
		height: 20rpx
	}

	.dddd image {
		width: 20rpx;
		height: 20rpx;
	}

	.ddd {
		color: #df7b2e;
		font-size: 32rpx;
	}

	.d2content {
		margin: 20rpx 0rpx;
	}

	.desc2 {
		padding-left: 20rpx;
		box-sizing: border-box;
		color: #999;
		font-size: 28rpx;
	}

	.d2item {
		display: flex;
		align-items: flex-start;
		margin-bottom: 10rpx;
		width: 100%;
	}

	.d2head {
		display: flex;
		justify-content: center;
	}

	.d2headc {
		background-color: #df7b2e;
		text-align: center;
		padding: 10rpx 30rpx;
		color: #ffffff;
	}

	.d2 {
		background-color: #f1f2f4;
		border-radius: 10rpx;
		padding: 20rpx;
		margin-top: 40rpx;
		padding-top: 0rpx;
	}

	.d1 {
		color: #df7b2e;
	}

	.content {
		margin-top: 60rpx;
		background-color: #FFFFFF;
		padding: 40rpx;
	}

	.head {
		background-color: #32385a;
		height: 240rpx;
		flex-direction: column;
		justify-content: center;
		display: flex;
		align-items: center;
	}

	page {
		background-color: #f1f2f4;
		line-height: 50rpx;
		font-size: 28rpx;
	}

	.avatar {
		position: absolute;
		left: 315rpx;
		top: 60rpx;
		z-index: 15555;
	}

	.topdesc {
		background-color: #ffffff;
		justify-content: center;
		color: #666;
		align-items: center;
		line-height: 50rpx;
		padding: 20rpx;
		width: 95%;
		margin-left: 2.5%;
		position: absolute;
		top: 120rpx;
		box-sizing: border-box;
		padding-top: 50rpx;
		border-radius: 10rpx;
	}

	.u-fade-enter-active {
		z-index: 99999999;
	}

	.red {
		color: red;
	}
</style>
