<template>
	<view class="hzIndex">
		<hzHeader title="门禁卡办理"></hzHeader>
		<view class="hzContent">
		<view class="main">
			<view class="tab-box">
				<view class="tab-item" :class="currentTabIndex == 0 ? 'active' : ''" @click="currentTabIndex = 0">
					门禁卡办理
					<view class="activeLine" v-if="currentTabIndex == 0"></view>
				</view>
				<view class="tab-item" :class="currentTabIndex == 1 ? 'active' : ''" @click="currentTabIndex = 1">
					门禁卡办理记录
					<view class="activeLine" v-if="currentTabIndex == 1"></view>
				</view>
			</view>
		</view>
		<view class="content" v-if="currentTabIndex == 0" style="position: relative;">
			<view class="interviewee">

				<view class="radio radioBox">
					<view class="r-div">
						<text class="input_left">办卡选择</text>
					</view>
					<view class="radiolist" style="flex-wrap: nowrap;justify-content: center;">
						<view style="width: 22%;border: 0upx;height: 160upx;" @click="showradio(index)" v-for="(item, index) in firstCardItems" :key="index">
							<view style="width: 75%;border-radius: 30upx;background-color: #F4F7FF;margin-bottom: 12upx;" :class="[firstIndex == index ? 'chosenCard' : '']">
								<image :src="item.src" style="width: 60%;height: 60%;"/>
							</view>
							<p class="item_title" style="">{{ item.name }}</p> 
						</view>
					</view>
				</view>

				<view class="form-box" style="border-radius: 10upx;">
					<view class="form-item" v-if="firstIndex == 0 || firstIndex == 1">
						<text class="label">证件类型:</text>
						<view class="ipt-box select">
							<image class="arrow" src="/static/icons/right-arrow.png" mode=""></image>
							<picker class="picker" v-if="secondCardItems.length > 0" :range="secondCardItems"
								@change="changesecondCardItems" range-key="DESCRIPTION">
								<view>{{ secondCardItems[secondIndex].DESCRIPTION }}</view>
							</picker>
						</view>
					</view>
					
					<!-- 新办卡 -->
					<view class="form-item" v-if="firstIndex==0">
						<view style="display: flex;justify-content: flex-start;align-items: center;justify-content: space-between;">
							<text class="label">出入区域<text style="color: red;">*</text>:</text>
							<view class="ipt-box">
								<view class="areaBtn" @click="goSelectArea(1)">选择</view>
							</view>
						</view>
						<!-- 区域表格 -->
						<uni-table ref="table" border emptyText="暂无更多数据" style="margin-top: 20upx;">
								<uni-tr>
									<!-- <uni-th width="150" align="left"></uni-th> -->
								</uni-tr>
								<uni-tr v-for="(item, index) in areaData0" :key="index">
									<uni-td align="center" width="80">{{ item.address }}</uni-td>
									<uni-td align="center">{{ item.area }}</uni-td>
								</uni-tr>
						</uni-table>
					</view>
					<view class="form-item" v-if="firstIndex==0">
						<text class="label" style="width: 250upx;">是否开通人脸权限:</text>
						<view class="ipt-box">
							<radio-group @change="faceChange">
								<label v-for="(item, index) in faceList" :key="index">
									<view style="display: inline-block;margin-right: 20upx;">
										<radio :value="item.value" :checked="item.value ==isEnableFace" color="#00c277"/>
										{{item.name}}
									</view>
								</label>
							</radio-group>
						</view>
					</view>
					<view>
						<view class="form-item" v-if="firstIndex == 0 || firstIndex == 1">
							<text class="label">人员姓名<text style="color: red;">*</text>:</text>
							<view class="ipt-box"><input class="top-t" v-model="personnel" placeholder="请输入人员姓名" type="text"
									maxlength="15" /></view>
						</view>
						<view class="form-item" v-if="firstIndex == 0">
							<text class="label">人员部门<text style="color: red;">*</text>:</text>
							<view class="ipt-box"><input class="top-t" v-model="unit" placeholder="请输入人员部门"
									maxlength="15" /></view>
						</view>
						<view class="form-item" v-if="firstIndex == 0">
							<text class="label">联系电话<text style="color: red;">*</text>:</text>
							<view class="ipt-box"><input class="top-t" v-model="personnelPhone" placeholder="请输入联系电话"
									type="text" maxlength="11" /></view>
						</view>
						<view style="margin: 20upx;" v-if="firstIndex == 0"><text style="font-size: 28upx;font-weight: bold;">人脸照片（上传1张）<text style="color: red;" v-if="isEnableFace=='1'">*</text>:</text></view>
						<view class="pic" style="border-bottom: 1px solid #eee;" v-if="firstIndex == 0">
							<view class="img-box">
								<view class="img-item" v-for="(item, index) in imgs" :key="index">
									<image class="remove-btn" @click="removeImg(index)" src="/static/icons/delete-icon.png"
										mode=""></image>
									<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
								</view>
								<view class="img-item upload-btn" @click="chooseImg()" v-if="imgs.length < 1">
									<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
								</view>
							</view> 
						</view> 
						<view style="font-size: 28rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;" v-if="firstIndex == 0">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息，违者将严肃问责追责!</view>
						<view style="margin: 20upx;"  v-if="firstIndex == 0"><text style="font-size: 28upx;font-weight: bold;">身份证正反面（上传2张）</text></view>
						<view class="pic" style="border-bottom: 1px solid #eee;" v-if="firstIndex == 0">
							<view class="img-box">
								<view class="img-item" v-for="(item, index) in idPhoto" :key="index">
									<image class="remove-btn" @click="removeImg2(index)" src="/static/icons/delete-icon.png"
										mode=""></image>
									<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
								</view>
								<view class="img-item upload-btn" @click="chooseImg2()" v-if="idPhoto.length < 2">
									<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
								</view>
							</view>
						</view>
						<view style="font-size: 28rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;" v-if="firstIndex == 0">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息，违者将严肃问责追责!</view>
					</view>
					<view></view>
					
					
					
					
					
					<!-- /新办卡 -->
					
					<!-- /新办证 -->
					<view class="form-item" v-if="firstIndex==1">
						<text class="label">人员单位<text style="color: red;">*</text>:</text>
						<view class="ipt-box"><input class="top-t" v-model="unit" placeholder="请输入人员单位"
								maxlength="15" /></view>
					</view>
					<view class="form-item" v-if="firstIndex==1">
						<text class="label">联系电话<text style="color: red;">*</text>:</text>
						<view class="ipt-box"><input class="top-t" v-model="personnelPhone" placeholder="请输入手机号码"
								type="text" maxlength="11" /></view>
					</view>
					<view class="form-item" v-if="firstIndex==1">
						<view style="display: flex;justify-content: flex-start;align-items: center;justify-content: space-between;">
							<text class="label">出入区域<text style="color: red;">*</text>:</text>
						</view> 
						<checkbox-group @change="accessAreaChecked" style="padding-left: 10upx;display: flex;">
							<view style="display: flex;justify-content: flex-start;align-items: center;margin-left: 10upx;margin-top: 10px;">
								<view>
									<checkbox color="#4db4ea" value="科技楼"/>
								</view>
								<view style="margin-right: 10upx;width: 70px;">科技楼</view>
								<!-- <view class="input-box">
									<input v-model="scienceTechRemarks" style="border-bottom: 2upx solid #333;" placeholder="请填写备注" type="text"
										maxlength="15" />
								</view> -->
							</view>
							<view
								style="display: flex;justify-content: flex-start;align-items: center;margin-left: 10upx;margin-top: 10px;">
								<view>
									<checkbox color="#4db4ea" value="调度楼" />
								</view>
								<view style="margin-right: 10upx;width: 70px;">调度楼</view>
								<!-- <view class="input-box">
									<input v-model="dispatchRemarks" style="border-bottom: 2upx solid #333;" placeholder="请填写备注" type="text" maxlength="15" />
								</view> -->
							</view>
							<view
								style="display: flex;justify-content: flex-start;align-items: center;margin-left: 10upx;margin-top: 10px;">
								<view>
									<checkbox color="#4db4ea" value="后勤楼" />
								</view>
								<view style="margin-right: 10upx;width: 70px;">后勤楼</view>
							<!-- 	<view class="input-box">
									<input v-model="logisticsRemarks" style="border-bottom: 2upx solid #333;" placeholder="请填写备注" type="text" maxlength="15" />
								</view> -->
							</view>
						</checkbox-group>
					</view>
					<view class="form-item" v-if="firstIndex==1">
						<text class="label">日期期限<text style="color: red;">*</text>:</text>
						<view class="ipt-box"><uni-datetime-picker :clear-icon="false" v-model="dateRange"
								type="daterange" :border="false"/></view>
					</view>
					<view style="margin: 20upx;border-bottom: 1px solid #eee;" v-if="firstIndex == 1"><text style="font-size: 28upx;font-weight: bold;">登记照片（上传1张）</text></view>
					<view class="pic" style="border-bottom: 1px solid #eee;" v-if="firstIndex == 1">
						<view class="img-box">
							<view class="img-item" v-for="(item, index) in imgs" :key="index">
								<image class="remove-btn" @click="removeImg(index)" src="/static/icons/delete-icon.png"
									mode=""></image>
								<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
							</view>
							<view class="img-item upload-btn" @click="chooseImg()" v-if="imgs.length < 1">
								<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
							</view>
						</view>
					</view>
					<view style="font-size: 28rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;" v-if="firstIndex == 1">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息，违者将严肃问责追责!</view>
					<view style="margin: 20upx;border-bottom: 1px solid #eee;" v-if="firstIndex == 1"><text style="font-size: 28upx;font-weight: bold;">身份证正反面（上传2张）</text></view>
					<view class="pic" style="border-bottom: 1px solid #eee;" v-if="firstIndex == 1">
						<view class="img-box">
							<view class="img-item" v-for="(item, index) in idPhoto" :key="index">
								<image class="remove-btn" @click="removeImg2(index)" src="/static/icons/delete-icon.png"
									mode=""></image>
								<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
							</view>
							<view class="img-item upload-btn" @click="chooseImg2()" v-if="idPhoto.length < 2">
								<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
							</view>
						</view>
					</view>
					<view style="font-size: 28rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;" v-if="firstIndex == 1">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息，违者将严肃问责追责!</view>
					<view class="form-item" v-if="firstIndex==1">
						<text class="label">申请事由:</text>
						<view class="ipt-box">
							<radio-group @change="radioChange">
								<label v-for="(item, index) in reasonList" :key="index">
									<view style="display: inline-block;margin-right: 20upx;">
										<radio :value="item.value" :checked="item.value ==matter" color="#00c277"/>
										{{item.name}}
									</view>
								</label>
							</radio-group>
						</view>
					</view>
					<view style="margin: 20upx;border-bottom: 1px solid #eee;" v-if="firstIndex == 1"><text style="font-size: 28upx;font-weight: bold;">证明文件</text></view>
					<view class="pic" style="border-bottom: 1px solid #eee;" v-if="firstIndex == 1">
						<view class="img-box">
							<view class="img-item" v-for="(item, index) in documentPhoto" :key="index">
								<image class="remove-btn" @click="removeImg3(index)" src="/static/icons/delete-icon.png"
									mode=""></image>
								<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
							</view>
							<view class="img-item upload-btn" @click="chooseImg3()" v-if="documentPhoto.length < 1">
								<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
							</view>
						</view>
					</view>
					<view style="font-size: 28rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;" v-if="firstIndex == 1">互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息，违者将严肃问责追责!</view>
					<!-- /新办证 -->
					
				</view>
				 
				<!-- 挂失 -->
				<view class="card-box" style="border-radius: 10upx;margin-top: 20upx;" v-if="firstIndex==2">
					<view style="margin-bottom: 20upx;display: flex;width: 100%;justify-content: space-between;align-items: center;">
						<view>我的卡</view>
						<view style="padding: 20rpx;border: 1px solid #6CD374;border-radius: 20rpx;" @click="openCardBand">绑定卡</view>
					</view>
					
					<view v-for="(item, index) in myCardList" :key="index">
						<view class="card-item" :style="{background:item.isLoss=='0'?'#6CD374':'#989898'}">
							<view style="margin-bottom:20upx;">{{item.cardName}}</view>
							<view style="margin-bottom:20upx;">{{item.name}}</view>
							<view style="margin-bottom:20upx;">{{item.staffNo}}</view>
							<view style="width: 100%;height: auto;display: flex;align-items: center;justify-content: flex-end;">
								<view class="card-btn" v-if="item.isLoss=='0'" @click="unbindCard(item)">解绑</view>
								<view class="card-btn" v-if="item.isLoss=='0'" @click="circulation(item)">挂失</view>
								<view class="card-btn" v-if="item.isLoss=='1'" style="background: #989898;">挂失中</view>
								<view class="card-btn" v-if="item.isLoss=='2'" style="background: #989898;">已挂失</view>
								<view class="card-btn" v-if="item.isLoss=='3'" style="background: #989898;">已补办</view>
								<view class="card-btn" v-if="item.isLoss=='3'"style="background: #FFEFE3;color: #FF9000;" @click="delCardOpen(item)">删除</view>
							</view>
						</view>
					</view>
					
				</view>
				
				<!-- 补办 -->
				<view class="card-box" style="border-radius: 10upx;margin-top: 20upx;" v-if="firstIndex==3">
					<view style="margin-bottom: 20upx;display: flex;width: 100%;justify-content: space-between;align-items: center;">
						<view>待补办</view>
					</view>
					
					<view v-for="(item, index) in reissueCardList" :key="index">
						<view class="card-item" :style="{background:'#6CD374'}">
							<view style="margin-bottom:20upx;">{{item.cardName}}</view>
							<view style="margin-bottom:20upx;">{{item.name}}</view>
							<view style="margin-bottom:20upx;">{{item.staffNo}}</view>
							<view style="width: 100%;height: auto;display: flex;align-items: center;justify-content: flex-end;">
								<view class="card-btn" @click="reissueCardOpen(item)">补办</view> 
							</view>
						</view>
					</view>
				</view>
				<!-- 补办 -->
				
				<view class="form-box" style="border-radius: 10upx;margin-top: 20upx;" v-if="firstIndex==0||firstIndex==1">
					<view class="form-item">
						<text class="label">审批人:</text>
						<view class="ipt-box select">
							<image class="arrow" src="/static/icons/right-arrow.png" mode=""></image>
							<picker class="picker" v-if="examList.length > 0" :range="examList" @change="changeExamList"
								range-key="name">
								<view>{{ examList[examIndex].name }}</view>
							</picker>
						</view>
					</view>
				</view>


			</view>
			<view class="occupied"></view>
			<view class="footer-btn" @click="submit" v-if="firstIndex==0||firstIndex==1">
				<view class="btn">提交</view>
			</view>
		</view>
		 
		<view v-if="currentTabIndex == 1" style="position: relative;">
			<view class="list-content" v-if="cardList.length > 0">
				<view class="details" v-for="(item, i) in cardList" :key="i">
					<view class="detail_header" @click="details(item)">
						<!-- <text class="blueSign"></text> -->
						<image src="/static/img/cardIcon.png" mode="" style="width: 35upx;height: 40upx;margin-left: 20upx;vertical-align: middle;"></image>
						<text class="font-tilte">{{firstCardItems[Number(item.TYPE)-1].name}}申请</text>
						<text v-if="item.EXAMINE_STATE ==0" class="statusred" style="color: #ff9000;background-color: #FFEFE3;">
							<text v-if="!item.CARD_STATUS">待审核</text>
							<text v-if="item.CARD_STATUS==0">审核中</text>
							<text v-if="item.CARD_STATUS==1">待制作</text>
						</text>
						<text v-if="item.EXAMINE_STATE ==2" class="statusred" style="color: #BD1515;background-color: #F6DFDF;">已拒绝</text>
						<text v-if="item.EXAMINE_STATE ==1" class="statusred" style="color: #0DB0A7;background-color: #C1EFEA;">
							<text v-if="item.CARD_STATUS==2">待领取</text>
							<text v-if="item.CARD_STATUS==3">已领取</text>
							<text v-if="item.CARD_STATUS==4">已挂失</text>
						</text>
					</view>

					<view class="detail_msg" @click="details(item)">
						<view class="info-item">
							<text>办卡类型：</text>
							<text class="infoSpan">{{item.TYPE_NAME}}</text>
						</view>
						<view class="info-item">
							<text>门卡类型：</text>
							<text class="infoSpan">{{item.CARD_TYPE}}</text>
						</view>
						<view class="info-item">
							<text>申请人：</text>
							<text class="infoSpan">{{item.USER_NAME}}</text>
						</view>
						<view class="info-item">
							<text>申请时间：</text>
							<text class="infoSpan">{{ formatDate(item.APPLY_TIME,'dateTime')}}</text>
						</view>

					</view>
				</view>
			</view>
			<content-none v-else :padTop="20"></content-none>
		</view>
		</view>
		<load-more v-if="currentTabIndex == 1" :loadingType="loadingType" :contentText="contentText"></load-more>
		<uni-popup ref="popup" type="center">
			<view style="background: white;width: 80%;height: 240upx;width: 600upx;position: relative;border-radius: 10upx;padding: 14upx;">
				<view style="color: #333;font-size: 30upx;font-weight: bold;padding: 10upx 0px;width: 100%;text-align: center;margin-top: 20upx;">
					<text>请确认是否挂失所选卡？</text>
				</view>
				<view class="footer-btn footer-btn-two" style="position: absolute;margin-bottom: 20upx;">
					<view class="btn btn-col" style="width:30%;margin-left:18%;margin-right: 6%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="closeCirculation()">取消</view>
					<view class="btn btn-col1" style="width:30%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="handleCard()">确定</view>
				</view>
			</view>
		</uni-popup>
		
		<uni-popup ref="popup2" type="center">
			<view style="background: white;width: 80%;height: 240upx;width: 600upx;position: relative;border-radius: 10upx;padding: 14upx;">
				<view style="color: #333;font-size: 30upx;font-weight: bold;padding: 10upx 0px;width: 100%;text-align: center;margin-top: 20upx;">
					<text>请确认是否解绑所选卡？</text>
				</view>
				<view class="footer-btn footer-btn-two" style="position: absolute;margin-bottom: 20upx;">
					<view class="btn btn-col" style="width:30%;margin-left:18%;margin-right: 6%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="closeCirculation2()">取消</view>
					<view class="btn btn-col1" style="width:30%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="handleCard2()">确定</view>
				</view>
			</view>
		</uni-popup>
		
		<uni-popup ref="bandPopup" type="center">
			<view style="background: white;width: 100%;height: 300upx;width: 600upx;position: relative;border-radius: 10upx;padding: 14upx;">
				<view style="color: #333;padding: 10upx 0px;width: 100%;margin-top: 20upx;">
					 
					 <view style="font-weight: bold;">绑定卡号：</view>
					 <view style="margin-top: 20rpx;"><input class="top-t" v-model="cardBand.cardNo" placeholder="请输入卡号" type="text" maxlength="20" style="width: 100%;font-size: 30rpx;"/></view>
				</view>
				<view class="footer-btn footer-btn-two" style="position: absolute;margin-bottom: 20upx;">
					<view class="btn btn-col" style="width:30%;margin-left:18%;margin-right: 6%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="closecardBand()">取消</view>
					<view class="btn btn-col1" style="width:30%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="handleCardBand()">绑定</view>
				</view>
			</view>
		</uni-popup>
		
		<uni-popup ref="popup3" type="center">
			<view style="background: white;width: 80%;height: 240upx;width: 600upx;position: relative;border-radius: 10upx;padding: 14upx;">
				<view style="color: #333;font-size: 30upx;font-weight: bold;padding: 10upx 0px;width: 100%;text-align: center;margin-top: 20upx;">
					<text>请确认是否补办所选卡？</text>
				</view>
				<view class="footer-btn footer-btn-two" style="position: absolute;margin-bottom: 20upx;">
					<view class="btn btn-col" style="width:30%;margin-left:18%;margin-right: 6%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="closeReissueCard()">取消</view>
					<view class="btn btn-col1" style="width:30%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="handleReissueCard()">补办</view>
				</view>
			</view>
		</uni-popup>
		
		<uni-popup ref="popup4" type="center">
			<view style="background: white;width: 80%;height: 240upx;width: 600upx;position: relative;border-radius: 10upx;padding: 14upx;">
				<view style="color: #333;font-size: 30upx;font-weight: bold;padding: 10upx 0px;width: 100%;text-align: center;margin-top: 20upx;">
					<text>请确认是否解绑所选卡？</text>
				</view>
				<view class="footer-btn footer-btn-two" style="position: absolute;margin-bottom: 20upx;">
					<view class="btn btn-col" style="width:30%;margin-left:18%;margin-right: 6%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="closeDelCard()">取消</view>
					<view class="btn btn-col1" style="width:30%;border-radius: 10upx;height: 65upx;line-height: 65upx;" @click="handleDelCard()">解绑</view>
				</view>
			</view>
		</uni-popup>
		
	</view>
</template>

<script>
	import {
		addCard,
		getIssueCardByUserId,
		getAllDept,
		getCardType,
		getDeptExamineAuth,
		getAllCardList,
		updateCardStatusById,
		reissueCard,
		addMyCard,
		getReissueCardList
	} from '@/common/api.js';
	import {
		callbackRequest,
		getStorage,
		alertTip,
		convertImgToBase64,
		formatDate,
		wxSdk,
		uploadImg
	} from '@/common/util.js';
	import loadMore from '@/components/loadMore.vue';
	import contentNone from '@/components/contentNone.vue';

	import {
		pathToBase64
	} from '@/js_sdk/mmmm-image-tools/index.js';
	export default {
		components: {
			loadMore,
			contentNone
		},
		data() {
			return {
				formatDate: formatDate,
				//分页
				page: 1,
				pageSize: 10,
				loadingType: 0, //0-loading前；1-loading中；2-没有更多了
				contentText: {
					contentdown: '上拉加载更多',
					contentrefresh: '正在加载...',
					contentnomore: '没有更多数据了'
				},
				// deptList: [],
				// departmentIndex: 0,
				userInfo: getStorage('userInfo'),
				areaData0:[],//出入区域
				unit: '',
				personnel: '',
				personnelPhone: '',
				matter: '', 
				chosenType:0,
				isEnableFace: '0',
				faceList: [{
								name: '是',
								value: '1'
							}, {
								name: '否',
								value: '0'
							}],
				reasonList: [{
								name: '运维',
								value: '运维'
							}, {
								name: '施工',
								value: '施工'
							}],
				accessArea: '',
				dateRange: '',
				examIndex: 0,
				examList: [],
				myCardList:[],//我的卡列表
				reissueCardList:[],//待补办卡列表
				losscard:{},
				unbind:{},
				reissueCardData:{},
				delCardData:{},
				//补卡数组
				lossCardList:[],
				// 补卡类型
				lossIndex:0,
				lossItem:{
					orgName:'',name:'',phone:'',staffNo:'',
				},
				showIndex: 0,
				currentTabIndex: 0,
				cardList: [],
				index: 0,
				firstCardItems: [{
					id: '1',
					name: '新办卡',
					src:'/static/img/card1.png'
				}, {
					id: '2',
					name: '新办证',
					src:'/static/img/card2.png'
				}, {
					id: '4',
					name: '卡挂失',
					src:'/static/img/card4.png'
				},{
					id: '3',
					name: '补办卡',
					src:'/static/img/card3.png'
				}],
				firstIndex: 0,
				secondCardItems: [], //{ id: '1', name: '职工卡' }, { id: '2', name: '聘用人员卡' }, { id: '3', name: '支撑人员卡' },{ id: '4', name: '出入证' }
				secondIndex: 0,
				faultType: 0,
				// pageTitle: ['新办卡', '补办卡', '新办证', '补办证'],
				submitFlag: true,
				showAlert: false,
				
				imgs: [],
				imgsId: [],
				
				idPhoto: [],
				idPhotoId: [],
				
				documentPhoto: [],
				documentPhotoId: [],
				
				scienceTechRemarks: '', //科技楼备注 
				dispatchRemarks: '', //调度楼备注  
				logisticsRemarks: '', //后勤楼备注
				cardBand:{
					cardNo:""
				}
			};
		},
		watch: {
			currentTabIndex: function(newVal, oldVal) {
				if (newVal == 1) {
					this.page = 1;
					this.loadingType = 0;
					this.dataList();
				} else {
					
				}
			}
		},
		onLoad(option) {
			this.getDeptExamineAuth();
			this.getsecondCardItems();
			this.currentTabIndex = option.currentTabIndex || 0;
		},
		onShow() {
			if (this.currentTabIndex == 0) {
				this.getAllCardList()
			} else {
				this.page = 1;
				this.loadingType = 0;
				this.dataList();
			}
		},
		methods: {
			radioChange(evt){
				this.matter = evt.target.value;
			},
			faceChange(evt){
				this.isEnableFace = evt.target.value;
			},
			accessAreaChecked(e){
				this.accessArea = e.detail.value
			},
			//办卡类型
			showradio: function(index) {
				var self = this;
				self.firstIndex = index;
				this.getsecondCardItems();
				if(index==0){
					this.unit= ''
					this.personnel= ''
					this.personnelPhone= ''
					this.imgs= [] 
					this.imgsId= []  
					this.idPhoto= []  
					this.idPhotoId= [] 
					this.documentPhoto = [];
					this.documentPhotoId= [];
					this.isEnableFace = '0'
					this.accessArea = ''
					this.areaData0 = []
				}
				if(index==1){
					this.unit= ''
					this.personnel= ''
					this.personnelPhone= ''
					this.imgs= [] 
					this.imgsId= []  
					this.idPhoto= []  
					this.idPhotoId= [] 
					this.documentPhoto = [];
					this.documentPhotoId= [];
					this.matter = '维保'
					this.accessArea = ''
				}
				if(index==2){
					this.getAllCardList();
				}
				if(index==3){
					this.getReissueCardList();
				}
			},
			// 获取证件类型
			getsecondCardItems() {
				this.secondIndex = 0;
				var parentCode = this.firstCardItems[this.firstIndex].id;
				let params = {
					method: getCardType,
					data: {
						type: Number(parentCode),
						userId: this.userInfo.id
					}
				};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						if (res.returnData.length > 0) {
							this.secondCardItems = res.returnData;
						} else {
							this.secondCardItems = []
						}
					} else {
						alertTip(res.returnMsg);
					}
				});
			},
			//选择证件类型
			changesecondCardItems(e) {
				this.secondIndex = e.detail.value;
			},
			//获取审批人
			getDeptExamineAuth() {
				let params = {
					method: getDeptExamineAuth,
					data: {
						userId: getStorage('userInfo').userId,
						departmentId: getStorage('userInfo').deptIdUrl,
					}
				};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						// console.log(res);
						this.examList = res.returnData;
					} else {
						alertTip(res.returnMsg);
					}
				});
			},
			//选择审批人
			changeExamList(e) {
				// console.log(e)
				this.examIndex = e.detail.value;
			},
			//提交（新办卡，新办证）
			submit() {
				var regPhone = /^1[3|4|5|6|7|8|9]\d{9}$/;
				// var regCard = /^[a-zA-Z0-9_]{0,}$/;
				// var regNumber = /[^\d]/;
				if (this.firstIndex == 0) {
					if (!this.unit) {
						alertTip('请输入人员部门');
						return false;
					}
					if (!this.personnel) {
						alertTip('请输入人员姓名');
						return false;
					}
					if (!this.personnelPhone) {
						alertTip('请输入联系电话');
						return false;
					}
					if (!regPhone.test(this.personnelPhone)) {
						alertTip('请输入正确的手机号');
						return false;
					}
					if(this.areaData0.length>0){
						let idList = this.areaData0.map(item=>{
							return item.areaIds
						})
						this.accessArea =idList.join(',')
					}
					if (!this.accessArea) {
						alertTip('请选择出入区域');
						return false;
					}
					if (this.isEnableFace=='1') {
						if (this.imgsId.length==0) {
							alertTip('请选择登记照片');
							return false;
						}	
					}
				}else if (this.firstIndex == 1) {
					console.log(this.accessArea)
					if (!this.personnel) {
						alertTip('请输入人员姓名');
						return false;
					}
					if (!this.unit) {
						alertTip('请输入人员单位');
						return false;
					}
					if (!regPhone.test(this.personnelPhone)) {
						alertTip('请输入正确的手机号');
						return false;
					}
					
					if (!this.accessArea) {
						alertTip('请选择出入区域');
						return false;
					}
					if(this.accessArea.length>0){
						this.accessArea = this.accessArea.join(',')
					}else{
						alertTip('请选择出入区域');
						return false;
					}
					if (!this.dateRange) {
						alertTip('请选择日期期限');
						return false;
					}
				}
				if (!this.submitFlag) {
					return false;
				}
				this.submitFlag = false;
				let params = {
					method: addCard,
					data: {
						type: this.firstCardItems[this.firstIndex].id,//办卡类型
						typeName: this.firstCardItems[this.firstIndex].name,//办卡名称
						cardType: this.secondCardItems[this.secondIndex].DESCRIPTION,//证件类型
						isEnableFace: this.isEnableFace,//人脸权限
						accessArea: this.accessArea,//出入区域
						
						userId: this.userInfo.id,
						userName: this.userInfo.userName,
						phone: this.userInfo.telnumber,
						orgId: this.userInfo.orgId,
						departmentId: this.userInfo.deptId,
						orgName: this.userInfo.orgName,
						
						unit: this.unit,
						personnel: this.personnel,
						personnelPhone: this.personnelPhone,
						personnel: this.personnel,
						matter: this.matter,//申请事由
					
						startTime: this.dateRange[0],
						endTime: this.dateRange[1],
						
						examinePersonId: this.examList[this.examIndex].id,
						examinePersonName: this.examList[this.examIndex].name,
						
						photo: this.imgsId.toString(),
						idPhoto: this.idPhotoId.toString(),
						documentation: this.documentPhotoId.toString()
						
					}
				}; 
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						alertTip(res.returnMsg);
						setTimeout(_ => {
							this.unit = '';
							this.personnel = '';
							this.personnelPhone = '';
							this.matter = '';
							this.accessArea = '';
							this.scienceTechRemarks = '';
							this.dispatchRemarks = '';
							this.logisticsRemarks = '';
							this.dateRange = '';
							this.isEnableFace = '0'
							this.areaData0 = [];
							this.imgs = [];
							this.imgsId = [];
							this.idPhoto = [];
							this.idPhotoId = [];
							this.documentPhoto = [];
							this.documentPhotoId= [];
							this.currentTabIndex = 1;
							this.submitFlag = true;
						}, 2000);
					} else {
						alertTip(res.returnMsg);
						this.submitFlag = true;
					}

				});
			},
			
			//登记照片
			async chooseImg() {
				let chec = 0;
				let sty = [];
				let _this = this;
				uni.showActionSheet({
					itemList: ['拍照', '相册'],
					success: function(resp) {
						chec = resp.tapIndex;
						if (chec == 0) {
							sty = ['camera']; //从相册相机选择 
						} else {
							sty = ['album']; //从相册相机选择
						}
						uni.chooseImage({
							count: 1,
							sizeType: ['compressed'],
							sourceType: sty,
							quality: 1,
							success: async function(res) {
								let resData = res.tempFilePaths;
								for (let i = 0; i < resData.length; i++) {
									if (_this.imgs.length > 1) {
										break;
									}
									uni.getImageInfo({
										src: resData[i],
										success: async (path) => {
											convertImgToBase64(path.path,
											async function(base64) {
													if (_this.imgs.length < 1) {
														// _this.imgs.push(base64);
														uni.showLoading({title: '图片上传中'})
														let blength = base64.length;
														let glength = 7500;
														// console.log("base64:",base64)
														if (blength <= glength) {
															let uploadParam = {
																base64: base64,
																userId: getStorage('userInfo').userId + i,
																groupEnd: '1'
															}
															await uploadImg(uploadParam).then(resu => {
																resu = resu.data;
																uni.hideLoading();
																if (resu.returnCode !=1) {
																	alertTip(resu.returnMsg);
																} else {
																	_this.imgs.push(base64);
																	_this.imgsId.push(resu.returnData + ".jpg");
																}
															});
														} else {
															let fnum = parseInt(blength / glength);
															for (let j =1; j < fnum + 1; j++) {
																if (j == fnum) {
																	let groupBase = base64.slice((j-1)*glength);
																	// console
																	// 	.log(
																	// 		groupBase
																	// 		.length,
																	// 		"groupBaselength"
																	// 		);
																	let uploadParam = {
																		base64: groupBase,
																		userId: getStorage('userInfo').userId +i,
																		groupEnd: '1'
																	}
																	await uploadImg(uploadParam).then(resu => {
																				resu = resu.data;
																				if (resu.returnCode==1) {
																					_this.imgs.push(base64);
																					_this.imgsId.push(resu.returnData+".jpg");
																				} else {
																					uni.hideLoading();
																					alertTip(resu.returnMsg);
																					return;
																				}
																	});
																} else {
																	let groupBase =base64.slice((j-1)*glength,glength*j);
																	let uploadParam = {
																		base64: groupBase,
																		userId: getStorage('userInfo').userId+i,
																		groupEnd: '0'
																	}
																	await uploadImg(uploadParam).then(resu => { 
																			resu = resu.data;
																			if (resu.returnCode ==1) {
																				
																			} else {
																				uni.hideLoading();
																				alertTip(resu.returnMsg);
																				return;
																			}
																	});
																}
															}
															uni.hideLoading();
														}
													}
												});
										},
									});
								}
							}
						});
					},
					fail: function(resp) {
						console.log(resp.errMsg);
					}
				});
			},
			//身份证照片
			async chooseImg2() {
				let chec = 0;
				let sty = [];
				let _this = this;
				uni.showActionSheet({
					itemList: ['拍照', '相册'],
					success: function(resp) {
						chec = resp.tapIndex;
						if (chec == 0) {
							sty = ['camera']; //从相册相机选择 
						} else {
							sty = ['album']; //从相册相机选择
						}
						uni.chooseImage({
							count: 2,
							sizeType: ['compressed'],
							sourceType: sty,
							quality: 1,
							success: async function(res) {
								let resData = res.tempFilePaths;
								for (let i = 0; i < resData.length; i++) {
									if (_this.idPhoto.length > 2) {
										break;
									}
									uni.getImageInfo({
										src: resData[i],
										success: async (path) => {
											convertImgToBase64(path.path,
											async function(base64) {
													if (_this.idPhoto.length < 2) {
														// _this.imgs.push(base64);
														uni.showLoading({
															title: '图片上传中'
														})
														let blength = base64.length;
														let glength = 7500;
														console.log("base64:",base64)
														if (blength <=
															glength) {
															let uploadParam = {
																base64: base64,
																userId: getStorage('userInfo').userId +i,
																groupEnd: '1'
															}
															await uploadImg(uploadParam)
																.then(
																	resu => {
																		resu =resu.data;
																		uni.hideLoading();
																		if (resu.returnCode !=1) {
																			alertTip(resu.returnMsg);
																		} else {
																			_this.idPhoto.push(base64);
																			_this.idPhotoId.push(resu.returnData +".jpg");
																		}
																	});
														} else {
															let fnum =parseInt(blength /glength);
															for (let j =1; j <fnum +1; j++) {
																if (j ==fnum) {
																	let groupBase =base64.slice((j -1) *glength);
																	console.log(groupBase.length,"groupBaselength");
																	let uploadParam = {
																		base64: groupBase,
																		userId: getStorage(
																				'userInfo'
																				)
																			.userId +
																			i,
																		groupEnd: '1'
																	}
																	await uploadImg
																		(
																			uploadParam)
																		.then(
																			resu => {
																				resu =
																					resu
																					.data;
																				if (resu
																					.returnCode ==
																					1
																					) {
																					_this
																						.idPhoto
																						.push(
																							base64
																							);
																					_this
																						.idPhotoId
																						.push(
																							resu
																							.returnData +
																							".jpg"
																							);
																				} else {
																					uni
																				.hideLoading();
																					alertTip
																						(resu
																							.returnMsg
																							);
																					return;
																				}
																			}
																			);
																} else {
																	let groupBase =
																		base64
																		.slice(
																			(j -
																				1) *
																			glength,
																			glength *
																			j
																			);
																	let uploadParam = {
																		base64: groupBase,
																		userId: getStorage(
																				'userInfo'
																				)
																			.userId +
																			i,
																		groupEnd: '0'
																	}
																	await uploadImg
																		(
																			uploadParam)
																		.then(
																			resu => {
																				resu =
																					resu
																					.data;
																				if (resu
																					.returnCode ==
																					1
																					) {} else {
																					uni
																				.hideLoading();
																					alertTip
																						(resu
																							.returnMsg
																							);
																					return;
																				}
																			}
																			);
																}
															}
															uni
														.hideLoading();
														}
													}
												});
										},
									});
								}
							}
						});
					},
					fail: function(resp) {
						console.log(resp.errMsg);
					}
				});
			},
			//证明文件照片
			async chooseImg3() {
				let chec = 0;
				let sty = [];
				let _this = this;
				uni.showActionSheet({
					itemList: ['拍照', '相册'],
					success: function(resp) {
						chec = resp.tapIndex;
						if (chec == 0) {
							sty = ['camera']; //从相册相机选择 
						} else {
							sty = ['album']; //从相册相机选择
						}
						uni.chooseImage({
							count: 1,
							sizeType: ['compressed'],
							sourceType: sty,
							quality: 1,
							success: async function(res) {
								let resData = res.tempFilePaths;
								for (let i = 0; i < resData.length; i++) {
									if (_this.documentPhoto.length > 1) {
										break;
									}
									uni.getImageInfo({
										src: resData[i],
										success: async (path) => {
											convertImgToBase64(path.path,
											async function(base64) {
													if (_this.documentPhoto.length < 1) {
														uni.showLoading({
															title: '图片上传中'
														})
														let blength = base64.length;
														let glength = 7500;
														// console.log("base64:",base64)
														if (blength <=
															glength) {
															let uploadParam = {
																base64: base64,
																userId: getStorage('userInfo').userId +i,
																groupEnd: '1'
															}
															await uploadImg(uploadParam)
																.then(
																	resu => {
																		resu =resu.data;
																		uni.hideLoading();
																		if (resu.returnCode !=1) {
																			alertTip(resu.returnMsg);
																		} else {
																			_this.documentPhoto.push(base64);
																			_this.documentPhotoId.push(resu.returnData +".jpg");
																		}
																	});
														} else {
															let fnum =parseInt(blength /glength);
															for (let j =1; j <fnum +1; j++) {
																if (j ==fnum) {
																	let groupBase =base64.slice((j -1) *glength);
																	console.log(groupBase.length,"groupBaselength");
																	let uploadParam = {
																		base64: groupBase,
																		userId: getStorage(
																				'userInfo'
																				)
																			.userId +
																			i,
																		groupEnd: '1'
																	}
																	await uploadImg
																		(
																			uploadParam)
																		.then(
																			resu => {
																				resu =
																					resu
																					.data;
																				if (resu
																					.returnCode ==
																					1
																					) {
																					_this
																						.documentPhoto
																						.push(
																							base64
																							);
																					_this
																						.documentPhotoId
																						.push(
																							resu
																							.returnData +
																							".jpg"
																							);
																				} else {
																					uni
																				.hideLoading();
																					alertTip
																						(resu
																							.returnMsg
																							);
																					return;
																				}
																			}
																			);
																} else {
																	let groupBase =
																		base64
																		.slice(
																			(j -
																				1) *
																			glength,
																			glength *
																			j
																			);
																	let uploadParam = {
																		base64: groupBase,
																		userId: getStorage(
																				'userInfo'
																				)
																			.userId +
																			i,
																		groupEnd: '0'
																	}
																	await uploadImg
																		(
																			uploadParam)
																		.then(
																			resu => {
																				resu =
																					resu
																					.data;
																				if (resu
																					.returnCode ==
																					1
																					) {} else {
																					uni
																				.hideLoading();
																					alertTip
																						(resu
																							.returnMsg
																							);
																					return;
																				}
																			}
																			);
																}
															}
															uni
														.hideLoading();
														}
													}
												});
										},
									});
								}
							}
						});
					},
					fail: function(resp) {
						console.log(resp.errMsg);
					}
				});
			},
			//删除登记照片
			removeImg(index) {
				this.imgs.splice(index, 1);
				this.imgsId.splice(index, 1);
			},
			//删除身份证图片
			removeImg2(index) {
				this.idPhoto.splice(index, 1);
				this.idPhotoId.splice(index, 1);
			},
			//删除证明文件
			removeImg3(index) {
				this.documentPhoto.splice(index, 1);
				this.documentPhotoId.splice(index, 1);
			},
			
			//补办挂失
			//获取所有卡
			getAllCardList() {
				let params = {
					method: getAllCardList,
					data: {
						userId: getStorage('userInfo').userId,
						phone: getStorage('userInfo').mobile,
					}
				};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						console.log(res);
						this.myCardList = res.returnData;
						// this.lossCardList = []
						// this.myCardList.forEach(item=>{
						// 	if(item.status==null){
						// 		this.lossCardList.push(item)
						// 	}
						// })
						// this.lossItem = this.lossCardList[0]
						// console.log(this.lossCardList)
					} else {
						alertTip(res.returnMsg);
					}
				});
			},
			getReissueCardList() {
				let params = {
					method: getReissueCardList,
					data: {
						userId: getStorage('userInfo').userId
					}
				};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						console.log(res);
						this.reissueCardList = res.returnData;
						 
					} else {
						alertTip(res.returnMsg);
					}
				});
			},
			//卡挂失
			//打开确认框
			circulation(item){
				this.losscard = {};
				this.losscard = item;
				this.$refs.popup.open();
			},
			//关闭确认框
			closeCirculation(){
				this.losscard = {};
				this.$refs.popup.close()
			},
			//确认挂失
			handleCard(){
				let params =  {
						method: addMyCard,
						data: {
							userId:getStorage('userInfo').userId,
							type:"3",
							cardId:this.losscard.id,
						}
					};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						alertTip(res.returnMsg);
						this.closeCirculation()
						this.getAllCardList();
					} else {
						alertTip(res.returnMsg);
					}
				});	
			},
			//卡解绑
			//打开确认框
			unbindCard(item){
				this.unbind = item;
				this.$refs.popup2.open();
			},
			//关闭确认框
			closeCirculation2(){
				this.unbind = {};
				this.$refs.popup2.close()
			},
			//确认解绑
			handleCard2(){
				console.log(this.unbind)
				let params =  {
						method: addMyCard,
						data: {
							userId:getStorage('userInfo').userId,
							type:"2",
							cardId:this.unbind.id
						}
					};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						alertTip(res.returnMsg);
						this.closeCirculation2()
						this.getAllCardList();
					} else {
						alertTip(res.returnMsg);
					}
				});	
			},
			//卡绑定
			//打开确认框
			openCardBand(){
				this.cardBand = {cardNo:""};
				this.$refs.bandPopup.open();
			},
			//关闭确认框
			closecardBand(){
				this.cardBand = {cardNo:""};
				this.$refs.bandPopup.close()
			},
			//确认绑定
			handleCardBand(){
				let params =  {
						method: addMyCard,
						data: {
							userId:getStorage('userInfo').userId,
							type:"1",
							cardNo:this.cardBand.cardNo
						}
					};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						alertTip(res.returnMsg);
						this.closecardBand()
						this.getAllCardList();
					} else {
						alertTip(res.returnMsg);
					}
				});	
			},
			//卡补办
			//打开确认框
			reissueCardOpen(item){
				this.reissueCardData = item;
				this.$refs.popup3.open();
			},
			//关闭确认框
			closeReissueCard(){
				this.reissueCardData = {};
				this.$refs.popup3.close()
			},
			//确认补办
			handleReissueCard(){
				console.log(this.reissueCardData)
				let params =  {
						method: addMyCard,
						data: {
							userId:getStorage('userInfo').userId,
							userName:getStorage('userInfo').username,
							phone:getStorage('userInfo').mobile,
							orgId:getStorage('userInfo').orgId,
							orgName:getStorage('userInfo').orgName,
							type:"4",
							cardId:this.reissueCardData.id
						}
					};
					console.log(params)
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						alertTip(res.returnMsg);
						this.closeReissueCard()
						this.getReissueCardList();
					} else {
						alertTip(res.returnMsg);
					}
				});	
			},
			
			//卡解绑
			//打开确认框
			delCardOpen(item){
				this.delCardData = item;
				this.$refs.popup4.open();
			},
			//关闭确认框
			closeDelCard(){
				this.delCardData = {};
				this.$refs.popup4.close()
			},
			//确认删除
			handleDelCard(){
				console.log(this.delCardData)
				let params =  {
						method: addMyCard,
						data: {
							userId:getStorage('userInfo').userId,
							userName:getStorage('userInfo').username,
							phone:getStorage('userInfo').mobile,
							orgId:getStorage('userInfo').orgId,
							orgName:getStorage('userInfo').orgName,
							type:"5",
							cardId:this.delCardData.id
						}
					};
					console.log(params)
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						alertTip(res.returnMsg);
						this.closeDelCard()
						this.getAllCardList();
					} else {
						alertTip(res.returnMsg);
					}
				});	
			},
			
			
			
			
			//获取申请列表
			dataList() {
				let params = {
					method: getIssueCardByUserId,
					data: {
						userId: this.userInfo.id,
						pageNum: this.page,
						pageSize: this.pageSize,
						// faultType:this.faultType,
						// isInspection:0
					}
				};
				callbackRequest(params).then(res => {
					res = res.data;
					if (res.returnCode == 1) {
						if (this.page == 1) {
							this.cardList = res.returnData || [];
						} else {
							if (res.returnData.length > 0) {
								this.cardList = this.cardList.concat(res.returnData);
								this.loadingType = 0;
							} else {
								this.loadingType = 2;
							}
						}
					} else {
						alertTip(res.returnMsg);
					}
				});
			},
			// 跳转详情
			details: function(item) {
				uni.navigateTo({
					url: '/pages/access-card/access-card-detail?id=' + item.ID + '&item=' + JSON.stringify(
						item)
				});
			},
			//跳转选择出入区域
			goSelectArea: function(type) {
				uni.navigateTo({
					url: '/pages/access-card/access-area?chosenType=' + type
				});
			},

		},
		onReachBottom() {
			if (this.loadingType !== 0 || this.currentTabIndex == 0) {
				return;
			}
			this.loadingType = 1;
			this.page = this.page + 1;
			this.dataList();
		},

	};
</script>

<style lang="scss">
	@import url('../../static/css/repair/malfunction-repair.css');
	@import '@/static/css/common.scss';
	
	.radioBox{
		height: 280upx;
	}
	.chosenCard{
		background-color: #8DDDC5 !important;
	}

	.nolist {
		font-size: 30upx;
		color: #797979;
		text-align: center;
		margin-top: 20upx;
	}
		.main {
			margin: 180upx 40upx 0;
			position: relative;
			z-index: 10;

			.tab-box {
				overflow: hidden;
				// border-radius: 10upx 10upx 0 0;
				// background: rgba(132, 149, 167, 0.8);
				height: 80upx;

				.tab-item {
					float: left;
					height: 70upx;
					width: 40%;
					font-size: 30upx;
					// color: #e5f6ff;
					// text-align: center;
					line-height: 70upx;
				}

				.active {
					// background: #fff;
					color: #333;
					border-radius: 10upx 10upx 0 0;
					font-weight: bold;
					
				}
				.activeLine{
					background: linear-gradient( 90deg, #50CBA1 0%, #06AEA6 100%), #5685F2;
					border-radius: 10upx;
					width: 80upx;
					height: 10upx;
				}
			}
		}
	

	.list-content {
		font-size: 28upx;
		margin: 0 25upx;
		margin-top: 20upx;
		.details {
			background: white;
			padding: 0 20upx 20upx;
			border-radius: 18upx;
			margin-bottom: 20upx;
			
			.detail_header {
				border-bottom: #f8f8f8 5upx solid;
				height: 100upx;
				line-height: 100upx;
				// margin: 0;
				// border-radius: 10upx;

				.blueSign {
					height: 28upx;
					width: 5upx;
					background: #00c277;
					display: inline-block;
					margin-left: 20upx;
					vertical-align: middle;
				}

				.font-tilte {
					font-size: 32upx;
					font-weight: bold;
					margin-left: 20upx;
					vertical-align: middle;
				}
			}

			.detail_msg {
				margin-left: 20upx;
				border-radius: 10upx;
				overflow: hidden;

				view {
					height: 60upx;
					line-height: 60upx;
				}

				.status {
					position: absolute;
					color: red;
					margin-left: 580upx;
					margin-top: -15upx;
				}
			}
		}
	}

	.statusgr {
		float: right;
		margin-right: 30upx;
		color: #00c277;
	}

	.statusred {
		width: 160upx;
		height: 60upx;
		line-height: 60upx;
		text-align: center;
		border-radius: 50upx;
		float: right;
		font-size: 26upx;
		margin-right: 30upx;
		margin-top: 25upx;
	}

	.img-box {
		overflow: hidden;
		padding-top: 20rpx;
		padding-bottom: 10rpx;

		.img-item {
			float: left;
			width: 200upx;
			height: 200upx;
			border: 1px solid #ddd;
			margin: 0 22rpx 20upx 0upx;
			position: relative;
			box-sizing: border-box;

			.img {
				display: block;
				width: 100%;
				height: 100%;
			}

			.remove-btn {
				position: absolute;
				top: -18upx;
				right: -18upx;
				width: 44upx;
				height: 44upx;
				z-index: 2;
			}
		}

		.upload-btn {
			.img {
				width: 60upx;
				height: 60upx;
				margin: unset;
			}
		}
	}

	.detail_msg .info-item {
		font-size: 28upx;
		margin-right: 30upx;
		text {
			display: inline-block;
			width: 140upx;
			color: #999;
		}

		.infoSpan {
			width: auto;
			font-size: 28upx;
			color: #999;
			float: right;
		}
	}
	.input-box {
		margin-left:40upx;

		input {
			width: 100%;
			height: 50upx;
			line-height: 50upx;
			font-size: 26upx;
			color: #666;
		}
	}
	.form-box {
		background: #fff;

		.form-item {
			overflow: hidden;
			border-bottom: 1px solid #eee;
			padding: 30upx 20upx;

			.label {
				float: left;
				width: 150upx;
				font-size: 28upx;
				color: #333;
				font-weight: bold;
				line-height: 50upx;
			}

			.ipt-box {
				margin-left: 160upx;
				.areaBtn{
					font-size: 24upx;
					width: 100upx;
					height: 60upx;
					line-height: 65upx;
					text-align: center;
					background: linear-gradient( 90deg, #50CBA1 0%, #06AEA6 100%), #C1EFEA;
					border-radius: 15upx;
					color: #fff;
					margin-right: 20upx;
				}
				input {
					width: 100%;
					height: 50upx;
					line-height: 50upx;
					font-size: 26upx;
					color: #666;
				}
			}

			.select {
				.arrow {
					float: right;
					width: 16upx;
					height: 29upx;
					margin-top: 10upx;
				}

				.picker {
					height: 50upx;
					line-height: 50upx;
					font-size: 26upx;
					color: #666;
					margin-left: 10upx;
				}
			}
		}
	}
	.card-box{
		background: #fff;
		padding: 40upx;
		.card-item{
			margin-bottom: 20upx;
			padding: 20upx;
			width: 100%;
			// height: 180upx;
			border-radius: 10upx;
			background-color: #6CD374;
			position: relative;
			color: #fff;
			.card-btn{
				// position: absolute;
				// bottom: 40upx;
				// right: 20upx;
				background-color: #C2FAF8;
				padding: 8rpx 20rpx;
				border-radius: 10rpx;
				margin-right: 20rpx;
				color: #666;
			}
			// .card-btn0{
			// 	position: absolute;
			// 	bottom: 40upx;
			// 	right: 150upx;
			// 	background-color: #C2FAF8;
			// 	padding: 5upx 20upx;
			// 	border-radius: 10upx;
			// }
		}
	}
	
	.comment-btn {
		float: right;
		font-size: 24upx;
		border-radius: 10upx;
		color: #fff;
		// line-height: 30upx;
		text-align: center;
		min-width: 120upx;
		margin-right: 30upx;
		background-color: #00c277;
	}

	.common-shade {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100vh;
		background: rgba(0, 0, 0, 0.7);
		z-index: 99;
	}

	.box {
		display: flex;
		display: -webkit-flex;
	}

	.box-row-reverse {
		flex-direction: row;
	}

	/*上下排列*/
	.box-column {
		flex-direction: column;
	}

	/*上下排列*/
	.box-left {
		justify-content: flex-start;
	}

	/*居右*/
	.box-right {
		justify-content: flex-end;
	}

	/*居左*/
	.box-center {
		justify-content: center;
	}

	/*居中*/
	.box-between {
		justify-content: space-between;
	}

	/*两端对齐*/
	.box-align-center {
		align-items: center;
	}

	.box-wrap {
		flex-wrap: wrap;
	}
</style>