<template>
	<view class="container">
		<custom-navbar title="解绑记录" :leftImg="'/static/images/whiteBack.png'" :showUser="true"
			backgroundColor="linear-gradient( 134deg, #F52540 0%, #E8101E 100%)" titleColor="#fff"
			borderBottom="none"></custom-navbar>
		<searchBox placeholder="手艺人名称" v-model="queryData.str_val" :showAdd="false" @confirm="search" @search="search" />
		<CommonList ref="groupRef" apiUrl="/sj/getUnbindReadList"
			:listScrollHeight="`calc(100vh - ${statusBarHeight + 302}rpx)`">
			<template #listData="{ list }">
				<view class="service-list">
					<view class="service-item flex-row-end-between" v-for="(item, index) in list" :key="index">
						<view class="item-left flex-row-start">
							<image class="item-left-photo" :src="item.head_photo" mode="aspectFill"></image>
							<view class="item-left-texts">
								<view class="item-left-text1">
									{{ item.name }}
								</view>
								<view class="flex-row-center">
									<text class="item-left-text2">解绑时间:{{ item.update_time }}</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</template>

			<!-- 空数据状态 -->
			<template #empty>
				<noData></noData>
			</template>
		</CommonList>
	</view>
</template>

<script>
	import request from "@/utils/request";
	import searchBox from "./components/search-box.vue";
	import CommonList from "@/components/common/CommonList.vue";
	export default {
		components: {
			searchBox,
			CommonList,
		},
		data() {
			return {
				userInfo: {},
				queryData: {
					str_val: "",
				},
				statusBarHeight: 0,
			};
		},
		async onLoad(options) {
			let type = 3;
			let result = await request.post("/user/getuser", {
				type,
			});
			this.userInfo = result.data;
			this.queryData.sjid = this.userInfo.id;
			this.statusBarHeight = this.getRpxStatusBarHeight();
			this.$nextTick(() => {
				this.search();
			});
		},
		methods: {
			search() {
				this.$refs.groupRef.manualRefresh(this.queryData);
			},
			goSlectSyr(item) {
				uni.navigateTo({
					url: `/pages/shop/staff/selectSyr?server_id=${item.id}`,
				});
			},
		},
	};
</script>

<style lang="less">
	.container {
		.container-tip {
			width: 750rpx;
			padding: 27rpx 16rpx 22rpx 32rpx;
			background: #fae7ec;

			.container-tip-text {
				font-weight: 400;
				font-size: 26rpx;
				color: #e8101e;
				line-height: 37rpx;
				text-align: left;
				font-style: normal;
			}

			.tip-icon {
				width: 46rpx;
				height: 46rpx;
				margin-right: 8rpx;
			}
		}

		.service-list {
			// background-color: #fff;
			// margin: 20rpx 20rpx 26rpx 20rpx;
			// border-radius: 10rpx;

			.service-item {
				//   padding-top: 20rpx;
				//   margin: 0rpx 20rpx 30rpx 20rpx;
				//   padding-bottom: 30rpx;
				//   border-bottom: 1rpx solid #f1f1f1;
				padding: 30rpx 20rpx;
				margin: 20rpx;

				background: #FFFFFF;
				border-radius: 10rpx;

				.item-left {
					.item-left-photo {
						width: 100rpx;
						height: 100rpx;
						border-radius: 20rpx;
						border-radius: 50%;
					}

					.item-left-texts {
						margin-left: 20rpx;

						.item-left-text1 {
							font-weight: 500;
							font-size: 28rpx;
							color: #333333;
							line-height: 40rpx;
							text-align: left;
							font-style: normal;
							margin: 10rpx 0;
						}

						.item-left-text2 {
							font-weight: 400;
							font-size: 24rpx;
							color: #666666;
							line-height: 33rpx;
							text-align: left;
							font-style: normal;
						}

						.item-left-line {
							margin: 0 10rpx;
							width: 2rpx;
							height: 20rpx;
							background: #666666;
						}
					}
				}

				.item-right {
					width: 124rpx;
					height: 53rpx;
					border-radius: 27rpx;
					border: 1rpx solid rgba(232, 16, 30, 0.5);
					font-size: 24rpx;
					color: #e8101e;
					text-align: left;
					font-style: normal;
				}
			}
		}
	}

	.common-list {
		background: #f5f5f5 !important;
		border-radius: 30rpx !important;
		padding-bottom: 0 !important;
	}

	::v-deep .list-container {
		padding: 0 !important;
	}

	::v-deep .list-scroll {
		margin-top: 0 !important;
	}
</style>