Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
399ef43d07 |
20
app.js
20
app.js
|
@ -1,29 +1,11 @@
|
||||||
import { checkUpgrade, getConfigByEnv } from "./utils/index"
|
import { checkUpgrade, getConfigByEnv } from "./utils/index"
|
||||||
|
|
||||||
function share() {
|
// app.js
|
||||||
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, }
|
||||||
},
|
},
|
||||||
|
|
7
app.json
7
app.json
|
@ -27,12 +27,7 @@
|
||||||
"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"
|
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 169 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 434 KiB |
|
@ -1,102 +0,0 @@
|
||||||
// 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 request from '../../../../../utils/request';
|
|
||||||
import { alertInfo, getPixelRatio, loadingFunc } from "../../../../../utils/index";
|
|
||||||
const { OK } = request;
|
|
||||||
Component({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的属性列表
|
|
||||||
*/
|
|
||||||
properties: {
|
|
||||||
meter: String,
|
|
||||||
},
|
|
||||||
observers: {
|
|
||||||
'meter': function() {
|
|
||||||
loadingFunc(async () => {
|
|
||||||
await this.getReadingList();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 组件的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
readingDetailShow: false,
|
|
||||||
readingDetail: {},
|
|
||||||
meterReadingHeader: [
|
|
||||||
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
|
||||||
{ title: '倍率', key: 'ratio' },
|
|
||||||
{ key: 'number', title: '抄表记录' },
|
|
||||||
],
|
|
||||||
meterReadingList: [],
|
|
||||||
yearMonthDayReading: dayjs().format("YYYY-MM-DD"),
|
|
||||||
yearMonthDayReadingStamp: new Date().getTime(),
|
|
||||||
readingPage: 1,
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的方法列表
|
|
||||||
*/
|
|
||||||
methods: {
|
|
||||||
clickReadingTime() {
|
|
||||||
this.setData({
|
|
||||||
readingVisible: true
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async getReadingList() {
|
|
||||||
const { meter, yearMonthDayReading, readingPage } = this.data;
|
|
||||||
const { code, message, data, total } = await getMeterReadingList({
|
|
||||||
id: meter,
|
|
||||||
time: yearMonthDayReading,
|
|
||||||
page: readingPage
|
|
||||||
})
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({ meterReadingList: data, totalPage: Math.ceil(total / 20) })
|
|
||||||
},
|
|
||||||
onReadingTimeClose() {
|
|
||||||
this.setData({ readingVisible: false })
|
|
||||||
},
|
|
||||||
onReadingTimeCancel() {
|
|
||||||
this.setData({ readingVisible: false })
|
|
||||||
},
|
|
||||||
onReadingTimeConfirm(e) {
|
|
||||||
const { time } = e.detail;
|
|
||||||
|
|
||||||
this.setData({
|
|
||||||
yearMonthDayReading: time,
|
|
||||||
yearMonthDayReadingStamp: new Date(time).getTime(),
|
|
||||||
readingVisible: false,
|
|
||||||
readingPage: 1,
|
|
||||||
}, () => {
|
|
||||||
loadingFunc(async () => {
|
|
||||||
await this.getReadingList();
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
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();
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,72 +0,0 @@
|
||||||
<!--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.readAt }}"
|
|
||||||
border="{{ false }}"
|
|
||||||
label="时间"
|
|
||||||
readonly
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ readingDetail.ratio }}"
|
|
||||||
border="{{ false }}"
|
|
||||||
label="倍率"
|
|
||||||
readonly
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ readingDetail.number }}"
|
|
||||||
border="{{ false }}"
|
|
||||||
label="表字"
|
|
||||||
readonly
|
|
||||||
/>
|
|
||||||
</van-cell-group>
|
|
||||||
</view>
|
|
||||||
</van-dialog>
|
|
|
@ -1,95 +0,0 @@
|
||||||
/* 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
|
|
||||||
}
|
|
|
@ -22,26 +22,26 @@ 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: [
|
||||||
|
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||||
|
{ title: '倍率', key: 'ratio' },
|
||||||
|
{ key: 'number', 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 +53,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,7 +74,6 @@ 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;
|
||||||
|
@ -129,12 +128,6 @@ 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(2, "0"));
|
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
|
@ -151,25 +144,18 @@ Page({
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: times
|
data: [...new Set(data?.map(item => item.time))]
|
||||||
},
|
},
|
||||||
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 exist.number;
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
})
|
|
||||||
return {
|
return {
|
||||||
name: element?.meter?.address,
|
name: element?.meter?.address,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: newList
|
stack: 'Total',
|
||||||
|
data: data?.filter(ele => ele?.meter?.id === item).map(item => item.number)
|
||||||
}})
|
}})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -178,7 +164,15 @@ 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;
|
||||||
|
@ -293,7 +287,6 @@ 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) {
|
||||||
|
@ -326,7 +319,6 @@ Page({
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,10 +12,7 @@
|
||||||
"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"
|
||||||
}
|
}
|
|
@ -57,9 +57,9 @@
|
||||||
</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">
|
||||||
|
@ -88,7 +88,19 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{queryType === 1}}">
|
<view wx:if="{{queryType === 1}}">
|
||||||
<reading meter="{{meterId}}" />
|
<view style="margin: 30rpx;">
|
||||||
|
<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;">
|
||||||
|
@ -128,4 +140,3 @@
|
||||||
bind:close="onTimeClose"
|
bind:close="onTimeClose"
|
||||||
bind:confirm="onTimeConfirm"
|
bind:confirm="onTimeConfirm"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
// 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] })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
<!--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>
|
|
|
@ -1,19 +0,0 @@
|
||||||
/* 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,8 +17,7 @@
|
||||||
<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" >
|
<view class="connect" catch:tap="consult" data-id="{{item.id}}">
|
||||||
<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>
|
||||||
|
@ -26,7 +25,6 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<pagination
|
<pagination
|
||||||
currentIndex="{{page}}"
|
currentIndex="{{page}}"
|
||||||
totalPage="{{totalPage}}"
|
totalPage="{{totalPage}}"
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.synopsis {
|
.synopsis {
|
||||||
height: 75rpx;
|
height: 80rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
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({
|
||||||
|
|
||||||
|
@ -10,8 +5,7 @@ Component({
|
||||||
* 组件的属性列表
|
* 组件的属性列表
|
||||||
*/
|
*/
|
||||||
properties: {
|
properties: {
|
||||||
type: Number,
|
|
||||||
data: Object
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,52 +19,6 @@ 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,7 +1,4 @@
|
||||||
{
|
{
|
||||||
"component": true,
|
"component": true,
|
||||||
"usingComponents": {
|
"usingComponents": {}
|
||||||
"van-button": "@vant/weapp/button/index",
|
|
||||||
"van-dialog": "@vant/weapp/dialog/index"
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,39 +1,2 @@
|
||||||
<!--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,60 +1 @@
|
||||||
/* 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,7 +7,6 @@ Component({
|
||||||
properties: {
|
properties: {
|
||||||
title: String,
|
title: String,
|
||||||
canBack: Boolean,
|
canBack: Boolean,
|
||||||
beforeBack: Function,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,11 +34,7 @@ Component({
|
||||||
* 组件的方法列表
|
* 组件的方法列表
|
||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
async back() {
|
back() {
|
||||||
const { beforeBack } = this;
|
|
||||||
if (beforeBack) {
|
|
||||||
await beforeBack();
|
|
||||||
}
|
|
||||||
wx.navigateBack();
|
wx.navigateBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { getLoginParkList, getParkBuildingList } from "../../service/park"
|
import { getParkList } 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, feeType } from "../../utils/data";
|
import { payWays } from "../../utils/data";
|
||||||
import { getTenementList, getWxTenementList } from "../../service/tenement";
|
|
||||||
const { OK } = request;
|
const { OK } = request;
|
||||||
|
|
||||||
// components/searchSelect/index.js
|
// components/searchSelect/index.js
|
||||||
|
@ -17,7 +17,6 @@ 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) {
|
||||||
|
@ -33,7 +32,6 @@ Component({
|
||||||
columns: [],
|
columns: [],
|
||||||
searchText: "",
|
searchText: "",
|
||||||
payWays,
|
payWays,
|
||||||
feeType,
|
|
||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
attached() {
|
attached() {
|
||||||
|
@ -61,12 +59,7 @@ 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: [],
|
||||||
|
@ -85,17 +78,6 @@ 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) {
|
||||||
|
@ -104,18 +86,12 @@ 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 getLoginParkList({keyword: searchText});
|
const { code, message, data: parks = [] } = await getParkList({keyword: searchText});
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return
|
return
|
||||||
|
@ -133,34 +109,9 @@ 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,33 +3,11 @@
|
||||||
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="{{type === 'tenement' ? '请输入关键词搜索后选择' : '请输入搜索关键词'}}"
|
placeholder="请输入搜索关键词"
|
||||||
use-action-slot
|
use-action-slot
|
||||||
bind:change="onChangeSearch"
|
bind:change="onChangeSearch"
|
||||||
>
|
>
|
||||||
|
@ -48,15 +26,14 @@
|
||||||
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="{{ columns }}"
|
columns="{{ payWays }}"
|
||||||
title="{{title}}"
|
title="{{title}}"
|
||||||
show-toolbar="{{true}}"
|
show-toolbar="{{true}}"
|
||||||
bind:cancel="onCancel"
|
bind:cancel="onCancel"
|
||||||
bind:confirm="onConfirm"
|
bind:confirm="onPayConfirm"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</van-popup>
|
</van-popup>
|
|
@ -1 +1,3 @@
|
||||||
/* components/searchSelect/index.wxss */
|
/* components/searchSelect/index.wxss */
|
||||||
|
.van-ellipsis van-picker-column__item {
|
||||||
|
}
|
|
@ -1,48 +0,0 @@
|
||||||
// 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: "" })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"van-icon": "@vant/weapp/icon/index",
|
|
||||||
"van-button": "@vant/weapp/button/index",
|
|
||||||
"van-field": "@vant/weapp/field/index"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
<!--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>
|
|
|
@ -1,37 +0,0 @@
|
||||||
/* 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,9 +27,6 @@ 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,19 +8,12 @@
|
||||||
</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" style="{{topColor ? 'background-color: rgb(242,248,246)' : ''}}">
|
<view class="d-table-row tr-class">
|
||||||
<view class="d-table-cell th-class" style="{{topStyle}}" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
|
<view class="d-table-cell th-class" 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
|
<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}}">
|
||||||
class="d-table-cell td-class"
|
<view class="text">
|
||||||
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>
|
||||||
|
|
|
@ -1,120 +0,0 @@
|
||||||
// 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() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
<!--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>
|
|
|
@ -1,8 +0,0 @@
|
||||||
/* pages/discountCoupon/index.wxss */
|
|
||||||
page {
|
|
||||||
background-color: rgb(242,243,245);
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
margin: 20rpx;
|
|
||||||
}
|
|
|
@ -2,7 +2,6 @@
|
||||||
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({
|
||||||
|
|
||||||
|
@ -94,33 +93,6 @@ 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",
|
||||||
|
@ -136,29 +108,4 @@ 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,14 +2,12 @@
|
||||||
"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,48 +17,16 @@
|
||||||
</van-tab>
|
</van-tab>
|
||||||
<van-tab title="手动绑定">
|
<van-tab title="手动绑定">
|
||||||
<view>
|
<view>
|
||||||
<van-field
|
<select label="园区" type="0" bind:choose="onChoosePark" park="{{park}}" parkName="{{parkName}}" required="{{true}}" />
|
||||||
required
|
<select label="公司名称" type="1" bind:choose="onChooseTenement" park="{{park}}" tenement="{{tenement}}" tenementName="{{tenementName}}" required="{{true}}" />
|
||||||
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 }}"
|
||||||
|
@ -81,13 +49,3 @@
|
||||||
</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"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
|
@ -124,26 +124,8 @@ 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)
|
||||||
|
|
|
@ -62,20 +62,9 @@
|
||||||
<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" wx:if="{{user.id}}"> {{meter.money}} </view>
|
||||||
<view class="text" wx:else> --- </view>
|
<view class="text" wx:else> --- </view>
|
||||||
<!-- bind:click="refreshMeter" -->
|
<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}}">
|
||||||
<van-button
|
<view style="width: 160rpx;display: flex;justify-content: center;"><van-icon name="replay" />
|
||||||
type="info"
|
刷新</view>
|
||||||
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,112 +0,0 @@
|
||||||
// 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() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"usingComponents": {
|
|
||||||
"navigator": "/components/navigator/index",
|
|
||||||
"discount-coupon": "/components/discountCoupon/index",
|
|
||||||
"empty": "/components/empty/index"
|
|
||||||
},
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
<!--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>
|
|
|
@ -1,23 +0,0 @@
|
||||||
/* 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;
|
|
||||||
}
|
|
|
@ -1,113 +0,0 @@
|
||||||
// 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() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
<!--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 +0,0 @@
|
||||||
/* pages/integralRecord/index.wxss */
|
|
|
@ -38,15 +38,11 @@ Component({
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setData({ detail: {...data,name: data?.name || wx.getStorageSync('tenement')?.name, },editType: 'detail', })
|
this.setData({ detail: {...data,name: wx.getStorageSync('tenement')?.name, },editType: 'detail', })
|
||||||
},
|
},
|
||||||
async getUser() {
|
async getUser() {
|
||||||
const tenement = wx.getStorageSync('tenement')
|
const tenement = wx.getStorageSync('tenement');
|
||||||
const { code, message, data } = await getUserInfo(tenement?.id)
|
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,19 +143,7 @@
|
||||||
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' }}"
|
||||||
|
@ -267,19 +255,10 @@
|
||||||
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() {
|
||||||
loadingFunc(() => this.init())
|
this.init();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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,15 +23,14 @@
|
||||||
</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;white-space: normal;word-break: keep-all;">
|
<view style="flex: 1; display: flex; align-items: center; justify-content: flex-end;">
|
||||||
<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,10 +18,6 @@
|
||||||
.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?.id) {
|
if (!data?.tenement?.id || !data?.name || !data?.phone || !data?.email) {
|
||||||
const user = wx.getStorageSync('user')
|
const user = wx.getStorageSync('user')
|
||||||
if (user.isAdmin) {
|
if (user.isAdmin) {
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
|
|
|
@ -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="{{ detail.name }}"
|
value="{{ tenementName }}"
|
||||||
label="发票抬头"
|
label="发票抬头"
|
||||||
readonly
|
readonly
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
|
|
@ -1,94 +0,0 @@
|
||||||
// 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() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"usingComponents": {
|
|
||||||
"table": "/components/table/table",
|
|
||||||
"navigator": "/components/navigator/index"
|
|
||||||
},
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
<!--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>
|
|
|
@ -1,10 +0,0 @@
|
||||||
/* pages/meterList/index.wxss */
|
|
||||||
.time {
|
|
||||||
margin: 20rpx 24rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: rgb(97, 93, 93);
|
|
||||||
}
|
|
||||||
|
|
||||||
page {
|
|
||||||
background-color: var(--transparent-green);
|
|
||||||
}
|
|
|
@ -4,10 +4,8 @@ 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({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,7 +15,6 @@ Page({
|
||||||
user: {},
|
user: {},
|
||||||
tenement: {},
|
tenement: {},
|
||||||
visible: false,
|
visible: false,
|
||||||
integral: 0,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,20 +63,9 @@ 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);
|
||||||
|
@ -100,16 +86,6 @@ 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({
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
"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,66 +8,16 @@
|
||||||
<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"> 积分: {{ integral }} </view>
|
<view class="integration"> 积分: - </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
|
<van-grid-item icon="envelop-o" text="法律援助" bind:click="jumpToLaw" />
|
||||||
bind:click="jumpToLaw"
|
<van-grid-item icon="notes-o" text="电力百科" bind:click="jumpToEncyclopedia" />
|
||||||
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;">
|
||||||
<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" />
|
||||||
|
@ -79,7 +29,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="发票抬头" icon="notes-o" value="" is-link bind:tap="jumpToUpdateInvoice">
|
<van-cell title="发票抬头" icon="discount-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" />
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"van-dialog": "@vant/weapp/dialog/index",
|
|
||||||
"search-select": "/components/searchSelect/index",
|
|
||||||
"van-field": "@vant/weapp/field/index"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
<!--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>
|
|
|
@ -1 +0,0 @@
|
||||||
/* pages/workBench/components/account/components/editModal/index.wxss */
|
|
|
@ -1,68 +0,0 @@
|
||||||
// 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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"van-dialog": "@vant/weapp/dialog/index",
|
|
||||||
"search-select": "/components/searchSelect/index",
|
|
||||||
"van-field": "@vant/weapp/field/index"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
<!--pages/workBench/components/account/components/updatePhoneModa/index.wxml-->
|
|
||||||
<van-dialog
|
|
||||||
use-slot
|
|
||||||
title="编辑管理员手机号"
|
|
||||||
show="{{ visible }}"
|
|
||||||
show-cancel-button
|
|
||||||
bind:confirm="onSubmit"
|
|
||||||
bind:cancel="onCancel"
|
|
||||||
>
|
|
||||||
<view class="modalContentWrapper">
|
|
||||||
<van-field
|
|
||||||
value="{{ phone }}"
|
|
||||||
placeholder="请输入新管理员手机号"
|
|
||||||
label="手机号"
|
|
||||||
border="{{ false }}"
|
|
||||||
title-width="120rpx"
|
|
||||||
data-name="phone"
|
|
||||||
bind:change="onChange"
|
|
||||||
>
|
|
||||||
</van-field>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</van-dialog>
|
|
|
@ -1 +0,0 @@
|
||||||
/* pages/workBench/components/account/components/updatePhoneModa/index.wxss */
|
|
|
@ -1,182 +0,0 @@
|
||||||
// pages/workBench/components/account/index.js
|
|
||||||
import request from "../../../../utils/request"
|
|
||||||
import { getTenementBackInfo, updateUserApp} from "../../../../service/tenement"
|
|
||||||
import { getBackApproveList, removeUser } from "../../../../service/user"
|
|
||||||
import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index"
|
|
||||||
const { OK } = request
|
|
||||||
|
|
||||||
Component({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的属性列表
|
|
||||||
*/
|
|
||||||
properties: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
list: [],
|
|
||||||
tenementInfo: {},
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的方法列表
|
|
||||||
*/
|
|
||||||
methods: {
|
|
||||||
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'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onConfirm(e) {
|
|
||||||
const that = this;
|
|
||||||
const { type, data } = e.detail;
|
|
||||||
switch(type) {
|
|
||||||
case "park":
|
|
||||||
this.setData({
|
|
||||||
park: data.id,
|
|
||||||
parkName: data.name,
|
|
||||||
show: false,
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case "tenement":
|
|
||||||
this.setData({
|
|
||||||
tenement: data.id,
|
|
||||||
tenementName: data.name,
|
|
||||||
show: false,
|
|
||||||
}, () => {
|
|
||||||
that.initUserList();
|
|
||||||
that.getTenementInfo();
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async setAdmin(e) {
|
|
||||||
const { id, name } = e.currentTarget.dataset;
|
|
||||||
const { tenement } = this.data;
|
|
||||||
await wxModal({ content: `确认要将${name}设置为管理吗?` })
|
|
||||||
const { code, message } = await updateUserApp({ userId: id, type: 2, tenement: tenement })
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
alertSuccess("转交成功")
|
|
||||||
this.initUserList();
|
|
||||||
this.getTenementInfo();
|
|
||||||
},
|
|
||||||
onCancel() {
|
|
||||||
this.setData({
|
|
||||||
show: false,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleDelete(e) {
|
|
||||||
const { id, name } = e.currentTarget.dataset;
|
|
||||||
const { tenement } = this.data;
|
|
||||||
const that = this;
|
|
||||||
wx.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: `确认要移除${name}吗?`,
|
|
||||||
complete: async (res) => {
|
|
||||||
if (res.cancel) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.confirm) {
|
|
||||||
const { code, message } = await removeUser(id, tenement)
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
alertSuccess("删除成功")
|
|
||||||
that.initUserList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onEditConfirm() {
|
|
||||||
this.initUserList()
|
|
||||||
this.handleCancel();
|
|
||||||
},
|
|
||||||
onUpdatePhoneConfirm() {
|
|
||||||
this.setData({ parentPhone: "", phone: "", type: "", title: "" })
|
|
||||||
this.getTenementInfo();
|
|
||||||
this.initUserList()
|
|
||||||
},
|
|
||||||
async getTenementInfo() {
|
|
||||||
const { tenement, park } = this.data;
|
|
||||||
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
tenementInfo: data,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async initUserList() {
|
|
||||||
const { tenement } = this.data;
|
|
||||||
const { code, message, data } = await getBackApproveList(tenement, 1);
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
list: data,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleAddSon() {
|
|
||||||
this.setData({
|
|
||||||
visible: true,
|
|
||||||
type: "add",
|
|
||||||
title: "新建子账号"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleChangeMain() {
|
|
||||||
const { tenementInfo = {} } = this.data;
|
|
||||||
this.setData({
|
|
||||||
updatePhoneVisible: true,
|
|
||||||
type: "update",
|
|
||||||
title: "编辑管理员",
|
|
||||||
parentPhone: tenementInfo.phone,
|
|
||||||
// name: main.WechatUserName,
|
|
||||||
// id: main.WechatUserID,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleUpdatePhoneCancel() {
|
|
||||||
this.setData({
|
|
||||||
updatePhoneVisible: false,
|
|
||||||
type: "",
|
|
||||||
phone: "",
|
|
||||||
parentPhone: "",
|
|
||||||
name: "",
|
|
||||||
id: "",
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCancel() {
|
|
||||||
this.setData({
|
|
||||||
visible: false,
|
|
||||||
type: "",
|
|
||||||
phone: "",
|
|
||||||
name: "",
|
|
||||||
id: "",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"van-field": "@vant/weapp/field/index",
|
|
||||||
"van-button": "@vant/weapp/button/index",
|
|
||||||
"search-select": "/components/searchSelect/index",
|
|
||||||
"van-empty": "@vant/weapp/empty/index",
|
|
||||||
"table": "/components/table/table",
|
|
||||||
"pagination": "/components/pagination/index",
|
|
||||||
"empty": "/components/empty/index",
|
|
||||||
"van-radio": "@vant/weapp/radio/index",
|
|
||||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
|
||||||
"van-tag": "@vant/weapp/tag/index",
|
|
||||||
"edit-modal": "./components/editModal/index",
|
|
||||||
"updatePhoneModal": "./components/updatePhoneModal/index",
|
|
||||||
"van-row": "@vant/weapp/row/index",
|
|
||||||
"van-col": "@vant/weapp/col/index",
|
|
||||||
"searchSelectWrapper": "/components/searchSelectWrapper/index",
|
|
||||||
"van-image": "@vant/weapp/image/index"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,142 +0,0 @@
|
||||||
<!--pages/workBench/components/account/index.wxml-->
|
|
||||||
<view>
|
|
||||||
<searchSelectWrapper
|
|
||||||
label="园区"
|
|
||||||
placeholder="请选择园区"
|
|
||||||
text="{{ parkName }}"
|
|
||||||
bind:search="onParkFocus"
|
|
||||||
/>
|
|
||||||
<searchSelectWrapper
|
|
||||||
label="商户"
|
|
||||||
placeholder="请选择商户"
|
|
||||||
text="{{ tenementName }}"
|
|
||||||
bind:search="onTenementFocus"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" />
|
|
||||||
<view wx:else>
|
|
||||||
<view class="operateBox">
|
|
||||||
<van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleAddSon"> 添加子账号 </van-button>
|
|
||||||
<van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleChangeMain"> 修改主账号 </van-button>
|
|
||||||
</view>
|
|
||||||
<view class="customTable">
|
|
||||||
<view class="customTableTile">
|
|
||||||
<van-row>
|
|
||||||
<van-col span="24">
|
|
||||||
<view class="tableTitleRow">
|
|
||||||
<view class="tableTitleRow">
|
|
||||||
<view class="tbody">
|
|
||||||
<view class="tr">
|
|
||||||
<view class="th" style="width: 200rpx;text-align: center;"> {{tenementInfo.shortName}} </view>
|
|
||||||
<view> {{tenementInfo.fullName}} </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="24">
|
|
||||||
<view class="tableTitleRow">
|
|
||||||
<view class="tbody">
|
|
||||||
<view class="tr">
|
|
||||||
<view
|
|
||||||
class="th"
|
|
||||||
style="width: 200rpx;text-align: center;"
|
|
||||||
wx:if="{{tenementInfo.feeType === 0}}"
|
|
||||||
> 华昌宝能收费 </view>
|
|
||||||
<view
|
|
||||||
class="th"
|
|
||||||
style="width: 200rpx;text-align: center;"
|
|
||||||
wx:if="{{tenementInfo.feeType === 1}}"
|
|
||||||
> 物业代收1 </view>
|
|
||||||
<view
|
|
||||||
class="th"
|
|
||||||
style="width: 200rpx;text-align: center;"
|
|
||||||
wx:if="{{tenementInfo.feeType === 2}}"
|
|
||||||
> 物业代收2 </view>
|
|
||||||
<view
|
|
||||||
class="th"
|
|
||||||
style="width: 200rpx;text-align: center;"
|
|
||||||
wx:if="{{tenementInfo.feeType === 3}}"
|
|
||||||
> 物业代收线损 </view>
|
|
||||||
<view style="margin-left: 26rpx;"> {{tenementInfo.contact}} {{tenementInfo.phone}} </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</van-col>
|
|
||||||
|
|
||||||
</van-row>
|
|
||||||
</view>
|
|
||||||
<view class="customTableContent">
|
|
||||||
<van-row wx:if="{{list.length}}">
|
|
||||||
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
|
||||||
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
|
||||||
<view class="tbody">
|
|
||||||
<view class="tr tableRow">
|
|
||||||
<view class="th" style="width: 200rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatUserName }} </view>
|
|
||||||
<view class="th" style="width: 250rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatPhone }} </view>
|
|
||||||
<view class="th" style="display: flex;">
|
|
||||||
<view style="margin-left: 16rpx;">
|
|
||||||
<view wx:if="{{!item.Permissions}}" style="display: inline-block;">
|
|
||||||
<view
|
|
||||||
class="primaryTextBtn"
|
|
||||||
bind:tap="handleDelete"
|
|
||||||
data-id="{{item.WechatUserID}}"
|
|
||||||
data-name="{{item.WechatUserName}}"
|
|
||||||
>
|
|
||||||
<van-image width="40rpx" height="40rpx" src="/assets/images/stop.png" />
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="primaryTextBtn"
|
|
||||||
bind:tap="setAdmin"
|
|
||||||
data-id="{{item.WechatUserID}}"
|
|
||||||
data-name="{{item.WechatUserName}}"
|
|
||||||
style="margin-left: 16rpx;"
|
|
||||||
>
|
|
||||||
<van-image width="40rpx" height="40rpx" src="/assets/images/tihuan.png" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<van-tag type="primary" wx:else>管理员</van-tag>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</block>
|
|
||||||
</van-radio-group>
|
|
||||||
</van-row>
|
|
||||||
<empty wx:else bind:refresh="initUserList" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<search-select
|
|
||||||
show="{{show}}"
|
|
||||||
title="{{title}}"
|
|
||||||
type="{{type}}"
|
|
||||||
park="{{park}}"
|
|
||||||
isBack="{{true}}"
|
|
||||||
bindconfirm="onConfirm"
|
|
||||||
bindcancel="onCancel"
|
|
||||||
/>
|
|
||||||
<edit-modal
|
|
||||||
visible="{{visible}}"
|
|
||||||
type="{{type}}"
|
|
||||||
title="{{title}}"
|
|
||||||
tenement="{{tenement}}"
|
|
||||||
park="{{park}}"
|
|
||||||
parentPhone="{{phone}}"
|
|
||||||
parentName="{{name}}"
|
|
||||||
parentId="{{id}}"
|
|
||||||
bind:ok="onEditConfirm"
|
|
||||||
bind:cancel="handleCancel"
|
|
||||||
/>
|
|
||||||
<updatePhoneModal
|
|
||||||
visible="{{updatePhoneVisible}}"
|
|
||||||
tenement="{{tenement}}"
|
|
||||||
park="{{park}}"
|
|
||||||
parentPhone="{{parentPhone}}"
|
|
||||||
bind:ok="onUpdatePhoneConfirm"
|
|
||||||
bind:cancel="handleUpdatePhoneCancel"
|
|
||||||
/>
|
|
|
@ -1,71 +0,0 @@
|
||||||
/* pages/workBench/components/account/index.wxss */
|
|
||||||
|
|
||||||
.operateBox {
|
|
||||||
margin: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.tr {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tbody .th {
|
|
||||||
word-break: break-all;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.primaryTextBtn {
|
|
||||||
color: #1989fa;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customTable {
|
|
||||||
margin: 20rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customTableTile {
|
|
||||||
background-color: var(--light-green);
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tableTitleRow {
|
|
||||||
padding: 16rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tableRow {
|
|
||||||
padding: 16rpx;
|
|
||||||
border: 1rpx solid #ccc;
|
|
||||||
border-top: 0rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
page {
|
|
||||||
background-color: rgb(228,240,236);
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
|
@ -1,7 +1,8 @@
|
||||||
// pages/workBench/components/recharge/components/waitApprove/index.js
|
// pages/workBench/components/approve/index.js
|
||||||
import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index";
|
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
|
||||||
import { getRechargeApproveList, rechargeApprove } from "../../../../../../service/recharge"
|
import { getParkMeterList, handleOperateMeterSwitch } from "../../../../service/meter"
|
||||||
import request from "../../../../../../utils/request"
|
import { getRechargeApproveList, rechargeApprove } from "../../../../service/recharge"
|
||||||
|
import request from "../../../../utils/request"
|
||||||
const { OK } = request
|
const { OK } = request
|
||||||
|
|
||||||
// pages/workBench/components/record/index.js
|
// pages/workBench/components/record/index.js
|
||||||
|
@ -11,7 +12,7 @@ Component({
|
||||||
* 组件的属性列表
|
* 组件的属性列表
|
||||||
*/
|
*/
|
||||||
properties: {
|
properties: {
|
||||||
status: Number
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,9 +25,7 @@ Component({
|
||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
attached() {
|
attached() {
|
||||||
loadingFunc(async () => {
|
this.init();
|
||||||
await this.init();
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -51,17 +50,7 @@ Component({
|
||||||
await that.init();
|
await that.init();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.onCancel();
|
this.onConcal();
|
||||||
},
|
|
||||||
onSearchKeyword(e) {
|
|
||||||
const that = this;
|
|
||||||
that.setData({
|
|
||||||
keyword: e.detail
|
|
||||||
}, () => {
|
|
||||||
loadingFunc(async () => {
|
|
||||||
await that.init();
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
onChangeKeyword(e) {
|
onChangeKeyword(e) {
|
||||||
this.setData({ keywordTemp: e.detail })
|
this.setData({ keywordTemp: e.detail })
|
||||||
|
@ -77,8 +66,8 @@ Component({
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
const { page, keyword, park, status } = this.data;
|
const { page, keyword, park } = this.data;
|
||||||
const { code, message, data, total } = await getRechargeApproveList({ park, page, keyword, status })
|
const { code, message, data, total } = await getRechargeApproveList({ park, page, keyword })
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message);
|
alertInfo(message);
|
||||||
return;
|
return;
|
||||||
|
@ -174,7 +163,7 @@ Component({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onCancel() {
|
onConcal() {
|
||||||
this.setData({
|
this.setData({
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
|
@ -10,7 +10,6 @@
|
||||||
"empty": "/components/empty/index",
|
"empty": "/components/empty/index",
|
||||||
"van-radio": "@vant/weapp/radio/index",
|
"van-radio": "@vant/weapp/radio/index",
|
||||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||||
"van-dialog": "@vant/weapp/dialog/index",
|
"van-dialog": "@vant/weapp/dialog/index"
|
||||||
"searchSelectWrapper": "/components/searchSelectWrapper/index"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,39 +1,34 @@
|
||||||
<!--pages/workBench/components/recharge/components/waitApprove/index.wxml-->
|
<!--pages/workBench/components/approve/index.wxml-->
|
||||||
<searchSelectWrapper
|
<!--pages/workBench/components/record/index.wxml-->
|
||||||
label="园区"
|
<van-field
|
||||||
|
value="{{ parkName }}"
|
||||||
placeholder="请选择园区"
|
placeholder="请选择园区"
|
||||||
text="{{parkName}}"
|
label="园区"
|
||||||
bind:search="onParkFocus"
|
readonly
|
||||||
/>
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
|
||||||
<searchSelectWrapper
|
<van-field
|
||||||
label="关键字"
|
value="{{ keyword }}"
|
||||||
placeholder="请输入关键字"
|
placeholder="请输入关键字"
|
||||||
text="{{meterName}}"
|
label="关键字"
|
||||||
bind:searchKeyword="onSearchKeyword"
|
border="{{ false }}"
|
||||||
type="inputSearch"
|
use-button-slot
|
||||||
/>
|
bind:change="onChangeKeyword"
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="primary" bind:click="onSearch">
|
||||||
|
搜索
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
<view>
|
<view>
|
||||||
<view wx:if="{{list.length}}">
|
<view wx:if="{{list.length}}">
|
||||||
<view class="operate" wx:if="{{status === 2}}">
|
|
||||||
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
|
|
||||||
<van-button
|
|
||||||
type="info"
|
|
||||||
size="small"
|
|
||||||
style="margin-right: 30rpx;"
|
|
||||||
bind:click="handleApprove"
|
|
||||||
data-status="0"
|
|
||||||
disabled="{{!record}}"
|
|
||||||
> 同意 </van-button>
|
|
||||||
<van-button
|
|
||||||
size="small"
|
|
||||||
bind:click="handleClear"
|
|
||||||
disabled="{{!record}}"
|
|
||||||
bind:click="handleApprove"
|
|
||||||
data-status="1"
|
|
||||||
> 拒绝 </van-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tableWrapper">
|
<view class="tableWrapper">
|
||||||
<view class="table">
|
<view class="table">
|
||||||
<view class="thead">
|
<view class="thead">
|
||||||
|
@ -46,11 +41,11 @@
|
||||||
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||||
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||||
<view class="tr">
|
<view class="tr">
|
||||||
<view class="th" style="width: 70rpx">
|
<view class="th" style="width: 60rpx">
|
||||||
<van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio>
|
<van-radio wx:if="{{item.orderStatus !== '已退回'}}" name="{{item.id}}"></van-radio>
|
||||||
</view>
|
</view>
|
||||||
<view class="th" style="width: 250rpx"> {{ item.tenement.shortName }} </view>
|
<view class="th" style="width: 200rpx"> {{ item.tenement.shortName }} </view>
|
||||||
<view class="th" style="width: 150rpx"> {{ item.money }} </view>
|
<view class="th" style="width: 200rpx"> {{ item.money }} </view>
|
||||||
<view class="th" style="width: 200rpx">
|
<view class="th" style="width: 200rpx">
|
||||||
<view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}">
|
<view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}">
|
||||||
查看详细
|
查看详细
|
||||||
|
@ -71,8 +66,27 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<empty bind:refresh="init" wx:else />
|
<empty bind:refresh="init" wx:else />
|
||||||
|
<view class="operate">
|
||||||
|
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
|
||||||
|
<van-button
|
||||||
|
type="info"
|
||||||
|
size="small"
|
||||||
|
style="margin-right: 30rpx;"
|
||||||
|
bind:click="handleApprove"
|
||||||
|
data-status="0"
|
||||||
|
disabled="{{!record}}"
|
||||||
|
> 同意 </van-button>
|
||||||
|
<van-button
|
||||||
|
size="small"
|
||||||
|
bind:click="handleClear"
|
||||||
|
disabled="{{!record}}"
|
||||||
|
bind:click="handleApprove"
|
||||||
|
data-status="1"
|
||||||
|
> 拒绝 </van-button>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<search-select
|
<search-select
|
||||||
show="{{show}}"
|
show="{{show}}"
|
||||||
|
@ -80,7 +94,7 @@
|
||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onCancel"
|
bindcancel="onConcal"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-dialog
|
<van-dialog
|
|
@ -1,4 +1,4 @@
|
||||||
/* pages/workBench/components/recharge/components/waitApprove/index.wxss */
|
/* pages/workBench/components/approve/index.wxss */
|
||||||
.table {
|
.table {
|
||||||
width: 810rpx;
|
width: 810rpx;
|
||||||
|
|
|
@ -1,152 +0,0 @@
|
||||||
// pages/workBench/components/recharge/components/reharge/index.js
|
|
||||||
|
|
||||||
import { handleRecharge } from "../../../../../../service/recharge";
|
|
||||||
import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index";
|
|
||||||
import request from '../../../../../../utils/request'
|
|
||||||
const { OK } = request;
|
|
||||||
|
|
||||||
Component({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的属性列表
|
|
||||||
*/
|
|
||||||
properties: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的方法列表
|
|
||||||
*/
|
|
||||||
methods: {
|
|
||||||
onParkFocus() {
|
|
||||||
this.setData({
|
|
||||||
show: true,
|
|
||||||
title: "园区",
|
|
||||||
type: 'park'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onMeterFocus() {
|
|
||||||
const { park } = this.data;
|
|
||||||
if (!park) {
|
|
||||||
alertInfo("请先选择园区")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
show: true,
|
|
||||||
title: "电表",
|
|
||||||
type: 'meter'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onConfirm(e) {
|
|
||||||
const { data, type, way } = e.detail;
|
|
||||||
switch(type) {
|
|
||||||
case "park":
|
|
||||||
this.setData({
|
|
||||||
parkName: data.name,
|
|
||||||
park: data.id,
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case "meter":
|
|
||||||
this.setData({
|
|
||||||
meterName: `${data.meterNo}-${data.address}${data.tenement?.name ? '-' + data.tenement?.name : ''}`,
|
|
||||||
meter: data.id,
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case "pay":
|
|
||||||
this.setData({
|
|
||||||
payName: data,
|
|
||||||
way: way,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.onCancel();
|
|
||||||
},
|
|
||||||
onCancel() {
|
|
||||||
this.setData({
|
|
||||||
show: false,
|
|
||||||
title: "",
|
|
||||||
type: "",
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onPayFocus() {
|
|
||||||
this.setData({
|
|
||||||
show: true,
|
|
||||||
title: "付款方式",
|
|
||||||
type: 'pay'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onChangeMoney(e) {
|
|
||||||
this.setData({ money: e.detail })
|
|
||||||
},
|
|
||||||
onChangeVoucherNo(e) {
|
|
||||||
this.setData({ voucherNo: e.detail })
|
|
||||||
},
|
|
||||||
handleClear() {
|
|
||||||
this.setData({
|
|
||||||
park: "",
|
|
||||||
parkName: "",
|
|
||||||
meter: "",
|
|
||||||
meterName: "",
|
|
||||||
way: "",
|
|
||||||
payName: "",
|
|
||||||
show: false,
|
|
||||||
title: "",
|
|
||||||
type: "",
|
|
||||||
money: null,
|
|
||||||
voucherNo: null
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async handleSubmit() {
|
|
||||||
const that = this;
|
|
||||||
const { park, meter, money, way, voucherNo } = this.data;
|
|
||||||
if (!park) {
|
|
||||||
alertInfo("请选择园区");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!meter) {
|
|
||||||
alertInfo("请选择电表")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!money) {
|
|
||||||
alertInfo("请输入金额")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!way && way !== 0) {
|
|
||||||
alertInfo("请选择付款方式")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!voucherNo) {
|
|
||||||
alertInfo("请输入凭证号")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
loadingFunc(async () => {
|
|
||||||
const { code, message } = await handleRecharge(park, {
|
|
||||||
amount: `${money || ''}`,
|
|
||||||
meter,
|
|
||||||
paymentType: way,
|
|
||||||
voucherNo,
|
|
||||||
type: 0
|
|
||||||
})
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
alertSuccess("充值成功")
|
|
||||||
setTimeout(() => {
|
|
||||||
that.handleClear()
|
|
||||||
that.setData({
|
|
||||||
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"van-popup": "@vant/weapp/popup/index",
|
|
||||||
"search-select": "/components/searchSelect/index",
|
|
||||||
"van-field": "@vant/weapp/field/index",
|
|
||||||
"van-button": "@vant/weapp/button/index",
|
|
||||||
"searchSelectWrapper": "/components/searchSelectWrapper/index"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
<!--pages/workBench/components/recharge/components/reharge/index.wxml-->
|
|
||||||
<van-cell-group>
|
|
||||||
<searchSelectWrapper
|
|
||||||
label="园区"
|
|
||||||
placeholder="请选择园区"
|
|
||||||
text="{{parkName}}"
|
|
||||||
bind:search="onParkFocus"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<searchSelectWrapper
|
|
||||||
label="电表"
|
|
||||||
placeholder="请选择电表"
|
|
||||||
text="{{meterName}}"
|
|
||||||
bind:search="onMeterFocus"
|
|
||||||
/>
|
|
||||||
<searchSelectWrapper
|
|
||||||
label="金额"
|
|
||||||
placeholder="请输入金额"
|
|
||||||
text="{{meterName}}"
|
|
||||||
fieldType="number"
|
|
||||||
type="input"
|
|
||||||
bind:changeText="onChangeMoney"
|
|
||||||
/>
|
|
||||||
<searchSelectWrapper
|
|
||||||
label="付款方式"
|
|
||||||
placeholder="请选择付款方式"
|
|
||||||
text="{{payName}}"
|
|
||||||
bind:search="onPayFocus"
|
|
||||||
/>
|
|
||||||
<searchSelectWrapper
|
|
||||||
label="凭证"
|
|
||||||
placeholder="请输入凭证"
|
|
||||||
type="input"
|
|
||||||
bind:changeText="onChangeVoucherNo"
|
|
||||||
/>
|
|
||||||
</van-cell-group>
|
|
||||||
|
|
||||||
<view style="margin-top: 60rpx;display: flex; justify-content: center; align-items: center;">
|
|
||||||
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleSubmit"> 确认 </van-button>
|
|
||||||
<van-button size="small" bind:click="handleClear"> 清空 </van-button>
|
|
||||||
</view>
|
|
||||||
<search-select
|
|
||||||
show="{{show}}"
|
|
||||||
title="{{title}}"
|
|
||||||
type="{{type}}"
|
|
||||||
park="{{park}}"
|
|
||||||
bindconfirm="onConfirm"
|
|
||||||
bindcancel="onCancel"
|
|
||||||
wx:if="{{show}}"
|
|
||||||
/>
|
|
|
@ -1 +0,0 @@
|
||||||
/* pages/workBench/components/recharge/components/reharge/index.wxss */
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
import { handleRecharge } from "../../../../service/recharge";
|
||||||
|
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
|
||||||
|
import request from '../../../../utils/request'
|
||||||
|
const { OK } = request;
|
||||||
|
|
||||||
// pages/workBench/components/recharge/index.js
|
// pages/workBench/components/recharge/index.js
|
||||||
Component({
|
Component({
|
||||||
|
@ -14,21 +18,135 @@ Component({
|
||||||
* 组件的初始数据
|
* 组件的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
active: 0,
|
show: false,
|
||||||
segmentedList: ['待审核', '已审核', '充值'],
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组件的方法列表
|
* 组件的方法列表
|
||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
changeQueryType(e) {
|
onParkFocus(e) {
|
||||||
console.log("change", e)
|
|
||||||
const { type } = e.currentTarget.dataset;
|
|
||||||
this.setData({
|
this.setData({
|
||||||
active: type
|
show: true,
|
||||||
|
title: "园区",
|
||||||
|
type: 'park'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onMeterFocus(e) {
|
||||||
|
const { park } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请先选择园区")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "电表",
|
||||||
|
type: 'meter'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const { data, type, way } = e.detail;
|
||||||
|
switch(type) {
|
||||||
|
case "park":
|
||||||
|
this.setData({
|
||||||
|
parkName: data.name,
|
||||||
|
park: data.id,
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case "meter":
|
||||||
|
this.setData({
|
||||||
|
meterName: `${data.meterNo}-${data.address}${data.tenement?.name ? '-' + data.tenement?.name : ''}`,
|
||||||
|
meter: data.id,
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case "pay":
|
||||||
|
this.setData({
|
||||||
|
payName: data,
|
||||||
|
way: way,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.onConcal();
|
||||||
|
},
|
||||||
|
onConcal() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onPayFocus() {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "付款方式",
|
||||||
|
type: 'pay'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeMoney(e) {
|
||||||
|
this.setData({ money: e.detail })
|
||||||
|
},
|
||||||
|
onChangeVoucherNo(e) {
|
||||||
|
this.setData({ voucherNo: e.detail })
|
||||||
|
},
|
||||||
|
handleClear() {
|
||||||
|
this.setData({
|
||||||
|
park: "",
|
||||||
|
parkName: "",
|
||||||
|
meter: "",
|
||||||
|
meterName: "",
|
||||||
|
way: "",
|
||||||
|
payName: "",
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
money: null,
|
||||||
|
voucherNo: null
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async handleSubmit() {
|
||||||
|
const that = this;
|
||||||
|
const { park, meter, money, way, voucherNo } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请选择园区");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!meter) {
|
||||||
|
alertInfo("请选择电表")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!money) {
|
||||||
|
alertInfo("请输入金额")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!way && way !== 0) {
|
||||||
|
alertInfo("请选择付款方式")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!voucherNo) {
|
||||||
|
alertInfo("请输入凭证号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loadingFunc(async () => {
|
||||||
|
const { code, message } = await handleRecharge(park, {
|
||||||
|
amount: `${money || ''}`,
|
||||||
|
meter,
|
||||||
|
paymentType: way,
|
||||||
|
voucherNo,
|
||||||
|
type: 0
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("充值成功")
|
||||||
|
setTimeout(() => {
|
||||||
|
that.handleClear()
|
||||||
|
that.setData({
|
||||||
|
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
|
@ -1,11 +1,9 @@
|
||||||
{
|
{
|
||||||
"component": true,
|
"component": true,
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"van-button": "@vant/weapp/button/index",
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
"segmented": "/components/Segmented/index",
|
"search-select": "/components/searchSelect/index",
|
||||||
"recharge": "./components/reharge/index",
|
"van-field": "@vant/weapp/field/index",
|
||||||
"approve": "./components/approve/index",
|
"van-button": "@vant/weapp/button/index"
|
||||||
"van-row": "@vant/weapp/row/index",
|
|
||||||
"van-col": "@vant/weapp/col/index"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,20 +1,81 @@
|
||||||
<!--pages/workBench/components/recharge/index.wxml-->
|
<!--pages/workBench/components/recharge/index.wxml-->
|
||||||
<view style="">
|
<van-cell-group>
|
||||||
<view class="typeQuery">
|
<van-field
|
||||||
<van-row>
|
value="{{ parkName }}"
|
||||||
<van-col span="8">
|
placeholder="请选择园区"
|
||||||
<view class="typeQueryText" style="color: {{active === 0 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{0}}"> 待审核 </view>
|
label="园区"
|
||||||
</van-col>
|
readonly
|
||||||
<van-col span="8">
|
border="{{ false }}"
|
||||||
<view class="typeQueryText" style="color: {{active === 1 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{1}}"> 已审核 </view>
|
use-button-slot
|
||||||
</van-col>
|
title-width="70rpx"
|
||||||
<van-col span="8">
|
>
|
||||||
<view class="typeQueryText" style="color: {{active === 2 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{2}}"> 充值 </view>
|
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
|
||||||
</van-col>
|
选择
|
||||||
</van-row>
|
</van-button>
|
||||||
</view>
|
</van-field>
|
||||||
</view>
|
<van-field
|
||||||
|
value="{{ meterName }}"
|
||||||
|
placeholder="请选择电表"
|
||||||
|
label="电表"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="70rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="primary" bind:click="onMeterFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ money }}"
|
||||||
|
placeholder="请输入金额"
|
||||||
|
label="金额"
|
||||||
|
type="number"
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="70rpx"
|
||||||
|
bind:change="onChangeMoney"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ payName }}"
|
||||||
|
placeholder="请选择付款方式"
|
||||||
|
label="付款方式"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="140rpx"
|
||||||
|
>
|
||||||
|
<van-button
|
||||||
|
slot="button"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
bind:click="onPayFocus"
|
||||||
|
>
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ voucherNo }}"
|
||||||
|
placeholder="请输入凭证"
|
||||||
|
label="凭证"
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="70rpx"
|
||||||
|
bind:change="onChangeVoucherNo"
|
||||||
|
/>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
<approve status="{{2}}" wx:if="{{active === 0}}" />
|
<view style="margin-top: 60rpx;display: flex; justify-content: center; align-items: center;">
|
||||||
<approve status="{{1}}" wx:if="{{active === 1}}" />
|
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleSubmit"> 确认 </van-button>
|
||||||
<recharge wx:if="{{active === 2}}" />
|
<van-button size="small" bind:click="handleClear"> 清空 </van-button>
|
||||||
|
</view>
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onConcal"
|
||||||
|
wx:if="{{show}}"
|
||||||
|
/>
|
||||||
|
|
|
@ -1,27 +1 @@
|
||||||
/* pages/workBench/components/recharge/index.wxss */
|
/* pages/workBench/components/recharge/index.wxss */
|
||||||
page {
|
|
||||||
background-color: rgb(228,240,236);
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.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;
|
|
||||||
}
|
|
|
@ -33,41 +33,18 @@ Component({
|
||||||
type: 'park'
|
type: 'park'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onMeterFocus(e) {
|
|
||||||
const { park } = this.data;
|
|
||||||
if (!park) {
|
|
||||||
alertInfo("请先选择园区")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
show: true,
|
|
||||||
title: "电表",
|
|
||||||
type: 'meter'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onConfirm(e) {
|
onConfirm(e) {
|
||||||
const { data, type } = e.detail;
|
const { data } = e.detail;
|
||||||
const that = this;
|
const that = this;
|
||||||
switch(type) {
|
|
||||||
case "park":
|
|
||||||
this.setData({
|
this.setData({
|
||||||
parkName: data.name,
|
parkName: data.name,
|
||||||
park: data.id,
|
park: data.id,
|
||||||
})
|
|
||||||
break;
|
|
||||||
case "meter":
|
|
||||||
this.setData({
|
|
||||||
meterName: data.address,
|
|
||||||
meter: data.id,
|
|
||||||
}, () => {
|
}, () => {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
await that.init();
|
await that.init();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
break;
|
this.onConcal();
|
||||||
}
|
|
||||||
|
|
||||||
this.onCancel();
|
|
||||||
},
|
},
|
||||||
onChangeKeyword(e) {
|
onChangeKeyword(e) {
|
||||||
this.setData({ keywordTemp: e.detail })
|
this.setData({ keywordTemp: e.detail })
|
||||||
|
@ -83,11 +60,11 @@ Component({
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
const { page, park, meter } = this.data;
|
const { page, keyword, park } = this.data;
|
||||||
if (!park) {
|
if (!park) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { code, message, data, total } = await getParkMeterList({ park, keyword: meter, page })
|
const { code, message, data, total } = await getParkMeterList({ park, keyword, page })
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message);
|
alertInfo(message);
|
||||||
return;
|
return;
|
||||||
|
@ -109,7 +86,7 @@ Component({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onCancel() {
|
onConcal() {
|
||||||
this.setData({
|
this.setData({
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
||||||
|
@ -123,10 +100,11 @@ Component({
|
||||||
},
|
},
|
||||||
async handleMeterSwitchOn() {
|
async handleMeterSwitchOn() {
|
||||||
const that = this;
|
const that = this;
|
||||||
const { meter, meterName } = this.data;
|
const { meter, list } = this.data;
|
||||||
|
const item = list.find(ele => ele.id === meter)
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: `您确认要对${meterName || 当前电表}进行合闸吗?`,
|
content: `您确认要对${item?.address || 当前电表}进行合闸吗?`,
|
||||||
complete: async (res) => {
|
complete: async (res) => {
|
||||||
if (res.cancel) {
|
if (res.cancel) {
|
||||||
|
|
||||||
|
@ -149,10 +127,11 @@ Component({
|
||||||
},
|
},
|
||||||
async handleMeterSwitchOff() {
|
async handleMeterSwitchOff() {
|
||||||
const that = this;
|
const that = this;
|
||||||
const { meter, meterName } = this.data;
|
const { meter, list } = this.data;
|
||||||
|
const item = list.find(ele => ele.id === meter)
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: `您确认要对${meterName || 当前电表}进行拉闸吗?`,
|
content: `您确认要对${item?.address || 当前电表}进行拉闸吗?`,
|
||||||
complete: async (res) => {
|
complete: async (res) => {
|
||||||
if (res.cancel) {
|
if (res.cancel) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
"empty": "/components/empty/index",
|
"empty": "/components/empty/index",
|
||||||
"van-radio": "@vant/weapp/radio/index",
|
"van-radio": "@vant/weapp/radio/index",
|
||||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||||
"van-tag": "@vant/weapp/tag/index",
|
"van-tag": "@vant/weapp/tag/index"
|
||||||
"van-row": "@vant/weapp/row/index",
|
|
||||||
"van-col": "@vant/weapp/col/index",
|
|
||||||
"searchSelectWrapper": "/components/searchSelectWrapper/index"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,22 +1,84 @@
|
||||||
<!--pages/workBench/components/record/index.wxml-->
|
<!--pages/workBench/components/record/index.wxml-->
|
||||||
<searchSelectWrapper
|
<van-field
|
||||||
label="园区"
|
value="{{ parkName }}"
|
||||||
placeholder="请选择园区"
|
placeholder="请选择园区"
|
||||||
text="{{parkName}}"
|
label="园区"
|
||||||
bind:search="onParkFocus"
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
|
||||||
|
<van-empty wx:if="{{!park}}" description="选择园区后查看" />
|
||||||
|
<view wx:else>
|
||||||
|
<van-field
|
||||||
|
value="{{ keyword }}"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
label="关键字"
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
bind:change="onChangeKeyword"
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="primary" bind:click="onSearch">
|
||||||
|
搜索
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<view>
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<van-radio-group value="{{ radio }}" bind:change="onChangeSelectMeter">
|
||||||
|
<view class="classWrapper">
|
||||||
|
<view class="table">
|
||||||
|
<view class="thead">
|
||||||
|
<view class="th" style="width: 80rpx"> </view>
|
||||||
|
<view class="th" style="width: 200rpx"> 商户名称 </view>
|
||||||
|
<view class="th" style="width: 200rpx"> 电表地址 </view>
|
||||||
|
<view class="th" style="width: 150rpx"> 电表余额 </view>
|
||||||
|
<view class="th" style="width: 130rpx"> 拉合闸 </view>
|
||||||
|
<view class="th" style="width: 130rpx"> 是否失联 </view>
|
||||||
|
</view>
|
||||||
|
<view class="tbody">
|
||||||
|
<view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item" class="tr">
|
||||||
|
|
||||||
|
<view class="th" style="width: 80rpx">
|
||||||
|
<van-radio name="{{item.id}}"></van-radio>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 200rpx"> {{ item.tenement.shortName }} </view>
|
||||||
|
<view class="th" style="width: 200rpx"> {{ item.address }} </view>
|
||||||
|
<view class="th" style="width: 150rpx"> {{ item.amount }} </view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:if="{{item.onPosition}}">
|
||||||
|
<van-tag type="warning">拉闸</van-tag>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:else>
|
||||||
|
<van-tag type="primary">合闸</van-tag>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:if="{{canConnect}}">
|
||||||
|
<van-tag type="primary">在线</van-tag>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:else>
|
||||||
|
<van-tag type="danger">失联</van-tag>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-radio-group>
|
||||||
|
<pagination
|
||||||
|
currentIndex="{{page}}"
|
||||||
|
totalPage="{{totalPage}}"
|
||||||
|
bind:pagingChange="onChangePage"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<searchSelectWrapper
|
</view>
|
||||||
label="电表"
|
<empty bind:refresh="init" wx:else />
|
||||||
placeholder="请选择电表"
|
|
||||||
text="{{meterName}}"
|
|
||||||
bind:search="onMeterFocus"
|
|
||||||
/>
|
|
||||||
<van-empty wx:if="{{!meter}}" description="选择电表后查看" />
|
|
||||||
<view wx:else>
|
|
||||||
<view wx:if="{{list.length}}">
|
|
||||||
<view class="operate">
|
<view class="operate">
|
||||||
<view style="margin-top: 24rpx; margin-bottom: 24rpx;display: flex; justify-content: center; align-items: center;">
|
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
|
||||||
<van-button
|
<van-button
|
||||||
type="info"
|
type="info"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -27,67 +89,7 @@
|
||||||
<van-button size="small" bind:click="handleClear" disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button>
|
<van-button size="small" bind:click="handleClear" disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="customTable" wx:for="{{list}}" wx:key="id">
|
|
||||||
<view class="customTableTile">
|
|
||||||
<van-row>
|
|
||||||
<van-col span="8">
|
|
||||||
<view style="text-align: center;"> {{item.tenement.shortName}} </view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="16"><view style="margin-left: 16rpx;">{{item.tenement.name}}</view> </van-col>
|
|
||||||
</van-row>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="customTableContent">
|
|
||||||
<van-row >
|
|
||||||
<van-col span="24">
|
|
||||||
<view class="tableRow">
|
|
||||||
<van-row gutter="5">
|
|
||||||
<van-col span="8" wx:if="{{item.type === 0}}">
|
|
||||||
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 商户电表 </view></van-col>
|
|
||||||
<van-col span="8" wx:elif="{{item.type === 2}}">
|
|
||||||
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 公摊电表 </view></van-col>
|
|
||||||
<van-col span="8" wx:else>
|
|
||||||
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 园区电表 </view></van-col>
|
|
||||||
<van-col span="16">表号:{{item.meterNo}}</van-col>
|
|
||||||
</van-row>
|
|
||||||
</view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="24">
|
|
||||||
<view class="tableRow">
|
|
||||||
<van-row gutter="5">
|
|
||||||
<van-col span="8">
|
|
||||||
<view style="text-align: center;border-right: 1rpx solid #ccc;"> {{item.address}} </view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="16">SN:{{item.meterSn}}</van-col>
|
|
||||||
</van-row>
|
|
||||||
</view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="24">
|
|
||||||
<view class="tableRow">
|
|
||||||
<van-row gutter="5">
|
|
||||||
<van-col span="8">
|
|
||||||
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 表字:{{item.amount}} </view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="16">余额:{{item.money}}</van-col>
|
|
||||||
</van-row>
|
|
||||||
</view>
|
|
||||||
</van-col>
|
|
||||||
<van-col span="24">
|
|
||||||
<view class="tableRow">
|
|
||||||
<van-row gutter="5">
|
|
||||||
<van-col span="8" wx:if="{{item.onPosition === 0}}">
|
|
||||||
<view style="text-align: center;border-right: 1rpx solid #ccc;">合闸</view> </van-col>
|
|
||||||
<van-col span="8" wx:else><view style="text-align: center;border-right: 1rpx solid #ccc;">拉闸</view> </van-col>
|
|
||||||
<van-col span="8" wx:if="{{item.canConnect}}"><view style="text-align: center;">在线</view> </van-col>
|
|
||||||
<van-col span="8" wx:else><view style="text-align: center;">失联</view> </van-col>
|
|
||||||
</van-row>
|
|
||||||
</view>
|
|
||||||
</van-col>
|
|
||||||
</van-row>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<empty bind:refresh="init" wx:else />
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<search-select
|
<search-select
|
||||||
|
@ -96,6 +98,6 @@
|
||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onCancel"
|
bindcancel="onConcal"
|
||||||
wx:if="{{show}}"
|
wx:if="{{show}}"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -39,25 +39,3 @@
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customTable {
|
|
||||||
margin: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
page {
|
|
||||||
background-color: rgb(228,240,236);
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,106 +0,0 @@
|
||||||
// pages/workBench/components/tenement/components/bindMeter/index.js
|
|
||||||
// 0015980101
|
|
||||||
import { bindMeter, } from "../../../../../../service/tenement"
|
|
||||||
import { getWorkMeterDetail } from "../../../../../../service/meter"
|
|
||||||
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
|
||||||
import request from "../../../../../../utils/request"
|
|
||||||
import dayjs from "../../../../../../utils/dayjs"
|
|
||||||
const { OK } = request
|
|
||||||
Component({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的属性列表
|
|
||||||
*/
|
|
||||||
properties: {
|
|
||||||
tenement: String,
|
|
||||||
tenementName: String,
|
|
||||||
park: String,
|
|
||||||
visible: Boolean,
|
|
||||||
meterId: String,
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组件的方法列表
|
|
||||||
*/
|
|
||||||
methods: {
|
|
||||||
onMeterFocus(e) {
|
|
||||||
const { park } = this.data;
|
|
||||||
if (!park) {
|
|
||||||
alertInfo("请先选择园区")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
show: true,
|
|
||||||
title: "电表",
|
|
||||||
type: 'meter'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onCancel() {
|
|
||||||
this.setData({
|
|
||||||
show: false,
|
|
||||||
title: "",
|
|
||||||
type: "",
|
|
||||||
})
|
|
||||||
// this.triggerEvent("close")
|
|
||||||
},
|
|
||||||
onClose() {
|
|
||||||
this.setData({
|
|
||||||
show: false,
|
|
||||||
title: "",
|
|
||||||
type: "",
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onChange(e) {
|
|
||||||
const { name } = e.currentTarget.dataset;
|
|
||||||
this.setData({
|
|
||||||
[name]: e.detail
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async onSubmit() {
|
|
||||||
const { overall, critical, peak, valley, park, tenement, meter } = this.data;
|
|
||||||
const { code, message } = await bindMeter(park, tenement, { code: meter, overall:overall? Number(overall) : overall,
|
|
||||||
critical : critical ? Number(critical) : critical,
|
|
||||||
peak: peak ? Number(peak) : peak,
|
|
||||||
valley : valley ? Number(valley) : valley, readAt: dayjs().format('YYYY-MM-DD HH:mm:ss') })
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
alertSuccess("绑定成功")
|
|
||||||
this.triggerEvent("ok")
|
|
||||||
},
|
|
||||||
onConfirm(e) {
|
|
||||||
const { type, data } = e.detail;
|
|
||||||
const that = this;
|
|
||||||
console.log("e.deail", e.detail)
|
|
||||||
switch(type) {
|
|
||||||
case "meter":
|
|
||||||
this.setData({
|
|
||||||
meter: data.id,
|
|
||||||
meterName: data.address,
|
|
||||||
show: false,
|
|
||||||
})
|
|
||||||
this.getMeterDetail(data.id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async getMeterDetail(id) {
|
|
||||||
const { code, message, data } = await getWorkMeterDetail(id)
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
overall: Number(data?.overall || 0),
|
|
||||||
status: data?.breakType ? '合闸' : "分闸"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"component": true,
|
|
||||||
"usingComponents": {
|
|
||||||
"van-dialog": "@vant/weapp/dialog/index",
|
|
||||||
"search-select": "/components/searchSelect/index",
|
|
||||||
"van-field": "@vant/weapp/field/index",
|
|
||||||
"van-button": "@vant/weapp/button/index"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,102 +0,0 @@
|
||||||
<!--pages/workBench/components/tenement/components/bindMeter/index.wxml-->
|
|
||||||
<van-dialog
|
|
||||||
use-slot
|
|
||||||
title="绑定表计"
|
|
||||||
show="{{ visible }}"
|
|
||||||
show-cancel-button
|
|
||||||
bind:confirm="onSubmit"
|
|
||||||
bind:close="onClose"
|
|
||||||
>
|
|
||||||
<view class="modalContentWrapper">
|
|
||||||
<van-field
|
|
||||||
value="{{tenementName}}"
|
|
||||||
label="商户名称"
|
|
||||||
readonly
|
|
||||||
type="textarea"
|
|
||||||
autosize="{{true}}"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{false}}"
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ meterName }}"
|
|
||||||
placeholder="请选择电表"
|
|
||||||
label="电表"
|
|
||||||
readonly
|
|
||||||
border="{{ false }}"
|
|
||||||
use-button-slot
|
|
||||||
title-width="100rpx"
|
|
||||||
>
|
|
||||||
<van-button slot="button" size="small" type="info" bind:click="onMeterFocus">
|
|
||||||
选择
|
|
||||||
</van-button>
|
|
||||||
</van-field>
|
|
||||||
<van-field
|
|
||||||
value="{{ status }}"
|
|
||||||
label="状态"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{false}}"
|
|
||||||
readonly
|
|
||||||
type="digit"
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ overall }}"
|
|
||||||
label="表字"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{false}}"
|
|
||||||
bind:change="onChange"
|
|
||||||
data-name="overall"
|
|
||||||
placeholder="请输入表字"
|
|
||||||
type="digit"
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ critical }}"
|
|
||||||
label="尖"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{false}}"
|
|
||||||
bind:change="onChange"
|
|
||||||
data-name="critical"
|
|
||||||
placeholder="请输入有功(尖)"
|
|
||||||
type="digit"
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ peak }}"
|
|
||||||
label="峰"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{false}}"
|
|
||||||
bind:change="onChange"
|
|
||||||
data-name="peak"
|
|
||||||
placeholder="请输入有功(峰)"
|
|
||||||
type="digit"
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ overall }}"
|
|
||||||
label="平"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{false}}"
|
|
||||||
bind:change="onChange"
|
|
||||||
data-name="overall"
|
|
||||||
placeholder="请输入有功(平)"
|
|
||||||
type="digit"
|
|
||||||
/>
|
|
||||||
<van-field
|
|
||||||
value="{{ valley }}"
|
|
||||||
label="谷"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{false}}"
|
|
||||||
bind:change="onChange"
|
|
||||||
data-name="valley"
|
|
||||||
type="digit"
|
|
||||||
placeholder="请输入有功(谷)"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</van-dialog>
|
|
||||||
|
|
||||||
<search-select
|
|
||||||
show="{{show}}"
|
|
||||||
title="{{title}}"
|
|
||||||
type="{{type}}"
|
|
||||||
park="{{park}}"
|
|
||||||
bindconfirm="onConfirm"
|
|
||||||
bindcancel="onCancel"
|
|
||||||
/>
|
|
|
@ -1 +0,0 @@
|
||||||
/* pages/workBench/components/tenement/components/bindMeter/index.wxss */
|
|
|
@ -1,103 +0,0 @@
|
||||||
// pages/workBench/components/tenement/components/createTenement/index.js
|
|
||||||
Page({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {
|
|
||||||
this.setData(options)
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onBuildingFocus() {
|
|
||||||
const { park } = this.data;
|
|
||||||
if (!park) {
|
|
||||||
alertInfo("请先选择园区")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
show: true,
|
|
||||||
title: "建筑",
|
|
||||||
type: 'building'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onFeeTypeFocus() {
|
|
||||||
const { park } = this.data;
|
|
||||||
if (!park) {
|
|
||||||
alertInfo("请先选择园区")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
show: true,
|
|
||||||
title: "建筑",
|
|
||||||
type: 'building'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
beforeBack() {
|
|
||||||
let pages = getCurrentPages(); // 获取当前页面栈
|
|
||||||
let prevPage = pages[pages.length - 2]; // 获取上一页
|
|
||||||
const { tenement = '', tenementName = '', park = '', parkName = '' } = this.data;
|
|
||||||
// 修改上一页的数据
|
|
||||||
prevPage.setData({
|
|
||||||
needBackShow: true,
|
|
||||||
tenement,
|
|
||||||
tenementName,
|
|
||||||
park,
|
|
||||||
parkName
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"usingComponents": {
|
|
||||||
"search-select": "/components/searchSelect/index",
|
|
||||||
"van-field": "@vant/weapp/field/index",
|
|
||||||
"van-button": "@vant/weapp/button/index",
|
|
||||||
"navigator": "/components/navigator/index"
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user