rong air 4 rokov pred
rodič
commit
27ecce975b

+ 5 - 0
src/components/device/device.vue

@@ -262,6 +262,11 @@ export default {
             Toast.success("已成功断开");
           },
         });
+        bluetooth.sendPause($this._deviceId, bluetooth.serviceId, bluetooth.cid)
+        bluetooth.sendEnd($this._deviceId, bluetooth.serviceId, bluetooth.cid)
+        bluetooth.shutdownSendControl($this._deviceId, bluetooth.serviceId, bluetooth.cid)
+
+
       }
     },
 

+ 11 - 13
src/components/index/personal.vue

@@ -57,13 +57,13 @@
         </van-col>
       </van-row>
       <van-row class="padding">
-        <view style="opacity: 0;">
+        <view style="opacity: 1;">
           <van-col span="4" class="lg" offset="2">
             <text class="cuIcon-selection"></text>
-            积分:
+            卡号:
           </van-col>
           <van-col span="8">
-            <text class="text-white text-bold text-xxl jifen">{{ userinfo.experience }}</text>
+            <text class="text-white text-bold text-lg">{{ invite_code }}</text>
           </van-col>
         </view>
 
@@ -163,8 +163,9 @@ export default {
       userinfo: {
         //判断是否第一次进入小程序 1为是第一次 0为非第一次
       },
-      first: 0,
-      pop_show: false
+      first: false,
+      pop_show: false,
+      invite_code:false
     }
   },
   methods: {
@@ -177,6 +178,7 @@ export default {
             let $res = res.data
             $this.userinfo['login_time'] = $res.data
             $this.$store.commit('set_userinfo', $this.userinfo)
+            wx.setStorageSync("is_first", false)
             reload_userinfo($this)
           })
           Toast.success($res.errmsg)
@@ -185,6 +187,7 @@ export default {
         }
       })
     },
+    //修改第一次登录状态
     close_pop() {
       this.pop_show = false
     },
@@ -207,14 +210,9 @@ export default {
     },
   },
   mounted() {
-    let $userinfo = wx.getStorageSync('userinfo')
-    if ($userinfo['login_time'] == 0) {
-      console.log('第一次登录')
-      $this.first = true
-    } else {
-      $this.first = false
-    }
-    $this.userinfo = $userinfo
+    $this.first = wx.getStorageSync('is_first')
+    $this.invite_code = wx.getStorageSync('code')
+    reload_userinfo($this)
     // else if ($this.userinfo.play_time == 0) {
     //   $this.pop_show = true
     // }

+ 3 - 1
src/components/index/regist.vue

@@ -134,6 +134,7 @@ export default {
       if ($this.title == "注册") {
         userRegister($params).then((res) => {
             console.log(res)
+            wx.setStorageSync("is_first", true)
             let $data = res.data
             if (!$data['code']) {
               Toast.clear()
@@ -148,6 +149,7 @@ export default {
         )
       } else if ($this.title == "登录") {
         userLogin($params).then((res) => {
+            wx.setStorageSync("is_first", false)
             console.log(res)
             let $data = res.data
             Toast.clear()
@@ -198,7 +200,7 @@ export default {
   },
   mounted() {
     $this.invite = $this.$store.getters.get_invite_code ? $this.$store.getters.get_invite_code : wx.getStorageSync('code')
-    // $this.invite = 3
+    // $this.invite = 1000000000
     console.log('regist-invite', $this.invite)
     mpvue.login({
       success($res) {

+ 2 - 1
src/main.js

@@ -6,7 +6,8 @@ import store from '@/store/index'
 
 
 var fly = new Fly()
-fly.config.baseURL = "https://testapi.shuimuai.com/"
+// fly.config.baseURL = "https://testapi.shuimuai.com/"
+fly.config.baseURL = "https://api.shuimuai.com/"
 fly.config.headers = {
   access_token:11,
   // 'Content-Type':'multipart/form-data; boundary=AaB03x'

+ 5 - 5
src/pages/start/index.vue

@@ -451,14 +451,14 @@ export default {
   },
   onUnload() {
     // 返回 的时候 暂停
-    // const countDown = $this.$mp.page.selectComponent('.control-count-down');
-    // countDown.pause();
+    const countDown = $this.$mp.page.selectComponent('.control-count-down');
+    countDown.pause();
     // bluetooth.sendPause($this._deviceId, $this._serviceId, $this._characteristicId)
     // bluetooth.sendEnd($this._deviceId, $this._serviceId, $this._characteristicId)
 
-    // let $play_time = $this.timeData.minutes * 60 + $this.timeData.seconds
-    // console.log($play_time)
-    // game_store.commit('setPlayTime', $play_time)
+    let $play_time = $this.timeData.minutes * 60 + $this.timeData.seconds
+    console.log($play_time)
+    game_store.commit('setPlayTime', $play_time)
     this.pop_show = false
   }
 }

+ 1 - 1
src/requests/main.js

@@ -1,7 +1,7 @@
 import Fly from 'flyio/dist/npm/wx'
 
 var fly = new Fly()
-fly.config.baseURL = "https://testapi.shuimuai.com/"
+fly.config.baseURL = "https://api.shuimuai.com/"
 fly.config.headers = {
   access_token: 11,
   // 'Content-Type':'multipart/form-data; boundary=AaB03x'