bayi пре 2 година
родитељ
комит
17abd2a49b
4 измењених фајлова са 20 додато и 4 уклоњено
  1. 7 1
      api/works.js
  2. 2 1
      components/uploadFile/index.js
  3. 1 0
      pages/reading/index.js
  4. 10 2
      pages/score/index.js

+ 7 - 1
api/works.js

@@ -31,4 +31,10 @@ module.exports = {
   // 分享时调用,判断分享作品是不是活动作品
   // wx/activityJoinRead/isActivityRead/{readId}2月17日 16:52
   isActivityWork: data => request(`/activityJoinRead/isActivityRead/${data}`, 'get'),
-}
+}
+
+/* 
+postWorksScore挑战分数上传
+publishRankWorks朗读赛分数上传
+publishWorks普通朗读结果上传
+*/

+ 2 - 1
components/uploadFile/index.js

@@ -121,10 +121,11 @@ Component({
         uploadSuccess: true,
         userReadId: res.id,
       })
+      wx.disableAlertBeforeUnload();
     },
     jumpWork() {
       wx.redirectTo({
-        url:'/pages/userWorks/index'
+        url: '/pages/userWorks/index'
       })
     }
   },

+ 1 - 0
pages/reading/index.js

@@ -622,6 +622,7 @@ Page({
     wsEngine.reset()
     this.resetReading()
     this.storeBindings.destroyStoreBindings()
+
   },
   backReading() {
     wx.navigateBack({

+ 10 - 2
pages/score/index.js

@@ -1,4 +1,3 @@
-
 import {
   createStoreBindings
 } from 'mobx-miniprogram-bindings'
@@ -15,7 +14,7 @@ Page({
     readingType: '',
     uploadHide: '',
     // 朗读赛的id
-    activityId: ''
+    activityId: '',
   },
 
   /**
@@ -23,6 +22,15 @@ Page({
    */
   async onLoad(options) {
     console.log(options);
+    wx.enableAlertBeforeUnload({
+      message: "未完成上传,是否退出?",
+      success: function (res) {
+        console.log(res)
+      },
+      fail: function (e) {
+        console.log(e)
+      }
+    })
     this.storeBindings = createStoreBindings(this, {
       store,
       fields: {