diff --git a/pages/index/coupons/index.js b/pages/index/coupons/index.js index 1b41688..0530259 100644 --- a/pages/index/coupons/index.js +++ b/pages/index/coupons/index.js @@ -1,7 +1,7 @@ // pages/index/sw/index.js let config = require('../../../config/config.js') let Http = require('../../../utils/HttpBasics') -const app = getApp() +let app = getApp() Component({ /** * 组件的属性列表 @@ -41,12 +41,14 @@ Component({ }, }, ready() { + var that = this + var pageNum = 1 if (app.globalData.token && app.globalData.token != null) { // business获取 Http.get({ url: config.api.businessList, data: { - pageNum: 1, + pageNum: pageNum, pageSize: 10, type: 1 } @@ -54,19 +56,19 @@ Component({ .then(res => { console.log(res) that.setData({ - list: res.data.list + tabs: res.data.list }) }) // 券list获取 Http.get({ url: config.api.couponList, data: { - pageNum: 1, + pageNum: pageNum, pageSize: 10 } }).then(res => { console.log(res); - this.setData({ + that.setData({ list: res.data.list }) }) @@ -84,19 +86,19 @@ Component({ .then(res => { console.log(res) that.setData({ - list: res.data.list + tabs: res.data.list }) }) // 券list获取 Http.get({ url: config.api.couponList, data: { - pageNum: 1, + pageNum: pageNum, pageSize: 10 } }).then(res => { console.log(res); - this.setData({ + that.setData({ list: res.data.list }) }) diff --git a/pages/index/coupons/index.wxml b/pages/index/coupons/index.wxml index 8c791f8..10f8049 100644 --- a/pages/index/coupons/index.wxml +++ b/pages/index/coupons/index.wxml @@ -1,6 +1,6 @@ - +