<template>
	<view class="content">
		<view class="zhidingyiBox">
			<view class="zhidingyi" @click="upimg">
				<view class="zdyLeft">
					<view class="zdyTitle">自定义图片</view>
					<view class="zdyms">建议尺寸：宽度750*390px</view>
					<view class="zdyms" style="padding-top: 24rpx;">请先上传自定义活动图片 后编辑活动内容</view>
				</view>
				<view class="zdyRight">
					<image src="../../static/img/bg_sucai@2x.png" mode="" class="zdyRightImg"></image>
				</view>
			</view>
		</view>
		<view class="listBox">
			<view class="listLine" v-for="(item,i) in list">
				<view class="listTitle">{{item.Name}}</view>
				<view class="listSm">{{item.collectingComment}}</view>
				<scroll-view scroll-x="true" class="scroll-X" >
					<view class="listLineImgBox" >
						<view class="" v-for="(img,index) in item.imgList" @click="goAdd(img)">
							<image  class="listLineImg" :src="img.Img" mode=""></image>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:'',
				imgurl:'',
			}
		},
		onLoad() {
          this.getSetTheGuestList();
		  //?token=1BAD122A96BA41E49200322381DC5D34&uid=DC0B84EA-A67B-4A4B-8EAE-F55A13CF8217
		},
		methods: {
		   goAdd(item){
				uni.navigateTo({
					url:'addActivity?img='+item.Img
				})
		   },
		   goAddzdy(img){
			   uni.navigateTo({
			   	url:'addActivity?img='+img
			   })
		   },
           getSetTheGuestList(){
			   uni.showLoading({
			   	title: '加载中'
			   })
			   this.$http('openH5SetTheGuest/getSetTheGuestList', {
			     
			    },'GET').then(res => {
			   		uni.hideLoading();
			   		this.list=res.data
			    })
		   },
		   upimg(){
			   var that = this;
			   uni.chooseImage({
			   	sourceType: ['album','camera'],
			   	count:1, 
			   	success: (chooseImageRes) => {
			   		const tempFilePaths = chooseImageRes.tempFilePaths;
			   		that.file=tempFilePaths[0]
			   		 uni.uploadFile({
			   	            url: that.$request.baseUrl+'accompany/SuperCheckSheet/uploadFile', //仅为示例，非真实的接口地址
			   	            filePath: tempFilePaths[0],
			   	            name: 'file',
			   	            formData: {
			   	                'user': 'test'
			   	            },
			   	            success: (uploadFileRes) => {
			   	                console.log(JSON.parse(uploadFileRes.data).data );
			   					//that.imgArr=that.imgArr.concat(JSON.parse(uploadFileRes.data).data) ;
			   					that.imgurl=JSON.parse(uploadFileRes.data).data[0];
								that.goAddzdy(that.imgurl)
			   	            }
			   	        });
			   
			   		
			   	}
			   });
		   }
		}
	}
</script>

<style scoped>
	.content{
		min-height: 100vh;
		background:#F4F5F7 ;
	}
	.zhidingyiBox{
		padding: 20rpx 24rpx;
	}
	.zhidingyi{
		background: #ffffff;
		border-radius: 10rpx;
		display: flex;
		justify-content: space-between;
	}
	.zdyRightImg{
		width: 217rpx;
		height: 210rpx;
	}
	.zdyLeft{
		padding-top: 50rpx;
		padding-left: 20rpx;
		width: 300rpx;
	}
 .zdyTitle{
	 color: #333333;
	 line-height: 42rpx;
	 font-size: 30rpx;
	 font-weight: 500;
	 padding-bottom: 16rpx;
 }
.zdyms{
	font-weight: 400;
	color: #999999;
	line-height: 33rpx;
	font-size: 24rpx;
}
.zdyRight{
	padding: 35rpx 30rpx;
}
.listBox{
	background: #ffffff;
}
.listLine{
	padding-left: 24rpx;
	padding-top: 30rpx;
}
.listLineImg{
	width: 630rpx;
	height: 252rpx;
	margin-right: 30rpx;
	border-radius: 10rpx;
}
.listLineImgBox{
	display: flex;
}
.listTitle{
	font-weight: 500;
	color: #333333;
	font-size: 30rpx;
}
.listSm{
	font-weight: 400;
	color: #999999;
	line-height: 33px;
	font-size: 24rpx;
	width: 702rpx;
	height: 33rpx;
}
</style>
