<template>
	<view class="cust_detail">
		<view class="cust_item_con" v-for="(item,index) in payment_list" :key="index"
			@click="toPaymentDetail(item)">
			<view class="con_info">
				<view class="head">{{item.number}}</view>
				<view class="con_money">
					<view class="c_m_left">
						回款金额：
					</view>
					<view class="c_m_right">
						&yen; {{item.money}}
					</view>
				</view>
				<view class="con_time">回款日期：{{item.return_time}}</view>
				<view class="recostatus" v-if="item.check_status == 0">
					<span>待审核</span>
				</view>
				<view class="recostatus" v-if="item.check_status == 1">
					<span>审核中</span>
				</view>
				<view class="recostatus" v-if="item.check_status == 2">
					<span>审核通过</span>
				</view>
				<view class="recostatus" v-if="item.check_status == 3" >
					<span>审核未通过</span>
				</view>
				<view class="recostatus" v-if="item.check_status == 4" >
					<span>已撤回</span>
				</view>
			</view>
		</view>
		<view style="height: 200rpx;"></view>
		<u-empty v-if="payment_list.length == 0" text="暂无更多"></u-empty>
		<view class="icon_creat" v-if="type == 1" @click="toAddPayment">
			<image :src="BASE_IMG_URL+'1.png'" mode="scaleToFill"></image>
		</view>
	</view>
</template>

<script>
	import {
		netPaymentList
	} from '@/api/kehu.js'
	import {
		netGetSignList
	} from '@/api/index.js'
	import {
		BASE_IMG_URL
	} from '@/util/api.js'

	export default {
		data() {
			return {
				BASE_IMG_URL: BASE_IMG_URL,
				payment_list: [], //回款记录
				kehuid:'',
				type:1,
				isSeas:1,
			}
		},
		onLoad(options){
			this.kehuid = options.id,
			this.limit = options.limit
			this.type = options.type
			
		},
		onShow() {
			//回款 记录
			this.getPaymentList()
		},
		created() {
			

		},
		methods: {
			//回款记录  列表
			getPaymentList() {
				let params = {
					customer_id: this.kehuid,
					limit: 1000
				}
				netPaymentList(params).then(res => {
					this.payment_list = res.data.data
				})
				console.log(this.payment_list, '回款记录')
			},
			//回款  详情
			toPaymentDetail(item) {
				uni.navigateTo({
					url: '/pagesB/contract/paymentDetail?id=' + item.id
				})
			},
			//添加  回款
			toAddPayment() {
				uni.navigateTo({
					url: '/pagesB/contract/addContractPayment?kehuid=' + this.kehuid
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.cust_detail {
		.cust_item_con {
			background: #fff;
			margin-top: 20rpx;
			.con_info {
				.head {
					border-bottom: 1px solid #ededed;
					font-size: 34rpx;
					color: #333;
					padding: 30rpx 60rpx;
				}
				.con_money {
					display: flex;
					justify-content: space-between;
					.c_m_left {
						padding: 35rpx 60rpx;
						font-size: 32rpx;
						color: #999;
					}
					.c_m_right {
						padding: 30rpx;
						font-size: 32rpx;
						color: $uni-text-color;
						font-weight: 500;
					}
				}
				.con_time {
					padding: 0 35rpx 30rpx 60rpx;
					font-size: 32rpx;
					color: #999;
				}
				.recostatus{
					padding: 0 0 30rpx 60rpx;
					span{
						font-size: 26rpx;
						color:$uni-text-color;
						padding: 5rpx 12rpx;
						background: $uni-text-color-opcity;
						border-radius: 5rpx;
					}
				}
			}
		}
		#btn {
			font-size: 26rpx;
			color: #fff;
			text-align: center;
			line-height: 88rpx;
			width: 500rpx;
			height: 88rpx;
			background: $uni-text-color;
			border-radius: 29rpx;
			margin: 30rpx auto;
		}
	}
</style>
