12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- const reqInterface = require("../../../api/models");
- import {
- toLink
- } from '../../../utils/nav';
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- publicityList: [],
- searchParams: {
- current: 1,
- size: 5
- },
- total: 0,
- conut: 0
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.getPublicityList(this.data.searchParams);
- },
- onShow() {
- if(wx.getStorageSync('token')) {
- reqInterface.GetQuotaGet().then(res => {
- this.setData({
- conut: res.remaining
- })
- })
- }
- },
- getPublicityList(val) {
- reqInterface.GetConsumerinfopublicList(val).then(res => {
- this.setData({
- publicityList: res.records,
- 'searchParams.current': this.data.searchParams.current - 1,
- total: parseInt(res.total / 5 + 1)
- })
- })
- },
- toUp() {
- this.setData({
- 'searchParams.current': this.data.searchParams.current - 1
- })
- this.getPublicityList(this.data.searchParams);
- },
- toNext() {
- this.setData({
- 'searchParams.current': this.data.searchParams.current + 1
- })
- this.getPublicityList(this.data.searchParams);
- },
- toApplyFor() {
- wx.navigateTo({
- url: '/pages/home/guide/detail/index',
- })
-
-
- },
-
- getRefresh() {
- let self = this;
- self.setData({
- searchParams: {
- current: 1,
- size: 5
- }
- })
- self.getPublicityList(self.data.searchParams);
- },
-
- toMore() {
- toLink('/pages/home/publicity/index/index')
- },
-
- toDetail(e) {
- toLink('/pages/home/publicity/detail/index', {id: e.currentTarget.dataset.id})
- },
- })
|