From b9d1ee34a772be9bb80c051eeb5e03a9ceec6f00 Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Fri, 8 Nov 2024 18:24:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E5=81=9A=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=EF=BC=8C=E8=B0=83=E6=95=B4=E7=94=A8=E7=94=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 +- .../components/listTable/index.js | 53 +++++++++++++++ .../components/listTable/index.json | 8 +++ .../components/listTable/index.wxml | 11 +++ .../components/listTable/index.wxss | 1 + childPackage/pages/electricQuery/index.js | 47 ++++++++++--- childPackage/pages/electricQuery/index.json | 3 +- childPackage/pages/electricQuery/index.wxml | 8 ++- components/searchSelect/index.js | 24 +++++++ components/searchSelect/index.json | 8 +++ components/searchSelect/index.wxml | 14 ++++ components/searchSelect/index.wxss | 1 + pages/home/index.js | 1 + pages/my/index.js | 14 ++++ pages/my/index.wxml | 1 + pages/workBench/components/approve/index.js | 24 +++++++ pages/workBench/components/approve/index.json | 4 ++ pages/workBench/components/approve/index.wxml | 2 + pages/workBench/components/approve/index.wxss | 1 + pages/workBench/components/recharge/index.js | 24 +++++++ .../workBench/components/recharge/index.json | 6 ++ .../workBench/components/recharge/index.wxml | 3 + .../workBench/components/recharge/index.wxss | 1 + pages/workBench/components/record/index.js | 24 +++++++ pages/workBench/components/record/index.json | 4 ++ pages/workBench/components/record/index.wxml | 2 + pages/workBench/components/record/index.wxss | 1 + pages/workBench/index.js | 68 +++++++++++++++++++ pages/workBench/index.json | 11 +++ pages/workBench/index.wxml | 13 ++++ pages/workBench/index.wxss | 1 + project.private.config.json | 14 ++++ 32 files changed, 384 insertions(+), 16 deletions(-) create mode 100644 childPackage/pages/electricQuery/components/listTable/index.js create mode 100644 childPackage/pages/electricQuery/components/listTable/index.json create mode 100644 childPackage/pages/electricQuery/components/listTable/index.wxml create mode 100644 childPackage/pages/electricQuery/components/listTable/index.wxss create mode 100644 components/searchSelect/index.js create mode 100644 components/searchSelect/index.json create mode 100644 components/searchSelect/index.wxml create mode 100644 components/searchSelect/index.wxss create mode 100644 pages/workBench/components/approve/index.js create mode 100644 pages/workBench/components/approve/index.json create mode 100644 pages/workBench/components/approve/index.wxml create mode 100644 pages/workBench/components/approve/index.wxss create mode 100644 pages/workBench/components/recharge/index.js create mode 100644 pages/workBench/components/recharge/index.json create mode 100644 pages/workBench/components/recharge/index.wxml create mode 100644 pages/workBench/components/recharge/index.wxss create mode 100644 pages/workBench/components/record/index.js create mode 100644 pages/workBench/components/record/index.json create mode 100644 pages/workBench/components/record/index.wxml create mode 100644 pages/workBench/components/record/index.wxss create mode 100644 pages/workBench/index.js create mode 100644 pages/workBench/index.json create mode 100644 pages/workBench/index.wxml create mode 100644 pages/workBench/index.wxss diff --git a/app.json b/app.json index 9789880..a03d56c 100644 --- a/app.json +++ b/app.json @@ -21,7 +21,8 @@ "pages/publicTransfer/index", "pages/special/index", "pages/encyclopedia/index", - "pages/encyclopediaDetail/index" + "pages/encyclopediaDetail/index", + "pages/workBench/index" ], "subPackages": [ { diff --git a/childPackage/pages/electricQuery/components/listTable/index.js b/childPackage/pages/electricQuery/components/listTable/index.js new file mode 100644 index 0000000..e0d4311 --- /dev/null +++ b/childPackage/pages/electricQuery/components/listTable/index.js @@ -0,0 +1,53 @@ +// childPackage/pages/electricQuery/components/listTable/index.js +Component({ + + /** + * 组件的属性列表 + */ + properties: { + list: { + type: Array, + watch(newVal) { + console.log("newVal ------", newVal) + } + }, + header: Array, + totalPage: Number, + }, + observers: { + 'list': function(val) { + this.setData({ + tempList: (this.data.list || [])?.slice(0, 20), + page: 1, + }) + } + }, + /** + * 组件的初始数据 + */ + data: { + page: 1, + tempList: [], + }, + lifetimes: { + attached() { + console.log('this.data', this.data.list) + this.setData({ + tempList: (this.data.list || [])?.slice(0, 20), + }) + } + }, + /** + * 组件的方法列表 + */ + methods: { + async onChangePage(e) { + const page = e.detail.currentIndex; + const that = this; + this.setData({ + page, + tempList: (this.data.list || [])?.slice((page - 1) * 20, page * 20) + }) + }, + } +}) \ No newline at end of file diff --git a/childPackage/pages/electricQuery/components/listTable/index.json b/childPackage/pages/electricQuery/components/listTable/index.json new file mode 100644 index 0000000..c4bbba3 --- /dev/null +++ b/childPackage/pages/electricQuery/components/listTable/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "table": "/components/table/table", + "empty": "/components/empty/index", + "pagination": "/components/pagination/index" + } +} \ No newline at end of file diff --git a/childPackage/pages/electricQuery/components/listTable/index.wxml b/childPackage/pages/electricQuery/components/listTable/index.wxml new file mode 100644 index 0000000..0a151a9 --- /dev/null +++ b/childPackage/pages/electricQuery/components/listTable/index.wxml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/childPackage/pages/electricQuery/components/listTable/index.wxss b/childPackage/pages/electricQuery/components/listTable/index.wxss new file mode 100644 index 0000000..35bb0b3 --- /dev/null +++ b/childPackage/pages/electricQuery/components/listTable/index.wxss @@ -0,0 +1 @@ +/* childPackage/pages/electricQuery/components/listTable/index.wxss */ \ No newline at end of file diff --git a/childPackage/pages/electricQuery/index.js b/childPackage/pages/electricQuery/index.js index 71cbb18..a12a3fa 100644 --- a/childPackage/pages/electricQuery/index.js +++ b/childPackage/pages/electricQuery/index.js @@ -48,13 +48,20 @@ Page({ this.setData({ queryType: type },() => { switch(type) { case 0: - this.init() + loadingFunc(async () => { + await this.init() + }) break; case 1: - this.getReadingList(); + loadingFunc(async () => { + await this.getReadingList(); + }) break; case 2: - this.getAccountingBalanceList(); + loadingFunc(async () => { + await this.getAccountingBalanceList(); + }) + break; } @@ -69,8 +76,11 @@ Page({ }, changeTimeType(e) { const { type } = e.currentTarget.dataset + const that = this; this.setData({ timeType: type }, () => { - this.init() + loadingFunc(async () => { + await that.init() + }) }) }, @@ -78,7 +88,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - this.init() + loadingFunc(async () => { + await this.init() + }) }, async init() { const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page } = this.data; @@ -251,13 +263,20 @@ Page({ const { queryType, } = this.data; switch(queryType) { case 1: - this.getReadingList(); + loadingFunc(async () => { + await this.getReadingList(); + }) break; case 2: - this.getAccountingBalanceList(); + loadingFunc(async () => { + await this.getAccountingBalanceList(); + }) break; default: - this.init(); + loadingFunc(async () => { + await this.init(); + }) + break; } }) @@ -273,13 +292,17 @@ Page({ switch(type) { case "year": this.setData({ year: time, visible: false, }, () => { - this.init(); + loadingFunc(async () => { + await this.init(); + }) }); break; case "month": const [year, month] = time.split("-") this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => { - this.init(); + loadingFunc(async () => { + await this.init(); + }) }); break; case "day": @@ -289,7 +312,9 @@ Page({ visible: false, page: 1, }, () => { - this.init(); + loadingFunc(async () => { + await this.init(); + }) }) break; } diff --git a/childPackage/pages/electricQuery/index.json b/childPackage/pages/electricQuery/index.json index 3972a94..175ba0d 100644 --- a/childPackage/pages/electricQuery/index.json +++ b/childPackage/pages/electricQuery/index.json @@ -11,7 +11,8 @@ "timePicker": "/components/timePicker/index", "accountingCard": "./components/accountingCard/index", "pagination": "/components/pagination/index", - "echarts": "/childPackage/components/echarts/ec-canvas" + "echarts": "/childPackage/components/echarts/ec-canvas", + "listTable": "./components/listTable/index" }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/childPackage/pages/electricQuery/index.wxml b/childPackage/pages/electricQuery/index.wxml index ecee176..8171e81 100644 --- a/childPackage/pages/electricQuery/index.wxml +++ b/childPackage/pages/electricQuery/index.wxml @@ -70,7 +70,7 @@ - + + + 合计:表计数量:{{meterNumber}},耗电量:{{electricNumber}} @@ -87,7 +89,7 @@ - +
+ + + 111 + \ No newline at end of file diff --git a/components/searchSelect/index.wxss b/components/searchSelect/index.wxss new file mode 100644 index 0000000..a6bad63 --- /dev/null +++ b/components/searchSelect/index.wxss @@ -0,0 +1 @@ +/* components/searchSelect/index.wxss */ \ No newline at end of file diff --git a/pages/home/index.js b/pages/home/index.js index 53e9f1a..2fa926b 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -386,4 +386,5 @@ Page({ } }) }, + }) \ No newline at end of file diff --git a/pages/my/index.js b/pages/my/index.js index a507ef6..a16c164 100644 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -39,6 +39,11 @@ Page({ }) }, jumpToQrCode() { + const { user = {} } = this.data; + if (!user?.id) { + alertInfo("请先登录") + return; + } wx.navigateTo({ url: '/pages/qrCode/index', }) @@ -73,6 +78,11 @@ Page({ url: '/pages/invoiceList/index?tab=2', }) }, + jumpToWorkBench() { + wx.navigateTo({ + url: '/pages/workBench/index', + }) + }, async getUnReadNumber() { const dot = await getDot(); this.setData({ @@ -117,4 +127,8 @@ Page({ }); }, + // onTabItemTap(item) { + // console.log('------------', item) + + // } }) \ No newline at end of file diff --git a/pages/my/index.wxml b/pages/my/index.wxml index 86cbd8b..f25a2d5 100644 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -14,6 +14,7 @@ + \ No newline at end of file diff --git a/pages/workBench/components/approve/index.js b/pages/workBench/components/approve/index.js new file mode 100644 index 0000000..04c0e1a --- /dev/null +++ b/pages/workBench/components/approve/index.js @@ -0,0 +1,24 @@ +// pages/workBench/components/approve/index.js +Component({ + + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) \ No newline at end of file diff --git a/pages/workBench/components/approve/index.json b/pages/workBench/components/approve/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/pages/workBench/components/approve/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/workBench/components/approve/index.wxml b/pages/workBench/components/approve/index.wxml new file mode 100644 index 0000000..80cada9 --- /dev/null +++ b/pages/workBench/components/approve/index.wxml @@ -0,0 +1,2 @@ + +pages/workBench/components/approve/index.wxml \ No newline at end of file diff --git a/pages/workBench/components/approve/index.wxss b/pages/workBench/components/approve/index.wxss new file mode 100644 index 0000000..9543ab5 --- /dev/null +++ b/pages/workBench/components/approve/index.wxss @@ -0,0 +1 @@ +/* pages/workBench/components/approve/index.wxss */ \ No newline at end of file diff --git a/pages/workBench/components/recharge/index.js b/pages/workBench/components/recharge/index.js new file mode 100644 index 0000000..932a858 --- /dev/null +++ b/pages/workBench/components/recharge/index.js @@ -0,0 +1,24 @@ +// pages/workBench/components/recharge/index.js +Component({ + + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) \ No newline at end of file diff --git a/pages/workBench/components/recharge/index.json b/pages/workBench/components/recharge/index.json new file mode 100644 index 0000000..b94c3e8 --- /dev/null +++ b/pages/workBench/components/recharge/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index" + } +} \ No newline at end of file diff --git a/pages/workBench/components/recharge/index.wxml b/pages/workBench/components/recharge/index.wxml new file mode 100644 index 0000000..f2a7fef --- /dev/null +++ b/pages/workBench/components/recharge/index.wxml @@ -0,0 +1,3 @@ + +充值 + \ No newline at end of file diff --git a/pages/workBench/components/recharge/index.wxss b/pages/workBench/components/recharge/index.wxss new file mode 100644 index 0000000..fc3e3af --- /dev/null +++ b/pages/workBench/components/recharge/index.wxss @@ -0,0 +1 @@ +/* pages/workBench/components/recharge/index.wxss */ \ No newline at end of file diff --git a/pages/workBench/components/record/index.js b/pages/workBench/components/record/index.js new file mode 100644 index 0000000..c76b4f6 --- /dev/null +++ b/pages/workBench/components/record/index.js @@ -0,0 +1,24 @@ +// pages/workBench/components/record/index.js +Component({ + + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) \ No newline at end of file diff --git a/pages/workBench/components/record/index.json b/pages/workBench/components/record/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/pages/workBench/components/record/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/workBench/components/record/index.wxml b/pages/workBench/components/record/index.wxml new file mode 100644 index 0000000..9200d7d --- /dev/null +++ b/pages/workBench/components/record/index.wxml @@ -0,0 +1,2 @@ + +pages/workBench/components/record/index.wxml \ No newline at end of file diff --git a/pages/workBench/components/record/index.wxss b/pages/workBench/components/record/index.wxss new file mode 100644 index 0000000..f41e371 --- /dev/null +++ b/pages/workBench/components/record/index.wxss @@ -0,0 +1 @@ +/* pages/workBench/components/record/index.wxss */ \ No newline at end of file diff --git a/pages/workBench/index.js b/pages/workBench/index.js new file mode 100644 index 0000000..4b09d20 --- /dev/null +++ b/pages/workBench/index.js @@ -0,0 +1,68 @@ +// pages/workBench/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + active: 0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + onTabChange(e) { + this.setData({ active: e.detail.index }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/workBench/index.json b/pages/workBench/index.json new file mode 100644 index 0000000..609219d --- /dev/null +++ b/pages/workBench/index.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index", + "navigator": "/components/navigator/index", + "approve": "./components/approve/index", + "recharge": "./components/recharge/index", + "record": "./components/record/index" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/workBench/index.wxml b/pages/workBench/index.wxml new file mode 100644 index 0000000..ae5e967 --- /dev/null +++ b/pages/workBench/index.wxml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/workBench/index.wxss b/pages/workBench/index.wxss new file mode 100644 index 0000000..c989687 --- /dev/null +++ b/pages/workBench/index.wxss @@ -0,0 +1 @@ +/* pages/workBench/index.wxss */ \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 2683e76..b31992c 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -10,6 +10,20 @@ "condition": { "miniprogram": { "list": [ + { + "name": "childPackage/pages/electricQuery/index", + "pathName": "childPackage/pages/electricQuery/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "pages/workBench/index", + "pathName": "pages/workBench/index", + "query": "", + "launchMode": "default", + "scene": null + }, { "name": "pages/publicTransfer/index", "pathName": "pages/publicTransfer/index",