43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
var t = getApp();
|
|
|
|
Page({
|
|
data: {
|
|
data: [],
|
|
isLogin: !1,
|
|
userInfo: {}
|
|
},
|
|
onLoad: function(t) {
|
|
this.getYonghuList();
|
|
},
|
|
onShow: function() {
|
|
this.getYonghuList();
|
|
},
|
|
toDate: function(t, e) {
|
|
var n = new Date(t), o = n.getFullYear(), i = n.getMonth() + 1 < 10 ? "0" + (n.getMonth() + 1) : n.getMonth() + 1, s = n.getDate() < 10 ? "0" + n.getDate() : n.getDate(), g = n.getHours() < 10 ? "0" + n.getHours() : n.getHours(), a = n.getMinutes() < 10 ? "0" + n.getMinutes() : n.getMinutes(), u = n.getSeconds() < 10 ? "0" + n.getSeconds() : n.getSeconds();
|
|
return "1" == e ? o + "-" + i + "-" + s + " " + g + ":" + a + ":" + u : "2" == e ? o + "-" + i + "-" + s : void 0;
|
|
},
|
|
getYonghuList: function(e) {
|
|
var n = this;
|
|
t._get("user/yongjinjilu", {}, function(t) {
|
|
t.data.list.length && wx.pageScrollTo({
|
|
scrollTop: 0
|
|
});
|
|
var e = t.data.list, o = [];
|
|
e.forEach(function(t, e) {
|
|
t.commission = t.commission / 100, 2 == t.status && (t.settlement_time = n.toDate(1e3 * t.settlement_time, 1)),
|
|
o.push(t);
|
|
}), n.setData({
|
|
data: o
|
|
});
|
|
});
|
|
},
|
|
getUserDetail: function() {},
|
|
onLogin: function() {
|
|
wx.navigateTo({
|
|
url: "../login/login"
|
|
});
|
|
},
|
|
onCheckLogin: function() {
|
|
return !!this.data.isLogin || (t.showError("很抱歉,您还没有登录"), !1);
|
|
}
|
|
}); |