优化页面
This commit is contained in:
90
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/points.js
vendored
Normal file
90
unpackage/dist/dev/mp-weixin/pages/Mine/minecomponents/points.js
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const components_request = require("../../../components/request.js");
|
||||
const components_formatDate = require("../../../components/formatDate.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
title: "Hello",
|
||||
userinfo: {},
|
||||
page: 0,
|
||||
triggered: false,
|
||||
pointslist: []
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.userinfo = res.data;
|
||||
this.getPointsDetail();
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
formatDate: components_formatDate.formatDate,
|
||||
//下拉刷新
|
||||
onRefresherRefresh() {
|
||||
this.page = 0;
|
||||
this.triggered = true;
|
||||
this.pointslist = [];
|
||||
this.getPointsDetail();
|
||||
},
|
||||
//上拉加载
|
||||
onScrollToLower() {
|
||||
this.page += 1;
|
||||
this.getPointsDetail();
|
||||
},
|
||||
//获取积分详情
|
||||
getPointsDetail() {
|
||||
components_request.request({
|
||||
url: "user/pointsDetail",
|
||||
method: "POST",
|
||||
data: {
|
||||
userId: this.userinfo.id,
|
||||
page: this.page,
|
||||
size: 10
|
||||
},
|
||||
userInfo: true
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.triggered = false;
|
||||
this.pointslist.push(...res.data);
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/points.vue:100", res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 返回上一页
|
||||
onBack() {
|
||||
common_vendor.index.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_uni_card = common_vendor.resolveComponent("uni-card");
|
||||
_component_uni_card();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.o$1((...args) => $options.onBack && $options.onBack(...args)),
|
||||
b: common_vendor.f($data.pointslist, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.formatDate(item.time)),
|
||||
b: common_vendor.t(item.info),
|
||||
c: common_vendor.t(item.num),
|
||||
d: item.status == 0 ? "#11ff002b" : "#ff000011",
|
||||
e: index,
|
||||
f: "cd2929c5-0-" + i0
|
||||
};
|
||||
}),
|
||||
c: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
|
||||
d: common_vendor.o$1((...args) => $options.onScrollToLower && $options.onScrollToLower(...args)),
|
||||
e: $data.triggered
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cd2929c5"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/Mine/minecomponents/points.js.map
|
||||
Reference in New Issue
Block a user