device.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  1. <template>
  2. <div id="device_container">
  3. <view>
  4. <text class="cuIcon-titles text-primary"></text>
  5. <text class="">我的设备</text>
  6. </view>
  7. <div class="device padding">
  8. <!-- 未连接部分-->
  9. <div v-if="connect_toy == 0">
  10. <div
  11. class="connect_box"
  12. v-if="device_status == 0 && connect_show == false"
  13. >
  14. <device_unconnect @open_scan="open_scan"></device_unconnect>
  15. </div>
  16. <!-- 连接中-->
  17. <div
  18. class="connecting_box"
  19. v-if="device_status != 0 && connect_show == false"
  20. >
  21. <device_connecting :status="device_status"></device_connecting>
  22. </div>
  23. <!-- 已链接 -->
  24. <div
  25. class="connected_box"
  26. v-if="connect_show"
  27. >
  28. <device_connected
  29. @open_choose_toy="open_choose_toy"
  30. @change_brain_status="change_device_status"
  31. :device_bg="device_bg"
  32. :device_power="device_power"
  33. :rssi="rssi"
  34. ></device_connected>
  35. </div>
  36. </div>
  37. <div v-else>
  38. <!-- 玩具模块-->
  39. <!-- 玩具连接中-->
  40. <div class="connecting_toy">
  41. <toy_connecting
  42. :connect_toy="connect_toy"
  43. :deviceId="device.deviceId"
  44. :toy_id="toy_action"
  45. :toy="toy_item"
  46. :device_bg="device_bg"
  47. :device_power="device_power"
  48. :toy_power="toy_power"
  49. @open_choose_toy="open_choose_toy"
  50. @change_toy_connect_status="change_toy_connect_status"
  51. @change_status="change_device_status"
  52. @gameStart="gameStart"
  53. ></toy_connecting>
  54. </div>
  55. </div>
  56. </div>
  57. <!-- 选择玩具-->
  58. <van-popup
  59. :show="choose_toy_window.show"
  60. @close="on_close"
  61. position="bottom"
  62. round
  63. closeable
  64. safe-area-inset-bottom
  65. >
  66. <!-- 标题 -->
  67. <div class="head padding">
  68. <div>
  69. <div class="line"></div>
  70. <div class="title">选择教具</div>
  71. </div>
  72. </div>
  73. <!-- 内容 -->
  74. <div class="padding toy_list">
  75. <van-row
  76. gutter="14"
  77. class="toy_list_content"
  78. >
  79. <van-col
  80. v-for="(toy, index) in toy_list"
  81. :key="index"
  82. class="text-center"
  83. >
  84. <div
  85. class="toy_item flex flex-direction justify-center align-center"
  86. @click="choose_toy(index)"
  87. :class="
  88. toy_action == toy.id
  89. ? 'toy_item_action_bg'
  90. : 'toy_item_normal_bg'
  91. "
  92. >
  93. <img
  94. :src="toy.img"
  95. alt=""
  96. class="toy_img"
  97. />
  98. <text class="toy_text padding-top">{{ toy.name }}</text>
  99. </div>
  100. </van-col>
  101. </van-row>
  102. </div>
  103. <!-- 结尾 -->
  104. <div class="toy_actions padding text-center">
  105. <view class="text-gray toy_action_text padding">选择你最感兴趣的项目,点击“选好了”以后将会自动连接
  106. </view>
  107. <button
  108. class="cu-btn lg cu-btn-primary text-white text-center padding"
  109. @click="choose_ok"
  110. >
  111. 选好了
  112. </button>
  113. </div>
  114. </van-popup>
  115. <van-toast id="van-toast"/>
  116. <van-dialog id="van-dialog"/>
  117. <view style="width: 100%;height: 300px;">
  118. <view>脑环Mac:{{ device.deviceId }}</view>
  119. <view>教具UUID:{{ toy_UUID }}</view>
  120. </view>
  121. <!-- <van-popup-->
  122. <!-- :show="start_show"-->
  123. <!-- :closeable="false"-->
  124. <!-- position="bottom"-->
  125. <!-- custom-style="height: 100%"-->
  126. <!-- @close="onStartGameShowClose"-->
  127. <!-- >-->
  128. <!-- <gameIng v-if="game_status" @closePop="onStartGameShowClose"></gameIng>-->
  129. <!-- </van-popup>-->
  130. </div>
  131. </template>
  132. <script>
  133. //蓝牙未连接
  134. import device_unconnect from "@/components/device/unconnect";
  135. //蓝牙连接中
  136. import device_connecting from "@/components/device/connecting";
  137. //蓝牙完成链接
  138. import device_connected from "@/components/device/connected";
  139. //连接玩具
  140. import toy_connecting from "@/components/device/toy/connecting";
  141. //开始游戏的界面
  142. import gameIng from "@/pages/start/index";
  143. //获取个人信息
  144. import Toast from "../../../static/vant/toast/toast";
  145. import {game_devices, getDeviceBySn, setDeviceInDb} from "../../requests/game";
  146. import game_store from "@/store/game";
  147. import bluetooth from "@/utils/bluetooth";
  148. import ble_store from "../../store/bluetooth";
  149. import Dialog from "../../../static/vant/dialog/dialog";
  150. let $this;
  151. export default {
  152. name: "device",
  153. components: {
  154. device_unconnect,
  155. device_connecting,
  156. device_connected,
  157. toy_connecting,
  158. gameIng,
  159. },
  160. data() {
  161. return {
  162. rssi: 0,
  163. //设备状态 0为未连接,1:连接中,2:已连接 3:连接失败
  164. device_status: 0,
  165. // device_status: 2,
  166. connect_show: false,
  167. //设置图标的颜色
  168. device_bg: false,
  169. choose_toy_window: {
  170. show: false,
  171. // show: true,
  172. },
  173. //'水柱音箱', '喷雾恐龙(大)', '喷雾恐龙(小)', '轨道车', '碰碰车', '小车(大)', '小车(中)', '小车(小)', '飞行器(大)', '飞行器(小)', '水母灯'
  174. toy_list: [],
  175. toy_item: {},
  176. toy_action: 1,
  177. // connect_show: true,
  178. //连接玩具 0:未连接 1:连接中 2:已连接 3:连接失败 4:游戏中
  179. connect_toy: 0,
  180. code: "jellyfish1234",
  181. device: {},
  182. deviceId: "",
  183. _device_index: false,
  184. toy_id: 0,
  185. toy_hex: "",
  186. // 电量
  187. device_power: 0,
  188. //教具电量
  189. toy_power: 0,
  190. //教具名称
  191. toy_sn: "",
  192. //UUID
  193. toy_UUID: "",
  194. // 开始游戏模块
  195. start_show: false,
  196. game_status: 0,
  197. //当前发送的hex码
  198. current_hex: "",
  199. //判断是否已经连接教具
  200. toy_connected: false
  201. };
  202. },
  203. methods: {
  204. //打开 扫描二维码
  205. open_scan() {
  206. // 打开蓝牙扫描 重置游戏状态
  207. game_store.setters.setGameStatus(0);
  208. //
  209. $this.scan_to_bluetooth();
  210. },
  211. //扫描连接蓝牙
  212. scan_to_bluetooth() {
  213. wx.scanCode({
  214. onlyFromCamera: true,
  215. success: (res) => {
  216. let $data = res;
  217. if ($data.result) {
  218. let url = decodeURIComponent($data.result);
  219. let $code = url.match(/\?ring=(.*)/)
  220. ? url.match(/\?ring=(.*)/)
  221. : url.match(/\?code=(.*)/);
  222. // 判断新的标识值
  223. $this.code = $code[1].toUpperCase();
  224. console.log("头环码", $code);
  225. //打开蓝牙设备
  226. wx.getSystemInfo({
  227. success(res) {
  228. // 判断ios 和 安卓
  229. if (res.platform == "ios") {
  230. wx.openBluetoothAdapter({
  231. //判断主机模式蓝牙是否打开
  232. mode: "central",
  233. success(res) {
  234. //判断已经打开连接了
  235. if (res["errMsg"] == "openBluetoothAdapter:ok") {
  236. // $this.startBluetoothDevicesDiscovery();
  237. wx.openBluetoothAdapter({
  238. //判断从机模式蓝牙是否打开
  239. mode: "peripheral",
  240. success(res) {
  241. if (res["errMsg"] == "openBluetoothAdapter:ok") {
  242. $this.startBluetoothDevicesDiscovery();
  243. }
  244. },
  245. fail(err) {
  246. let $msg = bluetooth.GetopenBluetoothAdapterError(
  247. err["errCode"]
  248. );
  249. setTimeout(() => {
  250. Toast.fail({
  251. message: $msg,
  252. });
  253. }, 3000);
  254. },
  255. });
  256. }
  257. },
  258. fail(err) {
  259. let $msg = bluetooth.GetopenBluetoothAdapterError(
  260. err["errCode"]
  261. );
  262. setTimeout(() => {
  263. Toast.fail({
  264. message: $msg,
  265. });
  266. }, 3000);
  267. },
  268. });
  269. } else {
  270. // 安卓手机
  271. wx.openBluetoothAdapter({
  272. mode: "peripheral",
  273. success(res) {
  274. //判断已经打开连接了
  275. if (res["errMsg"] == "openBluetoothAdapter:ok") {
  276. $this.startBluetoothDevicesDiscovery();
  277. }
  278. },
  279. fail(err) {
  280. let $msg = bluetooth.GetopenBluetoothAdapterError(
  281. err["errCode"]
  282. );
  283. setTimeout(() => {
  284. Toast.fail({
  285. message: $msg,
  286. });
  287. }, 3000);
  288. },
  289. });
  290. }
  291. },
  292. });
  293. }
  294. },
  295. });
  296. },
  297. //关闭窗口的方法
  298. on_close() {
  299. $this.choose_toy_window.show = false;
  300. },
  301. //选择玩具
  302. choose_toy($index) {
  303. $this.toy_action = $this.toy_list[$index].id;
  304. },
  305. // 打开选择玩具窗口
  306. open_choose_toy() {
  307. // $this.choose_toy_window.show = false;
  308. $this.choose_toy_window.show = true;
  309. $this.toy_connected = false
  310. bluetooth.sendControlClose();
  311. },
  312. // 选好玩具
  313. choose_ok() {
  314. $this.on_close();
  315. $this.change_toy_connect_status(1);
  316. $this._device_index = $this.toy_action - 1;
  317. //获取玩具
  318. let $toy = {};
  319. $this.toy_list.forEach(($val, $index) => {
  320. if ($val["id"] == $this.toy_action) {
  321. $this.toy_item = $toy = $val;
  322. }
  323. });
  324. $this.toy_id = $toy.id;
  325. let $hex = $this.toy_hex = $toy["hex"].substr($toy["hex"].length - 2, 2);
  326. //连接玩具
  327. $this.current_hex = `03 00 ${$hex} 00 0a`;
  328. bluetooth.sendConnectOneToMore($hex);
  329. },
  330. //修改玩具连接状态
  331. change_toy_connect_status($status = 0) {
  332. $this.connect_toy = $status;
  333. if ($status == 1) {
  334. $this.connect_show = true;
  335. } else {
  336. $this.connect_show = false;
  337. }
  338. },
  339. // 修改设备连接状态
  340. change_device_status($status = 0) {
  341. $this.device_status = $status;
  342. //当蓝牙连接已断开
  343. //当脑环断开
  344. if ($status == 0) {
  345. game_store.setters.setGameStatus(0);
  346. bluetooth.sendControlClose();
  347. // 清空链接得设备 三值
  348. game_store.setters.clearDeviceToy();
  349. $this.connect_toy = $status;
  350. $this.connect_show = false;
  351. wx.closeBLEConnection({
  352. deviceId: $this.device.deviceId,
  353. success(res) {
  354. Toast.success({
  355. message: "已成功断开",
  356. });
  357. },
  358. fail(res) {
  359. console.log("断开连接error:" + res)
  360. },
  361. complete(res) {
  362. $this.device = {}
  363. $this.toy_UUID = "";
  364. $this.$forceUpdate();
  365. }
  366. });
  367. wx.closeBluetoothAdapter();
  368. } else if ($status == 2) {
  369. $this.connect_show = true;
  370. }
  371. },
  372. //开始蓝牙被发现
  373. startBluetoothDevicesDiscovery() {
  374. wx.startBluetoothDevicesDiscovery({
  375. allowDuplicatesKey: true,
  376. success: (res) => {
  377. //2021年10月21日15:07:57 通过sn 返回deviceId
  378. getDeviceBySn($this.code).then((res) => {
  379. let $data = res.data;
  380. console.log($data)
  381. $this.change_device_status(1);
  382. if ($data.code == 0) {
  383. $data = $data.data;
  384. wx.getSystemInfo({
  385. success(res) {
  386. // 判断ios 和 安卓
  387. if (res.platform == "ios") {
  388. $this.device.deviceId = $data.ios_device_id;
  389. } else {
  390. $this.device.deviceId = $data.device_id;
  391. }
  392. if ($this.device.deviceId) {
  393. console.log("finded")
  394. $this.createBLEConnection()
  395. } else {
  396. console.log('unfinded')
  397. $this.onBluetoothDeviceFound();
  398. }
  399. }
  400. });
  401. } else {
  402. $this.onBluetoothDeviceFound();
  403. }
  404. })
  405. },
  406. fail(err) {
  407. $this.change_device_status(3);
  408. },
  409. });
  410. },
  411. //打开蓝牙搜索
  412. onBluetoothDeviceFound() {
  413. try {
  414. // 5秒后判断 这5秒在搜索设备,搜索到就赋值给_deviceId
  415. setTimeout(() => {
  416. if (!$this.device.deviceId) {
  417. wx.stopBluetoothDevicesDiscovery();
  418. $this.change_device_status(0);
  419. Toast.fail("未连接到设备");
  420. } else if ($this.device_status == 1) {
  421. wx.stopBluetoothDevicesDiscovery();
  422. $this.change_device_status(0);
  423. Toast.fail("设备未连接到");
  424. // console.log(
  425. // "设备未连接到device_status的状态为:",
  426. // $this.device_status
  427. // );
  428. }
  429. }, 5000);
  430. // 小乌龟
  431. wx.onBluetoothDeviceFound((res) => {
  432. res.devices.forEach((device) => {
  433. if (!device.name && !device.localName) {
  434. return;
  435. }
  436. if (device.localName && device.localName != "") {
  437. device.name = device.localName;
  438. }
  439. if (device["name"].toUpperCase() == $this.code) {
  440. $this.stopBluetoothDevicesDiscovery();
  441. $this.device = device;
  442. game_store.setters.setDeviceId(device.deviceId);
  443. $this.createBLEConnection();
  444. //录入库
  445. setDeviceInDb($this.code, device.deviceId)
  446. }
  447. });
  448. });
  449. } catch (e) {
  450. console.log("打开蓝牙error", e);
  451. }
  452. },
  453. // 停止蓝牙搜索
  454. stopBluetoothDevicesDiscovery() {
  455. wx.stopBluetoothDevicesDiscovery();
  456. },
  457. //连接低功耗蓝牙设备。
  458. createBLEConnection() {
  459. wx.createBLEConnection({
  460. deviceId: $this.device.deviceId,
  461. success: (res) => {
  462. console.log("成功连接");
  463. //成功连接脑环蓝牙
  464. $this.change_device_status(2);
  465. bluetooth.watch_bluetooth_status($this);
  466. bluetooth.getBLEDeviceServices($this.device.deviceId);
  467. bluetooth.watchingDevice($this);
  468. },
  469. fail(err) {
  470. console.log(err);
  471. },
  472. });
  473. },
  474. // 获取游戏设备玩具
  475. get_toy_list() {
  476. // 清空toy_list
  477. $this.toy_list = [];
  478. game_devices().then((res) => {
  479. let $data = res.data;
  480. let $toylist = $data.data;
  481. let _item = {};
  482. $toylist.forEach(($val, $index) => {
  483. _item = {
  484. id: parseInt($val["device_id"]),
  485. name: $val["name"],
  486. img: "https://img.shuimuai.com/" + $val["img"],
  487. hex: $val["bluetooth"],
  488. };
  489. $this.toy_list.push(_item);
  490. });
  491. game_store.setters.setToyList($this.toy_list);
  492. });
  493. },
  494. onStartGameShowClose() {
  495. $this.start_show = false;
  496. $this.game_status = 0;
  497. },
  498. gameStart() {
  499. $this.game_status = 1;
  500. $this.connect_toy = 4;
  501. },
  502. },
  503. mounted() {
  504. $this.get_toy_list();
  505. },
  506. created() {
  507. $this = this;
  508. },
  509. onShow() {
  510. //判断是否游戏中
  511. let $game_status = game_store.getters.getGameStatus();
  512. // 游戏过程中关闭脑环状态
  513. let $game_close_status = game_store.getters.getGameCloseStatus();
  514. console.log("返回时:" + $game_status, $game_close_status);
  515. if ($game_status == 3) {
  516. //不在游戏状态
  517. $this.connect_toy = 0;
  518. $this.connect_show = true;
  519. bluetooth.watchingDevice($this);
  520. bluetooth.watch_bluetooth_status($this);
  521. // let $ble_status = ble_store.getters.getBluetoothLinkStatus();
  522. // if ($ble_status == false) {
  523. // //断开蓝牙连接
  524. // $this.change_device_status(0);
  525. // }
  526. $this.toy_UUID = "";
  527. $this.$forceUpdate();
  528. // 状态为1的时候重置为1 小乌龟
  529. if ($game_close_status == 1) {
  530. // 重置默认条件
  531. $this.connect_toy = 0;
  532. $this.connect_show = false;
  533. $this.device_status = 0;
  534. bluetooth.watch_bluetooth_status($this);
  535. $this.device.deviceId = "";
  536. $this.toy_UUID = "";
  537. $this.$forceUpdate();
  538. // 清空链接的设备
  539. game_store.setters.clearDeviceToy();
  540. }
  541. }
  542. },
  543. onHide() {
  544. // game_store.setters.setGameStatus(0);
  545. },
  546. onLoad(options) {
  547. // 原有的code
  548. let $_code = wx.getStorageSync("code");
  549. if (options.q) {
  550. let url = decodeURIComponent(options.q);
  551. let $code = url.match(/\?code=(.*)/)[1];
  552. //判断新的code 和 旧的code 是否一致 不一致则重新登录
  553. console.log("1---" + $_code, "2---" + $code);
  554. if ($_code && $_code != $code) {
  555. Toast.fail("该用户已绑定邀请码");
  556. }
  557. }
  558. },
  559. };
  560. </script>
  561. <!--共有样式-->
  562. <style>
  563. .second_device_text {
  564. position: relative;
  565. bottom: 5px;
  566. }
  567. .connect_img {
  568. width: 85px;
  569. height: 80px;
  570. }
  571. /*玩具不同背景*/
  572. .toy_item_normal_bg {
  573. background-image: url("https://img.shuimuai.com/web/toy_bg.png");
  574. background-position: center;
  575. background-size: 100% 100%;
  576. }
  577. /*玩具选中背景*/
  578. .toy_item_action_bg {
  579. background-image: url("https://img.shuimuai.com/web/toy_bg_action.png");
  580. background-position: center;
  581. background-size: 100% 100%;
  582. }
  583. .ring_2 {
  584. width: 199px;
  585. height: 203px;
  586. background: rgba(93, 77, 184, 0);
  587. border: 2px solid #f7f7f7;
  588. opacity: 0.43;
  589. border-radius: 50%;
  590. }
  591. .ring_3 {
  592. width: 158px;
  593. height: 158px;
  594. background: rgba(93, 77, 184, 0);
  595. border: 3px solid #f6f6f6;
  596. opacity: 0.54;
  597. border-radius: 50%;
  598. }
  599. .dot_container {
  600. height: 100px;
  601. }
  602. .dot_wait {
  603. height: 5px;
  604. width: 80px;
  605. background-image: url("https://img.shuimuai.com/web/connect_line.png");
  606. background-position: center;
  607. background-size: 100% 100%;
  608. }
  609. .device_phone {
  610. width: 30px;
  611. height: 40px;
  612. bottom: 5px;
  613. }
  614. .device_brain {
  615. width: 40px;
  616. height: 40px;
  617. bottom: 10px;
  618. }
  619. .device_text {
  620. padding: 3px;
  621. font-size: 9px;
  622. }
  623. .moving_dot {
  624. width: 18px;
  625. height: 18px;
  626. position: relative;
  627. left: 15px;
  628. bottom: 7px;
  629. }
  630. .moving {
  631. animation: moving 2s linear infinite;
  632. }
  633. /*左右移动动画*/
  634. @keyframes moving {
  635. 0% {
  636. left: 0px;
  637. }
  638. 50% {
  639. left: 35px;
  640. }
  641. 100% {
  642. left: 0px;
  643. }
  644. }
  645. .cut_brain_icon {
  646. width: 11px;
  647. height: 11px;
  648. }
  649. .cut_text {
  650. font-size: 11px;
  651. }
  652. /*设备绿色信号灯*/
  653. .sign_green {
  654. width: 20px;
  655. height: 10px;
  656. position: relative;
  657. top: 9px;
  658. left: 0;
  659. }
  660. /*水母男孩*/
  661. .connected_boy {
  662. width: 110px;
  663. height: 110px;
  664. position: absolute;
  665. right: -60px;
  666. top: 63px;
  667. }
  668. .boy_session {
  669. background-image: url("https://img.shuimuai.com/web/boy_session.png");
  670. background-position: center;
  671. background-size: 100% 100%;
  672. width: 120px;
  673. height: 100px;
  674. position: absolute;
  675. top: 18px;
  676. right: 25px;
  677. z-index: 4;
  678. }
  679. .boy_session_text {
  680. font-size: 12px;
  681. color: #6b6b6b;
  682. }
  683. .device_electric {
  684. position: relative;
  685. width: 16px;
  686. height: 16px;
  687. top: 0px;
  688. right: 0px;
  689. z-index: 5;
  690. }
  691. /*设备连接模块*/
  692. .device_bg {
  693. width: 90px;
  694. height: 100px;
  695. background-position: center;
  696. background-size: 100% 100%;
  697. background-image: url("https://img.shuimuai.com/web/device_bg.png");
  698. }
  699. .left {
  700. line-height: 32px;
  701. }
  702. </style>
  703. <!--私有样式-->
  704. <style scoped>
  705. #device_container {
  706. position: relative;
  707. bottom: 80px;
  708. }
  709. .head .line {
  710. width: 4px;
  711. height: 14px;
  712. background-color: #5d4db8;
  713. margin-right: 7px;
  714. }
  715. .head view {
  716. display: flex;
  717. justify-self: start;
  718. align-items: center;
  719. }
  720. /*玩具列表*/
  721. .toy_list {
  722. overflow-x: scroll;
  723. }
  724. .toy_item {
  725. margin: 0px auto;
  726. /* width: 120px; */
  727. width: 140px;
  728. height: 130px;
  729. }
  730. /*玩具图片*/
  731. .toy_img {
  732. width: 65px;
  733. height: 65px;
  734. }
  735. .toy_text {
  736. font-size: 12px;
  737. }
  738. .toy_action_text {
  739. font-size: 11px;
  740. width: 100%;
  741. }
  742. /* 选择玩具 */
  743. .toy_list {
  744. width: 100%;
  745. overflow-x: auto;
  746. }
  747. .toy_list_content {
  748. width: 130%;
  749. display: inline-block;
  750. display: flex;
  751. flex-wrap: wrap;
  752. }
  753. /* padding toy_list */
  754. </style>