<template>
	<view style="position: relative">
		<!-- 胶囊 -->
		<mvBar :mysNavConfig="mysNavConfig"></mvBar>
		<view :style="{marginTop:navH}"></view>

		<view class="script" v-for="item in List">
			<view style="margin: 20rpx;">
				<p style="margin-bottom: 10rpx;">上传时间：{{item.create_at}}</p>
				<!-- 图片 -->
				<view v-if="item.type == 1">
					<view class="image-list">
						<!-- 图文 -->
						<view class="image-item" v-for="photo in item.Photo">
							<image :src="photo.photo_url" mode="aspectFill" style="width: 100%;height: 100%;"></image>
						</view>
					</view>
				</view>
				<!-- 视频 -->
				<view style="display: flex;" v-if="item.type == 2">
					<video :src="item.Photo[0].photo_url"></video>
				</view>
				<p>{{item.title}}</p>
				<text>{{item.content}}</text>
			</view>
			<view class="heng-line" v-if="item.is_review && !item.is_ok"></view>
			<view style="margin: 20rpx;color: red;" v-if="item.is_review && !item.is_ok">
				<p style="margin-bottom: 10rpx;">驳回时间：{{item.reject_at}}</p>
				<text>{{item.revise_opinion}}</text>
			</view>
		</view>
		<view style="height: 100rpx;width: 100%;"></view>
	</view>
</template>

<script>
	import mvBar from "@/components/mys_navBar/mysNavBar";
	export default {
		components: {
			mvBar,
		},
		data() {
			return {
				navH: getApp().globalData.navHeight,
				List: [],
				AllImage: [],
				mysNavConfig: {
					/* 开启单页显示首页图标 */
					isHome: true,
					/* 固定导航  */
					navFixed: true,
					/* 标题 （屏幕中心居中 两边图标中心居中使用slot center1） */
					navTitle: {
						text: "查看修改/反馈记录",
						color: "",
						fontSize: "32rpx", // px upx rpx
						fontWeight: "normal", // 100 - 700
					},
					btnType: "type2",
					onLeftClick: '',
					/* type2 按钮 */
					type2Config: {
						// 左图标
						leftPath: "/static/img/png2.png",
						// 右图标
						rightPath: "/static/img/png4.png",
						// 圆角
						radius: "40rpx",
					},
				},
			}
		},

		onShow() {
			this.getList();
		},

		onLoad(options) {
			let data = options.textObj.replace(/""/g, "");
			data = JSON.parse(decodeURIComponent(data))
			this.taskId = data.taskId
			console.log(this.taskId)
		},
		methods: {
			// 获取初稿审阅记录
			getList() {
				this.$https.get('/youngee/c/t/g/get-task-sketch' +
						"?" +
						"task_id" +
						"=" +
						this.taskId)
					.then(res => {
						console.log(res)
						this.List = res.data.data
					})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.script {
		margin-bottom: 100rpx;
	}

	.heng-line {
		width: 100%;
		border-bottom: 1rpx solid #dadada;
	}
	
	.image-list {
		margin: 0 2.5rpx;
		display: flex;
		flex-wrap: wrap;
		// justify-content: space-between;
	}
	
	.image-item {
		width: 220rpx;
		height: 220rpx;
		margin: 10rpx 7.5rpx;
	}
</style>
