|
@@ -172,13 +172,13 @@ import util from "../../../utils";
|
|
|
import game_store from "@/store/game";
|
|
|
import Toast from "../../../../static/vant/toast/toast";
|
|
|
import {gameAddLine, gameEnd} from "../../../requests/game";
|
|
|
-// import mpvueEcharts from "mpvue-echarts";
|
|
|
+import mpvueEcharts from "mpvue-echarts";
|
|
|
import echarts from "../../../../static/echarts.min";
|
|
|
import {LogInDb} from "@/requests/log";
|
|
|
import WechatLog from '@/utils/wechat_log'
|
|
|
import {formatPlaySeconds, get_big_data} from "../../../utils/game";
|
|
|
|
|
|
-let att_charts, med_charts, $this;
|
|
|
+let att_charts, med_charts, $this, $timeout;
|
|
|
|
|
|
// 大脑图表初始化
|
|
|
function initAttChart(canvas, width, height) {
|
|
@@ -187,9 +187,7 @@ function initAttChart(canvas, width, height) {
|
|
|
height: height,
|
|
|
});
|
|
|
canvas.setChart(att_charts);
|
|
|
-
|
|
|
let option = {}; // ECharts 配置项
|
|
|
-
|
|
|
att_charts.setOption(option);
|
|
|
return att_charts; // 返回 chart 后可以自动绑定触摸操作
|
|
|
}
|
|
@@ -201,31 +199,34 @@ function initMedChart(canvas, width, height) {
|
|
|
height: height,
|
|
|
});
|
|
|
canvas.setChart(med_charts);
|
|
|
-
|
|
|
let option = {}; // ECharts 配置项
|
|
|
-
|
|
|
med_charts.setOption(option);
|
|
|
return med_charts; // 返回 chart 后可以自动绑定触摸操作
|
|
|
}
|
|
|
|
|
|
-var $timeout;
|
|
|
export default {
|
|
|
name: "StartGames",
|
|
|
- // components: {
|
|
|
- // mpvueEcharts,
|
|
|
- // },
|
|
|
+ components: {
|
|
|
+ mpvueEcharts,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
// 折线图
|
|
|
echarts,
|
|
|
attCharts: initAttChart,
|
|
|
medCharts: initMedChart,
|
|
|
- // 监听到的蓝牙数据
|
|
|
- hexStr:"",
|
|
|
+ // 检测佩戴是否正确
|
|
|
+ device_bg: true,
|
|
|
+ // 脑机电量
|
|
|
+ device_power: 0,
|
|
|
+ // 教具电量
|
|
|
+ toy_power: 0,
|
|
|
+ // 使用类型: 1:次数 2:时间 0:未选择
|
|
|
+ mode: 0,
|
|
|
|
|
|
|
|
|
- // 使用类型 1次数 2时间 0未选择
|
|
|
- mode: 0,
|
|
|
+ // 监听到的蓝牙数据
|
|
|
+ hexStr:"",
|
|
|
|
|
|
timeData: {},
|
|
|
mode_item: {},
|
|
@@ -275,19 +276,12 @@ export default {
|
|
|
|
|
|
//结束游戏时选择类型的时间
|
|
|
over_play_time: 0,
|
|
|
- // 检测佩戴是否正确
|
|
|
- device_bg: true,
|
|
|
+
|
|
|
|
|
|
// 蓝牙信号强度
|
|
|
RSSI: 0,
|
|
|
game_status: 0,
|
|
|
|
|
|
- toy_power: 0,
|
|
|
- //toy_voltage: 0,
|
|
|
- device_power: 0,
|
|
|
- //device_voltage: 0,
|
|
|
-
|
|
|
- //toy_UUID: "",
|
|
|
|
|
|
|
|
|
save_index: [
|
|
@@ -550,23 +544,24 @@ export default {
|
|
|
let $hide_status = game_store.getters.getHideStatus();
|
|
|
if (!$hide_status) {
|
|
|
//console.log("专注放松度:",$this.att_list, $this.med_list, $this.amp_list)
|
|
|
- //通过专注放松度 画图
|
|
|
- let $option = util.getLineOption($this.att_list, $this.med_list, $this.amp_list);
|
|
|
- att_charts.setOption($option);
|
|
|
-
|
|
|
- //通过基本脑波发送数据
|
|
|
- let $base_option = util.getBaseOption(
|
|
|
- $this.delta_list,
|
|
|
- $this.theta_list,
|
|
|
- $this.low_alphas,
|
|
|
- $this.high_alphas,
|
|
|
- $this.low_betas,
|
|
|
- $this.high_betas
|
|
|
- );
|
|
|
- med_charts.setOption($base_option);
|
|
|
+ if (att_charts) {
|
|
|
+ //通过专注放松度 画图
|
|
|
+ let $option = util.getLineOption($this.att_list, $this.med_list, $this.amp_list);
|
|
|
+ att_charts.setOption($option);
|
|
|
+ }
|
|
|
+ if (med_charts) {
|
|
|
+ //通过基本脑波发送数据
|
|
|
+ let $base_option = util.getBaseOption(
|
|
|
+ $this.delta_list,
|
|
|
+ $this.theta_list,
|
|
|
+ $this.low_alphas,
|
|
|
+ $this.high_alphas,
|
|
|
+ $this.low_betas,
|
|
|
+ $this.high_betas
|
|
|
+ );
|
|
|
+ med_charts.setOption($base_option);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
//保存的数据
|
|
|
for (let i = 0; i < $this.save_index.length; i++) {
|
|
|
if (this.game_datas[$this.save_index[i]] == undefined) {
|