<template>
	<view class="app">
		<view class="lefttext">
			<scroll-view scroll-y style="white-space: nowrap;height: 100vh;">
				<view>
					体检日期
				</view>
				<view :class="currentValue == index ? 'showitem' : ''" v-for="(item, index) in timeList" :key="item.id"
					@click="currentInfo(index)" @tap="detail(item)">
					{{item.happentime}}
				</view>
			</scroll-view>
		</view>
		<view class="righttext">
			<scroll-view scroll-y style="white-space: nowrap;height: 100vh;">
				<view class="information">
					<view class="p1" style="margin-top: 10rpx;">
						<view class="p1left">
							体检日期：
						</view>
						<text>{{pageInfo.happentime}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							责任医生：
						</view>
						<text>{{pageInfo.field2 ? pageInfo.field2 : ''}}</text>
					</view>
				</view>
				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						症状
					</view>
				</view>
				<view class="symptom">
					<text>{{symptomList[pageInfo.gzhzh]}}</text>
					<text v-if="pageInfo.gzzqt"> 其他：{{pageInfo.gzzqt}}</text>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						一般情况
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							体温：
						</view>
						<text>{{pageInfo.gtw}}℃</text>
					</view>
					<view class="p1">
						<view class="p1left">
							脉率：
						</view>
						<text>{{pageInfo.gmb}}次/分钟</text>
					</view>
					<view class="p1">
						<view class="p1left">
							呼吸频率：
						</view>
						<text>{{pageInfo.ghx}}次/分钟</text>
					</view>
					<view class="p1">
						<view class="p1left">
							身高：
						</view>
						<text>{{pageInfo.gsg}}cm</text>
					</view>
					<view class="p1">
						<view class="p1left">
							体重：
						</view>
						<text>{{pageInfo.gtzh}}kg</text>
					</view>
					<view class="p1">
						<view class="p1left">
							BMI：
						</view>
						<text>{{pageInfo.gtzhzh}}Kg/㎡</text>
					</view>
					<view class="p1">
						<view class="p1left">
							腰围：
						</view>
						<text>{{pageInfo.gyw}}cm</text>
					</view>
					<view class="p1">
						<view class="p1left">
							左侧血压：
						</view>
						<text>{{pageInfo.gxyzc1 ? pageInfo.gxyzc1 : '-'}}/{{pageInfo.gxyzc2 ? pageInfo.gxyzc2 : '-'}}mmHg</text>
					</view>
					<view class="p1">
						<view class="p1left">
							左侧原因：
						</view>
						<text>{{pageInfo.zcyy ? pageInfo.zcyy : ''}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							右侧血压：
						</view>
						<text>{{pageInfo.gxyyc1 ? pageInfo.gxyyc1 : '-'}}/{{pageInfo.gxyyc2 ? pageInfo.gxyyc2 : '-'}}mmHg</text>
					</view>
					<view class="p1">
						<view class="p1left">
							右侧原因：
						</view>
						<text>{{pageInfo.ycyy ? pageInfo.ycyy : ''}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						体育锻炼
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							锻炼频率：
						</view>
						<text>{{trainingList[pageInfo.gdlpl]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							每次锻炼时间：
						</view>
						<text v-if="pageInfo.gmcdlsj">{{pageInfo.gmcdlsj}}分钟</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							坚持锻炼时间：
						</view>
						<text v-if="pageInfo.gjcdlsj">{{pageInfo.gjcdlsj}}年</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							锻炼方式：
						</view>
						<text v-if="pageInfo.gdlfs">{{pageInfo.gdlfs}}</text>
						<text v-else>-</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						饮食习惯
					</view>
				</view>

				<view class="symptom">
					<text>{{dietList[pageInfo.gysxg]}}</text>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						吸烟情况
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							吸烟状况：
						</view>
						<text>{{smokeList[pageInfo.gxyzk]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							平均日吸烟量：
						</view>
						<text v-if='pageInfo.grxyl'>{{pageInfo.grxyl}}（ 支 ）</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							开始吸烟年龄：
						</view>
						<text v-if='pageInfo.gksxynl'>{{pageInfo.gksxynl}}岁</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							开始吸烟年龄：
						</view>
						<text v-if='pageInfo.gjynl'>{{pageInfo.gjynl}}岁</text>
						<text v-else>-</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						饮酒情况
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							饮酒频率：
						</view>
						<text>{{drinkList[pageInfo.gyjpl]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							平均日饮酒量：
						</view>
						<text v-if='pageInfo.gryjl'>{{pageInfo.gryjl}}（ 两 ）</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							是否戒酒：
						</view>
						<text v-if='pageInfo.gsfjj'>{{isAbstinenceList[pageInfo.gsfjj]}}</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							戒酒年龄：
						</view>
						<text v-if='pageInfo.gjjnl'>{{pageInfo.gjjnl}}岁</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							开始饮酒年龄：
						</view>
						<text v-if='pageInfo.gksyjnl'>{{pageInfo.gksyjnl}}岁</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							近一年内是否曾醉酒：
						</view>
						<text v-if="pageInfo.gynnsfyj == '1'">是</text>
						<text v-else-if="pageInfo.gynnsfyj == '2'">否</text>
						<text v-else>-</text>
					</view>
					<view class="p1">
						<view class="p1left">
							饮酒种类：
						</view>
						<text v-if='pageInfo.gyjzl'>{{liquorClass[pageInfo.gyjzl]}}</text>
						<text v-else>-</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						口腔
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							口唇：
						</view>
						<text
							v-if="pageInfo.gkouchun && pageInfo.gkouchun != '6'">{{lipsList[pageInfo.gkouchun]}}</text>
						<text v-if="pageInfo.gkouchun == '6'">{{pageInfo.kchqt}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							齿列：
						</view>
						<text>{{dentitionList[pageInfo.gchilei]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							咽部：
						</view>
						<text
							v-if="pageInfo.gyanbu && pageInfo.gyanbu != '4'">{{pharyngealList[pageInfo.gyanbu]}}</text>
						<text v-if="pageInfo.gkouchun == '4'">{{pageInfo.chlqt}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						视力
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							左眼：
						</view>
						<text>{{pageInfo.gzysl ? pageInfo.gzysl : ''}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							右眼：
						</view>
						<text>{{pageInfo.gyysl ? pageInfo.gyysl : ''}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						其他情况
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							听力：
						</view>
						<text>{{hearingList[pageInfo.gtl]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							运动功能：
						</view>
						<text>{{exerciseList[pageInfo.gydgn]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							眼底：
						</view>
						<text v-if="pageInfo.gyand == '1'">正常</text>
						<text v-if="pageInfo.gyand == '2'">异常</text>
					</view>
					<view class="p1">
						<view class="p1left">
							皮肤：
						</view>
						<text>{{skinList[pageInfo.gpfgm]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							巩膜：
						</view>
						<text>{{scleraList[pageInfo.ggongmo]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							淋巴结：
						</view>
						<text>{{lymphList[pageInfo.glbj]}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						肺
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							桶状胸：
						</view>
						<text v-if="pageInfo.gtzx == '1'">是</text>
						<text v-else>否</text>
					</view>
					<view class="p1">
						<view class="p1left">
							呼吸音：
						</view>
						<text v-if="pageInfo.ghxy == '1'">正常</text>
						<text v-if="pageInfo.ghxy == '2'">异常</text>
					</view>
					<view class="p1">
						<view class="p1left">
							罗音：
						</view>
						<text>{{lyList[pageInfo.gly]}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						心脏
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							心率：
						</view>
						<text>{{pageInfo.gxinlv}}次/分</text>
					</view>
					<view class="p1">
						<view class="p1left">
							心律：
						</view>
						<text>{{xlList[pageInfo.gxinlvci]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							杂音：
						</view>
						<text>{{zyList[pageInfo.gzayin]}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						腹部
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							压痛：
						</view>
						<text v-if="pageInfo.gyato == '1'">无</text>
						<text v-if="pageInfo.gyato == '2'">有</text>
					</view>
					<view class="p1">
						<view class="p1left">
							包块：
						</view>
						<text v-if="pageInfo.gbk == '1'">无</text>
						<text v-if="pageInfo.gbk == '2'">有</text>
					</view>
					<view class="p1">
						<view class="p1left">
							肝大：
						</view>
						<text v-if="pageInfo.gganda == '1'">无</text>
						<text v-if="pageInfo.gganda == '2'">有</text>
					</view>
					<view class="p1">
						<view class="p1left">
							脾大：
						</view>
						<text v-if="pageInfo.gpida == '1'">无</text>
						<text v-if="pageInfo.gpida == '2'">有</text>
					</view>
					<view class="p1">
						<view class="p1left">
							脾大：
						</view>
						<text v-if="pageInfo.gzhuoyin == '1'">无</text>
						<text v-if="pageInfo.gzhuoyin == '2'">有</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						妇科
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							外阴：
						</view>
						<text>{{wyList[pageInfo.gwaiyin]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							阴道：
						</view>
						<text>{{wyList[pageInfo.gyindao]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							宫颈：
						</view>
						<text>{{wyList[pageInfo.ggongjing]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							宫体：
						</view>
						<text>{{wyList[pageInfo.ggongti]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							附件：
						</view>
						<text>{{wyList[pageInfo.gfujian]}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						血常规
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							血红蛋白：
						</view>
						<text v-if="pageInfo.hb">{{pageInfo.hb}}g/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							白细胞：
						</view>
						<text v-if="pageInfo.wbc">{{pageInfo.wbc}}×10 9 /L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							血小板：
						</view>
						<text v-if="pageInfo.plt">{{pageInfo.plt}}×10 9 /L</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						尿常规
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							尿蛋白：
						</view>
						<text v-if="pageInfo.gndb">{{pageInfo.gndb}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							尿糖：
						</view>
						<text v-if="pageInfo.gnt">{{pageInfo.gnt}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							尿酮体：
						</view>
						<text v-if="pageInfo.gntt">{{pageInfo.gntt}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							尿潜血：
						</view>
						<text v-if="pageInfo.gnqx">{{pageInfo.gnqx}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						肝功能
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							血清谷丙转氨酶：
						</view>
						<text v-if="pageInfo.alt">{{pageInfo.alt}}U/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							血清谷草转氨酶：
						</view>
						<text v-if="pageInfo.ast">{{pageInfo.ast}}U/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							白蛋白：
						</view>
						<text v-if="pageInfo.alb">{{pageInfo.alb}}g/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							总胆红素：
						</view>
						<text v-if="pageInfo.tbil">{{pageInfo.tbil}}umol/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							结合胆红素：
						</view>
						<text v-if="pageInfo.dbil">{{pageInfo.dbil}}umol/L</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						肾功能
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							血清肌酐：
						</view>
						<text v-if="pageInfo.scr">{{pageInfo.scr}}umol/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							血尿素氮：
						</view>
						<text v-if="pageInfo.bun">{{pageInfo.bun}}mmol/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							血钾浓度：
						</view>
						<text v-if="pageInfo.gsgnxjnd">{{pageInfo.gsgnxjnd}}umol/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							血钠浓度：
						</view>
						<text v-if="pageInfo.gsgnxnnd">{{pageInfo.gsgnxnnd}}mmol/L</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						血脂
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							总胆固醇：
						</view>
						<text v-if="pageInfo.cho">{{pageInfo.cho}}mmol/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							甘油三酯：
						</view>
						<text v-if="pageInfo.tg">{{pageInfo.tg}}mmol/L</text>
					</view>
					<view class="p1">
						<view class="p1left" style="width: 100%">
							血清低密度脂蛋白胆固醇：
						</view>
						<text v-if="pageInfo.ldlc">{{pageInfo.ldlc}}mmol/L</text>
					</view>
					<view class="p1">
						<view class="p1left" style="width: 100%">
							血清高密度脂蛋白胆固醇：
						</view>
						<text v-if="pageInfo.hdlc">{{pageInfo.hdlc}}mmol/L</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						其他
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							空腹血糖：
						</view>
						<text v-if="pageInfo.gkfxt">{{pageInfo.gkfxt}}mmol/L</text>
					</view>
					<view class="p1">
						<view class="p1left">
							尿微量白蛋白：
						</view>
						<text v-if="pageInfo.nwlbdb">{{pageInfo.nwlbdb}}mg/dL</text>
					</view>
					<view class="p1">
						<view class="p1left">
							大便潜血：
						</view>
						<text>{{gdbqxList[pageInfo.gdbqx]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							糖化血红蛋白：
						</view>
						<text v-if="pageInfo.gthxhdb">{{pageInfo.gthxhdb}}%</text>
					</view>
					<view class="p1">
						<view class="p1left">
							乙型肝炎表面抗原：
						</view>
						<text>{{gdbqxList[pageInfo.hbsag]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							心电图：
						</view>
						<!-- <text>{{xdtList[pageInfo.gxindt]}}</text> -->
						<text
							style="word-break: break-all;white-space: normal;">{{pageInfo.gxindt ? pageInfo.gxindt : ''}}</text>
					</view>
					<!-- <view class="p1">
					<view class="p1left">
						心电图异常描述：
					</view>
					<view style="font-size: 28rpx;line-height: 80rpx;color: #333333;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{pageInfo.gxindtyi ? pageInfo.gxindtyi : ''}}</view>
				</view> -->
					<view class="p1">
						<view class="p1left">
							胸部X线片：
						</view>
						<text>{{xbxpList[pageInfo.gxiongp]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							腹部B超：
						</view>
						<text>{{xbxpList[pageInfo.gfbbc]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							宫颈涂片：
						</view>
						<text>{{xbxpList[pageInfo.ggjtp]}}</text>
					</view>
				</view>

				<view class="title">
					<view class="left">
					</view>
					<view class="right">
						疾病情况
					</view>
				</view>

				<view class="information sign">
					<view class="p1">
						<view class="p1left">
							脑血管疾病：
						</view>
						<text>{{nxgList[pageInfo.gnxgjb]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							肾脏疾病：
						</view>
						<text>{{szjbList[pageInfo.gszjb]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							心血管疾病：
						</view>
						<text>{{xxgjbList[pageInfo.gxzjb]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							眼部疾病：
						</view>
						<text>{{ybjbList[pageInfo.gybjb]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							神经系统其他疾病：
						</view>
						<text>{{sjxtjbList[pageInfo.gsjxtjb]}}</text>
					</view>
					<view class="p1">
						<view class="p1left">
							其他系统疾病：
						</view>
						<text>{{qtsjjbList[pageInfo.gqtxtjb]}}</text>
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import {
		getPhysicalTime,
		getPhysicalDetail
	} from "@/api/pagesC/Healthrecords/index.js"
	import {
		configMap
	} from './config/config.js'
	export default {
		data() {
			return {
				currentValue: 0,
				identity: uni.getStorageSync('userinfo').cardNo,
				timeList: [],
				pageInfo: {},
				...configMap
			};
		},
		onLoad() {
			getPhysicalTime(this.identity).then(res => {
				// if(!res.data || res.data.length == 0) {
				// 	uni.showModal({
				// 		title: '提示',
				// 		content: '暂无相关数据',
				// 		showCancel: false,
				// 		success(res) {
				// 			if (res.confirm) {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}
				// 		}
				// 	})
				// 	return
				// }
				for (let item in res.data) {
					for (let i of res.data[item].list) {
						this.timeList.push(i)
					}
				}
				this.detail(this.timeList[0])
			})
		},
		methods: {
			currentInfo(index) {
				this.currentValue = index
			},
			detail(e) {
				getPhysicalDetail(this.identity, e.id).then(res => {
					this.pageInfo = res.data
				})
			}
		}
	}
</script>

<style lang="scss">
	.app {
		width: 100%;
		display: flex;
		background-color: #f6f6f6;

		.lefttext {
			font-size: 28rpx;
			color: #666666;
			width: 25%;
			line-height: 80rpx;
			text-align: center;
			background-color: #fff;

			.showitem {
				background-color: #55d0df;
				color: #fff;
			}
		}

		.righttext {
			width: 75%;

			.symptom {
				width: 92%;
				margin: 0 auto;
				background-color: #ffffff;
				border-radius: 10rpx;
				padding: 20rpx 0 20rpx 25rpx;

				text {
					display: block;
					font-size: 32rpx;
					line-height: 60rpx;
					letter-spacing: 1rpx;
					color: #333333;
				}
			}

			.information {
				width: 92%;
				margin: 0 auto;
				background-color: #ffffff;
				border-radius: 10rpx;
				padding-left: 25rpx;

				.p2 {
					border-top: 1rpx solid #f0f1f6;
					font-size: 28rpx;
					line-height: 100rpx;

					letter-spacing: 1rpx;
					color: #333333;
					display: flex;

					.p2left {
						width: 40%;
					}
				}

				.p1 {
					display: flex;
					align-items: center;
					font-size: 26rpx;
					line-height: 80rpx;
					letter-spacing: 1rpx;
					color: #666666;

					.p1left {
						width: 44%;
						min-width: 44%;
					}

					text {
						font-size: 28rpx;
						line-height: 80rpx;
						letter-spacing: 1rpx;
						color: #333333;
					}
				}
			}

			.title {
				display: flex;
				padding-left: 20rpx;
				margin-top: 40rpx;
				margin-bottom: 20px;
				font-size: 30rpx;

				.right {
					line-height: 34rpx;
					padding-left: 10rpx;
					color: #666666;
				}

				.left {
					width: 8rpx;
					height: 32rpx;
					background-color: #55d0df;
					border-radius: 4rpx;
				}
			}
		}
	}

	::-webkit-scrollbar {
		display: none !important;
	}
</style>