Quellcode durchsuchen

删除用户vip及用户邀请码页面

chaooo vor 1 Jahr
Ursprung
Commit
43361cd3d2

+ 0 - 2
src/app.json

@@ -13,8 +13,6 @@
     "pages/user/edit/confirm_phone_first/main",
     "pages/user/edit/confirm_phone_finally/main",
     "pages/user/orders/main",
-    "pages/user/vip/main",
-    "pages/user/vip_code/main",
     "pages/coupons/main"
   ],
   "window": {

+ 6 - 8
src/components/connection/index.vue

@@ -30,19 +30,16 @@ export default {
         img: "",
         hex: "",
       },
+      // $this.$connection 设置的参数
       // 连接教具 0:未连接 1:连接中 2:已连接 3:连接失败 4:游戏中
       connect_toy: 0,
-
-
-      // $this.$connection 设置的参数
       // 设置图标的颜色
       device_bg: false,
-      // 电量
+      // 脑机电量
       device_power: 0,
-      // 判断是否已经连接教具
-      // toy_connected: false,
+      // 教具电量
+      toy_power: 0,
       toy_sn:"",
-      toy_power:0,
     }
   },
   created() {
@@ -77,11 +74,12 @@ export default {
           }
         }, 1500);
       } else {
-        $this.device_status = 0;
         if ($status * 1 > 0) {
           // 取消连接-关闭脑机蓝牙连接
           $this.$connection.closeConnection($this);
         }
+        $this.device_status = 0;
+        $this.connect_toy = 0;
       }
     },
     /**

+ 2 - 0
src/components/connection/toys/selection.vue

@@ -43,6 +43,8 @@ export default {
           }
         });
         $this.select_status = true;
+        // 默认选择一个教具
+        $this.chooseToy(0);
       });
     }
   }

+ 33 - 38
src/pages/games/start/index.vue

@@ -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) {

+ 3 - 3
src/pages/index/index.vue

@@ -53,9 +53,9 @@ export default {
     }
   },
   onLoad() {
-    if (process.env.NODE_ENV == "development") {
-      wx.setStorageSync('token', "WxN3rgbWyVpjyBhi4uT6mZmwajZ3dFlm");
-    }
+    // if (process.env.NODE_ENV == "development") {
+    //   wx.setStorageSync('token', "WxN3rgbWyVpjyBhi4uT6mZmwajZ3dFlm");
+    // }
     //  判断存储是否登录
     let $token = wx.getStorageSync("token");
     if ($token) {

+ 41 - 38
src/pages/user/index.vue

@@ -57,24 +57,24 @@
         <view>次卡</view>
       </van-col>
     </van-row>
-    <view class="detail flex justify-around">
-      <!--      会员码-->
-      <img
-        src="https://img.shuimuai.com/m_btn_huiyuanma%402x.png"
-        @click="to_vip_code"
-      />
-      <!--      会员权益-->
-      <img
-        src="https://img.shuimuai.com/m_btn_huiyuanquanyi%402x.png"
-        @click="to_vip"
-      />
-      <!--      加入家庭组-->
-      <img
-        src="https://img.shuimuai.com/m_btn_jiatingzu%402x.png"
-        @click="open_scan"
-      />
-    </view>
-
+    <view class="line"></view>
+<!--    <view class="detail flex justify-around">-->
+<!--      &lt;!&ndash;      会员码&ndash;&gt;-->
+<!--      <img-->
+<!--        src="https://img.shuimuai.com/m_btn_huiyuanma%402x.png"-->
+<!--        @click="to_vip_code"-->
+<!--      />-->
+<!--      &lt;!&ndash;      会员权益&ndash;&gt;-->
+<!--      <img-->
+<!--        src="https://img.shuimuai.com/m_btn_huiyuanquanyi%402x.png"-->
+<!--        @click="to_vip"-->
+<!--      />-->
+<!--      &lt;!&ndash;      加入家庭组&ndash;&gt;-->
+<!--      <img-->
+<!--        src="https://img.shuimuai.com/m_btn_jiatingzu%402x.png"-->
+<!--        @click="open_scan"-->
+<!--      />-->
+<!--    </view>-->
     <!--    菜单模块-->
     <van-cell-group class="menu">
       <van-cell
@@ -143,25 +143,25 @@ export default {
         url: "/pages/user/edit/main",
       });
     },
-    //跳转vip权益
-    to_vip() {
-      mpvue.navigateTo({
-        url: "/pages/user/vip/main",
-      });
-    },
-    //打开扫一扫
-    open_scan() {
-      Toast.fail("暂未开通");
-      // mpvue.scanCode({
-      //   onlyFromCamera: true
-      // })
-    },
-    //跳转会员码
-    to_vip_code() {
-      mpvue.navigateTo({
-        url: "/pages/user/vip_code/main",
-      });
-    },
+    // //跳转vip权益
+    // to_vip() {
+    //   mpvue.navigateTo({
+    //     url: "/pages/user/vip/main",
+    //   });
+    // },
+    // //打开扫一扫
+    // open_scan() {
+    //   Toast.fail("暂未开通");
+    //   // mpvue.scanCode({
+    //   //   onlyFromCamera: true
+    //   // })
+    // },
+    // //跳转会员码
+    // to_vip_code() {
+    //   mpvue.navigateTo({
+    //     url: "/pages/user/vip_code/main",
+    //   });
+    // },
     to_coupons() {
       mpvue.navigateTo({
         url: "/pages/coupons/main",
@@ -304,7 +304,9 @@ image.bianji {
   color: #c7c4d8;
   margin-top: -2px;
 }
-
+.line{
+  height:30px;
+}
 /* 详细数据 */
 .detail {
   width: 100%;
@@ -331,6 +333,7 @@ image.bianji {
 /* 菜单 */
 .menu {
   width: 100%;
+  margin-top:100px;
 }
 
 .menu image:first-child {

+ 0 - 232
src/pages/user/vip/index.vue

@@ -1,232 +0,0 @@
-<template>
-  <div class="uc_vip_container">
-    <div class="banner">
-      <view class="banner_text">
-        <text>{{ userinfo['level_name'] }}</text>
-      </view>
-    </div>
-
-    <div class="content">
-      <div class="title">
-        <text>我的会员权益</text>
-      </div>
-
-      <!--      权益列表-->
-      <van-row gutter="10" class="benefit-row">
-        <van-col span="8">
-          <view class="benefit">
-            <img src="https://img.shuimuai.com/quanyi_icon_1.png" alt="" class="icon1">
-            <view>
-              <text class="title">会员卡</text>
-            </view>
-            <view>
-              <text class="subtitle">{{ datas.card }}张</text>
-            </view>
-          </view>
-        </van-col>
-        <van-col span="8">
-          <view class="benefit">
-            <img src="https://img.shuimuai.com/quanyi_icon_2.png" alt="" class="icon2">
-            <view>
-              <text class="title">核销时间{{ datas.play_time }}分钟</text>
-            </view>
-            <view>
-              <text class="subtitle">游玩限期{{ datas.validity }}个月</text>
-            </view>
-          </view>
-        </van-col>
-        <van-col span="8">
-          <view class="benefit">
-            <img src="https://img.shuimuai.com/quanyi_icon_3.png" alt="" class="icon3">
-            <view>
-              <text class="title">参与活动</text>
-            </view>
-            <view>
-              <text class="subtitle">{{ datas.activity }}个月内</text>
-            </view>
-          </view>
-        </van-col>
-        <van-col span="8">
-          <view class="benefit">
-            <img src="https://img.shuimuai.com/quanyi_icon_4.png" alt="" class="icon4">
-            <view>
-              <text class="title">租售产品</text>
-            </view>
-            <view>
-              <text class="subtitle">租{{ datas.lease_num }}套每天{{ datas.lease_time }}分钟</text>
-            </view>
-          </view>
-        </van-col>
-        <van-col span="8">
-          <view class="benefit">
-            <img src="https://img.shuimuai.com/quanyi_icon_5.png" alt="" class="icon5">
-            <view>
-              <text class="title">参与课程</text>
-            </view>
-            <view>
-              <text class="subtitle">{{ datas.course }}个月</text>
-            </view>
-          </view>
-        </van-col>
-        <van-col span="8">
-          <view class="benefit">
-            <img src="https://img.shuimuai.com/quanyi_icon_6.png" alt="" class="icon6">
-            <view>
-              <text class="title">邀请有奖</text>
-            </view>
-            <view>
-              <text class="subtitle">{{ datas.activity }}个月</text>
-            </view>
-          </view>
-        </van-col>
-      </van-row>
-
-
-      <!--      权益描述-->
-      <view class="desc" v-html="datas.content">
-      </view>
-    </div>
-  </div>
-</template>
-
-<script>
-
-import {vipPowerLevel} from "../../../requests/vip";
-import utils from '../../../utils/index'
-
-var $this
-export default {
-  name: "uc_vip_container",
-  components: {},
-  data() {
-    return {
-      datas: [],
-      userinfo: {},
-    }
-  },
-  methods: {
-    //获取页面数据初始化
-    getData() {
-      vipPowerLevel().then((res) => {
-        let $data = res.data;
-        $this.datas = $data.data
-      })
-    }
-  }
-  ,
-  mounted() {
-    $this.getData()
-    $this.userinfo = wx.getStorageSync('userinfo')
-    //$this.userinfo['level_name'] = utils.get_level_name($this.userinfo['level'])
-  },
-  created() {
-    $this = this;
-  },
-  onLoad() {
-  }
-}
-</script>
-
-<style scoped>
-.banner {
-  width: 100%;
-  height: 100px;
-  background-image: url("https://img.shuimuai.com/web/banner_huiyuan.png");
-  background-size: 100% 100%;
-  background-position: center;
-}
-
-.uc_vip_container .content {
-  padding: 10px;
-}
-
-.uc_vip_container .content .title {
-  font-size: 12px;
-  font-family: PingFang SC;
-  font-weight: 400;
-  color: #6B6B6B;
-  line-height: 24px;
-
-}
-
-/*权益grid*/
-.benefit {
-  text-align: center;
-  margin-top: 20px;
-}
-
-.benefit .icon:first-child {
-  width: 44px;
-  height: 31px;
-}
-
-.benefit .title {
-  font-size: 14px;
-  font-family: PingFang SC;
-  font-weight: 400;
-  color: #6B6B6B;
-  line-height: 20px;
-
-}
-
-.benefit .subtitle {
-  font-size: 10px;
-  font-family: PingFang SC;
-  font-weight: 400;
-  color: #6B6B6B;
-}
-
-.desc {
-  margin: 30px 0px;
-  width: 355px;
-  height: 273px;
-  font-size: 12px;
-  font-family: PingFang SC;
-  font-weight: 400;
-  color: #6B6B6B;
-  line-height: 20px;
-  padding: 15px;
-}
-
-.banner_text {
-  width: 100%;
-  height: 17px;
-  font-size: 18px;
-  font-family: Microsoft YaHei;
-  font-weight: bold;
-  color: #FFFFFF;
-  text-align: center;
-  padding-top: 60px;
-
-}
-
-.icon1 {
-  width: 44px;
-  height: 31px;
-}
-
-.icon2 {
-  width: 35px;
-  height: 37px;
-}
-
-.icon3 {
-  width: 45px;
-  height: 43px;
-}
-
-.icon4 {
-  width: 34px;
-  height: 39px;
-}
-
-.icon5 {
-  width: 37px;
-  height: 32px;
-}
-
-.icon6 {
-  width: 33px;
-  height: 36px;
-}
-</style>

+ 0 - 12
src/pages/user/vip/main.js

@@ -1,12 +0,0 @@
-import Vue from 'vue'
-import App from './index'
-
-// add this to handle exception
-Vue.config.errorHandler = function (err) {
-  if (console && console.error) {
-    console.error(err)
-  }
-}
-
-const app = new Vue(App)
-app.$mount()

+ 0 - 6
src/pages/user/vip/main.json

@@ -1,6 +0,0 @@
-{
-  "usingComponents": {
-    "van-row": "/static/vant/row/index",
-    "van-col": "/static/vant/col/index"
-  }
-}

+ 0 - 122
src/pages/user/vip_code/index.vue

@@ -1,122 +0,0 @@
-<template>
-  <div class="uc_vip_code_container">
-    <div class="card text-center padding-top-xl">
-      <view class="user margin-xl">
-        <view class="up">
-          <view class="left">
-            <img :src="userinfo.portrait"/>
-            <view>
-              <text>
-                <text>{{ userinfo.user_name }}</text>
-              </text>
-              <text>{{ userinfo.level_name }} </text><text  v-if="userinfo.level != 1"> 有效期至 {{ userinfo.validity_time }}</text>
-            </view>
-          </view>
-        </view>
-      </view>
-      <img src="https://img.shuimuai.com/web/demo_code.png" class="qrcode margin-xl" alt="">
-      <view class="text-center">
-        <text class="text-normal ">邀请卡:&emsp;{{ userinfo.invite_id }}</text>
-      </view>
-    </div>
-  </div>
-</template>
-
-<script>
-import utils from '@/utils/index'
-
-var $this
-export default {
-  name: "uc_vip_code_container",
-  components: {},
-  data() {
-    return {
-      userinfo: {},
-      invite_code: ""
-    }
-  },
-  methods: {}
-  ,
-  mounted() {
-  },
-  created() {
-    $this = this;
-  },
-  onLoad() {
-    $this.userinfo = wx.getStorageSync('userinfo')
-    $this.invite_code = wx.getStorageSync('code')
-
-  }
-}
-</script>
-
-<style scoped>
-.uc_vip_code_container {
-  padding: 80px 0px;
-}
-
-.card {
-  width: 347px;
-  height: 403px;
-  background: #FFFFFF;
-  box-shadow: 0px 3px 7px 0px #A6A6A6;
-  border-radius: 11px;
-  margin: 0px auto;
-}
-
-.user {
-  width: 100%;
-}
-
-.user .up {
-  width: 100%;
-  height: 40px;
-  margin-top: 9px;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-
-.user .up .left {
-  height: 40px;
-  display: flex;
-  align-items: center;
-  justify-content: start;
-}
-
-.user .up .left image {
-  width: 40px;
-  height: 40px;
-  margin-left: 17px;
-  margin-right: 8px;
-}
-
-
-.user .up .left view {
-  height: 40px;
-  display: flex;
-  flex-direction: column;
-  align-items: flex-start;
-  justify-content: space-between;
-}
-
-.user .up .left view text:first-child {
-  font-size: 15px;
-  font-weight: bold;
-}
-
-.user .up .left view text:last-child {
-  font-size: 13px;
-}
-
-.user .up .right {
-  height: 40px;
-
-}
-
-.qrcode {
-  width: 139px;
-  height: 139px;
-
-}
-</style>

+ 0 - 12
src/pages/user/vip_code/main.js

@@ -1,12 +0,0 @@
-import Vue from 'vue'
-import App from './index'
-
-// add this to handle exception
-Vue.config.errorHandler = function (err) {
-  if (console && console.error) {
-    console.error(err)
-  }
-}
-
-const app = new Vue(App)
-app.$mount()

+ 0 - 6
src/pages/user/vip_code/main.json

@@ -1,6 +0,0 @@
-{
-  "usingComponents": {
-    "van-row": "/static/vant/row/index",
-    "van-col": "/static/vant/col/index"
-  }
-}

+ 3 - 1
src/store/bluetooth.js

@@ -33,11 +33,13 @@ const setters = {
     wx.removeStorageSync('device_id')
     wx.removeStorageSync('device_sn')
     wx.removeStorageSync('service_id')
-    wx.removeStorageSync('is_new')
     wx.removeStorageSync('characteristic_write_id')
     wx.removeStorageSync('characteristic_notify_id')
     wx.setStorageSync('current_toy_id', '00')
   },
+  removeToyItem(toy_item) {
+    wx.removeStorageSync('toy_item')
+  },
   setBluetoothLinkStatus($bool) {
     wx.setStorageSync("ble_link_status", $bool)
   },

+ 1 - 1
src/utils/connection.js

@@ -540,7 +540,7 @@ export default {
     $this.connect_toy = 0;
     //$this.connect_show = false;
     $this.device_bg = false;
-    $this.connect_status = false;
+    //$this.connect_status = false;
 
     // 断开教具及蓝牙连接
     that.SendOrder("31");