ソースを参照

Merge branch 'xieying' of gitadmin/tuoheng_qmhh_web into develop

xieying
xieying 1年前
コミット
eb9111661e
2個のファイルの変更32行の追加11行の削除
  1. +18
    -2
      package_first/pages/LearningVideo/index.js
  2. +14
    -9
      package_first/pages/VolunteerActivity/index.js

+ 18
- 2
package_first/pages/LearningVideo/index.js ファイルの表示

@@ -10,6 +10,11 @@ Page({
params: {
openid: null
},
userPage:{
page:1,
limit:10
},
total:0,
current: ''
},

@@ -74,7 +79,13 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

if(this.data.userPage.page*this.data.userPage.limit<this.data.total){
this.data.userPage.page++
this.setData({
userPage:this.data.userPage
})
this.westreamVideo()
}
},

/**
@@ -92,7 +103,12 @@ Page({
...this.data.userPage
}
api_westreamVideo(data).then(res=>{
let list = [...this.data.list,...res.data.records]
let list = []
if(this.data.userPage.page==1){
list = res.data.records
}else{
list = [...this.data.list,...res.data.records]
}
let total = res.data.total
this.setData({
total,

+ 14
- 9
package_first/pages/VolunteerActivity/index.js ファイルの表示

@@ -69,7 +69,13 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

if(this.data.userPage.page*this.data.userPage.limit<this.data.total){
this.data.userPage.page++
this.setData({
userPage:this.data.userPage
})
this.westreamActivity()
}
},

/**
@@ -95,20 +101,19 @@ Page({
}
api_westreamActivity(data).then(res=>{
let list =[]
if(this.data.userPage.page==1){
list =res.data.records
}else{
list = [...this.data.list,...res.data.records]
}
let total = res.data.total
list = list.reduce((pre,item)=>{
res.data.records = res.data.records.reduce((pre,item)=>{
return [...pre,{
...item,
activityBeginTime:this.formatDate(item.activityBeginTime),
activityEndTime:this.formatDate(item.activityEndTime)
}]
},[])
if(this.data.userPage.page==1){
list =res.data.records
}else{
list = [...this.data.list,...res.data.records]
}
let total = res.data.total
this.setData({
total,
list,

読み込み中…
キャンセル
保存