bayi пре 2 година
родитељ
комит
291583fd24
3 измењених фајлова са 8 додато и 4 уклоњено
  1. 2 0
      api/user.js
  2. 3 1
      app.js
  3. 3 3
      pages/reading/index.js

+ 2 - 0
api/user.js

@@ -5,6 +5,8 @@ import {
 module.exports = {
   // 用户登录
   userLogin: data => request('/user/openId', 'get', data),
+  // 统计用户登录
+  loginLog: data => request('/loginLog', 'post', data),
   //获取他人用户信息,
   getUserInfo: data => request('/user/info', 'get', data),
   //获取用户信息

+ 3 - 1
app.js

@@ -1,5 +1,6 @@
 // app.js
 import {
+  loginLog,
   userLogin,
   getMyInfo
 } from '~/api/user'
@@ -11,10 +12,11 @@ import {
 } from '~/store/index'
 let storeBindings
 App({
-  onLaunch() {
+  async onLaunch() {
     this.updateApplet()
     this.checkIsIos()
     this.getNavbarInfo()
+    await loginLog()
   },
   async onShow(options) {
     if (!this.storeBindings) {

+ 3 - 3
pages/reading/index.js

@@ -234,7 +234,7 @@ Page({
       readingReset: false,
       'countDown.state': true
     })
-    this.stl = setInterval(() => {
+    this.stl = setInterval(async () => {
       if (this.data.countDown.num == 0) {
         clearInterval(this.stl)
         this.setData({
@@ -244,8 +244,8 @@ Page({
             num: 3
           }
         })
-        this.playMediaState()
-        this.soundRecording()
+        await this.playMediaState()
+        await this.soundRecording()
         this.startRecording()
       } else {
         this.setData({