<template>
	<view class="main">
		<TopBar title="驳回原因"/>
		<view class="refuse_flex">
			<view class="flex">
				<image class="refuse_img" :src="data.default_image || $noGoodsImg"></image>
				<view class="dlb dlb_box">
					<view class="refuse_goods_name">{{data.equipment_name}}</view>
					<view class="refuse_goods_price">￥{{data.price}}</view>
				</view>
			</view>
			<!-- <text class="refuse_refund">退定金</text> -->
		</view>
		<view class="refuse_view">
			<view class="title">已驳回</view>
			<view class="refuse_content">尊敬的用户，您好！您本次的采购分期申请已被驳回，定金已退还至您的余额，驳回原因如下：
			</view>
			<view class="refuse_item">{{data.dismiss_reason}}</view>
		</view>
		<view class="reupload" @click="reupload()">重新上传资质</view>
	</view>
</template>

<script>
	import TopBar from '@/components/TopBar/TopBar.vue';
	export default {
		data() {
			return {
				data: {
					contract_no: '',
					default_image: '',
					dismiss_reason: '',
					equipment_name: '',
					price: ''
				}
			}
		},
		onLoad(option) {
			uni.request({
				url: `/uni/api/userqualification/GetDismissReason/${option.apply_id}`,
				method: 'GET',
				success: (res) => {
					if(res.data.code === 0) {
						this.data = {
							...this.data,
							...res.data.data[0]
						}
					}
				}
			});
		},
		methods: {
			reupload() {
				uni.navigateTo({
					url: `/pages/apply/applypage1?contract_no=${this.data.contract_no}&property_id=${this.data.property_id}`
				})
			}
		},
		components: {
			TopBar
		}
	}
</script>

<style lang="less" scoped>
	.main {
		background-color: #F8F8F8;
		width: 100%;
		height: 100vh;
		padding-top: 80rpx;
	}
	.refuse_flex {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx 40rpx 20rpx 24rpx;
		box-shadow:0px 4px 16px 0px rgba(0,0,0,0.04);
		.flex {
			display: flex;
			.refuse_img {
				width: 120rpx;
				height: 120rpx;
				border-radius: 8rpx;
				margin-right: 20rpx;
			}
			.dlb_box {
				color: #212121;
				.refuse_goods_name {
					font-size: 26rpx;
					line-height: 36rpx;
					margin-bottom: 20rpx;
				}
				.refuse_goods_price {
					font-size: 28rpx;
					line-height: 40rpx;
				}
			}
		}
		.refuse_refund {
			width: 120rpx;
			height: 56rpx;
			line-height: 56rpx;
			border-radius: 28rpx;
			text-align: center;
			border: 1px solid #AEAEAE;
			box-sizing: border-box;
			color: #464646;
			font-size: 26rpx;
		}
	}
	.refuse_view {
		width: 694rpx;
		background: #fff;
		margin: 32rpx auto 40rpx;
		padding: 40rpx;
		box-sizing: border-box;
		.title {
			height:40rpx;
			font-size:28rpx;
			font-family:PingFangSC-Semibold,PingFang SC;
			font-weight:600;
			color: #212121;
		}
		.refuse_content {
			color: #8F99A7;
			font-size: 28rpx;
			line-height: 40rpx;
			margin: 20rpx 0 40rpx;
		}
		.refuse_item {
			color: #464646;
			font-size: 28rpx;
		}
	}
	.reupload {
		width: 238rpx;
		height: 68rpx;
		text-align: center;
		line-height: 68rpx;
		border-radius: 12rpx;
		background-color: #FFCD00;
		margin: 40rpx auto;
		font-size: 28rpx;
	}
</style>
