integral.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // pages/integral/integral.js
  2. import Integralinfo from '../../api/integralinfo'
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. lock: false,
  9. noResult: false,
  10. noMore: false,
  11. bannerList: [],
  12. channelid: '',
  13. shopid: '',
  14. storeid: ''
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad: function (options) {
  20. },
  21. /**
  22. * 生命周期函数--监听页面初次渲染完成
  23. */
  24. onReady: function () {
  25. },
  26. /**
  27. * 生命周期函数--监听页面显示
  28. */
  29. onShow: function () {
  30. this.getBannerList()
  31. },
  32. /**
  33. * 生命周期函数--监听页面隐藏
  34. */
  35. onHide: function () {
  36. },
  37. /**
  38. * 生命周期函数--监听页面卸载
  39. */
  40. onUnload: function () {
  41. },
  42. /**
  43. * 页面相关事件处理函数--监听用户下拉动作
  44. */
  45. onPullDownRefresh: function () {
  46. },
  47. /**
  48. * 页面上拉触底事件的处理函数
  49. */
  50. onReachBottom: function () {
  51. },
  52. /**
  53. * 用户点击右上角分享
  54. */
  55. onShareAppMessage: function () {
  56. },
  57. getBannerList: function() {
  58. Integralinfo.getBannerList({
  59. channelid: this.channelid,
  60. shopid: this.shopid,
  61. storeid: this.storeid
  62. }).then(res => {
  63. console.log(res.data)
  64. this.setData({
  65. bannerList: res.data
  66. })
  67. }).catch(err => {
  68. console.log(err)
  69. })
  70. },
  71. })