| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- import Service from "../lib/service";
- import { withLoading } from "@/utils/requestLoading";
- class UcardService extends Service {
- constructor() {
- super();
- }
- //获取卡片类型列表
- async cardTypesList(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/types/list", params);
- return res;
- }
- // 获取商户信息
- async getSingle(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/merchant/user/single", params);
- return res;
- }
- // 商户用户分页列表
- async merchantList(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/merchant/user/page", params);
- return res;
- }
- // 国家城市
- async ucardCountryCity(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/country", params);
- return res;
- }
- // 查询职业信息
- async getOccupationList(params = {}) {
- let res = await this.postAll(
- "Host80",
- "/wasabi/card/occupation/list",
- params
- );
- return res;
- }
- // 获取卡片申请列表
- async applyList(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/apply/page", params);
- return res;
- }
- // 获取卡片列表
- async cardList(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/list", params);
- return res;
- }
- // kyc列表
- async kycList(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/merchant/kyc/page", params);
- return res;
- }
- // 银行卡详情
- async getCardInfo(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/single", params);
- return res;
- }
- // 充值记录分页查询
- async rechargeList(params = {}) {
- let res = await this.postAll(
- "Host80",
- "/wasabi/card/recharge/page",
- params
- );
- return res;
- }
- // 文件上传 - 已改为统一上传接口
- // 注意:此方法现在主要用于兼容,实际文件上传已通过 Vue 组件中的统一上传工具处理
- async ucardUpload(params = {}) {
- // 如果传入了文件,使用统一上传逻辑
- if (params.file) {
- // 先调用原接口获取 uploadToken(需要传文件)
- let formData = new FormData();
- formData.append('file', params.file);
- let res = await this.postAll("Host80", "/wasabi/upload/file", formData);
- // if (tokenRes.code !== 200) {
- // return tokenRes;
- // }
- // 获取 uploadToken
- // let uploadToken = tokenRes.data?.uploadToken || tokenRes.uploadToken || tokenRes.data;
- // if (!uploadToken) {
- // return {
- // code: 400,
- // msg: 'Failed to get uploadToken'
- // };
- // }
- // 使用新接口上传
- // let uploadFormData = new FormData();
- // uploadFormData.append('file', params.file);
- // uploadFormData.append('uploadToken', uploadToken);
- // let res = await this.postAll("Host05", "/common/base/upload", uploadFormData);
- return res;
- }
- // 如果没有文件,返回错误
- return {
- code: 400,
- msg: 'File is required'
- }
- }
- // 查询交易记录分页列表
- async transactionsList(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/transac/page", params);
- return res;
- }
- // 免费次数
- async reductionNum(params = {}) {
- let res = await this.postAll(
- "Host80",
- "/wasabi/apply/reduction/num",
- params
- );
- return res;
- }
- // 账户余额
- async walletBalance(params = {}) {
- let res = await this.postAll(
- "Host80",
- "/wasabi/card/wallet/balance",
- params
- );
- return res;
- }
- // 钱包记录分页列表
- async getRecordPage(params = {}) {
- let res = await this.postAll(
- "Host80",
- "/wasabi/card/wallet/record/page",
- params
- );
- return res;
- }
- // 验证权限
- async permissionVerify(params = {}) {
- let res = await this.postAll(
- "Host80",
- "/wasabi/card/permission/verify",
- params
- );
- return res;
- }
- // 证件类型配置
- async idTypesConfigList(params = {}) {
- let res = await this.postAll(
- "Host80",
- "/wasabi/card/id/type/config/list",
- params
- );
- return res;
- }
- //根据条件查看拒绝列表-用于下拉和选择展示理由
- async reasonsRefusalList(params = {}) {
- let res = await this.postAll("Host80", "/reasons/refusal/list", params);
- return res;
- }
- //获取收款用户列表
- async globalReceiverUserList(params = {}) {
- let res = await this.postAll("Host80", "/ucard/global/receiver/user/list", params);
- return res;
- }
- // 上传文件
- async scanFile(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/scan/code", params);
- return res;
- }
- // 区块链配置下拉列表
- async getBlockchainDropdown(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/blockchain/config/dropdown", params);
- return res;
- }
- //币种下拉列表
- async globalCurrenciesDropdown(params = {}) {
- let res = await this.postAll("Host80", "/ucard/global/currencies/dropdown", params);
- return res;
- }
- //币种字段和可选值列表
- async globalCurrenciesField(params = {}) {
- let res = await this.postAll("Host80", "/ucard/global/currencies/field/list", params);
- return res;
- }
- //查询ucard账户信息
- async cardAccountDropdown(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/account/dropdown", params);
- return res;
- }
- //速汇订单分页列表
- async globalOrdersList(params = {}) {
- let res = await this.postAll("Host80", "/ucard/global/order/page/list", params);
- return res;
- }
- //查询支持的城市列表
- async globalQueryBankCities(params = {}) {
- let res = await this.postAll("Host80", "/ucard/global/query/bank/cities", params);
- return res;
- }
- // 加密货币交易记录列表
- async getBlockchainTransactionPage(params = {}) {
- let res = await this.postAll("Host80", "/ucard/wallet/deposit/page", params);
- return res;
- }
- // 卡扣款分页列表
- async getCardWithdrawPage(params = {}) {
- let res = await this.postAll("Host80", "/wasabi/card/withdraw/page", params);
- return res;
- }
- // 收付款人全部可填列表
- async getGlobalFieldParams(params = {}) {
- let res = await this.postAll("Host80", "/ucard/global/field/params", params);
- return res;
- }
- //已认证用户信息详情
- async globalUserDetails(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/global/user/details", params));
- }
- // 查询开卡进度详情
- async updateCardTypes(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/update/basic/info", params));
- }
- // 商户用户注册
- async merchantRegister(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/merchant/user/register", params));
- }
- // 更新商户用户信息
- async merchantUpdate(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/merchant/user/update", params));
- }
- // 银行卡激活
- async ucardActivate(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/activate", params));
- }
- // 银行卡充值
- async ucardRecharge(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/recharge", params));
- }
- // 查询卡片余额
- async ucardBalance(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/balance", params));
- }
- // 找回密码
- async ucardResetPassword(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/password/reset", params));
- }
- // 冻结卡片
- async ucardFreeze(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/freeze", params));
- }
- // 解冻卡片
- async ucardUnfreeze(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/unfreeze", params));
- }
- // KYC链接
- async getWebsdkLink(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/getWebsdkLink", params));
- }
- // 申请开卡
- async ucardApply(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/apply", params));
- }
- // 开卡详情
- async applyDetails(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/apply/details", params));
- }
- // 更新地址
- async addressUpdate(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/merchant/user/address/update", params));
- }
- // 查看cvv码校验密码
- async getCvv(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/password/verify", params));
- }
- // 查询CVV 发送短信验证码
- async sendEmailCode(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/query/cvv/send/code", params));
- }
- // 验证邮箱验证码查询
- async getCvvCode(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/query/cvv/verify/code", params));
- }
- // 全球速汇
- //创建订单
- async globalOrdersCreate(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/global/create/order", params));
- }
- // 订单详情
- async globalOrdersDetail(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/global/order/details", params));
- }
- //修改订单
- async globalOrderUpdate(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/update/global/order", params));
- }
- //查询已认证用户列表
- async cardUserList(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/wasabi/card/query/user/list", params));
- }
- //查询手续费率和汇率
- async globalExchangeRate(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/global/query/exchange/rate", params));
- }
- // 补充资料
- async globalSupplementary(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/global/supplementary/data", params));
- }
- //取消交易订单
- async globalCancelOrder(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/global/cancel/order", params));
- }
- // 生成钱包地址
- async getVaultodyAddress(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/wallet/generate/deposit/address", params));
- }
- // 提现列表
- async getWalletPage(params = {}) {
- return await this.postAll("Host80", "/ucard/wallet/withdraw/page", params);
- }
- // 提现
- async getWalletApply(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/wallet/withdraw/apply", params));
- }
- // 取消提现
- async getWalletCancel(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/wallet/withdraw/cancel", params));
- }
- // 验证邮箱验证码
- async getWalletSendEmailCode(params = {}) {
- return await withLoading(() => this.postAll("Host80", "/ucard/wallet/send/email/code", params));
- }
- }
- export default new UcardService();
|