const util = require('../../../utils/util.js');
const config = require('../../../utils/config')
Page({
  data: {
    imgPath:config.imgPath,
    act_list:[],
    pageIndex:1
  },
  onLoad(options) {
    this.getActList()
  },
  onShow() {

  },
  jumpToPoster(e){
    let id =e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/product/activity/bill?id='+id+'&makeTask=true',
    })
  },
  jumpPage(){
    wx.navigateTo({
      url: '/pages/turntable/hairpin/index',
    })
  },
  getActList(e){
    let that=this;
    util.ajax({
      func: "v2/article/recom_list",
      data: { 
        pageIndex: this.data.pageIndex, 
        pageSize: 10
      },
      load:false
    }, function (res) {
      if (res.code == 0) {
        that.setData({act_list:e?[...that.data.act_list,...res.data.list]:res.data.list})
      }
    })
  },
  onReachBottom() {
    let that=this;
    this.data.pageIndex++;
    this.setData({pageIndex:this.data.pageIndex})
    this.getActList(true)
  },
  onShareAppMessage() {
    return{
      title:'上传发圈截图，领取更多优惠福利。',
      path:'/pages/account/monetaryCenter/posterTask',
      imageUrl:'https://img.bbztx.com/image_test/upload/thumbs/20220905/logo/1662359120902091698.png'
    }
  }
})