<template>
	<view class="pages">
		<view class="" :style="{height: navHeight+'px' }"></view>
		<view class="navbar-box">
			<u-navbar title="演职人员" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#000'}" leftIconColor="#000" bgColor="#fff"></u-navbar>
		</view>
		<view class="page-wrap">
			<!-- <view class="title">演员信息</view> -->
			<view class="list">
				<view class="item" v-for="(item, index) in actorsArr" :key="index">
					<image class="img" :src="item.performerHead||staticUrl+'/img/actors.png'"></image>
					<view class="text">
						<view class="name">{{item.performerName}}</view>
						<view class="role u-line-1">{{item.performerRole}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { systemInfo } from "@/mixin.js";
	export default {
		mixins:[systemInfo],
		data() {
			return {
				staticUrl:this.$commonConfig.staticUrl,
				performId:'',
				actorsArr:[],
				params:{
					
				}
				
			}
		},
		onShow() {
		},
		onLoad(page) {
			console.log('page',page);
			this.performId = page.performId;
			this.getActors();
			this.getSystemInfo();
		},
		methods: {
			leftClick(e){
				let pages = getCurrentPages();
				if(pages.length==1){
					uni.$u.route('/pages/index/index')
				}else{
					uni.navigateBack()
				};
			},
			getActors(){
				this.$u.api.actorsList({performId:this.performId}).then(res=>{
					console.log('actorsList',res.data);
					this.actorsArr =  res.data.list;
				}).catch(err=>{
					console.log('actorsList',err);
				})
			},

		}
	}
</script>
<style>
page{
	background-color: #F7F8F9;
}
</style>
<style lang="scss" scoped>
.page-wrap{
	margin-top: 44rpx;
}
.title{
	font-size: 28rpx;
	font-weight: 400;
	color: #7F7F7F;
	line-height: 42rpx;
	margin-bottom: 40rpx;
}
.list{
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24rpx;
	.item{
		text-align: center;
		background: #FFFFFF;
		border-radius: 20rpx;
		padding: 12rpx;
	}
	.img{
		display: block;
		width: 100%;
		height: 200rpx;
		margin-bottom: 16rpx;
	}
	.name{
		font-size: 28rpx;
		font-weight: 500;
		color: #2D2D2D;
		line-height: 42rpx;
		margin-bottom: 4rpx;
	}
	.role{
		font-size: 24rpx;
		font-weight: 400;
		color: #7F7F7F;
		line-height: 36rpx;
	}
}
</style>