<template>
	<view class="hl88-lr-bulletin">
		<view @touchstart="onTouchStart" @touchmove="onTouchMove" class="hl88-lr-bullDrag" :style="{left: touch.left, top: touch.top}">
			<text style="color: aliceblue;">{{touch}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'LiveRoomBulletin',
		props: {
			text: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				touch: {
					left: 0,
					top: 0,
					width: 0,
					height: 0
				}
			};
		},
		methods: {
			onTouchStart(e) {
				this.touch.left = e.touches[0].pageX;
				this.touch.top = e.touches[0].pageY;
				// 双击
				if(e.touches.length == 2){
					this.touch.width = e.touches[0].pageX - e.touches[1].pageX;
					this.touch.height = e.touches[0].pageY - e.touches[1].pageY;
				}
			},
			onTouchMove(e) {
				this.touch.left = e.touches[0].pageX;
				this.touch.top = e.touches[0].pageY;
				// 双击
				if(e.touches.length == 2){
					this.touch.width = e.touches[0].pageX - e.touches[1].pageX;
					this.touch.height = e.touches[0].pageY - e.touches[1].pageY;
				}
			}
			
		}
	}
</script>

<style>
	.hl88-lr-bulletin {
	}
</style>
