<template>
	<view class="containers">
		<view>
			<img :src="succ" alt="">
			<view class="success-title">
				<view>提交成功{{!iscall?'，等待审核':''}}</view>
				<view class="en-text">{{!iscall?'Submit Successfully, Waiting for Approval':'Submit Successfully'}}</view>
			</view>
			<view v-if="!iscall" class="success-tip">
				<view>审核通过后，系统将在第一时间通知你</view>
				<view class="en-text">After approval, the system will notify you as soon as possible</view>
			</view>
			<view>
				<button @click="toHistory" class="history-btn">
					<view>我的拜访记录</view>
					<view class="en-text">My Visit Records</view>
				</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				succ: require('../../static/img/success.png'),
				iscall:false
				
			}
		},
		onLoad(options) {
			this.iscall=options.iscall?true:false

		},
		methods: {
			toHistory() {
				let url = '/pages/visit/visithistory'
				if(this.iscall){
					url = '/pages/bd/record?type=call'
				}
				uni.redirectTo({
					url: url
				})
			}
		}
	}
</script>

<style scoped>
	.containers {
		background-color: #fff;
		min-height: 80vh;
		padding: 20rpx;
		position: relative;
	}

	.containers>view {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		width: 70%;
		text-align: center;
	}

	.containers>view img {
		width: 200rpx;
		height: 200rpx;
	}

	.containers>view view {
		margin-bottom: 40rpx
	}

	.success-title {
		display: flex;
		flex-direction: column;
		align-items: center;
		font-size: 40rpx;
		color: #000;
		margin-bottom: 40rpx;
	}
	.success-title .en-text {
		font-size: 28rpx;
		color: #999;
		margin-top: 8rpx;
		font-weight: normal;
	}
	.success-tip {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-bottom: 40rpx;
		font-size: 32rpx;
		color: #666;
	}
	.success-tip .en-text {
		font-size: 24rpx;
		color: #999;
		margin-top: 8rpx;
	}
	.history-btn {
		background-color: #4f607e;
		color: #fff;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 20rpx 40rpx;
	}
	.history-btn .en-text {
		font-size: 22rpx;
		opacity: 0.9;
		margin-top: 4rpx;
	}
</style>
