暂存工作台模块,初步完成待测试和优化
This commit is contained in:
@@ -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("充值成功")
|
||||
|
||||
}
|
||||
}
|
||||
})
|
@@ -68,7 +68,7 @@
|
||||
|
||||
<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"> 取消 </van-button>
|
||||
<van-button size="small" bind:click="handleClear"> 清空 </van-button>
|
||||
</view>
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
@@ -77,4 +77,5 @@
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onConcal"
|
||||
wx:if="{{show}}"
|
||||
/>
|
||||
|
Reference in New Issue
Block a user