<template>
	<view v-if="ready">
		<view class="uploadBox">
			<view class="chooseBox">
				<view class="fileBox">
					<video :src="form.VideoPath"></video>
				</view>
			</view>
		</view>
		<view class="fromItemBox">
			<view class="title wrap1">{{form.Name}}</view>
			<view class="time">{{form.CreateTime?form.CreateTime.substring(0,16):''}}</view>
		</view>
		<view class="resText">
			<view class="resTitle">
				AI分析结果：
			</view>
			<textarea class="textarea" v-model="form.AIContent" disabled auto-height placeholder=""></textarea>
		</view>
	</view>
</template>

<script>
	import customFormMixins from '@/common/customform.js'
	export default {
		mixins: [customFormMixins],
		data() {
			return {
				form: {
					name:'',
					VideoPath:'',
				},
				uploadList:[],
				ready:false,
			}
		},
		async onLoad({ type, id }) {
		  await this.init(type, id) 
		}, 
		methods: {
			async init(type,id){
				let res = await this.HTTP_GET('learun/adms/smartEducation/smartSelfCourseInfo',id)
				if(!res)return
				if(res.VideoPath){
					let fileList = await this.convertToFormValue({type:'upload'},res.VideoPath)
					if(fileList&&fileList.length){
						res.VideoPath = fileList[0].path
					}
				}
				// res.VideoPath = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(res.VideoPath, true)
				this.form = res
				this.ready = true
			},
		}
	}
</script>

<style scoped>
	.uploadBox{
		.chooseBox{
			height: 400rpx;
			border-radius: 16rpx;
			.fileBox{
				height: 100%;
				overflow: hidden;
				uni-video{
					height: 100%;
					width: 100%;
				}
			}
		}
	}
	.fromItemBox{
		background-color: #fff;
		padding: 30rpx;
		.title{
			color: #333;
			font-size: 17px;
			font-weight: 700;
		}
		.time{
			margin-top: 20rpx;
			color: #666;
			font-size: 12px;
		}
	}
	.resText{
		border-radius: 16rpx;
		background-color: #fff;
		padding: 30rpx;
		min-height: 100px;
		margin-top: 30rpx;
		.resTitle{
			font-size: 15px;
			color: #0C86D8;
			font-weight: 700;
			margin-bottom: 20rpx;
		}
		.textarea{
			color: #333;
			font-size: 14px;
			min-height: 160rpx;
			width: 100%;
		}
	}
	/* 文字溢出 */
	.wrap1 {
	  display: block;
	  text-overflow: ellipsis;
	  overflow: hidden;
	  white-space: nowrap;
	}
</style>