From 8482453da044c596640108a269785b45c2e0799b Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Tue, 10 Sep 2024 11:07:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=B4=E8=B4=B9=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=92=8C=E5=AF=B9=E5=85=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/select/index.js | 4 +-- pages/publicTransfer/index.js | 18 +++++++++++--- pages/publicTransfer/index.json | 1 + pages/publicTransfer/index.wxml | 3 ++- pages/questions/index.json | 3 ++- pages/questions/index.wxml | 9 ++++--- pages/rechargeDetail/index.wxml | 21 ++++++++++++++++ pages/rechargeRecord/index.js | 43 +++++++++++++++++++++++++++------ pages/rechargeRecord/index.wxml | 7 +++++- pages/rechargeRecord/index.wxss | 27 +++++++++++++++++++++ service/recharge.js | 4 +-- 11 files changed, 120 insertions(+), 20 deletions(-) diff --git a/components/select/index.js b/components/select/index.js index 951936f..10c77e3 100644 --- a/components/select/index.js +++ b/components/select/index.js @@ -1,4 +1,4 @@ -import { getParkList } from "../../service/park"; +import { getLoginParkList } from "../../service/park"; import { getTenementList } from "../../service/tenement"; import request from '../../utils/request' @@ -32,7 +32,7 @@ Component({ async onInput(e) { switch(this.data.type) { case 0: - const { data = [], code, message } = await getParkList({ keyword: e.detail }); + const { data = [], code, message } = await getLoginParkList({ keyword: e.detail }); this.setData({ list: data, visible: true, diff --git a/pages/publicTransfer/index.js b/pages/publicTransfer/index.js index bdae1ef..650d537 100644 --- a/pages/publicTransfer/index.js +++ b/pages/publicTransfer/index.js @@ -4,6 +4,7 @@ import { createPublicTopUp } from '../../service/recharge' import { uploadFile, uploadPublicFile } from "../../service/public"; import { alertInfo, loadingFunc, getFileName, alertSuccess } from "../../utils/index"; import request from '../../utils/request'; +import Dialog from '@vant/weapp/dialog/dialog'; const { OK } = request; @@ -77,11 +78,22 @@ Page({ alertInfo(message) return; } - alertSuccess("已提交,待审核") - setTimeout(() => { + Dialog.alert({ + title: '提示', + message: '订单提交成功!请耐心等待管理员审核,如果疑问请联系客服', + confirmButtonOpenType: "contact", + showCancelButton: true, + confirmButtonText: "联系客服", + cancelButtonText: "关闭" + }).then(() => { + + }).catch(() => { wx.redirectTo({ - url: '/pages/home/index', + url: '/pages/rechargeRecord/index', }) + }); + setTimeout(() => { + }, 600) }, handleDelete() { diff --git a/pages/publicTransfer/index.json b/pages/publicTransfer/index.json index c2a876c..585eead 100644 --- a/pages/publicTransfer/index.json +++ b/pages/publicTransfer/index.json @@ -3,6 +3,7 @@ "navigator": "/components/navigator/index", "van-field": "@vant/weapp/field/index", "van-uploader": "@vant/weapp/uploader/index", + "van-dialog": "@vant/weapp/dialog/index", "van-button": "@vant/weapp/button/index" }, "navigationStyle": "custom" diff --git a/pages/publicTransfer/index.wxml b/pages/publicTransfer/index.wxml index 7d31d4f..840800d 100644 --- a/pages/publicTransfer/index.wxml +++ b/pages/publicTransfer/index.wxml @@ -22,4 +22,5 @@ /> 提交 - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/questions/index.json b/pages/questions/index.json index 7ce00fa..0093d1d 100644 --- a/pages/questions/index.json +++ b/pages/questions/index.json @@ -1,7 +1,8 @@ { "usingComponents": { "navigator": "/components/navigator/index", - "scrollPageWrapper": "/components/scrollPageWrapper/index" + "scrollPageWrapper": "/components/scrollPageWrapper/index", + "empty": "/components/empty/index" }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/questions/index.wxml b/pages/questions/index.wxml index 366b8bd..f801ce0 100644 --- a/pages/questions/index.wxml +++ b/pages/questions/index.wxml @@ -2,9 +2,12 @@ - - {{index + 1}}、 {{ item.name }} - {{ item.content }} + + + {{index + 1}}、 {{ item.name }} + {{ item.content }} + + \ No newline at end of file diff --git a/pages/rechargeDetail/index.wxml b/pages/rechargeDetail/index.wxml index f3ba4f1..e7abfc0 100644 --- a/pages/rechargeDetail/index.wxml +++ b/pages/rechargeDetail/index.wxml @@ -83,6 +83,27 @@ readonly border="{{ false }}" /> + + + diff --git a/pages/rechargeRecord/index.js b/pages/rechargeRecord/index.js index 00392a6..a087b2e 100644 --- a/pages/rechargeRecord/index.js +++ b/pages/rechargeRecord/index.js @@ -16,6 +16,7 @@ Page({ list: [ ], + way: ["现金", "银行卡", "支付宝", "微信", "云闪付","对公转账", "小程序-微信支付"], show: false, columns: [], type: "", @@ -40,6 +41,18 @@ Page({ title: "表计" }) }, + clickType() { + this.setData({ + type: "pay", + columns: [ + {id: undefined, name: "全部" }, + {id: 1, name: "对公" }, + {id: 2, name: "微信" }, + ], + show: true, + title: "充值类型" + }) + }, onOk(e) { const { type, value = {} } = e.detail; if (type === "year") { @@ -50,9 +63,13 @@ Page({ this.onChangeMeter(value) return; } + if (type === "pay") { + this.onChangePay(value) + return; + } }, onChangeYear(e) { - const { codeId } = this.data; + const { codeId, pay } = this.data; const currentYear = e this.setData({ year: currentYear, @@ -60,11 +77,11 @@ Page({ show: false, title: "" }) - this.init(currentYear, codeId) + this.init(currentYear, codeId, pay) }, onChangeMeter(e) { - const { id, code } = e; - const { year } = this.data; + const { id, code, } = e; + const { year, pay } = this.data; this.setData({ codeId: id, meterCode: code, @@ -72,7 +89,19 @@ Page({ show: false, 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 || [], }) }, - async init(year, codeId) { - const { code, message, data = [], amount = 0 } = await getRechargeList(year, codeId); + async init(year, codeId, pay) { + const { code, message, data = [], amount = 0 } = await getRechargeList(year, codeId, pay); if (code !== OK) { alertInfo(message) return; diff --git a/pages/rechargeRecord/index.wxml b/pages/rechargeRecord/index.wxml index dac645a..04c07f1 100644 --- a/pages/rechargeRecord/index.wxml +++ b/pages/rechargeRecord/index.wxml @@ -11,7 +11,7 @@ - {{ typeText }} + {{ payType }} 全部类型 @@ -25,9 +25,14 @@ {{ item.meter.address }} {{ item.time }} + {{ way[item.paymentType] }} {{ item.money }}元 + + 处理中 + 已退回 + 充值成功 diff --git a/pages/rechargeRecord/index.wxss b/pages/rechargeRecord/index.wxss index 6cf1605..0d22da1 100644 --- a/pages/rechargeRecord/index.wxss +++ b/pages/rechargeRecord/index.wxss @@ -28,6 +28,7 @@ border-right: 0; border-top: 0; align-items: center; + position: relative; } .recordsItem:last-child { border-bottom: 0; @@ -89,4 +90,30 @@ overflow: hidden; white-space: nowrap; 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); } \ No newline at end of file diff --git a/service/recharge.js b/service/recharge.js index 4643df3..5efeb62 100644 --- a/service/recharge.js +++ b/service/recharge.js @@ -2,9 +2,9 @@ import apis from '../utils/request'; 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 - return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}&codeId=${codeId}`); + return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}&codeId=${codeId}&pay=${pay}`); } // 预备充值请求