Compare commits

...

115 Commits

Author SHA1 Message Date
fe590353df 修改解绑表的时候读数问题,抄表路线的抄表记录可以查看图片 2025-10-28 14:25:59 +08:00
2535720023 绑定电表和解绑电表的时候初始传尖峰平谷和保存的时候传平 2025-10-11 15:37:16 +08:00
5e2b2dcfda 修改工作台 2025-10-10 14:10:50 +08:00
612dd4eac1 去除打印 2025-09-28 16:29:08 +08:00
87bb23a9a4 修改时间冒泡的问题,调整电表详情 2025-09-28 16:06:27 +08:00
a2f92a0959 修改状态 2025-09-24 10:24:52 +08:00
e64318f174 只有最后一条抄表记录可以修改 2025-09-23 17:18:51 +08:00
195a6d7c48 修改传参的问题 2025-09-22 14:57:20 +08:00
76746682fa 根据接口修改 2025-09-22 10:56:24 +08:00
ad4d9323ad 拍照支持裁剪 2025-09-22 09:48:37 +08:00
d4f357d624 工作台修改 2025-09-19 17:34:28 +08:00
9b00bb3561 修改抄表路线问题 2025-09-19 16:27:29 +08:00
d77af4b78f 修改问题 2025-09-19 15:29:26 +08:00
345a362c74 修改样式,修改不能输入负数的问题 2025-09-19 14:37:33 +08:00
aea85af0f9 修改样式 2025-09-18 15:34:44 +08:00
b61f3287fb 抄表记录时间戳 2025-09-17 17:23:40 +08:00
49aeeb05a7 抄表记录修改时间格式调整 2025-09-17 16:58:48 +08:00
95e6937d06 抄表记录提交 2025-09-17 16:48:57 +08:00
4308096394 准备联调抄表记录 2025-09-17 14:51:36 +08:00
17c992fb0b 准备联调抄表记录 2025-09-16 17:35:49 +08:00
493be62f44 暂存工作台抄表 2025-09-10 15:51:13 +08:00
af749eb638 提交本地接口地址 2025-09-10 14:03:25 +08:00
3340f1f3af 提交用电查询选择电表的问题 2025-09-10 11:26:20 +08:00
cdbc3fa959 暂存 2025-09-10 11:19:07 +08:00
b1cca8f8a5 导入抄表记录 2025-09-09 17:33:56 +08:00
70737fa2b8 导入抄表记录完成电表列表部分(未调试) 2025-09-08 17:31:03 +08:00
71ad4995c8 开始做工作台的抄表 2025-09-05 17:32:27 +08:00
3e640c3633 修改部分内容 2025-09-02 17:16:59 +08:00
a8312b89d5 Merge branch 'dev' of https://git.archgrid.xyz/zly/electricity_bill_calc_wx into dev 2025-07-30 11:06:57 +08:00
f0dee5bc77 修改登录提示语 2025-07-30 11:05:45 +08:00
7bc344e90b 修改抄表记录详情中sn取值错误 2025-07-28 10:35:49 +08:00
5f56f9a6a8 b 2025-07-23 17:40:38 +08:00
886a03cf16 工作台 -> 充值审核 -> 已审核列表标签字体缩小 2025-07-22 08:58:30 +08:00
fccaee5f2b C端小程序显示优化 工作台部分 2025-07-21 14:10:05 +08:00
33d7528990 C端小程序显示优化 2025-07-21 09:50:46 +08:00
f9aedf7d79 二、C端小程序电费扣款记录 2025-07-17 15:33:22 +08:00
ac0a4b02c7 提交工作台和首页的更改 2025-07-16 17:33:15 +08:00
7bd4da3c84 修改抄表记录峰谷不显示的问题 2025-06-17 17:30:51 +08:00
a36faa9bcb 支持微信公众号跳转账单 2025-06-11 08:59:40 +08:00
7772b3de1a 开票的时候,点击开票先跳转到开票列表,从接口成功后跳转改成直接跳转,由后端控制状态显示,防止特殊情况下存在接口无返回导致页面卡死的问题后用户重复点击导致多开发票的问题,以及pdf右上角默认展示菜单 2025-06-06 17:08:06 +08:00
10a0fd7c19 修改电量查询的账务余额 2025-05-14 13:11:43 +08:00
d27fa31ac7 处理无响应请求 2025-05-14 09:57:14 +08:00
a3c4e78c22 电量查询支持峰谷 2025-05-13 09:15:51 +08:00
5c202e99a6 抄表记录支持尖峰平谷 2025-05-13 08:39:41 +08:00
e637bbf8a8 用电查询支持尖峰平谷 2025-05-12 17:31:24 +08:00
4d665588ac 修改用电查询 2025-05-12 14:04:17 +08:00
028d695deb 修改描述 2025-04-27 17:39:33 +08:00
3e9857bdcd 账单支持峰谷 2025-04-27 08:59:56 +08:00
34995ef9a3 账单支持峰谷表字 2025-04-23 17:25:17 +08:00
fb9e727efd 修改工作台开户建筑必填和优化报错信息,账单支持峰谷 2025-04-22 18:00:12 +08:00
721937fa5b 修改了开户的时候无法关掉选择的问题,电量图表的错位问题 2025-03-31 16:48:06 +08:00
32b7dbc38c 修改开户缓存问题和修改编辑商户信息后商户信息不变化的问题 2025-03-12 08:47:59 +08:00
1b69035ed2 修改转换管理员接口 2025-03-04 17:32:41 +08:00
fc5ef4b931 修改开户报错 2025-03-04 17:03:39 +08:00
8478e324d8 修改样式 2025-03-03 16:56:50 +08:00
d58436ef5f 修改样式 2025-03-03 16:54:40 +08:00
5fbd34d9f8 完成样式改动和设置为管理员 2025-02-28 10:33:20 +08:00
edcaa7701c 暂存样式修改 2025-02-27 17:37:12 +08:00
902b4726c6 调整样式 2025-02-26 13:41:44 +08:00
71194fbf1c 修改完接口后刷新 2025-02-25 10:33:14 +08:00
28c4028893 修改引用错误 2025-02-25 10:07:24 +08:00
1a3b94af51 调整顺序 2025-02-25 09:33:17 +08:00
8a1af13924 去掉多余 2025-02-25 09:03:53 +08:00
db4045031a 修改按钮样式 2025-02-25 09:02:02 +08:00
d6e93d9f36 暂存c端账号管理和商户信息 2025-02-24 17:35:18 +08:00
93ee759092 暂存商户信息 2025-02-21 15:47:36 +08:00
b078bbf26a 暂存账号管理 2025-02-21 08:41:46 +08:00
16a03fbb4b 暂存工作台的修改 2025-02-20 17:28:45 +08:00
5d617f2282 暂存充值审核 2025-02-20 10:38:29 +08:00
616c6a53fb 修改发票显示问题和暂存工作台修改 2025-02-19 19:54:02 +08:00
103c10347c 预留手机号新加解释,优惠券新增备注,修改部分样式,优化table组件可以传属性 2025-01-21 14:32:41 +08:00
24f2ec9ead 修改电表报表抄表记录 2025-01-17 08:44:59 +08:00
2b653ea3ed 修改搜索条件被截掉的问题,新增电表列表 2025-01-14 17:10:46 +08:00
b905da6035 新增分享功能,修改开票判断逻辑,可查询电表列表 2025-01-10 15:07:07 +08:00
ec77d26c27 调整用户手动绑定的时候,需要手动搜索才可以查询出公司,做好隐私处理,修改了电表在线状态错误的问题 2025-01-09 15:07:35 +08:00
293a5c8682 调整我的页面,调整手动绑定字段错误和接口调用的错误 2025-01-03 10:57:46 +08:00
bcaefbe1cb 开票信息支持电话 2024-12-26 17:37:52 +08:00
4ecf443f89 调整手动绑定样式 2024-12-24 17:33:07 +08:00
399ef43d07 暂存获取用户信息错误的问题 2024-12-17 10:23:55 +08:00
b3358ef4ec 修改获取用户信息错误 2024-12-13 09:32:44 +08:00
f63b2f3319 修改显示错误 2024-12-10 17:35:28 +08:00
307be86cb4 修改积分显示异常 2024-12-09 16:35:39 +08:00
ebc8cae3c8 修改优惠券bug 2024-12-09 15:31:49 +08:00
f6f1425cf5 修改领券中心bug 2024-12-09 14:19:42 +08:00
fd7777e4f4 调整优惠券部分 2024-12-09 10:36:16 +08:00
9bc3cb5584 提交优惠券,积分修改(领券部分没做) 2024-12-06 17:41:26 +08:00
34c2cb76e7 编辑我的页面跳转,完成积分和优惠券页面的创建(内容还没写多少) 2024-12-04 17:30:02 +08:00
f6d44a6d33 调整整体样式 2024-12-02 16:02:39 +08:00
a164ec227b 修改援助样式,新增人员所在单位 2024-11-29 17:27:18 +08:00
3ad21ea708 提交法律援助和财税援助,调整我的页面 2024-11-29 15:36:18 +08:00
520f44a25f 暂存我的页面修改 2024-11-28 17:33:29 +08:00
7bbe58a0d0 上传首页更改 2024-11-28 09:51:12 +08:00
6af35a4632 暂存首页改造,banner 2024-11-26 17:00:51 +08:00
cfad35ec52 调整接口地址 2024-11-26 09:41:22 +08:00
883461c852 调整工作台接口,处理特殊字符 2024-11-18 17:09:07 +08:00
84c6c54e58 修改对公审核字段错误的问题 2024-11-14 16:22:38 +08:00
efe3d3241d 暂存工作台模块,初步完成待测试和优化 2024-11-13 17:31:26 +08:00
c8649288ff 暂存工作台修改 2024-11-12 11:10:46 +08:00
b9d1ee34a7 开始做工作台,调整用电查询分页 2024-11-08 18:24:05 +08:00
08ef87ce33 修改首页获取园区商户信息错误的问题 2024-10-29 16:32:16 +08:00
58b945eb72 获取用户信息传商户id 2024-10-29 15:31:24 +08:00
1bb3d6dddb 充值记录查看凭证,检查二维码和上传凭证问题,首页获取商户列表更改 2024-10-29 15:25:42 +08:00
e94051f7c9 百科支持图片和视频 2024-10-23 10:26:14 +08:00
cb58d3b439 百科支持富文本,对公展示充值信息,下载充值记录文件名改动 2024-10-22 16:11:49 +08:00
f00bcbe8d1 修改提示描述,修改下载文件名字,修改接口响应判断 2024-10-21 13:35:50 +08:00
26ec060327 修改电表倍率字段 2024-10-18 16:13:16 +08:00
0522d517e0 调整专区样式 2024-09-24 11:08:23 +08:00
3f6a12ee67 解决数据下拉加载的bug,调整专区样式,完善充值记录 2024-09-12 14:04:53 +08:00
b4438b4638 修改xml不能下载的问题 2024-09-10 17:18:01 +08:00
5c971ef2e8 修改下载发票失败的问题 2024-09-10 16:40:29 +08:00
86ca43d214 开收据调整 2024-09-10 16:11:10 +08:00
37c8d6560f 百科新增loading 2024-09-10 14:15:03 +08:00
3def3bf68b 上传文件限制大小 2024-09-10 13:47:09 +08:00
7d81e7d4d5 Merge branch 'dev' of https://git.archgrid.xyz/zly/electricity_bill_calc_wx into dev 2024-09-10 11:08:16 +08:00
8482453da0 修改缴费记录和对公 2024-09-10 11:07:45 +08:00
327 changed files with 13909 additions and 403 deletions

21
app.js
View File

@@ -1,14 +1,31 @@
import { checkUpgrade, getConfigByEnv } from "./utils/index"
// app.js
function share() {
wx.onAppRoute(function(res) {
const pages = getCurrentPages()
const view = pages[pages.length - 1];
if (view) {
wx.showShareMenu()
view.onShareAppMessage = () => {
return {
title: "",
path: "/pages/home/index",
imageUrl: "/assets/images/share.png"
}
}
}
})
}
App({
onShow() {
checkUpgrade();
},
onLaunch() {
share()
const { api } = getConfigByEnv();
this.globalData = { ...this.globalData, api, }
},
globalData: {
primaryColor: '#52c41a'

View File

@@ -21,7 +21,28 @@
"pages/publicTransfer/index",
"pages/special/index",
"pages/encyclopedia/index",
"pages/encyclopediaDetail/index"
"pages/encyclopediaDetail/index",
"pages/workBench/index",
"pages/workBenchNew/index",
"pages/webPage/index",
"pages/aid/finance/index",
"pages/aid/law/index",
"pages/aid/detail/index",
"pages/aid/consult/index",
"pages/writeReading/index",
"pages/readingHistory/index",
"pages/integral/index",
"pages/discountCoupon/index",
"pages/integralRecord/index",
"pages/meterList/index",
"pages/workBench/components/tenement/components/createTenement/index",
"pages/billMeterDetail/index",
"pages/meterBalanceRecord/index",
"pages/workBenchNew/components/workBenchMeter/index",
"pages/workBenchNew/components/workBenchTenement/index",
"pages/workBenchNew/components/workBenchApprove/index",
"pages/workBenchNew/components/workBenchWxUser/index",
"pages/workBenchNew/components/workBenchReading/index"
],
"subPackages": [
{
@@ -41,12 +62,6 @@
"iconPath": "/assets/tabbar/home.png",
"selectedIconPath": "/assets/tabbar/home_select.png"
},
{
"pagePath": "pages/special/index",
"text": "专区",
"iconPath": "/assets/tabbar/special.png",
"selectedIconPath": "/assets/tabbar/special_select.png"
},
{
"pagePath": "pages/my/index",
"text": "我的",

BIN
assets/images/baike.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
assets/images/finance.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
assets/images/law.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets/images/share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
assets/images/stop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
assets/images/tihuan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 KiB

View File

@@ -1,9 +1,12 @@
import { getReportDetail } from "../../../service/report";
import { alertInfo, getPixelRatio } from "../../../utils/index";
import { alertInfo, alertSuccess, getPixelRatio, loadingFunc } from "../../../utils/index";
import request from '../../../utils/request'
import * as echarts from '../../components/echarts/echarts';
import { getRoundNumber } from "../../../utils/index"
const { OK } = request
// pages/billDetail/index.js
Page({
@@ -15,31 +18,34 @@ Page({
time: "",
detail: {},
meters: [],
header1: [
{ key: 'address', title: '电表地址' },
{ title: '起码',renderBody: (item) => { return item?.startNumber } },
{ title: '止码',renderBody: (item) => { return item?.endNumber } },
{ title: '倍率',renderBody: (item) => { return item?.displayRatio } },
],
header2: [
{ title: '用电量', renderBody: (item) => item?.overall?.amount },
{ title: '线损电量',renderBody: (item) => item?.loss?.amount },
{ title: '公摊电量',renderBody: (item) => item?.publicAmount },
{ title: '合计电量',renderBody: (item) => {
// header1: [
// { key: 'address', title: '电表地址' },
// { title: '起码',renderBody: (item) => { return item?.startNumber } },
// { title: '止码',renderBody: (item) => { return item?.endNumber } },
// { title: '倍率',renderBody: (item) => { return item?.displayRatio } },
// ],
// header2: [
// { title: '用电量', renderBody: (item) => item?.overall?.amount },
// { title: '线损电量',renderBody: (item) => item?.loss?.amount },
// { title: '公摊电量',renderBody: (item) => item?.publicAmount },
// { title: '合计电量',renderBody: (item) => {
} },
]
// } },
// ]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { id, time } = options;
this.init(id, time);
const { id, time, tenement } = options;
const that = this;
loadingFunc(async () => {
await that.init(id, time, tenement);
})
},
async init(id, time) {
const { code, message, detail, amount } = await getReportDetail(id)
async init(id, time, tenement) {
const { code, message, detail, amount } = await getReportDetail(id, tenement)
if (code !== OK) {
alertInfo(message)
return;
@@ -50,45 +56,92 @@ Page({
detail,
amount: amount,
meters: detail?.meters?.map(item => {
const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0)
item.finalAmount = Number(finalAmount).toFixed(2)
if (item?.loss?.amount) {
item.loss.amount = getRoundNumber(Number(item.loss.amount))
}
// const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0)
item.finalAmount = getRoundNumber(Number(item.finalAmount))
return item;
})
})
const option = {
tooltip: {
trigger: 'item'
},
legend: {
top: 10,
left: 'center'
},
label: {
alignTo: 'edge',
formatter: '{name|{b}}\n{value|{c} }',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999'
if (detail?.park?.meter04kvType === 0) {
const option = {
tooltip: {
trigger: 'item'
},
legend: {
top: 10,
left: 'center'
},
label: {
alignTo: 'edge',
formatter: '{name|{b}}\n{value|{c} }',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999'
}
}
}
},
series: [
{
type: 'pie',
radius: '50%',
data: [
{ value: detail.comprehensive.lossAmount, name: '本期线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
{ value: detail.comprehensive.consumption, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } },
],
}
]
};
this.init_pieCharts(option);
},
series: [
{
type: 'pie',
radius: '50%',
data: [
{ value: detail.comprehensive.lossAmount, name: '线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
{ value: detail.comprehensive.consumption, name: '电度电量', itemStyle: { color: 'rgb(80,135,236)' } },
],
}
]
};
this.init_pieCharts(option);
} else {
// const option = {
// tooltip: {
// trigger: 'item'
// },
// legend: {
// top: 10,
// left: 'center'
// },
// label: {
// alignTo: 'edge',
// formatter: '{name|{b}}\n{value|{c} }',
// minMargin: 5,
// edgeDistance: 10,
// lineHeight: 15,
// rich: {
// time: {
// fontSize: 10,
// color: '#999'
// }
// }
// },
// series: [
// {
// type: 'pie',
// radius: '50%',
// data: [
// {
// value: detail.comprehensive.lossAmount,
// name: '线损电量',
// },
// {
// value: detail.comprehensive.consumption,
// name: '电度电量',
// },
// ],
// }
// ]
// };
// this.init_pieCharts(option);
}
const that = this;
wx.getSystemInfo({
success: function (res) {
@@ -115,6 +168,12 @@ Page({
return pieChart;
});
},
jumpToDetail(e) {
const { meter } = e.currentTarget.dataset;
wx.navigateTo({
url: '/pages/billMeterDetail/index?data=' + JSON.stringify(meter),
})
},
download() {
const { id: tenement } = wx.getStorageSync('tenement')
const { id } = this.data;
@@ -134,18 +193,27 @@ Page({
case 'develop':
wx.setClipboardData({
data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
success: () => {
alertSuccess("复制成功")
}
})
break;
// 体验版
case 'trial':
wx.setClipboardData({
data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
success: () => {
alertSuccess("复制成功")
}
})
break;
// 正式版
case 'release':
wx.setClipboardData({
data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
success: () => {
alertSuccess("复制成功")
}
})
break;
}

View File

@@ -1,7 +1,7 @@
<!--pages/billDetail/index.wxml-->
<navigator title="{{ time }}电费账单" canBack="{{true}}" />
<view class="title" style="top: {{statusBarHeight + 46}}px">
<avatar text="{{detail.tenement.shortName}}" />
<avatar text="{{detail.tenement.shortName}}" />
<view class="titleContent">
<view class="park">
<view class="label">
@@ -11,7 +11,7 @@
</view>
<view class="address">
<view class="label">
用电地址:
商户地址:
</view>
<view class="value"> {{ detail.tenement.address }} </view>
</view>
@@ -19,20 +19,20 @@
<view class="label">
账单周期:
</view>
<view class="value"> {{ detail.comprehensive.startDate }} 至 {{ detail.comprehensive.endDate }} </view>
<view class="value"> {{ detail.comprehensive.startDate }} 至 {{ detail.comprehensive.endDate }} </view>
</view>
</view>
<van-button type="info" size="small" class="download" bind:click="download">下载</van-button>
</view>
<view class="wrapper">
<view class="wrapper" wx:if="{{detail.park.meter04kvType !== 1}}">
<view class="line"></view>
<view class="contentTitle"> 本期账单 </view>
<van-row gutter="10">
<van-col span="8">
<view class="colContent">
<view class="colContentTitle">本期用电量</view>
<view class="colContentValue"> {{ amount }} 千瓦时 </view>
<view class="colContentValue" wx:if="{{detail.park.meter04kvType === 0}}"> {{ amount }} 千瓦时 </view>
</view>
</van-col>
<van-col span="8">
@@ -50,17 +50,10 @@
</van-row>
<view class="line"></view>
<view class="contentTitle"> 电费构成 </view>
<echarts
style="width:200rpx;height:180rpx;"
id="echarts"
class='mychart-bar'
canvas-id="mychart-bar"
ec="{{ ec }}"
forceUseOldCanvas="{{false}}"
>
<echarts style="width:200rpx;height:180rpx;" id="echarts" class='mychart-bar' canvas-id="mychart-bar" ec="{{ ec }}" forceUseOldCanvas="{{false}}">
</echarts>
<view class="tooltip">
本月电量+本月线损电量)*电单价+摊薄公摊电费+摊薄调整电费
电度电量+线损电量)*电单价+摊薄公摊电费+摊薄调整电费
</view>
<view class="line"></view>
<view class="contentTitle"> 电量明细 </view>
@@ -81,12 +74,12 @@
</van-col>
<van-col span="6">
<view class="tableTitle"> 倍率 </view>
<view class="tableContent"> {{item.displayRatio}} </view>
<view class="tableContent"> {{item.ratio}} </view>
</van-col>
</van-row>
<van-row>
<van-col span="6">
<view class="tableTitle"> 电量 </view>
<view class="tableTitle"> 电度电量 </view>
<view class="tableContent"> {{item.overall.amount}} </view>
</van-col>
@@ -106,4 +99,97 @@
</view>
</view>
</view>
<view class="wrapper" wx:if="{{detail.park.meter04kvType === 1}}">
<view class="line"></view>
<view class="contentTitle"> 本期账单 </view>
<van-row gutter="10">
<van-col span="12">
<view class="colContent">
<view class="colContentTitle">本期用电量</view>
<view class="colContentValue"> {{ detail.comprehensive.finalAmount }} 千瓦时 </view>
</view>
</van-col>
<van-col span="12">
<view class="colContent">
<view class="colContentTitle">本期电费</view>
<view class="colContentValue"> {{ detail.comprehensive.total }} 元 </view>
</view>
</van-col>
</van-row>
<view class="line"></view>
<view class="contentTitle"> 分时明细 </view>
<van-row gutter="10">
<van-col span="12">
<view class="colContent">
<view class="colContentTitle">
分时电量
<view> (千瓦时) </view>
</view>
<view class="colContentValue2">尖: {{ detail.comprehensive.sharpAmount }} </view>
<view class="colContentValue2">峰: {{ detail.comprehensive.peakAmount }} </view>
<view class="colContentValue2">平: {{ detail.comprehensive.flatAmount }} </view>
<view class="colContentValue2">谷: {{ detail.comprehensive.valleyAmount }} </view>
</view>
</van-col>
<van-col span="12">
<view class="colContent">
<view class="colContentTitle">
分时单价
<view> (元/千瓦时) </view>
</view>
<view class="colContentValue2">尖: {{ detail.comprehensive.priceSharp }} </view>
<view class="colContentValue2">峰: {{ detail.comprehensive.pricePeak }} </view>
<view class="colContentValue2">平: {{ detail.comprehensive.priceFlat }} </view>
<view class="colContentValue2">谷: {{ detail.comprehensive.priceValley }} </view>
</view>
</van-col>
</van-row>
<view class="line"></view>
<view class="tooltip">
(电度电量+线损电量)*单价+摊薄公摊电费+摊薄调整电费
</view>
<view class="line"></view>
<view class="contentTitle"> 分时电量明细 </view>
<view class="tableWrapper">
<view class="meterListItem" wx:for="{{meters}}" wx:key="id">
<div class="top">
<view class="address">{{item.address}}</view>
<view class="detail primaryTextBtn" bind:tap="jumpToDetail" data-meter="{{item}}"> 详情 </view>
</div>
<view style="margin: 20rpx 0; background-color: #fff;">
<van-row custom-style="height: 100%;display: flex;flex-direction: column;overflow: hidden;">
<van-col span="6">
<view class="tableTitle"> 电度电量 </view>
</van-col>
<van-col span="6">
<view class="tableTitle"> 线损电量 </view>
</van-col>
<van-col span="6">
<view class="tableTitle"> 合计电量 </view>
</van-col>
<van-col span="6">
<view class="tableTitle"> 合计电费 </view>
</van-col>
</van-row>
<van-row class="meterListItemContent">
<van-col span="6">
<view class="tableContent"> {{item.overall.amount}} </view>
</van-col>
<van-col span="6">
<view class="tableContent"> {{item.loss.amount}} </view>
</van-col>
<van-col span="6">
<view class="tableContent"> {{item.finalAmount}} </view>
</van-col>
<van-col span="6">
<view class="tableContent"> {{item.finalTotal}} </view>
</van-col>
</van-row>
</view>
</view>
</view>
</view>
<view style="height: 20rpx;"></view>

View File

@@ -59,12 +59,25 @@ page {
text-align: center;
font-weight: 500;
}
.colContentTitle2 {
padding: 30rpx 0;
text-align: center;
font-weight: 500;
}
.colContentValue {
padding-bottom: 30rpx;
text-align: center;
overflow: hidden;
}
.colContentValue2 {
padding-bottom: 20rpx;
padding-left: 40rpx;
overflow: hidden;
}
.tooltip {
font-size: 30rpx;
color: rgb(136, 132, 132);
@@ -87,10 +100,37 @@ page {
background-color: #fff;
box-sizing: border-box;
flex: 1;
word-break: break-all;
}
.download {
position: absolute;
top: 20rpx;
right: 20rpx;
}
.meterListItem {
font-size: 32rpx;
}
.meterListItem .top {
display: flex;
align-items: center;
}
.meterListItem .address {
flex: 1;
}
/* .top .meterListItem:nth-child(even) .tableContent,
.bottom .meterListItem:nth-child(even) .tableContent,
.top .meterListItem:nth-child(even),
.bottom .meterListItem:nth-child(even)
{
} */
.meterListItemContent, .meterListItemContent .tableContent {
background-color: #fff;
}

View File

@@ -1,24 +1,23 @@
// pages/electricQuery/components/accountingCard/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
data: Object
},
/**
* 组件的属性列表
*/
properties: {
data: Object
},
/**
* 组件的初始数据
*/
data: {
/**
* 组件的初始数据
*/
data: {
},
},
/**
* 组件的方法列表
*/
methods: {
/**
* 组件的方法列表
*/
methods: {
}
}
})

View File

@@ -1,33 +1,86 @@
<!--pages/electricQuery/components/accountingCard/index.wxml-->
<view class="wrapper">
<view class="title">
{{data.meter.address}}
</view>
<van-row>
<van-col span="6">
<view class="tableTitle"> 初始余额 </view>
</van-col>
<van-col span="7">
<view class="tableTitle"> 储值累计金额 </view>
</van-col>
<van-col span="5">
<view class="tableTitle"> 电费 </view>
</van-col>
<van-col span="6">
<view class="tableTitle"> 账务余额 </view>
</van-col>
<van-col span="6">
<view class="tableContent"> {{data.startMoney}} </view>
</van-col>
<van-col span="7">
<view class="tableContent"> {{data.rechargeMoney}} </view>
</van-col>
<van-col span="5">
<view class="tableContent"> {{data.electricMoney}} </view>
</van-col>
<van-col span="6">
<view class="tableContent"> {{data.currentMoney}} </view>
</van-col>
</van-row>
<view class="title">
<span>{{data.meter.address}}</span>
<span style="font-size: 30rpx; margin-left: 100rpx;">电表编号:{{data.meter.sn}}</span>
</view>
<van-row>
<view class="table-header" style="border-bottom: 2rpx solid #000; ">
<view class="table-header-row">
<text class="table-header-cell">类目</text>
<text class="table-header-cell">金额</text>
<text class="table-header-cell">更新时间</text>
</view>
</view>
</van-row>
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
<van-row>
<van-col span="7">
<view class="tableTitle"> 初始余额 </view>
</van-col>
<van-col span="10">
<view class="tableContent"> {{data.startMoney}} </view>
</van-col>
<van-col span="7">
<view calss="tableContent"> {{data.updateStartMoneyAt || '--'}} </view>
</van-col>
</van-row>
</view>
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
<van-row>
<van-col span="7">
<view class="tableTitle"> 累计充值金额 </view>
</van-col>
<van-col span="10">
<view class="tableContent"> {{data.rechargeMoney}} </view>
</van-col>
<van-col span="7">
<view calss="tableContent"> {{data.updateRechargeMoneyAt || '--'}} </view>
</van-col>
</van-row>
</view>
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
<van-row>
<van-col span="7">
<view class="tableTitle"> 电费 </view>
</van-col>
<van-col span="10">
<view class="tableContent"> {{data.electricMoney}} </view>
</van-col>
<van-col span="7">
<view calss="tableContent"> {{data.updateElectricMoneyAt || '--'}} </view>
</van-col>
</van-row>
</view>
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
<van-row>
<van-col span="7">
<view class="tableTitle"> 账务余额 </view>
</van-col>
<van-col span="10">
<view class="tableContent"> {{data.accountMoney}} </view>
</van-col>
<van-col span="7">
<view calss="tableContent"> {{data.updateAccountMoneyAt || '--'}} </view>
</van-col>
</van-row>
</view>
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
<van-row>
<van-col span="7">
<view class="tableTitle"> 电表余额 </view>
</van-col>
<van-col span="10">
<view class="tableContent"> {{data.meterMoney}} </view>
</van-col>
<van-col span="7">
<view calss="tableContent"> {{data.updateMeterMoneyAt || '--'}} </view>
</van-col>
</van-row>
</view>
</view>

View File

@@ -17,8 +17,25 @@
}
.tableContent {
margin-top: 10rpx;
margin-top: 25rpx;
margin-bottom: 20rpx;
text-align: center;
font-size: 32rpx;
}
}
.table-header {
display: flex;
width: 100%;
background-color: #f5f5f5;
border-bottom: 1rpx solid #eaeaea;
}
.table-header-row {
display: flex;
width: 100%;
}
.table-header-cell {
flex: 1;
text-align: center;
padding: 20rpx 0;
font-size: 25rpx;
color: #333;
}

View File

@@ -0,0 +1,49 @@
// childPackage/pages/electricQuery/components/listTable/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
type: Array,
},
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() {
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)
})
},
}
})

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"table": "/components/table/table",
"empty": "/components/empty/index",
"pagination": "/components/pagination/index"
}
}

View File

@@ -0,0 +1,11 @@
<!--childPackage/pages/electricQuery/components/listTable/index.wxml-->
<view wx:if="{{list.length}}">
<table header="{{header}}" list="{{tempList}}" />
<pagination
currentIndex="{{page}}"
totalPage="{{totalPage}}"
bind:pagingChange="onChangePage"
/>
</view>
<empty bind:refresh="init" wx:else />

View File

@@ -0,0 +1 @@
/* childPackage/pages/electricQuery/components/listTable/index.wxss */

View File

@@ -0,0 +1,128 @@
// childPackage/pages/electricQuery/components/reading/index.js
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../../../service/accounting";
import { getTenementMeterList } from "../../../../../service/meter";
import dayjs from "../../../../../utils/dayjs";
import { getParkInfoByTime } from "../../../../../service/park";
import request from '../../../../../utils/request';
import { alertInfo, getPixelRatio, loadingFunc } from "../../../../../utils/index";
const { OK } = request;
Component({
/**
* 组件的属性列表
*/
properties: {
meter: String,
parkInfo: Object,
},
observers: {
'meter': function() {
loadingFunc(async () => {
await this.getReadingList();
})
},
"parkInfo": function(newValue) {
this.setData({ park: newValue })
}
},
/**
* 组件的初始数据
*/
data: {
readingDetailShow: false,
readingDetail: {},
park: {},
meterReadingHeader: [
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
{ title: '倍率', key: 'ratio' },
{ key: 'number', title: '当前表字' },
],
meterReadingList: [],
yearMonthDayReading: dayjs().format("YYYY-MM-DD"),
yearMonthDayReadingStamp: new Date().getTime(),
readingPage: 1,
},
/**
* 组件的方法列表
*/
methods: {
clickReadingTime() {
this.setData({
readingVisible: true
})
},
async getReadingList() {
const { meter, yearMonthDayReading, readingPage } = this.data;
const { code, message, data, total } = await getMeterReadingList({
id: meter,
time: yearMonthDayReading,
page: readingPage
})
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({ meterReadingList: data, totalPage: Math.ceil(total / 20) })
},
onReadingTimeClose() {
this.setData({ readingVisible: false })
},
onReadingTimeCancel() {
this.setData({ readingVisible: false })
},
onReadingTimeConfirm(e) {
const { time } = e.detail;
this.setData({
yearMonthDayReading: time,
yearMonthDayReadingStamp: new Date(time).getTime(),
readingVisible: false,
readingPage: 1,
}, () => {
loadingFunc(async () => {
await this.getParkInfo(time)
await this.getReadingList();
})
})
},
async getParkInfo(time) {
const park = wx.getStorageSync('park');
const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id, `${time}`, `${0}`,)
if (code !== OK) {
alertInfo(message)
return;
}
const that = this;
return new Promise((resolve) => {
that.setData({
parkInfo: parkInfo
}, () => {
resolve()
})
})
},
showDetail(e) {
const { index, data = {} } = e.detail;
this.setData({
readingDetailShow: true,
readingDetail: data || {}
})
},
async onChangePage(e) {
const page = e.detail.currentIndex;
const that = this;
this.setData({
readingPage: page
}, () => {
loadingFunc(async () => {
await that.getReadingList();
})
})
},
}
})

View File

@@ -0,0 +1,13 @@
{
"component": true,
"usingComponents": {
"custom-picker": "/components/picker/index",
"table": "/components/table/table",
"empty": "/components/empty/index",
"timePicker": "/components/timePicker/index",
"pagination": "/components/pagination/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-field": "@vant/weapp/field/index",
"van-icon": "@vant/weapp/icon/index"
}
}

View File

@@ -0,0 +1,150 @@
<!--childPackage/pages/electricQuery/components/reading/index.wxml-->
<view style="margin-left: 30rpx;">
<view class="timeChooseWrapper">
<view> 选择时间 </view>
<view class="time" bind:tap="clickReadingTime">
<view class="timeText"> {{yearMonthDayReading}} </view>
<van-icon name="arrow-down" />
</view>
</view>
</view>
<view style="margin: 30rpx;">
<view wx:if="{{meterReadingList.length}}">
<table
header="{{meterReadingHeader}}"
list="{{meterReadingList}}"
bind:onClick="showDetail"
/>
<pagination
currentIndex="{{readingPage}}"
totalPage="{{totalPage}}"
bind:pagingChange="onChangePage"
/>
</view>
<empty bind:refresh="getReadingList" wx:else />
</view>
<timePicker
type="day"
day="{{yearMonthDayReadingStamp}}"
show="{{readingVisible}}"
bind:cancel="onReadingTimeCancel"
bind:close="onReadingTimeClose"
bind:confirm="onReadingTimeConfirm"
/>
<van-dialog
use-slot
title="抄表记录详情"
show="{{ readingDetailShow }}"
bind:close="onClose"
>
<view style="margin-top: 10px;">
<van-cell-group>
<van-field
value="{{ readingDetail.meter.address }}"
border="{{ false }}"
label="地址"
readonly
/>
<van-field
value="{{ readingDetail.meter.sn }}SN"
border="{{ false }}"
label="编号"
readonly
/>
<van-field
value="{{ readingDetail.readAt }}"
border="{{ false }}"
label="时间"
readonly
/>
<van-field
value="{{ readingDetail.ratio }}"
border="{{ false }}"
label="倍率"
readonly
/>
<van-field
value="{{ readingDetail.number }}"
border="{{ false }}"
label="当前表字(总)"
readonly
/>
<van-field
value="{{ readingDetail.overall }}"
border="{{ false }}"
label="总用电量"
readonly
/>
<van-field
value="{{ readingDetail.sharp }}"
border="{{ false }}"
label="当前表字(尖)"
readonly
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
/>
<van-field
value="{{ readingDetail.sharpAmount }}"
border="{{ false }}"
label="尖用电量"
readonly
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
/>
<van-field
value="{{ readingDetail.peak }}"
border="{{ false }}"
label="当前表字(峰)"
readonly
wx:if="{{park.meter04kvType === 1 || park.meter04kvType === 2}}"
/>
<van-field
value="{{ readingDetail.peakAmount }}"
border="{{ false }}"
label="峰用电量"
readonly
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
/>
<van-field
value="{{ readingDetail.flat }}"
border="{{ false }}"
label="当前表字(平)"
readonly
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
/>
<van-field
value="{{ readingDetail.flatAmount }}"
border="{{ false }}"
label="平用电量"
readonly
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
/>
<van-field
value="{{ readingDetail.valley }}"
border="{{ false }}"
label="当前表字(谷)"
readonly
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
/>
<van-field
value="{{ readingDetail.valleyAmount }}"
border="{{ false }}"
label="谷用电量"
readonly
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
/>
<view class="text">上次抄表记录起,至现在时间内的用电量</view>
</van-cell-group>
</view>
</van-dialog>

View File

@@ -0,0 +1,102 @@
/* childPackage/pages/electricQuery/components/reading/index.wxss */
/* pages/electricQuery/index.wxss */
page {
background-color: var(--transparent-green);
}
.queryWrapper {
margin: 20rpx 0rpx;
background-color: #fff;
padding:15rpx 20rpx;
box-sizing: border-box;
border-radius: 20rpx;
display: flex;
align-items: center;
font-size: 32rpx;
}
.label {
width: 180rpx;
font-size: 32rpx;
}
.sum {
margin-bottom: 30rpx;
margin-left: 30rpx;
margin-right: 30rpx;
padding-bottom: 50rpx;
}
.query {
margin: 20rpx 0rpx;
}
.typeQueryText {
text-align: center;
padding: 20rpx;
background-color: var(--light-green);
font-size: 32rpx;
}
.select {
border: 1rpx solid #ccc;
padding: 12rpx;
border-radius: 12rpx;
flex: 1;
display: flex;
justify-content: space-between;
font-size: 30rpx;
}
.timeQueryText {
text-align: center;
padding: 20rpx;
background-color: rgb(242,248,246);
font-size: 30rpx;
}
.wrapper {
margin-left: 30rpx;
margin-right: 30rpx;
padding: 0;
}
.tooltip {
margin: 20rpx 0;
font-size: 28rpx;
color: rgb(97, 93, 93);
}
.timeChooseWrapper {
display: flex;
align-items: center;
font-size: 30rpx;
}
.time {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 10rpx 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.timeText {
flex: 1;
}
.mychart-bar::after{
content:"";
display:block;
clear:both
}
.text{
font-size: 28rpx;
color: #999999;
margin: 10rpx 0;
text-align: center;
}

View File

@@ -1,6 +1,7 @@
// pages/electricQuery/index.js
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../service/accounting";
import { getTenementMeterList } from "../../../service/meter";
import { getParkInfoByTime } from "../../../service/park";
import dayjs from "../../../utils/dayjs";
import request from '../../../utils/request';
import * as echarts from '../../components/echarts/echarts';
@@ -22,39 +23,52 @@ Page({
year: dayjs().format('YYYY'),
yearMonth: dayjs().format("YYYY-MM"),
yearMonthDay: dayjs().format("YYYY-MM-DD"),
yearStamp: new Date().getTime(),
yearMonthStamp: new Date().getTime(),
yearMonthDayStamp: new Date().getTime(),
header: [
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
// { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
{ title: '时间',renderBody: (item) => { return item.time } },
{ key: 'number', title: '耗量' },
],
meterReadingHeader: [
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
{ title: '倍率', key: 'ratio' },
{ key: 'number', title: '抄表记录' },
valleyHeader: [
// { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
{ title: '时间',renderBody: (item) => { return item.time } },
{ key: 'critical', title: '' },
{ key: 'peak', title: '峰' },
{ key: 'flat', title: '平' },
{ key: 'valley', title: '谷' },
],
list: [],
visible: false,
meterReadingList: [],
accountingList: [],
electricNumber: 0,
meterNumber: 0,
page: 1,
readingPage: 1,
},
changeQueryType(e) {
const { type } = e.currentTarget.dataset
this.setData({ queryType: type },() => {
switch(type) {
case 0:
this.init()
loadingFunc(async () => {
await this.init()
})
break;
case 1:
this.getReadingList();
break;
// loadingFunc(async () => {
// await this.getReadingList();
// })
// break;
case 2:
this.getAccountingBalanceList();
loadingFunc(async () => {
await this.getAccountingBalanceList();
})
break;
}
@@ -67,10 +81,14 @@ Page({
visible: true
})
},
changeTimeType(e) {
const { type } = e.currentTarget.dataset
const { type } = e.currentTarget.dataset;
const that = this;
this.setData({ timeType: type }, () => {
this.init()
loadingFunc(async () => {
await that.init()
})
})
},
@@ -78,10 +96,14 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.init()
loadingFunc(async () => {
await this.getMeters()
await this.getParkInfo()
await this.init()
})
},
async init() {
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page } = this.data;
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page, parkInfo } = this.data;
let time;
switch(timeType) {
case 1:
@@ -116,12 +138,18 @@ Page({
devicePixelRatio: getPixelRatio(),
});
const ids = [...new Set(data?.map(item => item?.meter?.id))]
const point = data?.[0]?.time?.slice(-1)
const times = [...new Set(data?.map(item => item.time))].
map(item => Number(item.replace(point, ""))).
sort((a, b) => a - b).
map(ele => `${ele}${point}`.padStart(3, "0"));
const options = {
tooltip: {
trigger: 'axis'
},
legend: {
data: data?.map(item => item?.meter?.address),
data: data?.map(item => item?.meter?.address),
},
grid: {
left: '3%',
@@ -132,18 +160,25 @@ Page({
xAxis: {
type: 'category',
boundaryGap: false,
data: [...new Set(data?.map(item => item.time))]
data: times
},
yAxis: {
type: 'value'
},
series: ids?.map(item => {
const element = data?.find(i => i?.meter?.id === item)
const list = data?.filter(ele => ele?.meter?.id === item)
const newList = [...times].map(item => {
const exist = list.find(ele => ele.time === item)
if (exist) {
return Number(exist.critical)+ Number(exist.peak)+Number(exist.flat)+Number(exist.valley);
}
return null
})
return {
name: element?.meter?.address,
type: 'line',
stack: 'Total',
data: data?.filter(ele => ele?.meter?.id === item).map(item => item.number)
data: newList
}})
};
@@ -152,15 +187,7 @@ Page({
return pieChart;
});
},
async getReadingList() {
const { meterId } = this.data;
const { code, message, data } = await getMeterReadingList(meterId)
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({ meterReadingList: data, totalPage: 1 })
},
async export() {
loadingFunc(async () => {
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay } = this.data;
@@ -184,6 +211,7 @@ Page({
wx.openDocument({
filePath: data.tempFilePath,
fileType: ['xlsx'],
showMenu: true,
success() {
},
fail(err) {
@@ -193,7 +221,6 @@ Page({
})
},
async onChangePage(e) {
console.log('e', e)
const page = e.detail.currentIndex;
const that = this;
this.setData({
@@ -218,15 +245,44 @@ Page({
alertInfo(message)
return;
}
const first = data?.[0]
this.setData({
meterList: data || [],
meterId: first?.id,
meterAddress: first?.address,
meterCode: first?.code,
}, () => {
const { queryType, } = this.data;
switch(queryType) {
case 1:
loadingFunc(async () => {
await this.getReadingList();
})
break;
case 2:
loadingFunc(async () => {
await this.getAccountingBalanceList();
})
break;
default:
loadingFunc(async () => {
await this.init();
})
break;
}
})
},
clickMeter() {
this.setData({
type: "meter",
columns: [{ id: "", name: "全部", code: "" }, ...this.data.meterList.map(item => ({ id: item.id, name: `${item.code}-${item.address}`, code: item.code }))],
columns: [
// { id: "", name: "全部", code: "" },
...this.data.meterList.map(item => ({
id: item.id,
name: `${item.code}-${item.address}`,
code: item.code,
address: item.address
}))],
show: true,
title: "表计"
})
@@ -240,11 +296,12 @@ Page({
})
},
onOk(e) {
const { id, code } = e.detail.value;
const { id, code, address } = e.detail.value;
this.setData({
// year: currentYear,
meterId: id,
meterCode: code,
meterAddress: address,
type: "",
show: false,
title: ""
@@ -252,13 +309,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;
}
})
@@ -269,32 +333,44 @@ Page({
onTimeCancel() {
this.setData({ visible: false })
},
onTimeConfirm(e) {
const { type, time } = e.detail;
switch(type) {
case "year":
this.setData({ year: time, visible: false, }, () => {
this.init();
loadingFunc(async () => {
await this.getParkInfo()
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.getParkInfo()
await this.init();
})
});
break;
case "day":
console.log('day')
this.setData({
yearMonthDay: time,
yearMonthDayStamp: new Date(time).getTime(),
visible: false,
page: 1,
}, () => {
this.init();
loadingFunc(async () => {
await this.getParkInfo()
await this.init();
})
})
break;
}
},
readingChangeTime(e) {
},
/**
* 生命周期函数--监听页面初次渲染完成
@@ -307,9 +383,39 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getMeters()
},
},
async getParkInfo() {
const park = wx.getStorageSync('park');
const { timeType, yearMonthDay, yearMonth, year } = this.data;
let time = ''
switch(timeType) {
case 0:
time = yearMonthDay;
break;
case 1:
time = yearMonth;
break;
case 2:
time = year;
}
const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id, `${time}`, `${timeType}`,)
if (code !== OK) {
alertInfo(message)
return;
}
const that = this;
return new Promise((resolve) => {
that.setData({
parkInfo: parkInfo
}, () => {
resolve()
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/

View File

@@ -11,7 +11,11 @@
"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",
"van-dialog": "@vant/weapp/dialog/index",
"van-field": "@vant/weapp/field/index",
"reading": "./components/reading/index"
},
"navigationStyle": "custom"
}

View File

@@ -7,7 +7,7 @@
</view>
<view class="select" bind:tap="clickMeter">
<view class="selectContent">
{{ meterCode === "" ? '全部' : meterCode }}
{{ meterAddress === "" ? '-' : meterAddress }}
</view>
<van-icon name="arrow-down" />
</view>
@@ -30,23 +30,25 @@
<view class="timeQuery" wx:if="{{queryType === 0}}">
<van-row>
<van-col span="8">
<view class="timeQueryText" style="color: {{timeType === 0 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{0}}"> 日量 </view>
<view class="timeQueryText" style="color: {{timeType === 0 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{0}}"> 日用电量 </view>
</van-col>
<van-col span="8">
<view class="timeQueryText" style="color: {{timeType === 1 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{1}}"> 月量 </view>
<view class="timeQueryText" style="color: {{timeType === 1 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{1}}"> 月电用量 </view>
</van-col>
<van-col span="8">
<view class="timeQueryText" style="color: {{timeType === 2 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{2}}"> 年量 </view>
<view class="timeQueryText" style="color: {{timeType === 2 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{2}}"> 年用电量 </view>
</van-col>
</van-row>
</view>
</view>
<view wx:if="{{queryType === 0}}">
<view class="tooltip">
不包括线损电量,显示为电表实际消电量。仅供参考,实际能电量以电费账单为主。如有疑问,请联系客服。
不包括线损电量,显示为电表实际消电量。仅供参考,实际能电量以电费账单为主。如有疑问,请联系客服。
</view>
<view class="timeChooseWrapper">
<view> 选择时间 </view>
<view wx:if="{{timeType === 0}}"> 选择时间 </view>
<view wx:elif="{{timeType === 1}}"> 选择日期 </view>
<view wx:else="{{timeType === 2}}"> 选择月份 </view>
<view class="time" bind:tap="clickTime">
<view class="timeText" wx:if="{{timeType === 0}}"> {{yearMonthDay}} </view>
<view class="timeText" wx:elif="{{timeType === 1}}"> {{yearMonth}} </view>
@@ -57,20 +59,23 @@
</view>
</view>
<view wx:elif="{{queryType === 1}}">
<view class="tooltip">
<!-- <view class="tooltip">
显示为最新的一条抄表记录。电表更新数据有延迟,仅供参考,实际以电表上显示为准。
</view>
</view> -->
</view>
<view wx:elif="{{queryType === 2}}">
<view class="tooltip">
账务余额更新时间为:每次预存电费后,每次账单发布后,剩余的实际金额。电表余额与账务余额相差较大的用户,每半年统一处理一次。
账务余额更新时间为:每次预存电费后,每次发布账单后剩余的实际金额。
</view>
<view class="tooltip">
计算公式:账务余额 = 初始余额 + 累充充值金额 - 电费
</view>
</view>
</view>
<view wx:if="{{queryType === 0}}">
<view style="margin: 30rpx;">
<view wx:if="{{list.length}}">
<!-- <view wx:if="{{list.length}}">
<table header="{{header}}" list="{{list}}" />
<pagination
currentIndex="{{page}}"
@@ -79,26 +84,27 @@
wx:if="{{timeType === 0}}"
/>
</view>
<empty bind:refresh="init" wx:else />
<empty bind:refresh="init" wx:else /> -->
<listTable
list="{{list}}"
header="{{header}}"
totalPage="{{totalPage}}"
wx:if="{{parkInfo.category !== 1}}"
/>
<listTable
list="{{list}}"
header="{{valleyHeader}}"
totalPage="{{totalPage}}"
wx:if="{{parkInfo.category === 1}}"
/>
</view>
<view class="sum">
合计:表计数量:{{meterNumber}}电量:{{electricNumber}}
合计:表计数量:{{meterNumber}}电量:{{electricNumber}}
</view>
</view>
<view wx:if="{{queryType === 1}}">
<view style="margin: 30rpx;">
<view wx:if="{{meterReadingList.length}}" >
<table
header="{{meterReadingHeader}}"
list="{{meterReadingList}}"
/>
</view>
<empty bind:refresh="getReadingList" wx:else />
</view>
<reading meter="{{meterId}}" parkInfo="{{parkInfo}}" bind:changeTime="readingChangeTime" />
</view>
<view wx:if="{{queryType === 2}}">
<view style="margin: 30rpx;">
@@ -137,4 +143,5 @@
bind:cancel="onTimeCancel"
bind:close="onTimeClose"
bind:confirm="onTimeConfirm"
/>
/>

View File

@@ -0,0 +1,50 @@
// components/datePicker/index.js
import dayjs from "../../utils/dayjs"
Component({
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
// time: String,
},
// observers: {
// time: function(newValue) {
// if (!newValue) {
// return;
// }
// this.setData({
// currentDate: new Date(newValue).getTime(),
// })
// }
// },
/**
* 组件的初始数据
*/
data: {
currentDate: new Date().getTime(),
maxDate: new Date().getTime(),
minDate: new Date(2024, 1, 1).getTime(),
},
lifetimes: {
attached() {
this.setData({
maxDate: new Date().getTime(),
currentDate: new Date().getTime(),
})
}
},
/**
* 组件的方法列表
*/
methods: {
onCancel() {
this.triggerEvent("cancel")
},
onConfirm(e) {
this.triggerEvent("confirm", { time: dayjs(e.detail).format("YYYY-MM-DD HH:mm:ss") })
}
}
})

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
}
}

View File

@@ -0,0 +1,18 @@
<!--components/datePicker/index.wxml-->
<van-popup
show="{{ show }}"
position="bottom"
bind:close="onClose"
z-index="10000"
>
<van-datetime-picker
type="datetime"
value="{{ currentDate }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
bind:confirm="onConfirm"
bind:cancel="onCancel"
/>
</van-popup>

View File

@@ -0,0 +1 @@
/* components/datePicker/index.wxss */

View File

@@ -0,0 +1,31 @@
// components/Segmented/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
list: Array,
active: Number,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
handleChange(e) {
const { index } = e.currentTarget.dataset;
if (index === this.data.active) {
return;
}
this.triggerEvent("change", { index, name: this.data.list[index] })
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,12 @@
<!--components/Segmented/index.wxml-->
<view style="margin: 10rpx 20rpx">
<view
wx:for="{{list}}"
wx:key="index"
class="item {{index === active ? 'active' : ''}}"
bind:tap="handleChange"
data-index="{{index}}"
>
{{ item }}
</view>
</view>

View File

@@ -0,0 +1,19 @@
/* components/Segmented/index.wxss */
.item {
display: inline-block;
padding: 20rpx;
border: 1rpx solid #ccc;
border-right: 0rpx;
font-size: 32rpx;
min-width: 140rpx;
text-align: center;
}
.item:nth-last-child(1) {
border-right: 1rpx solid #ccc;
}
.active {
background-color: var(--middle-green);
}

89
components/aid/index.js Normal file
View File

@@ -0,0 +1,89 @@
import { getAidList } from "../../service/system";
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request;
// components/aid/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
type: Number,
bannerType: Number,
},
lifetimes: {
attached() {
this.init();
}
},
/**
* 组件的初始数据
*/
data: {
park: {},
list: [],
total: 0,
page: 1,
size: 20,
},
lifetimes: {
attached() {
loadingFunc(async () => {
await this.init();
})
}
},
/**
* 组件的方法列表
*/
methods: {
async init() {
const { type, page, size } = this.data;
const { code, message, data = [], total } = await getAidList(page, size, type);
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
list: data,
total,
totalPage: Math.ceil(total / size)
})
},
onRefresh() {
const that = this;
this.setData({
page: 1,
}, () => {
that.init();
})
},
jumpToDetail(e) {
const { id = "" } = e.currentTarget.dataset;
const { type } = this.data;
wx.navigateTo({
url: `/pages/aid/detail/index?id=${id}&type=${type}`,
})
},
consult(e) {
const { id = "" } = e.currentTarget.dataset;
const { type } = this.data;
wx.navigateTo({
url: `/pages/aid/consult/index?id=${id}&type=${type}`,
})
},
async onChangePage(e) {
const page = e.detail.currentIndex;
const that = this;
this.setData({
page
}, () => {
that.init();
})
},
}
})

10
components/aid/index.json Normal file
View File

@@ -0,0 +1,10 @@
{
"component": true,
"usingComponents": {
"Banner": "/components/banner/index",
"van-image": "@vant/weapp/image/index",
"empty": "/components/empty/index",
"van-icon": "@vant/weapp/icon/index",
"pagination": "/components/pagination/index"
}
}

36
components/aid/index.wxml Normal file
View File

@@ -0,0 +1,36 @@
<!--components/aid/index.wxml-->
<Banner park="{{park.id}}" type="{{bannerType}}" />
<div class="title">行业精英</div>
<view wx:if="{{list.length}}">
<view wx:for="{{list}}" wx:key="id" >
<view class="userInfoItem" bind:tap="jumpToDetail" data-id="{{item.id}}">
<view class="content">
<van-image
width="200rpx"
height="200rpx"
lazy-load
src="{{item.avatar}}"
/>
<view class="userInfo">
<view style="display: flex;font-size: 30rpx;">
<view class="userName"> {{ item.name }} </view>
<view class="userLevel"> {{ item.level }} </view>
</view>
<view class="synopsis"> {{item.synopsis}}{{item.synopsis}} {{item.synopsis}} </view>
<view class="connect" >
<view style="display: flex; align-items: center;" catch:tap="consult" data-id="{{item.id}}">
<van-icon name="service-o" color="#1989fa" />
<view style="margin-left: 10rpx;color: #1989fa;"> 在线咨询 </view>
</view>
</view>
</view>
</view>
</view>
</view>
<pagination
currentIndex="{{page}}"
totalPage="{{totalPage}}"
bind:pagingChange="onChangePage"
/>
</view>
<empty wx:else bind:refresh="onRefresh" />

58
components/aid/index.wxss Normal file
View File

@@ -0,0 +1,58 @@
/* components/aid/index.wxss */
.title {
padding-top: 30rpx;
padding-left: 30rpx;
display: flex;
}
.userInfoItem {
padding: 30rpx;
}
.userInfoItem .content {
display: flex;
align-items: center;
border-bottom: 1rpx solid #ccc;
}
.userInfo {
height: 200rpx;
margin-left: 30rpx;
flex: 1;
}
.userLevel {
margin-left: 30rpx;
font-weight: 600;
}
.synopsis {
height: 75rpx;
overflow: hidden;
margin-top: 20rpx;
margin-bottom: 10rpx;
font-size: 32rpx;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.connect {
display: flex;
justify-content: flex-end;
}
.userName {
width: 150rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.userLevel {
width: 250rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

View File

@@ -1,7 +1,7 @@
/* components/avatar/index.wxss */
.wrapper {
width: 120rpx;
height: 120rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
background: radial-gradient(circle, var(--light-green), var(--middle-green),var(--deep-green) );
display: flex;

View File

@@ -0,0 +1,74 @@
import { getBannerList } from "../../service/system"
import { alertInfo } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request;
const result = wx.getAccountInfoSync();
const { envVersion } = result.miniProgram;
// pages/home/components/home-swiper/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
park: String,
type: Number,
},
observers: {
'park,type': function(newPark, newType) {
if ((!newPark && newType === 0) || (!newType && newType !== 0)) {
return
}
this.init(newPark, newType)
}
},
/**
* 组件的初始数据
*/
data: {
indicatorDots: true,
vertical: false,
autoplay: true,
interval: 6000,
duration: 500,
list: [],
},
/**
* 组件的方法列表
*/
methods: {
async init(park, type) {
const { code, message, data = [] } = await getBannerList(park, type);
if (code !== OK) {
alertInfo(message);
this.setData({ list: [], park, type })
return
}
this.setData({ list: data })
},
handleJump(e) {
const { data = {} } = e.currentTarget.dataset;
switch(data.jumpType) {
case 1:
wx.navigateToMiniProgram({
appId: data.appid,
path: data.wxPath,
envVersion: envVersion
})
break;
case 2:
wx.navigateTo({
url: data.value,
})
break;
case 3:
wx.navigateTo({
url: '/pages/webPage/index?path=' + data.value,
})
break;
}
}
}
})

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"van-image": "@vant/weapp/image/index"
}
}

View File

@@ -0,0 +1,23 @@
<!--pages/home/components/home-swiper/index.wxml-->
<swiper
indicator-dots="{{list.length > 1}}"
autoplay="{{autoplay}}"
interval="{{interval}}"
duration="{{duration}}"
circular="{{true}}"
wx:if="{{list.length}}"
style="height: 288rpx"
>
<block wx:for="{{list}}" wx:key="id" wx:item="item">
<swiper-item>
<van-image
width="100%"
height="100%"
lazy-load
src="{{item.url}}"
data-data="{{item}}"
bind:click="handleJump"
/>
</swiper-item>
</block>
</swiper>

View File

@@ -0,0 +1 @@
/* pages/home/components/home-swiper/index.wxss */

View File

@@ -0,0 +1,76 @@
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index"
import { redeemCoupons } from "../../service/system";
import request from "../../utils/request"
const { OK } = request;
// components/discountCoupon/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
type: Number,
data: Object
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
handleChange() {
const { data } = this.data;
const that = this;
loadingFunc(async () => {
const { code, message } = await redeemCoupons({ id: data.id, type: 2 })
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("兑换成功")
that.triggerEvent("change", { id, type: 2 })
})
},
showRemark() {
wx.showModal({
title: '备注',
content: this.data?.data?.remark,
showCancel: false,
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
}
}
})
},
handleUseIt() {
alertInfo("敬请期待")
},
async handleUse() {
const { data } = this.data;
const that = this;
loadingFunc(async () => {
const { code, message } = await redeemCoupons({ id: data.id, type: 2 })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("领取成功")
that.triggerEvent("get", { id, type: 1 })
})
}
}
})

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"van-button": "@vant/weapp/button/index",
"van-dialog": "@vant/weapp/dialog/index"
}
}

View File

@@ -0,0 +1,39 @@
<!--components/discountCoupon/index.wxml-->
<view class="wrapper">
<view class="top">
<view class="left">
<view class="typeText">
<text wx:if="{{data.type === 0}}"> 通用优惠券 </text>
<text wx:if="{{data.type === 1}}"> 无门槛优惠券 </text>
<text wx:if="{{data.type === 2}}"> 满减券 </text>
</view>
<view class="time">
有效期至 {{ data.endTime }}
</view>
</view>
<view class="right">
<view class="price">
<text style="font-size: 26rpx;line-height: 26rpx;"> ¥ </text>
<view class="number" wx:if="{{data.discount > 0}}"> {{ data.discount }} 折 </view>
<view class="number" wx:elif="{{data.discountMoney > 0}}"> {{ data.discountMoney }} 元 </view>
<view wx:else> - </view>
</view>
<view class="limit">
满 {{ data.useMin }} 可用
</view>
</view>
</view>
<view class="bottom">
<view class="left" bind:tap="showRemark">
{{data.remark}}
</view>
<view class="right">
<van-button wx:if="{{type === 1}}" type="info" size="small" bind:tap="handleUse">去领取</van-button>
<van-button wx:if="{{type === 2}}" type="info" size="small" bind:tap="handleChange">去兑换</van-button>
<van-button wx:if="{{type === 3}}" type="info" size="small" bind:tap="handleUseIt">去使用</van-button>
</view>
</view>
</view>
<van-dialog id="van-dialog" />

View File

@@ -0,0 +1,60 @@
/* components/discountCoupon/index.wxss */
.wrapper {
padding: 24rpx;
border-radius: 16rpx;
background-color: #fff;
}
.top {
display: flex;
justify-content: space-between;
border-bottom: 1rpx dashed #ccc;
padding-bottom: 30rpx;
}
.top .right {
color: #fa541c;
}
.price {
display: flex;
align-items: flex-end;
margin-bottom: 14rpx;
}
.typeText {
font-weight: 700;
font-size: 36rpx;
margin-bottom: 20rpx;
}
.time {
font-size: 30rpx;
}
.price {
font-size: 44rpx;
line-height: 44rpx;
}
.limit {
font-size: 30rpx;
}
.bottom {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.bottom .left {
flex: 1;
max-width: calc(100vw - 60rpx - 250rpx);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 30rpx;
color: rgba(0, 0, 0, 0.7)
}

View File

@@ -0,0 +1,8 @@
"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}/*!
* mp-html v2.5.0
* https://github.com/jin-yufeng/mp-html
*
* Released under the MIT license
* Author: Jin Yufeng
*/
var t=require("./parser"),n=[];Component({data:{nodes:[]},properties:{containerStyle:String,content:{type:String,value:"",observer:function(e){this.setContent(e)}},copyLink:{type:Boolean,value:!0},domain:String,errorImg:String,lazyLoad:Boolean,loadingImg:String,pauseVideo:{type:Boolean,value:!0},previewImg:{type:null,value:!0},scrollTable:Boolean,selectable:null,setTitle:{type:Boolean,value:!0},showImgMenu:{type:Boolean,value:!0},tagStyle:Object,useAnchor:null},created:function(){this.plugins=[];for(var e=n.length;e--;)this.plugins.push(new n[e](this))},detached:function(){this._hook("onDetached")},methods:{in:function(e,t,n){e&&t&&n&&(this._in={page:e,selector:t,scrollTop:n})},navigateTo:function(t,n){var i=this;return new Promise(function(o,r){if(!i.data.useAnchor)return void r(Error("Anchor is disabled"));var a=wx.createSelectorQuery().in(i._in?i._in.page:i).select((i._in?i._in.selector:"._root")+(t?"".concat(">>>","#").concat(t):"")).boundingClientRect();i._in?a.select(i._in.selector).scrollOffset().select(i._in.selector).boundingClientRect():a.selectViewport().scrollOffset(),a.exec(function(t){if(!t[0])return void r(Error("Label not found"));var a=t[1].scrollTop+t[0].top-(t[2]?t[2].top:0)+(n||parseInt(i.data.useAnchor)||0);i._in?i._in.page.setData(e({},i._in.scrollTop,a)):wx.pageScrollTo({scrollTop:a,duration:300}),o()})})},getText:function(e){var t="";return function e(n){for(var i=0;i<n.length;i++){var o=n[i];if("text"===o.type)t+=o.text.replace(/&amp;/g,"&");else if("br"===o.name)t+="\n";else{var r="p"===o.name||"div"===o.name||"tr"===o.name||"li"===o.name||"h"===o.name[0]&&o.name[1]>"0"&&o.name[1]<"7";r&&t&&"\n"!==t[t.length-1]&&(t+="\n"),o.children&&e(o.children),r&&"\n"!==t[t.length-1]?t+="\n":"td"!==o.name&&"th"!==o.name||(t+="\t")}}}(e||this.data.nodes),t},getRect:function(){var e=this;return new Promise(function(t,n){wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function(e){return e[0]?t(e[0]):n(Error("Root label not found"))})})},pauseMedia:function(){for(var e=(this._videos||[]).length;e--;)this._videos[e].pause()},setPlaybackRate:function(e){this.playbackRate=e;for(var t=(this._videos||[]).length;t--;)this._videos[t].playbackRate(e)},setContent:function(e,n){var i=this;this.imgList&&n||(this.imgList=[]),this._videos=[];var o={},r=new t(this).parse(e);if(n)for(var a=this.data.nodes.length,s=r.length;s--;)o["nodes[".concat(a+s,"]")]=r[s];else o.nodes=r;if(this.setData(o,function(){i._hook("onLoad"),i.triggerEvent("load")}),this.data.lazyLoad||this.imgList._unloadimgs<this.imgList.length/2){var l=0,c=function e(t){t&&t.height||(t={}),t.height===l?i.triggerEvent("ready",t):(l=t.height,setTimeout(function(){i.getRect().then(e).catch(e)},350))};this.getRect().then(c).catch(c)}else this.imgList._unloadimgs||this.getRect().then(function(e){i.triggerEvent("ready",e)}).catch(function(){i.triggerEvent("ready",{})})},_hook:function(e){for(var t=n.length;t--;)this.plugins[t][e]&&this.plugins[t][e]()},_add:function(e){e.detail.root=this}}});

View File

@@ -0,0 +1 @@
{"component":true,"usingComponents":{"node":"./node/node"}}

View File

@@ -0,0 +1 @@
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}"><slot wx:if="{{!nodes[0]}}"/><node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg,showImgMenu,selectable]}}" catchadd="_add"/></view>

View File

@@ -0,0 +1 @@
._root{padding:1px 0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}._select{-webkit-user-select:text;user-select:text}

View File

@@ -0,0 +1 @@
"use strict";function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function e(e){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?t(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Component({data:{ctrl:{},isiOS:wx.getSystemInfoSync().system.includes("iOS")},properties:{childs:Array,opts:Array},options:{addGlobalClass:!0},attached:function(){this.triggerEvent("add",this,{bubbles:!0,composed:!0})},methods:{noop:function(){},getNode:function(t){try{for(var e=t.split("_"),r=this.data.childs[e[0]],i=1;i<e.length;i++)r=r.children[e[i]];return r}catch(t){return{text:"",attrs:{},children:[]}}},play:function(t){var r=t.target.dataset.i,i=this.getNode(r);if(this.root.triggerEvent("play",{source:i.name,attrs:e(e({},i.attrs),{},{src:i.src[this.data.ctrl[r]||0]})}),this.root.data.pauseVideo){for(var o=!1,s=t.target.id,a=this.root._videos.length;a--;)this.root._videos[a].id===s?o=!0:this.root._videos[a].pause();if(!o){var n=wx.createVideoContext(s,this);n.id=s,this.root.playbackRate&&n.playbackRate(this.root.playbackRate),this.root._videos.push(n)}}},imgTap:function(t){var e=this.getNode(t.target.dataset.i);if(e.a)return this.linkTap(e.a);if(!e.attrs.ignore&&(this.root.triggerEvent("imgtap",e.attrs),this.root.data.previewImg)){var r=this.root.imgList[e.i];wx.previewImage({showmenu:this.root.data.showImgMenu,current:r,urls:this.root.imgList})}},imgLoad:function(t){var e,i=t.target.dataset.i,o=this.getNode(i);o.w?(this.data.opts[1]&&!this.data.ctrl[i]||-1===this.data.ctrl[i])&&(e=1):e=t.detail.width,e&&this.setData(r({},"ctrl."+i,e)),this.checkReady()},checkReady:function(){var t=this;this.root.data.lazyLoad||(this.root.imgList._unloadimgs-=1,this.root.imgList._unloadimgs||setTimeout(function(){t.root.getRect().then(function(e){t.root.triggerEvent("ready",e)}).catch(function(){t.root.triggerEvent("ready",{})})},350))},linkTap:function(t){var e=t.currentTarget?this.getNode(t.currentTarget.dataset.i):{},r=e.attrs||t,i=r.href;this.root.triggerEvent("linktap",Object.assign({innerText:this.root.getText(e.children||[])},r)),i&&("#"===i[0]?this.root.navigateTo(i.substring(1)).catch(function(){}):i.split("?")[0].includes("://")?this.root.data.copyLink&&wx.setClipboardData({data:i,success:function(){return wx.showToast({title:"链接已复制"})}}):wx.navigateTo({url:i,fail:function(){wx.switchTab({url:i,fail:function(){}})}}))},mediaError:function(t){var e=t.target.dataset.i,i=this.getNode(e);if("video"===i.name||"audio"===i.name){var o=(this.data.ctrl[e]||0)+1;if(o>i.src.length&&(o=0),o<i.src.length)return this.setData(r({},"ctrl."+e,o))}else"img"===i.name&&(this.data.opts[2]&&this.setData(r({},"ctrl."+e,-1)),this.checkReady());this.root&&this.root.triggerEvent("error",{source:i.name,attrs:i.attrs,errMsg:t.detail.errMsg})}}});

View File

@@ -0,0 +1 @@
{"component":true,"usingComponents":{"node":"./node"}}

View File

@@ -0,0 +1 @@
<wxs module="isInline">var e={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};module.exports=function(n,i){return e[n]||-1!==(i||"").indexOf("inline")};</wxs><template name="el"><block wx:if="{{n.name==='img'}}"><rich-text wx:if="{{n.t}}" style="display:{{n.t}}" nodes="<img class='_img' style='{{n.attrs.style}}' src='{{n.attrs.src}}'>" data-i="{{i}}" catchtap="imgTap"/><block wx:else><image wx:if="{{(opts[1]&&!ctrl[i])||ctrl[i]<0}}" class="_img" style="{{n.attrs.style}}" src="{{ctrl[i]<0?opts[2]:opts[1]}}" mode="widthFix"/><image id="{{n.attrs.id}}" class="_img {{n.attrs.class}}" style="{{ctrl[i]===-1?'display:none;':''}}width:{{ctrl[i]||1}}px;height:1px;{{n.attrs.style}}" src="{{n.attrs.src}}" mode="{{!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))}}" lazy-load="{{opts[0]}}" webp="{{n.webp}}" show-menu-by-longpress="{{opts[3]&&!n.attrs.ignore}}" data-i="{{i}}" bindload="imgLoad" binderror="mediaError" catchtap="imgTap" bindlongpress="noop"/></block></block><text wx:elif="{{n.text}}" user-select="{{opts[4]=='force'&&isiOS}}" decode>{{n.text}}</text><text wx:elif="{{n.name==='br'}}">\n</text><view wx:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline;{{n.attrs.style}}" data-i="{{i}}" catchtap="linkTap"><node childs="{{n.children}}" opts="{{opts}}" style="display:inherit"/></view><video wx:elif="{{n.name==='video'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" autoplay="{{n.attrs.autoplay}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" muted="{{n.attrs.muted}}" object-fit="{{n.attrs['object-fit']}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><audio wx:elif="{{n.name==='audio'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><rich-text wx:else id="{{n.attrs.id}}" style="{{n.f}}" user-select="{{opts[4]}}" nodes="{{[n]}}"/></template><block wx:for="{{childs}}" wx:for-item="n1" wx:for-index="i1" wx:key="i1"><template wx:if="{{!n1.c&&(!n1.children||n1.name==='a'||!isInline(n1.name,n1.attrs.style))}}" is="el" data="{{n:n1,i:''+i1,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n1.attrs.id}}" class="_{{n1.name}} {{n1.attrs.class}}" style="{{n1.attrs.style}}"><block wx:for="{{n1.children}}" wx:for-item="n2" wx:for-index="i2" wx:key="i2"><template wx:if="{{!n2.c&&(!n2.children||n2.name==='a'||!isInline(n2.name,n2.attrs.style))}}" is="el" data="{{n:n2,i:i1+'_'+i2,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n2.attrs.id}}" class="_{{n2.name}} {{n2.attrs.class}}" style="{{n2.attrs.style}}"><block wx:for="{{n2.children}}" wx:for-item="n3" wx:for-index="i3" wx:key="i3"><template wx:if="{{!n3.c&&(!n3.children||n3.name==='a'||!isInline(n3.name,n3.attrs.style))}}" is="el" data="{{n:n3,i:i1+'_'+i2+'_'+i3,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n3.attrs.id}}" class="_{{n3.name}} {{n3.attrs.class}}" style="{{n3.attrs.style}}"><block wx:for="{{n3.children}}" wx:for-item="n4" wx:for-index="i4" wx:key="i4"><template wx:if="{{!n4.c&&(!n4.children||n4.name==='a'||!isInline(n4.name,n4.attrs.style))}}" is="el" data="{{n:n4,i:i1+'_'+i2+'_'+i3+'_'+i4,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n4.attrs.id}}" class="_{{n4.name}} {{n4.attrs.class}}" style="{{n4.attrs.style}}"><block wx:for="{{n4.children}}" wx:for-item="n5" wx:for-index="i5" wx:key="i5"><template wx:if="{{!n5.c&&(!n5.children||n5.name==='a'||!isInline(n5.name,n5.attrs.style))}}" is="el" data="{{n:n5,i:i1+'_'+i2+'_'+i3+'_'+i4+'_'+i5,opts:opts,ctrl:ctrl}}"/><node wx:else id="{{n5.attrs.id}}" class="_{{n5.name}} {{n5.attrs.class}}" style="{{n5.attrs.style}}" childs="{{n5.children}}" opts="{{opts}}"/></block></view></block></view></block></view></block></view></block>

View File

@@ -0,0 +1 @@
._a{padding:1.5px 0 1.5px 0;color:#366092;word-break:break-all}._hover{text-decoration:underline;opacity:.7}._img{max-width:100%;-webkit-touch-callout:none}._b,._strong{font-weight:700}._code{font-family:monospace}._del{text-decoration:line-through}._em,._i{font-style:italic}._h1{font-size:2em}._h2{font-size:1.5em}._h3{font-size:1.17em}._h5{font-size:.83em}._h6{font-size:.67em}._h1,._h2,._h3,._h4,._h5,._h6{display:block;font-weight:700}._ins{text-decoration:underline}._li{display:list-item}._ol{list-style-type:decimal}._ol,._ul{display:block;padding-left:40px;margin:1em 0}._q::before{content:'"'}._q::after{content:'"'}._sub{font-size:smaller;vertical-align:sub}._sup{font-size:smaller;vertical-align:super}._tbody,._tfoot,._thead{display:table-row-group}._tr{display:table-row}._td,._th{display:table-cell;vertical-align:middle}._th{font-weight:700;text-align:center}._ul{list-style-type:disc}._ul ._ul{margin:0;list-style-type:circle}._ul ._ul ._ul{list-style-type:square}._abbr,._b,._code,._del,._em,._i,._ins,._label,._q,._span,._strong,._sub,._sup{display:inline}._blockquote,._div,._p{display:block}

File diff suppressed because one or more lines are too long

View File

@@ -7,6 +7,7 @@ Component({
properties: {
title: String,
canBack: Boolean,
beforeBack: Function,
},
/**
@@ -34,7 +35,11 @@ Component({
* 组件的方法列表
*/
methods: {
back() {
async back() {
const { beforeBack } = this;
if (beforeBack) {
await beforeBack();
}
wx.navigateBack();
}
}

View File

@@ -90,7 +90,6 @@ Component({
},
//更改页码点击事件
onChangePage: function (e) {
//console.log("更改页码事件:",e);
this.setData({
pageMask: false,
index: e.currentTarget.dataset.index //点击的页数

View File

@@ -9,7 +9,7 @@
<view class="page-mask" bindtap="hidePagePopup"></view>
<view class="page-popup">
<view class="page-popup-box">
<view class="page-line" wx:for="{{total}}" wx:for-index="idx" data-index="{{idx+1}}" bindtap="changePage">第{{item+1}}页</view>
<view class="page-line" wx:for="{{total}}" wx:key="index" wx:for-index="idx" data-index="{{idx+1}}" bindtap="changePage">第{{item+1}}页</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,166 @@
import { getLoginParkList, getParkBuildingList } from "../../service/park"
import { getParkSimpleMeterList } from "../../service/meter"
import { alertInfo } from "../../utils/index";
import request from "../../utils/request"
import { payWays, feeType } from "../../utils/data";
import { getTenementList, getWxTenementList } from "../../service/tenement";
const { OK } = request;
// components/searchSelect/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: String,
type: String,
show: Boolean,
park: String,
isBack: Boolean,
filterBind: Boolean,
},
observers: {
"show,type,filterBind": function(newShow, newType) {
if (newShow && newType) {
this.onSearch()
}
}
},
/**
* 组件的初始数据
*/
data: {
columns: [],
searchText: "",
payWays,
feeType,
},
lifetimes: {
attached() {
}
},
/**
* 组件的方法列表
*/
methods: {
onChangeSearch(e) {
this.setData({
searchText: e.detail,
})
},
onCancel() {
this.setData({
columns: [],
list: [],
searchText: ""
})
this.triggerEvent("cancel")
},
onConfirm(event) {
const { index } = event.detail;
const { list = [], type } = this.data;
const item = list[index];
if (!item) {
alertInfo("请选择一项")
return
}
this.setData({
columns: [],
list: [],
searchText: ""
})
this.triggerEvent("confirm", { data: item, type } );
},
onPayConfirm(event) {
const { index } = event.detail;
const { payWays = [], type } = this.data;
const item = payWays[index];
this.setData({
columns: [],
list: [],
searchText: ""
})
this.triggerEvent("confirm", { data: item, way: index, type } );
},
onFeeTypeConfirm(event) {
const { index } = event.detail;
const { feeType = [], type } = this.data;
const item = feeType[index];
this.setData({
columns: [],
list: [],
searchText: ""
})
this.triggerEvent("confirm", { data: item, way: index, type } );
},
onSearch() {
const { type, bind, filterBind } = this.data;
switch(type) {
case "park":
this.onSearchPark();
return;
case "meter":
this.onSearchMeter();
return
case "tenement":
this.onSearchTenement();
return;
case "building":
this.onSearchBuilding();
return;
}
},
async onSearchPark() {
const { searchText = "" } = this.data;
const { code, message, data: parks = [] } = await getLoginParkList({keyword: searchText});
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
columns: parks?.map(item => item?.name),
list: parks,
})
},
async onSearchMeter() {
const { searchText = "", park, filterBind } = this.data;
const { code, message, data: parks = [] } = await getParkSimpleMeterList({keyword: searchText, park, isNeedBind: !filterBind});
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`) || [],
list: parks || [],
})
},
async onSearchTenement() {
const { searchText = "", park, isBack } = this.data;
const { code, message, data = [] } = isBack ? await getWxTenementList({keyword: searchText, park}) : await getTenementList({keyword: searchText, park});
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
columns: data?.length ? data?.map(item => item?.name) : [],
list: data,
})
},
async onSearchBuilding() {
const { park } = this.data;
const { code, message, buildings: data = [] } = await getParkBuildingList(park);
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
columns: data?.length ? data?.map(item => item?.name) : [],
list: data,
})
},
}
})

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-search": "@vant/weapp/search/index"
}
}

View File

@@ -0,0 +1,62 @@
<!--components/searchSelect/index.wxml-->
<van-popup
show="{{ show }}"
bind:click="onClickHide"
position="bottom"
z-index="100000"
wx:if="{{show}}"
>
<view wx:if="{{type === 'pay'}}">
<van-picker
custom-style="width: 100%;"
columns="{{ payWays }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onPayConfirm"
/>
</view>
<view wx:elif="{{type === 'feeType'}}">
<van-picker
custom-style="width: 100%;"
columns="{{ feeType }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onFeeTypeConfirm"
/>
</view>
<view wx:elif="{{type !== 'pay'}}">
<van-search
value="{{ value }}"
placeholder="{{type === 'tenement' ? '请输入关键词搜索后选择' : '请输入搜索关键词'}}"
use-action-slot
bind:change="onChangeSearch"
>
<view
style="margin-left: 20rpx; margin-right: 20rpx"
slot="action"
bind:tap="onSearch"
>搜索</view>
</van-search>
<van-picker
custom-style="width: 100%;"
columns="{{ columns }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onConfirm"
/>
</view>
<view wx:else>
<van-picker
custom-style="width: 100%;"
columns="{{ columns }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onConfirm"
/>
</view>
</van-popup>

View File

@@ -0,0 +1 @@
/* components/searchSelect/index.wxss */

View File

@@ -0,0 +1,48 @@
// components/searchSelectWrapper/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
label: String,
placeholder: String,
text: String,
fieldType: {
type: String,
value: "text"
},
type: {
type: String,
value: "select"
}
},
/**
* 组件的初始数据
*/
data: {
keyword: "",
text: "",
},
/**
* 组件的方法列表
*/
methods: {
onSearch() {
this.triggerEvent("search")
},
onChangeKeyword(e) {
this.setData({ keyword: e.detail });
},
onChangeText(e) {
this.setData({ text: e.detail });
this.triggerEvent("changeText", e.detail)
},
onSearchKeyword() {
this.triggerEvent("searchKeyword", this.data.keyword)
this.setData({ keyword: "" })
}
}
})

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-button": "@vant/weapp/button/index",
"van-field": "@vant/weapp/field/index"
}
}

View File

@@ -0,0 +1,35 @@
<!--components/searchSelectWrapper/index.wxml-->
<view class="wrapper" wx:if="{{type === 'select'}}">
<view class="label"> {{ label }} </view>
<view class="content" bind:tap="clickTime" bind:tap="onSearch">
<view class="text" wx:if="{{!text}}" style="color: #ccc;"> {{placeholder}} </view>
<view class="text" wx:else> {{text}} </view>
<van-icon name="arrow-down" />
</view>
</view>
<view class="wrapper" wx:if="{{type === 'inputSearch'}}">
<view class="label"> {{ label }} </view>
<view class="inputContent" bind:tap="clickTime">
<van-field
value="{{ value }}"
placeholder="{{placeholder}}"
border="{{ false }}"
bind:change="onChangeKeyword"
custom-style="padding: 0;font-size: 30rpx;line-height: 32rpx;"
/>
</view>
<van-button type="info" size="small" bind:click="onSearchKeyword"> 搜索 </van-button>
</view>
<view class="wrapper" wx:if="{{type === 'input'}}">
<view class="label"> {{ label }} </view>
<view class="inputContent" bind:tap="clickTime">
<van-field
value="{{ value }}"
placeholder="{{placeholder}}"
border="{{ false }}"
type="fieldType"
bind:change="onChangeText"
custom-style="padding: 0;font-size: 30rpx;line-height: 32rpx;"
/>
</view>
</view>

View File

@@ -0,0 +1,37 @@
/* components/searchSelectWrapper/index.wxss */
.wrapper {
display: flex;
align-items: center;
font-size: 30rpx;
padding: 20rpx;
}
.content {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 10rpx 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.inputContent {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 0 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.text {
flex: 1;
}
.label {
width: 120rpx;
}

View File

@@ -1,4 +1,4 @@
import { getParkList } from "../../service/park";
import { getLoginParkList } from "../../service/park";
import { getTenementList } from "../../service/tenement";
import request from '../../utils/request'
@@ -32,7 +32,7 @@ Component({
async onInput(e) {
switch(this.data.type) {
case 0:
const { data = [], code, message } = await getParkList({ keyword: e.detail });
const { data = [], code, message } = await getLoginParkList({ keyword: e.detail });
this.setData({
list: data,
visible: true,

View File

@@ -27,6 +27,9 @@ Component({
type: String,
value: '#d6e8ff'
},
topColor: String,
topStyle: String,
bodyStyle: String,
maxLine: {
type: Number,
value: 2

View File

@@ -8,12 +8,19 @@
</wxs>
<scroll-view hidden="{{!showList.length||!showHeader.length}}" scroll-x class="table1-view" style="--max_line:{{maxLine}};--width:{{getTableWidth(tableWidth)}}">
<view class="table1 d-table table-class">
<view class="d-table-row tr-class">
<view class="d-table-cell th-class" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
<view class="d-table-row tr-class" style="{{topColor ? 'background-color: rgb(242,248,246)' : ''}}">
<view class="d-table-cell th-class" style="{{topStyle}}" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
</view>
<view bindtap="onTap" data-index="{{index}}" bindlongpress="onLongPress" class="tr-class d-table-row {{currentIndex===index?'active':''}} {{index%2===0?'tr-class_even':'tr-class_odd'}}" wx:for="{{showList}}" wx:key="index">
<view class="d-table-cell td-class " wx:for="{{showHeader}}" wx:for-item="head" wx:for-index="hindex" wx:key="hindex" style="background-color: {{item[head.key].bg}};color:{{item[head.key].color}}">
<view class="text">
<view
class="d-table-cell td-class"
wx:for="{{showHeader}}"
wx:for-item="head"
wx:for-index="hindex"
wx:key="hindex"
style="background-color: {{item[head.key].bg}};color:{{item[head.key].color}}"
>
<view class="text" style="{{bodyStyle}}">
{{item[head.key].text}}
</view>
</view>

View File

@@ -23,6 +23,7 @@ Component({
year: String,
month: Number,
day: Number,
currentDate: Number,
},
/**
* 组件的初始数据

117
pages/aid/consult/index.js Normal file
View File

@@ -0,0 +1,117 @@
import { askAid } from "../../../service/system";
import dayjs from "../../../utils/dayjs";
import { alertInfo, alertSuccess, isValidPhoneNumber, loadingFunc } from "../../../utils/index";
import request from '../../../utils/request'
const { OK } = request
// pages/aid/consult/index.js
Page({
/**
* 页面的初始数据
*/
data: {
form: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { id, type } = options;
this.setData({ type: Number(type), id });
},
onChange(e) {
const data = e.detail;
const { name } = e.currentTarget.dataset
const { form } = this.data;
form[name] = data;
this.setData({
form,
})
},
back() {
wx.navigateBack()
},
async submit() {
const { form } = this.data;
const { name, phone, detail } = form;
if (!name) {
alertInfo("请输入名字")
return;
}
if (!phone) {
alertInfo("请输入手机号")
return;
}
if (phone && !isValidPhoneNumber(phone)) {
alertInfo("手机号格式不正确")
return
}
if (!detail) {
alertInfo("请输入详情")
return
}
const that = this;
loadingFunc(async () => {
const { type, id } = that.data;
const { code, message } = await askAid({ ...form, type, createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), connectId: id })
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("创建成功")
setTimeout(() => {
wx.navigateBack();
}, 500)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,8 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,50 @@
<!--pages/aid/consult/index.wxml-->
<navigator title="填写咨询信息" canBack="{{true}}" />
<van-cell-group>
<van-field
value="{{form.name}}"
label="名字"
placeholder="请输入名字"
bind:change="onChange"
data-name="name"
title-width="140rpx"
required
/>
<van-field
value="{{form.phone}}"
label="手机号"
bind:change="onChange"
data-name="phone"
placeholder="请输入手机号"
required
title-width="140rpx"
/>
<van-field
value="{{form.email}}"
label="邮箱"
bind:change="onChange"
data-name="email"
placeholder="请输入邮箱"
title-width="140rpx"
/>
<van-field
value="{{form.detail}}"
label="咨询内容"
bind:change="onChange"
data-name="detail"
required
type="textarea"
autosize="{{true}}"
placeholder="请输入咨询内容"
title-width="140rpx"
/>
<view style="margin-top: 20rpx; margin-left: 30rpx;">
<mp-html content="{{detail.detail}}" />
</view>
</van-cell-group>
<view class="submit">
<van-button block class="cancelEdit" bind:click="back">返回</van-button>
<van-button type="info" block class="save" bind:click="submit">保存</van-button>
</view>

View File

@@ -0,0 +1,17 @@
/* pages/aid/consult/index.wxss */
.submit {
margin: 40rpx;
margin-bottom: 50rpx;
display: flex;
align-items: center;
}
.cancelEdit, .save {
flex: 1;
}
.cancelEdit {
margin-right: 40rpx;
}

95
pages/aid/detail/index.js Normal file
View File

@@ -0,0 +1,95 @@
import { getAidDetail } from "../../../service/system";
import { alertInfo, loadingFunc } from "../../../utils/index";
import request from "../../../utils/request"
const { OK } = request;
// pages/aid/detail/index.js
Page({
/**
* 页面的初始数据
*/
data: {
detail: {},
id: "",
type: undefined,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const that = this;
const { type, id } = options;
this.setData({ type, id }, () => {
loadingFunc(async () => {
that.init();
})
})
},
async init() {
const { id, type } = this.data;
const { code, message, data = {} } = await getAidDetail(id);
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
detail: data
})
},
connect() {
const { type, id } = this.data;
wx.navigateTo({
url: `/pages/aid/consult/index?type=${type}&id=${id}`,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,10 @@
{
"usingComponents": {
"aid": "/components/aid/index",
"navigator": "/components/navigator/index",
"mp-html": "/components/mp-html/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,53 @@
<!--pages/aid/detail/index.wxml-->
<navigator title="详情" canBack="{{true}}" />
<van-cell-group>
<van-field
value="{{detail.name}}"
label="名字"
readonly
autosize="{{true}}"
type="textarea"
border="{{ false }}"
/>
<van-field
value="{{detail.level}}"
label="职称"
readonly
autosize="{{true}}"
type="textarea"
border="{{ false }}"
/>
<van-field
value="{{detail.company}}"
label="所在单位"
readonly
autosize="{{true}}"
type="textarea"
border="{{ false }}"
/>
<van-field
value="{{detail.synopsis}}"
label="简介"
readonly
autosize="{{true}}"
type="textarea"
border="{{ false }}"
/>
<van-field
use-input-slot
label="详细"
readonly
border="{{ false }}"
>
</van-field>
<view style="margin-top: 20rpx; margin-left: 30rpx;">
<mp-html content="{{detail.detail}}" />
</view>
</van-cell-group>
<view style="margin-top: 40rpx;margin-left: 30rpx;margin-bottom: 30rpx;margin-right: 30rpx;">
<van-button type="info" block class="save" bind:click="connect">去联系</van-button>
</view>

View File

@@ -0,0 +1 @@
/* pages/aid/detail/index.wxss */

View File

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

View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"aid": "/components/aid/index",
"navigator": "/components/navigator/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,3 @@
<!--pages/aid/finance/index.wxml-->
<navigator title="财税援助" canBack="{{true}}" />
<aid bannerType="{{2}}" type="{{1}}" />

View File

@@ -0,0 +1 @@
/* pages/aid/finance/index.wxss */

66
pages/aid/law/index.js Normal file
View File

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

7
pages/aid/law/index.json Normal file
View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"aid": "/components/aid/index",
"navigator": "/components/navigator/index"
},
"navigationStyle": "custom"
}

3
pages/aid/law/index.wxml Normal file
View File

@@ -0,0 +1,3 @@
<!--pages/aid/law/index.wxml-->
<navigator title="法律援助" canBack="{{true}}" />
<aid bannerType="{{3}}" type="{{2}}" />

1
pages/aid/law/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/aid/law/index.wxss */

View File

@@ -1,5 +1,5 @@
import { getBillList } from "../../service/accounting"
import { alertInfo } from "../../utils/index";
import { alertInfo, loadingFunc } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request;
@@ -17,11 +17,19 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.init();
const that = this;
loadingFunc(async () => {
await that.init();
})
},
async init() {
const { page, list } = this.data;
const { code, data, message } = await getBillList(page)
if (code !== OK) {
alertInfo(message)
return;
}
if (!data?.length) {
alertInfo("没有更多了")
return;
@@ -33,8 +41,9 @@ Page({
},
jumpToDetail(e) {
const { id: report } = e.currentTarget.dataset
const tenement = wx.getStorageSync('tenement')?.id || ""
wx.navigateTo({
url: '/childPackage/pages/billDetail/index?id=' + report,
url: `/childPackage/pages/billDetail/index?id=${report}&tenement=${tenement}`,
})
},
})

View File

@@ -0,0 +1,87 @@
// pages/billMeterDetail/index.js
import { getRoundNumber } from "../../utils/index"
Page({
/**
* 页面的初始数据
*/
data: {
data: {},
headers: [
{ key: 'type', title: '' },
{ title: '尖',renderBody: (item) => { return item?.sharp } },
{ title: '峰',renderBody: (item) => { return item?.peak } },
{ title: '平',renderBody: (item) => { return item?.flat } },
{ title: '谷',renderBody: (item) => { return item?.valley } },
],
list: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const data = JSON.parse(options.data) || {}
this.setData({
data: data,
list: [
{ type: "起码", sharp: data.startSharp, peak: data.startPeak, flat: data.startFlat, valley: data.startValley },
{ type: "止码", sharp: data.endSharp, peak: data.endPeak, flat: data.endFlat, valley: data.endValley },
{ type: "退补电量", sharp: data.refundSharp, peak: data.refundPeak, flat: data.refundFlat, valley: data.refundValley },
{ type: "从表电量", sharp: getRoundNumber(data.nestSharp), peak: getRoundNumber(data.nestPeak), flat: getRoundNumber(data.nestFlat), valley: getRoundNumber(data.nestValley) },
{ type: "电度电量", sharp: getRoundNumber(data?.critical?.amount), peak: getRoundNumber(data.peak?.amount), flat: getRoundNumber(data.flat?.amount), valley: getRoundNumber(data.valley?.amount) },
{ type: "分时单价", sharp: data.critical?.price, peak: data.peak?.price, flat: data.flat?.price, valley: data.valley?.price },
{ type: "电费", sharp: getRoundNumber(data.chargeSharp), peak: getRoundNumber(data.chargePeak), flat: getRoundNumber(data.chargeFlat), valley: getRoundNumber(data.chargeValley) },
]
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,10 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-field": "@vant/weapp/field/index",
"table": "/components/table/table"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,45 @@
<!--pages/billMeterDetail/index.wxml-->
<navigator title="详情" canBack="{{true}}" />
<view class="contentWrapper">
<van-field
label="电表编号"
readonly="{{true}}"
border="{{false}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
value="{{data.meterNo}}"
/>
<van-field
label="电表地址"
readonly="{{true}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{false}}"
value="{{data.address}}"
/>
<van-field
label="倍率"
readonly="{{true}}"
border="{{false}}"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
value="{{data.ratio}}"
/>
<view class="table">
<table header="{{headers}}" list="{{list}}" />
</view>
<view class="total">
<van-row>
<van-col span="12">
<view class="totalNumber">
电度电量:{{data.overall.amount}}
</view>
</van-col>
<van-col span="12">
<view class="totalNumber">
电度电费:{{data.overall.fee}}
</view>
</van-col>
</van-row>
</view>
</view>

View File

@@ -0,0 +1,22 @@
/* pages/billMeterDetail/index.wxss */
.infoItem {
word-break: break-all;
}
.contentWrapper {
margin: 20rpx;
}
.table {
border: 1rpx solid rgba(204,204,204,.5);
margin-bottom: 40rpx;
}
.total {
padding-top: 30rpx;
padding-bottom: 40rpx;
}
.totalNumber {
word-break: break-all;
}

View File

@@ -0,0 +1,120 @@
// pages/discountCoupon/index.js
import request from "../../utils/request"
import { getCurrentCoupons, getCurrentIntegral, getRedeemableCoupons } from "../../service/system";
import { alertInfo, loadingFunc } from "../../utils/index";
const { OK } = request;
Page({
/**
* 页面的初始数据
*/
data: {
currentList: [],
canGetList: [],
active: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onChange(e) {
this.setData({
active: e.detail.index,
}, () => {
const { active } = this.data;
this.init(active);
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
const { active } = this.data;
this.init(active);
},
init(active) {
switch(active) {
case 0:
this.getCurrent()
break;
case 1:
this.getCanGet();
break;
}
},
async getCurrent() {
const that = this;
loadingFunc(async() => {
const { code, message, data = [], } = await getCurrentCoupons();
if (code !== OK) {
alertInfo(message)
return
}
that.setData({
currentList: data
})
})
},
getCanGet() {
const that = this;
loadingFunc(async() => {
const { code, message, data = [], } = await getRedeemableCoupons({ type: 1 });
if (code !== OK) {
alertInfo(message)
return
}
that.setData({
canGetList: data
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,10 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"discount-coupon": "/components/discountCoupon/index",
"empty": "/components/empty/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,20 @@
<!--pages/discountCoupon/index.wxml-->
<navigator title="我的优惠券" canBack="{{true}}" />
<van-tabs active="{{ active }}" bind:change="onChange">
<van-tab title="我的优惠券">
<view wx:if="{{currentList.length}}">
<view wx:for="{{currentList}}" wx:key="id" class="item">
<discount-coupon data="{{item}}" type="{{3}}" />
</view>
</view>
<empty wx:else bind:refresh="getCurrent" />
</van-tab>
<van-tab title="领券中心">
<view wx:if="{{canGetList.length}}">
<view wx:for="{{canGetList}}" wx:key="id" class="item">
<discount-coupon data="{{item}}" type="{{1}}" bind:get="getCanGet" />
</view>
</view>
<empty wx:else bind:refresh="getCanGet" />
</van-tab>
</van-tabs>

View File

@@ -0,0 +1,8 @@
/* pages/discountCoupon/index.wxss */
page {
background-color: rgb(242,243,245);
}
.item {
margin: 20rpx;
}

View File

@@ -21,7 +21,6 @@ Component({
},
lifetimes: {
attached() {
console.log('----------=========')
this.getData();
}
},
@@ -29,7 +28,7 @@ Component({
* 组件的方法列表
*/
methods: {
async getData() {
async init() {
const page = this.data.page;
const id = this.id;
const { code, data, message, total } = await getEncyclopediaList(id, page);
@@ -39,8 +38,12 @@ Component({
}
this.setData({ list: data, totalPage: Math.ceil(total / 20) });
},
async getData() {
loadingFunc(async() => {
await this.init();
})
},
jumpToDetail(e) {
console.log('e', e)
wx.navigateTo({
url: `/pages/encyclopediaDetail/index?id=${e.currentTarget.dataset.data.id}`,
})

View File

@@ -31,7 +31,6 @@ Page({
})
},
onChange(e) {
console.log('e', e)
this.setData({
active: e.detail.index,
})

View File

@@ -1,6 +1,7 @@
{
"usingComponents": {
"navigator": "/components/navigator/index"
"navigator": "/components/navigator/index",
"mp-html": "/components/mp-html/index"
},
"navigationStyle": "custom"
}

View File

@@ -2,5 +2,7 @@
<navigator title="百科详情" canBack="{{true}}" />
<view class="contentWrapper">
<view class="title">{{detail.title}}</view>
<view class="content">{{detail.content}}</view>
<view class="content">
<mp-html content="{{detail.content}}" />
</view>
</view>

View File

@@ -2,6 +2,7 @@
import { userValidate } from "../../service/user";
import { alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
import request from "../../utils/request"
import Dialog from '@vant/weapp/dialog/dialog';
const { OK } = request;
Page({
@@ -93,6 +94,33 @@ Page({
})
})
},
onParkFocus(e) {
this.setData({
show: true,
title: "园区",
type: 'park'
})
},
onTenementFocus(e) {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "公司",
type: 'tenement'
})
},
showTooltip() {
Dialog.alert({
title: '提示',
message: '该手机号为开户时预留的手机号,一般为接收电费欠费短信的管理员手机号。',
}).then(() => {
// on close
});
},
scan() {
wx.scanCode({
scanType: "qrCode",
@@ -107,4 +135,28 @@ Page({
}
})
},
onConfirm(e) {
const { type, data = {} } = e.detail;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
})
break;
case "tenement":
this.setData({
tenement: data.id,
tenementName: data.name,
})
}
this.onCancel();
},
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
},
})

Some files were not shown because too many files have changed in this diff Show More