<template>
	<view class="app">
		<view class="body">
			<view class="left">
				<u-collapse :accordion='false' :arrow="false">
					<u-collapse-item :title="item.head" v-for="(item, index) in itemlistleft" :key="index"
						:class="item.check?'headcollapse':''" @change='tapcollapseleft(item)'>
						<!-- {{item.body}} -->
						<view class="itemtext">
							<view class="left">
								2222222222
							</view>
						</view>
						<!-- 		<view class="itemtext" v-for="uitem in item.list">
							<view class="left">
								{{uitem.happentime}}
							</view>
						</view> -->
					</u-collapse-item>
				</u-collapse>

			</view>
			<view class="right">
				<u-collapse :item-style="itemStyle" :arrow="false" :accordion='false'>
					<u-collapse-item :title="item.head" v-for="(item, index) in itemList" :key="index"
						@change='tapcollapse(item)' :class="item.check?'headcollapse':''">
						<!-- {{item.body}} -->
						<view class="itemtext">
							<view class="collapse_top" v-for="uitem in item.ptValList">
						<!-- 		<u-icon name="star-fill" color="#000" size="28"></u-icon>
								<span style="margin-left: 10rpx;">健康生活方式</span> -->
								<view class="itemsdata">
									<view class="itemword">
										<u-checkbox v-model="checked">	{{uitem.formName}}</u-checkbox>
									</view>
									<!-- <view class="itemword">
										<u-checkbox v-model="checked">测试345353535</u-checkbox>
									</view>
									<view class="itemword">
										<u-checkbox v-model="checked">测试345353535</u-checkbox>
									</view> -->
								</view>
							</view>

						</view>
					</u-collapse-item>
				</u-collapse>

			</view>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				checked: true,
				itemlistleft: [{
					head: "赏识在于角度的转换",
					body: "只要我们正确择取一个合适的参照物乃至稍降一格去看待他人，值得赏识的东西便会扑面而来",
					open: true,
					disabled: true
				}, {
					head: "生活中不是缺少美，而是缺少发现美的眼睛",
					body: "学会欣赏，实际是一种积极生活的态度，是生活的调味品，会在欣赏中发现生活的美",
					open: false,
				}],


				itemList: [{
					head: "赏识在于角度的转换",
					body: "只要我们正确择取一个合适的参照物乃至稍降一格去看待他人，值得赏识的东西便会扑面而来",
					open: true,
					disabled: true
				}, {
					head: "生活中不是缺少美，而是缺少发现美的眼睛",
					body: "学会欣赏，实际是一种积极生活的态度，是生活的调味品，会在欣赏中发现生活的美",
					open: false,
				}, {
					head: "周围一些不起眼的人、事、物，或许都隐藏着不同凡响的智慧",
					body: "但是据说雕刻大卫像所用的这块大理石，曾被多位雕刻家批评得一无是处，有些人认为这块大理石采凿得不好，有些人嫌它的纹路不够美",
					open: false,
				}],

			}
		},
		methods: {
			tapcollapse(item) {
				item.check = !item.check
			},
			tapcollapseleft(item){
				item.check = !item.check
				
			}

		}
	}
</script>

<style lang="scss">
	.app {
		height: 100vh;
		background-color: #fff;
		// padding: 100rpx 40rpx;
		text-align: center;
		font-size: 36rpx;

		.body {
			width: 100%;
			height: 100vh;
			display: flex;

			.left {
				height: 100vh;
				width: 30%;
				// background: aliceblue;
				::v-deep .u-collapse-title {
					font-size: 26rpx;
					font-family: Source Han Sans CN;
					font-weight: 500;
					color: #000;
					padding-left: 10rpx;
					font-weight: 600;
				}

				::v-deep .u-collapse-head {
					width: 96%;
					margin: 0 auto;

				}

				.itemtext {
					font-size: 28rpx;
					background: #FFFFFF;
					font-weight: 500;
					color: #333333;
					height: 100rpx;
					padding-left: 10rpx;
					line-height: 100rpx;
					border-bottom: 2rpx solid #E6E6E6;
					margin: 0 auto;
					display: flex;
					justify-content: space-between;
				}

				.headcollapse {
					::v-deep .u-collapse-head {
						border-bottom: 2rpx solid #E6E6E6;
					}

					::v-deep .u-collapse-item {
						padding-bottom: 4rpx;
					}
				}

				::v-deep .u-collapse-head {
					width: 96%;
					margin: 0 auto;
					// background: #169BD5 !important;
					text-align: center;
					color: #fff;
				}

				::v-deep .u-collapse-item {
					// background-color: #4271B9;
					margin-bottom: 2rpx;
				}
			}

			.right {
				height: 100vh;
				width: 70%;

				::v-deep .u-collapse-title {
					font-size: 30rpx;
					font-weight: 600;
					padding-left: 10rpx;
				}

				.headcollapse {
					::v-deep .u-collapse-head {
						border-bottom: 2rpx solid #E6E6E6;
						text-align: center !important;
					}

					::v-deep .u-collapse-title {
						color: #26A888;
					}
				}

				::v-deep .u-collapse-head {
					width: 96%;
					margin: 0 auto;
					background: #169BD5 !important;
					text-align: center;
					color: #fff;
				}

				// background-color: red;
				.itemtext {
					.collapse_top {
						font-size: 30rpx;
						font-weight: 500;
						color: #000;
						width: 94%;
						line-height: 40rpx;
						margin: 0 auto;
						padding: 20rpx 20rpx;

						.itemsdata {
							width: 100%;

							.itemword {
								margin: 15rpx;


							}

						}

					}
				}

			}
		}
	}
</style>