修改分页组件在部分场景中存在缓存问题导致部分数据无法查看的问题

This commit is contained in:
qiaomu 2024-08-08 10:30:55 +08:00
parent cf7756dd5c
commit b9e1b06d29
33 changed files with 56 additions and 886 deletions

View File

@ -35,7 +35,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const { id = "R00053677580943361", time = "2023-10" } = options; const { id, time } = options;
this.init(id, time); this.init(id, time);
}, },
async init(id, time) { async init(id, time) {

View File

@ -99,7 +99,12 @@ Page({
alertInfo(message) alertInfo(message)
return; return;
} }
this.setData({ list: data, electricNumber: Number(electricNumber)?.toFixed(2), meterNumber: Number(meterNumber), totalPage: Math.ceil(total / 20) }) this.setData({
list: data,
electricNumber: Number(electricNumber)?.toFixed(2),
meterNumber: Number(meterNumber),
totalPage: Math.ceil(total / 20)
})
if (!data?.length) { if (!data?.length) {
return; return;
} }
@ -279,7 +284,13 @@ Page({
}); });
break; break;
case "day": case "day":
this.setData({ yearMonthDay: time, yearMonthDayStamp: new Date(time).getTime(), visible: false }, () => { console.log('day')
this.setData({
yearMonthDay: time,
yearMonthDayStamp: new Date(time).getTime(),
visible: false,
page: 1,
}, () => {
this.init(); this.init();
}) })
break; break;

View File

@ -105,7 +105,6 @@
<view wx:if="{{accountingList.length}}"> <view wx:if="{{accountingList.length}}">
<accountingCard wx:for="{{accountingList}}" data="{{item}}" /> <accountingCard wx:for="{{accountingList}}" data="{{item}}" />
</view> </view>
<!-- <table header="{{meterReadingHeader}}" list="{{accountingList}}" wx:if="{{accountingList.length}}" /> -->
<empty bind:refresh="getAccountingBalanceList" wx:else /> <empty bind:refresh="getAccountingBalanceList" wx:else />
</view> </view>

View File

@ -35,7 +35,6 @@ Component({
*/ */
methods: { methods: {
back() { back() {
// this.triggerEvent("back")
wx.navigateBack(); wx.navigateBack();
} }
} }

View File

@ -5,10 +5,26 @@ Component({
properties: { properties: {
currentIndex: { //当前页码 currentIndex: { //当前页码
type: Number, type: Number,
value: 1 value: 1,
observer(newVal,oldVal) {// 数据监听
const that = this;
this.setData({
index: newVal
}, () => {
that.updateBtnDis();
})
},
}, },
totalPage: { totalPage: {
type: Number type: Number,
observer(newVal,oldVal) {// 数据监听
const that = this;
this.setData({
total: newVal
}, () => {
that.updateBtnDis();
})
},
} }
}, },
@ -124,17 +140,17 @@ Component({
}) })
}else if (index == total) { // 最后一页 }else if (index == total) { // 最后一页
this.setData({ this.setData({
nextBtnDis: true nextBtnDis: true,
prevBtnDis: false,
}) })
} else if (index == 1){ // 第一页 } else if (index == 1){ // 第一页
this.setData({ this.setData({
prevBtnDis: true prevBtnDis: true,
nextBtnDis: false,
}) })
}else{ }else{
this.setData({ this.setData({
prevBtnDis: false prevBtnDis: false,
})
this.setData({
nextBtnDis: false nextBtnDis: false
}) })
} }

View File

@ -14,3 +14,4 @@
</view> </view>
</view> </view>
</view> </view>
{{totalPage}}

View File

@ -15,13 +15,6 @@ Component({
title: String, title: String,
}, },
/**
* 组件的初始数据
*/
data: {
// columns:['杭州', '宁波', '温州', '嘉兴', '湖州']
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */

View File

@ -3,7 +3,7 @@ import { getTenementList } from "../../service/tenement";
import request from '../../utils/request' import request from '../../utils/request'
const { OK } = request const { OK } = request
// components/select/index.js
Component({ Component({
/** /**
@ -30,10 +30,6 @@ Component({
*/ */
methods: { methods: {
async onInput(e) { async onInput(e) {
// this.setData({
// visible: true,
// list: [e.detail, e.detail, e.detail]
// })
switch(this.data.type) { switch(this.data.type) {
case 0: case 0:
const { data = [], code, message } = await getParkList({ keyword: e.detail }); const { data = [], code, message } = await getParkList({ keyword: e.detail });

View File

@ -102,52 +102,4 @@ Page({
}) })
}, 500) }, 500)
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -2,7 +2,7 @@ import { getBillList } from "../../service/accounting"
import { alertInfo } from "../../utils/index"; import { alertInfo } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
const { OK } = request; const { OK } = request;
// pages/billList/index.js
Page({ Page({
/** /**
@ -37,52 +37,4 @@ Page({
url: '/childPackage/pages/billDetail/index?id=' + report, url: '/childPackage/pages/billDetail/index?id=' + report,
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,8 +1,8 @@
// pages/handleLogin/index.js
import { userValidate } from "../../service/user"; import { userValidate } from "../../service/user";
import { alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index"; import { alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
import request from "../../utils/request" import request from "../../utils/request"
const { OK } = request; const { OK } = request;
// pages/handleLogin/index.js
Page({ Page({
/** /**
@ -111,52 +111,4 @@ Page({
} }
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,3 +1,4 @@
// pages/home/index.js
import { getMeterDetail, getMeterList, getTenementMeterList } from "../../service/meter"; import { getMeterDetail, getMeterList, getTenementMeterList } from "../../service/meter";
import { getOwnTenementList } from "../../service/tenement"; import { getOwnTenementList } from "../../service/tenement";
import { alertInfo, alertSuccess } from "../../utils/index"; import { alertInfo, alertSuccess } from "../../utils/index";
@ -6,7 +7,6 @@ import { getDot } from "../../utils/system";
import { getUserInfo } from "../../service/user" import { getUserInfo } from "../../service/user"
import { requestRecharge } from "../../service/recharge"; import { requestRecharge } from "../../service/recharge";
const { OK } = request; const { OK } = request;
// pages/home/index.js
Page({ Page({
/** /**
@ -75,10 +75,6 @@ Page({
const currentPark = this.data.park; const currentPark = this.data.park;
switch(type) { switch(type) {
case "park": case "park":
// if (value.id === currentPark?.id) {
// this.setData({ show: false })
// return
// }
this.setData({ this.setData({
show: false, show: false,
park: value, park: value,
@ -88,13 +84,7 @@ Page({
wx.setStorageSync('tenement', value.tenements?.[0]) wx.setStorageSync('tenement', value.tenements?.[0])
break; break;
case "tenement": case "tenement":
// const currentTenement = this.data.tenement;
// if (value.id === currentTenement?.id) {
// this.setData({ show: false })
// return
// }
wx.setStorageSync('tenement', value) wx.setStorageSync('tenement', value)
// wx.setStorageSync('meter', null)
this.setData({ this.setData({
show: false, show: false,
tenement: value tenement: value
@ -153,9 +143,6 @@ Page({
alertInfo("最少为1分") alertInfo("最少为1分")
return return
} }
// wx.navigateTo({
// url: `/pages/rechargeWay/index?money=${money}&address=${meter.address}&id=${meter?.id}&tenement=${tenement?.id}&park=${park.id}`,
// })
this.setData({ rechargeVisible: true }) this.setData({ rechargeVisible: true })
}, },
jumpToInvoice() { jumpToInvoice() {
@ -267,15 +254,12 @@ Page({
async setUser() { async setUser() {
const result = await getUserInfo(); const result = await getUserInfo();
if (result.code !== OK) { if (result.code !== OK) {
// alertInfo(result.message)
const user = wx.getStorageSync('user') const user = wx.getStorageSync('user')
this.setData({ user: user }) this.setData({ user: user })
return; return;
} }
this.setData({ user: result.data }) this.setData({ user: result.data })
wx.setStorageSync('user', result.data) wx.setStorageSync('user', result.data)
// const user = wx.getStorageSync('user')
// this.setData({ user: user })
}, },
async getAllList() { async getAllList() {
const { code, message, data } = await getOwnTenementList() const { code, message, data } = await getOwnTenementList()
@ -332,7 +316,6 @@ Page({
alertInfo("请先登录") alertInfo("请先登录")
return return
} }
// alertInfo("尚未完成")
wx.navigateTo({ wx.navigateTo({
url: '/pages/billList/index', url: '/pages/billList/index',
}) })
@ -380,38 +363,4 @@ Page({
} }
}) })
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -94,8 +94,6 @@
<view class="others"> <view class="others">
<van-grid direction="horizontal" column-num="2"> <van-grid direction="horizontal" column-num="2">
<van-grid-item icon="balance-list-o" text="电费账单" bind:click="jumpToOrder"> <van-grid-item icon="balance-list-o" text="电费账单" bind:click="jumpToOrder">
<!-- <view slot="icon"> 111 </view> -->
<!-- <van-icon slot="icom" name="balance-list-o" /> -->
</van-grid-item> </van-grid-item>
<van-grid-item icon="after-sale" text="缴费记录" bind:click="jumpToRecord" /> <van-grid-item icon="after-sale" text="缴费记录" bind:click="jumpToRecord" />
<van-grid-item icon="bar-chart-o" text="用电查询" bind:click="jumpToElectric" /> <van-grid-item icon="bar-chart-o" text="用电查询" bind:click="jumpToElectric" />

View File

@ -1,8 +1,8 @@
// pages/invoiceInfo/index.js
import { getInvoiceInfoDetail, downloadInvoice } from "../../service/invoice"; import { getInvoiceInfoDetail, downloadInvoice } from "../../service/invoice";
import { alertError, alertInfo, loadingFunc } from "../../utils/index"; import { alertError, alertInfo, loadingFunc } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
const { OK } = request; const { OK } = request;
// pages/invoiceInfo/index.js
Page({ Page({
/** /**
@ -74,69 +74,7 @@ Page({
} }
}) })
}) })
// console.log('data', data)
// const filePath = `${wx.env.USER_DATA_PATH}/发票/${that.data.id}.${res.tapIndex === 0 ? 'xml' : "pdf"}`;
// FileSystemManager.writeFile({
// filePath: filePath,
// data: res.data,
// encoding: 'base64', // 2. base64解密写入, 后台返回的byte[]数组是经过base64编码的其他方式写入文件打开格式不对
// success: function(res) {
// },
// fail: function (e) {
// console.log(e.errMsg);
// }
// });
} }
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,6 +1,6 @@
// pages/invoiceDetailContent/index.js
import { getInvoiceInfoDetail } from "../../service/invoice"; import { getInvoiceInfoDetail } from "../../service/invoice";
// pages/invoiceDetailContent/index.js
Page({ Page({
/** /**
@ -35,52 +35,4 @@ Page({
url: '/pages/invoiceDetail/index?id=' + this.data.id, url: '/pages/invoiceDetail/index?id=' + this.data.id,
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,8 +1,8 @@
// pages/invoiceList/components/already/index.js
import { getAlreadyInvoiceList } from "../../../../service/invoice" import { getAlreadyInvoiceList } from "../../../../service/invoice"
import { alertInfo, loadingFunc } from "../../../../utils/index"; import { alertInfo, loadingFunc } from "../../../../utils/index";
import request from '../../../../utils/request' import request from '../../../../utils/request'
const { OK } = request; const { OK } = request;
// pages/invoiceList/components/already/index.js
Component({ Component({
/** /**

View File

@ -1,10 +1,10 @@
// pages/invoiceList/components/info/index.js
import { getInvoiceInfo, updateInvoiceInfo } from "../../../../service/invoice" import { getInvoiceInfo, updateInvoiceInfo } from "../../../../service/invoice"
import { getUserInfo } from "../../../../service/user"; import { getUserInfo } from "../../../../service/user";
import { alertInfo, alertSuccess, isValidPhoneNumber } from "../../../../utils/index"; import { alertInfo, alertSuccess, isValidPhoneNumber } from "../../../../utils/index";
import request from '../../../../utils/request' import request from '../../../../utils/request'
const { OK } = request const { OK } = request
// pages/invoiceList/components/info/index.js
Component({ Component({
/** /**
@ -89,10 +89,6 @@ Component({
alertInfo("请输入发票税号") alertInfo("请输入发票税号")
return; return;
} }
// if (!address) {
// alertInfo("请输入地址")
// return;
// }
if (phone && !isValidPhoneNumber(phone)) { if (phone && !isValidPhoneNumber(phone)) {
alertInfo("手机号格式不正确") alertInfo("手机号格式不正确")
return return

View File

@ -17,7 +17,6 @@
label="发票类型" label="发票类型"
readonly="{{true}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
@ -28,7 +27,6 @@
label="发票类型" label="发票类型"
readonly="{{true}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
@ -39,7 +37,6 @@
label="发票类型" label="发票类型"
readonly="{{true}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
@ -50,7 +47,6 @@
label="抬头类型" label="抬头类型"
readonly="{{true}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
@ -70,7 +66,6 @@
label="抬头类型" label="抬头类型"
readonly="{{true}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
@ -81,7 +76,6 @@
label="抬头类型" label="抬头类型"
readonly="{{true}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
@ -95,7 +89,6 @@
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
> >
@ -107,7 +100,6 @@
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
autosize="{{true}}" autosize="{{true}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
> >
@ -119,7 +111,6 @@
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
autosize="{{true}}" autosize="{{true}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
> >
@ -132,7 +123,6 @@
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
autosize="{{true}}" autosize="{{true}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
@ -146,7 +136,6 @@
custom-style="padding-left: 0; padding-right: 0; height: auto;" custom-style="padding-left: 0; padding-right: 0; height: auto;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
autosize="{{true}}" autosize="{{true}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
@ -161,16 +150,12 @@
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
autosize="{{true}}" autosize="{{true}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
data-name="remark" data-name="remark"
value="{{detail.remark || '-'}}" value="{{detail.remark || '-'}}"
> >
<!-- <view slot="input" style="margin-top: -10rpx;">
<view> {{detail.remark || '-'}} </view>
</view> -->
</van-field> </van-field>
</view> </view>
<view wx:else> <view wx:else>
@ -303,7 +288,6 @@
data-name="phone" data-name="phone"
value="{{detail.phone || '-'}}" value="{{detail.phone || '-'}}"
> >
</van-field> </van-field>
</view> </view>
<view wx:else> <view wx:else>

View File

@ -46,15 +46,12 @@ Component({
}, },
onChange(e) { onChange(e) {
const { id, index } = e.currentTarget.dataset; const { id, index } = e.currentTarget.dataset;
// let newList = this.data.chooseList;
const { list } = this.data; const { list } = this.data;
const newSelectList = this.data.selectList; const newSelectList = this.data.selectList;
if (e.detail) { if (e.detail) {
newSelectList[index] = true; newSelectList[index] = true;
// newList = [...new Set([...newList, id])]
} else { } else {
newSelectList[index] = false; newSelectList[index] = false;
// newList = newList.filter(item => item !== id);
} }
let selectCount = 0; let selectCount = 0;
let selectMoney = 0; let selectMoney = 0;
@ -66,7 +63,6 @@ Component({
} }
} }
this.setData({ this.setData({
// chooseList: newList,
selectList: newSelectList, selectList: newSelectList,
allChecked: selectCount === list.length, allChecked: selectCount === list.length,
selectCount, selectCount,

View File

@ -1,8 +1,8 @@
import { deleteInvoiceInfo, getInvoiceInfoList } from "../../service/invoice"; // pages/invoiceList/index.js
import { deleteInvoiceInfo } from "../../service/invoice";
import { alertInfo, alertSuccess, wxModal } from "../../utils/index"; import { alertInfo, alertSuccess, wxModal } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
const { OK } = request const { OK } = request
// pages/invoiceList/index.js
Page({ Page({
/** /**
@ -32,24 +32,6 @@ Page({
active: Number(tab) active: Number(tab)
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.init();
},
async init() {
// const { data, code, message } = await getInvoiceInfoList()
// this.setData({ list: data })
},
operate(e) { operate(e) {
const { data } = e.currentTarget.dataset; const { data } = e.currentTarget.dataset;
this.setData({ this.setData({
@ -94,38 +76,4 @@ Page({
url: '/pages/editInvoice/index?id=-1', url: '/pages/editInvoice/index?id=-1',
}) })
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,9 +1,9 @@
// pages/invoicing/index.js
import { getInvoiceInfo, makeInvoice } from "../../service/invoice" import { getInvoiceInfo, makeInvoice } from "../../service/invoice"
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index"; import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
const { OK } = request const { OK } = request
// pages/invoicing/index.js
Page({ Page({
/** /**
@ -77,18 +77,6 @@ Page({
}, },
changeRemark(e) { changeRemark(e) {
this.setData({ remark: e.detail }) this.setData({ remark: e.detail })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
}, },
async onSubmit() { async onSubmit() {
loadingFunc(async() => { loadingFunc(async() => {
@ -111,38 +99,4 @@ Page({
changeShow() { changeShow() {
this.setData({ show: true }) this.setData({ show: true })
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,3 +1,4 @@
// pages/login/index.js
import { getPrivaciList, login } from "../../service/user"; import { getPrivaciList, login } from "../../service/user";
import { alertError, alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index"; import { alertError, alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
import request from "../../utils/request"; import request from "../../utils/request";
@ -5,7 +6,6 @@ import { getUserInfo } from "../../service/user"
import Dialog from '@vant/weapp/dialog/dialog'; import Dialog from '@vant/weapp/dialog/dialog';
const { OK } = request; const { OK } = request;
// pages/login/index.js
Page({ Page({
/** /**
@ -29,21 +29,9 @@ Page({
this.setData({ user: result.data }) this.setData({ user: result.data })
wx.setStorageSync('user', result.data) wx.setStorageSync('user', result.data)
// const user = wx.getStorageSync('user')
// this.setData({ user: user })
}, },
onLoad() { onLoad() {
this.getPrivacy(); this.getPrivacy();
// this.setUser();
// if (user.status === 0 || user.status === 2) {
// wx.redirectTo({
// url: '/pages/waitApprove/index',
// })
// return
// }
// wx.switchTab({
// url: '/pages/home/index',
// })
}, },
async getPrivacy() { async getPrivacy() {
const { code, message, data } = await getPrivaciList() const { code, message, data } = await getPrivaciList()
@ -53,18 +41,6 @@ Page({
} }
this.setData({ privacyList: data }) this.setData({ privacyList: data })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onClose() {
// wx.exitMiniProgram()
},
onConfirm() {
// this.handleLogin()
},
async handleLogin(phoneCode) { async handleLogin(phoneCode) {
loadingFunc(async () => { loadingFunc(async () => {
const wxLoginCode = await wxLogin() const wxLoginCode = await wxLogin()
@ -134,51 +110,4 @@ Page({
url: '/childPackage/pages/agreements/index?url=' + url, url: '/childPackage/pages/agreements/index?url=' + url,
}) })
}, },
jumpToLoginAgreement() {
},
jumpToSecret() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -5,14 +5,6 @@ import request from "../../../../utils/request"
const { OK } = request; const { OK } = request;
Component({ Component({
/**
* 组件的属性列表
*/
properties: {
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
@ -21,9 +13,6 @@ Component({
}, },
lifetimes: { lifetimes: {
attached: function() { attached: function() {
// this.setData({
// list: []
// })
this.init(); this.init();
} }
}, },

View File

@ -3,8 +3,6 @@
.item { .item {
display: flex; display: flex;
align-items: center; align-items: center;
/* padding-top: 24rpx; */
/* padding-bottom: 24rpx; */
padding: 24rpx; padding: 24rpx;
margin-left: 32rpx; margin-left: 32rpx;
margin-right: 32rpx; margin-right: 32rpx;
@ -19,7 +17,6 @@
} }
.operate { .operate {
/* display: flex; */
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -7,64 +7,9 @@ Page({
data: { data: {
active: 0 active: 0
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onChangeTab(e) { onChangeTab(e) {
this.setData({ this.setData({
active: e.detail.index active: e.detail.index
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,3 +1,4 @@
// pages/my/index.js
import { alertInfo, alertSuccess } from "../../utils/index"; import { alertInfo, alertSuccess } from "../../utils/index";
import Dialog from '@vant/weapp/dialog/dialog'; import Dialog from '@vant/weapp/dialog/dialog';
import { getUserInfo, logout } from "../../service/user"; import { getUserInfo, logout } from "../../service/user";
@ -5,7 +6,6 @@ import { getDot } from "../../utils/system";
import request from "../../utils/request" import request from "../../utils/request"
const { OK } = request; const { OK } = request;
// pages/my/index.js
Page({ Page({
/** /**
@ -116,38 +116,4 @@ Page({
}); });
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,9 +1,5 @@
<!--pages/my/index.wxml--> <!--pages/my/index.wxml-->
<!-- <cell open-type="contact" title="联系客服" borderBottom="{{true}}" />
<cell title="常见问题" bind:click="jumpToQuestions" /> -->
<!-- <van-cell-group title=" "> -->
<navigator title="我的" /> <navigator title="我的" />
<van-cell title="联系客服" value="" is-link bind:tap="connect" /> <van-cell title="联系客服" value="" is-link bind:tap="connect" />
<van-cell wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" /> <van-cell wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
@ -19,9 +15,5 @@
<van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" /> <van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" />
<van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" /> <van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" />
<van-cell title="退出登录" value="" is-link bind:tap="logout" /> <van-cell title="退出登录" value="" is-link bind:tap="logout" />
<!-- </van-cell-group> -->
<!-- <van-cell-group title=" ">
<van-cell title="单元格" value="内容" is-link />
</van-cell-group> -->
<van-dialog id="van-dialog" /> <van-dialog id="van-dialog" />

View File

@ -11,9 +11,6 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
// list: [],
// urls: [],
// indexs: [],
url: "", url: "",
tenement: "" tenement: ""
}, },
@ -22,7 +19,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// this.getList()
loadingFunc(async () => { loadingFunc(async () => {
await this.getCode() await this.getCode()
}) })
@ -43,7 +39,6 @@ Page({
}) })
}, },
async getCode() { async getCode() {
// const { index, id } = e.currentTarget.dataset;
const tenement = wx.getStorageSync('tenement'); const tenement = wx.getStorageSync('tenement');
const { code, message, data } = await getWxCode(tenement.id) const { code, message, data } = await getWxCode(tenement.id)
if (code !== OK) { if (code !== OK) {
@ -54,14 +49,6 @@ Page({
url: data, url: data,
tenement: tenement tenement: tenement
}) })
// const newUrls = that.data.urls;
// newUrls[index] = data;
// const newIndexs = that.data.indexs;
// newIndexs[index] = true;
// that.setData({
// urls: newUrls,
// indexs: newIndexs,
// })
}, },
look(e) { look(e) {
const that = this; const that = this;
@ -69,52 +56,4 @@ Page({
await this.getCode(e, that) await this.getCode(e, that)
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,8 +1,8 @@
// pages/questions/index.js
import { getQuestionList } from "../../service/user"; import { getQuestionList } from "../../service/user";
import { alertInfo } from "../../utils/index"; import { alertInfo } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
const { OK } = request const { OK } = request
// pages/questions/index.js
Page({ Page({
/** /**
@ -36,52 +36,8 @@ Page({
page: next ? page + 1 : page page: next ? page + 1 : page
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { onReachBottom() {
this.getList(); this.getList();
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,32 +1,7 @@
<!--pages/recharge/index.wxml--> <!--pages/recharge/index.wxml-->
<view class="wrapper"> <view class="wrapper">
<!-- <van-grid column-num="2" center="{{false}}">
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 充值表号: </view>
<view class="gridContent"> {{ detail.meter.code }} </view>
</view>
</van-grid-item>
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 表计地址: </view>
<view class="gridContent"> {{ detail.meter.address }} </view>
</view>
</van-grid-item>
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 剩余金额: </view>
<view class="gridContent"> {{ detail.money }} </view>
</view>
</van-grid-item>
<van-grid-item icon="photo-o" text="文字" use-slot>
<view>
<view class="gridTitle"> 公司名称: </view>
<view class="gridContent"> {{ detail.tenement.name }} </view>
</view>
</van-grid-item>
</van-grid> -->
<van-row gutter="10"> <van-row gutter="10">
<van-col span="12"> <van-col span="12">
<view class="title">充值表号:</view> <view class="title">充值表号:</view>

View File

@ -1,9 +1,9 @@
// pages/rechargeDetail/index.js
import { getRechargeDetail } from "../../service/recharge"; import { getRechargeDetail } from "../../service/recharge";
import { alertError, alertInfo, loadingFunc } from "../../utils/index"; import { alertError, alertInfo, loadingFunc } from "../../utils/index";
import { getRechargeOperateType, getRechargeOperateWay } from "../../utils/data"; import { getRechargeOperateType, getRechargeOperateWay } from "../../utils/data";
import request from "../../utils/request" import request from "../../utils/request"
const { OK } = request const { OK } = request
// pages/rechargeDetail/index.js
Page({ Page({
/** /**
@ -72,54 +72,6 @@ Page({
}) })
}, },
back() { back() {
// wx.navigateBack({ delta: 1 });
wx.navigateBack(); wx.navigateBack();
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,9 +1,9 @@
// pages/rechargeRecord/index.js
import { getRechargeList } from "../../service/recharge"; import { getRechargeList } from "../../service/recharge";
import { getTenementMeterList } from "../../service/meter"; import { getTenementMeterList } from "../../service/meter";
import { getYears, alertInfo, loadingFunc } from "../../utils/index"; import { getYears, alertInfo, loadingFunc } from "../../utils/index";
import request from "../../utils/request"; import request from "../../utils/request";
const { OK } = request; const { OK } = request;
// pages/rechargeRecord/index.js
Page({ Page({
/** /**
@ -50,19 +50,6 @@ Page({
this.onChangeMeter(value) this.onChangeMeter(value)
return; return;
} }
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
}, },
onChangeYear(e) { onChangeYear(e) {
const { codeId } = this.data; const { codeId } = this.data;
@ -78,9 +65,7 @@ Page({
onChangeMeter(e) { onChangeMeter(e) {
const { id, code } = e; const { id, code } = e;
const { year } = this.data; const { year } = this.data;
// const currentYear = years[Number(e)]
this.setData({ this.setData({
// year: currentYear,
codeId: id, codeId: id,
meterCode: code, meterCode: code,
type: "", type: "",
@ -144,38 +129,4 @@ Page({
back() { back() {
wx.navigateBack({delta: 1 }) wx.navigateBack({delta: 1 })
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -23,7 +23,6 @@
} }
.recordsItem { .recordsItem {
display: flex; display: flex;
/* justify-content: space-between; */
padding: 16rpx 20rpx; padding: 16rpx 20rpx;
border-left: 0; border-left: 0;
border-right: 0; border-right: 0;
@ -73,8 +72,6 @@
text-align: right; text-align: right;
color: #fff; color: #fff;
font-size: 32rpx; font-size: 32rpx;
/* display: flex; */
/* justify-content: end; */
} }
.type { .type {
@ -93,7 +90,3 @@
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
page {
/* background-color: var(--light-green); */
}