<template>
	<view class="center">

		<view class="fleet_info">
			<view class="fleet_img">
				<u-swiper :list="imgList" height="200" indicator></u-swiper>
			</view>
			<view>{{fleetInfo.fleetName}}</view>
			<view>{{fleetInfo.province}}{{fleetInfo.city}}{{fleetInfo.area}}</view>
			<view>车队简介</view>
			<u--textarea v-model="fleetInfo.notice" placeholder="输入公告文字,0-500字" disabled autoHeight >
			</u--textarea>
			<view>车队简介</view>
			<u--textarea v-model="fleetInfo.fleetProfile" placeholder="输入公告文字,0-500字" disabled maxlength="500" autoHeight count>
			</u--textarea>
			<view>车队成员（{{fleetInfo.fleetMemberNum}}）</view>
			<view class="flex">
				<view margin v-for="(item,index) in fleetInfo.fleetMemberInfoList" >
					<u--image class="flex-end" :showLoading="true" :src="item.driverPortrait" width="50px" height="50px"
						shape='circle'>
					</u--image>
				</view>
			</view>
		</view>
		<chunLei-popups v-model="value" :popData="dataList" @tapPopup="tapPopup" :x="344" :y="20" placement="top-end">
		</chunLei-popups>
	</view>
</template>

<script>
	import chunLeiPopups from "@/components/chunLei-popups/chunLei-popups.vue";
	export default {
		components: {
			chunLeiPopups
		},
		data() {
			return {
				value: false,
				imgList:[],
				type:"",
				dataList: [{
						title: '设置',
						icon: '../../static/chuangjianqunliao-lan.png',
						src: '/pages/riders/addFleet',
						// disabled: true
						show: true
					},
					{
						title: '发公告',
						icon: '../../static/tianjiahaoyou.png',
						src: '/pages/riders/notice',
						show: true
					},
					{
						title: '删除成员',
						icon: '../../static/scan_icon.png',
						show: true
					},
					{
						title: '转移队长',
						icon: '../../static/zhifeiji.png',
						show: true
					},
					{
						title: '退出车队',
						icon: '../../static/shoufukuan.png',
						show:true
					},
					{
						title: '举报',
						icon: '../../static/shoufukuan.png',
						src: "/pages/riders/report",
						show:true,
					}
				],
				id: "",
				fleetInfo: {},
				more: false,
			}
		},
		onShow() {
			this.getList()
		},
		onLoad(options) {
			this.id = options.id
			this.type = options.type
			if(!this.type){
				for(let i = 0 ; i < this.dataList.length - 2 ; i++){
					 this.dataList[i].show = false
				}
			}
			this.getList()
		},
		onNavigationBarButtonTap(e) {
			this.value = true
		},
		methods: {
			clickRightIcon() {
				this.value = true
			},
			tapPopup(e) {
				this.$u.route(e.src, {
					id: this.id
				})
				// uni.showToast({
				// 	title:e.title,
				// 	icon:'none'
				// })
			},
			returnPage() {
				this.$u.route("/pages/riders/myTeam")
			},
			getList() {
				this.$request.baseRequest('get', '/fleetInfo/getFleetInfo', {
						id: this.id
					}).then(res => {
						this.fleetInfo = res.data
						if(this.fleetInfo.fleetUrl){
							this.imgList = this.fleetInfo.fleetUrl.split(",")
						}else{
							this.imgList = this.fleetInfo.coverUrl.split(",")
						}
						
					})
					.catch(res => {
						uni.$u.toast(res.message);
					});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.center {
		.top {
			margin-top: 20rpx;
			width: 100%;

			.top_left {
				width: 50%;
			}

			.top_right {
				width: 50%;
				text-align: right;
				margin-right: 20rpx;
			}
		}
	}

	.fleet_info {
		.fleet_img {
			width: 100%;

		}
	}
</style>
