Explorar el Código

Merge branch 'xieying' of gitadmin/tuoheng_qmhh_web into develop

xieying
xieying hace 1 año
padre
commit
eb9111661e
Se han modificado 2 ficheros con 32 adiciones y 11 borrados
  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 Ver fichero

@@ -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 Ver fichero

@@ -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,

Cargando…
Cancelar
Guardar