Compare commits
59 Commits
master
...
3e640c3633
Author | SHA1 | Date | |
---|---|---|---|
3e640c3633 | |||
a8312b89d5 | |||
f0dee5bc77 | |||
7bc344e90b | |||
5f56f9a6a8 | |||
886a03cf16 | |||
fccaee5f2b | |||
33d7528990 | |||
f9aedf7d79 | |||
ac0a4b02c7 | |||
7bd4da3c84 | |||
a36faa9bcb | |||
7772b3de1a | |||
10a0fd7c19 | |||
d27fa31ac7 | |||
a3c4e78c22 | |||
5c202e99a6 | |||
e637bbf8a8 | |||
4d665588ac | |||
028d695deb | |||
3e9857bdcd | |||
34995ef9a3 | |||
fb9e727efd | |||
721937fa5b | |||
32b7dbc38c | |||
1b69035ed2 | |||
fc5ef4b931 | |||
8478e324d8 | |||
d58436ef5f | |||
5fbd34d9f8 | |||
edcaa7701c | |||
902b4726c6 | |||
71194fbf1c | |||
28c4028893 | |||
1a3b94af51 | |||
8a1af13924 | |||
db4045031a | |||
d6e93d9f36 | |||
93ee759092 | |||
b078bbf26a | |||
16a03fbb4b | |||
5d617f2282 | |||
616c6a53fb | |||
103c10347c | |||
24f2ec9ead | |||
2b653ea3ed | |||
b905da6035 | |||
ec77d26c27 | |||
293a5c8682 | |||
bcaefbe1cb | |||
4ecf443f89 | |||
b3358ef4ec | |||
f63b2f3319 | |||
307be86cb4 | |||
ebc8cae3c8 | |||
f6f1425cf5 | |||
fd7777e4f4 | |||
9bc3cb5584 | |||
34c2cb76e7 |
20
app.js
20
app.js
@@ -1,11 +1,29 @@
|
|||||||
import { checkUpgrade, getConfigByEnv } from "./utils/index"
|
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({
|
App({
|
||||||
onShow() {
|
onShow() {
|
||||||
checkUpgrade();
|
checkUpgrade();
|
||||||
},
|
},
|
||||||
onLaunch() {
|
onLaunch() {
|
||||||
|
share()
|
||||||
const { api } = getConfigByEnv();
|
const { api } = getConfigByEnv();
|
||||||
this.globalData = { ...this.globalData, api, }
|
this.globalData = { ...this.globalData, api, }
|
||||||
},
|
},
|
||||||
|
9
app.json
9
app.json
@@ -27,7 +27,14 @@
|
|||||||
"pages/aid/finance/index",
|
"pages/aid/finance/index",
|
||||||
"pages/aid/law/index",
|
"pages/aid/law/index",
|
||||||
"pages/aid/detail/index",
|
"pages/aid/detail/index",
|
||||||
"pages/aid/consult/index"
|
"pages/aid/consult/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"
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
{
|
{
|
||||||
|
BIN
assets/images/baike.png
Normal file
BIN
assets/images/baike.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
BIN
assets/images/finance.png
Normal file
BIN
assets/images/finance.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
assets/images/law.png
Normal file
BIN
assets/images/law.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
assets/images/share.png
Normal file
BIN
assets/images/share.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 169 KiB |
BIN
assets/images/stop.png
Normal file
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
BIN
assets/images/tihuan.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 434 KiB |
@@ -1,9 +1,12 @@
|
|||||||
import { getReportDetail } from "../../../service/report";
|
import { getReportDetail } from "../../../service/report";
|
||||||
import { alertInfo, alertSuccess, getPixelRatio } from "../../../utils/index";
|
import { alertInfo, alertSuccess, getPixelRatio, loadingFunc } from "../../../utils/index";
|
||||||
import request from '../../../utils/request'
|
import request from '../../../utils/request'
|
||||||
import * as echarts from '../../components/echarts/echarts';
|
import * as echarts from '../../components/echarts/echarts';
|
||||||
|
import { getRoundNumber } from "../../../utils/index"
|
||||||
const { OK } = request
|
const { OK } = request
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// pages/billDetail/index.js
|
// pages/billDetail/index.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@@ -15,31 +18,35 @@ Page({
|
|||||||
time: "",
|
time: "",
|
||||||
detail: {},
|
detail: {},
|
||||||
meters: [],
|
meters: [],
|
||||||
header1: [
|
// header1: [
|
||||||
{ key: 'address', title: '电表地址' },
|
// { key: 'address', title: '电表地址' },
|
||||||
{ title: '起码',renderBody: (item) => { return item?.startNumber } },
|
// { title: '起码',renderBody: (item) => { return item?.startNumber } },
|
||||||
{ title: '止码',renderBody: (item) => { return item?.endNumber } },
|
// { title: '止码',renderBody: (item) => { return item?.endNumber } },
|
||||||
{ title: '倍率',renderBody: (item) => { return item?.displayRatio } },
|
// { title: '倍率',renderBody: (item) => { return item?.displayRatio } },
|
||||||
],
|
// ],
|
||||||
header2: [
|
// header2: [
|
||||||
{ title: '用电量', renderBody: (item) => item?.overall?.amount },
|
// { title: '用电量', renderBody: (item) => item?.overall?.amount },
|
||||||
{ title: '线损电量',renderBody: (item) => item?.loss?.amount },
|
// { title: '线损电量',renderBody: (item) => item?.loss?.amount },
|
||||||
{ title: '公摊电量',renderBody: (item) => item?.publicAmount },
|
// { title: '公摊电量',renderBody: (item) => item?.publicAmount },
|
||||||
{ title: '合计电量',renderBody: (item) => {
|
// { title: '合计电量',renderBody: (item) => {
|
||||||
|
|
||||||
} },
|
// } },
|
||||||
]
|
// ]
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { id, time } = options;
|
const { id, time, tenement } = options;
|
||||||
this.init(id, time);
|
const that = this;
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init(id, time, tenement);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async init(id, time) {
|
async init(id, time, tenement) {
|
||||||
const { code, message, detail, amount } = await getReportDetail(id)
|
console.log("time:", tenement)
|
||||||
|
const { code, message, detail, amount } = await getReportDetail(id, tenement)
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return;
|
return;
|
||||||
@@ -50,11 +57,15 @@ Page({
|
|||||||
detail,
|
detail,
|
||||||
amount: amount,
|
amount: amount,
|
||||||
meters: detail?.meters?.map(item => {
|
meters: detail?.meters?.map(item => {
|
||||||
const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0)
|
if (item?.loss?.amount) {
|
||||||
item.finalAmount = Number(finalAmount).toFixed(2)
|
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;
|
return item;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
if (detail?.park?.meter04kvType === 0) {
|
||||||
const option = {
|
const option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item'
|
trigger: 'item'
|
||||||
@@ -81,14 +92,57 @@ Page({
|
|||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: '50%',
|
radius: '50%',
|
||||||
data: [
|
data: [
|
||||||
{ value: detail.comprehensive.lossAmount, name: '本期线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
|
{ value: detail.comprehensive.lossAmount, name: '线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
|
||||||
{ value: detail.comprehensive.consumption, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } },
|
{ value: detail.comprehensive.consumption, name: '电度电量', itemStyle: { color: 'rgb(80,135,236)' } },
|
||||||
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
this.init_pieCharts(option);
|
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;
|
const that = this;
|
||||||
wx.getSystemInfo({
|
wx.getSystemInfo({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
@@ -115,6 +169,13 @@ Page({
|
|||||||
return pieChart;
|
return pieChart;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
jumpToDetail(e) {
|
||||||
|
const { meter } = e.currentTarget.dataset;
|
||||||
|
console.log("meter", meter)
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/billMeterDetail/index?data=' + JSON.stringify(meter),
|
||||||
|
})
|
||||||
|
},
|
||||||
download() {
|
download() {
|
||||||
const { id: tenement } = wx.getStorageSync('tenement')
|
const { id: tenement } = wx.getStorageSync('tenement')
|
||||||
const { id } = this.data;
|
const { id } = this.data;
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
<view class="label">
|
<view class="label">
|
||||||
用电地址:
|
商户地址:
|
||||||
</view>
|
</view>
|
||||||
<view class="value"> {{ detail.tenement.address }} </view>
|
<view class="value"> {{ detail.tenement.address }} </view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,14 +25,14 @@
|
|||||||
<van-button type="info" size="small" class="download" bind:click="download">下载</van-button>
|
<van-button type="info" size="small" class="download" bind:click="download">下载</van-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="wrapper">
|
<view class="wrapper" wx:if="{{detail.park.meter04kvType !== 1}}">
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="contentTitle"> 本期账单 </view>
|
<view class="contentTitle"> 本期账单 </view>
|
||||||
<van-row gutter="10">
|
<van-row gutter="10">
|
||||||
<van-col span="8">
|
<van-col span="8">
|
||||||
<view class="colContent">
|
<view class="colContent">
|
||||||
<view class="colContentTitle">本期用电量</view>
|
<view class="colContentTitle">本期用电量</view>
|
||||||
<view class="colContentValue"> {{ amount }} 千瓦时 </view>
|
<view class="colContentValue" wx:if="{{detail.park.meter04kvType === 0}}"> {{ amount }} 千瓦时 </view>
|
||||||
</view>
|
</view>
|
||||||
</van-col>
|
</van-col>
|
||||||
<van-col span="8">
|
<van-col span="8">
|
||||||
@@ -50,17 +50,10 @@
|
|||||||
</van-row>
|
</van-row>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="contentTitle"> 电费构成 </view>
|
<view class="contentTitle"> 电费构成 </view>
|
||||||
<echarts
|
<echarts style="width:200rpx;height:180rpx;" id="echarts" class='mychart-bar' canvas-id="mychart-bar" ec="{{ ec }}" forceUseOldCanvas="{{false}}">
|
||||||
style="width:200rpx;height:180rpx;"
|
|
||||||
id="echarts"
|
|
||||||
class='mychart-bar'
|
|
||||||
canvas-id="mychart-bar"
|
|
||||||
ec="{{ ec }}"
|
|
||||||
forceUseOldCanvas="{{false}}"
|
|
||||||
>
|
|
||||||
</echarts>
|
</echarts>
|
||||||
<view class="tooltip">
|
<view class="tooltip">
|
||||||
(本月电量+本月线损电量)*电单价+摊薄公摊电费+摊薄调整电费
|
(电度电量+线损电量)*电单价+摊薄公摊电费+摊薄调整电费
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="contentTitle"> 电量明细 </view>
|
<view class="contentTitle"> 电量明细 </view>
|
||||||
@@ -86,7 +79,7 @@
|
|||||||
</van-row>
|
</van-row>
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col span="6">
|
<van-col span="6">
|
||||||
<view class="tableTitle"> 用电量 </view>
|
<view class="tableTitle"> 电度电量 </view>
|
||||||
<view class="tableContent"> {{item.overall.amount}} </view>
|
<view class="tableContent"> {{item.overall.amount}} </view>
|
||||||
|
|
||||||
</van-col>
|
</van-col>
|
||||||
@@ -106,4 +99,97 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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 style="height: 20rpx;"></view>
|
@@ -59,12 +59,25 @@ page {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.colContentTitle2 {
|
||||||
|
padding: 30rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
.colContentValue {
|
.colContentValue {
|
||||||
padding-bottom: 30rpx;
|
padding-bottom: 30rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.colContentValue2 {
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
padding-left: 40rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.tooltip {
|
.tooltip {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: rgb(136, 132, 132);
|
color: rgb(136, 132, 132);
|
||||||
@@ -87,6 +100,7 @@ page {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.download {
|
.download {
|
||||||
@@ -94,3 +108,29 @@ page {
|
|||||||
top: 20rpx;
|
top: 20rpx;
|
||||||
right: 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;
|
||||||
|
}
|
@@ -1,6 +1,5 @@
|
|||||||
// pages/electricQuery/components/accountingCard/index.js
|
// pages/electricQuery/components/accountingCard/index.js
|
||||||
Component({
|
Component({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组件的属性列表
|
* 组件的属性列表
|
||||||
*/
|
*/
|
||||||
|
@@ -1,33 +1,86 @@
|
|||||||
<!--pages/electricQuery/components/accountingCard/index.wxml-->
|
<!--pages/electricQuery/components/accountingCard/index.wxml-->
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
{{data.meter.address}}
|
<span>{{data.meter.address}}</span>
|
||||||
|
<span style="font-size: 30rpx; margin-left: 100rpx;">电表编号:{{data.meter.sn}}</span>
|
||||||
</view>
|
</view>
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col span="6">
|
<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>
|
<view class="tableTitle"> 初始余额 </view>
|
||||||
</van-col>
|
</van-col>
|
||||||
<van-col span="7">
|
<van-col span="10">
|
||||||
<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>
|
<view class="tableContent"> {{data.startMoney}} </view>
|
||||||
</van-col>
|
</van-col>
|
||||||
<van-col span="7">
|
<van-col span="7">
|
||||||
<view class="tableContent"> {{data.rechargeMoney}} </view>
|
<view calss="tableContent"> {{data.updateStartMoneyAt || '--'}} </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-col>
|
||||||
</van-row>
|
</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>
|
@@ -17,8 +17,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tableContent {
|
.tableContent {
|
||||||
margin-top: 10rpx;
|
margin-top: 25rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 32rpx;
|
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;
|
||||||
|
}
|
130
childPackage/pages/electricQuery/components/reading/index.js
Normal file
130
childPackage/pages/electricQuery/components/reading/index.js
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
// 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 () => {
|
||||||
|
console.log("----------")
|
||||||
|
await this.getParkInfo(time)
|
||||||
|
console.log("===========")
|
||||||
|
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();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
150
childPackage/pages/electricQuery/components/reading/index.wxml
Normal file
150
childPackage/pages/electricQuery/components/reading/index.wxml
Normal 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>
|
102
childPackage/pages/electricQuery/components/reading/index.wxss
Normal file
102
childPackage/pages/electricQuery/components/reading/index.wxss
Normal 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;
|
||||||
|
}
|
@@ -1,6 +1,7 @@
|
|||||||
// pages/electricQuery/index.js
|
// pages/electricQuery/index.js
|
||||||
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../service/accounting";
|
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../service/accounting";
|
||||||
import { getTenementMeterList } from "../../../service/meter";
|
import { getTenementMeterList } from "../../../service/meter";
|
||||||
|
import { getParkInfoByTime } from "../../../service/park";
|
||||||
import dayjs from "../../../utils/dayjs";
|
import dayjs from "../../../utils/dayjs";
|
||||||
import request from '../../../utils/request';
|
import request from '../../../utils/request';
|
||||||
import * as echarts from '../../components/echarts/echarts';
|
import * as echarts from '../../components/echarts/echarts';
|
||||||
@@ -22,26 +23,32 @@ Page({
|
|||||||
year: dayjs().format('YYYY'),
|
year: dayjs().format('YYYY'),
|
||||||
yearMonth: dayjs().format("YYYY-MM"),
|
yearMonth: dayjs().format("YYYY-MM"),
|
||||||
yearMonthDay: dayjs().format("YYYY-MM-DD"),
|
yearMonthDay: dayjs().format("YYYY-MM-DD"),
|
||||||
|
|
||||||
yearStamp: new Date().getTime(),
|
yearStamp: new Date().getTime(),
|
||||||
yearMonthStamp: new Date().getTime(),
|
yearMonthStamp: new Date().getTime(),
|
||||||
yearMonthDayStamp: new Date().getTime(),
|
yearMonthDayStamp: new Date().getTime(),
|
||||||
|
|
||||||
|
|
||||||
header: [
|
header: [
|
||||||
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
// { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||||
{ title: '时间',renderBody: (item) => { return item.time } },
|
{ title: '时间',renderBody: (item) => { return item.time } },
|
||||||
{ key: 'number', title: '耗量' },
|
{ key: 'number', title: '耗量' },
|
||||||
],
|
],
|
||||||
meterReadingHeader: [
|
valleyHeader: [
|
||||||
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
// { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||||
{ title: '倍率', key: 'ratio' },
|
{ title: '时间',renderBody: (item) => { return item.time } },
|
||||||
{ key: 'number', title: '抄表记录' },
|
{ key: 'critical', title: '尖' },
|
||||||
|
{ key: 'peak', title: '峰' },
|
||||||
|
{ key: 'flat', title: '平' },
|
||||||
|
{ key: 'valley', title: '谷' },
|
||||||
],
|
],
|
||||||
list: [],
|
list: [],
|
||||||
visible: false,
|
visible: false,
|
||||||
meterReadingList: [],
|
|
||||||
accountingList: [],
|
accountingList: [],
|
||||||
electricNumber: 0,
|
electricNumber: 0,
|
||||||
meterNumber: 0,
|
meterNumber: 0,
|
||||||
page: 1,
|
page: 1,
|
||||||
|
readingPage: 1,
|
||||||
},
|
},
|
||||||
changeQueryType(e) {
|
changeQueryType(e) {
|
||||||
const { type } = e.currentTarget.dataset
|
const { type } = e.currentTarget.dataset
|
||||||
@@ -53,10 +60,10 @@ Page({
|
|||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
loadingFunc(async () => {
|
// loadingFunc(async () => {
|
||||||
await this.getReadingList();
|
// await this.getReadingList();
|
||||||
})
|
// })
|
||||||
break;
|
// break;
|
||||||
case 2:
|
case 2:
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
await this.getAccountingBalanceList();
|
await this.getAccountingBalanceList();
|
||||||
@@ -74,8 +81,9 @@ Page({
|
|||||||
visible: true
|
visible: true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
changeTimeType(e) {
|
changeTimeType(e) {
|
||||||
const { type } = e.currentTarget.dataset
|
const { type } = e.currentTarget.dataset;
|
||||||
const that = this;
|
const that = this;
|
||||||
this.setData({ timeType: type }, () => {
|
this.setData({ timeType: type }, () => {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
@@ -89,11 +97,13 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
|
await this.getMeters()
|
||||||
|
await this.getParkInfo()
|
||||||
await this.init()
|
await this.init()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async 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;
|
let time;
|
||||||
switch(timeType) {
|
switch(timeType) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -128,6 +138,12 @@ Page({
|
|||||||
devicePixelRatio: getPixelRatio(),
|
devicePixelRatio: getPixelRatio(),
|
||||||
});
|
});
|
||||||
const ids = [...new Set(data?.map(item => item?.meter?.id))]
|
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"));
|
||||||
|
console.log(times)
|
||||||
const options = {
|
const options = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
@@ -144,18 +160,25 @@ Page({
|
|||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: [...new Set(data?.map(item => item.time))]
|
data: times
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: 'value'
|
||||||
},
|
},
|
||||||
series: ids?.map(item => {
|
series: ids?.map(item => {
|
||||||
const element = data?.find(i => i?.meter?.id === 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 {
|
return {
|
||||||
name: element?.meter?.address,
|
name: element?.meter?.address,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
stack: 'Total',
|
data: newList
|
||||||
data: data?.filter(ele => ele?.meter?.id === item).map(item => item.number)
|
|
||||||
}})
|
}})
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -164,15 +187,7 @@ Page({
|
|||||||
return pieChart;
|
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() {
|
async export() {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay } = this.data;
|
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay } = this.data;
|
||||||
@@ -196,6 +211,7 @@ Page({
|
|||||||
wx.openDocument({
|
wx.openDocument({
|
||||||
filePath: data.tempFilePath,
|
filePath: data.tempFilePath,
|
||||||
fileType: ['xlsx'],
|
fileType: ['xlsx'],
|
||||||
|
showMenu: true,
|
||||||
success() {
|
success() {
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
@@ -229,15 +245,39 @@ Page({
|
|||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const first = data?.[0]
|
||||||
this.setData({
|
this.setData({
|
||||||
meterList: data || [],
|
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() {
|
clickMeter() {
|
||||||
this.setData({
|
this.setData({
|
||||||
type: "meter",
|
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 }))],
|
||||||
show: true,
|
show: true,
|
||||||
title: "表计"
|
title: "表计"
|
||||||
})
|
})
|
||||||
@@ -251,11 +291,12 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onOk(e) {
|
onOk(e) {
|
||||||
const { id, code } = e.detail.value;
|
const { id, code, address } = e.detail.value;
|
||||||
this.setData({
|
this.setData({
|
||||||
// year: currentYear,
|
// year: currentYear,
|
||||||
meterId: id,
|
meterId: id,
|
||||||
meterCode: code,
|
meterCode: code,
|
||||||
|
meterAddress: address,
|
||||||
type: "",
|
type: "",
|
||||||
show: false,
|
show: false,
|
||||||
title: ""
|
title: ""
|
||||||
@@ -287,12 +328,14 @@ Page({
|
|||||||
onTimeCancel() {
|
onTimeCancel() {
|
||||||
this.setData({ visible: false })
|
this.setData({ visible: false })
|
||||||
},
|
},
|
||||||
|
|
||||||
onTimeConfirm(e) {
|
onTimeConfirm(e) {
|
||||||
const { type, time } = e.detail;
|
const { type, time } = e.detail;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "year":
|
case "year":
|
||||||
this.setData({ year: time, visible: false, }, () => {
|
this.setData({ year: time, visible: false, }, () => {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
|
await this.getParkInfo()
|
||||||
await this.init();
|
await this.init();
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -301,6 +344,7 @@ Page({
|
|||||||
const [year, month] = time.split("-")
|
const [year, month] = time.split("-")
|
||||||
this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => {
|
this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
|
await this.getParkInfo()
|
||||||
await this.init();
|
await this.init();
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -313,12 +357,16 @@ Page({
|
|||||||
page: 1,
|
page: 1,
|
||||||
}, () => {
|
}, () => {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
|
await this.getParkInfo()
|
||||||
await this.init();
|
await this.init();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
readingChangeTime(e) {
|
||||||
|
console.log('e', e.detail)
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
@@ -330,9 +378,39 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
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()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面隐藏
|
* 生命周期函数--监听页面隐藏
|
||||||
*/
|
*/
|
||||||
|
@@ -12,7 +12,10 @@
|
|||||||
"accountingCard": "./components/accountingCard/index",
|
"accountingCard": "./components/accountingCard/index",
|
||||||
"pagination": "/components/pagination/index",
|
"pagination": "/components/pagination/index",
|
||||||
"echarts": "/childPackage/components/echarts/ec-canvas",
|
"echarts": "/childPackage/components/echarts/ec-canvas",
|
||||||
"listTable": "./components/listTable/index"
|
"listTable": "./components/listTable/index",
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"reading": "./components/reading/index"
|
||||||
},
|
},
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
@@ -7,7 +7,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="select" bind:tap="clickMeter">
|
<view class="select" bind:tap="clickMeter">
|
||||||
<view class="selectContent">
|
<view class="selectContent">
|
||||||
{{ meterCode === "" ? '全部' : meterCode }}
|
{{ meterAddress === "" ? '-' : meterAddress }}
|
||||||
</view>
|
</view>
|
||||||
<van-icon name="arrow-down" />
|
<van-icon name="arrow-down" />
|
||||||
</view>
|
</view>
|
||||||
@@ -30,23 +30,25 @@
|
|||||||
<view class="timeQuery" wx:if="{{queryType === 0}}">
|
<view class="timeQuery" wx:if="{{queryType === 0}}">
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col span="8">
|
<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>
|
||||||
<van-col span="8">
|
<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>
|
||||||
<van-col span="8">
|
<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-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{queryType === 0}}">
|
<view wx:if="{{queryType === 0}}">
|
||||||
<view class="tooltip">
|
<view class="tooltip">
|
||||||
不包括线损电量,显示为电表实际消耗电量。仅供参考,实际能耗电量以电费账单为主。如有疑问,请联系客服。
|
不包括线损电量,显示为电表实际消用电量。仅供参考,实际能用电量以电费账单为主。如有疑问,请联系客服。
|
||||||
</view>
|
</view>
|
||||||
<view class="timeChooseWrapper">
|
<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="time" bind:tap="clickTime">
|
||||||
<view class="timeText" wx:if="{{timeType === 0}}"> {{yearMonthDay}} </view>
|
<view class="timeText" wx:if="{{timeType === 0}}"> {{yearMonthDay}} </view>
|
||||||
<view class="timeText" wx:elif="{{timeType === 1}}"> {{yearMonth}} </view>
|
<view class="timeText" wx:elif="{{timeType === 1}}"> {{yearMonth}} </view>
|
||||||
@@ -57,13 +59,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:elif="{{queryType === 1}}">
|
<view wx:elif="{{queryType === 1}}">
|
||||||
<view class="tooltip">
|
<!-- <view class="tooltip">
|
||||||
显示为最新的一条抄表记录。电表更新数据有延迟,仅供参考,实际以电表上显示为准。
|
显示为最新的一条抄表记录。电表更新数据有延迟,仅供参考,实际以电表上显示为准。
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view wx:elif="{{queryType === 2}}">
|
<view wx:elif="{{queryType === 2}}">
|
||||||
<view class="tooltip">
|
<view class="tooltip">
|
||||||
账务余额更新时间为:每次预存电费后,每次账单发布后,剩余的实际金额。电表余额与账务余额相差较大的用户,每半年统一处理一次。
|
账务余额更新时间为:每次预存电费后,每次发布账单后剩余的实际金额。
|
||||||
|
</view>
|
||||||
|
<view class="tooltip">
|
||||||
|
计算公式:账务余额 = 初始余额 + 累充充值金额 - 电费
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -81,26 +86,25 @@
|
|||||||
</view>
|
</view>
|
||||||
<empty bind:refresh="init" wx:else /> -->
|
<empty bind:refresh="init" wx:else /> -->
|
||||||
|
|
||||||
<listTable list="{{list}}" header="{{header}}" totalPage="{{totalPage}}" />
|
<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>
|
||||||
<view class="sum">
|
<view class="sum">
|
||||||
合计:表计数量:{{meterNumber}},耗电量:{{electricNumber}}
|
合计:表计数量:{{meterNumber}},用电量:{{electricNumber}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{queryType === 1}}">
|
<view wx:if="{{queryType === 1}}">
|
||||||
<view style="margin: 30rpx;">
|
<reading meter="{{meterId}}" parkInfo="{{parkInfo}}" bind:changeTime="readingChangeTime" />
|
||||||
<view wx:if="{{meterReadingList.length}}">
|
|
||||||
<table
|
|
||||||
header="{{meterReadingHeader}}"
|
|
||||||
list="{{meterReadingList}}"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<empty bind:refresh="getReadingList" wx:else />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{queryType === 2}}">
|
<view wx:if="{{queryType === 2}}">
|
||||||
<view style="margin: 30rpx;">
|
<view style="margin: 30rpx;">
|
||||||
@@ -140,3 +144,4 @@
|
|||||||
bind:close="onTimeClose"
|
bind:close="onTimeClose"
|
||||||
bind:confirm="onTimeConfirm"
|
bind:confirm="onTimeConfirm"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
37
components/DateTimePicker/index.js
Normal file
37
components/DateTimePicker/index.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// components/datePicker/index.js
|
||||||
|
import dayjs from "../../utils/dayjs"
|
||||||
|
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
show: Boolean,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
currentDate: new Date().getTime(),
|
||||||
|
maxDate: new Date().getTime(),
|
||||||
|
minDate: new Date(2024, 1, 1).getTime(),
|
||||||
|
},
|
||||||
|
lifetimes: {
|
||||||
|
attached() {
|
||||||
|
console.log("attached", this.data.show)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onCancel() {
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
this.triggerEvent("confirm", { time: dayjs(e.detail).format("YYYY-MM-DD HH:mm:ss") })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
7
components/DateTimePicker/index.json
Normal file
7
components/DateTimePicker/index.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
|
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
|
||||||
|
}
|
||||||
|
}
|
18
components/DateTimePicker/index.wxml
Normal file
18
components/DateTimePicker/index.wxml
Normal 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>
|
1
components/DateTimePicker/index.wxss
Normal file
1
components/DateTimePicker/index.wxss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* components/datePicker/index.wxss */
|
32
components/Segmented/index.js
Normal file
32
components/Segmented/index.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
// components/Segmented/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
list: Array,
|
||||||
|
active: Number,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
handleChange(e) {
|
||||||
|
console.log(e, this.data.active)
|
||||||
|
const { index } = e.currentTarget.dataset;
|
||||||
|
if (index === this.data.active) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.triggerEvent("change", { index, name: this.data.list[index] })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
4
components/Segmented/index.json
Normal file
4
components/Segmented/index.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
12
components/Segmented/index.wxml
Normal file
12
components/Segmented/index.wxml
Normal 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>
|
19
components/Segmented/index.wxss
Normal file
19
components/Segmented/index.wxss
Normal 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);
|
||||||
|
}
|
@@ -17,7 +17,8 @@
|
|||||||
<view class="userLevel"> {{ item.level }} </view>
|
<view class="userLevel"> {{ item.level }} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="synopsis"> {{item.synopsis}}{{item.synopsis}} {{item.synopsis}} </view>
|
<view class="synopsis"> {{item.synopsis}}{{item.synopsis}} {{item.synopsis}} </view>
|
||||||
<view class="connect" catch:tap="consult" data-id="{{item.id}}">
|
<view class="connect" >
|
||||||
|
<view style="display: flex; align-items: center;" catch:tap="consult" data-id="{{item.id}}">
|
||||||
<van-icon name="service-o" color="#1989fa" />
|
<van-icon name="service-o" color="#1989fa" />
|
||||||
<view style="margin-left: 10rpx;color: #1989fa;"> 在线咨询 </view>
|
<view style="margin-left: 10rpx;color: #1989fa;"> 在线咨询 </view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<pagination
|
<pagination
|
||||||
currentIndex="{{page}}"
|
currentIndex="{{page}}"
|
||||||
totalPage="{{totalPage}}"
|
totalPage="{{totalPage}}"
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.synopsis {
|
.synopsis {
|
||||||
height: 80rpx;
|
height: 75rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index"
|
||||||
|
import { redeemCoupons } from "../../service/system";
|
||||||
|
import request from "../../utils/request"
|
||||||
|
const { OK } = request;
|
||||||
|
|
||||||
// components/discountCoupon/index.js
|
// components/discountCoupon/index.js
|
||||||
Component({
|
Component({
|
||||||
|
|
||||||
@@ -5,7 +10,8 @@ Component({
|
|||||||
* 组件的属性列表
|
* 组件的属性列表
|
||||||
*/
|
*/
|
||||||
properties: {
|
properties: {
|
||||||
|
type: Number,
|
||||||
|
data: Object
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,6 +25,52 @@ Component({
|
|||||||
* 组件的方法列表
|
* 组件的方法列表
|
||||||
*/
|
*/
|
||||||
methods: {
|
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 })
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"component": true,
|
"component": true,
|
||||||
"usingComponents": {}
|
"usingComponents": {
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index"
|
||||||
|
}
|
||||||
}
|
}
|
@@ -1,2 +1,39 @@
|
|||||||
<!--components/discountCoupon/index.wxml-->
|
<!--components/discountCoupon/index.wxml-->
|
||||||
<text>components/discountCoupon/index.wxml</text>
|
|
||||||
|
|
||||||
|
<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" />
|
@@ -1 +1,60 @@
|
|||||||
/* components/discountCoupon/index.wxss */
|
/* 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)
|
||||||
|
}
|
||||||
|
@@ -7,6 +7,7 @@ Component({
|
|||||||
properties: {
|
properties: {
|
||||||
title: String,
|
title: String,
|
||||||
canBack: Boolean,
|
canBack: Boolean,
|
||||||
|
beforeBack: Function,
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,7 +35,11 @@ Component({
|
|||||||
* 组件的方法列表
|
* 组件的方法列表
|
||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
back() {
|
async back() {
|
||||||
|
const { beforeBack } = this;
|
||||||
|
if (beforeBack) {
|
||||||
|
await beforeBack();
|
||||||
|
}
|
||||||
wx.navigateBack();
|
wx.navigateBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { getParkList } from "../../service/park"
|
import { getLoginParkList, getParkBuildingList } from "../../service/park"
|
||||||
import { getParkSimpleMeterList } from "../../service/meter"
|
import { getParkSimpleMeterList } from "../../service/meter"
|
||||||
import { alertInfo } from "../../utils/index";
|
import { alertInfo } from "../../utils/index";
|
||||||
import request from "../../utils/request"
|
import request from "../../utils/request"
|
||||||
import { payWays } from "../../utils/data";
|
import { payWays, feeType } from "../../utils/data";
|
||||||
|
import { getTenementList, getWxTenementList } from "../../service/tenement";
|
||||||
const { OK } = request;
|
const { OK } = request;
|
||||||
|
|
||||||
// components/searchSelect/index.js
|
// components/searchSelect/index.js
|
||||||
@@ -17,6 +17,7 @@ Component({
|
|||||||
type: String,
|
type: String,
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
park: String,
|
park: String,
|
||||||
|
isBack: Boolean,
|
||||||
},
|
},
|
||||||
observers: {
|
observers: {
|
||||||
"show,type": function(newShow, newType) {
|
"show,type": function(newShow, newType) {
|
||||||
@@ -32,6 +33,7 @@ Component({
|
|||||||
columns: [],
|
columns: [],
|
||||||
searchText: "",
|
searchText: "",
|
||||||
payWays,
|
payWays,
|
||||||
|
feeType,
|
||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
attached() {
|
attached() {
|
||||||
@@ -59,7 +61,12 @@ Component({
|
|||||||
onConfirm(event) {
|
onConfirm(event) {
|
||||||
const { index } = event.detail;
|
const { index } = event.detail;
|
||||||
const { list = [], type } = this.data;
|
const { list = [], type } = this.data;
|
||||||
|
console.log("index", index)
|
||||||
const item = list[index];
|
const item = list[index];
|
||||||
|
if (!item) {
|
||||||
|
alertInfo("请选择一项")
|
||||||
|
return
|
||||||
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
columns: [],
|
columns: [],
|
||||||
list: [],
|
list: [],
|
||||||
@@ -78,6 +85,17 @@ Component({
|
|||||||
})
|
})
|
||||||
this.triggerEvent("confirm", { data: item, way: index, type } );
|
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() {
|
onSearch() {
|
||||||
const { type } = this.data;
|
const { type } = this.data;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
@@ -86,12 +104,18 @@ Component({
|
|||||||
return;
|
return;
|
||||||
case "meter":
|
case "meter":
|
||||||
this.onSearchMeter();
|
this.onSearchMeter();
|
||||||
|
return
|
||||||
|
case "tenement":
|
||||||
|
this.onSearchTenement();
|
||||||
|
return;
|
||||||
|
case "building":
|
||||||
|
this.onSearchBuilding();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onSearchPark() {
|
async onSearchPark() {
|
||||||
const { searchText = "" } = this.data;
|
const { searchText = "" } = this.data;
|
||||||
const { code, message, data: parks = [] } = await getParkList({keyword: searchText});
|
const { code, message, data: parks = [] } = await getLoginParkList({keyword: searchText});
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return
|
return
|
||||||
@@ -109,9 +133,34 @@ Component({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`),
|
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`) || [],
|
||||||
list: parks,
|
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,
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -3,11 +3,33 @@
|
|||||||
show="{{ show }}"
|
show="{{ show }}"
|
||||||
bind:click="onClickHide"
|
bind:click="onClickHide"
|
||||||
position="bottom"
|
position="bottom"
|
||||||
|
z-index="100000"
|
||||||
|
wx:if="{{show}}"
|
||||||
>
|
>
|
||||||
<view wx:if="{{type !== 'pay'}}">
|
<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
|
<van-search
|
||||||
value="{{ value }}"
|
value="{{ value }}"
|
||||||
placeholder="请输入搜索关键词"
|
placeholder="{{type === 'tenement' ? '请输入关键词搜索后选择' : '请输入搜索关键词'}}"
|
||||||
use-action-slot
|
use-action-slot
|
||||||
bind:change="onChangeSearch"
|
bind:change="onChangeSearch"
|
||||||
>
|
>
|
||||||
@@ -26,14 +48,15 @@
|
|||||||
bind:confirm="onConfirm"
|
bind:confirm="onConfirm"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view wx:else>
|
<view wx:else>
|
||||||
<van-picker
|
<van-picker
|
||||||
custom-style="width: 100%;"
|
custom-style="width: 100%;"
|
||||||
columns="{{ payWays }}"
|
columns="{{ columns }}"
|
||||||
title="{{title}}"
|
title="{{title}}"
|
||||||
show-toolbar="{{true}}"
|
show-toolbar="{{true}}"
|
||||||
bind:cancel="onCancel"
|
bind:cancel="onCancel"
|
||||||
bind:confirm="onPayConfirm"
|
bind:confirm="onConfirm"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</van-popup>
|
</van-popup>
|
@@ -1,3 +1 @@
|
|||||||
/* components/searchSelect/index.wxss */
|
/* components/searchSelect/index.wxss */
|
||||||
.van-ellipsis van-picker-column__item {
|
|
||||||
}
|
|
48
components/searchSelectWrapper/index.js
Normal file
48
components/searchSelectWrapper/index.js
Normal 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: "" })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
8
components/searchSelectWrapper/index.json
Normal file
8
components/searchSelectWrapper/index.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
35
components/searchSelectWrapper/index.wxml
Normal file
35
components/searchSelectWrapper/index.wxml
Normal 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>
|
37
components/searchSelectWrapper/index.wxss
Normal file
37
components/searchSelectWrapper/index.wxss
Normal 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;
|
||||||
|
}
|
@@ -27,6 +27,9 @@ Component({
|
|||||||
type: String,
|
type: String,
|
||||||
value: '#d6e8ff'
|
value: '#d6e8ff'
|
||||||
},
|
},
|
||||||
|
topColor: String,
|
||||||
|
topStyle: String,
|
||||||
|
bodyStyle: String,
|
||||||
maxLine: {
|
maxLine: {
|
||||||
type: Number,
|
type: Number,
|
||||||
value: 2
|
value: 2
|
||||||
|
@@ -8,12 +8,19 @@
|
|||||||
</wxs>
|
</wxs>
|
||||||
<scroll-view hidden="{{!showList.length||!showHeader.length}}" scroll-x class="table1-view" style="--max_line:{{maxLine}};--width:{{getTableWidth(tableWidth)}}">
|
<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="table1 d-table table-class">
|
||||||
<view class="d-table-row tr-class">
|
<view class="d-table-row tr-class" style="{{topColor ? 'background-color: rgb(242,248,246)' : ''}}">
|
||||||
<view class="d-table-cell th-class" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
|
<view class="d-table-cell th-class" style="{{topStyle}}" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
|
||||||
</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 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
|
||||||
<view class="text">
|
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}}
|
{{item[head.key].text}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@@ -23,6 +23,7 @@ Component({
|
|||||||
year: String,
|
year: String,
|
||||||
month: Number,
|
month: Number,
|
||||||
day: Number,
|
day: Number,
|
||||||
|
currentDate: Number,
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 组件的初始数据
|
* 组件的初始数据
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { getBillList } from "../../service/accounting"
|
import { getBillList } from "../../service/accounting"
|
||||||
import { alertInfo } from "../../utils/index";
|
import { alertInfo, loadingFunc } from "../../utils/index";
|
||||||
import request from '../../utils/request'
|
import request from '../../utils/request'
|
||||||
const { OK } = request;
|
const { OK } = request;
|
||||||
|
|
||||||
@@ -17,11 +17,19 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init();
|
const that = this;
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
const { page, list } = this.data;
|
const { page, list } = this.data;
|
||||||
const { code, data, message } = await getBillList(page)
|
const { code, data, message } = await getBillList(page)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!data?.length) {
|
if (!data?.length) {
|
||||||
alertInfo("没有更多了")
|
alertInfo("没有更多了")
|
||||||
return;
|
return;
|
||||||
@@ -33,8 +41,9 @@ Page({
|
|||||||
},
|
},
|
||||||
jumpToDetail(e) {
|
jumpToDetail(e) {
|
||||||
const { id: report } = e.currentTarget.dataset
|
const { id: report } = e.currentTarget.dataset
|
||||||
|
const tenement = wx.getStorageSync('tenement')?.id || ""
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/childPackage/pages/billDetail/index?id=' + report,
|
url: `/childPackage/pages/billDetail/index?id=${report}&tenement=${tenement}`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
87
pages/billMeterDetail/index.js
Normal file
87
pages/billMeterDetail/index.js
Normal 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() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
10
pages/billMeterDetail/index.json
Normal file
10
pages/billMeterDetail/index.json
Normal 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"
|
||||||
|
}
|
45
pages/billMeterDetail/index.wxml
Normal file
45
pages/billMeterDetail/index.wxml
Normal 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>
|
22
pages/billMeterDetail/index.wxss
Normal file
22
pages/billMeterDetail/index.wxss
Normal 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;
|
||||||
|
}
|
120
pages/discountCoupon/index.js
Normal file
120
pages/discountCoupon/index.js
Normal 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() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
10
pages/discountCoupon/index.json
Normal file
10
pages/discountCoupon/index.json
Normal 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"
|
||||||
|
}
|
20
pages/discountCoupon/index.wxml
Normal file
20
pages/discountCoupon/index.wxml
Normal 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>
|
8
pages/discountCoupon/index.wxss
Normal file
8
pages/discountCoupon/index.wxss
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/* pages/discountCoupon/index.wxss */
|
||||||
|
page {
|
||||||
|
background-color: rgb(242,243,245);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
margin: 20rpx;
|
||||||
|
}
|
@@ -2,6 +2,7 @@
|
|||||||
import { userValidate } from "../../service/user";
|
import { userValidate } from "../../service/user";
|
||||||
import { alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
|
import { alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
|
||||||
import request from "../../utils/request"
|
import request from "../../utils/request"
|
||||||
|
import Dialog from '@vant/weapp/dialog/dialog';
|
||||||
const { OK } = request;
|
const { OK } = request;
|
||||||
Page({
|
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() {
|
scan() {
|
||||||
wx.scanCode({
|
wx.scanCode({
|
||||||
scanType: "qrCode",
|
scanType: "qrCode",
|
||||||
@@ -108,4 +136,29 @@ Page({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
console.log('e', e.detail)
|
||||||
|
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: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
@@ -2,12 +2,14 @@
|
|||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"topbar": "/components/topbar/index",
|
"topbar": "/components/topbar/index",
|
||||||
"select": "/components/select/index",
|
"select": "/components/select/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
"van-button": "@vant/weapp/button/index",
|
"van-button": "@vant/weapp/button/index",
|
||||||
"van-field": "@vant/weapp/field/index",
|
"van-field": "@vant/weapp/field/index",
|
||||||
"van-icon": "@vant/weapp/icon/index",
|
"van-icon": "@vant/weapp/icon/index",
|
||||||
"van-tab": "@vant/weapp/tab/index",
|
"van-tab": "@vant/weapp/tab/index",
|
||||||
"van-tabs": "@vant/weapp/tabs/index",
|
"van-tabs": "@vant/weapp/tabs/index",
|
||||||
"navigator": "/components/navigator/index"
|
"navigator": "/components/navigator/index",
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index"
|
||||||
},
|
},
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
@@ -17,16 +17,48 @@
|
|||||||
</van-tab>
|
</van-tab>
|
||||||
<van-tab title="手动绑定">
|
<van-tab title="手动绑定">
|
||||||
<view>
|
<view>
|
||||||
<select label="园区" type="0" bind:choose="onChoosePark" park="{{park}}" parkName="{{parkName}}" required="{{true}}" />
|
<van-field
|
||||||
<select label="公司名称" type="1" bind:choose="onChooseTenement" park="{{park}}" tenement="{{tenement}}" tenementName="{{tenementName}}" required="{{true}}" />
|
required
|
||||||
|
value="{{ parkName }}"
|
||||||
|
label="园区"
|
||||||
|
placeholder="请选择园区"
|
||||||
|
border="{{ true }}"
|
||||||
|
readonly
|
||||||
|
use-button-slot
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="info" bind:click="onParkFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
required
|
||||||
|
value="{{ tenementName }}"
|
||||||
|
label="商户"
|
||||||
|
placeholder="请选择商户"
|
||||||
|
border="{{ true }}"
|
||||||
|
readonly
|
||||||
|
use-button-slot
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="info" bind:click="onTenementFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
<van-field
|
<van-field
|
||||||
required
|
required
|
||||||
value="{{ phone }}"
|
value="{{ phone }}"
|
||||||
label="预留手机号"
|
|
||||||
placeholder="请输入预留手机号"
|
placeholder="请输入预留手机号"
|
||||||
border="{{ true }}"
|
border="{{ true }}"
|
||||||
bind:change="onChangePhone"
|
bind:change="onChangePhone"
|
||||||
|
>
|
||||||
|
<view slot="label">
|
||||||
|
手机号
|
||||||
|
<van-icon
|
||||||
|
name="question-o"
|
||||||
|
style="margin-left: 8rpx;font-size: 36rpx;"
|
||||||
|
bind:tap="showTooltip"
|
||||||
/>
|
/>
|
||||||
|
</view>
|
||||||
|
</van-field>
|
||||||
<van-field
|
<van-field
|
||||||
required
|
required
|
||||||
value="{{ name }}"
|
value="{{ name }}"
|
||||||
@@ -49,3 +81,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</van-tab>
|
</van-tab>
|
||||||
</van-tabs>
|
</van-tabs>
|
||||||
|
<van-dialog id="van-dialog" />
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
/>
|
||||||
|
|
||||||
|
@@ -115,6 +115,12 @@ Page({
|
|||||||
show: false,
|
show: false,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
jumpToMeterBalanceRecord(e) {
|
||||||
|
const id = e.currentTarget.dataset.id
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/meterBalanceRecord/index?id=${id}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
changeMoney(e) {
|
changeMoney(e) {
|
||||||
const { money } = e.currentTarget.dataset;
|
const { money } = e.currentTarget.dataset;
|
||||||
this.setData({
|
this.setData({
|
||||||
@@ -124,8 +130,26 @@ Page({
|
|||||||
onChangeMoney(e) {
|
onChangeMoney(e) {
|
||||||
this.setData({ money: e.detail })
|
this.setData({ money: e.detail })
|
||||||
},
|
},
|
||||||
|
jumpToMeterList() {
|
||||||
|
const { tenement, user } = this.data;
|
||||||
|
if (!user) {
|
||||||
|
alertInfo("请先登录")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!tenement) {
|
||||||
|
alertInfo("请先选择商户")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/meterList/index?id=' + tenement?.id,
|
||||||
|
})
|
||||||
|
},
|
||||||
async recharge() {
|
async recharge() {
|
||||||
const { user, money, meter, tenement, park } = this.data;
|
const { user, money, meter, tenement, park } = this.data;
|
||||||
|
if (!user || !user.id) {
|
||||||
|
alertInfo("请先登录")
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { code, message, data } = await getTenementExceptionalCase(park?.id, tenement?.id);
|
const { code, message, data } = await getTenementExceptionalCase(park?.id, tenement?.id);
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
|
@@ -60,11 +60,27 @@
|
|||||||
<view class="cardItem">
|
<view class="cardItem">
|
||||||
<view class="cardItemLabel"> 电表余额: </view>
|
<view class="cardItemLabel"> 电表余额: </view>
|
||||||
<view class="cardItemValue" style="position: relative;">
|
<view class="cardItemValue" style="position: relative;">
|
||||||
<view class="text" wx:if="{{user.id}}"> {{meter.money}} </view>
|
<view
|
||||||
|
class="text primaryTextBtn"
|
||||||
|
wx:if="{{user.id}}"
|
||||||
|
bind:tap="jumpToMeterBalanceRecord"
|
||||||
|
data-id="{{meter.id}}"
|
||||||
|
> {{meter.money}} </view>
|
||||||
<view class="text" wx:else> --- </view>
|
<view class="text" wx:else> --- </view>
|
||||||
<van-button type="info" size="small" plain="{{true}}" custom-style="position: absolute; right: -20rpx; bottom: -20rpx;z-index: 99;" bind:click="refreshMeter" wx:if="{{user.id}}">
|
<!-- bind:click="refreshMeter" -->
|
||||||
<view style="width: 160rpx;display: flex;justify-content: center;"><van-icon name="replay" />
|
<van-button
|
||||||
刷新</view>
|
type="info"
|
||||||
|
size="small"
|
||||||
|
plain="{{true}}"
|
||||||
|
custom-style="position: absolute; right: -20rpx; bottom: -20rpx;z-index: 99;"
|
||||||
|
wx:if="{{user.id}}"
|
||||||
|
bind:click="jumpToMeterList"
|
||||||
|
>
|
||||||
|
<view style="width: 160rpx;display: flex;justify-content: center;">
|
||||||
|
<!-- <van-icon name="replay" /> -->
|
||||||
|
查看全部
|
||||||
|
<!-- 刷新 -->
|
||||||
|
</view>
|
||||||
</van-button>
|
</van-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
/* pages/home/index.wxss */
|
/* pages/home/index.wxss */
|
||||||
@import "/app.wxss";
|
@import "/app.wxss";
|
||||||
|
|
||||||
|
.balanceText {
|
||||||
|
color: var(--primary-color)
|
||||||
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
background-color: var(--deep-green);
|
background-color: var(--deep-green);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
112
pages/integral/index.js
Normal file
112
pages/integral/index.js
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
// pages/integral/index.js
|
||||||
|
import request from "../../utils/request"
|
||||||
|
import { getCurrentIntegral, getRedeemableCoupons } from "../../service/system";
|
||||||
|
import { alertInfo, loadingFunc } from "../../utils/index";
|
||||||
|
const { OK } = request;
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
integral: 0,
|
||||||
|
page: 1,
|
||||||
|
size: 20,
|
||||||
|
list: [],
|
||||||
|
totalPage: 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
this.getIntegral();
|
||||||
|
this.getCoupons();
|
||||||
|
},
|
||||||
|
async getCoupons() {
|
||||||
|
const { page, size } = this.data
|
||||||
|
const { code, message, data, total } = await getRedeemableCoupons({ page, size, type: 2 })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data,
|
||||||
|
totalPage: Math.ceil(total / size),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
const that = this;
|
||||||
|
that.setData({
|
||||||
|
page: 1,
|
||||||
|
size: 20
|
||||||
|
}, () => {
|
||||||
|
that.getCoupons()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToRecord() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/integralRecord/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getIntegral() {
|
||||||
|
const { code, message, data } = await getCurrentIntegral();
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
integral: data?.balance || 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
8
pages/integral/index.json
Normal file
8
pages/integral/index.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"discount-coupon": "/components/discountCoupon/index",
|
||||||
|
"empty": "/components/empty/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
14
pages/integral/index.wxml
Normal file
14
pages/integral/index.wxml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<!--pages/integral/index.wxml-->
|
||||||
|
<navigator title="积分兑换" canBack="{{true}}" />
|
||||||
|
<view class="integralWrapper">
|
||||||
|
<view class="currentIntegral">
|
||||||
|
<view class="number"> 当前积分: {{ integral }} </view>
|
||||||
|
<view class="primaryTextBtn" bind:tap="jumpToRecord"> 查看积分明细 </view>
|
||||||
|
</view>
|
||||||
|
<view class="ticketList" wx:if="{{list.length}}">
|
||||||
|
<view wx:for="{{list}}" wx:key="id" class="item">
|
||||||
|
<discount-coupon data="{{item}}" type="{{2}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<empty wx:else bind:refresh="refresh" text="暂无可兑换的优惠券" />
|
||||||
|
</view>
|
23
pages/integral/index.wxss
Normal file
23
pages/integral/index.wxss
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/* pages/integral/index.wxss */
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: rgb(242,243,245);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
margin: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.integralWrapper {
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currentIntegral {
|
||||||
|
font-size: 34rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ticketList {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
113
pages/integralRecord/index.js
Normal file
113
pages/integralRecord/index.js
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
// pages/integralRecord/index.js
|
||||||
|
import request from "../../utils/request"
|
||||||
|
import { getIntegralRecord } from "../../service/system";
|
||||||
|
import { alertInfo, loadingFunc } from "../../utils/index";
|
||||||
|
const { OK } = request;
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
page: 1,
|
||||||
|
size: 20,
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
totalPage: 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
const { page, size } = this.data;
|
||||||
|
const { code, message, data, total } = await getIntegralRecord({ page, size })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data?.map(item => {
|
||||||
|
item.type = ['充值增加', '系统增加', '系统减少', '冲正减少', '退费减少', '兑换优惠券', '积分清零'][item.type - 1]
|
||||||
|
item.nowBalance = Number(item.nowBalance || 0)
|
||||||
|
item.lastBalance = Number(item.lastBalance || 0)
|
||||||
|
item.value = item.nowBalance - item.lastBalance;
|
||||||
|
item.value = item.value > 0 ? `+${item.value}` : item.value
|
||||||
|
return item
|
||||||
|
}) || [],
|
||||||
|
total,
|
||||||
|
totalPage: Math.ceil(total / size),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
page: 1,
|
||||||
|
size: 20,
|
||||||
|
}, () => {
|
||||||
|
that.init();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
const that = this;
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onChangePage(e) {
|
||||||
|
const page = e.detail.currentIndex;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
page
|
||||||
|
}, () => {
|
||||||
|
that.init();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
10
pages/integralRecord/index.json
Normal file
10
pages/integralRecord/index.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"van-cell": "@vant/weapp/cell/index",
|
||||||
|
"van-cell-group": "@vant/weapp/cell-group/index",
|
||||||
|
"empty": "/components/empty/index",
|
||||||
|
"pagination": "/components/pagination/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
23
pages/integralRecord/index.wxml
Normal file
23
pages/integralRecord/index.wxml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<!--pages/integralRecord/index.wxml-->
|
||||||
|
<navigator title="积分明细" canBack="{{true}}" />
|
||||||
|
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<van-cell-group>
|
||||||
|
<van-cell
|
||||||
|
wx:for="{{list}}"
|
||||||
|
wx:key="id"
|
||||||
|
title="{{item.type}}"
|
||||||
|
value="{{item.value}}"
|
||||||
|
label="{{item.createdAt}}"
|
||||||
|
/>
|
||||||
|
</van-cell-group>
|
||||||
|
<pagination
|
||||||
|
currentIndex="{{page}}"
|
||||||
|
totalPage="{{totalPage}}"
|
||||||
|
bind:pagingChange="onChangePage"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view wx:else>
|
||||||
|
<empty bind:refresh="refresh" />
|
||||||
|
</view>
|
1
pages/integralRecord/index.wxss
Normal file
1
pages/integralRecord/index.wxss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* pages/integralRecord/index.wxss */
|
@@ -80,13 +80,32 @@ Page({
|
|||||||
}
|
}
|
||||||
wx.openDocument({
|
wx.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
|
showMenu: true,
|
||||||
// fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了 !!!
|
// fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了 !!!
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
|
|
||||||
},
|
},
|
||||||
fail: function (e) {
|
fail: function (e) {
|
||||||
alertError("打开失败")
|
// alertError("打开失败")
|
||||||
console.log('打开失败错误为', e)
|
// console.log('打开失败错误为', e)
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '打开失败,请复制链接后通过浏览器打开',
|
||||||
|
complete: (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.setClipboardData({
|
||||||
|
data: data,
|
||||||
|
success: () => {
|
||||||
|
alertSuccess("复制成功")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -43,6 +43,15 @@ Component({
|
|||||||
page: page + 1,
|
page: page + 1,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
refresh() {
|
||||||
|
const that = this;
|
||||||
|
that.setData({
|
||||||
|
page: 1,
|
||||||
|
list: []
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(() => that.getList())
|
||||||
|
})
|
||||||
|
},
|
||||||
onRefresh() {
|
onRefresh() {
|
||||||
loadingFunc(() => this.getList())
|
loadingFunc(() => this.getList())
|
||||||
},
|
},
|
||||||
|
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<scroll-view wx:if="{{list.length}}" scroll-y lower-threshold="100px" bindscrolltolower="scrollToLower" style="height: 80vh;" scroll-top="{{topHeight}}px" class="scrView">
|
<scroll-view wx:if="{{list.length}}" scroll-y lower-threshold="100px" bindscrolltolower="scrollToLower" style="height: 80vh;" scroll-top="{{topHeight}}px" class="scrView">
|
||||||
|
<view style="margin: 18rpx 30rpx;">
|
||||||
|
<van-button type="info" size="small" icon="replay" bind:click="refresh"> 刷新 </van-button>
|
||||||
|
</view>
|
||||||
<view class="card" wx:for="{{list}}">
|
<view class="card" wx:for="{{list}}">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@@ -28,7 +31,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="{{item.status === 1 ? 'approving' : 'already'}}">
|
<view class="{{item.status === 1 ? 'approving' : 'already'}}">
|
||||||
<view wx:if="{{item.status === 1}}"> 审核中 </view>
|
<view wx:if="{{item.status === 1}}"> 开票中 </view>
|
||||||
<view wx:else> 已开票 </view>
|
<view wx:else> 已开票 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@@ -38,10 +38,15 @@ Component({
|
|||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setData({ detail: {...data,name: wx.getStorageSync('tenement')?.name, },editType: 'detail', })
|
this.setData({ detail: {...data,name: data?.name || wx.getStorageSync('tenement')?.name, },editType: 'detail', })
|
||||||
},
|
},
|
||||||
async getUser() {
|
async getUser() {
|
||||||
const { code, message, data } = await getUserInfo()
|
const tenement = wx.getStorageSync('tenement')
|
||||||
|
const { code, message, data } = await getUserInfo(tenement?.id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setData({ user: data });
|
this.setData({ user: data });
|
||||||
},
|
},
|
||||||
changeEditType() {
|
changeEditType() {
|
||||||
|
@@ -143,7 +143,19 @@
|
|||||||
value="{{detail.address || '-'}}"
|
value="{{detail.address || '-'}}"
|
||||||
>
|
>
|
||||||
</van-field>
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
label="电话"
|
||||||
|
wx:if="{{editType === 'detail' }}"
|
||||||
|
custom-style="padding-left: 0; padding-right: 0;"
|
||||||
|
readonly="{{editType === 'detail'}}"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{ editType === 'detail' ? false : true }}"
|
||||||
|
bind:change="onChangeText"
|
||||||
|
data-name="tenementPhone"
|
||||||
|
value="{{detail.tenementPhone || '-'}}"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
<van-field
|
<van-field
|
||||||
label="备注"
|
label="备注"
|
||||||
wx:if="{{editType === 'detail' }}"
|
wx:if="{{editType === 'detail' }}"
|
||||||
@@ -255,10 +267,19 @@
|
|||||||
bind:change="onChangeText"
|
bind:change="onChangeText"
|
||||||
data-name="address"
|
data-name="address"
|
||||||
/>
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{formData.tenementPhone}}"
|
||||||
|
label="备注"
|
||||||
|
placeholder="{{'请输入电话'}}"
|
||||||
|
custom-style="padding-left: 0; padding-right: 0;"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{true }}"
|
||||||
|
bind:change="onChangeText"
|
||||||
|
data-name="tenementPhone"
|
||||||
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
value="{{formData.remark}}"
|
value="{{formData.remark}}"
|
||||||
label="备注"
|
label="电话"
|
||||||
placeholder="{{'请输入备注'}}"
|
placeholder="{{'请输入备注'}}"
|
||||||
custom-style="padding-left: 0; padding-right: 0;"
|
custom-style="padding-left: 0; padding-right: 0;"
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
|
@@ -14,7 +14,7 @@ Component({
|
|||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
attached() {
|
attached() {
|
||||||
this.init();
|
loadingFunc(async () => await this.init())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -42,7 +42,7 @@ Component({
|
|||||||
this.setData({ list: data, selectList: new Array(data?.length).map(() => false), allChecked: false, })
|
this.setData({ list: data, selectList: new Array(data?.length).map(() => false), allChecked: false, })
|
||||||
},
|
},
|
||||||
onRefresh() {
|
onRefresh() {
|
||||||
loadingFunc(() => this.init())
|
loadingFunc(async () => await this.init())
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
const { id, index } = e.currentTarget.dataset;
|
const { id, index } = e.currentTarget.dataset;
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
{{ item.tenement.name }}
|
{{ item.tenement.name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
{{ item.range[0] }} - {{ item.range[1] }}
|
{{ item.range[0] }} 至 {{ item.range[1] }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rightMoney"> ¥ {{ item.money }} </view>
|
<view class="rightMoney"> ¥ {{ item.money }} </view>
|
||||||
@@ -23,14 +23,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</van-checkbox-group>
|
</van-checkbox-group>
|
||||||
|
<view style="height: 60rpx"></view>
|
||||||
|
|
||||||
<view class="allSelect">
|
<view class="allSelect">
|
||||||
<van-checkbox value="{{ allChecked }}" bind:change="onAllChecked">
|
<van-checkbox value="{{ allChecked }}" bind:change="onAllChecked">
|
||||||
全选
|
全选
|
||||||
</van-checkbox>
|
</van-checkbox>
|
||||||
<view style="flex: 1; display: flex; align-items: center; justify-content: flex-end;">
|
<view style="flex: 1; display: flex; align-items: center; justify-content: flex-end;white-space: normal;word-break: keep-all;">
|
||||||
<view class="allNumber"> {{ selectCount }} </view>
|
<view class="allNumber"> {{ selectCount }} </view>
|
||||||
笔订单,共
|
笔,共
|
||||||
<view class="allMoney"> ¥ {{selectMoney}} </view>
|
<view class="allMoney"> ¥ {{selectMoney}} </view>
|
||||||
<van-button size="small" type="info" bind:click="next" disabled="{{!selectCount}}"> 下一步 </van-button>
|
<van-button size="small" type="info" bind:click="next" disabled="{{!selectCount}}"> 下一步 </van-button>
|
||||||
</view>
|
</view>
|
||||||
|
@@ -18,6 +18,10 @@
|
|||||||
.middle {
|
.middle {
|
||||||
margin-top: 26rpx;
|
margin-top: 26rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 350rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
|
@@ -33,7 +33,7 @@ Page({
|
|||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!data?.tenement?.id || !data?.name || !data?.phone || !data?.email) {
|
if (!data?.id) {
|
||||||
const user = wx.getStorageSync('user')
|
const user = wx.getStorageSync('user')
|
||||||
if (user.isAdmin) {
|
if (user.isAdmin) {
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
@@ -82,18 +82,17 @@ Page({
|
|||||||
loadingFunc(async() => {
|
loadingFunc(async() => {
|
||||||
const {ids = [], remark } = this.data;
|
const {ids = [], remark } = this.data;
|
||||||
const tenement = wx.getStorageSync('tenement')
|
const tenement = wx.getStorageSync('tenement')
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/invoiceList/index?tab=1',
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
const { code, message, data } = await makeInvoice({ ids, tenement: tenement.id, remark })
|
const { code, message, data } = await makeInvoice({ ids, tenement: tenement.id, remark })
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
alertSuccess("操作成功")
|
alertSuccess("操作成功")
|
||||||
setTimeout(() => {
|
|
||||||
wx.redirectTo({
|
|
||||||
url: '/pages/invoiceList/index?tab=1',
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeShow() {
|
changeShow() {
|
||||||
|
@@ -73,7 +73,7 @@
|
|||||||
<van-field
|
<van-field
|
||||||
value="{{ detail.phone }}"
|
value="{{ detail.phone }}"
|
||||||
wx:if="{{detail.headerType === 0}}"
|
wx:if="{{detail.headerType === 0}}"
|
||||||
label="电话"
|
label="手机号"
|
||||||
readonly
|
readonly
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
disabled="{{true}}"
|
disabled="{{true}}"
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
>
|
>
|
||||||
<view class="modalContentWrapper">
|
<view class="modalContentWrapper">
|
||||||
<van-field
|
<van-field
|
||||||
value="{{ tenementName }}"
|
value="{{ detail.name }}"
|
||||||
label="发票抬头"
|
label="发票抬头"
|
||||||
readonly
|
readonly
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
@@ -54,7 +54,7 @@ Page({
|
|||||||
this.noPermission()
|
this.noPermission()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
alertSuccess("注册成功")
|
alertSuccess("登录成功")
|
||||||
const { token, ...user } = data
|
const { token, ...user } = data
|
||||||
wx.setStorageSync('user', user)
|
wx.setStorageSync('user', user)
|
||||||
wx.setStorageSync('token', data?.token)
|
wx.setStorageSync('token', data?.token)
|
||||||
|
149
pages/meterBalanceRecord/index.js
Normal file
149
pages/meterBalanceRecord/index.js
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
import dayjs from "../../utils/dayjs"
|
||||||
|
import { getDayCalcList } from "../../service/calc"
|
||||||
|
import { alertError } from "../../utils/index";
|
||||||
|
import request from "../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
// pages/meterBalanceRecord/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
time: "",
|
||||||
|
timeStamp: undefined,
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
size: 999,
|
||||||
|
header: [
|
||||||
|
{ key: 'day', title: '日期', },
|
||||||
|
{ key: "money", title: '充值金额', renderBody: (item) => {
|
||||||
|
if (item.type === 1 || item.type === 7) {
|
||||||
|
return item.topFee
|
||||||
|
} else if (item.type === 5 || item.type === 6 || item.type === 8) {
|
||||||
|
return `-${item.topFee}`
|
||||||
|
} else {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{ key: 'overall', title: '电费', renderBody: (item) => {
|
||||||
|
if (item.type == 1 || item.type === 5 || item.type === 6 || item.type === 7 || item.type === 8) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return item.money
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{ key: 'balance', title: '电表余额' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
const { id } = options
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
id,
|
||||||
|
time: dayjs().format("YYYY-MM"),
|
||||||
|
timeStamp: Date.now()
|
||||||
|
}, () => {
|
||||||
|
that.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clickTime() {
|
||||||
|
this.setData({
|
||||||
|
timeVisible: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getList() {
|
||||||
|
const { id, time, page, size } = this.data;
|
||||||
|
const { code, message, data } = await getDayCalcList({
|
||||||
|
page,
|
||||||
|
size,
|
||||||
|
startTime: dayjs(time).subtract(1, 'month').endOf('month').format("YYYY-MM-DD"),
|
||||||
|
endTime: dayjs(time).endOf('month').format("YYYY-MM-DD"),
|
||||||
|
codeId: id,
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data?.map(item => {
|
||||||
|
item.day = dayjs(item.endTime).format("DD日")
|
||||||
|
return item;
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onTimeConfirm(e) {
|
||||||
|
const { time } = e.detail;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
time,
|
||||||
|
timeStamp: new Date(time).getTime(),
|
||||||
|
timeVisible: false,
|
||||||
|
}, () => {
|
||||||
|
that.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onTimeCancel() {
|
||||||
|
this.setData({
|
||||||
|
timeVisible: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onTimeClose() {
|
||||||
|
this.setData({
|
||||||
|
timeVisible: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
13
pages/meterBalanceRecord/index.json
Normal file
13
pages/meterBalanceRecord/index.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"timePicker": "/components/timePicker/index",
|
||||||
|
"van-icon": "@vant/weapp/icon/index",
|
||||||
|
"van-tag": "@vant/weapp/tag/index",
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"empty": "/components/empty/index",
|
||||||
|
"table": "/components/table/table",
|
||||||
|
"van-col": "@vant/weapp/col/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
74
pages/meterBalanceRecord/index.wxml
Normal file
74
pages/meterBalanceRecord/index.wxml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<!--pages/meterBalanceRecord/index.wxml-->
|
||||||
|
<navigator title="电费扣款记录" canBack="{{true}}" />
|
||||||
|
<view class="pageWrapper">
|
||||||
|
<view class="timeChooseWrapper">
|
||||||
|
<view> 选择时间 </view>
|
||||||
|
<view class="time" bind:tap="clickTime">
|
||||||
|
|
||||||
|
<view class="timeText"> {{time}} </view>
|
||||||
|
<van-icon name="arrow-down" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="customTable" wx:if="{{list.length}}">
|
||||||
|
<!-- <view class="customTableTile">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="4">
|
||||||
|
<view style="text-align: center;"> 日期 </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="6">
|
||||||
|
<view style="text-align: center;"> 充值金额 </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="6">
|
||||||
|
<view style="text-align: center;"> 电费 </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="8">
|
||||||
|
<view style="text-align: center;"> 电表余额 </view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
<view class="customTableContent" wx:for="{{list}}" wx:key="id">
|
||||||
|
<view class="tableRow">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="4">
|
||||||
|
<view style="text-align: center;"> {{ item.day }} </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="6">
|
||||||
|
<view style="text-align: center;" wx:if="{{item.type === 1 || item.type === 7}}"> {{ item.topFee }} </view>
|
||||||
|
<view style="text-align: center;" wx:elif="{{item.type === 5 || item.type === 6 || item.type === 8}}"> -{{ item.topFee }} </view>
|
||||||
|
<view style="text-align: center;" wx:else> 0 </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="6">
|
||||||
|
<view style="text-align: center;" wx:if="{{item.type == 1 || item.type === 5 || item.type === 6 || item.type === 7 || item.type === 8}}">
|
||||||
|
0
|
||||||
|
</view>
|
||||||
|
<view style="text-align: center;" wx:else> {{item.money}} </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="8">
|
||||||
|
<view style="text-align: center;"> {{item.balance}} </view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view> -->
|
||||||
|
<table
|
||||||
|
header="{{header}}"
|
||||||
|
list="{{list}}"
|
||||||
|
border="{{true}}"
|
||||||
|
topStyle="text-align: center"
|
||||||
|
bodyStyle="text-align: center"
|
||||||
|
topColor="rgb(242,248,246)"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<empty bind:refresh="getList" wx:else />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<timePicker
|
||||||
|
type="month"
|
||||||
|
currentDate="{{timeStamp}}"
|
||||||
|
show="{{timeVisible}}"
|
||||||
|
bind:cancel="onTimeCancel"
|
||||||
|
bind:close="onTimeClose"
|
||||||
|
bind:confirm="onTimeConfirm"
|
||||||
|
/>
|
91
pages/meterBalanceRecord/index.wxss
Normal file
91
pages/meterBalanceRecord/index.wxss
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/* pages/meterBalanceRecord/index.wxss */
|
||||||
|
.pageWrapper {
|
||||||
|
margin: 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeChooseWrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.timeText {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
width: 890rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.classWrapper {
|
||||||
|
width: 100vw;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thead {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
border-bottom: 1rpx solid #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thead .th {
|
||||||
|
padding: 20rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody {
|
||||||
|
width: 890rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .tr {
|
||||||
|
padding: 20rpx;
|
||||||
|
border-bottom: 1rpx solid #EEEEEE;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .th {
|
||||||
|
word-break: break-all;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customTable {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customTableTile {
|
||||||
|
background-color: var(--light-green);
|
||||||
|
padding: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableRow {
|
||||||
|
padding: 16rpx;
|
||||||
|
border: 1rpx solid #ccc;
|
||||||
|
border-top: 0rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: var(--transparent-green);
|
||||||
|
}
|
94
pages/meterList/index.js
Normal file
94
pages/meterList/index.js
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
// pages/meterList/index.js
|
||||||
|
import { getTenementMeterList } from "../../service/meter";
|
||||||
|
import dayjs from "../../utils/dayjs";
|
||||||
|
import { alertInfo, loadingFunc } from "../../utils/index";
|
||||||
|
import request from '../../utils/request';
|
||||||
|
const { OK } = request;
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
header: [
|
||||||
|
{ key: 'address', title: '电表地址' },
|
||||||
|
{ key: "money", title: '电表余额', },
|
||||||
|
{ key: 'overall', title: '电表总量' },
|
||||||
|
],
|
||||||
|
list: [],
|
||||||
|
},
|
||||||
|
async getMeters({ id }) {
|
||||||
|
const { code, message, data } = await getTenementMeterList(id);
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
this.setData({ meterList: [], meter: {} })
|
||||||
|
wx.setStorageSync('meter', {})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data || [],
|
||||||
|
})
|
||||||
|
// if (!storageMeter) {
|
||||||
|
wx.setStorageSync('meter', data?.[0] || {} )
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await this.getMeters({ id: options?.id })
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
this.setData({
|
||||||
|
time: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
7
pages/meterList/index.json
Normal file
7
pages/meterList/index.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"table": "/components/table/table",
|
||||||
|
"navigator": "/components/navigator/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
13
pages/meterList/index.wxml
Normal file
13
pages/meterList/index.wxml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!--pages/meterList/index.wxml-->
|
||||||
|
<navigator title="电表列表" canBack="{{true}}" />
|
||||||
|
<view class="time">{{ time }} </view>
|
||||||
|
<view style="margin: 0 24rpx;">
|
||||||
|
<table
|
||||||
|
header="{{header}}"
|
||||||
|
list="{{list}}"
|
||||||
|
border="{{true}}"
|
||||||
|
topStyle="text-align: center"
|
||||||
|
bodyStyle="text-align: center"
|
||||||
|
topColor="rgb(242,248,246)"
|
||||||
|
/>
|
||||||
|
</view>
|
10
pages/meterList/index.wxss
Normal file
10
pages/meterList/index.wxss
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/* pages/meterList/index.wxss */
|
||||||
|
.time {
|
||||||
|
margin: 20rpx 24rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgb(97, 93, 93);
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: var(--transparent-green);
|
||||||
|
}
|
@@ -4,8 +4,10 @@ import Dialog from '@vant/weapp/dialog/dialog';
|
|||||||
import { getUserInfo, logout } from "../../service/user";
|
import { getUserInfo, logout } from "../../service/user";
|
||||||
import { getDot } from "../../utils/system";
|
import { getDot } from "../../utils/system";
|
||||||
import request from "../../utils/request"
|
import request from "../../utils/request"
|
||||||
|
import { getCurrentIntegral } from "../../service/system";
|
||||||
const { OK } = request;
|
const { OK } = request;
|
||||||
|
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,6 +17,7 @@ Page({
|
|||||||
user: {},
|
user: {},
|
||||||
tenement: {},
|
tenement: {},
|
||||||
visible: false,
|
visible: false,
|
||||||
|
integral: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,9 +66,20 @@ Page({
|
|||||||
}
|
}
|
||||||
this.init()
|
this.init()
|
||||||
this.getUnReadNumber()
|
this.getUnReadNumber()
|
||||||
|
this.getIntegral()
|
||||||
const tenement = wx.getStorageSync('tenement')
|
const tenement = wx.getStorageSync('tenement')
|
||||||
this.setData({ tenement })
|
this.setData({ tenement })
|
||||||
},
|
},
|
||||||
|
async getIntegral() {
|
||||||
|
const { code, message, data } = await getCurrentIntegral();
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
integral: data?.balance || 0
|
||||||
|
})
|
||||||
|
},
|
||||||
async init() {
|
async init() {
|
||||||
const tenement = wx.getStorageSync('tenement')
|
const tenement = wx.getStorageSync('tenement')
|
||||||
const result = await getUserInfo(tenement?.id);
|
const result = await getUserInfo(tenement?.id);
|
||||||
@@ -86,6 +100,16 @@ Page({
|
|||||||
url: '/pages/workBench/index',
|
url: '/pages/workBench/index',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
jumpToIntegral() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/integral/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToDiscountCoupon() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/discountCoupon/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
async getUnReadNumber() {
|
async getUnReadNumber() {
|
||||||
const dot = await getDot();
|
const dot = await getDot();
|
||||||
this.setData({
|
this.setData({
|
||||||
@@ -120,15 +144,27 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
connect() {
|
connect() {
|
||||||
Dialog.alert({
|
// Dialog.alert({
|
||||||
title: '提示',
|
// title: '提示',
|
||||||
message: '将进入咨询客服页面',
|
// message: '将进入咨询客服页面',
|
||||||
confirmButtonOpenType: "contact",
|
// "confirm-button-open-type": "contact",
|
||||||
showCancelButton: true,
|
// showCancelButton: true,
|
||||||
}).then(() => {
|
// }).then(() => {
|
||||||
// on close
|
// // on close
|
||||||
});
|
// });
|
||||||
|
this.setData({
|
||||||
|
connectShow: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bindConnect() {
|
||||||
|
this.setData({
|
||||||
|
connectShow: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bindCancelConnect() {
|
||||||
|
this.setData({
|
||||||
|
connectShow: false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
jumpToFinance() {
|
jumpToFinance() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
|
@@ -8,7 +8,8 @@
|
|||||||
"navigator": "/components/navigator/index",
|
"navigator": "/components/navigator/index",
|
||||||
"van-grid": "@vant/weapp/grid/index",
|
"van-grid": "@vant/weapp/grid/index",
|
||||||
"avatar": "/components/avatar/index",
|
"avatar": "/components/avatar/index",
|
||||||
"van-grid-item": "@vant/weapp/grid-item/index"
|
"van-grid-item": "@vant/weapp/grid-item/index",
|
||||||
|
"van-image": "@vant/weapp/image/index"
|
||||||
},
|
},
|
||||||
"navigationBarTitleText": "我的",
|
"navigationBarTitleText": "我的",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
|
@@ -8,17 +8,68 @@
|
|||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="nickName"> {{ user.nickName }} </view>
|
<view class="nickName"> {{ user.nickName }} </view>
|
||||||
<view class="tenement"> {{ tenement.name }} </view>
|
<view class="tenement"> {{ tenement.name }} </view>
|
||||||
<view class="integration"> 积分: - </view>
|
<view class="integration"> 积分: {{ integral }} </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-bottom: 20rpx;border-radius: 16rpx; overflow: hidden;">
|
<view style="margin-bottom: 20rpx;border-radius: 16rpx; overflow: hidden;">
|
||||||
<van-grid column-num="3" >
|
<van-grid column-num="3" >
|
||||||
<van-grid-item icon="friends-o" text="财税援助" bind:click="jumpToFinance" />
|
|
||||||
<van-grid-item icon="envelop-o" text="法律援助" bind:click="jumpToLaw" />
|
<van-grid-item
|
||||||
<van-grid-item icon="notes-o" text="电力百科" bind:click="jumpToEncyclopedia" />
|
bind:click="jumpToLaw"
|
||||||
|
use-slot
|
||||||
|
>
|
||||||
|
<van-image
|
||||||
|
width="140rpx"
|
||||||
|
height="140rpx"
|
||||||
|
style="margin-top: 20rpx;"
|
||||||
|
src="/assets/images/law.png"
|
||||||
|
/>
|
||||||
|
<view style="margin-top: 20rpx;font-size: 34rpx;"> 法律援助 </view>
|
||||||
|
</van-grid-item>
|
||||||
|
<van-grid-item
|
||||||
|
bind:click="jumpToFinance"
|
||||||
|
use-slot
|
||||||
|
>
|
||||||
|
<van-image
|
||||||
|
style="margin-top: 20rpx;"
|
||||||
|
width="140rpx"
|
||||||
|
height="140rpx"
|
||||||
|
src="/assets/images/finance.png"
|
||||||
|
/>
|
||||||
|
<view style="margin-top: 20rpx;font-size: 34rpx;"> 财税援助 </view>
|
||||||
|
</van-grid-item>
|
||||||
|
<van-grid-item
|
||||||
|
bind:click="jumpToEncyclopedia"
|
||||||
|
use-slot
|
||||||
|
>
|
||||||
|
<van-image
|
||||||
|
width="140rpx"
|
||||||
|
height="140rpx"
|
||||||
|
style="margin-top: 20rpx;"
|
||||||
|
src="/assets/images/baike.png"
|
||||||
|
/>
|
||||||
|
<view style="margin-top: 20rpx;font-size: 34rpx;"> 电力百科 </view>
|
||||||
|
</van-grid-item>
|
||||||
</van-grid>
|
</van-grid>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="margin-bottom: 20rpx;border-radius: 16rpx; overflow: hidden;">
|
||||||
|
<van-cell
|
||||||
|
title="积分兑换"
|
||||||
|
value=""
|
||||||
|
is-link
|
||||||
|
bind:tap="jumpToIntegral"
|
||||||
|
icon="diamond-o"
|
||||||
|
/>
|
||||||
|
<van-cell
|
||||||
|
title="我的优惠券"
|
||||||
|
value=""
|
||||||
|
is-link
|
||||||
|
bind:tap="jumpToDiscountCoupon"
|
||||||
|
icon="label-o"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
<view style="border-radius: 16rpx; overflow: hidden;">
|
<view style="border-radius: 16rpx; overflow: hidden;">
|
||||||
|
<!-- <button open-type="contact" class="connect"> 联系客服 </button> -->
|
||||||
<van-cell title="联系客服" value="" is-link bind:tap="connect" icon="service-o" />
|
<van-cell title="联系客服" value="" is-link bind:tap="connect" icon="service-o" />
|
||||||
<van-cell icon="qr" wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
|
<van-cell icon="qr" wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
|
||||||
<van-cell icon="friends-o" wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember">
|
<van-cell icon="friends-o" wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember">
|
||||||
@@ -29,7 +80,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="发票抬头" icon="discount-o" value="" is-link bind:tap="jumpToUpdateInvoice">
|
<van-cell title="发票抬头" icon="notes-o" value="" is-link bind:tap="jumpToUpdateInvoice">
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="绑定企业" icon="exchange" value="" is-link bind:tap="bindTenement" />
|
<van-cell title="绑定企业" icon="exchange" value="" is-link bind:tap="bindTenement" />
|
||||||
<van-cell title="常见问题" icon="question-o" value="" is-link bind:tap="jumpToQuestions" />
|
<van-cell title="常见问题" icon="question-o" value="" is-link bind:tap="jumpToQuestions" />
|
||||||
@@ -39,3 +90,17 @@
|
|||||||
|
|
||||||
<van-dialog id="van-dialog" />
|
<van-dialog id="van-dialog" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<van-dialog
|
||||||
|
title="提示"
|
||||||
|
message="将进入咨询客服页面"
|
||||||
|
show="{{ connectShow }}"
|
||||||
|
custom-class="my-custom-class"
|
||||||
|
show-cancel-button
|
||||||
|
use-confirm-button-slot="{{true}}"
|
||||||
|
use-cancel-button-slot="{{true}}"
|
||||||
|
>
|
||||||
|
<button slot="cancel-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindCancelConnect"> 取消 </button>
|
||||||
|
<button open-type="contact" slot="confirm-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindConnect"> 确认 </button>
|
||||||
|
</van-dialog>
|
||||||
|
|
||||||
|
@@ -40,3 +40,6 @@
|
|||||||
margin-top: 6rpx;
|
margin-top: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.connect {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@@ -94,6 +94,7 @@ Page({
|
|||||||
wx.openDocument({
|
wx.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
|
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
|
||||||
|
showMenu: true,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
resolve()
|
resolve()
|
||||||
},
|
},
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
border="{{ false }}"
|
border="{{ false }}"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
value="{{detail.meter.code}}"
|
value="{{detail.meter.sn}}(SN)"
|
||||||
label="电表编号"
|
label="电表编号"
|
||||||
readonly
|
readonly
|
||||||
autosize="{{true}}"
|
autosize="{{true}}"
|
||||||
|
@@ -0,0 +1,74 @@
|
|||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||||
|
import { createTenementWxUser } from "../../../../../../service/tenement";
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
// pages/workBench/components/account/components/editModal/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
type: String,
|
||||||
|
title: String,
|
||||||
|
visible: Boolean,
|
||||||
|
onCancel: Function,
|
||||||
|
park: String,
|
||||||
|
tenement: String,
|
||||||
|
parentPhone:String,
|
||||||
|
parentName:String,
|
||||||
|
parentId:String,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
"parentName,parentId,parentPhone": function(newName, newId, newPhone) {
|
||||||
|
this.setData({ data: { name: newName, id: newId, phone: newPhone } })
|
||||||
|
},
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
data: { name: "", phone: "", id: "" }
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
async onSubmit() {
|
||||||
|
const { data = {}, tenement, park, type } = this.data;
|
||||||
|
if (!data.phone) {
|
||||||
|
alertInfo("请输入手机号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!data.name) {
|
||||||
|
alertInfo("请输入昵称")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { code, message } = await createTenementWxUser({ ...data, tenement, park })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
this.setData({ data: {} })
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
const { name } = e.currentTarget.dataset;
|
||||||
|
const newData = this.data.data;
|
||||||
|
newData[name] = e.detail;
|
||||||
|
this.setData({
|
||||||
|
data: newData,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({ data: {} })
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index"
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,34 @@
|
|||||||
|
<!--pages/workBench/components/account/components/editModal/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="{{title}}"
|
||||||
|
show="{{ visible }}"
|
||||||
|
show-cancel-button
|
||||||
|
bind:confirm="onSubmit"
|
||||||
|
bind:cancel="onCancel"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{data.name}}"
|
||||||
|
label="昵称"
|
||||||
|
placeholder="请输入昵称"
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="120rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
data-name="name"
|
||||||
|
bind:change="onChange"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ data.phone }}"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
label="手机号"
|
||||||
|
border="{{ false }}"
|
||||||
|
title-width="120rpx"
|
||||||
|
data-name="phone"
|
||||||
|
bind:change="onChange"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-dialog>
|
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/account/components/editModal/index.wxss */
|
@@ -0,0 +1,68 @@
|
|||||||
|
// pages/workBench/components/account/components/updatePhoneModa/index.js
|
||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||||
|
import { updateAdminPhone } from "../../../../../../service/tenement";
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
type: String,
|
||||||
|
title: String,
|
||||||
|
visible: Boolean,
|
||||||
|
onCancel: Function,
|
||||||
|
park: String,
|
||||||
|
tenement: String,
|
||||||
|
parentPhone:String,
|
||||||
|
parentName:String,
|
||||||
|
parentId:String,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
"parentPhone": function (newPhone) {
|
||||||
|
this.setData({ phone: newPhone })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
phone: "",
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
async onSubmit() {
|
||||||
|
const { phone, tenement, park, type } = this.data;
|
||||||
|
if (!phone) {
|
||||||
|
alertInfo("请输入手机号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { code, message } = await updateAdminPhone({tenement, phone: phone })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
this.setData({ phone: "" })
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
phone: e.detail,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({ phone: "" })
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index"
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user