let Http = require('../../../utils/http.js') let format = require('../../../utils/util.js') let app = getApp() //1535126400000 Page({ data: { tabs: [{ key: 0, name: "未使用" }, { key: 1, name: "已使用" }, { key: 2, name: "已过期" }, { key: 3, name: "已退款" } ], list: [], current: '', current_scroll: '1' }, onLoad() { this.getList(0) }, getList(key) { Http.getResquest('/api/couponOrder/list', app.globalData.token, '加载中', { pageNum: 1, pageSize: 10, orderStatus: key }, (res) => { res.data.list.map(file => { file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') }) this.setData({ list: res.data.list }) console.log(res) }) }, handleChange({ detail }) { this.setData({ current: detail.key }); }, handleChangeScroll({ detail }) { this.getList(detail.key) this.setData({ current_scroll: detail.key }); }, })