index.vue 24 KB

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