<template>
	<view v-if="!successful" class="content">

		<view class="content-detail">
			<view class="content-title">
				<view class="content-title-a">
					交易申请协议
				</view>
				<view class="content-title-b" @click="navation">
					申请记录
				</view>
			</view>
			<view class="">

				<view v-html="detail.business_apply_agree">

				</view>

			</view>

		</view>

		<view class="content-bottom" v-if="type==0">
			<view class="bottombtn_no" @click="noagree">拒绝</view>
			<view class="bottom_agree" @click="agree">同意</view>
		</view>
		<view class="content-bottom" v-if="type==1||type==3">
			<view class="bottom_agree" @click="agree">重新申请</view>
		</view>
	</view>

	<view class="settledSuccessMain" v-else>
		<view class="settledSuccessful">

			<image class="image" src="@/pages/store/static/images/settledSuccessful.svg">
				<view class="title">恭喜，您的资料提交成功！</view>
				<view class="info">预计15个工作日内审核完毕，平台客服会及时与您联系！</view>
				<view class="goHome" hover-class="none" @click="goHome">
					返回首页
				</view>
		</view>
	</view>
</template>

<script>
	import {
		business,
		intentionbus
	} from "@/api/product"
	export default {
		data() {
			return {
				detail: {},
				type: 0,
				successful: false
			}
		},
		onLoad(e) {
			this.type = e.business_status
			
			this.list()
		},
		methods: {
			//获取协议内容
			list() {
				business().then(res => {
					this.detail = res.data
				})
			},
			
			// 首页
			goHome() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			},
			//跳转
			navation() {

				uni.navigateTo({
					url: '/pages/product/transactionApplication/application'
				})
			},
			//拒绝申请
			noagree() {
				uni.navigateTo({
					url: '/pages/moreProject/moreProject'
				})
				
			},
			//同意申请
			agree() {
				intentionbus().then(res => {
					if (res.status == 200) {
						this.$util.Tips({
							title: res.message,
							icon: 'success',
						})
						this.successful=true
						
					}


				}).catch((err) => {

					this.$util.Tips({
						title: err,
						icon: 'error',
					})
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		position: relative;
	}

	.content-detail {
		padding: 20rpx 20rpx;
		color: #333333;
		font-size: 28rpx;
		margin-bottom: 155rpx;

		.content-title {
			color: #333333;
			font-size: 32rpx;
			text-align: center;
			margin-top: 40rpx;
			margin-bottom: 40rpx;

			.content-title-b {
				width: 165rpx;
				height: 70rpx;
				font-size: 26rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
				text-align: center;
				line-height: 70rpx;
				background: linear-gradient(90deg, #F84221 0%, #FF6D20 100%);
				box-shadow: 0px 4rpx 11rpx 2rpx rgba(252, 89, 32, 0.49);
				border-radius: 37rpx 0px 0px 37rpx;
				opacity: 1;
				position: absolute;
				top: 40rpx;
				right: 0;
			}
		}
	}

	.content-bottom {
		position: absolute;
		width: 100%;
		bottom: 0;
		position: fixed;
		height: 175rpx;
		background: #FFFFFF;
		display: flex;
		justify-content: space-around;


		.bottombtn_no {
			margin-top: 42rpx;
			width: 249rpx;
			height: 84rpx;
			text-align: center;
			line-height: 84rpx;
			border-radius: 46rpx 46rpx;
			opacity: 1;
			border: 2rpx solid #B3B3B3;
			font-size: 33rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #737373;

		}

		.bottom_agree {
			margin-top: 42rpx;
			width: 249rpx;
			height: 84rpx;
			text-align: center;
			line-height: 84rpx;
			background: linear-gradient(270deg, #FF6D20 0%, #F84221 100%);
			border-radius: 46rpx 46rpx;
			opacity: 1;

			font-size: 33rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #fff;
		}

	}
	.settledSuccessMain {
		height: 100vh;
		display: flex;
		flex-direction: column;
		background: #fff;
	}
	
	.settledSuccessful {
		flex: 1;
		width: 100%;
		padding: 0 56px;
		height: auto;
		background: #fff;
		text-align: center;
	}
	
	.settledSuccessful .image {
		width: 189px;
		height: 157px;
		margin-top: 66px;
	}
	
	.settledSuccessful .title {
		color: #333333;
		font-size: 16px;
		font-weight: bold;
		margin-top: 35px;
	}
	
	.settledSuccessful .info {
		color: #A0A0A0;
		font-size: 13px;
		margin-top: 12px;
	}
	
	.settledSuccessful .goHome {
		margin: 60px auto 0;
		line-height: 43px;
		color: #282828;
		font-size: 15px;
		border: 1px solid #B4B4B4;
		border-radius: 60px;
	}
</style>