修改缴费记录和对公

This commit is contained in:
qiaomu 2024-09-10 11:07:45 +08:00
parent 6e2608925c
commit 8482453da0
11 changed files with 120 additions and 20 deletions

View File

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

View File

@ -4,6 +4,7 @@ import { createPublicTopUp } from '../../service/recharge'
import { uploadFile, uploadPublicFile } from "../../service/public"; import { uploadFile, uploadPublicFile } from "../../service/public";
import { alertInfo, loadingFunc, getFileName, alertSuccess } from "../../utils/index"; import { alertInfo, loadingFunc, getFileName, alertSuccess } 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;
@ -77,11 +78,22 @@ Page({
alertInfo(message) alertInfo(message)
return; return;
} }
alertSuccess("已提交,待审核") Dialog.alert({
setTimeout(() => { title: '提示',
message: '订单提交成功!请耐心等待管理员审核,如果疑问请联系客服',
confirmButtonOpenType: "contact",
showCancelButton: true,
confirmButtonText: "联系客服",
cancelButtonText: "关闭"
}).then(() => {
}).catch(() => {
wx.redirectTo({ wx.redirectTo({
url: '/pages/home/index', url: '/pages/rechargeRecord/index',
}) })
});
setTimeout(() => {
}, 600) }, 600)
}, },
handleDelete() { handleDelete() {

View File

@ -3,6 +3,7 @@
"navigator": "/components/navigator/index", "navigator": "/components/navigator/index",
"van-field": "@vant/weapp/field/index", "van-field": "@vant/weapp/field/index",
"van-uploader": "@vant/weapp/uploader/index", "van-uploader": "@vant/weapp/uploader/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-button": "@vant/weapp/button/index" "van-button": "@vant/weapp/button/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"

View File

@ -23,3 +23,4 @@
<van-button bind:tap="handleSubmit" type="info" block style="margin-top: 20rpx;"> 提交 </van-button> <van-button bind:tap="handleSubmit" type="info" block style="margin-top: 20rpx;"> 提交 </van-button>
</view> </view>
<van-dialog id="van-dialog" />

View File

@ -1,7 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"navigator": "/components/navigator/index", "navigator": "/components/navigator/index",
"scrollPageWrapper": "/components/scrollPageWrapper/index" "scrollPageWrapper": "/components/scrollPageWrapper/index",
"empty": "/components/empty/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@ -2,9 +2,12 @@
<scrollPageWrapper> <scrollPageWrapper>
<navigator title="常见问题" canBack="{{true}}" /> <navigator title="常见问题" canBack="{{true}}" />
<view class="content"> <view class="content">
<view wx:for="{{questions}}" wx:key="index"> <view wx:if="{{questions.length}}">
<view class="question"> {{index + 1}}、 {{ item.name }} </view> <view wx:for="{{questions}}" wx:key="index">
<view class="answer"> {{ item.content }} </view> <view class="question"> {{index + 1}}、 {{ item.name }} </view>
<view class="answer"> {{ item.content }} </view>
</view>
</view> </view>
<empty bind:refresh="getList" />
</view> </view>
</scrollPageWrapper> </scrollPageWrapper>

View File

@ -83,6 +83,27 @@
readonly readonly
border="{{ false }}" border="{{ false }}"
/> />
<van-field
value="处理中"
label="订单状态"
readonly
border="{{ false }}"
wx:if="{{detail.orderStatus === 1}}"
/>
<van-field
value="已退回"
label="订单状态"
readonly
border="{{ false }}"
wx:elif="{{detail.orderStatus === 2}}"
/>
<van-field
value="已充值"
label="订单状态"
readonly
border="{{ false }}"
wx:else
/>
</van-cell-group> </van-cell-group>
<view class="operate"> <view class="operate">

View File

@ -16,6 +16,7 @@ Page({
list: [ list: [
], ],
way: ["现金", "银行卡", "支付宝", "微信", "云闪付","对公转账", "小程序-微信支付"],
show: false, show: false,
columns: [], columns: [],
type: "", type: "",
@ -40,6 +41,18 @@ Page({
title: "表计" title: "表计"
}) })
}, },
clickType() {
this.setData({
type: "pay",
columns: [
{id: undefined, name: "全部" },
{id: 1, name: "对公" },
{id: 2, name: "微信" },
],
show: true,
title: "充值类型"
})
},
onOk(e) { onOk(e) {
const { type, value = {} } = e.detail; const { type, value = {} } = e.detail;
if (type === "year") { if (type === "year") {
@ -50,9 +63,13 @@ Page({
this.onChangeMeter(value) this.onChangeMeter(value)
return; return;
} }
if (type === "pay") {
this.onChangePay(value)
return;
}
}, },
onChangeYear(e) { onChangeYear(e) {
const { codeId } = this.data; const { codeId, pay } = this.data;
const currentYear = e const currentYear = e
this.setData({ this.setData({
year: currentYear, year: currentYear,
@ -60,11 +77,11 @@ Page({
show: false, show: false,
title: "" title: ""
}) })
this.init(currentYear, codeId) this.init(currentYear, codeId, pay)
}, },
onChangeMeter(e) { onChangeMeter(e) {
const { id, code } = e; const { id, code, } = e;
const { year } = this.data; const { year, pay } = this.data;
this.setData({ this.setData({
codeId: id, codeId: id,
meterCode: code, meterCode: code,
@ -72,7 +89,19 @@ Page({
show: false, show: false,
title: "" title: ""
}) })
this.init(year, id) this.init(year, id, pay)
},
onChangePay(e) {
const { id, name } = e;
console.log('e', e)
const { year, codeId } = this.data;
this.setData({
payType: name,
type: "",
show: false,
title: ""
})
this.init(year,codeId, id, )
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
@ -102,8 +131,8 @@ Page({
meterList: data || [], meterList: data || [],
}) })
}, },
async init(year, codeId) { async init(year, codeId, pay) {
const { code, message, data = [], amount = 0 } = await getRechargeList(year, codeId); const { code, message, data = [], amount = 0 } = await getRechargeList(year, codeId, pay);
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
return; return;

View File

@ -11,7 +11,7 @@
<van-icon name="arrow-down" custom-class="down" /> <van-icon name="arrow-down" custom-class="down" />
</view> </view>
<view class="tenementPicker" bind:tap="clickType"> <view class="tenementPicker" bind:tap="clickType">
<view wx:if="{{typeText}}" class="tenementName"> {{ typeText }} </view> <view wx:if="{{payType}}" class="tenementName"> {{ payType }} </view>
<view wx:else> 全部类型 </view> <view wx:else> 全部类型 </view>
<van-icon name="arrow-down" custom-class="down" /> <van-icon name="arrow-down" custom-class="down" />
</view> </view>
@ -25,9 +25,14 @@
<view class="codeTime"> <view class="codeTime">
<view class="code"> {{ item.meter.address }} </view> <view class="code"> {{ item.meter.address }} </view>
<view class="time"> {{ item.time }} </view> <view class="time"> {{ item.time }} </view>
<view class="way"> {{ way[item.paymentType] }} </view>
</view> </view>
<view class="money"> {{ item.money }}元 </view> <view class="money"> {{ item.money }}元 </view>
<van-icon name="arrow" /> <van-icon name="arrow" />
<view class="rechargeStatus rechargeWait" wx:if="{{item.orderStatus === 1}}"> 处理中 </view>
<view class="rechargeStatus rechargeBack" wx:elif="{{item.orderStatus === 2}}"> 已退回 </view>
<view class="rechargeStatus rechargeSuccess" wx:else> 充值成功 </view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -28,6 +28,7 @@
border-right: 0; border-right: 0;
border-top: 0; border-top: 0;
align-items: center; align-items: center;
position: relative;
} }
.recordsItem:last-child { .recordsItem:last-child {
border-bottom: 0; border-bottom: 0;
@ -90,3 +91,29 @@
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.way {
margin-top: 10rpx;
font-size: 24rpx;
}
.rechargeStatus {
position: absolute;
right: 0;
top: 0;
z-index: 99;
font-size: 26rpx;
padding: 4rpx 10rpx;
}
.rechargeWait {
background-color: rgb(234,226,26);
}
.rechargeSuccess {
background-color: rgb(88,165,141);
}
.rechargeBack {
background-color: rgb(229,229,229);
}

View File

@ -2,9 +2,9 @@ import apis from '../utils/request';
const { GET, POST, PUT, DELETE } = apis const { GET, POST, PUT, DELETE } = apis
// 获取充值记录 // 获取充值记录
export const getRechargeList = async function(year, codeId) { export const getRechargeList = async function(year = "", codeId = "", pay = "") {
const tenement = wx.getStorageSync('tenement')?.id const tenement = wx.getStorageSync('tenement')?.id
return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}&codeId=${codeId}`); return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}&codeId=${codeId}&pay=${pay}`);
} }
// 预备充值请求 // 预备充值请求