<template>
	<view class="absolute w-full h-full bg-[#4E55AF]">
		<!-- <u-navbar :background="background" title=""></u-navbar> -->
		<view class=" flex flex-col items-center  mt-[180rpx]">
			<u-image width="500" height="300" mode="widthFix" src="/static/images/withdraw/withdraw_bg.png"></u-image>
		</view>
		<view class="my-[100rpx] text-center px-[50rpx]">
			<view class="type-primary font-bold mb-[50rpx]">
				{{text1}}
			</view>
			<view class="leading-loose">
				{{text2}}
			</view>
		</view>
		<view class="max-w-[750px] fixed bottom-[50rpx] w-4/5 ml-[10%]">
			<u-button type="primary" @click="submitHandle"> {{t('common.confirm')}} </u-button>
		</view>

	</view>
</template>

<script lang="ts" setup>
	import { reactive, ref } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	import { t } from '@/utils/util'
	
	const text1 = ref('')
	const text2 = ref('')
	
	
	let type_arr = [{
		text1: t('orderDetail.rechargeSuccess'),
		text2: t('orderDetail.rechargeSuccessTips')
	}, {
		text1: t('orderDetail.withdrawSuccess'),
		text2: t('orderDetail.withdrawSuccessTips')
	}, {
		text1: t('orderDetail.vipOpenSuccess'),
		text2: ""
	}, {
		text1: t('orderDetail.bindSuccess'),
		text2: ""
	}]
	

	const submitHandle = () => {
		let canNavBack = getCurrentPages()
		if( canNavBack && canNavBack.length>1) {  
		    uni.navigateBack({
		    	delta: 2
		    });
		} else {  
		    history.back();  
		}
	}
	onLoad((options : any) => {
		text1.value = type_arr[options.type]['text1'];
		text2.value = type_arr[options.type]['text2'];
	})
</script>

<style lang="scss">
	.type-primary {
		color: $u-type-primary;
	}
</style>