admin
2020-12-22 28a4cfadc0a78d1bfec093e0694f420aaf3a725c
pages/rewards/rewards.js
@@ -1,5 +1,5 @@
var help = require('../../util/help.js');
var api = require('../../util/api.js');
var help = require('/util/help.js');
var api = require('/util/api.js');
var $this;
Page({
  data: {
@@ -19,12 +19,14 @@
    //过期未领弹框
    showOutDateModal: false,
    showNotice: true,
    showNotice: false,
    noticeMode: 'closable',//closable
  },
  onLoad() {
    help.setPageNavBar("天天领现金");
    $this = this;
    $this.requestNotice();
    $this.requestActivity(1, true);
  },
  //请求活动
@@ -32,12 +34,13 @@
    $this.setData({
      page: page,
      isRequesting: true,
      showEmptyDefault:false
      showEmptyDefault: false
    });
    api.getRecommendActivity({
      data: {
        page: page
      },
      showErrorToast: true,
      showLoading: first,
      success: function (res) {
        console.log(res)
@@ -61,10 +64,6 @@
              showEmptyDefault: true
            })
          }
        } else {
          my.showToast({
            content: res.msg
          });
        }
      },
      fail: function () {
@@ -84,6 +83,21 @@
          });
        }, 1000);
      }
    });
  },
  requestNotice() {
    api.getNotice({
      position: 'home',
      success(res) {
        if (res.code == 0) {
          $this.setData({
            notice: res.data,
            showNotice: true,
            noticeMode: res.data.link?'link':'closable'
          })
        }
      }
    });
@@ -152,8 +166,12 @@
      my.showToast({
        content: "进入详情"
      });
      if ($this.data.notice.link) {
        my.navigateTo({
          url: '/pages/web/web?url=' + $this.data.notice.link
        })
      }
    }
  }