bayi 2 yıl önce
ebeveyn
işleme
ad7c96bdba

+ 1 - 1
components/comment/index.js

@@ -88,7 +88,7 @@ Component({
     },
     // 评论作品
     async sendReply() {
-      if (!this.data.detailDesc) {
+      if (!this.data.detailDesc.trim()) {
         return
       }
       if (this.data.replyType == 'works') {

+ 34 - 34
components/navigationBar/index.wxml

@@ -1,9 +1,9 @@
 <!-- 自定义顶部栏 -->
 <view class="nav-bar" style="height:{{navBarHeight}}px;">
-    <view class="view" style="height:{{menuHeight}}px;top:{{menuTop}}px;">
-        <view class="selectGrade" bindtap="showGrade">{{userInfo.gradeName}}</view>
-        <view class="title">{{title}}</view>
-    </view>
+  <view class="view" style="height:{{menuHeight}}px;top:{{menuTop}}px;">
+    <view class="selectGrade" bindtap="showGrade">{{userInfo.gradeName}}</view>
+    <view class="title">{{title}}</view>
+  </view>
 </view>
 <!-- 
   内容区域:
@@ -13,35 +13,35 @@
 <view class="headerBg" style="top:{{navBarHeight}}px;"></view>
 
 <view wx:if="{{isGradeShow}}" class="gradeContainer" catchtouchmove='true' style="margin-top:{{navBarHeight}}px;"
-    bindtap="closeGrade">
-    <view class="gradeBox" catchtap="selectGrade">
-        <view class="title">请选择年级</view>
-        <view class="content">
-            <view class="grade oneRow {{temporaryGrade=='PRESCHOOL'?'check':''}}" data-code="PRESCHOOL">学前班</view>
-        </view>
-        <view class="content">
-            <view class="grade {{temporaryGrade=='PRIMARY_FIRST_GRADE'?'check':''}}" data-code="PRIMARY_FIRST_GRADE">一年级
-            </view>
-            <view class="grade {{temporaryGrade=='PRIMARY_SECOND_GRADE'?'check':''}}" data-code="PRIMARY_SECOND_GRADE">
-                二年级
-            </view>
-        </view>
-        <view class="content">
-            <view class="grade {{temporaryGrade=='PRIMARY_THREE_GRADE'?'check':''}}" data-code="PRIMARY_THREE_GRADE">三年级
-            </view>
-            <view class="grade {{temporaryGrade=='PRIMARY_SENIOR_GRADE'?'check':''}}" data-code="PRIMARY_SENIOR_GRADE">
-                四年级
-            </view>
-        </view>
-        <view class="content">
-            <view class="grade {{temporaryGrade=='PRIMARY_THREE_GRADE'?'check':''}}" data-code="PRIMARY_THREE_GRADE">五年级
-            </view>
-            <view class="grade {{temporaryGrade=='PRIMARY_SENIOR_GRADE'?'check':''}}" data-code="PRIMARY_SENIOR_GRADE">
-                六年级
-            </view>
-        </view>
-        <view class="submitBox">
-            <button class="resetBtn submit" bindtap="changeGrade">确定</button>
-        </view>
+  bindtap="closeGrade">
+  <view class="gradeBox" catchtap="selectGrade">
+    <view class="title">请选择年级</view>
+    <view class="content">
+      <view class="grade oneRow {{temporaryGrade=='PRESCHOOL'?'check':''}}" data-code="PRESCHOOL">学前班</view>
+    </view>
+    <view class="content">
+      <view class="grade {{temporaryGrade=='PRIMARY_FIRST_GRADE'?'check':''}}" data-code="PRIMARY_FIRST_GRADE">一年级
+      </view>
+      <view class="grade {{temporaryGrade=='PRIMARY_SECOND_GRADE'?'check':''}}" data-code="PRIMARY_SECOND_GRADE">
+        二年级
+      </view>
+    </view>
+    <view class="content">
+      <view class="grade {{temporaryGrade=='PRIMARY_THREE_GRADE'?'check':''}}" data-code="PRIMARY_THREE_GRADE">三年级
+      </view>
+      <view class="grade {{temporaryGrade=='PRIMARY_SENIOR_GRADE'?'check':''}}" data-code="PRIMARY_SENIOR_GRADE">
+        四年级
+      </view>
+    </view>
+    <view class="content">
+      <view class="grade {{temporaryGrade=='PRIMARY_FIVE_GRADE'?'check':''}}" data-code="PRIMARY_FIVE_GRADE">五年级
+      </view>
+      <view class="grade {{temporaryGrade=='PRIMARY_SIX_GRADE'?'check':''}}" data-code="PRIMARY_SIX_GRADE">
+        六年级
+      </view>
+    </view>
+    <view class="submitBox">
+      <button class="resetBtn submit" bindtap="changeGrade">确定</button>
     </view>
+  </view>
 </view>

+ 3 - 2
components/videoPreview/index.js

@@ -39,7 +39,7 @@ Component({
     },
     videoType: {
       type: String,
-      // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案
+      // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,excellent是优秀作品展播
       value: 'public'
     },
     currentId: {
@@ -193,6 +193,7 @@ Component({
     },
     toPkPage() {
       let videoInfo = this.data.videoInfoCopy
+      console.log(videoInfo,this.properties.videoType);
       if (this.properties.videoType == 'pk') {
         this.setPkData({
           nickName: videoInfo.user.nickName || videoInfo.user.eid,
@@ -203,7 +204,7 @@ Component({
         })
       }
       let readId = videoInfo.userRead.id
-      let url = this.properties.videoType == 'public' ? `/pages/pkPage/index?videoId=${readId}` : `/pages/reading/index?videoId=${videoInfo.userRead.exampleId}&readingType=pk`
+      let url = this.properties.videoType == 'excellent' ? `/pages/pkPage/index?videoId=${readId}` : `/pages/reading/index?videoId=${videoInfo.userRead.exampleId}&readingType=pk`
       wx.navigateTo({
         url
       })

+ 2 - 2
components/videoPreview/index.wxml

@@ -25,7 +25,7 @@
         </view>
       </view>
     </view>
-    <view class="wH-right" wx:elif="{{videoType=='public'&&selfUid!=videoInfoCopy.user.uid}}">
+    <view class="wH-right" wx:elif="{{videoType=='public'&&selfUid!=videoInfoCopy.user.uid||videoType=='excellent'&&selfUid!=videoInfoCopy.user.uid}}">
       <view class="follow {{videoInfoCopy.isFans?'isFans':''}}" bindtap="setFans">
         <image src="{{videoInfoCopy.isFans?'/static/follow_2.png':'/static/follow_1.png'}}" class="character" mode="" />
         <text class="text">{{videoInfoCopy.isFans?'已关注':'关注'}}</text>
@@ -88,7 +88,7 @@
       <view class="icon-name">{{filters.numFilter(videoInfoCopy.userRead.likeAmount)}}</view>
     </view>
   </view>
-  <view class="toReading" bindtap="toPkPage" wx:if="{{videoType=='pk'}}">
+  <view class="toReading" bindtap="toPkPage" wx:if="{{videoType=='pk'||videoType=='excellent'}}">
     <image src="/static/reading.png" class="reading" mode="" />
     <view class="reading-text">挑战PK</view>
   </view>

+ 6 - 0
pages/editUser/index.js

@@ -29,6 +29,12 @@ Page({
       {
         value: 'PRIMARY_SENIOR_GRADE',
         key: '四年级'
+      }, {
+        value: 'PRIMARY_FIVE_GRADE',
+        key: '五年级'
+      }, {
+        value: 'PRIMARY_SIX_GRADE',
+        key: '六年级'
       },
     ],
   },

+ 3 - 3
pages/index/index.wxml

@@ -1,6 +1,5 @@
 <navigationBar bind:reload='resetData'></navigationBar>
 <view class="recommend">
-  <canvas id='share' type="2d"> </canvas>
   <banner classify='1' />
   <!-- 滚动定位 -->
   <view class="scrollBox {{isFixed?'isFixed':''}}" style="top:{{navBarHeight}}px;">
@@ -24,5 +23,6 @@
   <!-- 当一级分类固定定位时占位用的元素 -->
   <view class="{{isFixed?'brace':''}}" />
   <!-- 优秀作品展播及官方推荐列表组件 -->
-  <worksList id="worksList" worksList="{{list}}" videoType="{{currentType=='1'?'pk':'public'}}" />
-</view>
+  <worksList id="worksList" worksList="{{list}}" videoType="{{currentType=='1'?'excellent':'public'}}" />
+</view>
+<canvas id='share' type="2d"> </canvas>

+ 2 - 6
pages/works/index.js

@@ -2,6 +2,7 @@ const app = getApp()
 import {
   getBannerList
 } from '~/api/global'
+import share from '~/mixins/share'
 import {
   getSelfRead
 } from '~/api/user'
@@ -10,7 +11,7 @@ import {
 } from '~/api/works'
 import reachBottom from '~/mixins/reachBottom'
 Page({
-  behaviors: [reachBottom],
+  behaviors: [reachBottom, share],
   data: {
     navBarHeight: app.globalData.navBarHeight,
     bannerList: [],
@@ -74,10 +75,5 @@ Page({
   onReachBottom() {
     this.loadMore()
   },
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
 
-  }
 })

+ 2 - 1
pages/works/index.wxml

@@ -9,4 +9,5 @@
   </view>
   <!-- 优秀作品展播及官方推荐列表组件 -->
   <worksList id="worksList" videoType="{{currentType=='1'?'pk':'my'}}" worksList="{{list}}" />
-</view>
+</view>
+<canvas id='share' type="2d"> </canvas>

+ 1 - 1
store/index.js

@@ -24,7 +24,7 @@ export const store = observable({
       "PRIMARY_THREE_GRADE": "三年级",
       "PRIMARY_SENIOR_GRADE": "四年级",
       "PRIMARY_FIVE_GRADE":"五年级",
-      "PRIMARY_SIX_GRADE":"年级",
+      "PRIMARY_SIX_GRADE":"年级",
       "PRESCHOOL": "学前班",
     }
     step.gradeName = grade ? gradeObj[grade] : '请选择'

+ 7 - 5
utils/filter.wxs

@@ -40,11 +40,13 @@ function gradeFilter(grade) {
         return '暂无'
     }
     var gradeObj = {
-        "PRIMARY_FIRST_GRADE": "一年级",
-        "PRIMARY_SECOND_GRADE": "二年级",
-        "PRIMARY_THREE_GRADE": "三年级",
-        "PRIMARY_SENIOR_GRADE": "四年级",
-        "PRESCHOOL": "学前班",
+      "PRIMARY_FIRST_GRADE": "一年级",
+      "PRIMARY_SECOND_GRADE": "二年级",
+      "PRIMARY_THREE_GRADE": "三年级",
+      "PRIMARY_SENIOR_GRADE": "四年级",
+      "PRIMARY_FIVE_GRADE":"五年级",
+      "PRIMARY_SIX_GRADE":"六年级",
+      "PRESCHOOL": "学前班",
     }
     return gradeObj[grade]
 }