<template>
	<view class="login-container" :style="!workArray.length?{backgroundColor:`#F7F7F7`}:{}">
		<model :show="show" @close="show=false" :content="content" />
		<!-- <view class="title-back">
			<view class="left-father" @click="goBack">
				<image class="back-img" src="https://www.focusnu.com/media/directive/index/left.png" />
				
			</view>
		</view> -->
		<view class="title-back" :style="{height:`${uni.getStorageSync('moveHeight')+35}px`}">
			<view class="left-father" @click="goBack">
				<image class="back-img" src="https://www.focusnu.com/media/directive/index/left.png" />
				<!-- <view style="font-size: 30rpx;">机构加盟</view> -->
			</view>
		</view>
		<view :style="{height:`${uni.getStorageSync('moveHeight') + 30}px`}"></view>
		<view style="position: absolute;top: 200rpx;left: 30rpx;z-index: 1;display: flex;align-items: center;"
			v-if="workArray.length">
			<view class="shu"></view>
			<view class="content-weight">账单信息</view>
		</view>
		<view class="index-up" v-if="workArray.length">
			<image class="index-up-img" src="https://www.focusnu.com/media/directive/index/pouplebgc.png"
				mode="widthFix" lazy-load="false" />
		</view>
		<view
			style="position: absolute;left:0;top: 400rpx;width: 100%;display: flex;flex-direction: column;justify-content: center;align-items: center;z-index: 999;"
			v-if="!workArray.length">
			<image style="height: 220rpx;width: 350rpx;"
				src="https://www.focusnu.com/media/directive/index/jigouyaoqing.png" />
			<view style="color: #8E96AD;margin-top: 20rpx;">
				暂无缴费信息
			</view>
		</view>
		<view class="bgc-card">
			<view class="under-scroll">
				<view v-for="(item,index) in workArray" :key="index">
					<view class="white-small">
						<view class="white-name">
							<view style="font-size: 36rpx;font-weight: 600;"
								v-if="item.type=='bind_nu' && item.elderName==null">
								预缴金额
							</view>
							<view style="font-size: 36rpx;font-weight: 600;" v-else>
								{{ item.elderName }}
							</view>
							<view style="font-size: 30rpx;">
								{{ item.nuName }}
							</view>
						</view>
						<view style="font-size: 50rpx;font-weight: 600;margin: 15rpx 0;">
							{{ item.amount }}
						</view>
						<view class="gray-bgc">
							<view style="display: flex;margin-left: 20rpx;">
								<view class="">
									{{ item.typeName }}
								</view>
								<!-- <view style="margin: 0 20rpx;">
									|
								</view> -->
								<!-- <view class="">
									余额
									<text style="color: #0087FF;">
										{{ item.balance }}
									</text>
								</view> -->
							</view>
							<view style="margin-right: 20rpx;color: #b8b8b8;">
								余额
								<text style="color: #0087FF;">
									{{ item.balance }}
								</text>
								元
							</view>
						</view>
						<view class="remark-bgc">
							备注信息：{{item.createTime.slice(0,10) }}{{ item.remark }}

						</view>
						<view style="margin-top: 20rpx;color: #999999;font-size: 30rpx;">
							{{ item.departName }}
						</view>
						<!-- <image style="height: 90rpx;width: 90rpx;"
							src="https://www.focusnu.com/media/directive/index/touxiang.png" />
						<view class="">
							<view style="display: flex;margin-left: 20rpx;align-items: center;">
								<view style="color: black;font-size: 32rpx;">
									{{ item.name }}
								</view>
								<view style="margin-left: 20rpx;">
									{{ item.sex }}
								</view>
							</view>
							<view style="display: flex;margin-left: 20rpx;align-items: center;margin-top: 10rpx;">
								<view style="color: black;font-size: 28rpx;">
									NUID
								</view>
								<view style="margin-left: 10rpx;">
									{{ item.nuId }}
								</view>
							</view>
						</view>
						<view style="position: absolute;right: 20rpx;top: 60rpx;display: flex;align-items: center;">
							<image style="height: 30rpx;width: 30rpx;"
								src="https://www.focusnu.com/media/directive/index/infotime.png" />
								<view style="margin-left: 20rpx;">
									{{ item.createTime.slice(0, 10) }} 
								</view>
								<image style="height: 30rpx;width: 30rpx;margin-left: 10rpx;"
									src="https://www.focusnu.com/media/directive/index/more.png" />
						</view> -->
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script setup>
	import {
		reactive,
		ref,
		nextTick
	} from 'vue';
	import {
		onLoad,
		onPullDownRefresh,

	} from '@dcloudio/uni-app'
	import {
		// getEmployeesOrgRela,
		payMoneyList
	} from './api.js'
	// import {
	// 	getMessageList
	// } from '@/pages/addstaff/api/addjigou.js'
	import model from "@/compontent/public/model.vue"

	const type = ref(0)
	const workArray = ref([])
	const special = ref(false);
	const statusarray = ["loading", "success", "fail"]
	const payMoneyListvalue = ref("")
	const orgCode = ref("")

	// 页面加载时接收 URL 参数
	onLoad((options) => {
		payMoneyListvalue.value = options.nuId
		orgCode.value = options.orgCode
		payMoneyList(payMoneyListvalue.value, orgCode.value).then(res => {
			workArray.value = res.result
		})
	})

	onPullDownRefresh(() => {
		payMoneyList(payMoneyList.value, orgCode.value).then(res => {
			workArray.value = res.result
		})
		uni.stopPullDownRefresh()
	})
	const content = ref("");
	const show = ref(false);
	const openLook = (res) => {
		if (res) {
			content.value = res;
			show.value = true
		}
	}
	const goBack = () => {
		uni.navigateBack()
	}
	// const changeoldman = (item) => {
	// 	console.log("????",item)
	// 	uni.setStorageSync("baddata", item)
	// 	uni.setStorageSync('specicalid', item.id);
	// 	uni.setStorageSync("backhuancun", {})
	// 	let data = {
	// 		nuId : item.nuId,
	// 		orgCode : item.orgCode
	// 	}
	// 	uni.setStorageSync('oldman', data);
	// 	uni.navigateTo({
	// 		url: "/pages/addoldman/oldIDcard"
	// 	})
	// }
	// const again = (item) => {
	// 	uni.navigateTo({
	// 		url: "/pages/yuangongindex/searchjigou"
	// 	})
	// 	// uni.getStorage({
	// 	// 	key: 'openid',
	// 	// 	success: function(res) {
	// 	// 		getMessageList(res.data).then(res => {
	// 	// 			if (res.success) {
	// 	// 				uni.setStorageSync("baddata", res.result[0])
	// 	// 				uni.setStorageSync('specicalid', res.result[0].id);
	// 	// 				uni.setStorageSync("backhuancun", {})
	// 	// 				uni.navigateTo({
	// 	// 					url: `/pages/addstaff/information`
	// 	// 				});
	// 	// 			}

	// 	// 		})
	// 	// 	}
	// 	// });

	// }

	// const jumpToAll = (element) => {
	// 	console.log("????", element.applyStatus)
	// 	// uni.getStorage({
	// 	// 	key: 'openid',
	// 	// 	success: function(res) {
	// 	// 		getMessageList(res.data).then(res => {
	// 	// 			if (res.success) {
	// 	// 				uni.navigateTo({
	// 	// 					url: `/pages/addstaff/all?element=${JSON.stringify(res.result[0])}&applyStatus=${element.applyStatus}`
	// 	// 				});
	// 	// 			}

	// 	// 		})
	// 	// 	}
	// 	// });
	// 	// uni.navigateTo({
	// 	// 	url: `/pages/yuangongindex/company?element=${JSON.stringify(element)}`
	// 	// });
	// }
</script>

<style lang="scss" scoped>
	.login-container {
		display: flex;
		flex-direction: column;
		min-height: 100vh;
		width: 100%;
		background-color: #F7F7F7;
		position: relative;

	}

	.under-scroll {
		width: 100%;
		height: calc(100% - 460rpx);
		padding-top: 30rpx;

		.white-small {
			width: 94%;
			margin-left: 3%;
			// height: 450rpx;
			background-color: #fff;
			border-radius: 30rpx;
			// padding: 40rpx;
			padding: 40rpx 50rpx;
			// padding-top: 40rpx;
			// margin-bottom: 50rpx;
			font-size: 25rpx;
			// color: #999999;
			position: relative;
			// display: flex;
			// align-items: center;
			margin-top: 50rpx;
		}
	}

	.button-heng {
		// width: 100%;
		display: flex;
		justify-content: flex-end;
		position: absolute;
		bottom: 30rpx;
		right: 0;




	}

	.bgc-card {
		margin-top: 80rpx;
		// background-color: #F7F7F7;
		width: 98%;
		margin-left: 1%;
		border-top-left-radius: 30rpx;
		border-top-right-radius: 30rpx;
		min-height: calc(100vh - 650rpx);
		z-index: 1;
	}

	.index-up {
		position: absolute;
		top: 0rpx;
		left: 0;
		width: 100%;

		.index-up-img {
			width: 100%;
			height: 20rpx;
		}
	}

	.title-card {
		margin: 30rpx;
		background-color: #fff;
		width: 93%;
		height: 250rpx;
		border-radius: 30rpx;
		padding: 0 45rpx;
		margin-top: 40rpx;
		padding-top: 40rpx;

		.big-weight {
			font-size: 30rpx;
			color: #333333;
			font-weight: 600;
			margin-bottom: 30rpx;
		}

		.title-other {
			color: #666666;
			font-size: 25rpx;
		}
	}

	.title-back {
		background-color: #EFF6F9;
		width: 100%;
		height: 70rpx;
		display: flex;
		justify-content: space-between;
		align-items: flex-end;
		padding-bottom: 20rpx;
		border-bottom: 1rpx solid #cbd1d2;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9999;
	}

	.left-father {
		display: flex;
		align-items: center;
		z-index: 1;

		.back-img {
			width: 45rpx;
			height: 40rpx;
			margin-left: 40rpx;
			margin-right: 15rpx;
		}
	}

	.enter-img {
		width: 25rpx;
		height: 25rpx;
		position: absolute;
		right: 30rpx;
		top: 35rpx;
	}

	.bottom-father {
		display: flex;
		justify-content: space-between;
		margin-bottom: 20rpx;
	}

	.bottom-img {
		position: absolute;
		right: 30rpx;
		top: 60rpx;
		width: 160rpx;
		height: 140rpx;
	}

	.blue-button {
		margin: 0 30rpx;
		margin-top: 30rpx;

		width: 200rpx;
		height: 60rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background: linear-gradient(to right, #00C9FF, #0076FF);
		border-radius: 25rpx;
		color: #fff;
		font-size: 30rpx;
		z-index: 999;
	}

	.white-button {
		margin: 0 30rpx;
		margin-top: 30rpx;

		width: 200rpx;
		height: 60rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background: linear-gradient(to bottom, #f3f3f5, #dee4e9);
		border-radius: 25rpx;
		// color: #fff;
		font-size: 30rpx;
		z-index: 999;
		// display: flex;
		// justify-content: center;
		// align-items: center;
		// width: 30%;
		// height: 60rpx;
		// margin: 0 30rpx;
		// margin-top: 10rpx;
		// // color: #fff;
		// background: linear-gradient(to bottom, #f3f3f5, #dee4e9);
		// border-radius: 25rpx;
		// font-size: 30rpx;
	}

	.card-font {
		margin-left: 10rpx;
		font-size: 32rpx;
		margin-top: 30rpx;
		padding-top: 25rpx;
		word-wrap: break-word;
		width: 450rpx;
		font-weight: 600;
	}

	.gray-font {
		// margin-left: 20rpx;
		font-size: 32rpx;
		margin-top: 20rpx;
		color: #B1B1B1;
		width: 100%;
	}



	.applying {
		position: absolute;
		right: 20rpx;
		top: 0rpx;
		background-color: #FFE8D3;
		color: #FF7900;
		width: 130rpx;
		height: 50rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		border-radius: 10rpx;
		margin-left: 35rpx;
		margin-top: 25rpx;
		// margin-top: 20rpx;
		// margin-bottom: 20rpx;
	}

	.applysuccess {
		position: absolute;
		right: 20rpx;
		top: 0rpx;
		background-color: #DEF1FF;
		color: #0093FF;
		width: 130rpx;
		height: 50rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		border-radius: 10rpx;
		margin-left: 35rpx;
		margin-top: 25rpx;
		// margin-bottom: 20rpx;
	}

	.applyfail {
		position: absolute;
		right: 20rpx;
		top: 0rpx;
		background-color: #fff4f7;
		color: #FC3D7F;
		width: 130rpx;
		height: 50rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		border-radius: 10rpx;
		margin-left: 35rpx;
		margin-top: 20rpx;
		// margin-bottom: 20rpx;
	}

	.applywhy {
		position: absolute;
		right: 20rpx;
		top: 60rpx;
		background-color: #F1F1F1;
		color: #373737;
		width: 130rpx;
		height: 50rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		border-radius: 10rpx;
		margin-left: 35rpx;
		margin-top: 20rpx;
	}

	.shu {
		width: 14rpx;
		height: 36rpx;
		background-color: #0097FF;
		border-radius: 10rpx;
		margin: 3rpx 20rpx 0 30rpx;
	}

	.content-weight {
		font-size: 36rpx;
		font-weight: 600;
	}

	.white-name {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.gray-bgc {
		background-color: #F3F6FE;
		width: 100%;
		height: 70rpx;
		display: flex;
		align-items: center;
		border-radius: 5rpx;
		justify-content: space-between;
		font-size: 28rpx;
	}

	.remark-bgc {
		flex-wrap: wrap;
		background-color: #F9F9F9;
		padding: 20rpx;
		width: 100%;
		font-size: 25rpx;
		margin-top: 20rpx;
		color: #b8b8b8;
	}
</style>