87 lines
2.4 KiB
JavaScript
87 lines
2.4 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_intergral = require("../../api/intergral.js");
|
|
const common_js_util = require("../../common/js/util.js");
|
|
if (!Array) {
|
|
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
|
_easycom_uni_icons2();
|
|
}
|
|
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
|
if (!Math) {
|
|
(_easycom_uni_icons + common_vendor.unref(apex))();
|
|
}
|
|
const apex = () => "../../components/header/apex.js";
|
|
const _sfc_main = {
|
|
__name: "integralLog",
|
|
setup(__props) {
|
|
const scrollLog = common_vendor.reactive({
|
|
data: [],
|
|
pageNum: 1,
|
|
pageSize: 30,
|
|
total: 0
|
|
});
|
|
common_vendor.onLoad(() => {
|
|
getList();
|
|
});
|
|
common_vendor.onPullDownRefresh(() => {
|
|
refreshList();
|
|
});
|
|
common_vendor.onReachBottom(() => {
|
|
getMoreList();
|
|
});
|
|
function refreshList() {
|
|
scrollLog.homePageSize = 1;
|
|
getList();
|
|
}
|
|
function getMoreList() {
|
|
if (scrollLog.total <= scrollLog.data.length)
|
|
return;
|
|
scrollLog.pageNum++;
|
|
getList();
|
|
}
|
|
function getList() {
|
|
api_intergral.intergral.scrollChange({
|
|
query: {
|
|
pageNum: scrollLog.pageNum,
|
|
pageSize: scrollLog.pageSize
|
|
}
|
|
}).then((rs) => {
|
|
if (rs.code == 200) {
|
|
if (scrollLog.pageNum == 1)
|
|
scrollLog.data.length = 0;
|
|
scrollLog.data.push(...rs.rows);
|
|
scrollLog.total = rs.total;
|
|
return;
|
|
}
|
|
common_js_util.util.alert({
|
|
content: rs.msg,
|
|
showCancel: false
|
|
});
|
|
}).finally(() => {
|
|
common_vendor.index.stopPullDownRefresh();
|
|
});
|
|
}
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({}, {
|
|
c: common_vendor.p({
|
|
title: "变动明细"
|
|
}),
|
|
d: common_vendor.f(scrollLog.data, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(item.context),
|
|
b: common_vendor.t(item.createTime),
|
|
c: Number(item.scroll) != 0
|
|
}, Number(item.scroll) != 0 ? common_vendor.e({
|
|
d: Number(item.scroll) > 0
|
|
}, Number(item.scroll) > 0 ? {} : {}, {
|
|
e: common_vendor.t(item.scroll)
|
|
}) : {}, {
|
|
f: index
|
|
});
|
|
})
|
|
});
|
|
};
|
|
}
|
|
};
|
|
wx.createPage(_sfc_main);
|