|
- let format = require('../../../utils/util.js')
- let config = require('../../../config/config.js')
- let app = getApp()
- const Http = require("../../../utils/HttpBasics")
- //1535126400000
- Page({
- data: {
- tabs: [],
- list: [],
- current: '',
- current_scroll: '1'
- },
- onLoad() {
- this.getBusinessList(1)
- this.getList(0, 1)
- },
- getList(key, pageNum) {
- var that = this
- Http.get({
- url: config.api.couponOrderList,
- data: {
- pageNum: pageNum,
- pageSize: 10,
- orderStatus: key
- }
- })
- .then(res => {
- console.log(res)
- res.data.list.map(file => {
- file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss')
- })
- that.setData({
- list: res.data.list
- })
- })
- },
- getBusinessList(pageNum) {
- var that = this
- Http.get({
- url: config.api.businessList,
- data: {
- pageNum: pageNum,
- pageSize: 10,
- type: 1
- }
- })
- .then(function(res) {
- console.log(res)
- that.setData({
- list: res.data.list
- })
- }, function(error) {})
- },
- handleChange({
- detail
- }) {
- this.setData({
- current: detail.key
- });
- },
- handleChangeScroll({
- detail
- }) {
- this.getList(detail.key)
- this.setData({
- current_scroll: detail.key
- });
- },
- })
|