diff --git a/app/Controller/Recharge/RechargeController.php b/app/Controller/Recharge/RechargeController.php index 009ecbd..c0c5f9c 100644 --- a/app/Controller/Recharge/RechargeController.php +++ b/app/Controller/Recharge/RechargeController.php @@ -37,11 +37,11 @@ class RechargeController extends AbstractController 'cardNo' => $user->card_no ?? '', 'mobile' => $user->mobile ?? '', 'bankCardNo' => $bankCard->bank_card_no ?? '', - 'amount' => intval($prePayLog->amount / 100), ]; } return $this->success([ - 'user' => $userInfo + 'user' => $userInfo, + 'amount' => intval($prePayLog->amount / 100), ]); } diff --git a/public/payment.html b/public/payment.html index 90a875a..94301dc 100644 --- a/public/payment.html +++ b/public/payment.html @@ -27,7 +27,7 @@ - + @@ -99,7 +99,7 @@ amount: 1, remark: '' }, - amountReadonly: false + amountDisabled: false } }, created() { @@ -200,15 +200,19 @@ if (result.code != 1000) { return this.$message.error(response.data.message); } - if (result.user != null) { - this.form.name = result.user.name; - this.form.cardNo = result.user.cardNo; - this.form.mobile = result.user.mobile; - this.form.bankCardNo = result.user.bankCardNo; - if (result.user.amount > 0) { - this.form.amount = result.user.amount; - this.amountReadonly = true; - } + + let data = result.data; + if (data.user != null) { + this.form.name = data.user.name; + this.form.cardNo = data.user.cardNo; + this.form.mobile = data.user.mobile; + this.form.bankCardNo = data.user.bankCardNo; + + } + console.log(data) + if (data.amount > 0) { + this.form.amount = data.amount; + this.amountDisabled = true; } }) .catch((error) => {