Files
JMApp/pages/listDetail/listDetail.js
XiaoMo 95eed74b96 feat: 新增商品详情搭配优惠组件和客服弹窗
refactor: 优化页面样式和交互逻辑

fix: 修复洗车券列表和详情页的数据展示问题

style: 调整用户页面按钮样式和布局

chore: 移除无用页面和代码,更新项目配置

docs: 更新单次启动页面的使用说明和注意事项

perf: 优化网络请求和数据处理逻辑

build: 更新依赖和配置文件

test: 更新测试用例以适应新功能

ci: 调整CI配置以适应新项目结构
2026-01-03 11:26:51 +08:00

71 lines
2.0 KiB
JavaScript

var t = getApp(), e = require("../../utils/login.js");
Page({
data: {
showLoding: !0,
type: "",
list: [],
loading: !1,
page: {
next_page: 1
}
},
onLoad: function(a) {
var n = this;
this.setData({
type: a.type
}), wx.setNavigationBarTitle({
title: "invest" == a.type ? "充值记录" : "消费明细"
}), e.pageStart(t).then(function(t) {
n.getContent();
});
},
onShow: function() {
this.refresh && this.refreshPage();
},
refreshPage: function() {
this.setData({
list: [],
page: {
next_page: 1
}
}), this.getContent();
},
onPullDownRefresh: function() {
if (!t.globalData.canGetData) return !1;
this.refreshPage(), wx.stopPullDownRefresh();
},
onReachBottom: function() {
if (!t.globalData.canGetData) return !1;
this.getContent();
},
onShareAppMessage: function() {},
getContent: function() {
if (!this.data.page.next_page || this.data.loading) return !1;
wx.showLoading({
title: ""
});
var a = this, n = "invest" == this.data.type ? t.globalData.config.recharge.log : t.globalData.config.consume.init;
e.request(n, {
page: this.data.page.next_page
}, !0).then(function(t) {
if (wx.hideLoading(), 200 != t.code) return wx.showModal({
title: "提示",
content: t.message
}), !1;
a.setData({
showLoding: !1,
list: a.data.list.concat(t.data.list),
user: t.data.user,
page: t.data.page
}, function() {});
}).catch(function(t) {
wx.hideLoading();
});
},
toPage: function() {
this.refresh = 1, wx.navigateTo({
url: "/pages/voucher/voucher"
});
}
});