<template>
	<view class="app">
		<image src="../../static/pagesB/xinjianwenzhen.png" mode="" @tap='gocreatenewconsultation'></image>
		<view class="title">
			<view class="text" v-for='(item,index) in titlelist' :key='index'
				:class="titletext==item.text?'Selectedtext':''" @tap='selecttitltext(item)'>
				{{item.text}}
			</view>
		</view>
		<view class="list">
			<view class="item">
				<view class="time">
					2023-12-12 12:12
				</view>
				<image src="../../static/pagesB/Behave.png" mode=""></image>
				<view class="name">
					张三
				</view>
				<view class="text">
					你好，请问今天下午方便吗
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				titletext: '本周全部',
				titlelist: [{
						text: '本周全部',
					},
					{
						text: '已解答',
					},
					{
						text: '未解答',
					},
				],
			};
		},
		methods: {
			//选择
			selecttitltext(item) {
				this.titletext = item.text
			},
			//新建图文咨询
			gocreatenewconsultation() {
				uni.navigateTo({
					url: "/pagesB/createnewconsultation/createnewconsultation"
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F4F5F7;
	}

	.app {
		width: 96%;
		margin: 20rpx auto;
		padding: 20rpx 0;
		background: #FFFFFF;
		box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
		border-radius: 5rpx;

		.list {
			width: 94%;
			margin: 0 auto;

			.item {
				width: 100%;
				position: relative;
				height: 300rpx;
				background: #F6F6F6;
				border-radius: 5rpx;

				.text {
					position: absolute;
					left: 190rpx;
					top: 180rpx;
					font-size: 28rpx;
					font-weight: 400;
					color: #5F5F5F;
					padding-right: 20rpx;
					text-overflow: -o-ellipsis-lastline;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					line-clamp: 2;
					-webkit-box-orient: vertical;
					white-space: normal;
					word-break: break-all;
				}

				.name {
					position: absolute;
					left: 190rpx;
					top: 120rpx;
					font-size: 32rpx;
					font-weight: 500;
					color: #000000;
				}

				.time {
					width: 100%;
					padding-left: 20rpx;
					height: 80rpx;
					line-height: 80rpx;
					border-bottom: 2rpx solid #DADADA;
					font-size: 26rpx;
					font-weight: 400;
					color: #5F5F5F;
				}

				image {
					position: absolute;
					left: 20rpx;
					top: 110rpx;
					width: 150rpx;
					height: 150rpx;
				}
			}
		}

		.title {
			text-align: center;
			width: 94%;
			margin: 30rpx auto;
			display: flex;

			.text {
				margin-right: 20rpx;
				height: 70rpx;
				line-height: 70rpx;
				background: #FFFFFF;
				border: 1px solid #26A888;
				border-radius: 5rpx;
				width: 25%;
				color: #26A888;
			}

			.Selectedtext {
				color: #fff;
				background: #26A888 !important;
			}
		}

		image {
			width: 94%;
			display: block;
			margin: 0 auto;
			height: 130rpx;
		}
	}
</style>