Files
oil-client-wechat/pages/limitDetail/limitDetail.js
2025-12-19 11:20:59 +08:00

55 lines
1.3 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const app = getApp();
Page({
data: {
userInfo: {
namePhone: '',
vehicle: ''
},
walletList: [],
// 此页面 页面内容距最顶部的距离
height: app.globalData.height,
nvabarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: "额度查询结果", //导航栏 中间的标题
}
},
onLoad: function(options) {
// 获取事件通道
const eventChannel = this.getOpenerEventChannel();
// 监听limitData事件获取上一页面传递的数据
eventChannel.on('limitData', (data) => {
console.log('接收到的数据:', data);
this.processData(data.walletList);
});
},
// 处理数据
processData: function(data) {
// 检查数据是否有效
if (data && data.length > 0) {
// 从第一个元素获取用户基本信息
const firstItem = data[0];
// 格式化姓名和手机号
const namePhone = `${firstItem.auName}-${firstItem.phone}`;
this.setData({
userInfo: {
namePhone: namePhone,
vehicle: firstItem.vehicle || '未设置'
},
walletList: data
});
}
},
// 返回上一页
navigateBack: function() {
wx.navigateBack({
delta: 1
});
}
});