|
@@ -41,7 +41,7 @@
|
|
:connect_toy="connect_toy"
|
|
:connect_toy="connect_toy"
|
|
:deviceId="_deviceId"
|
|
:deviceId="_deviceId"
|
|
:toy_id="toy_action"
|
|
:toy_id="toy_action"
|
|
- :toy="toy_list[toy_action - 1]"
|
|
|
|
|
|
+ :toy="toy_item"
|
|
:device_bg="device_bg"
|
|
:device_bg="device_bg"
|
|
:device_power="device_power"
|
|
:device_power="device_power"
|
|
@open_choose_toy="open_choose_toy"
|
|
@open_choose_toy="open_choose_toy"
|
|
@@ -71,7 +71,7 @@
|
|
<!-- 内容 -->
|
|
<!-- 内容 -->
|
|
<div class="padding toy_list">
|
|
<div class="padding toy_list">
|
|
<van-row gutter="14" class="toy_list_content">
|
|
<van-row gutter="14" class="toy_list_content">
|
|
- <van-col span="8" v-for="(toy, index) in toy_list" :key="index">
|
|
|
|
|
|
+ <van-col span="12" v-for="(toy, index) in toy_list" :key="index" class="text-center">
|
|
<div
|
|
<div
|
|
class="toy_item flex flex-direction justify-center align-center"
|
|
class="toy_item flex flex-direction justify-center align-center"
|
|
@click="choose_toy(index)"
|
|
@click="choose_toy(index)"
|
|
@@ -148,6 +148,7 @@ export default {
|
|
},
|
|
},
|
|
//'水柱音箱', '喷雾恐龙(大)', '喷雾恐龙(小)', '轨道车', '碰碰车', '小车(大)', '小车(中)', '小车(小)', '飞行器(大)', '飞行器(小)', '水母灯'
|
|
//'水柱音箱', '喷雾恐龙(大)', '喷雾恐龙(小)', '轨道车', '碰碰车', '小车(大)', '小车(中)', '小车(小)', '飞行器(大)', '飞行器(小)', '水母灯'
|
|
toy_list: [],
|
|
toy_list: [],
|
|
|
|
+ toy_item:{},
|
|
toy_action: 1,
|
|
toy_action: 1,
|
|
// connect_show: true,
|
|
// connect_show: true,
|
|
//连接玩具 0:未连接 1:连接中 2:已连接 3:连接失败 4:游戏中
|
|
//连接玩具 0:未连接 1:连接中 2:已连接 3:连接失败 4:游戏中
|
|
@@ -226,7 +227,12 @@ export default {
|
|
$this.change_toy_connect_status(1);
|
|
$this.change_toy_connect_status(1);
|
|
$this._device_index = $this.toy_action - 1;
|
|
$this._device_index = $this.toy_action - 1;
|
|
//获取玩具
|
|
//获取玩具
|
|
- let $toy = $this.toy_list[$this.toy_action - 1];
|
|
|
|
|
|
+ let $toy = {}
|
|
|
|
+ $this.toy_list.forEach(($val, $index) => {
|
|
|
|
+ if ($val['id']==$this.toy_action){
|
|
|
|
+ $this.toy_item = $toy = $val
|
|
|
|
+ }
|
|
|
|
+ })
|
|
$this.toy_id = $toy.id
|
|
$this.toy_id = $toy.id
|
|
let $hex = $toy["hex"].substr($toy["hex"].length - 2, 2);
|
|
let $hex = $toy["hex"].substr($toy["hex"].length - 2, 2);
|
|
let toy_hex = "0x" + $hex;
|
|
let toy_hex = "0x" + $hex;
|
|
@@ -626,6 +632,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.toy_item {
|
|
.toy_item {
|
|
|
|
+ margin: 0px auto;
|
|
width: 120px;
|
|
width: 120px;
|
|
height: 130px;
|
|
height: 130px;
|
|
}
|
|
}
|
|
@@ -653,7 +660,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.toy_list_content {
|
|
.toy_list_content {
|
|
- width: 120%;
|
|
|
|
|
|
+ width: 100%;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
display: flex;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|