tanyanfei 3 år sedan
förälder
incheckning
35300b0536

+ 1 - 2
app.json

@@ -26,8 +26,7 @@
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",
     "navigationBarTitleText": "中科院期刊平台",
-    "navigationBarTextStyle": "black",
-    "enablePullDownRefresh":true
+    "navigationBarTextStyle": "black"
   },
   "tabBar": {
     "color": "#666666",

+ 4 - 1
pages/eventDetail/eventDetail.js

@@ -209,7 +209,10 @@ Page({
   submit: function (e) {
     var form = e.detail.value;
     var list = this.data.list, index=this.data.index;
-    form.organizer_unit = list[0][index[0]].value+list[1][index[1]].value+list[2][index[2]].value
+    if (this.data.info.signup_fields.indexOf('company')>=0){
+      form.organizer_unit = list[0][index[0]].value + list[1][index[1]].value + list[2][index[2]].value
+    }
+    
     form.uid=this.data.user_id;
     form.conference_id=this.data.info.id;
     form.conference_name = this.data.info.name;

+ 28 - 14
pages/index/index.js

@@ -25,19 +25,32 @@ Page({
   },
 
 
-  onLoad: function () {
-    this.setData({
-      openid: app.globalData.openid
-    })
-    wx.getStorage({
-      key: 'uid',
-      success: res => {
-        if (res.data) {
-          this.setData({ show: 0 ,uid:res.data})
-        }
-        this.getData();
-      },
-    })
+  onShow: function () {
+    if (this.data.uid){
+      this.setData({
+        organizers: [],
+        subjects: [],
+        page_org: 1,
+        page_sub: 1,
+        total_org: 0,
+        total_sub: 0
+      })
+      this.getData();
+    }else{
+      this.setData({
+        openid: app.globalData.openid
+      })
+      wx.getStorage({
+        key: 'uid',
+        success: res => {
+          if (res.data) {
+            this.setData({ show: 0, uid: res.data })
+          }
+          this.getData();
+        },
+      })
+    }  
+    
     
   },
   onGotUserInfo: function () {
@@ -145,6 +158,7 @@ Page({
   }, 
   //主办单位
   getorg:function(){
+    console.log(this.data.page_org)
     const organizers=this.data.organizers;
     wx.request({
       url: host + '/api/index/organizers',
@@ -317,6 +331,6 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-     
+     wx.startPullDownRefresh()
   },
 })

+ 8 - 1
pages/index/index.wxml

@@ -65,8 +65,10 @@
                     <view wx:else bindtap="top" data-type='organizer' data-id='{{item.id}}' class="top">置顶</view>
               </view>
           </view>
+          <block wx:if='{{total_org>=20}}'>
           <view class='more' wx:if='{{organizers.length < total_org}}'>上拉加载更多...</view>
           <view class='more' wx:else>已加载全部数据!</view>
+          </block>
       </scroll-view>
   </swiper-item>
   <!-- 领域期刊 -->
@@ -86,8 +88,10 @@
                     <view wx:else bindtap="top" data-id='{{item.id}}' data-type='subject' class="top">置顶</view>
               </view>
           </view>
+          <block wx:if='{{total_sub>=20}}'>
           <view class='more' wx:if='{{subjects.length < total_sub}}'>上拉加载更多...</view>
           <view class='more' wx:else>已加载全部数据!</view>
+          </block>
       </scroll-view>
   </swiper-item>
   <swiper-item>
@@ -138,4 +142,7 @@
         <text class="xx">申请获取您的用户信息(头像、昵称等)</text>
         <button bindtap="onGotUserInfo">确定</button>
     </view>
-</view>
+</view>
+
+
+

+ 0 - 1
pages/index/index.wxss

@@ -1,5 +1,4 @@
 /**index.wxss**/
-
 .search{
   height: 64rpx;
   background: #fff;

+ 6 - 3
pages/knowledge/knowledge.js

@@ -20,7 +20,12 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  onShow: function () {
+    this.setData({
+      list: [],
+      total: 0,
+      page: 1
+    })
     this.getData()
   },
   search:function(e){
@@ -90,9 +95,7 @@ Page({
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
 
-  },
 
   /**
    * 生命周期函数--监听页面隐藏

+ 2 - 0
pages/knowledge/knowledge.wxml

@@ -39,8 +39,10 @@
                   <text class="">主办单位:{{item.desc}}</text>
               </view>
           </navigator>
+          <block wx:if='{{total>=20}}'>
           <view class='more' wx:if='{{list.length < total}}'>上拉加载更多...</view>
           <view class='more' wx:else>已加载全部数据!</view>
+          </block>
       </scroll-view>
   </swiper-item>
 

+ 15 - 6
pages/learning/learning.js

@@ -25,12 +25,25 @@ Page({
     total_0:0,
     total_1: 0,
     total_2: 0,
+    
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  onShow: function () {
+    this.setData({
+      conference: [],
+      over: [],
+      pre: [],
+      page_0: 1,
+      page_1: 1,
+      page_2: 1,
+      total_0: 0,
+      total_1: 0,
+      total_2: 0,
+      show: 0
+    })
     this.getData();
   },
   getData:function(){
@@ -220,11 +233,7 @@ Page({
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
-    this.setData({
-      show:0
-    })
-  },
+
 
   /**
    * 生命周期函数--监听页面隐藏