let format = require('../../../utils/util.js') let app = getApp() const Http = require("../../../utils/HttpBasics") //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.get({ url: config.api.couponOrderList, data: { pageNum: 1, pageSize: 10, orderStatus: key } }) .then(function(res) { console.log(res) res.data.list.map(file => { file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss') }) this.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 }); }, })