Преглед изворни кода

排名可以展开和加载更多不超过两条更改

Limengbo пре 6 година
родитељ
комит
715f5d136a

+ 4 - 0
compontents/chat/chat.js

@@ -28,6 +28,10 @@ Component({
       type: String,
       value: '' 
     },
+    more: {
+      type: String,
+      value: ''
+    }
   },
 
   /**

+ 1 - 1
compontents/chat/chat.wxml

@@ -49,7 +49,7 @@
                 <image class="share_up" src="../../pages/image/share_up.png"></image>
             </button> 
         </view>
-        <view class="more" bindtap="examine">查看更多</view>
+        <view class="more" wx:if="{{more}}" bindtap="examine">查看更多</view>
     </view>
     <view class="no-con" wx:if="{{!productionData.list && type == 2}}">
         <view class="state">你还没有上传作品</view>

+ 1 - 1
compontents/lesson_list/lessonList.wxml

@@ -21,7 +21,7 @@
     </view>
 
 
-    <view class="unfold" wx-if="{{height}}">
+    <view class="unfold" wx:if="{{height}}">
       <image class="dirImg" src="{{src}}"></image>
       <text data-flag="{{flag}}" bindtap="onTap">{{downUp}}</text>
     </view>

+ 1 - 1
compontents/preview/preview.wxml

@@ -17,7 +17,7 @@
         </view>
     </view>
     
-    <view class="unfold" wx-if="{{height}}">
+    <view class="unfold" wx:if="{{height}}">
       <image class="dirImg" src="{{src}}"></image>
       <text data-flag="{{flag}}" bindtap="onTap">{{downUp}}</text>
     </view>

+ 1 - 1
compontents/ranking/ranking.js

@@ -24,7 +24,7 @@ Component({
       type: String,
       value: ''
     },
-    heigth: {
+    height: {
       type: String,
       value: ''
     }

+ 2 - 2
compontents/ranking/ranking.wxml

@@ -18,7 +18,7 @@
             </view>
         </block>
     </view>
-    <view class="rank-list" animation="{{animationData}}" style="height: {{heigth}}rpx">
+    <view class="rank-list" animation="{{animationData}}" style="height: {{height}}rpx">
         <view class="rank-friend" wx:for="{{friendsData}}" wx:key="{{index}}">
             <view class="rank-head">
                 <text class="rank-text">{{item.rank}}</text>
@@ -38,7 +38,7 @@
         <text wx:if="{{myData.exp >= 0}}" class="medal-num" style="color: #5b82fa">LV{{myData.number}}({{myData.exp}})</text>
         <text wx:else class="medal-num" style="color: #5b82fa">{{myData.number}}{{str}}</text>
     </view> 
-    <view class="particular" bindtap="more" data-flag="{{flag}}">
+    <view class="particular" bindtap="more" data-flag="{{flag}}" wx:if="{{height}}">
         查看更多
     </view>
 </view>

+ 5 - 4
compontents/ranking/ranking.wxss

@@ -25,10 +25,6 @@
     top: 0rpx;
     width: 116rpx;
     text-align: center;   
-    word-break:keep-all;/* 不换行 */   
-    white-space:nowrap;/* 不换行 */  
-    overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */   
-    text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
 }
 
 .my-rank .head-rank-1 {
@@ -107,7 +103,12 @@
 }
 
 .name {
+    width: 100%;
     font-size: 24rpx;
+    word-break:keep-all;/* 不换行 */   
+    white-space:nowrap;/* 不换行 */  
+    overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */   
+    text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
 }
 
 .medal-num {

+ 16 - 3
pages/art/art.js

@@ -16,7 +16,9 @@ Page({
     questionsdian: '',
     list: [],
     lessonListHeight: '',
-    previewHeight: ''
+    previewHeight: '',
+    productionMore: '',
+    questionsMore: ''
   },
 
   /* 区分答疑和分享 */
@@ -113,8 +115,14 @@ Page({
         this.setData({
           productionData: res.data.data
         })
+        if(res.data.data) {
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              productionMore: true
+            })
+          }
+        }
       }
-      
     });
     /* 答疑 */
     this.distinction(1, columnId, 1, 2, res => {
@@ -126,7 +134,12 @@ Page({
         if(res.data.data) {
           this.setData({
             questionsdian: util.replyNo(res.data.data.list)
-          })
+          })  
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              questionsMore: true
+            })
+          }
         }
       }
     });

+ 4 - 2
pages/art/art.wxml

@@ -24,7 +24,8 @@
                 type="2"
                 columnType="6"
                 bind:myevent="onMyEvent"
-                data-type="2"/>
+                data-type="2"
+                more="{{productionMore}}"/>
 
             <chat id="questions"
                 productionData="{{questionsData}}" 
@@ -33,7 +34,8 @@
                 type="1"
                 columnType="6"
                 bind:myevent="onMyEvent"
-                data-type="1"/>
+                data-type="1"
+                more="{{questionsMore}}"/>
 
             <view class="questions-one" data-id="questions" bindtap="location">
                 <image src="../image/q_discuss.png" ></image>

+ 7 - 1
pages/chinese/chinese.js

@@ -14,7 +14,8 @@ Page({
     questionsdian: '',
     list: [],
     lessonListHeight: '',
-    previewHeight: ''
+    previewHeight: '',
+    questionsMore: ''
   },
 
   /* 区分答疑和分享 */
@@ -94,6 +95,11 @@ Page({
           this.setData({
             questionsdian: util.replyNo(res.data.data.list)
           })
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              questionsMore: true
+            })
+          }
         }
       }
     });

+ 2 - 1
pages/chinese/chinese.wxml

@@ -24,7 +24,8 @@
                 type="1"
                 columnType="3"
                 bind:myevent="onMyEvent"
-                data-type="1"/>
+                data-type="1"
+                more="{{questionsMore}}"/>
 
 
             <view class="questions-one" data-id="questions" bindtap="location">

+ 7 - 1
pages/english/english.js

@@ -14,7 +14,8 @@ Page({
     questionsdian: '',
     list: [],
     lessonListHeight: '',
-    previewHeight: ''
+    previewHeight: '',
+    questionsMore: ''
   },
 
   /* 区分答疑和分享 */
@@ -94,6 +95,11 @@ Page({
           this.setData({
             questionsdian: util.replyNo(res.data.data.list)
           })
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              questionsMore: true
+            })
+          }
         } 
       }
     });

+ 2 - 1
pages/english/english.wxml

@@ -24,7 +24,8 @@
                 type="1"
                 columnType="4"
                 bind:myevent="onMyEvent"
-                data-type="1"/>
+                data-type="1"
+                more="questionsMore"/>
 
 
             <view class="questions-one" data-id="questions" bindtap="location">

+ 1 - 1
pages/index/index.wxss

@@ -148,7 +148,7 @@
 
 .img {
   display: flex;
-  margin-top: 38rpx;
+  padding-top: 38rpx;
 }
 
 .img view {

+ 10 - 2
pages/input_content/input_content.js

@@ -51,11 +51,19 @@ Page({
             icon: 'loading',  
             mask: true,  
             duration: 1000 
-          })  
-          that.data.tempFilePath.push(tempFilePaths);
+          }) 
+          for(let item of tempFilePaths){
+            that.data.tempFilePath.push(item);
+          }
           that.setData({
             tempFilePath:  that.data.tempFilePath
           })
+          wx.showModal({  
+            title: '上传提示',  
+            content: JSON.stringify(that.data.tempFilePath),  
+            showCancel: false,  
+            success: function (res) { }  
+          })  
           var uploadImgCount = 0;  
           for (var i = 0, h = tempFilePaths.length; i < h; i++) {
             //上传文件

+ 7 - 1
pages/language/language.js

@@ -14,7 +14,8 @@ Page({
     questionsdian: '',
     list: [],
     lessonListHeight: '',
-    previewHeight: ''
+    previewHeight: '',
+    questionsMore: ''
   },
 
   /* 区分答疑和分享 */
@@ -91,6 +92,11 @@ Page({
           this.setData({
             questionsdian: util.replyNo(res.data.data.list)
           })
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              questionsMore: true
+            })
+          }
         }       
       }
     });

+ 2 - 1
pages/language/language.wxml

@@ -24,7 +24,8 @@
                 type="1"
                 columnType="1"
                 bind:myevent="onMyEvent"
-                data-type="1"/>
+                data-type="1"
+                more="{{questionsMore}}"/>
 
 
             <view class="questions-one" class="questions-one" data-id="questions" bindtap="location">

+ 7 - 1
pages/mathematics/mathematics.js

@@ -14,7 +14,8 @@ Page({
     questionsdian: '',
     list: [],
     lessonListHeight: '',
-    previewHeight: ''
+    previewHeight: '',
+    questionsMore: ''
   },
 
   /* 区分答疑和分享 */
@@ -93,6 +94,11 @@ Page({
           this.setData({
             questionsdian: util.replyNo(res.data.data.list)
           })
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              questionsMore: true
+            })
+          }
         }     
       }
     });

+ 2 - 1
pages/mathematics/mathematics.wxml

@@ -24,7 +24,8 @@
                 type="1"
                 columnType="2"
                 bind:myevent="onMyEvent"
-                data-type="1"/>
+                data-type="1"
+                more="{{questionsMore}}"/>
 
 
             <view class="questions-one" class="questions-one" data-id="questions" bindtap="location">

+ 15 - 1
pages/science/science.js

@@ -16,7 +16,9 @@ Page({
     questionsdian: '',
     list: [],
     lessonListHeight: '',
-    previewHeight: ''
+    previewHeight: '',
+    productionMore: '',
+    questionsMore: ''
   },
   /* 区分答疑和分享 */
   distinction: function(type, columnId, pageNo, pageSize, success) {
@@ -108,6 +110,13 @@ Page({
         this.setData({
           productionData: res.data.data,
         }) 
+        if(res.data.data) {
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              productionMore: true
+            })
+          }
+        }  
       }
       
     });
@@ -122,6 +131,11 @@ Page({
           this.setData({
             questionsdian: util.replyNo(res.data.data.list)
           })
+          if(res.data.data.totalSize > 2) {
+            this.setData({
+              questionsMore: true
+            })
+          }
         }  
       }
     });

+ 4 - 2
pages/science/science.wxml

@@ -24,7 +24,8 @@
                 type="2"
                 columnType="5"
                 bind:myevent="onMyEvent"
-                data-type="2"/>
+                data-type="2"
+                more="{{productionMore}}"/>
 
             <chat id="questions"
                 productionData="{{questionsData}}" 
@@ -33,7 +34,8 @@
                 type="1"
                 columnType="5"
                 bind:myevent="onMyEvent"
-                data-type="1"/>
+                data-type="1"
+                more="{{questionsMore}}"/>
 
             <view class="questions-one" data-id="questions" bindtap="location">
                 <image src="../image/q_discuss.png" ></image>