wpfw_ewei_wxapp/pages/member/balance/index.js
2023-02-26 08:10:18 +08:00

76 lines
2.1 KiB
JavaScript

var t = getApp(), e = t.requirejs("core");
Page({
data: {
icons: t.requirejs("icons"),
type: 0,
isopen: !1,
page: 1,
loaded: !1,
loading: !0,
list: [],
is_transfer: !1,
bg: "",
btn_text: "转账"
},
onLoad: function(e) {
e.type > 0 && this.setData({
type: 1
}), t.url(e), this.getUserCredit2(), this.getSet(), this.getList();
},
onPullDownRefresh: function() {
wx.stopPullDownRefresh();
},
onReachBottom: function() {
this.data.loaded || this.data.list.length == this.data.total || this.getList();
},
getUserCredit2: function() {
var t = this;
e.get("member/getUserCredit", {}, function(e) {
t.setData({
credit2: e.member.credit2,
sysset: e.sysset
});
});
},
getSet: function() {
var e = t.getCache("transfer_account", "");
"" != e && 1 == e.balance && this.setData({
is_transfer: !0,
btn_text: e.texts.transfer_text
});
},
getList: function() {
var t = this;
t.setData({
loading: !0
}), e.get("member/log/get_list", {
type: t.data.type,
page: t.data.page
}, function(e) {
var a = {
loading: !1,
total: e.total,
show: !0
};
if (1 == t.data.page) {
a.isopen = e.isopen;
var s = "充值记录";
1 == e.isopen && (s = e.moneytext + "明细"), a.moneytext = e.moneytext, wx.setNavigationBarTitle({
title: s
});
}
e.list || (e.list = []), e.list.length > 0 && (a.page = t.data.page + 1, a.list = t.data.list.concat(e.list),
e.list.length < e.pagesize && (a.loaded = !0)), t.setData(a);
});
},
myTab: function(t) {
var a = e.pdata(t).type;
this.setData({
type: a,
page: 1,
list: [],
loading: !0
}), this.getList();
}
});