<template>
	<view class="">
		<view class="listBox mt10">
			<view class="">
				{{data.videoName}}
			</view>
			<view class="mt20">
				发课时间:{{data.planSendTime}}
			</view>
			<view class="x-f mt20" v-if="data.tagNames">
				<view class="mr10">
					标签:
				</view>
				<view class="x-f" v-if="data.tagNames">
					<view class="listBox-btn mr10" v-for="(val,key) in data.tagNames" :key="key">
						{{val}}
					</view>
				</view>
			</view>
			<view class="mt20">
				自动催课:{{data.isUrgeCourse==1?'是':'否'}}
			</view>
			<view class="mt20">
				催课文案:
				<text v-for="(item,index) in data.urgeContent" :key="index">{{index+1}}、{{item}}</text>
			</view>
		</view>
		<view class="listBox mt10" v-if="data.detailList && data.detailList.length>0">
			<view :class="[index!=0?'mt10':'']" v-for="(item,index) in data.detailList" :key="index">
				<view class="x-bc">
					<view class="">
						{{item.userName}}
					</view>
					<view class="colorF" :class="[item.sendStatus==1?'green':'']">
						{{item.sendStatus==1?'已完成':'进行中'}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		sendLogDetail,
	} from "./api/courseManage.js"
	export default {
		data() {
			return {
				data: {}
			}
		},
		onLoad(params) {
			if (params.id) {
				this.sendLogDetailFun(params.id)
			}
		},
		methods: {
			sendLogDetailFun(id) {
				sendLogDetail({
					logId: id
				}).then((res) => {
					if (res.code == 200) {
						res.data.tagNames = res.data.tagNames && res.data.tagNames.split(',') || ''
						this.data = res.data
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.listBox {
		background: #fff;
		padding: 28rpx;

		.listBox-line {
			margin: 20rpx 0;
			border-bottom: 2rpx solid #999999;
		}

		.listBox-btn {
			padding: 2rpx 20rpx;
			border-radius: 10rpx;
			border: 1rpx solid #999999;
			width: auto;
			height: auto;
		}
	}

	.mr10 {
		margin-right: 10rpx;
	}

	.green {
		color: #4FC06B;
	}
</style>