Silent 6 年之前
父节点
当前提交
a788cf0e7a

+ 1 - 1
wechat/app.json

xqd
@@ -1,9 +1,9 @@
 {
   "pages": [
+    "pages/article/article",
     "pages/index/index",
     "pages/announce/announce",
     "pages/announce-detail/index",
-    "pages/article/article",
     "pages/article-detail/index",
     "pages/userinfo/userinfo",
     "pages/mycourse/mycourse",

+ 6 - 0
wechat/pages/announce/announce.js

xqd xqd
@@ -13,6 +13,9 @@ Page({
   },
   loadMoreAnnouncesList: function() {
     var that = this;
+    wx.showLoading({
+      title: '加载中',
+    })
     wx.request({
       url: api.getAnnouncesUrl,
       method: 'GET',
@@ -32,6 +35,9 @@ Page({
             duration: 800
           })
         }
+      },
+      complete: res => {
+        wx.hideLoading()
       }
     })
   },

+ 6 - 0
wechat/pages/article/article.js

xqd xqd
@@ -87,6 +87,9 @@ Page({
     //     "show": -1
     //   },
     //       ];
+    wx.showLoading({
+      title: '加载中',
+    })
     wx.request({
       url: api.getMoreVideosAndArticlesUrl,
       method: 'GET',
@@ -130,6 +133,9 @@ Page({
             }
           }
         }
+      },
+      complete: res => {
+        wx.hideLoading()
       }
     })
     // app.request({

+ 6 - 4
wechat/pages/article/article.wxml

xqd
@@ -1,8 +1,10 @@
-<view class="swiper-tab">
-  <view class="swiper-tab-item {{ item.tab == selectedTab ? 'active' : '' }}" data-current="{{ item.tab }}" bindtap="clickTab" wx:for="{{ tabList }}">{{ item.title }}</view>
+<view class='swiper-top-container'>
+  <view class="swiper-tab">
+    <view class="swiper-tab-item {{ item.tab == selectedTab ? 'active' : '' }}" data-current="{{ item.tab }}" bindtap="clickTab" wx:for="{{ tabList }}">{{ item.title }}</view>
+  </view>
 </view>
-<swiper current-item-id="{{ selectedTab }}" duration="300" bindchange="swiperTab">
-  <swiper-item item-id="video">
+<swiper current-item-id="{{ selectedTab }}" duration="300" bindchange="swiperTab" class='sg-swiper'>
+  <swiper-item item-id="video" classs="swiper-item">
     <view class="after-navber">
       <view class="info">
         <view class="info-list">

+ 21 - 1
wechat/pages/article/article.wxss

xqd xqd
@@ -121,7 +121,15 @@
   height: 10rpx;
   margin-right: 16rpx;
 }
-
+.swiper-top-container {
+  position: fixed;
+  width: 100%;
+  top: 0;
+  left: 0;
+  height: 88rpx;
+  z-index: 4000;
+  background-color: #efeff4;
+}
 .swiper-tab {
   width: 100%;
   border-bottom: 2rpx solid #ccc;
@@ -141,3 +149,15 @@
   color: #fb534b;
   border-bottom: 4rpx solid red;
 }
+.sg-swiper {
+  margin-top: 88rpx;
+  height: 100%;
+}
+.swiper-item {
+  overflow: scroll;
+}
+
+.after-navber {
+  height: 100%;
+  overflow: scroll;
+}