<style scoped>
	.explain{
		width: 100vw;
		height: 100vh;
		background: #F5F5F5;
		box-sizing: border-box;
		padding: 36rpx;
		
	}
	.box{
		width: 100%;
		
		box-sizing: border-box;
		padding:  40rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		border-radius: 48rpx;
		background: #FFF;
		
	}
	.box-top{
		height: calc( 100vh - 270rpx);
		overflow-y: auto;
		width: 100%;
		
	}
	.box-b{
		width: 292rpx;
		height: 90rpx;
		background: #E4E5FB;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 32rpx;
		color: #4C50E7;
		border-radius: 45rpx;
	}
	.dc{
		font-size: 30px;
		color: #111111;
		font-weight: bold;
	}
	.dclx{
		padding:4px 6px ;
		border-radius: 3px;
		background: #E8E9EA;
		font-size: 28rpx;
		color: #666666;
		
		
	}
	

</style>
<template>
	<view class="explain">
		<view class="box">
			<view class="box-top">
				<view class="dc">{{item.WordWrite}}</view>
				<view style="display: flex;align-items: center;flex-wrap: wrap;margin-top: 36rpx;">
					<view class="dclx">{{item.WordType}}</view>
					<view style="font-size: 28rpx;color: #999999;margin:0 26rpx">[{{item.WordContent}}]</view>
					<image style="width: 32rpx;height: auto;" mode="widthFix" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/laba2x.png" @click="play"></image>
				</view>
				<view style="width: 100%;height: 1px;background: #333F53;margin: 40rpx 0;"></view>
				<view style="font-size: 32rpx;font-weight: bold;color: #111111;">{{item.ChineseMean}}</view>
			</view>
			<view class="box-b" @click="continueWrite">继续做题</view>
			
		</view>
			
	</view>
</template>

<script>
	import {ref,reactive,toRefs,toRef,getCurrentInstance,watch,computed,onMounted,provide} from "vue";
	const innerAudioContext = uni.createInnerAudioContext();
	innerAudioContext.autoplay = false;
	export default {
		props: {
			item: {
				type: Object,
				default: () => {
					return {}
				}
			}
		},
		setup(props,{attrs,slots,emit}) {
			let data = reactive({
				
			})
			let methods = {
				play() {
					innerAudioContext.src=`https://fanyi.baidu.com/gettts?lan=jp&text=${encodeURIComponent(props.item.WordContent)}&spd=3&source=web`
					innerAudioContext.play()
				},
				continueWrite(){
					emit('todo')
				}
			}
			onMounted(()=>{
			})
			let that = methods;
			return {
			  ...toRefs(data),
			  ...methods,
			};
		}
	}
</script>

