index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952
  1. <template>
  2. <div id="playing_container">
  3. <!-- 计费面板模块-->
  4. <div class="game_panel padding-top-sm">
  5. <van-row gutter="16">
  6. <van-col
  7. span="8"
  8. offset="2"
  9. >
  10. <view class="text-sm">
  11. <text class="title">本次游玩时间</text>
  12. </view>
  13. <view class="text-lg padding-top">
  14. <text class="count_down_text">{{ played_time_text }}</text>
  15. </view>
  16. </van-col>
  17. <van-col
  18. span="10"
  19. offset="4"
  20. >
  21. <view class="text-sm">
  22. <text class="title">计费模式</text>
  23. <text class="type padding-left-sm">{{ mode_item.name }}</text>
  24. </view>
  25. <button
  26. class="cu-btn bg-red text-white margin-top-sm"
  27. @click="game_finished"
  28. >
  29. <img
  30. src="https://img.shuimuai.com/m_duankainaohuan.png"
  31. class="cut_brain_icon"
  32. alt=""
  33. />
  34. <text class="padding-lr cut_text text-sm">结束游戏</text>
  35. </button>
  36. </van-col>
  37. </van-row>
  38. </div>
  39. <!-- 设备状态-->
  40. <div class="game_status padding-tb">
  41. <van-row>
  42. <van-col
  43. span="10"
  44. offset="2"
  45. >
  46. <div
  47. class="flex flex-direction align-center justify-center"
  48. v-if="device_bg"
  49. >
  50. <img
  51. src="https://img.shuimuai.com/web/touhuanzhuangtai_2.png"
  52. alt=""
  53. class="device_img"
  54. />
  55. <text class="text-default">已经正确佩戴</text>
  56. </div>
  57. <div
  58. class="flex flex-direction align-center justify-center"
  59. v-else
  60. >
  61. <img
  62. src="https://img.shuimuai.com/web/touhuanzhuangtai_3.png"
  63. alt=""
  64. class="device_img"
  65. />
  66. <text class="text-default">未正确佩戴</text>
  67. </div>
  68. </van-col>
  69. <van-col span="10">
  70. <div class="flex flex-direction align-center justify-center">
  71. <view class="elc_power_container">
  72. <img
  73. src="https://img.shuimuai.com/web/dianchi_3.png"
  74. alt=""
  75. :style="{ width: device_power + '%' }"
  76. class="device_elc"
  77. />
  78. </view>
  79. <text class="text-default">{{ device_power }}%</text>
  80. <text class="text-default">设备电量</text>
  81. </div>
  82. </van-col>
  83. <!-- <van-col span="2">
  84. <div class="flex flex-direction align-center justify-center">
  85. <view>
  86. <text>-{{ rssi }}dbm</text>
  87. </view>
  88. <view>
  89. <text class="text-default">信号强度</text>
  90. </view>
  91. </div>
  92. </van-col> -->
  93. </van-row>
  94. </div>
  95. <!-- 环形实时数据 -->
  96. <div class="circle_container">
  97. <van-circle :value="online_att" layer-color="#49465E" color="#FFB400" stroke-width="7" :speed="0">
  98. <view class="circle_text">
  99. <text class="online_att_txt">
  100. {{ online_att }}
  101. </text>
  102. <view class="online_desc">
  103. <!-- <text class="online_desc">-->
  104. {{ online_att_desc }}
  105. <!-- </text>-->
  106. </view>
  107. </view>
  108. </van-circle>
  109. <van-circle :value="online_med" layer-color="#49465E" color="#40FF31" stroke-width="7" :speed="0">
  110. <view class="circle_text">
  111. <text class="online_med_txt">
  112. {{ online_med }}
  113. </text>
  114. <view class="online_desc">
  115. <!-- <text class="online_desc">-->
  116. {{ online_med_desc }}
  117. <!-- </text>-->
  118. </view>
  119. </view>
  120. </van-circle>
  121. </div>
  122. <!-- 图标模块-->
  123. <div class="ec_container">
  124. <view class="chart_view_first margin-tb-xl">
  125. <view class="bar">
  126. <view>
  127. <view class="line"></view>
  128. <view class="title">大脑状态</view>
  129. </view>
  130. <view class="label">
  131. <view>
  132. <view class="dot dot-orange"></view>
  133. <view class="name">Att(专注度)</view>
  134. </view>
  135. <view>
  136. <view class="dot dot-med"></view>
  137. <view class="name">Med(放松度)</view>
  138. </view>
  139. <view>
  140. <view class="dot dot-amp"></view>
  141. <view class="name">Amp (和谐度)</view>
  142. </view>
  143. </view>
  144. </view>
  145. <view class="chart">
  146. <mpvue-echarts
  147. :echarts="echarts"
  148. :onInit="attCharts"
  149. canvasId="canvasId-demo1"
  150. />
  151. </view>
  152. </view>
  153. <view class="chart_view_second margin-tb-xl">
  154. <view class="bar">
  155. <view>
  156. <view class="line"></view>
  157. <view class="title">基本脑波</view>
  158. </view>
  159. <view class="label">
  160. <view>
  161. <view class="dot dot-blue"></view>
  162. <view class="name">Delta</view>
  163. </view>
  164. <view>
  165. <view class="dot dot-green"></view>
  166. <view class="name">Theta</view>
  167. </view>
  168. <view>
  169. <view class="dot dot-yellow"></view>
  170. <view class="name">Beta</view>
  171. </view>
  172. <view>
  173. <view class="dot dot-orange-yellow"></view>
  174. <view class="name">Alpha</view>
  175. </view>
  176. </view>
  177. </view>
  178. <view class="chart">
  179. <mpvue-echarts
  180. :echarts="echarts"
  181. :onInit="medCharts"
  182. canvasId="canvasId-demo2"
  183. />
  184. </view>
  185. </view>
  186. </div>
  187. <van-dialog id="van-dialog"/>
  188. <van-toast id="van-toast"/>
  189. <van-notify id="van-notify"/>
  190. </div>
  191. </template>
  192. <script>
  193. import util, {formatSeconds} from "../../utils/index";
  194. import bluetooth from "../../utils/bluetooth";
  195. import game_store from "@/store/game";
  196. import Toast from "../../../static/vant/toast/toast";
  197. import {gameAddLine, gameEnd} from "../../requests/game";
  198. import mpvueEcharts from "mpvue-echarts";
  199. import echarts from "../../../static/echarts.min";
  200. var att_charts, med_charts, $this;
  201. // 大脑图表初始化
  202. function initAttChart(canvas, width, height) {
  203. att_charts = echarts.init(canvas, null, {
  204. width: width,
  205. height: height,
  206. });
  207. canvas.setChart(att_charts);
  208. let option = {}; // ECharts 配置项
  209. att_charts.setOption(option);
  210. return att_charts; // 返回 chart 后可以自动绑定触摸操作
  211. }
  212. // 我的设备图表初始化
  213. function initMedChart(canvas, width, height) {
  214. med_charts = echarts.init(canvas, null, {
  215. width: width,
  216. height: height,
  217. });
  218. canvas.setChart(med_charts);
  219. let option = {}; // ECharts 配置项
  220. med_charts.setOption(option);
  221. return med_charts; // 返回 chart 后可以自动绑定触摸操作
  222. }
  223. export default {
  224. name: "index_container",
  225. components: {
  226. mpvueEcharts,
  227. },
  228. data() {
  229. return {
  230. // 折线图
  231. echarts,
  232. attCharts: initAttChart,
  233. medCharts: initMedChart,
  234. // 使用类型 1次数 2时间 0未选择
  235. mode: 0,
  236. timeData: {},
  237. mode_item: {},
  238. device_power: 100,
  239. user_info: {},
  240. //设备值
  241. _deviceId: "",
  242. _serviceId: "",
  243. _characteristicId: "",
  244. toy_index: 0,
  245. toy_id: 0,
  246. toy: {},
  247. toy_hex: "",
  248. play_time: 0,
  249. //实时的专注值和放松度
  250. online_att: 0,
  251. online_att_desc: "",
  252. online_med: 0,
  253. online_med_desc: "",
  254. //图标数据集合
  255. att_list: [],
  256. med_list: [],
  257. //和谐度
  258. amp_list: [],
  259. delta_list: [],
  260. alpha_list: [],
  261. beta_list: [],
  262. theta_list: [],
  263. //临时数据集合
  264. attList: [],
  265. medList: [],
  266. //和谐度
  267. ampList: [],
  268. deltaList: [],
  269. alphaList: [],
  270. betaList: [],
  271. thetaList: [],
  272. //判断是否结束游戏
  273. is_end: false,
  274. // 消耗的时间
  275. played_time: null,
  276. played_time_text: "--:--",
  277. //结束游戏时选择类型的时间
  278. over_play_time: 0,
  279. // 检测佩戴是否正确
  280. device_bg: true,
  281. // 蓝牙信号强度
  282. rssi: 0,
  283. game_status: 0,
  284. };
  285. },
  286. methods: {
  287. //游戏结束方法
  288. game_finished() {
  289. bluetooth.sendEnd();
  290. $this.$emit("closePop", true);
  291. //取消监听低功耗蓝牙设备
  292. wx.offBLECharacteristicValueChange();
  293. //设置游戏状态为 停止游戏
  294. game_store.getters.getGameStatus() == 0
  295. ? game_store.setters.setGameStatus(0)
  296. : game_store.setters.setGameStatus(3);
  297. //游戏结束重置游戏时间
  298. wx.removeStorageSync("play_time");
  299. //删除游戏专注数据
  300. game_store.remover.rmGameAttMedDatas();
  301. //删除隐藏时间
  302. game_store.remover.rmHideTime();
  303. //游戏结束重置游戏模式
  304. // game_store.setters.setMode(0);
  305. //删除游戏得id
  306. game_store.setters.removeToyHex();
  307. // 结束游戏在提交报告函数里
  308. $this.post_data();
  309. Toast.loading({
  310. forbidClick: true,
  311. mask: true,
  312. message: "正在生成报告...",
  313. duration: 0,
  314. });
  315. },
  316. to_report() {
  317. mpvue.redirectTo({
  318. url: "/pages/report/main",
  319. success() {
  320. $this.timeData = {};
  321. $this.attList = [];
  322. $this.medList = [];
  323. $this.ampList = [];
  324. },
  325. });
  326. },
  327. // 开始游戏
  328. start_game() {
  329. wx.setKeepScreenOn({
  330. keepScreenOn: true,
  331. });
  332. bluetooth.watchingDevice($this);
  333. bluetooth.sendControl();
  334. },
  335. // ArrayBuffer转16进度字符串示例
  336. ab2hex(buffer) {
  337. var hexArr = Array.prototype.map.call(new Uint8Array(buffer), function (
  338. bit
  339. ) {
  340. return ("00" + bit.toString(16)).slice(-2);
  341. });
  342. return hexArr.join("");
  343. },
  344. // 往后端推送一次定时数据
  345. post_data() {
  346. //判断数据长度大于理想状态 需要对数组进行切割 逐个提交数据
  347. let $len = 240;
  348. let $_len = $len / 6;
  349. console.log($this.attList.length, "结束游戏提交的数据量");
  350. let $total_len = $this.attList.length +
  351. $this.medList.length +
  352. $this.ampList.length +
  353. $this.deltaList.length +
  354. $this.alphaList.length +
  355. $this.betaList.length +
  356. $this.thetaList.length;
  357. if ($total_len > $len) {
  358. let $count = Math.ceil($this.attList.length / $_len);
  359. let index = 0;
  360. let inter = setInterval(() => {
  361. if (index < $count) {
  362. let $params = {
  363. game_record_id: game_store.getters.getGameRecordId(),
  364. //数据段长度大于65 多个提交
  365. line: $this.attList.slice(index * $_len, (index + 1) * $_len),
  366. line_med: $this.medList.slice(index * $_len, (index + 1) * $_len),
  367. amp: $this.ampList.slice(index * $_len, (index + 1) * $_len),
  368. delta: $this.deltaList.slice(index * $_len, (index + 1) * $_len),
  369. theta: $this.alphaList.slice(index * $_len, (index + 1) * $_len),
  370. alpha: $this.betaList.slice(index * $_len, (index + 1) * $_len),
  371. beta: $this.thetaList.slice(index * $_len, (index + 1) * $_len),
  372. };
  373. gameAddLine($params).then((res) => {
  374. let $data = res.data;
  375. if ($data.code == 0) {
  376. console.log("ok", $params["line"]);
  377. }
  378. });
  379. }
  380. index++;
  381. if (index == $count) {
  382. clearInterval(inter);
  383. $this.game_over();
  384. $this.to_report();
  385. }
  386. }, 200);
  387. return $count * 500;
  388. } else {
  389. let $params = {
  390. game_record_id: game_store.getters.getGameRecordId(),
  391. //数据段长度小于65 单个提交
  392. line: $this.attList,
  393. line_med: $this.medList,
  394. amp: $this.ampList,
  395. delta: $this.deltaList,
  396. theta: $this.alphaList,
  397. alpha: $this.betaList,
  398. beta: $this.thetaList
  399. };
  400. if (!$params.line) {
  401. return false;
  402. }
  403. gameAddLine($params).then((res) => {
  404. let $data = res.data;
  405. if ($data.code == 0) {
  406. $this.attList = [];
  407. $this.ampList = [];
  408. $this.medList = [];
  409. $this.deltaList = [];
  410. $this.alphaList = [];
  411. $this.betaList = [];
  412. $this.thetaList = [];
  413. }
  414. setTimeout(() => {
  415. $this.game_over();
  416. $this.to_report();
  417. }, 800);
  418. });
  419. return 800;
  420. }
  421. },
  422. // 结束游戏
  423. game_over() {
  424. $this.over_play_time = game_store.getters.getOverPlayTime();
  425. $this.played_time = $this.played_time >= 0 ? $this.played_time : 0;
  426. let $params = {
  427. game_record_id: game_store.getters.getGameRecordId(),
  428. type: $this.mode,
  429. // play_time: $this.play_time - Math.abs($this.played_time),
  430. play_time: $this.over_play_time - $this.played_time,
  431. };
  432. //
  433. gameEnd($params).then((res) => {
  434. let $data = res.data;
  435. $this.played_time = null;
  436. //设置未结束游戏
  437. $this.is_end = false;
  438. $this.att_list = [];
  439. $this.med_list = [];
  440. $this.amp_list = [];
  441. $this.delta_list = [];
  442. $this.alpha_list = [];
  443. $this.theta_list = [];
  444. $this.beta_list = [];
  445. //游戏结束重置游戏卡卷类型时间和卡卷类型
  446. wx.removeStorageSync("over_play_time");
  447. game_store.setters.setMode(0);
  448. });
  449. },
  450. // 处理游戏中数据的方法
  451. do_datas: function ($data) {
  452. var $delta =
  453. Math.round($data["delta"]) > 10000
  454. ? parseInt(
  455. Math.round($data["delta"])
  456. .toString()
  457. .slice(0, 4)
  458. )
  459. : Math.round($data["delta"]);
  460. var $alpha =
  461. Math.round($data["alpha"]) > 1000
  462. ? Math.round($data["alpha"])
  463. .toString()
  464. .slice(0, 4)
  465. : Math.round($data["alpha"]);
  466. var $theta =
  467. Math.round($data["theta"]) > 1000
  468. ? Math.round($data["theta"])
  469. .toString()
  470. .slice(0, 4)
  471. : Math.round($data["theta"]);
  472. var $beta =
  473. Math.round($data["beta"]) > 1000
  474. ? Math.round($data["beta"])
  475. .toString()
  476. .slice(0, 4)
  477. : Math.round($data["beta"]);
  478. $this.online_att = $data["att"];
  479. $this.online_med = $data["med"];
  480. let $att_msg = "";
  481. if ($data["att"] >= 1 && $data['att'] < 40) {
  482. $att_msg = "专注力不足";
  483. } else if ($data['att'] < 60) {
  484. $att_msg = "一般专注";
  485. } else if ($data['att'] < 80) {
  486. $att_msg = "高度专注";
  487. } else if ($data['att'] <= 100) {
  488. $att_msg = "深度专注";
  489. }
  490. $this.online_att_desc = $att_msg;
  491. let $med_msg = "";
  492. if ($data["med"] >= 1 && $data['med'] < 40) {
  493. $med_msg = "放松度不足";
  494. } else if ($data['med'] < 60) {
  495. $med_msg = "一般放松";
  496. } else if ($data['med'] < 80) {
  497. $med_msg = "高度放松";
  498. } else if ($data['med'] <= 100) {
  499. $med_msg = "深度放松";
  500. }
  501. $this.online_med_desc = $med_msg;
  502. $this.att_list.push($data["att"]);
  503. $this.med_list.push($data["med"]);
  504. $this.amp_list.push(Math.abs($data["att"] - $data["med"]));
  505. $this.delta_list.push($delta);
  506. $this.alpha_list.push($alpha);
  507. $this.theta_list.push($theta);
  508. $this.beta_list.push($beta);
  509. // 专注值和放松度 只显示50个
  510. if ($this.att_list.length > 50) {
  511. $this.att_list.shift();
  512. $this.med_list.shift();
  513. $this.amp_list.shift();
  514. }
  515. //四个基础脑波值 显示30个
  516. if ($this.delta_list.length > 30) {
  517. $this.delta_list.shift();
  518. $this.alpha_list.shift();
  519. $this.theta_list.shift();
  520. $this.beta_list.shift();
  521. }
  522. $this.attList.push($data["att"]);
  523. $this.medList.push($data["med"]);
  524. $this.ampList.push(Math.abs($data["att"] - $data["med"]));
  525. $this.deltaList.push($data["delta"]);
  526. $this.alphaList.push($data["alpha"]);
  527. $this.betaList.push($data["beta"]);
  528. $this.thetaList.push($data["theta"]);
  529. game_store.setters.setGameAttMedDatas({
  530. attList: $this.attList,
  531. medList: $this.medList,
  532. ampList: $this.ampList,
  533. deltaList: $this.deltaList,
  534. alphaList: $this.alphaList,
  535. betaList: $this.betaList,
  536. thetaList: $this.thetaList,
  537. });
  538. //判断是否隐藏 隐藏则不绘画
  539. let $hide_status = game_store.getters.getHideStatus();
  540. if (!$hide_status) {
  541. //通过专注放松度 画图
  542. let $option = util.getLineOption($this.att_list, $this.med_list, $this.amp_list);
  543. att_charts.setOption($option);
  544. //通过基本脑波发送数据
  545. let $base_option = util.getBaseOption(
  546. $this.delta_list,
  547. $this.theta_list,
  548. $this.alpha_list,
  549. $this.beta_list
  550. );
  551. med_charts.setOption($base_option);
  552. }
  553. },
  554. //计算游玩时间
  555. calThePlayedTime() {
  556. //筛选模式
  557. $this.mode = game_store.getters.getMode();
  558. let mode_list = [
  559. {
  560. id: 1,
  561. name: "次卡(10分钟)",
  562. },
  563. {
  564. id: 2,
  565. name: "会员时间消费",
  566. },
  567. ];
  568. //可玩时间 (剩余时长)
  569. $this.play_time = game_store.getters.getPlayTime();
  570. //已经玩了多长时间
  571. $this.played_time = game_store.getters.getPlayedTime()
  572. ? game_store.getters.getPlayedTime()
  573. : game_store.getters.getPlayTime();
  574. $this.mode_item = {};
  575. $this.mode_item = mode_list[$this.mode - 1];
  576. },
  577. RandDomNum() {
  578. $this.online_att = Math.round(Math.random() * 100);
  579. $this.online_med = Math.round(Math.random() * 100);
  580. }
  581. },
  582. mounted() {
  583. $this._deviceId = game_store.getters.getDeviceId();
  584. $this._serviceId = game_store.getters.getServiceId();
  585. $this._characteristicId = game_store.getters.getCharacterId();
  586. // setTimeout(() => {
  587. $this.game_status = game_store.getters.getGameStatus();
  588. // }, 1000)
  589. //判断是否结束游戏
  590. if ($this.is_end == true) {
  591. $this.game_finished();
  592. } else {
  593. $this.calThePlayedTime();
  594. $this.start_game();
  595. //打开蓝牙监听
  596. bluetooth.watch_bluetooth_status($this);
  597. }
  598. },
  599. created() {
  600. $this = this;
  601. },
  602. // 加载完成后、后台切到前台或重新进入页面时触发
  603. onShow() {
  604. // 判断可游玩时间是否小于 0
  605. game_store.setters.setHideStatus(false);
  606. if ($this.played_time == 0) {
  607. $this.game_finished();
  608. } else {
  609. wx.getSystemInfoAsync({
  610. success(res) {
  611. if (res.platform != "android") {
  612. //获取 拉到后台得时间
  613. let $hide_time = game_store.getters.getHideTime();
  614. if ($hide_time) {
  615. //获取当前时间
  616. let $now = Math.round(new Date() / 1000);
  617. //获得后台到当前时间差
  618. let $residue = $now - $hide_time;
  619. //将原来的游玩时间+上 时间差
  620. let $played_time = $this.played_time * 1 - $residue * 1;
  621. //判断时间差
  622. if ($residue > $this.played_time) {
  623. $this.game_finished();
  624. }
  625. //重新设置游玩时间
  626. game_store.setters.setPlayedTime($played_time);
  627. $this.calThePlayedTime();
  628. }
  629. }
  630. },
  631. });
  632. }
  633. },
  634. onLoad(options) {
  635. if (options.end == 1) {
  636. $this.is_end = true;
  637. }
  638. },
  639. // 页面从前台切换到后台或者去别的页面时候触发的
  640. onHide() {
  641. game_store.setters.setHideStatus(true);
  642. game_store.setters.setHideTime(Math.round(new Date() / 1000));
  643. },
  644. // 页面卸载时候触发的生命周期
  645. onUnload() {
  646. console.log("小程序被销毁");
  647. if (!$this.is_end) {
  648. //停止传输数据
  649. bluetooth.sendEnd();
  650. wx.offBLECharacteristicValueChange();
  651. //存储时间
  652. game_store.setters.setPlayedTime($this.played_time);
  653. //设置未结束游戏
  654. $this.is_end = false;
  655. }
  656. },
  657. };
  658. </script>
  659. <style scoped>
  660. #playing_container {
  661. width: 100%;
  662. background: linear-gradient(
  663. 0deg,
  664. rgba(40, 157, 206, 0.51),
  665. rgba(135, 145, 226, 0.26)
  666. );
  667. background-color: #46425e;
  668. padding: 5px;
  669. height: 850px;
  670. }
  671. .game_panel {
  672. width: 100%;
  673. height: 76px;
  674. background: #46425e;
  675. box-shadow: 0px 3px 4px 0px #302d43;
  676. border-radius: 11px;
  677. margin: 0px auto;
  678. }
  679. .game_panel .title {
  680. color: #9a96b7;
  681. }
  682. .game_panel .type {
  683. color: #ffffff;
  684. }
  685. .cut_brain_icon {
  686. width: 11px;
  687. height: 11px;
  688. }
  689. .device_img {
  690. width: 36px;
  691. height: 36px;
  692. }
  693. .text-default {
  694. color: #9a95b7;
  695. font-size: 10px;
  696. }
  697. /*电量显示*/
  698. .elc_power_container {
  699. width: 28px;
  700. border: #9a95b7 3px solid;
  701. border-radius: 5px;
  702. height: 22px;
  703. }
  704. .device_elc {
  705. height: 18px;
  706. }
  707. /* 节标题 */
  708. .bar {
  709. width: 100%;
  710. height: 15px;
  711. display: flex;
  712. align-items: center;
  713. justify-content: space-between;
  714. padding: 0 7px;
  715. box-sizing: border-box;
  716. margin: 11px 0;
  717. }
  718. .bar view {
  719. display: flex;
  720. align-items: center;
  721. justify-content: start;
  722. }
  723. .bar .line {
  724. width: 4px;
  725. height: 15px;
  726. background-color: #ffb400;
  727. margin-right: 7px;
  728. }
  729. .bar .title {
  730. color: #fff;
  731. font-size: 15px;
  732. }
  733. .label {
  734. color: #9a95b7;
  735. font-size: 10px;
  736. }
  737. /*点图*/
  738. .dot {
  739. width: 8px;
  740. height: 8px;
  741. border-radius: 50%;
  742. margin-right: 4px;
  743. margin-left: 15px;
  744. }
  745. .dot-orange {
  746. background: #ffb400;
  747. }
  748. .dot-pink {
  749. background: #d4327a;
  750. }
  751. .dot-blue {
  752. background: #00ccff;
  753. }
  754. .dot-green {
  755. background: #0cda2e;
  756. }
  757. .dot-yellow {
  758. background: #d1d310;
  759. }
  760. .dot-orange-yellow {
  761. background: #f8a117;
  762. }
  763. /* 图表 */
  764. #mychart-dom-multi-line {
  765. width: 100%;
  766. height: 175px;
  767. }
  768. #mychart-dom-multi-line-med {
  769. width: 100%;
  770. height: 100px;
  771. }
  772. /*弹窗模块*/
  773. .err_container {
  774. width: 260px;
  775. height: 300px;
  776. border-radius: 5px;
  777. }
  778. /*标题*/
  779. .err_container .title {
  780. font-size: 20px;
  781. font-weight: bold;
  782. color: #4c4c4c;
  783. line-height: 24px;
  784. }
  785. /*子标题*/
  786. .err_container .sub-title {
  787. font-size: 12px;
  788. font-family: Microsoft YaHei;
  789. font-weight: 400;
  790. color: #4b4b4b;
  791. line-height: 24px;
  792. }
  793. .err_img {
  794. width: 73px;
  795. height: 83px;
  796. }
  797. .chart_view_first {
  798. position: relative;
  799. bottom: 10px;
  800. }
  801. .chart_view_second {
  802. position: relative;
  803. bottom: 5px;
  804. }
  805. /*倒计时样式*/
  806. .count_down_text {
  807. font-size: 35px;
  808. font-family: PingFang SC;
  809. font-weight: 400;
  810. color: #fff;
  811. line-height: 28px;
  812. }
  813. .chart {
  814. width: 360px;
  815. height: 193px;
  816. background: #302d43;
  817. opacity: 0.6;
  818. border-radius: 10px;
  819. }
  820. /* 提高dialog提示的层级 */
  821. #van-dialog {
  822. z-index: 10000001 !important;
  823. }
  824. .dot-amp {
  825. background: #D4327A;
  826. }
  827. .dot-med {
  828. background: #40FF31;
  829. }
  830. .circle_container {
  831. width: 100%;
  832. height: 150px;
  833. background: #302D43;
  834. opacity: 0.6;
  835. border-radius: 20px;
  836. display: flex;
  837. justify-content: space-around;
  838. align-items: center;
  839. }
  840. .circle_text {
  841. width: 100%;
  842. padding-bottom: 50px;
  843. }
  844. .online_att_txt {
  845. font-size: 40px;
  846. font-family: Arial;
  847. font-weight: bold;
  848. color: #FAB615;
  849. /*height: 186px;*/
  850. }
  851. .online_med_txt {
  852. font-size: 40px;
  853. font-family: Arial;
  854. font-weight: bold;
  855. color: #40FF31;
  856. /*height: 186px;*/
  857. }
  858. .online_desc {
  859. font-size: 12px;
  860. font-weight: 400;
  861. color: #FFFFFF;
  862. }
  863. </style>