<template>
	<view class="inspage-content" :style="{'--status-bar-': statusBarHeight}">
		<view class="inspage-content-info">
			<!-- 头部主要内容 开始 -->
			<view class="inspage-content-header">	
				<customNavbar 
				title="提示" 
				bgColor="var(--gd-bgm-color)"
				:contentStyle="{ color: '#fff' }"
				:left-style="{ color: '#fff' }"
				></customNavbar>
			</view>
			<!-- 头部主要内容 结束 -->
			
			<!-- userInfo内容 开始 -->
			
			<view class="inspage-content-userinfo">
				<text>{{ withdrawStatus(retailStatistics.status) }}</text>
				<text>￥2000</text>
				<view>
					<view>
						<text>服务费</text>
						<text>￥{{ retailStatistics && retailStatistics.servicePrice }}</text>
					</view>
					<view>
						<text>到账账户</text>
						<text>{{ withdrawType(retailStatistics.withdrawType) }}</text>
					</view>
				</view>
			</view>
			<!-- userInfo内容 结束 -->
		</view>
	</view>
</template>

<script>
	import { navigateTo } from "@/utils/util.js"
	export default {
		data() {
			return {
				title: '提示',
				statusBarHeight: 0, // 状态栏安全距离
				tool: [ // 我的工具
					{ title: "邀请总人数",num: 0,decimals:0 },
					{ title: "待核销",num: 0,decimals:2 },
					{ title: "已核销",num: 0,decimals:2 },
				],
				retailStatistics: {}, // 统计信息
				params: {}
			}
		},
		onLoad(e) {
			this.params = e
		},
		onShow() {
			this.statusBarHeight = getApp().globalData.statusBarHeight
			this.orderWithdrawSelectById()
		},
		methods: {
			/**
			 * @author ygh
			 * @data 2023-12-20
			 */
			navigateToFun(item){
				navigateTo(item.url)
			},
			/**
			 * 数字显示格式化
			 *
			 */
			numFormat(num=0) {
				if(num<100000) {
					return num
				}else if(num>100000){
					return (num/10000).toFixed(2)
				}
			},
			/** 获取数据 */
			async orderWithdrawSelectById(){
				try{
					let res = await this.$u.api.orderWithdrawSelectById({
						noSign: 1,
						userid: this.distribution_user_info.userId,
						id: this.params.id
					})
					
					if(res && res.code ===200) {
						this.retailStatistics = res.data
					} 
				}catch(e){
					//TODO handle the exception
					console.error("e===",e)
				}
			},
			withdrawType(type){
				let src = ''
				switch(type) {
					case 'wechat': src="微信零钱"; break;
					case 'bank': src="银行卡"; break;
				}
				return src
			},
			/**
			 * 申请状态
			 */
			withdrawStatus(type){
				let src = ''
				switch(type) {
					case '0': src="正在提现,请耐心等待!"; break;
					case '1': src="提现成功!"; break;
					case '2': src="提现失败!"; break;
				}
				return src
			},
		}
	}
</script>

<style lang="scss" scoped>
	.inspage-content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		--header-h: 90rpx;
		.inspage-content-info {
			width: 100%;
			box-sizing: border-box;
		}
	}
	/** 头部主要内容 开始 */
	.inspage-content-header {
		width: 100%;
		height: var(--header-h);
		box-sizing: border-box;
		::v-deep .u-search {
			padding: 0 30rpx !important;
		}
		::v-deep .u-search__action {
			color: #fff !important;
		}
	}
	/** 头部主要内容 结束  **/
	
	/** userInfo内容 开始 */
	.inspage-content-userinfo {
		width: 100%;
		padding: 24rpx 40rpx 0;
		box-sizing: border-box;
		>text {
			width: 100%;
			display: flex;
			justify-content: center;
		}
		>text:nth-child(1) {
			padding: 50rpx 0 100rpx;
			font-size: 32rpx;
		}
		>text:nth-child(2) {
			padding: 50rpx 0 100rpx;
			color: var(--gd-bgm-color);
			font-size: 52rpx;
		}
		>view {
			padding-top: 50rpx;
			color: #606060;
			font-size: 24rpx;
			>view {
				padding-bottom: 20rpx;
				width: 100%;
				display: flex;
				justify-content: space-between;
			}
		}
	}
	/** userInfo内容 结束  **/
</style>
