From cbe7db0ac11e2791dca19b7f88d79b46f3e5bf95 Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Fri, 26 Apr 2024 09:20:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E7=A5=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=81=94=E8=B0=83=E9=94=99=E8=AF=AF=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=85=85=E5=80=BC=E8=AE=B0=E5=BD=95=E6=8C=89=E8=A1=A8?= =?UTF-8?q?=E8=AE=A1=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=88=91=E7=9A=84=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=91=E7=A5=A8=E6=8A=AC=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 6 +- components/empty/index.js | 9 ++- components/empty/index.wxml | 4 +- components/empty/index.wxss | 6 +- pages/invoiceList/components/already/index.js | 7 +- .../invoiceList/components/already/index.json | 3 +- .../invoiceList/components/already/index.wxml | 7 +- pages/invoiceList/components/info/index.wxml | 20 +++--- pages/invoiceList/components/notyet/index.js | 5 +- .../invoiceList/components/notyet/index.json | 3 +- .../invoiceList/components/notyet/index.wxml | 8 ++- pages/invoiceList/index.js | 2 +- pages/my/index.js | 5 ++ pages/my/index.wxml | 1 + pages/rechargeRecord/index.js | 57 ++++++++-------- pages/rechargeRecord/index.json | 3 +- pages/rechargeRecord/index.wxml | 10 +-- pages/updateInvoice/index.js | 66 +++++++++++++++++++ pages/updateInvoice/index.json | 7 ++ pages/updateInvoice/index.wxml | 3 + pages/updateInvoice/index.wxss | 1 + service/recharge.js | 5 +- 22 files changed, 176 insertions(+), 62 deletions(-) create mode 100644 pages/updateInvoice/index.js create mode 100644 pages/updateInvoice/index.json create mode 100644 pages/updateInvoice/index.wxml create mode 100644 pages/updateInvoice/index.wxss diff --git a/app.json b/app.json index e4e0ea5..fa876b1 100644 --- a/app.json +++ b/app.json @@ -1,11 +1,11 @@ { "pages": [ "pages/home/index", + "pages/rechargeRecord/index", "pages/invoiceList/index", "pages/invoiceDetail/index", "pages/invoiceDetailContent/index", "pages/invoicing/index", - "pages/rechargeRecord/index", "pages/member/index", "pages/login/index", "pages/handleLogin/index", @@ -18,8 +18,8 @@ "pages/questions/index", "pages/editInvoice/index", "pages/rechargeDetail/index", - "pages/agreements/index" - + "pages/agreements/index", + "pages/updateInvoice/index" ], "tabBar": { "list": [ diff --git a/components/empty/index.js b/components/empty/index.js index 7f80210..ca026c8 100644 --- a/components/empty/index.js +++ b/components/empty/index.js @@ -5,7 +5,10 @@ Component({ * 组件的属性列表 */ properties: { - + text: { + type: String, + value: '暂无数据' + }, }, /** @@ -19,6 +22,8 @@ Component({ * 组件的方法列表 */ methods: { - + refresh() { + this.triggerEvent("refresh") + } } }) \ No newline at end of file diff --git a/components/empty/index.wxml b/components/empty/index.wxml index 147019f..2545452 100644 --- a/components/empty/index.wxml +++ b/components/empty/index.wxml @@ -1,4 +1,4 @@ - - 按钮 + + 刷 新 \ No newline at end of file diff --git a/components/empty/index.wxss b/components/empty/index.wxss index 615e47f..1c9a2f2 100644 --- a/components/empty/index.wxss +++ b/components/empty/index.wxss @@ -1 +1,5 @@ -/* components/empty/index.wxss */ \ No newline at end of file +/* components/empty/index.wxss */ +.bottom-button { + width: 320rpx; + height: 80rpx; +} \ No newline at end of file diff --git a/pages/invoiceList/components/already/index.js b/pages/invoiceList/components/already/index.js index 26e00ee..f2fee00 100644 --- a/pages/invoiceList/components/already/index.js +++ b/pages/invoiceList/components/already/index.js @@ -1,5 +1,5 @@ import { getAlreadyInvoiceList } from "../../../../service/invoice" -import { alertInfo } from "../../../../utils/index"; +import { alertInfo, loadingFunc } from "../../../../utils/index"; import request from '../../../../utils/request' const { OK } = request; // pages/invoiceList/components/already/index.js @@ -43,8 +43,11 @@ Component({ page: page + 1, }) }, + onRefresh() { + loadingFunc(() => this.getList()) + }, scrollToLower() { - this.getList(); + loadingFunc(() => this.getList()) }, jumpToDetail() { wx.navigateTo({ diff --git a/pages/invoiceList/components/already/index.json b/pages/invoiceList/components/already/index.json index 3b51cdc..25a7954 100644 --- a/pages/invoiceList/components/already/index.json +++ b/pages/invoiceList/components/already/index.json @@ -1,6 +1,7 @@ { "component": true, "usingComponents": { - "van-button": "@vant/weapp/button/index" + "van-button": "@vant/weapp/button/index", + "empty": "/components/empty/index" } } \ No newline at end of file diff --git a/pages/invoiceList/components/already/index.wxml b/pages/invoiceList/components/already/index.wxml index 69dabbf..61cbab7 100644 --- a/pages/invoiceList/components/already/index.wxml +++ b/pages/invoiceList/components/already/index.wxml @@ -1,7 +1,7 @@ - + @@ -28,4 +28,7 @@ - \ No newline at end of file + + + + \ No newline at end of file diff --git a/pages/invoiceList/components/info/index.wxml b/pages/invoiceList/components/info/index.wxml index 60b64c8..1401c5e 100644 --- a/pages/invoiceList/components/info/index.wxml +++ b/pages/invoiceList/components/info/index.wxml @@ -29,8 +29,8 @@ - 普通电子发票 - 增值税专用电子发票 + 普通电子发票 + 增值税专用电子发票 - @@ -44,7 +44,7 @@ border="{{ editType === 'detail' ? false : true }}" > - + 企业单位 个人/非企业单位 @@ -54,8 +54,8 @@ slot="input" style="margin-top: -10rpx;" > - 企业单位 - 个人/非企业单位 + 企业单位 + 个人/非企业单位 - @@ -83,7 +83,7 @@ false) }) }, + onRefresh() { + loadingFunc(() => this.init()) + }, onChange(e) { const { id, index } = e.currentTarget.dataset; // let newList = this.data.chooseList; diff --git a/pages/invoiceList/components/notyet/index.json b/pages/invoiceList/components/notyet/index.json index 7360772..9cc5c01 100644 --- a/pages/invoiceList/components/notyet/index.json +++ b/pages/invoiceList/components/notyet/index.json @@ -2,6 +2,7 @@ "component": true, "usingComponents": { "van-checkbox": "@vant/weapp/checkbox/index", - "van-button": "@vant/weapp/button/index" + "van-button": "@vant/weapp/button/index", + "empty": "/components/empty/index" } } \ No newline at end of file diff --git a/pages/invoiceList/components/notyet/index.wxml b/pages/invoiceList/components/notyet/index.wxml index 46d0617..d789638 100644 --- a/pages/invoiceList/components/notyet/index.wxml +++ b/pages/invoiceList/components/notyet/index.wxml @@ -1,5 +1,6 @@ + - + @@ -29,5 +30,8 @@ ¥ {{selectMoney}} 下一步 + - + + + diff --git a/pages/invoiceList/index.js b/pages/invoiceList/index.js index c758a79..bf8acd3 100644 --- a/pages/invoiceList/index.js +++ b/pages/invoiceList/index.js @@ -17,7 +17,7 @@ Page({ { name: '删除', }, ], selectData: {}, - active: 1, + active: 0, }, /** diff --git a/pages/my/index.js b/pages/my/index.js index fe3641b..02558f5 100644 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -67,6 +67,11 @@ Page({ this.setData({ user: result.data }) wx.setStorageSync('user', result.data) }, + jumpToUpdateInvoice() { + wx.navigateTo({ + url: '/pages/updateInvoice/index', + }) + }, async getUnReadNumber() { const dot = await getDot(); this.setData({ diff --git a/pages/my/index.wxml b/pages/my/index.wxml index ffa3b95..974a775 100644 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -15,6 +15,7 @@ + diff --git a/pages/rechargeRecord/index.js b/pages/rechargeRecord/index.js index 6503943..94f7941 100644 --- a/pages/rechargeRecord/index.js +++ b/pages/rechargeRecord/index.js @@ -1,5 +1,5 @@ import { getRechargeList } from "../../service/recharge"; -import { getOwnTenementList } from "../../service/tenement"; +import { getTenementMeterList } from "../../service/meter"; import { getYears, alertInfo } from "../../utils/index"; import request from "../../utils/request"; const { OK } = request; @@ -16,13 +16,13 @@ Page({ list: [ ], - tenement: "", - tenementName: "", show: false, columns: [], type: "", title: "", amount: 0, + codeId: "", + meterCode: "" }, clickYear() { this.setData({ @@ -32,12 +32,12 @@ Page({ title: "年份" }) }, - clickTenement() { + clickMeter() { this.setData({ - type: "tenement", - columns: this.data.tenements, + type: "meter", + columns: this.data.meterList.map(item => ({ id: item.id, name: `${item.code}-${item.address}`, code: item.code })), show: true, - title: "商户" + title: "表计" }) }, onOk(e) { @@ -46,8 +46,8 @@ Page({ this.onChangeYear(value.id) return; } - if (type === "tenement") { - this.onChangeTenement(value) + if (type === "meter") { + this.onChangeMeter(value) return; } }, @@ -75,14 +75,15 @@ Page({ }) this.init(currentYear, tenement) }, - onChangeTenement(e) { - const { id, name } = e; + onChangeMeter(e) { + const { id, code } = e; + console.log('e', e) const { year } = this.data; // const currentYear = years[Number(e)] this.setData({ // year: currentYear, - tenement: id, - tenementName: name, + codeId: id, + meterCode: code, type: "", show: false, title: "" @@ -93,26 +94,28 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - const { year, tenement } = this.data; - this.init(year, tenement); - this.getTenementsList(); + const { year } = this.data; + const tenement = wx.getStorageSync('tenement') + this.init(year, ''); + this.getMeters(tenement?.id); }, - async getTenementsList() { - const { code, message, data } = await getOwnTenementList() + refreshEmpty() { + const tenement = wx.getStorageSync('tenement') + this.init(year, ''); + this.init(year, tenement); + }, + async getMeters(id) { + const { code, message, data } = await getTenementMeterList(id); if (code !== OK) { alertInfo(message) - return + return; } - let tenements = [{id: "", name: "全部"}]; - data.forEach(item => { - if (item.tenements) { - tenements = [...tenements, ...item.tenements] - } + this.setData({ + meterList: data || [], }) - this.setData({ tenements }) }, - async init(year, tenement) { - const { code, message, data = [], amount = 0 } = await getRechargeList(year, tenement); + async init(year, codeId) { + const { code, message, data = [], amount = 0 } = await getRechargeList(year, codeId); if (code !== OK) { alertInfo(message) return; diff --git a/pages/rechargeRecord/index.json b/pages/rechargeRecord/index.json index 8a9e30b..06d330b 100644 --- a/pages/rechargeRecord/index.json +++ b/pages/rechargeRecord/index.json @@ -4,7 +4,8 @@ "scrollPageWrapper": "/components/scrollPageWrapper/index", "van-icon": "@vant/weapp/icon/index", "custom-status-bar": "/components/customStatusBar/index", - "custom-picker": "/components/picker/index" + "custom-picker": "/components/picker/index", + "empty": "/components/empty/index" }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/rechargeRecord/index.wxml b/pages/rechargeRecord/index.wxml index 5a78342..ebe75b5 100644 --- a/pages/rechargeRecord/index.wxml +++ b/pages/rechargeRecord/index.wxml @@ -8,8 +8,8 @@ - - {{ tenementName }} + + {{ meterCode }} 全部 @@ -18,7 +18,7 @@ 合计: {{amount}}元 - + 充值 @@ -31,5 +31,7 @@ - + + + \ No newline at end of file diff --git a/pages/updateInvoice/index.js b/pages/updateInvoice/index.js new file mode 100644 index 0000000..4844a55 --- /dev/null +++ b/pages/updateInvoice/index.js @@ -0,0 +1,66 @@ +// pages/updateInvoice/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/updateInvoice/index.json b/pages/updateInvoice/index.json new file mode 100644 index 0000000..cb01258 --- /dev/null +++ b/pages/updateInvoice/index.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "navigator": "/components/navigator/index", + "info": "/pages/invoiceList/components/info/index" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/updateInvoice/index.wxml b/pages/updateInvoice/index.wxml new file mode 100644 index 0000000..e3a5b6d --- /dev/null +++ b/pages/updateInvoice/index.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pages/updateInvoice/index.wxss b/pages/updateInvoice/index.wxss new file mode 100644 index 0000000..cc76a4f --- /dev/null +++ b/pages/updateInvoice/index.wxss @@ -0,0 +1 @@ +/* pages/updateInvoice/index.wxss */ \ No newline at end of file diff --git a/service/recharge.js b/service/recharge.js index 070f8e6..014cd8a 100644 --- a/service/recharge.js +++ b/service/recharge.js @@ -2,8 +2,9 @@ import apis from '../utils/request'; const { GET, POST, PUT, DELETE } = apis // 获取充值记录 -export const getRechargeList = async function(year, tenement) { - return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}`); +export const getRechargeList = async function(year, codeId) { + const tenement = wx.getStorageSync('tenement')?.id + return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}&codeId=${codeId}`); } // 预备充值请求