<template>
	<!-- 黑名单页面 -->
	<view class="page-container">

		<!-- 导航栏 -->
		<wd-navbar title="账户状态" safeAreaInsetTop :bordered="false"></wd-navbar>
		<!-- 主要内容区域 -->
		<view class="content-wrapper">
			<!-- 状态图标 -->
			<view class="status-icon-wrapper">
				<view class="icon-bg">
					<wd-icon name="warning" size="100rpx" color="#fff"></wd-icon>
				</view>
			</view>
			<!-- 标题 -->
			<view class="title-text">账户已被限制</view>
			<!-- 描述信息 -->
			<view class="description-text">
				<text>{{blackInfo.content}}</text>
			</view>
			<!-- 联系客服卡片 -->
			<view class="contact-card-new">
				<!-- <view class="contact-header">
					<uv-icon name="server-man" size="36rpx" color="#389054"></uv-icon>
					<text class="header-title">联系我们</text>
				</view> -->
				<view class="contact-body">
					<view class="contact-item-new">
						<image class="item-img" :src="blackInfo.qrCode" mode="widthFix"></image>
					</view>
				</view>
				<view class="contact-footer">
					<wd-icon name="time" size="28rpx" color="#999"></wd-icon>
					<text class="footer-text">服务时间：{{blackInfo.date}}</text>
				</view>
			</view>


		</view>





		<!-- 底部提示 -->
		<view class="footer-tips">
			<view class="tip-card">
				<uv-icon name="info-circle" size="32rpx" color="#f9ae3d"></uv-icon>
				<view class="tip-content">
					<view class="tip-title">温馨提示</view>
					<view class="tip-text">账户异常可能由违规操作、安全风险等原因导致，请您理解与配合。</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import {
		ref,
		onMounted
	} from "vue";

	interface blackObj {
		//商品ID
		status : number
		content : string
		//客服二维码路径  
		qrCode : string
		//服务时间  
		date : string
	}
	const blackInfo = ref<blackObj>({});
	onMounted(() => {
		uni.getStorage({
			key: 'blackInfo',
			success: (res) => {
				console.log(res.data);
				blackInfo.value = res.data;
			}
		})
	})
	// // 客服电话
	// const phoneValue = ref("");

	// // 拨打客服电话
	// const makePhoneCall = () => {
	//   // 检查电话号码是否存在
	//   if (!phoneValue.value) {
	//     uni.showToast({
	//       title: "暂未获取到客服电话",
	//       icon: "none",
	//     });
	//     return;
	//   }

	//   uni.makePhoneCall({
	//     phoneNumber: phoneValue.value,
	//     success: () => {
	//       console.log("成功发起拨打电话");
	//     },
	//     fail: (err) => {
	//       console.error("拨打电话失败:", err);
	//       uni.showToast({
	//         title: "拨打电话功能暂不可用",
	//         icon: "none",
	//       });
	//     },
	//   });
	// };

	// // 处理联系客服操作
	// const handleContactService = () => {
	//   // 添加触觉反馈，提升用户体验
	//   uni.vibrateShort && uni.vibrateShort();
	//   makePhoneCall();
	// };

	// // 获取远程设置，例如客服电话
	// const getSetting = async () => {
	//   try {
	//     const { kefu } = await useHttp("/api/setting");
	//     if (kefu && kefu.kefu_mobile) {
	//       phoneValue.value = kefu.kefu_mobile;
	//     } else {
	//       console.warn("未获取到客服电话");
	//     }
	//   } catch (e) {
	//     console.error("获取配置失败", e);
	//   }
	// };

	// // 页面加载时获取设置
	// getSetting();
</script>

<style lang="scss" scoped>
	.page-container {
		min-height: 100vh;
		background: linear-gradient(180deg, #f0f8f2 0%, #ffffff 40%);
		display: flex;
		flex-direction: column;
	}

	.content-wrapper {
		// flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 40rpx;
		box-sizing: border-box;

		.status-icon-wrapper {
			margin-top: 60rpx;
			margin-bottom: 40rpx;
			position: relative;

			.icon-bg {
				width: 160rpx;
				height: 160rpx;
				border-radius: 50%;
				background: linear-gradient(145deg, #ff7575, #dd524d);
				box-shadow: 0 10rpx 30rpx rgba(221, 82, 77, 0.4);
				display: flex;
				justify-content: center;
				align-items: center;
				animation: pulse 2s infinite;
			}
		}

		.title-text {
			font-size: 48rpx;
			font-weight: bold;
			color: #303133;
			margin-bottom: 24rpx;
		}

		.description-text {
			font-size: 30rpx;
			color: #606266;
			line-height: 1.6;
			text-align: center;
			margin-bottom: 60rpx;
			padding: 0 20rpx;
		}

		.contact-card-new {
			width: 100%;
			background-color: #fff;
			border-radius: 24rpx;
			padding: 32rpx;
			box-sizing: border-box;
			box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.08);
			// margin-bottom: 60rpx;

			.contact-header {
				display: flex;
				align-items: center;
				margin-bottom: 32rpx;

				.header-title {
					font-size: 36rpx;
					font-weight: bold;
					color: #303133;
					margin-left: 16rpx;
				}
			}

			.contact-body {
				display: flex;
				flex-direction: column;
				gap: 16rpx;
			}

			.contact-item-new {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 24rpx;
				background-color: #f7f8fa;
				border-radius: 16rpx;
				transition: all 0.2s ease;

				&:active {
					background-color: #f2f3f5;
				}

				.item-image {
					width: 100%;

				}
			}

			.contact-footer {
				display: flex;
				align-items: center;
				justify-content: center;
				padding-top: 24rpx;
				margin-top: 24rpx;
				border-top: 1rpx solid #f2f3f5;

				.footer-text {
					font-size: 26rpx;
					color: #909399;
					margin-left: 12rpx;
				}
			}
		}
	}

	.footer-tips {
		padding: 0 40rpx 40rpx;
		box-sizing: border-box;

		.tip-card {
			display: flex;
			align-items: flex-start;
			background-color: #fff7e8;
			border-radius: 16rpx;
			padding: 24rpx;

			.tip-content {
				margin-left: 16rpx;

				.tip-title {
					font-size: 28rpx;
					font-weight: bold;
					color: #f29100;
					margin-bottom: 8rpx;
				}

				.tip-text {
					font-size: 26rpx;
					color: #b87a28;
					line-height: 1.5;
				}
			}
		}
	}

	@keyframes pulse {
		0% {
			transform: scale(1);
			box-shadow: 0 10rpx 30rpx rgba(221, 82, 77, 0.4);
		}

		50% {
			transform: scale(1.05);
			box-shadow: 0 15rpx 40rpx rgba(221, 82, 77, 0.6);
		}

		100% {
			transform: scale(1);
			box-shadow: 0 10rpx 30rpx rgba(221, 82, 77, 0.4);
		}
	}
</style>