<template>
	<view style="padding-top: 80px;">
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<view class="dis-flex top-nav">
			<view class="back" @click="back"></view>
			<!-- <view class="dis-flex input-box">
				<uni-icons type="search"></uni-icons>
				<input type="text" placeholder="请输入关键字进行搜索">
			</view> -->
			<view class="title">
				热搜榜单
			</view>
			<view style="width: 40px;"></view>
		</view>
		<view class="">
			<view class="list-box">
				<view class="title">热搜</view>
				<view class="list-content">
					<view class="dis-flex list-item" v-for="(item, index) in hotSearchData" @click="toSubject(item)">
						<view class="" :class="index<3?'red':'yellow'">{{index+1}}</view>
						<view class="text11">{{item}}</view>
						<view class="red_bg" v-if="index<2">热</view>
						<view class="yellow_bg" v-else-if="index<4">新</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import App from '@/common/js/app.js';
export default {
	data() {
		return {
			hotSearchData:[]
		};
	},
	onShow() {
		this.getinfoHot();
	},
	methods: {
		back(){
			uni.navigateBack({
				delta: 1
			})
		},
		toSubject(t){
			uni.navigateTo({
				url:"/pagesA/commentSubject/commentSubject?keyword="+t
			})
		},
		// 热门话题
		getinfoHot(){
			let _this = this;
			App._post_form('&do=GetPlatformInfor&type=2', {}, res => {
				_this.setData({
					hotSearchData: res.data.data
				});
			}, false, () => {
				
			})
		},
	}
}
</script>

<style lang="scss" scoped>
.status_bar {
	width: 100%;
	height: var(--status-bar-height);
	padding-bottom: 15px;
	background-color: #fff;
	position: fixed;
	top: 0px;
	z-index: 99;
}
.dis-flex{
	display: flex;
	align-items: center;
}
.top-nav{
	width: 100vw;
	position: fixed;
	top: 40px;
	background: #fff;
	border-bottom: 1px solid #efefef;
	z-index: 99;
	.back{
		width: 40px;
		height: 40px;
		position: relative;
	}
	.back::before{
		content: '';
		position: absolute;
		top: 24rpx;
		left: 45rpx;
		width: 10px;
		height: 10px;
		border-top: 2px solid transparent;
		border-left: 2px solid #333;
		border-right: 2px solid transparent;
		border-bottom: 2px solid #333;
		transform: rotate(45deg);
	}
	.input-box{
		width: 56vw;
		height: 30px;
		padding: 0 10px;
		background-color: #f3f3f3;
		border-radius: 15px;
		font-size: 14px;
	}
	.title{
		text-align: center;
		flex: 1;
	}
}

.list-box{
	padding: 20rpx;
	.title{
		text-align: center;
		font-size: 18px;
		font-weight: bold;
		margin: 10px;
	}
	.list-item{
		line-height: 70rpx;
		justify-content: space-between;
		border-bottom: 1px solid #efefef;
	}
	.text11{
		flex: 1;
	}
	.red{
		color: #f00;
		margin-right: 10px;
	}
	.yellow{
		color: #ffd900;
		margin-right: 10px;
	}
	.red_bg, .yellow_bg{
		width: 22px;
		height: 22px;
		line-height: 22px;
		color: #fff;
		text-align: center;
		border-radius: 4px;
		font-size: 14px;
	}
	.red_bg{
		background-color: #f00;
	}
	.yellow_bg{
		background-color: #ffd900;
	}
}
</style>
