|
@@ -3,7 +3,10 @@
|
|
|
<!-- 计费面板模块-->
|
|
|
<div class="game_panel padding-top-sm">
|
|
|
<van-row gutter="16">
|
|
|
- <van-col span="8" offset="2">
|
|
|
+ <van-col
|
|
|
+ span="8"
|
|
|
+ offset="2"
|
|
|
+ >
|
|
|
<view class="text-sm">
|
|
|
<text class="title">本次游玩时间</text>
|
|
|
</view>
|
|
@@ -11,7 +14,10 @@
|
|
|
<text class="count_down_text">{{ played_time_text }}</text>
|
|
|
</view>
|
|
|
</van-col>
|
|
|
- <van-col span="10" offset="4">
|
|
|
+ <van-col
|
|
|
+ span="10"
|
|
|
+ offset="4"
|
|
|
+ >
|
|
|
<view class="text-sm">
|
|
|
<text class="title">计费模式</text>
|
|
|
<text class="type padding-left-sm">{{ mode_item.name }}</text>
|
|
@@ -34,7 +40,10 @@
|
|
|
<!-- 设备状态-->
|
|
|
<div class="game_status padding-tb">
|
|
|
<van-row>
|
|
|
- <van-col span="10" offset="2">
|
|
|
+ <van-col
|
|
|
+ span="10"
|
|
|
+ offset="2"
|
|
|
+ >
|
|
|
<div
|
|
|
class="flex flex-direction align-center justify-center"
|
|
|
v-if="device_bg"
|
|
@@ -46,7 +55,10 @@
|
|
|
/>
|
|
|
<text class="text-default">已经正确佩戴</text>
|
|
|
</div>
|
|
|
- <div class="flex flex-direction align-center justify-center" v-else>
|
|
|
+ <div
|
|
|
+ class="flex flex-direction align-center justify-center"
|
|
|
+ v-else
|
|
|
+ >
|
|
|
<img
|
|
|
src="https://img.shuimuai.com/web/touhuanzhuangtai_3.png"
|
|
|
alt=""
|
|
@@ -254,7 +266,7 @@ export default {
|
|
|
//游戏结束方法
|
|
|
game_finished() {
|
|
|
bluetooth.sendEnd();
|
|
|
-
|
|
|
+
|
|
|
$this.$emit("closePop", true);
|
|
|
//取消监听低功耗蓝牙设备
|
|
|
wx.offBLECharacteristicValueChange();
|
|
@@ -280,7 +292,7 @@ export default {
|
|
|
forbidClick: true,
|
|
|
mask: true,
|
|
|
message: "正在生成报告...",
|
|
|
- duration: 0
|
|
|
+ duration: 0,
|
|
|
});
|
|
|
},
|
|
|
to_report() {
|
|
@@ -299,19 +311,17 @@ export default {
|
|
|
keepScreenOn: true,
|
|
|
});
|
|
|
|
|
|
-
|
|
|
bluetooth.watchingDevice($this);
|
|
|
bluetooth.sendControl();
|
|
|
},
|
|
|
|
|
|
// ArrayBuffer转16进度字符串示例
|
|
|
ab2hex(buffer) {
|
|
|
- var hexArr = Array.prototype.map.call(
|
|
|
- new Uint8Array(buffer),
|
|
|
- function (bit) {
|
|
|
- return ("00" + bit.toString(16)).slice(-2);
|
|
|
- }
|
|
|
- );
|
|
|
+ var hexArr = Array.prototype.map.call(new Uint8Array(buffer), function(
|
|
|
+ bit
|
|
|
+ ) {
|
|
|
+ return ("00" + bit.toString(16)).slice(-2);
|
|
|
+ });
|
|
|
return hexArr.join("");
|
|
|
},
|
|
|
// 往后端推送一次定时数据
|
|
@@ -409,13 +419,53 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 处理游戏中数据的方法
|
|
|
- do_datas: function ($data) {
|
|
|
+ do_datas: function($data) {
|
|
|
+ var $delta =
|
|
|
+ Math.round($data["delta"]) > 10000
|
|
|
+ ? parseInt(
|
|
|
+ Math.round($data["delta"])
|
|
|
+ .toString()
|
|
|
+ .slice(0, 4)
|
|
|
+ )
|
|
|
+ : Math.round($data["delta"]);
|
|
|
+ var $alpha =
|
|
|
+ Math.round($data["alpha"]) > 1000
|
|
|
+ ? Math.round($data["alpha"])
|
|
|
+ .toString()
|
|
|
+ .slice(0, 4)
|
|
|
+ : Math.round($data["alpha"]);
|
|
|
+ var $theta =
|
|
|
+ Math.round($data["theta"]) > 1000
|
|
|
+ ? Math.round($data["theta"])
|
|
|
+ .toString()
|
|
|
+ .slice(0, 4)
|
|
|
+ : Math.round($data["theta"]);
|
|
|
+ var $beta =
|
|
|
+ Math.round($data["theta"]) > 1000
|
|
|
+ ? Math.round($data["delta"])
|
|
|
+ .toString()
|
|
|
+ .slice(0, 4)
|
|
|
+ : Math.round($data["beta"]);
|
|
|
$this.att_list.push($data["att"]);
|
|
|
$this.med_list.push($data["med"]);
|
|
|
- $this.delta_list.push(Math.round($data["delta"] / 10000));
|
|
|
- $this.alpha_list.push(Math.round($data["alpha"] / 10000));
|
|
|
- $this.theta_list.push(Math.round($data["theta"] / 10000));
|
|
|
- $this.beta_list.push(Math.round($data["beta"]) / 10000);
|
|
|
+ // $this.delta_list.push(Math.round($data["delta"]));
|
|
|
+ // $this.alpha_list.push(Math.round($data["alpha"] / 10000));
|
|
|
+ // $this.theta_list.push(Math.round($data["theta"]));
|
|
|
+ // $this.beta_list.push(Math.round($data["beta"]) / 10000);
|
|
|
+ $this.delta_list.push($delta);
|
|
|
+ // $this.delta_list.push(8888);
|
|
|
+ $this.alpha_list.push($alpha);
|
|
|
+ $this.theta_list.push($theta);
|
|
|
+ $this.beta_list.push($beta);
|
|
|
+ console.log(
|
|
|
+ "游戏中的4个基本脑波 ----------------------------",
|
|
|
+ $delta,
|
|
|
+ $alpha,
|
|
|
+ $theta,
|
|
|
+ $beta,
|
|
|
+ "delta",
|
|
|
+ $this.delta_list
|
|
|
+ );
|
|
|
|
|
|
if ($this.att_list.length > 50) {
|
|
|
$this.att_list.shift();
|
|
@@ -502,7 +552,6 @@ export default {
|
|
|
// message: '智脑环已断开连接,请重新扫码智脑环',
|
|
|
// duration: 0,
|
|
|
// });
|
|
|
-
|
|
|
},
|
|
|
created() {
|
|
|
$this = this;
|