Files
2024-08-22 12:53:28 +08:00

42 lines
1.4 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, g = n.getDate() < 10 ? "0" + n.getDate() : n.getDate(), a = n.getHours() < 10 ? "0" + n.getHours() : n.getHours(), s = n.getMinutes() < 10 ? "0" + n.getMinutes() : n.getMinutes(), u = n.getSeconds() < 10 ? "0" + n.getSeconds() : n.getSeconds();
return "1" == e ? o + "-" + i + "-" + g + " " + a + ":" + s + ":" + u : "2" == e ? o + "-" + i + "-" + g : void 0;
},
getYonghuList: function(e) {
var n = this;
t._get("user/txjilu", {}, function(t) {
t.data.list.length && wx.pageScrollTo({
scrollTop: 0
});
var e = t.data.list, o = [];
e.forEach(function(t, e) {
t.qian = t.qian / 100, 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);
}
});