Browse Source

1.所有banner要支持按年级配置,废除按标签切换 2.官方推荐增加播放量

bayi 2 năm trước cách đây
mục cha
commit
d4c1b0a303

+ 64 - 38
components/authority/index.less

@@ -22,56 +22,82 @@
       .work {
         margin: 20rpx 0rpx;
 
-        .cover {
-          width: 344rpx;
-          height: 194rpx;
-          border-radius: 8rpx;
-        }
+        .content {
+          position: relative;
+          font-size: 0px;
 
-        .title {
-          width: 344rpx;
-          margin-top: 6rpx;
-          font-size: 32rpx;
-        }
-      }
+          .cover {
+            width: 344rpx;
+            height: 194rpx;
+            border-radius: 8rpx;
+          }
+
+          .audioBox {
+            position: relative;
 
-      .audioBox {
-        position: relative;
+            .audioPlay {
+              position: absolute;
+              left: 0px;
+              top: 0px;
+              bottom: 0px;
+              right: 0px;
+              margin: auto;
+              width: 220rpx;
+              height: 174rpx;
+              display: flex;
+              align-items: center;
+              justify-content: center;
 
-        .audioPlay {
-          position: absolute;
-          left: 0px;
-          top: 0px;
-          bottom: 0px;
-          right: 0px;
-          margin: auto;
-          width: 220rpx;
-          height: 174rpx;
-          display: flex;
-          align-items: center;
-          justify-content: center;
+              .audioPlayBg {
+                width: 150rpx;
+                height: 150rpx;
+              }
 
-          .audioPlayBg {
-            width: 150rpx;
-            height: 150rpx;
+              .audioPlayZhen {
+                position: absolute;
+                right: 30rpx;
+                top: 16rpx;
+                width: 32rpx;
+                height: 40rpx;
+              }
+
+              .cover {
+                position: absolute;
+                width: 130rpx;
+                height: 130rpx;
+                border-radius: 50%;
+              }
+            }
           }
 
-          .audioPlayZhen {
+          .mask {
             position: absolute;
-            right: 30rpx;
-            top: 16rpx;
-            width: 32rpx;
+            width: 100%;
             height: 40rpx;
-          }
+            bottom: 0px;
+            background: linear-gradient(0deg, rgba(0, 0, 0, .3), transparent);
+            display: flex;
+            align-items: center;
+            .fb {
+              margin: 6rpx 10rpx;
+              width: 26rpx;
+              height: 26rpx;
+            }
 
-          .cover {
-            position: absolute;
-            width: 130rpx;
-            height: 130rpx;
-            border-radius: 50%;
+            .fb-num {
+              font-size: 24rpx;
+              color: white;
+            }
           }
         }
+
+        .title {
+          width: 344rpx;
+          margin-top: 6rpx;
+          font-size: 32rpx;
+        }
       }
+
     }
   }
 }

+ 16 - 7
components/authority/index.wxml

@@ -1,3 +1,5 @@
+<wxs src="../../utils/filter.wxs" module="filters" />
+
 <view class="authority">
   <view class="module" wx:for="{{worksList}}" wx:key="index">
     <view class="topic">{{item.title}}</view>
@@ -5,15 +7,22 @@
     <view class="works">
       <view class="work" wx:for="{{item.userReadList}}" wx:for-item='work' wx:key="index" bindtap="jumpReading"
         data-id='{{work.userRead.id}}'>
-        <image src="{{work.userRead.coverImg}}" class="cover" wx:if="{{work.userReadExtend.resourcesType==0}}" />
-        <view class="audioBox" wx:else>
-          <image src="{{work.userReadExtend.backgroundVirtualImg}}" class="cover" />
-          <view class="audioPlay">
-            <image src="/static/audioBg.png" class="audioPlayBg" />
-            <image src="/static/zhen.png" class="audioPlayZhen" />
-            <image src="{{work.userRead.coverImg}}" class="cover" />
+        <view class="content">
+          <image src="{{work.userRead.coverImg}}" class="cover" wx:if="{{work.userReadExtend.resourcesType==0}}" />
+          <view class="audioBox" wx:else>
+            <image src="{{work.userReadExtend.backgroundVirtualImg}}" class="cover" />
+            <view class="audioPlay">
+              <image src="/static/audioBg.png" class="audioPlayBg" />
+              <image src="/static/zhen.png" class="audioPlayZhen" />
+              <image src="{{work.userRead.coverImg}}" class="cover" />
+            </view>
+          </view>
+          <view class="mask">
+            <image src="/static/fb.png" class="fb" />
+            <view class="fb-num">{{filters.numFilter(work.userRead.playAmount)}}</view>
           </view>
         </view>
+        <!-- 图片 -->
         <view class="textOver title">{{work.userRead.title}}</view>
       </view>
     </view>

+ 33 - 11
components/authority/index.wxss

@@ -19,20 +19,19 @@
 .authority .module .works .work {
   margin: 20rpx 0rpx;
 }
-.authority .module .works .work .cover {
+.authority .module .works .work .content {
+  position: relative;
+  font-size: 0px;
+}
+.authority .module .works .work .content .cover {
   width: 344rpx;
   height: 194rpx;
   border-radius: 8rpx;
 }
-.authority .module .works .work .title {
-  width: 344rpx;
-  margin-top: 6rpx;
-  font-size: 32rpx;
-}
-.authority .module .works .audioBox {
+.authority .module .works .work .content .audioBox {
   position: relative;
 }
-.authority .module .works .audioBox .audioPlay {
+.authority .module .works .work .content .audioBox .audioPlay {
   position: absolute;
   left: 0px;
   top: 0px;
@@ -45,20 +44,43 @@
   align-items: center;
   justify-content: center;
 }
-.authority .module .works .audioBox .audioPlay .audioPlayBg {
+.authority .module .works .work .content .audioBox .audioPlay .audioPlayBg {
   width: 150rpx;
   height: 150rpx;
 }
-.authority .module .works .audioBox .audioPlay .audioPlayZhen {
+.authority .module .works .work .content .audioBox .audioPlay .audioPlayZhen {
   position: absolute;
   right: 30rpx;
   top: 16rpx;
   width: 32rpx;
   height: 40rpx;
 }
-.authority .module .works .audioBox .audioPlay .cover {
+.authority .module .works .work .content .audioBox .audioPlay .cover {
   position: absolute;
   width: 130rpx;
   height: 130rpx;
   border-radius: 50%;
 }
+.authority .module .works .work .content .mask {
+  position: absolute;
+  width: 100%;
+  height: 40rpx;
+  bottom: 0px;
+  background: linear-gradient(0deg, rgba(0, 0, 0, 0.3), transparent);
+  display: flex;
+  align-items: center;
+}
+.authority .module .works .work .content .mask .fb {
+  margin: 6rpx 10rpx;
+  width: 26rpx;
+  height: 26rpx;
+}
+.authority .module .works .work .content .mask .fb-num {
+  font-size: 24rpx;
+  color: white;
+}
+.authority .module .works .work .title {
+  width: 344rpx;
+  margin-top: 6rpx;
+  font-size: 32rpx;
+}

+ 23 - 8
components/uploadFile/index.js

@@ -95,23 +95,38 @@ 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({
-        "userReadId": res.id,
-        "complete": _data.integrity,
-        "accuracy": _data.accuracy,
-        "speed": _data.fluency,
-        "intonation": _data.tone,
-        "score": _data.myOverall
+        userReadId: res.id,
+        complete: _data.integrity,
+        accuracy: _data.accuracy,
+        speed: _data.fluency,
+        intonation: _data.tone,
+        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
+        }
       })
-      console.log(scoreRes,'scoreRes');
       this.setData({
         uploadFlag: false,
         uploadState: true,

+ 0 - 2
pages/activity/index.js

@@ -36,10 +36,8 @@ Page({
     })
   },
   async getBannerList() {
-    console.log(this.data.userInfo);
     let bannerList = await getBannerList({
       grade: this.data.userInfo.grade,
-      classify: 3
     })
     this.setData({
       bannerList,

+ 0 - 2
pages/index/index.js

@@ -142,7 +142,6 @@ Page({
   async getBannerList() {
     let bannerList = await getBannerList({
       grade: this.data.userInfo.grade,
-      classify: this.data.currentType
     })
     this.setData({
       bannerList,
@@ -170,7 +169,6 @@ Page({
       if (target.dataset.type != '7') {
         this.resetData()
       }
-      this.getBannerList()
     }
   },
   onUnload() {

+ 1 - 6
pages/score/index.js

@@ -1,6 +1,4 @@
-import {
-  userEvent
-} from '~/api/global'
+
 import {
   createStoreBindings
 } from 'mobx-miniprogram-bindings'
@@ -42,9 +40,6 @@ Page({
       readingType: options.readingType ? options.readingType : '',
       activityId: options.activityId
     })
-    await userEvent({
-      action: 'WXSCORE',
-    })
   },
   backReading() {
     let pagesList = getCurrentPages()

+ 1 - 2
pages/works/index.js

@@ -41,6 +41,7 @@ Page({
         this.requestAgain()
       }
     }
+    this.getBannerList()
   },
   loadMore() {
     if (this.data.currentType == '4') {
@@ -54,7 +55,6 @@ Page({
   async getBannerList() {
     let bannerList = await getBannerList({
       grade: this.data.userInfo.grade,
-      classify: this.data.currentType
     })
     this.setData({
       bannerList,
@@ -90,7 +90,6 @@ Page({
   },
   requestAgain() {
     this.resetData()
-    this.getBannerList()
   },
   async getLocUserInfo() {
     this.storeBindings = createStoreBindings(this, {

BIN
static/fb.png


+ 8 - 8
utils/request.js

@@ -6,13 +6,13 @@ const {
     envVersion
   }
 } = wx.getAccountInfoSync();
-if (envVersion == 'develop') {
-  baseUrl = 'https://reader-api.efunbox.cn/wx'
-  oldUrl = 'https://reader-api.efunbox.cn'
-} else {
-  baseUrl = 'https://reader-api.ai160.com/wx'
-  oldUrl = 'https://reader-api.ai160.com'
-}
+// if (envVersion == 'develop') {
+baseUrl = 'https://reader-api.efunbox.cn/wx'
+oldUrl = 'https://reader-api.efunbox.cn'
+// } else {
+//   baseUrl = 'https://reader-api.ai160.com/wx'
+//   oldUrl = 'https://reader-api.ai160.com'
+// }
 
 function request(url, method, data, oldBaseUrl = false) {
   let header = {
@@ -37,7 +37,7 @@ function request(url, method, data, oldBaseUrl = false) {
         } else if (code == '1102' || code == '1204') {
           console.log(code, '<=====code1', message);
           wx.clearStorage()
-        } else {
+        } else if (code) {
           console.log(code, '<=====code2', message);
           wx.showToast({
             title: message,