<template>
	<view class="content">
		<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>

		<view class=" bg-white sticky top-0 z-50 flex items-center" style="height: 9vh;display: flex;justify-content: center;">
			<view class="mr-2">
				<wd-button @click="utils.toUrl('/mall/caiwu/cash/edit')" size="small">提现</wd-button>
			</view>
		</view>

		<view class="grid p-2">

			<yList height="91vh" ref="yListRef" :apiObj="fullDiscountApi.caiwu.cashList" :params="{ ...params }">
				<template #default="{ list }">
					<view>
						<view v-for="item of list" class="goods">
							<wd-card type="rectangle">
								<template #title>
									<view class="title">
										<view>
											<span class="mr-2">ID：{{ item?.id }}</span>
										</view>
										<view style="display: flex;align-items: center;">
											{{ item.create_time }}
											<view class="p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
												<view>
													<wd-button :round="false" size="small"
													  :type="['warning', 'success', 'warning', 'info', 'info'][item.status]">
													  <div>{{ ["待审核", "待打款", "已打款", "已拒绝"][item.status] }}</div>
													</wd-button>
												</view>
											</view>
										</view>
									</view>
								</template>

								<view class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
									<view>
										<template v-if="item.type == 0">
											<div>开户行：{{ item.bank_name }}</div>
											<div>银行卡号：{{ item.bank_code }}</div>
										</template>
										<template v-if="item.type == 1">
											<div>
												<img :src="item.wx_payee_pic" style="width: 30px;" alt="">
											</div>
										</template>
										<template v-if="item.type == 2">
											<div>{{ item.ali_code }}</div>
										</template>
									</view>
									<view style="font-weight: bold;font-size: 32rpx;color: #19be6b;">
										{{ item.cash_price }}
									</view>
								</view>
								
								
								
								
								<view v-if="item.auditing_desc" class="bg-gray-50 p-2 mb-2 flex justify-between" style="font-size: 22rpx;">
									<view>
										<span class="mr-2 warn-state warn-status-processing bg-yellow-600"></span>
										审核备注：{{ item.auditing_desc }}
									</view>
								</view>
								
							</wd-card>
						</view>
					</view>
				</template>
			</yList>

		</view>

		<wd-toast />
		<wd-message-box></wd-message-box>
	</view>
</template>

<script setup>
	import {
		ref,
		nextTick
	} from 'vue';
	import utils from '@/utils/utils.js';
	import fullDiscountApi from '@/api/mall/discount.js';
	import kevyloading from "@/components/kevy-loading/kevy-loading";
	import yList from "/components/yList/index.vue";

	import {
		onShow,
	} from "@dcloudio/uni-app";

	const yListRef = ref(null);

	const popover = ref(false);

	const params = ref({
		name: null,
		price: null,
		send_type: null
	});

	/** 
	 * @type {Ref<boolean>} 
	 * 控制页面加载状态的 Ref
	 */
	const loading = ref(false);

	// 初始化调用获取一行数据
	onShow(() => {

	})
</script>

<style lang="scss" scoped>
	.search-type {
		position: relative;
		height: 30px;
		line-height: 30px;
		padding: 0 8px 0 16px;
		font-size: 24rpx;
		color: rgba(0, 0, 0, .45);
	}

	.search-type::after {
		position: absolute;
		content: '';
		width: 1px;
		right: 0;
		top: 5px;
		bottom: 5px;
		background: rgba(0, 0, 0, 0.25);
	}

	.search-type {
		:deep(.icon-arrow) {
			display: inline-block;
			font-size: 20px;
			vertical-align: middle;
		}
	}


	.couponBox,
	.title {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}

	.couponBox {
		justify-content: flex-start;
	}

	.title {
		justify-content: space-between;
	}

	.title-tip {
		color: rgba(0, 0, 0, 0.25);
		font-size: 12px;
	}
</style>