tanyanfei 3 years ago
parent
commit
377b6891aa

+ 4 - 3
app.json

@@ -1,17 +1,18 @@
 {
   "pages": [
     
+    "pages/mine/mine",
     "pages/index/index",
     "pages/knowledge/knowledge",
     "pages/search/search",
     "pages/learning/learning",
-    
+    "pages/order/order",
     "pages/searchList/searchList",
     "pages/wenzhang/wenzhang",
-    "pages/mine/mine",
+    
     "pages/hotel/hotel",
     "pages/huodong/huodong",
-    "pages/order/order",
+   
     "pages/eventDetail/eventDetail",
     "pages/order/hotel",
    

+ 41 - 32
pages/eventDetail/eventDetail.js

@@ -47,33 +47,35 @@ Page({
           this.setData({
             user_id: res.data
           })
+          wx.request({
+            url: host + '/api/detail',
+            method: 'GET',
+            data: {
+              type: 'conference',
+              id: options.id,
+              uid: res.data
+            },
+            success: function (res) {
+              wx.hideNavigationBarLoading();
+              const info = res.data.data
+              if (info.sign_note) { info.sign_note = info.sign_note.replace(/\\n/, '\n') }
+              that.setData({
+                info: info
+              })
+              // that.init()
+            },
+            fail: function () {
+              wx.hideLoading();
+              wx.showToast({
+                title: '服务器开小差啦!',
+                icon: 'none'
+              })
+            }
+          })
         }
       },
     })
-    wx.request({
-      url: host + '/api/detail',
-      method: 'GET',
-      data: {
-        type: 'conference',
-        id: options.id
-      },
-      success: function (res) {
-        wx.hideNavigationBarLoading();
-        const info = res.data.data
-        if (info.sign_note) { info.sign_note = info.sign_note.replace(/\\n/, '\n')}
-        that.setData({
-          info: info
-        })
-        // that.init()
-      },
-      fail: function () {
-        wx.hideLoading();
-        wx.showToast({
-          title: '服务器开小差啦!',
-          icon: 'none'
-        })
-      }
-    })
+    
     //中科院单位
     wx.request({
       url: host + '/api/organization/list',
@@ -91,6 +93,15 @@ Page({
       },
     })
   },
+  map:function(){
+    const latitude = Number(this.data.info.hotel.latitude);
+    const longitude = Number(this.data.info.hotel.longitude);
+    wx.openLocation({
+      latitude,
+      longitude,
+      scale: 18
+    })
+  },
   init: function () {
     const query = wx.createSelectorQuery()
     const that = this
@@ -186,14 +197,13 @@ Page({
     })
   }, 
   skip:function(){
-    this.setData({
-      page: this.data.page+2
+    wx.redirectTo({
+      url: '../order/order'
     })
   },
-  sure: function () {
+  next: function () {
     this.setData({
-      page: 0,
-      show:0
+      page: this.data.page+1
     })
   },
   close:function(){
@@ -272,7 +282,6 @@ Page({
   //提交凭证
   submit1:function(e){
     var form = e.detail.value;
-    console.log(form)
     form.id=this.data.apply_id;
     form.proof_img = this.data.proof_img;
     if (!form.proof_img) {
@@ -343,8 +352,8 @@ Page({
     })
   },
   home:function(){
-      wx.switchTab({
-        url: '../mine/mine',
+      wx.redirectTo({
+        url: '../order/order',
       })
   },
   zk1: function () {

+ 18 - 2
pages/eventDetail/eventDetail.wxml

@@ -36,8 +36,24 @@
     </view>
 </view>
 
+<view class="hotel" wx:if='{{info.hotel.name}}'>
+    <view class="tt">酒店信息</view>
+    <image style="width:100%;" mode="widthFix" src="{{info.hotel.imgs[0]}}"></image>
+    <view>{{info.hotel.name}}</view>
+    <view>地址:{{info.hotel.address}}  <text class="map" bindtap="map">查看地图</text></view>
+    <view>联系电话:{{info.hotel.telephone}}</view>
+    <view class="room">
+        <image  src="{{info.room.imgs[0]}}"></image>
+        <view>
+            <view>{{info.room.name}}</view>
+            <view><text>{{info.room.room_area}}m²</text> <text>{{info.room.enable_number}}人入住</text></view>
+            <view>剩余数量:{{info.room.room_number}}</view>
+        </view>
+    </view>
+</view>
                               
-<button wx:if='{{info.is_signup}}' bindtap="open" class="post">我要报名</button>
+<button  wx:if='{{info.is_signup && !info.is_user_signuped}}' bindtap="open" class="post">我要报名</button>
+<button  wx:if='{{info.is_signup && info.is_user_signuped}}' disabled="true" class="post">已报名</button>
 
 <view class="bg" wx:if='{{show}}'>
     <form wx:if='{{page==1}}' class="form" bindsubmit='submit'>
@@ -114,7 +130,7 @@
                 <text>(2)支票(仅限北京参会代表)。</text> -->
                 
           </view>
-          <button  bindtap="sure" class="post">下一步</button>
+          <button  bindtap="next" class="post">下一步</button>
     </view>
 
     <form class="form form2" wx:if='{{page==3}}'  bindsubmit='submit1'>

+ 28 - 0
pages/eventDetail/eventDetail.wxss

@@ -242,4 +242,32 @@ page{
 .ql-container{
   height: auto;
   min-height:0;
+}
+
+.hotel{
+  margin: 40rpx 0;
+}
+.hotel>view{
+  color: #333;
+  line-height: 30px;
+}
+.room{
+  display: flex;
+  margin-top: 20rpx;
+}
+.room image{
+  width: 150rpx;
+  height: 150rpx;
+}
+.room>view{
+  width: 60%;
+  padding-left: 20rpx;
+  color: #666;
+}
+.room text{
+  margin-right: 20rpx;
+}
+.map{
+  float: right;
+  color: green;
 }

+ 17 - 7
pages/hotel/hotel.js

@@ -14,7 +14,8 @@ Page({
     show:0,
     s_time:'',
     e_time:'',
-    room_nums:''
+    room_nums:'',
+    success:false
   },
 
   /**
@@ -78,6 +79,13 @@ Page({
     data.room_stime=this.data.s_time;
     data.room_etime = this.data.e_time;
     data.room_nums = this.data.room_nums;
+    if (!data.room_nums || !data.room_stime || !data.room_etime){
+      wx.showToast({
+        title: '请输入入住人数和时间',
+        icon: 'none'
+      })
+      return 
+    }
     wx.request({
       url: host + '/api/user/signup',
       method: 'PUT',
@@ -87,11 +95,9 @@ Page({
           wx.showToast({
             title: '预定成功',
           })
-          setTimeout(()=>{
-            wx.redirectTo({
-              url: '../order/order',
-            })
-          },1000)
+          this.setData({
+            success:true
+          })
         } else {
           wx.showToast({
             title: '提交失败',
@@ -101,7 +107,11 @@ Page({
       })
     })
   },
-
+  home: function () {
+    wx.redirectTo({
+      url: '../order/order',
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 10 - 0
pages/hotel/hotel.wxml

@@ -19,6 +19,8 @@
     </view>
 </view>
 
+
+
 <view class="bg" wx:if='{{show}}'>
   <view class="room">  
       <text class="room_title">{{data.name}}</text>
@@ -55,4 +57,12 @@
       </view>
       <view bindtap="order" data-id='{{data.id}}' class="order">预定</view>
   </view>
+</view>
+
+
+<view wx:if='{{success}}' class="bg end">
+        <icon type="success" size='72'></icon>
+        <view>恭喜您报名成功</view>
+        <view class="form_info">请您准时参加会议,到达会议地点届时将会有我方工作人员安排您的入住</view>
+        <button bindtap="home" class="post">确认</button>
 </view>

+ 25 - 0
pages/hotel/hotel.wxss

@@ -150,4 +150,29 @@ picker{
   line-height: 60rpx;
   color: #fff;
   font-size: 26rpx;
+}
+.form_info{
+  color: #333;
+  font-size: 26rpx;
+  display: block;
+  line-height: 50rpx;
+  margin-bottom: 50rpx;
+}
+
+.end{
+  background: #fff;
+  text-align: center;
+  padding: 50px;
+
+}
+.post{
+  width: 100% !important;
+  background: #0580D3;
+  color: #fff;
+  display: block;
+  font-size: 34rpx;
+  height: 90rpx;
+  line-height: 90rpx;
+  padding: 0;
+  border-radius: 18rpx;
 }

+ 47 - 5
pages/huodong/huodong.js

@@ -7,7 +7,11 @@ Page({
    * 页面的初始数据
    */
   data: {
-    id:''
+    id:'',
+    keyword:'',
+    page:1,
+    loading:true,
+    pre:[]
   },
 
   /**
@@ -25,6 +29,29 @@ Page({
     }
     this.getData()
   },
+  search: function (e) {
+    this.setData({
+      keyword: e.detail.value,
+      page:1,
+      pre:[]
+    })
+    this.getData();
+  },
+  search1: function (e) {
+    this.setData({
+      page: 1,
+      pre: []
+    })
+    this.getData();
+  },
+  next: function () {
+    if (this.data.loading) {
+      this.setData({
+        page: this.data.page + 1
+      })
+      this.getData()
+    }
+  },
   getData: function () {
     var that = this;
     wx.showNavigationBarLoading()
@@ -34,15 +61,30 @@ Page({
       url: host + '/api/activity/list',
       data: {
         type: this.data.type,
-        journal_id: this.data.id
+        journal_id: this.data.id,
+        keyword: this.data.keyword,
+        page_size:20,
+        page:this.data.page
       },
-      success: function (res) {
+      success: res=>{
         wx.hideNavigationBarLoading()
         if (!res.data) {
           return
         }
-        that.setData({
-          pre: res.data.data.list
+        let list = this.data.pre, data = res.data.data.list;
+        if (data.length <= 0) {
+          this.setData({
+            loading: false
+          })
+          return;
+        }
+        for (let i = 0; i < data.length; i++) {
+          data[i].name = data[i].name.replace(this.data.keyword, '<span style="color:#3780CD;">' + this.data.keyword + '</span>')
+
+          list.push(data[i])
+        }
+        this.setData({
+          pre: list
         })
       }
     })

+ 10 - 2
pages/huodong/huodong.wxml

@@ -1,8 +1,12 @@
-<scroll-view class="content" scroll-y="true">
+<view class="search">
+    <input bindinput="search" placeholder-style='color:#C8C8C8;' value="{{keyword}}" placeholder="输入名称/关键字搜索"></input>
+    <image bindtap="search1"  mode="widthFix" src="../images/search.png"></image>
+</view>
+<scroll-view class="content" scroll-y="true" bindscrolltolower='next'>
                 <navigator class="list" wx:for='{{pre}}' wx:key="pre{{index}}" url="../conference/conference?id={{item.id}}" >
                       <image  mode="widthFix" src="{{item.img}}"></image>
                       <view>
-                          <view class="tt">{{item.name}}  </view>
+                      <view class="tt"> <rich-text nodes="{{item.name}}"></rich-text></view>
                           <view class="ly"> 
                               <view>
                                   <text>{{item.begin_time}}</text>
@@ -13,4 +17,8 @@
                           <text>{{item.desc}}</text>
                       </view>
                   </navigator> 
+                  <block wx:if='{{pre.length >= 20}}'>
+                      <view class='more' wx:if='{{loading}}'>上拉加载更多...</view>
+                      <view class='more' wx:else>已加载全部数据!</view>
+                  </block>
 </scroll-view>

+ 8 - 0
pages/huodong/huodong.wxss

@@ -1,4 +1,7 @@
 /* pages/huodong/huodong.wxss */
+.search{
+  margin-bottom: 20rpx;
+}
 .list{
   /* box-shadow: 0px 2rpx 9rpx 0px rgba(0, 0, 0, 0.2); */
   /* border-radius: 20rpx; */
@@ -65,4 +68,9 @@
 }
 .ly view text{
   font-size: 18rpx;
+}
+.more{
+  text-align:center;
+  color:#999;
+  padding:10rpx 0;
 }

+ 1 - 1
pages/index/index.js

@@ -25,7 +25,7 @@ Page({
   },
 
 
-  onShow: function () {
+  onLoad: function () {
     if (this.data.uid){
       this.setData({
         organizers: [],

+ 22 - 1
pages/jInfo/jInfo.js

@@ -40,7 +40,28 @@ Page({
       }
     })
   },
-
+  weixin: function () {
+    if (this.data.info.qrcode || this.data.info.wxcode) {
+      this.setData({
+        show: true
+      })
+    } else {
+      wx.showToast({
+        title: '该期刊暂无公众号',
+      })
+    }
+  },
+  close: function () {
+    this.setData({
+      show: false
+    })
+  },
+  view: function () {
+    wx.previewImage({
+      urls: [this.data.info.qrcode],
+      current: this.data.info.qrcode
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 23 - 1
pages/jInfo/jInfo.wxml

@@ -10,7 +10,7 @@
       <view>主编:{{info.editor}}</view>
       <view>主办单位:{{info.publishingUnit}}</view>
     </view>
-    <button class="gzgzh">关注公众账号</button>
+    <button bindtap="weixin" class="gzgzh">关注公众账号</button>
   </view>
   <view class="intro">
     <text>期刊简介:</text>
@@ -34,3 +34,25 @@
     <view>编辑部地址:{{info.editorialAddress}}</view>
   </view>
 </view>
+
+<view wx:if='{{show}}' class="ewm">
+    <view  class="bg" bindtap="close"></view>
+    <view class="ww">
+        <view class="t">
+            <image src="{{info.img}}"></image>
+            <view>
+              <view>{{info.name}}</view>
+              <view style="color:#999;">微信号:{{info.wxcode}}</view>
+            </view>
+        </view>
+        <image wx:if='{{info.qrcode}}' bindtap="view" class="m" mode="widthFix" src="{{info.qrcode}}"></image>
+        <image wx:else class="m" mode="widthFix" src="../images/no.png"></image>
+        <view class="b" wx:if='{{info.qrcode}}'>
+            <text>1.扫描二维码,关注期刊公众号</text>
+            <text>2.点击图片放大后长按可保存</text>
+        </view>
+        <view class="b" wx:else>
+            <text>抱歉,本公众号暂未上传二维码</text>
+        </view>
+    </view>
+</view>

+ 46 - 0
pages/jInfo/jInfo.wxss

@@ -66,4 +66,50 @@
   display: block;
   text-align: center;
   margin-top: 50rpx;
+}
+
+.bg{
+  position: fixed;
+  width: 100%;
+  height: 100vh;
+  top: 0;
+  left: 0;
+  z-index: 9;
+  background: rgba(0,0,0,.5);
+}
+.ewm>.ww{
+  background: #fff;
+  border-radius: 18rpx;
+  padding: 100rpx;
+  display: block;
+  position: absolute;
+  width: 90%;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  margin: auto;
+  height: 80vh;
+  z-index: 99;
+}
+
+.t image{
+  width: 100rpx;
+  height: 100rpx;
+  border-radius: 8rpx;
+}
+.t>view{
+  display: inline-block;
+  vertical-align: top;
+  margin-left: 20rpx;
+}
+.m{
+  display: block;
+  width: 100%;
+  margin: 50rpx auto;
+}
+.b text{
+  display: block;
+  text-align: center;
+  color: #999;
 }

+ 1 - 1
pages/order/hotel.wxml

@@ -1,6 +1,6 @@
 <view class="content">
     <navigator class="list" wx:for='{{list}}' url="../hotel/hotel?aid={{aid}}&id={{item.id}}">
-        <image src="{{item.img}}"></image>
+        <image src="{{item.imgs}}"></image>
         <view>
             <view class="title">{{item.name}}</view>
             <text>地址:{{item.address}}</text>

+ 2 - 2
pages/order/order.wxml

@@ -8,12 +8,12 @@
         <view >
             <view class="title">{{item.conference_name}}</view>
             <text>报名时间:{{item.ctime}}</text>
-            <navigator url="../eventDetail/eventDetail?id={{item.conference_id}}&apply_id={{item.id}}" class="btn" wx:if='{{item.signup_status==0}}' >上传凭证</navigator>
+            <navigator url="../eventDetail/eventDetail?id={{item.conference_id}}&apply_id={{item.id}}" class="btn" wx:if='{{item.signup_status==0 || item.signup_status==-1}}' >上传凭证</navigator>
             <navigator class="btn" style="background:#999;" wx:if='{{item.signup_status==1}}' >待审核</navigator>
             <navigator class="btn" wx:if='{{item.signup_status==2}}' url="../order/hotel?id={{item.conference_id}}&&aid={{item.id}}"  class="btn">选酒店</navigator>
             <view catchtap="verify" data-url='{{item.verify_qrcode}}' class="btn" wx:if='{{item.signup_status==3}}' >核销</view>
             <view class="btn" style="background:#999;" wx:if='{{item.signup_status==4}}' >已核销</view>
-            <view class="btn" style="background:#999;" wx:if='{{item.signup_status==-1}}' >已驳回</view>
+          
         </view>
     </navigator>
 </view>

+ 3 - 3
pages/searchList/searchList.js

@@ -67,7 +67,7 @@ Page({
               return;
           }
           for (let i = 0; i <data.length;i++) {
-            data[i].name = data[i].name.replace(this.data.keyword, '<span style="color:#3780CD;">' + this.data.keyword+'</span>')
+            data[i]._name = data[i].name.replace(this.data.keyword, '<span style="color:#3780CD;">' + this.data.keyword+'</span>')
             list.push(data[i])
           }
           this.setData({
@@ -79,7 +79,7 @@ Page({
           let data = res.data.data
           for(let i=0;i<data.length;i++){
             for (let j = 0; j < data[i].list.length; j++) {
-              data[i].list[j].name = data[i].list[j].name.replace(this.data.keyword, '<span style="color:#3780CD;">' + this.data.keyword + '</span>')
+              data[i].list[j]._name = data[i].list[j].name.replace(this.data.keyword, '<span style="color:#3780CD;">' + this.data.keyword + '</span>')
             }
           }
           this.setData({
@@ -155,7 +155,7 @@ Page({
       page: 1,
       loading: true
     })
-    
+    this.getData()
   },
 
 

+ 9 - 9
pages/searchList/searchList.wxml

@@ -22,7 +22,7 @@
     <navigator  url="../journalDetail/journalDetail?id={{i.id}}" class="list" wx:for='{{item.list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{item.value=="journal"&& idx<3}}'>
               <image  src="{{i.img}}"></image>
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text>微信号:{{i.wxcode}}</text>
                   <text>主编:{{i.editor}}</text>
                   <text class="">主办单位:{{i.publishingUnit}}</text>
@@ -31,28 +31,28 @@
     <navigator url="../list/list?organizer_id={{i.id}}&title={{i.name}}" class="list" wx:for='{{item.list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{item.value=="organizer" && idx<3}}' >
               <image style="height:125rpx;" src="{{i.img}}"></image>
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text class="wrap">{{i.desc}}</text>
               </view>
     </navigator>
     <navigator url="../actDetail/actDetail?id={{i.id}}" class="list" wx:for='{{item.list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{item.value=="article" && idx<3}}' >
               <image  src="{{i.img}}"></image>
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text class="wrap">{{i.desc}}</text>
               </view>
     </navigator>
     <navigator url="../eventDetail/eventDetail?id={{i.id}}" class="list" wx:for='{{item.list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{item.value=="conference" && idx<3}}' >
               <image src="{{i.img}}"></image>
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text class="wrap">{{i.desc}}</text>
               </view>
     </navigator>
     <navigator url="../list/list?subject_id={{i.id}}&title={{i.name}}" class="list" wx:for='{{item.list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{item.value=="subject" && idx<3}}' style='padding-left:0;'>
               <!-- <image  mode="widthFix" src="{{i.img}}"></image> -->
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text class="wrap">{{i.desc}}</text>
               </view>
     </navigator>
@@ -62,7 +62,7 @@
     <navigator  url="../journalDetail/journalDetail?id={{i.id}}" class="list" wx:for='{{list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{value==type && type=="journal"}}'>
               <image  src="{{i.img}}"></image>
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <!-- <text>微信号:{{i.wxcode}}</text>
                   <text>主编:{{i.editor}}</text>
                   <text class="">主办单位:{{i.publishingUnit}}</text> -->
@@ -72,7 +72,7 @@
     <navigator url="../list/list?organizer_id={{i.id}}&title={{i.name}}" class="list" wx:for='{{list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{value==type && type=="organizer"}}' >
               <image style="height:125rpx;"  src="{{i.img}}"></image>
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text class="wrap">{{i.desc}}</text>
               </view>
     </navigator>
@@ -86,14 +86,14 @@
     <navigator url="../conference/conference?id={{i.id}}" class="list" wx:for='{{list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{value==type && type=="conference"}}' >
               <image src="{{i.img}}"></image>
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text class="wrap">{{i.desc}}</text>
               </view>
     </navigator>
     <navigator url="../list/list?subject_id={{i.id}}&title={{i.name}}" class="list" wx:for='{{list}}' wx:for-item='i'  wx:for-index='idx' wx:if='{{value==type && type=="subject"}}' style='padding-left:0;'>
               <!-- <image  mode="widthFix" src="{{i.img}}"></image> -->
               <view>
-                  <view class="title"> <rich-text nodes="{{i.name}}"></rich-text></view>
+                  <view class="title"> <rich-text nodes="{{i._name}}"></rich-text></view>
                   <text class="wrap">{{i.desc}}</text>
               </view>
     </navigator>

+ 48 - 10
pages/wenzhang/wenzhang.js

@@ -8,7 +8,10 @@ Page({
    */
   data: {
     keyword:'',
-    id:''
+    id:'',
+    list:[],
+    page:1,
+    loading:true
   },
 
   /**
@@ -22,28 +25,63 @@ Page({
   },
   search: function (e) {
     this.setData({
-      keyword: e.detail.value
+      keyword: e.detail.value,
+      page:1,
+      list:[]
     })
     this.getData();
   },
+  search1: function (e) {
+    this.setData({
+      page: 1,
+      list: []
+    })
+    this.getData();
+  },
+  next: function () {
+    if (this.data.loading) {
+      this.setData({
+        page: this.data.page + 1
+      })
+      this.getData()
+    }
+  },
   getData: function () {
-    wx.showNavigationBarLoading()
     var that = this;
+    wx.showNavigationBarLoading()
     wx.request({
       url: host + '/api/article/list',
-      method: 'GET',
       data: {
-        journal_id:this.data.id,
-        keyword: this.data.keyword
+        journal_id: this.data.id,
+        keyword: this.data.keyword,
+        page_size: 20,
+        page: this.data.page
       },
-      success: function (res) {
+      success: res => {
         wx.hideNavigationBarLoading()
-        that.setData({
-          list: res.data.data.list
+        if (!res.data) {
+          return
+        }
+        let list = this.data.list, data = res.data.data.list;
+        if (data.length <= 0) {
+          this.setData({
+            loading: false
+          })
+          return;
+        }
+        for (let i = 0; i < data.length; i++) {
+          data[i].name = data[i].name.replace(this.data.keyword, '<span style="color:#3780CD;">' + this.data.keyword + '</span>')
+
+          list.push(data[i])
+        }
+        this.setData({
+          list: list
         })
       }
     })
-  }, 
+
+  },
+
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 10 - 5
pages/wenzhang/wenzhang.wxml

@@ -1,21 +1,26 @@
 <view class="search">
     <input bindinput="search" placeholder-style='color:#C8C8C8;' value="{{keyword}}" placeholder="输入名称/关键字搜索"></input>
-    <image bindtap="search"  mode="widthFix" src="../images/search.png"></image>
+    <image bindtap="getData"  mode="widthFix" src="../images/search.png"></image>
 </view>
 
-<scroll-view wx:if='{{list.length>0}}' scroll-y="true" scroll-into-view="{{scroll}}" class="content">
+<scroll-view wx:if='{{list.length>0}}' scroll-y="true" scroll-into-view="{{scroll}}" class="content"  bindscrolltolower='next'>
           <navigator url="../actDetail/actDetail?id={{item.id}}" class="list" wx:for='{{list}}' wx:key="journals{{index}}">
               <image   src="{{item.img}}"></image>
               <view>
-                  <view class="title">{{item.name}}</view>
+                  <view class="title"> <rich-text nodes="{{item.name}}"></rich-text></view>
+
                   <view class="ly"> 
                               <view>
                                   <text>2018.5.28</text>
                               </view>
-                              <text>作者:</text>
+                              <text>作者:{{item.author}}</text>
                               <text></text> 
                   </view>
-                  <text class="">主办单位:{{item.desc}}</text>
+                  <text class="">{{item.desc}}</text>
               </view>
           </navigator>
+           <block wx:if='{{list.length >= 20}}'>
+                      <view class='more' wx:if='{{loading}}'>上拉加载更多...</view>
+                      <view class='more' wx:else>已加载全部数据!</view>
+            </block>
 </scroll-view>

+ 5 - 0
pages/wenzhang/wenzhang.wxss

@@ -107,4 +107,9 @@ scroll-view{
 }
 .content{
   height: calc(100vh - 104rpx);
+}
+.more{
+  text-align:center;
+  color:#999;
+  padding:10rpx 0;
 }