Bläddra i källkod

1.调整tabbar的位置,2.评分分数降低3.调整选择年级弹窗

bayi 2 år sedan
förälder
incheckning
fdf968e354

+ 11 - 1
app.js

@@ -64,7 +64,17 @@ App({
           scene
         } = wx.getLaunchOptionsSync()
         // 1023	安卓系统桌面图标,1104微信聊天主界面下拉,「我的小程序」栏(基础库2.2.4-2.29.0版本废弃,2.29.1版本起生效) 
-        this.globalData.desktopTips = this.globalData.isIOS ? scene != 1104 : scene != 1023
+        if (this.globalData.isIOS ? scene != 1104 : scene != 1023) {
+          let preTime = wx.getStorageSync('preDesktopTime')
+          let flag = !preTime ? true : (new Date() - preTime) / 43200000 > 1 ? true : false
+          if (flag) {
+            this.globalData.desktopTips = true
+            wx.setStorage({
+              key: "preDesktopTime",
+              data: new Date()
+            })
+          }
+        }
       }
     })
   },

+ 10 - 19
components/navigationBar/index.js

@@ -8,6 +8,7 @@ import {
 import {
   store
 } from '~/store/index'
+let timer
 Component({
   // 自动绑定
   behaviors: [storeBindingsBehavior],
@@ -35,32 +36,19 @@ Component({
     temporaryGrade: null
   },
   pageLifetimes: {
-    show: function () {
+    show() {
       if (!this.data.userInfo.grade) {
-        let timer = setInterval(() => {
-          if (this.data.userInfo.uid && this.data.userInfo.grade) {
-            clearInterval(timer)
-          } else {
+        timer = setInterval(() => {
+          if (this.data.userInfo.uid && !this.data.userInfo.grade) {
             this.showGrade()
+          } else if (this.data.userInfo.uid && this.data.userInfo.grade) {
             clearInterval(timer)
           }
         }, 500)
       }
     },
-  },
-  lifetimes: {
-    attached() {
-      // if (!this.data.userInfo.grade) {
-      //   let timer = setInterval(() => {
-      //     console.log(this.data.userInfo.uid, this.data.userInfo.grade);
-      //     if (this.data.userInfo.uid && this.data.userInfo.grade) {
-      //       clearInterval(timer)
-      //     } else {
-      //       this.showGrade()
-      //       clearInterval(timer)
-      //     }
-      //   }, 500)
-      // }
+    hide() {
+      clearInterval(timer)
     }
   },
   methods: {
@@ -85,6 +73,9 @@ Component({
       })
     },
     showGrade() {
+      if (this.data.isGradeShow) {
+        return
+      }
       this.setData({
         isGradeShow: true,
         temporaryGrade: this.data.userInfo.grade

+ 0 - 3
components/videoPreview/index.js

@@ -48,9 +48,6 @@ Component({
       type: String,
       // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,
       value: 'public',
-      observer(val) {
-        console.log(val);
-      }
     },
     currentId: {
       type: Number

+ 0 - 3
components/worksList/index.js

@@ -54,9 +54,6 @@ Component({
       type: String,
       // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,collection为收藏时的样式,
       value: 'public',
-      observer(val) {
-        console.log(val);
-      }
     },
     // 是否在tabbar页面使用
     tabBarPadding: {

+ 5 - 5
custom-tab-bar/index.js

@@ -15,16 +15,16 @@ Component({
     color: "#999999",
     selectedColor: "#32CA69",
     listTab: [{
-      "pagePath": "/pages/works/index",
-      "text": "作品",
-      "iconPath": "/static/zp.png",
-      "selectedIconPath": "/static/zp2.png"
-    }, {
       "pagePath": "/pages/index/index",
       "text": "推荐",
       "iconPath": "/static/tj.png",
       "selectedIconPath": "/static/tj2.png"
     }, {
+      "pagePath": "/pages/works/index",
+      "text": "作品",
+      "iconPath": "/static/zp.png",
+      "selectedIconPath": "/static/zp2.png"
+    }, {
       "pagePath": "/pages/my/index",
       "text": "我的",
       "iconPath": "/static/my.png",

+ 1 - 2
pages/index/index.js

@@ -30,7 +30,7 @@ Page({
   onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 1
+        selected: 0
       })
     }
     this.getLocUserInfo()
@@ -52,7 +52,6 @@ Page({
         })
       }, 6000)
     }
-
   },
   onUnload() {
     this.storeBindings.destroyStoreBindings()

+ 4 - 3
pages/reading/index.js

@@ -238,6 +238,7 @@ Page({
     let lessonText = JSON.parse(this.data.videoInfo.userReadExtend.lessonText).map((item) => {
       return item.text
     }).join('\n')
+    // https://www.chivox.com/opendoc/#/ChineseDoc/coreCn/Chinese/cn.sent.raw?id=%e5%8f%82%e6%95%b0%e8%af%b4%e6%98%8e <----参数说明
     wsEngine.start({
       request: {
         coreType: "cn.pred.raw",
@@ -246,7 +247,7 @@ Page({
         attachAudioUrl: 1,
         result: {
           details: {
-            gop_adjust: 1
+            gop_adjust: -0.8
           }
         }
       },
@@ -316,7 +317,7 @@ Page({
     const result = res.result;
     const integrity = Math.floor(result.integrity); //完成度
     const tone = Math.floor(result.tone); // 语调声调
-    const accuracy = Math.floor(result.overall); // 准确度 发音分
+    const accuracy = Math.floor(result.accuracy); // 准确度 发音分
     const fluency = Math.floor(result.fluency.overall); //流利度
     let myOverall = Math.floor(integrity * 0.3 + accuracy * 0.5 + fluency * 0.1 + tone * 0.1);
     let detail = {
@@ -362,7 +363,7 @@ Page({
           audioPath
         })
         let _data = this.data.readDetail
-        console.log('挑战分数-----:', {
+        console.log('挑战分数-----', {
           "userReadId": uploadRes.id,
           "complete": _data.integrity,
           "accuracy": _data.accuracy,

+ 1 - 1
pages/works/index.js

@@ -22,7 +22,7 @@ Page({
   onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 0
+        selected: 1
       })
     }
     let uid = wx.getStorageSync('uid')