index.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. // 获取应用实例
  2. const app = getApp();
  3. const {
  4. getBanner,
  5. login,
  6. listByDevice
  7. } = require('../../utils/api.js');
  8. const {
  9. isCN
  10. } = require('../../utils/util.js');
  11. let _this = null;
  12. const interval = null;
  13. // import routeUtil from '../../utils/route_util.js'
  14. import routeUtil from '../../utils/route_util'
  15. import route_constant from '../../utils/route_constant.js'
  16. Page({
  17. data: {
  18. ///下午好
  19. greeting: "",
  20. phone: "",
  21. nvabarData: {
  22. showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示
  23. title: 'OhPlay', //导航栏 中间的标题
  24. },
  25. bannerList: [],
  26. autoplay: true,
  27. interval: 3000, // 切换时间间隔
  28. duration: 500, // 滑动动画时长
  29. circular: true, // 衔接滑动
  30. indexPage: 0,
  31. ///是否展示频道
  32. showChannel: false,
  33. ////首页
  34. navBarHeight: app.globalData.navBarHeight,
  35. MenuButtonheight: app.globalData.MenuButtonheight,
  36. MenuButtonTop: app.globalData.MenuButtonTop,
  37. actionIndex: null,
  38. luoma: ["Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", " Ⅶ", "Ⅷ", "Ⅸ", "Ⅹ", "Ⅺ", "Ⅻ"],
  39. channelData: [],
  40. deviceList: [],
  41. deviceListIndex: null,
  42. showLogin: false,
  43. isOneLoading: true,
  44. uid: null,
  45. isSetWake: false,
  46. thisDeviceMac: null,
  47. battery: 4, // 0≤电量<20,0格
  48. newVersion: false,
  49. ////我的界面
  50. loginStatus: true,
  51. nickname: "未登录",
  52. userPic: './../../img/head_pic.png',
  53. islogin: false,
  54. },
  55. onLoad(options) {
  56. var that = this;
  57. var bannerList = wx.getStorageSync("homeBanner") || [];
  58. if (that.data.bannerList.length == 0) {
  59. that.setData({
  60. bannerList: bannerList
  61. });
  62. }
  63. that.onHomeLoad();
  64. that.onMeLoad();
  65. },
  66. onShow() {
  67. var that = this;
  68. that.onHomeShow();
  69. that.onMeLoad();
  70. var nickname = that.data.nickname;
  71. var greeting = that.updateGreeting();
  72. if (nickname != "" && nickname != "未登录") {
  73. greeting = greeting + ',' + nickname;;
  74. }
  75. that.setData({
  76. greeting: greeting
  77. });
  78. getBanner({}).then((res) => {
  79. that.setData({
  80. bannerList: res
  81. });
  82. wx.setStorageSync("homeBanner", res);
  83. })
  84. },
  85. updateGreeting() {
  86. const now = new Date();
  87. const hour = now.getHours();
  88. let greeting;
  89. if (hour >= 5 && hour < 12) {
  90. greeting = '上午好';
  91. } else if (hour >= 12 && hour < 18) {
  92. greeting = '下午好';
  93. } else {
  94. greeting = '晚上好';
  95. }
  96. return greeting;
  97. },
  98. onHomeLoad() {
  99. _this = this;
  100. // 版本自动更新代码
  101. const updateManager = wx.getUpdateManager();
  102. updateManager.onUpdateReady(function () {
  103. _this.setData({
  104. newVersion: true
  105. });
  106. })
  107. updateManager.onUpdateFailed(function () {
  108. // 新的版本下载失败
  109. wx.showModal({
  110. title: '已有新版本咯',
  111. content: '请您删除当前小程序,重新打开呦~',
  112. showCancel: false
  113. })
  114. })
  115. wx.showLoading({
  116. title: '加载中',
  117. });
  118. const str = setTimeout(() => {
  119. clearTimeout(str);
  120. if (_this.data.isOneLoading) {
  121. _this.setData({
  122. isOneLoading: false,
  123. });
  124. }
  125. }, 500);
  126. // 获取缓存的频道数据
  127. wx.getStorage({
  128. key: "channelData",
  129. success(res) {
  130. _this.setData({
  131. channelData: res.data
  132. })
  133. }
  134. });
  135. // 登录
  136. this.login();
  137. },
  138. onMeLoad() {
  139. // wx.getStorage("userInfo")
  140. var that = this;
  141. wx.getStorage({
  142. key: "userInfo",
  143. success(res) {
  144. var phone = res.data.phone;
  145. if (!phone) {
  146. return;
  147. };
  148. var nickname = res.data.nickname || "";
  149. var greeting = that.updateGreeting();
  150. if (nickname != "" && nickname != "未登录") {
  151. greeting = greeting + ',' + nickname;;
  152. }
  153. that.setData({
  154. phone: phone,
  155. greeting: greeting,
  156. nickname: nickname,
  157. userPic: res.data.headUrl || "",
  158. islogin: true,
  159. });
  160. }
  161. })
  162. },
  163. onHomeShow() {
  164. if ((!this.data.isOneLoading)) {
  165. wx.getStorage({
  166. key: 'userInfo',
  167. fail(res) {
  168. // 取消订阅
  169. if (_this.data.thisDeviceMac !== null) {
  170. app.unsubscribe(`/${_this.data.thisDeviceMac}/user/pub_response`);
  171. };
  172. _this.setData({
  173. showLogin: true,
  174. });
  175. },
  176. success() {
  177. if (app.globalData.newDeviceId) {
  178. // 获取设备本地数据
  179. _this.getDeviceData();
  180. } else if (_this.data.deviceListIndex !== null) {
  181. // 更新
  182. _this.actionDevice(_this.data.deviceListIndex);
  183. }
  184. }
  185. });
  186. };
  187. },
  188. ////开始是home的
  189. login() {
  190. wx.login({
  191. success: res => {
  192. let phone = undefined;
  193. try {
  194. var value = wx.getStorageSync('userInfo')
  195. if (value) {
  196. phone = value.phone || undefined;
  197. };
  198. } catch (e) {
  199. // Do something when catch error
  200. };
  201. // 请求登录
  202. login({
  203. code: res.code,
  204. phone
  205. }).then((res) => {
  206. app.globalData.userInfo = res;
  207. wx.setStorage({
  208. key: "userInfo",
  209. data: res
  210. });
  211. // 需要用授权登录
  212. if ((res.isNewUser && res.isNewUser === true) || !phone) {
  213. _this.setData({
  214. showLogin: true,
  215. });
  216. return;
  217. };
  218. // 获取设备本地数据
  219. this.getDeviceData();
  220. _this.setData({
  221. showLogin: false,
  222. });
  223. wx.setStorage({
  224. key: "token",
  225. data: JSON.stringify({
  226. id: res.userId,
  227. token: res.accessToken,
  228. }),
  229. });
  230. });
  231. },
  232. })
  233. },
  234. ///开始时home的
  235. getDeviceData() {
  236. // 获取设备数据
  237. wx.getStorage({
  238. key: 'devicelist',
  239. success(res) {
  240. wx.hideLoading();
  241. if (res.data) {
  242. const resData = JSON.parse(res.data);
  243. console.log("本地设备列表", resData)
  244. _this.setData({
  245. deviceList: resData
  246. });
  247. // 连接mqtt
  248. if (app.globalData.client === null) {
  249. app.connect();
  250. } else if (app.globalData.newDeviceId) {
  251. _this.setData({
  252. actionIndex: null,
  253. deviceListIndex: null,
  254. });
  255. // 监听
  256. let topic = `/AIrSMArT_${resData[0].name.split("BLUFI_")[1]}/status/onoffline`;
  257. app.subscribe(topic);
  258. const Timeout = setTimeout(() => {
  259. clearTimeout(Timeout);
  260. _this.actionDevice(0);
  261. }, 1000);
  262. }
  263. // // 有新设备
  264. // if(app.globalData.newDeviceId) {
  265. // _this.setData({
  266. // actionIndex: null,
  267. // deviceListIndex: null,
  268. // });
  269. // let topic = `/AIrSMArT_${resData[0].name.split("BLUFI_")[1]}/status/onoffline`;
  270. // app.subscribe(topic);
  271. // }
  272. }
  273. },
  274. fail(e) {
  275. wx.hideLoading();
  276. }
  277. });
  278. },
  279. // 回调
  280. mqttCallback(type, option) {
  281. // console.log("gadsfadsfqwerq===" + type + "===" + option);
  282. let payloads = null;
  283. if (option) {
  284. payloads = JSON.parse(option.payload);
  285. };
  286. switch (type) {
  287. case "connect":
  288. _this.connectSuccess();
  289. break;
  290. case "message_onoffline":
  291. _this.online(payloads);
  292. break;
  293. case "message":
  294. // 接收设备播放信息
  295. if (payloads.type === "get_position" && payloads.other) {
  296. let actionIndex = null;
  297. _this.data.channelData.map((v, index) => {
  298. if (v.channelNum === payloads.other.channel) {
  299. actionIndex = index;
  300. }
  301. });
  302. _this.setData({
  303. actionIndex,
  304. });
  305. } else if (payloads.type === "play" || payloads.type === "play_state") {
  306. if (_this.data.deviceListIndex === null) {
  307. return;
  308. }
  309. // 接收设备当前播放状态
  310. const obj = {
  311. DstDeviceName: _this.getThisDeviceID()
  312. }
  313. app.PubMsg({
  314. type: "get_position",
  315. ...obj
  316. });
  317. } else if (payloads.type === "get_dev_info") {
  318. // 接收设备当前信息
  319. this.getchannelData(payloads.other.ProdModel);
  320. // 电量
  321. _this.setData({
  322. battery: _this._battery(payloads.other.Power),
  323. })
  324. // 当前设备木有设置定时
  325. _this.setData({
  326. isSetWake: false,
  327. });
  328. payloads.other.alarm.map((v) => {
  329. if (v.enable === "1") {
  330. _this.setData({
  331. isSetWake: true
  332. });
  333. }
  334. });
  335. // 更新信息
  336. _this.data.deviceList.map((v, index) => {
  337. if (payloads.SrcDeviceName && payloads.SrcDeviceName.indexOf(v.name.split("BLUFI_")[1]) !== -1) {
  338. _this.data.deviceList[index].ProdModel = payloads.other.ProdModel;
  339. _this.data.deviceList[index].devName = payloads.other.devName;
  340. }
  341. });
  342. // 更新缓存
  343. wx.setStorage({
  344. key: "devicelist",
  345. data: JSON.stringify(_this.data.deviceList),
  346. success() {
  347. _this.setData({
  348. deviceList: _this.data.deviceList
  349. })
  350. }
  351. });
  352. } else if (payloads.type === "battery" && payloads.other) {
  353. _this.setData({
  354. battery: _this._battery(payloads.other.battery),
  355. })
  356. }
  357. break;
  358. default:
  359. }
  360. },
  361. // 格式化电量
  362. _battery(battery) {
  363. let _battery = 0;
  364. if (battery < 20) {
  365. _battery = 0
  366. } else if (20 <= battery && battery < 40) {
  367. _battery = 1
  368. } else if (40 <= battery && battery < 60) {
  369. _battery = 2
  370. } else if (60 <= battery && battery < 80) {
  371. _battery = 3
  372. } else if (80 <= battery && battery <= 100) {
  373. _battery = 4
  374. } else if (battery > 100) {
  375. _battery = 5
  376. };
  377. return _battery
  378. },
  379. connectSuccess() {
  380. // 订阅设备在线信息
  381. _this.subscribeDevicesStatus();
  382. },
  383. // [{"deviceId":"BLUFI_7cdfa1fcbb24","name":"BLUFI_7cdfa1fcbb24","state":"online","ProdModel":"MW-2AX(WIFI-N)","devName":"猫王小王子OTR-X"}]
  384. online(payloads) {
  385. // 设置在线状态
  386. _this.data.deviceList.map((v, index) => {
  387. if (payloads.uuid && payloads.uuid.indexOf(v.name.split("BLUFI_")[1]) !== -1) {
  388. _this.data.deviceList[index].state = payloads.state;
  389. }
  390. });
  391. _this.setData({
  392. deviceList: _this.data.deviceList,
  393. });
  394. // 更新缓存
  395. wx.setStorage({
  396. key: "devicelist",
  397. data: JSON.stringify(_this.data.deviceList)
  398. });
  399. // 如没有选中,选中最新的
  400. (() => {
  401. if (_this.data.deviceListIndex === null) {
  402. let itue = false;
  403. _this.data.deviceList.map((v, index) => {
  404. if (v.state === "online" && !itue) {
  405. itue = true;
  406. _this.actionDevice(index);
  407. }
  408. });
  409. }
  410. // else {
  411. // _this.actionDevice(_this.data.deviceListIndex);
  412. // };
  413. })();
  414. // 当前播放设备离线
  415. if (_this.data.deviceListIndex !== null && _this.data.deviceList[_this.data.deviceListIndex].state !== "online") {
  416. _this.setData({
  417. actionIndex: null,
  418. deviceListIndex: null,
  419. });
  420. };
  421. },
  422. // 订阅设备在线状态
  423. subscribeDevicesStatus() {
  424. this.data.deviceList.forEach((value) => {
  425. let topic = `/AIrSMArT_${value.name.split("BLUFI_")[1]}/status/onoffline`;
  426. app.subscribe(topic);
  427. })
  428. },
  429. subscribeCurrDevice() {
  430. if (!(app.globalData.client && app.globalData.client.connected)) {
  431. console.log("未连接MQTT服务器");
  432. const str = setInterval(() => {
  433. clearInterval(str);
  434. _this.subscribeCurrDevice();
  435. }, 500);
  436. return;
  437. };
  438. if (this.data.deviceList.length === 0 || this.data.deviceListIndex === null) {
  439. return
  440. };
  441. let topic = `/AIrSMArT_${this.data.deviceList[this.data.deviceListIndex].name.split("BLUFI_")[1]}/user/pub_response`;
  442. app.subscribe(topic);
  443. const obj = {
  444. DstDeviceName: _this.getThisDeviceID()
  445. };
  446. app.PubMsg({
  447. type: "get_dev_info",
  448. ...obj
  449. });
  450. },
  451. actionMusic(e) {
  452. if (e.currentTarget.dataset.index === this.data.actionIndex) {
  453. return;
  454. };
  455. if (this.data.deviceListIndex === null) {
  456. wx.showToast({
  457. title: '请选择设备',
  458. icon: "none"
  459. })
  460. return;
  461. };
  462. this.setData({
  463. actionIndex: e.currentTarget.dataset.index
  464. });
  465. const other = {
  466. "url": "",
  467. "media_data": "",
  468. "user_id": `${app.globalData.userInfo.deviceUid}`,
  469. "timestamp": `${Math.round(new Date() / 1000)}`,
  470. "channel_id": `${this.data.channelData[e.currentTarget.dataset.index].channelNum}`,
  471. "order": "",
  472. "resource_from": "",
  473. "songAlbumID": "",
  474. "version": 3,
  475. "is_debug": app.globalData.is_debug
  476. };
  477. app.PubMsg({
  478. type: "play",
  479. DstDeviceName: _this.getThisDeviceID(),
  480. other
  481. });
  482. },
  483. actionDeviceIndex(e) {
  484. if (e.currentTarget.dataset.index === this.data.deviceListIndex) {
  485. return
  486. };
  487. this.actionDevice(e.currentTarget.dataset.index)
  488. },
  489. actionDevice(index) {
  490. const device = this.data.deviceList[index];
  491. if (device.state !== "online") {
  492. return;
  493. };
  494. // 取消订阅
  495. if (this.data.thisDeviceMac !== null) {
  496. app.unsubscribe(`/${this.data.thisDeviceMac}/user/pub_response`);
  497. };
  498. this.setData({
  499. deviceListIndex: index,
  500. thisDeviceMac: `AIrSMArT_${this.data.deviceList[index].name.split("BLUFI_")[1]}`
  501. });
  502. // app.PubMsg({
  503. // type: "get_dev_info",
  504. // DstDeviceName: _this.getThisDeviceID()
  505. // });
  506. this.subscribeCurrDevice();
  507. },
  508. getThisDeviceID() {
  509. return `AIrSMArT_${this.data.deviceList[this.data.deviceListIndex].name.split("BLUFI_")[1]}`
  510. },
  511. getchannelData(clientType) {
  512. let _this = this;
  513. if (this.data.deviceListIndex === null) {
  514. return;
  515. };
  516. listByDevice({
  517. clientType
  518. }).then((res) => {
  519. _this.setData({
  520. channelData: res
  521. });
  522. // 接收设备当前播放状态
  523. const obj = {
  524. DstDeviceName: _this.getThisDeviceID()
  525. }
  526. app.PubMsg({
  527. type: "get_position",
  528. ...obj
  529. });
  530. wx.setStorage({
  531. key: "channelData",
  532. data: res
  533. });
  534. // 有新设备
  535. if (app.globalData.newDeviceId) {
  536. app.globalData.newDeviceId = null;
  537. return;
  538. // 去掉此功能,先留着吧
  539. // const other= {
  540. // "url": "",
  541. // "media_data": "",
  542. // "user_id": `${app.globalData.userInfo.deviceUid}`,
  543. // "timestamp": `${Math.round(new Date() / 1000)}`,
  544. // "channel_id": `${res[1].channelNum}`,
  545. // "order": "",
  546. // "resource_from": "",
  547. // "songAlbumID":"",
  548. // "version":3,
  549. // "is_debug": app.globalData.is_debug
  550. // };
  551. // app.PubMsg({
  552. // type: "play",
  553. // DstDeviceName: _this.getThisDeviceID(),
  554. // other
  555. // });
  556. }
  557. })
  558. },
  559. goChnnel() {
  560. wx.setStorage({
  561. key: "channelDeta",
  562. data: this.data.channelData[this.data.actionIndex],
  563. success() {
  564. wx.navigateTo({
  565. url: './../channelDetails/channelDetails'
  566. })
  567. }
  568. })
  569. },
  570. updata() {
  571. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  572. wx.getUpdateManager().applyUpdate()
  573. },
  574. updataClone() {
  575. this.setData({
  576. newVersion: false
  577. })
  578. },
  579. onUnload() {
  580. if (app.globalData.client === null) {
  581. return;
  582. };
  583. app.globalData.client.end(true);
  584. app.globalData.client.end(true);
  585. app.globalData.client = null;
  586. },
  587. onTapIndex(e) {
  588. var that = this;
  589. var index = e.currentTarget.dataset.index;
  590. var indexPage = that.data.indexPage;
  591. if (indexPage != index) {
  592. that.setData({
  593. indexPage: index,
  594. });
  595. }
  596. },
  597. goMeAbout() {
  598. wx.navigateTo({
  599. url: './../about/about',
  600. })
  601. },
  602. goMeLogin() {
  603. const that = this;
  604. if (that.data.islogin) {
  605. // 退出登录
  606. wx.removeStorage({
  607. key: 'userInfo',
  608. success(res) {
  609. var nickname = "未登录";
  610. var greeting = that.updateGreeting();
  611. if (nickname != "" && nickname != "未登录") {
  612. greeting = greeting + ',' + nickname;;
  613. }
  614. that.setData({
  615. phone: "",
  616. greeting: greeting,
  617. islogin: false,
  618. nickname: nickname,
  619. userPic: "./../../img/head_pic.png",
  620. });
  621. // wx.switchTab({
  622. // url: `./../index/index`
  623. // });
  624. }
  625. });
  626. wx.removeStorage({
  627. key: 'token',
  628. })
  629. } else {
  630. // 登录
  631. wx.navigateTo({
  632. url: './../login/login',
  633. });
  634. }
  635. },
  636. addDevice() {
  637. var that = this;
  638. var phone = that.data.phone;
  639. var showLogin = that.data.showLogin;
  640. if (phone == "" || showLogin) {
  641. wx.navigateTo({
  642. url: './../login/login'
  643. });
  644. return;
  645. }
  646. that.goDeviceConnect();
  647. },
  648. goDeviceConnect() {
  649. wx.navigateTo({
  650. url: './../deviceList/deviceList',
  651. });
  652. },
  653. ///点击item
  654. // [{"deviceId":"BLUFI_7cdfa1fcbb24","name":"BLUFI_7cdfa1fcbb24","state":"online","ProdModel":"MW-2AX(WIFI-N)","devName":"猫王小王子OTR-X"}]
  655. onTapIem(e) {
  656. var that = this;
  657. var item = e.currentTarget.dataset.item;
  658. var devName = item.devName;
  659. if (devName == "猫王小王子OTR-X") {
  660. that.goWake();
  661. return;
  662. }
  663. },
  664. goWake() {
  665. if (this.data.deviceListIndex === null) {
  666. return;
  667. };
  668. wx.navigateTo({
  669. url: './../deviceWake/deviceWake?deviceId=' + this.data.deviceList[this.data.deviceListIndex].deviceId + "&clientType=" + this.data.deviceList[this.data.deviceListIndex].ProdModel,
  670. });
  671. },
  672. ///点击banner事件
  673. onTapBanner() {
  674. var that = this;
  675. var item = e.currentTarget.dataset.item;
  676. },
  677. deleteDevice(e) {
  678. wx.showModal({
  679. title: '确定删除?',
  680. success: function (res) {
  681. if (res.confirm) {
  682. const id = this.data.deviceList[e.currentTarget.dataset.index].deviceId;
  683. let name = _this.data.deviceListIndex !== null ? this.data.deviceList[_this.data.deviceListIndex].name : null;
  684. const deviceList = this.data.deviceList.filter((v, i) => {
  685. return id !== v.deviceId
  686. });
  687. // 取消订阅
  688. app.unsubscribe(`/AIrSMArT_${_this.data.deviceList[e.currentTarget.dataset.index].name.split("BLUFI_")[1]}/user/pub_response`);
  689. wx.setStorage({
  690. key: "devicelist",
  691. data: JSON.stringify(deviceList),
  692. success() {
  693. _this.setData({
  694. deviceList,
  695. thisDeviceMac: null
  696. });
  697. // 当前没有设备
  698. if (deviceList.length === 0) {
  699. _this.setData({
  700. actionIndex: null,
  701. deviceListIndex: null,
  702. });
  703. }
  704. if (_this.data.deviceListIndex === null) {
  705. return
  706. };
  707. if (e.currentTarget.dataset.index === _this.data.deviceListIndex) {
  708. let index_ = null;
  709. deviceList.map((v, index) => {
  710. if (v.state === "online" && index_ === null) {
  711. index_ = index;
  712. }
  713. });
  714. if (index_ !== null) {
  715. _this.actionDevice(index_);
  716. } else {
  717. _this.setData({
  718. actionIndex: null,
  719. deviceListIndex: null,
  720. });
  721. };
  722. } else {
  723. deviceList.map((v, index) => {
  724. if (v.name === name) {
  725. _this.setData({
  726. deviceListIndex: index,
  727. });
  728. }
  729. });
  730. }
  731. }
  732. });
  733. }
  734. }
  735. });
  736. },
  737. addConnectDevice(connectDevice) {
  738. console.log("dfadsfasdfasdfa==111==" + JSON.stringify(connectDevice))
  739. },
  740. })