|
@@ -1,3 +1,4 @@
|
|
|
+const app = getApp();
|
|
|
Page({
|
|
|
data: {
|
|
|
images: {
|
|
@@ -5,19 +6,9 @@ Page({
|
|
|
water: '/static_file/water.png'
|
|
|
},
|
|
|
userInfo: {
|
|
|
- name: '王源',
|
|
|
- id: '320185452454104',
|
|
|
- address: '徐州市丰县****楼102室'
|
|
|
- },
|
|
|
- amount: 73.28, //应缴金额
|
|
|
- actualAmount: 73.28,
|
|
|
- balance: 0, // 余额
|
|
|
- quickAmounts: [10, 30, 50, 100, 200, 500],
|
|
|
- waterUsage: {
|
|
|
- lastReading: 2000,
|
|
|
- currentReading: 2050,
|
|
|
- nextReading: 3020,
|
|
|
- usage: 87
|
|
|
+ name: app.globalData.currentAccountInfo.username,
|
|
|
+ id: app.globalData.currentAccountInfo.usernumber,
|
|
|
+ address: app.globalData.currentAccountInfo.address
|
|
|
},
|
|
|
showKeyboard: false,
|
|
|
selectedAmount: null,
|
|
@@ -35,136 +26,47 @@ Page({
|
|
|
water: '/static_file/water.png'
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- // 获取地址信息
|
|
|
- if (options.address) {
|
|
|
- this.setData({
|
|
|
- address: options.address
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
// 获取账单列表
|
|
|
this.getBillList();
|
|
|
},
|
|
|
|
|
|
- // 返回上一页
|
|
|
- goBack: function() {
|
|
|
- wx.navigateBack({
|
|
|
- delta: 1
|
|
|
+ getBillList:function(){
|
|
|
+ const _this = this;
|
|
|
+ wx.showLoading({
|
|
|
+ title: '获取中...',
|
|
|
+ mask: true,
|
|
|
});
|
|
|
+ debugger;
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.interfaceUrls.billList,
|
|
|
+ method: 'POST',
|
|
|
+ data: {
|
|
|
+ accountNum: app.globalData.currentAccountInfo.usernumber,
|
|
|
+ year: new Date().getFullYear()
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/json', // 默认值
|
|
|
+ 'token':app.globalData.userWxInfo.token,
|
|
|
+ 'source':"wc",
|
|
|
+ '!SAAS_LOGIN_TOKEN_!':app.globalData.currentAccountInfo.dsKey
|
|
|
+ },
|
|
|
+ success (res) {
|
|
|
+ wx.hideLoading();
|
|
|
+ let apiReturnData=res.data;
|
|
|
+ debugger;
|
|
|
+ _this.setData({
|
|
|
+ billList:apiReturnData.data,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail(error) {
|
|
|
+ wx.hideLoading()
|
|
|
+ utils.simleInfo('登录失败,请稍后再试')
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
- // 从接口获取账单列表数据
|
|
|
- getBillList: function() {
|
|
|
- // 这里应该是从API获取数据,这里用模拟数据
|
|
|
- const mockData = [
|
|
|
- {
|
|
|
- billDate: '2025/01/30',
|
|
|
- billNumber: '250201100235',
|
|
|
- amount: '73.28',
|
|
|
- usage: '87',
|
|
|
- meterReading: '2000-2025',
|
|
|
- paymentTime: '2025/01/31 14:39',
|
|
|
- isPaid: false,
|
|
|
- currentDate: '2025/01/30',
|
|
|
- currentReading: '2025',
|
|
|
- lastDate: '2024/12/30',
|
|
|
- lastReading: '2000',
|
|
|
- totalAmount: '85.62',
|
|
|
- discount: '12.34',
|
|
|
- lateFee: '0',
|
|
|
- payableAmount: '73.28'
|
|
|
- },
|
|
|
- {
|
|
|
- billDate: '2024/12/30',
|
|
|
- billNumber: '250201103521',
|
|
|
- amount: '127.28',
|
|
|
- usage: '121',
|
|
|
- meterReading: '2000-2025',
|
|
|
- paymentTime: '2025/01/03 09:51',
|
|
|
- isPaid: true,
|
|
|
- currentDate: '2024/12/30',
|
|
|
- currentReading: '2000',
|
|
|
- lastDate: '2024/11/30',
|
|
|
- lastReading: '1975',
|
|
|
- totalAmount: '137.28',
|
|
|
- discount: '10.00',
|
|
|
- lateFee: '0',
|
|
|
- payableAmount: '127.28'
|
|
|
- },
|
|
|
- {
|
|
|
- billDate: '2024/11/30',
|
|
|
- billNumber: '250201103521',
|
|
|
- amount: '127.28',
|
|
|
- usage: '121',
|
|
|
- meterReading: '2000-2025',
|
|
|
- paymentTime: '2024/12/03 09:51',
|
|
|
- isPaid: true,
|
|
|
- currentDate: '2024/11/30',
|
|
|
- currentReading: '1975',
|
|
|
- lastDate: '2024/10/31',
|
|
|
- lastReading: '1950',
|
|
|
- totalAmount: '137.28',
|
|
|
- discount: '10.00',
|
|
|
- lateFee: '0',
|
|
|
- payableAmount: '127.28'
|
|
|
- },
|
|
|
- {
|
|
|
- billDate: '2024/11/30',
|
|
|
- billNumber: '250201103521',
|
|
|
- amount: '127.28',
|
|
|
- usage: '121',
|
|
|
- meterReading: '2000-2025',
|
|
|
- paymentTime: '2024/12/03 09:51',
|
|
|
- isPaid: true,
|
|
|
- currentDate: '2024/11/30',
|
|
|
- currentReading: '1950',
|
|
|
- lastDate: '2024/10/31',
|
|
|
- lastReading: '1925',
|
|
|
- totalAmount: '137.28',
|
|
|
- discount: '10.00',
|
|
|
- lateFee: '0',
|
|
|
- payableAmount: '127.28'
|
|
|
- },
|
|
|
- {
|
|
|
- billDate: '2024/11/30',
|
|
|
- billNumber: '250201103521',
|
|
|
- amount: '127.28',
|
|
|
- usage: '121',
|
|
|
- meterReading: '2000-2025',
|
|
|
- paymentTime: '2024/12/03 09:51',
|
|
|
- isPaid: true,
|
|
|
- currentDate: '2024/11/30',
|
|
|
- currentReading: '1925',
|
|
|
- lastDate: '2024/10/31',
|
|
|
- lastReading: '1900',
|
|
|
- totalAmount: '137.28',
|
|
|
- discount: '10.00',
|
|
|
- lateFee: '0',
|
|
|
- payableAmount: '127.28'
|
|
|
- },
|
|
|
- {
|
|
|
- billDate: '2024/11/30',
|
|
|
- billNumber: '250201103521',
|
|
|
- amount: '127.28',
|
|
|
- usage: '121',
|
|
|
- meterReading: '2000-2025',
|
|
|
- paymentTime: '2024/12/03 09:51',
|
|
|
- isPaid: true,
|
|
|
- currentDate: '2024/11/30',
|
|
|
- currentReading: '1900',
|
|
|
- lastDate: '2024/10/31',
|
|
|
- lastReading: '1875',
|
|
|
- totalAmount: '137.28',
|
|
|
- discount: '10.00',
|
|
|
- lateFee: '0',
|
|
|
- payableAmount: '127.28'
|
|
|
- }
|
|
|
- ];
|
|
|
+ // 返回上一页
|
|
|
+ goBack: function() {
|
|
|
|
|
|
- this.setData({
|
|
|
- billList: mockData
|
|
|
- });
|
|
|
},
|
|
|
|
|
|
// 点击开发票按钮
|