<template>
	<view class="wrapper">
		<text class="iconTop">&#xe649;</text>
		<view class="list">
			
			<view class="li" @click="scan">
				<text class="icon">&#xe891;</text>
				<text class="t1">扫一扫</text>
			</view>
			<view class="li" @click="creatTask">
				<text class="icon">&#xe64a;</text>
				<text class="t1">创建任务</text>
			</view>
			<view class="li" @click="goUrl">
				<text class="icon">&#xe6a7;</text>
				<text class="t1">关注机器人</text>
			</view>
		</view>
	</view>
</template>

<script>
	var domModule = weex.requireModule('dom');
	
	domModule.addRule('fontFace', {
		'fontFamily': "iconfont",
		'src': "url('/static/iconfont.ttf')"
	})
	export default {
		data(){
			return {
				
			}
		},
		mounted() {
			
		},
		methods:{
			close() {
				const fssubNVue = uni.getSubNVueById('BpopLog2')
				console.log(fssubNVue)
				fssubNVue.hide()
			},
			goUrl(){
				this.close()
				uni.navigateTo({
					url:'/pages/native/robot'
				})
			},
			creatTask(){
				this.close()
				uni.navigateTo({
					url:'/pages/webview/popup'
				})
				return
				uni.$emit('xBpopLog2', {
				    content: 'comfirm'  
				});
			},
			scan() {
				this.close()
				uni.scanCode({
					success: (res) => {
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
					},
					fail: (e) => {
						console.log(e)
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.iconTop{
		font-family: iconfont;
		color: #484848;
		text-align: right;
		font-size: 20px;
		margin-bottom: -22rpx;
		margin-right: 18rpx;
	}
	.icon {
		font-family: iconfont;
		font-size: 22px;
		color: #fff;
		opacity: 0.7;
	}
	.wrapper{
		position: relative;
		.list{
			background: #484848;
			padding: 10rpx 0;
			border-radius: 20rpx;
			.li{
				padding: 15rpx 20rpx;
				margin-top: 14rpx;
				flex-direction: row;
				align-items: center;
				.t1{
					color: #fff;
					font-size: 28rpx;
					margin-left: 20rpx;
					border-bottom:1px solid #4D4C4C;
				}
			}
		}
	}
</style>
