暂存工作台模块,初步完成待测试和优化

This commit is contained in:
2024-11-13 17:31:26 +08:00
parent c8649288ff
commit efe3d3241d
13 changed files with 680 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
import { handleRecharge } from "../../../../service/recharge";
import { alertInfo, alertSuccess } from "../../../../utils/index";
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
import request from '../../../../utils/request'
const { OK } = request;
@@ -45,9 +45,7 @@ Component({
})
},
onConfirm(e) {
// console.log('e', e)
const { data, type, way } = e.detail;
console.log('e.detail', e.detail)
switch(type) {
case "park":
this.setData({
@@ -85,14 +83,28 @@ Component({
})
},
onChangeMoney(e) {
console.log('e', e)
this.setData({ money: e.detail })
},
onChangeVoucherNo(e) {
console.log('e', 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("请选择园区");
@@ -114,18 +126,27 @@ Component({
alertInfo("请输入凭证号")
return
}
const { code, message } = await handleRecharge(park, {
amount: `${money || ''}`,
meter,
paymentType: way,
voucherNo,
type: "0"
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)
})
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("充值成功")
}
}
})