58 lines
1.1 KiB
JavaScript
58 lines
1.1 KiB
JavaScript
// components/videoList/videoList.js
|
|
Component({
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
|
|
},
|
|
|
|
/**
|
|
* 组件的初始数据
|
|
*/
|
|
data: {
|
|
lists:[],//列表
|
|
company_id:wx.getStorageSync('company_id'),
|
|
page:1,
|
|
has_more:true,
|
|
},
|
|
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
methods: {
|
|
/**
|
|
* 跳转到详情
|
|
*/
|
|
toUrl(e){
|
|
wx.navigateTo({
|
|
url: '/pages/home/activeDetail/activeDetail?id='+e.currentTarget.dataset.id,
|
|
})
|
|
},
|
|
/**
|
|
* 企业活动列表
|
|
*/
|
|
actives(){
|
|
if(this.data.has_more){
|
|
wx.$api.companyModule.actives('company',this.data.company_id,this.data.page).then(res=>{
|
|
console.log(res)
|
|
if(res.page.has_more){
|
|
this.setData({
|
|
has_more:true,
|
|
page:this.data.page+1,
|
|
})
|
|
}else{
|
|
this.setData({
|
|
has_more:false
|
|
})
|
|
}
|
|
var lists=this.data.lists.concat(res.data);
|
|
this.setData({
|
|
lists:lists
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
})
|