bayi пре 2 година
родитељ
комит
69f2532df6
5 измењених фајлова са 29 додато и 20 уклоњено
  1. 1 2
      api/global.js
  2. 10 4
      components/uploadFile/index.js
  3. 6 3
      pages/pkResult/index.js
  4. 5 10
      pages/reading/index.js
  5. 7 1
      pages/score/index.js

Разлика између датотеке није приказан због своје велике величине
+ 1 - 2
api/global.js


+ 10 - 4
components/uploadFile/index.js

@@ -9,6 +9,9 @@ import {
   postWorksScore,
   publishRankWorks
 } from '~/api/works'
+import {
+  userEvent
+} from '~/api/global'
 Component({
   behaviors: [storeBindingsBehavior],
   storeBindings: {
@@ -41,7 +44,7 @@ Component({
    * 组件的方法列表
    */
   methods: {
-    upload() {
+    async upload() {
       if (this.data.uploadState) {
         return
       }
@@ -75,6 +78,9 @@ Component({
           percent: res.progress
         })
       })
+      await userEvent({
+        action: 'WXUPLOAD',
+      })
     },
     cancelMask() {
       this.setData({
@@ -83,9 +89,9 @@ Component({
     },
     async uploadWorks(audio) {
       const data = {
-        "exampleId": this.data.readDetail.id,
-        "audioPath": audio,
-        "originVideo": this.data.readDetail.originVideo,
+        exampleId: this.data.readDetail.id,
+        audioPath: audio,
+        originVideo: this.data.readDetail.originVideo,
       };
       let res
       if (this.properties.readingType == 'readMatch') {

+ 6 - 3
pages/pkResult/index.js

@@ -4,9 +4,11 @@ import {
 import {
   setDuration
 } from '~/utils/util'
+import {
+  userEvent
+} from '~/api/global'
 let innerAudioContext
 Page({
-
   /**
    * 页面的初始数据
    */
@@ -36,8 +38,6 @@ Page({
       pkRecord,
       pkRecordVOS
     } = await getPkResult(options.id)
-    console.log(options.id, pkRecord,
-      pkRecordVOS);
     this.setData({
       pkId: options.id,
       pkRecord,
@@ -45,6 +45,9 @@ Page({
     })
     this.compareScore(pkRecordVOS)
     this.innerAudioContext = wx.createInnerAudioContext()
+    await userEvent({
+      action: 'WXSCOREPK',
+    })
   },
   compareScore(resultData) {
     let first = resultData[0]

+ 5 - 10
pages/reading/index.js

@@ -390,17 +390,9 @@ Page({
         let audioPath = formateRes.data;
         let uploadRes = await publishWorks({
           exampleId: this.data.pkData.exampleId,
-          audioPath
+          audioPath,
         })
         let _data = this.data.readDetail
-        console.log('挑战分数-----', {
-          "userReadId": uploadRes.id,
-          "complete": _data.integrity,
-          "accuracy": _data.accuracy,
-          "speed": _data.fluency,
-          "intonation": _data.tone,
-          "score": _data.myOverall
-        });
         postWorksScore({
           "userReadId": uploadRes.id,
           "complete": _data.integrity,
@@ -415,6 +407,9 @@ Page({
           winnerUId: this.data.pkData.score > _data.myOverall ? this.data.pkData.uid : this.data.pkData.score == _data.myOverall ? '' : wx.getStorageSync('uid')
         }
         let result = await uploadPk(data)
+        await userEvent({
+          action: 'WXUPLOADPK',
+        })
         wx.redirectTo({
           url: `/pages/pkResult/index?id=${result.id}`
         })
@@ -517,7 +512,7 @@ Page({
       this.innerAudioContext.play();
     }
     await userEvent({
-      action: 'READING',
+      action: 'WXREADING',
       readId: this.data.videoInfo.userRead.id
     })
   },

+ 7 - 1
pages/score/index.js

@@ -1,4 +1,7 @@
 import {
+  userEvent
+} from '~/api/global'
+import {
   createStoreBindings
 } from 'mobx-miniprogram-bindings'
 import {
@@ -18,7 +21,7 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad(options) {
+  async onLoad(options) {
     this.storeBindings = createStoreBindings(this, {
       store,
       fields: {
@@ -35,6 +38,9 @@ Page({
       score,
       readingType: options.readingType ? options.readingType : ''
     })
+    await userEvent({
+      action: 'WXSCORE',
+    })
   },
   backReading() {
     let pagesList = getCurrentPages()