<template>
	<view class="pages">
		<u-navbar title="解封记录" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
			title-size='36' height='50'></u-navbar>
		<view class="list" @scrolltolower="onReachBottom">
			<view class="list_item" v-for="(item,index) in list" :key="index" @click="btnxq(item.infoId)">
				<view class="top">
					<text>申请人：{{item.userName == undefined ? '--' : item.userName}}</text> 
					<text style="color: #4CD964;" v-if="item.status == 3">已通过</text>
					<text style="color: #E83535;" v-if="item.status == 4">已驳回</text>
					<text style="color: #ccc;" v-if="item.status == 1">未提交</text>
					<text style="color: #ccc;" v-if="item.status == 2">审核中</text>
				</view>
				<view class="bd">
					
					<view class="">
						审批意见：{{item.verifyRemark == undefined ? '--' : item.verifyRemark}}
					</view>
					<view class="">
						申请时间：{{item.submitTime == undefined ? '--' : item.submitTime}}
					</view>
				</view>
			</view>
		</view>
		<view v-if="list.length == 0" class="" style="width: 100%;text-align: center;margin-top: 50rpx;font-size: 36rpx;color: #ccc;">
			没有更多解封记录了...
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgc: {
					backgroundColor: "#8883f0",
				},
				pageNum: 1,
				pageSize: 10,
				list: [],
				total: 0
			}
		},
		onLoad() {
			this.getlist()
		},
		onShow() {

		},
		// 分享到好友（会话）
		onShareAppMessage: function() {
			return {
				title: '创想物联',
				path: '/pages/shouye/index'
			}
		},

		// 分享到朋友圈  
		onShareTimeline: function() {
			return {
				title: '创想物联',
				query: '',
				path: '/pages/shouye/index'
			}
		},
		methods: {
			// 点击请求详情
			btnxq(infoId){
				uni.navigateTo({
					url:'/page_fenbao/jiefeng/jiefengxq?infoId=' + infoId
				})
			},
			// 请求解封记录
			getlist() {
				this.$u.get(`/app/riskInfo/list?pageNum=${this.pageNum}&pageSize=${this.pageSize}&orderByColumn=createTime&isAsc=desc`).then((res) => {
					if (res.code == 200) {
						this.total = res.total
						if (res.rows.length > 0) {
							// 有数据，追加到列表  
							this.list = this.list.concat(res.rows)
							this.pageNum++
						} 
					}
				})
			},
			// 上拉获取更多数据
			onReachBottom() {
				if (this.list.length < this.total) {
					this.getlist()
				} else {
					uni.showToast({
						title: '没有更多记录了',
						icon: 'none',
						duration: 2000
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	/deep/ .u-title {
		padding-bottom: 22rpx;
	}

	/deep/ .u-icon__icon {
		padding-bottom: 22rpx;
	}

	page {
		background-color: #F7FAFE;

		.list {
			width: 100%;

			.list_item {
				padding: 0 44rpx;
				box-sizing: border-box;
				margin-top: 22rpx;
				width: 100%;
				height: 280rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 6rpx 52rpx 0rpx rgba(0, 0, 0, 0.08);

				.top {
					width: 100%;
					height: 108rpx;
					line-height: 108rpx;
					display: flex;
					justify-content: space-between;
					font-weight: 600;
					font-size: 32rpx;
					color: #3D3D3D;
					border-bottom: 1px solid #D8D8D8;
				}

				.bd {
					view {
						font-size: 32rpx;
						color: #3D3D3D;
						margin-top: 28rpx;
					}
				}
			}
		}
	}
</style>