Increase payment support and update parameters

- Improved payment system with WeChat and AliPay support
- Increased minimum recharge amount to `1`
- Added maximum of `9` characters for the recharge amount
- Added minimum withdraw amount setting
- Added real name field for AliPay
- Added third-party login field for AliPay
- Added maxlength of `9` characters for the withdraw amount
- Added a span tag to append '元' to the recharge amount
- Added a new function `with

[buyer/src/pages/home/userCenter/MoneyManagement.vue]
- Raise the minimum recharge amount to `1`
- Allow for a maximum of `9` characters for the recharge amount
- Added support for WeChat and AliPay
- Added a minimum withdraw amount setting
- Added a real name field for AliPay
- Added a third-party login field for AliPay
- Added maxlength of `9` characters for the withdraw amount
- Added a span tag to append '元' to the recharge amount
- Fixed typo
[buyer/src/api/pay.js]
- Add a new function `withdrawalSettingVO` for payment result inquiry
- Change the parameters for `payCallback` function
master
misworga831 2023-03-08 21:58:29 +08:00
parent 72fb11d3d3
commit 8599708af3
2 changed files with 119 additions and 62 deletions

View File

@ -46,3 +46,17 @@ export function payCallback (params) {
params params
}); });
} }
/**
* 支付结果查询
* @param orderType 交易类型,可用值:TRADE,ORDER,RECHARGE
* @param sn 订单编号
*/
export function withdrawalSettingVO (params) {
return request({
url: `/buyer/wallet/wallet/withdrawalSettingVO`,
needToken: true,
method: Method.GET,
params
});
}

View File

@ -22,19 +22,19 @@
<div> <div>
<Form <Form
ref="formData" ref="formData"
:model="formData"
label-position="left"
:label-width="100" :label-width="100"
:model="formData"
:rules="formValidate" :rules="formValidate"
label-position="left"
> >
<FormItem label="充值金额" prop="price"> <FormItem label="充值金额" prop="price">
<Input v-model="formData.price" size="large" number maxlength="9" <Input v-model="formData.price" maxlength="9" number size="large"
><span slot="append"></span></Input> ><span slot="append"></span></Input>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
<div slot="footer" style="text-align: center"> <div slot="footer" style="text-align: center">
<Button type="success" size="large" @click="rechargePrice"></Button> <Button size="large" type="success" @click="rechargePrice"></Button>
</div> </div>
</Modal> </Modal>
<!-- 提现申请 --> <!-- 提现申请 -->
@ -46,23 +46,45 @@
<div> <div>
<Form <Form
ref="withdrawApplyFormData" ref="withdrawApplyFormData"
:label-width="120"
:model="withdrawApplyFormData" :model="withdrawApplyFormData"
label-position="left"
:label-width="100"
:rules="withdrawApplyFormValidate" :rules="withdrawApplyFormValidate"
> >
<FormItem label="提现类型" prop="type">
<Select v-model="withdrawApplyFormData.type" disabled>
<Option value="ALI">支付宝</Option>
<Option value="WECHAT">微信</Option>
</Select>
</FormItem>
<FormItem label="提现金额" prop="price"> <FormItem label="提现金额" prop="price">
<Input <Input
v-model="withdrawApplyFormData.price" v-model="withdrawApplyFormData.price"
size="large"
number
maxlength="9" maxlength="9"
number
size="large"
><span slot="append"></span></Input> ><span slot="append"></span></Input>
<span style="color: red">最低提现金额 {{ withdrawApplyFormData.minPrice }}</span>
</FormItem>
<FormItem v-if="withdrawApplyFormData.type === 'ALI'" label="真实姓名" prop="realName">
<Input
v-model="withdrawApplyFormData.realName"
maxlength="9"
number
size="large"
></Input>
</FormItem>
<FormItem v-if="withdrawApplyFormData.type === 'ALI'" label="第三方登录账号" prop="connectNumber">
<Input
v-model="withdrawApplyFormData.connectNumber"
maxlength="9"
number
size="large"
></Input>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
<div slot="footer" style="text-align: center"> <div slot="footer" style="text-align: center">
<Button type="success" size="large" @click="withdrawal"></Button> <Button size="large" type="success" @click="withdrawal"></Button>
</div> </div>
</Modal> </Modal>
<!-- 余额日志 --> <!-- 余额日志 -->
@ -73,15 +95,15 @@
<div class="page-size"> <div class="page-size">
<Page <Page
:current="walletForm.pageNumber" :current="walletForm.pageNumber"
:total="logColumnsData.total"
:page-size="walletForm.pageSize" :page-size="walletForm.pageSize"
:page-size-opts="[10, 20, 50]"
:total="logColumnsData.total"
show-sizer
show-total
size="small"
transfer
@on-change="changePage" @on-change="changePage"
@on-page-size-change="changePageSize" @on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-sizer
transfer
></Page> ></Page>
</div> </div>
</TabPane> </TabPane>
@ -95,15 +117,15 @@
<div class="page-size"> <div class="page-size">
<Page <Page
:current="rechargeForm.pageNumber" :current="rechargeForm.pageNumber"
:total="rechargeListData.total"
:page-size="rechargeForm.pageSize" :page-size="rechargeForm.pageSize"
:page-size-opts="[10, 20, 50]"
:total="rechargeListData.total"
show-sizer
show-total
size="small"
transfer
@on-change="rechargeChangePage" @on-change="rechargeChangePage"
@on-page-size-change="rechargeChangePageSize" @on-page-size-change="rechargeChangePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-sizer
transfer
></Page> ></Page>
</div> </div>
</TabPane> </TabPane>
@ -117,15 +139,15 @@
<div class="page-size"> <div class="page-size">
<Page <Page
:current="withdrawApplyForm.pageNumber" :current="withdrawApplyForm.pageNumber"
:total="withdrawApplyColumnsListData.total"
:page-size="withdrawApplyForm.pageSize" :page-size="withdrawApplyForm.pageSize"
:page-size-opts="[10, 20, 50]"
:total="withdrawApplyColumnsListData.total"
show-sizer
show-total
size="small"
transfer
@on-change="withdrawChangePage" @on-change="withdrawChangePage"
@on-page-size-change="withdrawChangePageSize" @on-page-size-change="withdrawChangePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-sizer
transfer
></Page> ></Page>
</div> </div>
</TabPane> </TabPane>
@ -134,14 +156,9 @@
</template> </template>
<script> <script>
import { import {getDepositLog, getMembersWallet, getRecharge, getWithdrawApply, recharge, withdrawalApply} from '@/api/member';
getMembersWallet, import {withdrawalSettingVO} from "@/api/pay";
getDepositLog,
getRecharge,
getWithdrawApply,
recharge,
withdrawalApply
} from '@/api/member';
export default { export default {
name: 'MoneyManagement', name: 'MoneyManagement',
data() { data() {
@ -157,7 +174,11 @@ export default {
}, },
// //
withdrawApplyFormData: { withdrawApplyFormData: {
price: 1 price: 1,
minPrice: 1,
type: '',
realName: '',
connectNumber: '',
}, },
// //
walletForm: { walletForm: {
@ -186,7 +207,13 @@ export default {
message: '请输入大于0小于9999的合法提现金额', message: '请输入大于0小于9999的合法提现金额',
trigger: 'change' trigger: 'change'
} }
] ],
realName: [
{required: true, message: '请输入真实姓名'},
],
connectNumber: [
{required: true, message: '请输入第三方登录账号'},
],
}, },
formValidate: { formValidate: {
price: [ price: [
@ -460,8 +487,19 @@ export default {
}, },
// //
withdrawalApply() { withdrawalApply() {
this.withdrawApplyFormData.price = 1;
this.withdrawApplyModal = true; this.withdrawApplyModal = true;
this.withdrawApplyFormData.minPrice = 1;
this.withdrawApplyFormData.price = 1;
this.withdrawApplyFormData.type = '';
this.withdrawApplyFormData.realName = '';
this.withdrawApplyFormData.connectNumber = '';
withdrawalSettingVO().then((res) => {
if (res.code === 200) {
this.withdrawApplyFormData.minPrice = res.result.minPrice;
this.withdrawApplyFormData.type = res.result.type;
this.withdrawApplyFormData.price = 1;
}
});
}, },
// //
withdrawal() { withdrawal() {
@ -482,25 +520,30 @@ export default {
}; };
</script> </script>
<style scoped lang="scss"> <style lang="scss" scoped>
.box { .box {
margin: 20px 0; margin: 20px 0;
} }
.page-size { .page-size {
margin: 15px 0px; margin: 15px 0px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
} }
.account-price { .account-price {
font-weight: bold; font-weight: bold;
} }
.subTips { .subTips {
margin-left: 10px; margin-left: 10px;
} }
.account-btns { .account-btns {
margin: 10px 0; margin: 10px 0;
} }
.ivu-btn { .ivu-btn {
margin: 0 4px; margin: 0 4px;
} }