<template>
	<view class="">
		<view class="sort">
			<view class="sortItem" :style="{color:current==1?'#A5CF49':'#333333'}" @click="sort(1)">
				<text>平台资讯</text>
				
			</view>
			<view class="sortItem" @click="sort(2)" :style="{color:current==2?'#A5CF49':'#333333'}">
				<text>平台规则</text>
				
			</view>
		</view>
		<view class="notice">
			<u-notice-bar :text="text1" color="#fff" bgColor="#A5CF49" fontSize='16'></u-notice-bar>
		</view>
		<view class="content">
			<u-parse v-if="current==1" :content="platform_information"></u-parse>
			<u-parse v-else :content="platform_rules"></u-parse>
		</view>
		
	</view>

	
</template>

<script setup>
	import {
		onLoad,
		onShow,
		onPullDownRefresh
	} from "@dcloudio/uni-app";
	import zpTooltip from '../../uni_modules/zb-tooltip/components/zb-tooltip/zb-tooltip.vue'
	import {
		ref
	} from "vue"
	import {getplatformeditor,getnoticelist,getplatformmeun} from '@/utils/api.js'
	let platform_information=ref('')
	let platform_rules=ref('')
	onLoad(() => {
		getplatformmeun().then(res=>{
			uni.setNavigationBarTitle({
				title: res.data.name
			});
		})
	getplatformeditor().then(res=>{
		platform_information.value=res.data.platform_information
		platform_rules.value=res.data.platform_rules
	})
	// getnoticelist(3).then(res=>{
	// 	let data=res.data
	// 	data.forEach(item=>{
	// 		text1.value=text1.value+'   '+item.content
	// 	})
	// })
	text1.value=getApp().globalData.config.infomation_notice
	})
	onShow(() => {

	})

	let  text1=ref('')
	let current = ref(1)
	let sort = (type) => {
		if (current.value != type) {
			current.value = type
			
		} 
	}
	
	onPullDownRefresh(() => {
		setTimeout(function() {
			uni.stopPullDownRefresh();
		}, 1000);
	})
</script>


<style lang="scss">
	.content{
		background-color: #fff;
		padding: 40rpx 28rpx;
	}
	.accountList{
		background-color: #FFFFFF;
		.accountItem{
			border-bottom: 1rpx solid #F5F5F5;
			display: flex;
			padding: 24rpx;
			align-items: center;
			image{
				width: 188rpx;
				max-height: 188rpx;
				border-radius: 10rpx;
				margin-right: 26rpx;
			}
			.introduction{
				flex: 1;
				
				.title{
					color: #666666;
					font-size: 28rpx;
				}
				.u-fade-enter-active{
					margin-top: 0;
					padding: 10rpx;
				}
				.price{
					color: #FF2828;
					font-size: 24rpx;
					text{
						font-size: 40rpx;
						font-weight: bold;
					}
				}
			}
		}
	}
	
	.btnBox {
		margin-top: 100rpx;
		display: flex;
		justify-content: right;

		button {
			margin: 0;
			margin-left: 40rpx;
			padding: 0;
			width: 206rpx;
			height: 80rpx;
			line-height: 80rpx;
			background: #F5F5F5;
			border-radius: 40rpx;
			font-size: 24rpx;
		}

		.btn1 {

			background: #F5F5F5;
		}

		.btn2 {

			background: #A5CF49;
			color: #fff;
		}
	}

	.labelItem {
		.label {
			font-size: 24rpx;
			font-weight: bold;
			margin: 24rpx 0 10rpx;
		}

		.value {
			.codeInput {
				font-size: 24rpx;
				width: 562rpx;
				height: 68rpx;
				line-height: 68rpx;
				background: #F5F5F5;
				border-radius: 20rpx;
				padding: 0 24rpx;
			}
		}

		.value1 {
			display: flex;
			align-items: center;
			justify-content: space-between;

			input {
				font-size: 24rpx;
				text-align: center;
				width: 231rpx;
				height: 68rpx;
				line-height: 68rpx;
				background: #F5F5F5;
				border-radius: 20rpx;
				padding: 0 24rpx;
			}
		}
	}

	.popup {
		padding: 0 40rpx;
		font-size: 24rpx;

		.item {
			line-height: 90rpx;
			border-bottom: 1rpx solid #F5F5F5;

		}
	}

	.popup1 {
		padding: 0 40rpx 40rpx;
	}

	::v-deep .u-checkbox {
		span {
			font-size: 24rpx !important;
		}

		margin-right: 20rpx;
	}

	::v-deep .u-radio {
		span {
			font-size: 24rpx !important;
		}

		margin-right: 20rpx;
	}

	::v-deep .u-fade-enter-active {
		margin-top: 89px;
	}

	::v-deep .u-slide-down-enter-to {
		top: 89px !important;
	}

	.select {
		transform: rotate(180deg);
	}

	page {
		.sort {
			border-top: 1rpx solid #F2F2F2;
			width: 750rpx;
			height: 88rpx;
			line-height: 88rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.1);
			display: flex;

			.sortItem {
				flex: 1;
				display: flex;
				justify-content: center;

				text {
					margin-right: 16rpx;
				}
			}
		}
	}
</style>
