瀏覽代碼

Merge branch 'newRender' into develop

# Conflicts:
#	pages/reading/index.js
bayi 2 年之前
父節點
當前提交
447ba095e2
共有 4 個文件被更改,包括 23 次插入33 次删除
  1. 3 3
      components/authority/index.less
  2. 3 3
      components/authority/index.wxss
  3. 5 20
      components/uploadFile/index.js
  4. 12 7
      pages/reading/index.js

+ 3 - 3
components/authority/index.less

@@ -4,14 +4,14 @@
   padding-bottom: 100px;
 
   .module {
-    margin-bottom: 20rpx;
+    margin-bottom: 30rpx;
     .topic {
       font-size: 38rpx;
       font-weight: bold;
     }
 
     .explain {
-      margin-top: 10rpx;
+      margin: 10rpx 0rpx;
       font-size: 24rpx;
     }
 
@@ -21,7 +21,7 @@
       flex-wrap: wrap;
 
       .work {
-        margin: 20rpx 0rpx;
+        margin: 10rpx 0rpx;
 
         .content {
           position: relative;

+ 3 - 3
components/authority/index.wxss

@@ -4,14 +4,14 @@
   padding-bottom: 100px;
 }
 .authority .module {
-  margin-bottom: 20rpx;
+  margin-bottom: 30rpx;
 }
 .authority .module .topic {
   font-size: 38rpx;
   font-weight: bold;
 }
 .authority .module .explain {
-  margin-top: 10rpx;
+  margin: 10rpx 0rpx;
   font-size: 24rpx;
 }
 .authority .module .works {
@@ -20,7 +20,7 @@
   flex-wrap: wrap;
 }
 .authority .module .works .work {
-  margin: 20rpx 0rpx;
+  margin: 10rpx 0rpx;
 }
 .authority .module .works .work .content {
   position: relative;

+ 5 - 20
components/uploadFile/index.js

@@ -5,13 +5,14 @@ import {
   store
 } from '~/store/index'
 import {
+  userEvent
+} from '~/api/global'
+import {
   publishWorks,
   postWorksScore,
   publishRankWorks
 } from '~/api/works'
-import {
-  userEvent
-} from '~/api/global'
+
 Component({
   behaviors: [storeBindingsBehavior],
   storeBindings: {
@@ -95,15 +96,10 @@ Component({
       };
       let res
       if (this.properties.readingType == 'readMatch') {
-        console.log('publishRankWorks1');
         res = await publishRankWorks(data)
-        console.log('publishRankWorks2');
       } else {
-        console.log('publishWorks1');
         res = await publishWorks(data)
-        console.log('publishWorks2');
       }
-      console.log('shareVideo', res);
       wx.setStorageSync('shareVideoId', res.id)
       let _data = this.data.readDetail
       let scoreRes = await postWorksScore({
@@ -115,18 +111,7 @@ Component({
         score: _data.myOverall,
       })
       console.log(scoreRes, 'scoreRes');
-      await userEvent({
-        action: 'WXSCORE',
-        targetContent: {
-          userReadId: res.id,
-          complete: _data.integrity,
-          accuracy: _data.accuracy,
-          speed: _data.fluency,
-          intonation: _data.tone,
-          score: _data.myOverall,
-          scoreRes: scoreRes
-        }
-      })
+
       this.setData({
         uploadFlag: false,
         uploadState: true,

+ 12 - 7
pages/reading/index.js

@@ -102,7 +102,6 @@ Page({
     // 录音授权
     wx.getSetting({
       success(res) {
-        console.log(res);
         if (!res.authSetting['scope.record']) {
           wx.authorize({
             scope: 'scope.record',
@@ -115,9 +114,7 @@ Page({
                 content: '请先开启录音功能',
                 success(res) {
                   wx.openSetting({
-                    success(res) {
-
-                    }
+                    success(res) {}
                   })
                 }
               })
@@ -130,8 +127,12 @@ Page({
     wsEngine.onResult((res) => {
       this.getRecordScore(res)
     });
-    wsEngine.onErrorResult((res) => {
+    wsEngine.onErrorResult(async (res) => {
       console.log("===收到错误结果=============", res)
+      await userEvent({
+        action: 'WXSCORE',
+        targetContent: res
+      })
     });
     this.innerAudioContext = wx.createInnerAudioContext();
     this.innerAudioContext.onTimeUpdate(res => {
@@ -342,7 +343,8 @@ Page({
       });
     });
   },
-  // eeeeee() {
+  // 直接跳转的时候用的,勿动
+  // util() {
   //   wx.navigateTo({
   //     url: `/pages/score/index?readingType=${this.data.readingType}`,
   //     events: {
@@ -360,7 +362,7 @@ Page({
   //   })
   // },
   // 获取测评结果
-  getRecordScore(res) {
+  async getRecordScore(res) {
     const result = res.result;
     const integrity = Math.floor(result.integrity); //完成度
     const tone = Math.floor(result.tone); // 语调声调
@@ -383,6 +385,9 @@ Page({
     }
     console.log('评测结果', detail);
     this.setReadDetail(detail)
+    await userEvent({
+      action: 'WXSCORE',
+    })
     if (this.data.readingType == 'public' || this.data.readingType == 'readMatch') {
       wx.navigateTo({
         url: `/pages/score/index?readingType=${this.data.readingType}&activityId=${this.data.activityId}`,