<template>
	<view class="w-body">
		<w-public />
		<w-navbar fixed title=""></w-navbar>
		<view class="msg" v-if="!data.ok">
			<view><u-icon name="checkmark-circle-fill" color="var(--w-error)" size="100"></u-icon></view>
			<view style="font-size: 20px; line-height: 2;">{{ data.msg || '操作失败' }}</view>
		</view>
		<view class="msg" v-else>
			<view><u-icon name="checkmark-circle-fill" color="var(--w-success)" size="100"></u-icon></view>
			<view style="font-size: 20px; line-height: 2;">{{ data.msg || '操作成功' }}</view>
		</view>
		<view style="width: 50%; margin: auto;"><u-button text="返回" @click="if(data.to){$w.to(data.to);}else{$w.back(2);}"></u-button></view>
	</view>
</template>

<script setup>
import { onLoad,onShow } from '@dcloudio/uni-app'
import { ref } from 'vue'

const data = ref({
	ok:true,
	msg:"",
	to:""
});

onLoad((e=>{
	data.value.ok = e.ok?('true'==e.ok):true;
	data.value.msg = e.msg;
	data.value.to=e.to;
	
}));

</script>

<style lang="scss" scoped>
.w-body{
	--navbar-height:44px;
	
	.msg {
		width:100%;
		box-sizing: border-box;
		padding-top: 20px;
		aspect-ratio: 1/1;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
}
</style>
