<!-- 蓝牙平台限制 todo https://uniapp.dcloud.io/api/system/bluetooth?id=stopbluetoothdevicesdiscovery -->
<template>
	<view>
		<uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" title="选择设备类型" color="#000000" fixed="true" :border="false">
			<view slot="left">
				<view class=" flex align-center margin-left">
					<image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
				</view>
			</view>

		</uni-nav-bar>
		<view class="flex justify-start  align-center margin-top ">
			<image style="margin: 0 20rpx 0 100rpx; width: 30rpx;height: 30rpx;" src="/static/devicesOther/link.png" mode="aspectFit"></image>
			<text style="font-size: 15px; color: #999999;">请选择设备类型开始绑定</text>
		</view>
		<view class="card-view padding-top padding-bottom" v-for="(item,index) in devicesList" :key="index">
			<view class="flex justify-between align-center" @tap="_onConnectDevice(item,$event)">
				<text style="margin-left: 70rpx; font-weight: bold; font-size: 18px; color: #565656;">{{item.cname}}</text>
				<image style="margin-right: 30rpx; width: 20rpx;height: 90rpx;" src="/static/devicesOther/deviceright.png" mode="aspectFit"></image>
			</view>
		</view>

	</view>


</template>

<script>
	import {
		mapState
	} from 'vuex';

	export default {
		computed: mapState([]),
		data() {
			return {
				// 列表
				devicesList: [{
						cname: "手柄盒子",
						deviceType: 'BLEHandle',
						//type: 'boxingMode'
					},
					// {
					// 	cname: "跳跃模式",
					// 	type: 'jumpMode'
					// },
					// {
					// 	cname: "跳跑模式",
					// 	type: 'jumpRunMode'
					// }
				]
			}
		},
		onLoad() {

		},
		onShow() {},
		onHide() {},
		methods: {

			onBack() {
				uni.navigateBack({
					delta: 1
				})
			},


			// 提示点击连接设备
			_onConnectDevice(item, event) {
				// console.log(item, event);
				uni.navigateTo({
					url: '../devices-hardware/devices-hardware?deviceType='+item.deviceType
				})
			}
		}

	}
</script>

<style>
</style>
