ucard.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. import Service from "../lib/service";
  2. import { withLoading } from "@/utils/requestLoading";
  3. class UcardService extends Service {
  4. constructor() {
  5. super();
  6. }
  7. //获取卡片类型列表
  8. async cardTypesList(params = {}) {
  9. let res = await this.postAll("Host80", "/wasabi/card/types/list", params);
  10. return res;
  11. }
  12. // 获取商户信息
  13. async getSingle(params = {}) {
  14. let res = await this.postAll("Host80", "/wasabi/merchant/user/single", params);
  15. return res;
  16. }
  17. // 商户用户分页列表
  18. async merchantList(params = {}) {
  19. let res = await this.postAll("Host80", "/wasabi/merchant/user/page", params);
  20. return res;
  21. }
  22. // 国家城市
  23. async ucardCountryCity(params = {}) {
  24. let res = await this.postAll("Host80", "/wasabi/card/country", params);
  25. return res;
  26. }
  27. // 查询职业信息
  28. async getOccupationList(params = {}) {
  29. let res = await this.postAll(
  30. "Host80",
  31. "/wasabi/card/occupation/list",
  32. params
  33. );
  34. return res;
  35. }
  36. // 获取卡片申请列表
  37. async applyList(params = {}) {
  38. let res = await this.postAll("Host80", "/wasabi/card/apply/page", params);
  39. return res;
  40. }
  41. // 获取卡片列表
  42. async cardList(params = {}) {
  43. let res = await this.postAll("Host80", "/wasabi/card/list", params);
  44. return res;
  45. }
  46. // kyc列表
  47. async kycList(params = {}) {
  48. let res = await this.postAll("Host80", "/wasabi/merchant/kyc/page", params);
  49. return res;
  50. }
  51. // 银行卡详情
  52. async getCardInfo(params = {}) {
  53. let res = await this.postAll("Host80", "/wasabi/card/single", params);
  54. return res;
  55. }
  56. // 充值记录分页查询
  57. async rechargeList(params = {}) {
  58. let res = await this.postAll(
  59. "Host80",
  60. "/wasabi/card/recharge/page",
  61. params
  62. );
  63. return res;
  64. }
  65. // 文件上传 - 已改为统一上传接口
  66. // 注意:此方法现在主要用于兼容,实际文件上传已通过 Vue 组件中的统一上传工具处理
  67. async ucardUpload(params = {}) {
  68. // 如果传入了文件,使用统一上传逻辑
  69. if (params.file) {
  70. // 先调用原接口获取 uploadToken(需要传文件)
  71. let formData = new FormData();
  72. formData.append('file', params.file);
  73. let res = await this.postAll("Host80", "/wasabi/upload/file", formData);
  74. // if (tokenRes.code !== 200) {
  75. // return tokenRes;
  76. // }
  77. // 获取 uploadToken
  78. // let uploadToken = tokenRes.data?.uploadToken || tokenRes.uploadToken || tokenRes.data;
  79. // if (!uploadToken) {
  80. // return {
  81. // code: 400,
  82. // msg: 'Failed to get uploadToken'
  83. // };
  84. // }
  85. // 使用新接口上传
  86. // let uploadFormData = new FormData();
  87. // uploadFormData.append('file', params.file);
  88. // uploadFormData.append('uploadToken', uploadToken);
  89. // let res = await this.postAll("Host05", "/common/base/upload", uploadFormData);
  90. return res;
  91. }
  92. // 如果没有文件,返回错误
  93. return {
  94. code: 400,
  95. msg: 'File is required'
  96. }
  97. }
  98. // 查询交易记录分页列表
  99. async transactionsList(params = {}) {
  100. let res = await this.postAll("Host80", "/wasabi/card/transac/page", params);
  101. return res;
  102. }
  103. // 免费次数
  104. async reductionNum(params = {}) {
  105. let res = await this.postAll(
  106. "Host80",
  107. "/wasabi/apply/reduction/num",
  108. params
  109. );
  110. return res;
  111. }
  112. // 账户余额
  113. async walletBalance(params = {}) {
  114. let res = await this.postAll(
  115. "Host80",
  116. "/wasabi/card/wallet/balance",
  117. params
  118. );
  119. return res;
  120. }
  121. // 钱包记录分页列表
  122. async getRecordPage(params = {}) {
  123. let res = await this.postAll(
  124. "Host80",
  125. "/wasabi/card/wallet/record/page",
  126. params
  127. );
  128. return res;
  129. }
  130. // 验证权限
  131. async permissionVerify(params = {}) {
  132. let res = await this.postAll(
  133. "Host80",
  134. "/wasabi/card/permission/verify",
  135. params
  136. );
  137. return res;
  138. }
  139. // 证件类型配置
  140. async idTypesConfigList(params = {}) {
  141. let res = await this.postAll(
  142. "Host80",
  143. "/wasabi/card/id/type/config/list",
  144. params
  145. );
  146. return res;
  147. }
  148. //根据条件查看拒绝列表-用于下拉和选择展示理由
  149. async reasonsRefusalList(params = {}) {
  150. let res = await this.postAll("Host80", "/reasons/refusal/list", params);
  151. return res;
  152. }
  153. //获取收款用户列表
  154. async globalReceiverUserList(params = {}) {
  155. let res = await this.postAll("Host80", "/ucard/global/receiver/user/list", params);
  156. return res;
  157. }
  158. // 上传文件
  159. async scanFile(params = {}) {
  160. let res = await this.postAll("Host80", "/wasabi/scan/code", params);
  161. return res;
  162. }
  163. // 区块链配置下拉列表
  164. async getBlockchainDropdown(params = {}) {
  165. let res = await this.postAll("Host80", "/wasabi/card/blockchain/config/dropdown", params);
  166. return res;
  167. }
  168. //币种下拉列表
  169. async globalCurrenciesDropdown(params = {}) {
  170. let res = await this.postAll("Host80", "/ucard/global/currencies/dropdown", params);
  171. return res;
  172. }
  173. //币种字段和可选值列表
  174. async globalCurrenciesField(params = {}) {
  175. let res = await this.postAll("Host80", "/ucard/global/currencies/field/list", params);
  176. return res;
  177. }
  178. //查询ucard账户信息
  179. async cardAccountDropdown(params = {}) {
  180. let res = await this.postAll("Host80", "/wasabi/card/account/dropdown", params);
  181. return res;
  182. }
  183. //速汇订单分页列表
  184. async globalOrdersList(params = {}) {
  185. let res = await this.postAll("Host80", "/ucard/global/order/page/list", params);
  186. return res;
  187. }
  188. //查询支持的城市列表
  189. async globalQueryBankCities(params = {}) {
  190. let res = await this.postAll("Host80", "/ucard/global/query/bank/cities", params);
  191. return res;
  192. }
  193. // 加密货币交易记录列表
  194. async getBlockchainTransactionPage(params = {}) {
  195. let res = await this.postAll("Host80", "/ucard/wallet/deposit/page", params);
  196. return res;
  197. }
  198. // 卡扣款分页列表
  199. async getCardWithdrawPage(params = {}) {
  200. let res = await this.postAll("Host80", "/wasabi/card/withdraw/page", params);
  201. return res;
  202. }
  203. // 收付款人全部可填列表
  204. async getGlobalFieldParams(params = {}) {
  205. let res = await this.postAll("Host80", "/ucard/global/field/params", params);
  206. return res;
  207. }
  208. //已认证用户信息详情
  209. async globalUserDetails(params = {}) {
  210. return await withLoading(() => this.postAll("Host80", "/ucard/global/user/details", params));
  211. }
  212. // 查询开卡进度详情
  213. async updateCardTypes(params = {}) {
  214. return await withLoading(() => this.postAll("Host80", "/wasabi/card/update/basic/info", params));
  215. }
  216. // 商户用户注册
  217. async merchantRegister(params = {}) {
  218. return await withLoading(() => this.postAll("Host80", "/wasabi/merchant/user/register", params));
  219. }
  220. // 更新商户用户信息
  221. async merchantUpdate(params = {}) {
  222. return await withLoading(() => this.postAll("Host80", "/wasabi/merchant/user/update", params));
  223. }
  224. // 银行卡激活
  225. async ucardActivate(params = {}) {
  226. return await withLoading(() => this.postAll("Host80", "/wasabi/card/activate", params));
  227. }
  228. // 银行卡充值
  229. async ucardRecharge(params = {}) {
  230. return await withLoading(() => this.postAll("Host80", "/wasabi/card/recharge", params));
  231. }
  232. // 查询卡片余额
  233. async ucardBalance(params = {}) {
  234. return await withLoading(() => this.postAll("Host80", "/wasabi/card/balance", params));
  235. }
  236. // 找回密码
  237. async ucardResetPassword(params = {}) {
  238. return await withLoading(() => this.postAll("Host80", "/wasabi/card/password/reset", params));
  239. }
  240. // 冻结卡片
  241. async ucardFreeze(params = {}) {
  242. return await withLoading(() => this.postAll("Host80", "/wasabi/card/freeze", params));
  243. }
  244. // 解冻卡片
  245. async ucardUnfreeze(params = {}) {
  246. return await withLoading(() => this.postAll("Host80", "/wasabi/card/unfreeze", params));
  247. }
  248. // KYC链接
  249. async getWebsdkLink(params = {}) {
  250. return await withLoading(() => this.postAll("Host80", "/wasabi/getWebsdkLink", params));
  251. }
  252. // 申请开卡
  253. async ucardApply(params = {}) {
  254. return await withLoading(() => this.postAll("Host80", "/wasabi/card/apply", params));
  255. }
  256. // 开卡详情
  257. async applyDetails(params = {}) {
  258. return await withLoading(() => this.postAll("Host80", "/wasabi/card/apply/details", params));
  259. }
  260. // 更新地址
  261. async addressUpdate(params = {}) {
  262. return await withLoading(() => this.postAll("Host80", "/wasabi/merchant/user/address/update", params));
  263. }
  264. // 查看cvv码校验密码
  265. async getCvv(params = {}) {
  266. return await withLoading(() => this.postAll("Host80", "/wasabi/card/password/verify", params));
  267. }
  268. // 查询CVV 发送短信验证码
  269. async sendEmailCode(params = {}) {
  270. return await withLoading(() => this.postAll("Host80", "/wasabi/query/cvv/send/code", params));
  271. }
  272. // 验证邮箱验证码查询
  273. async getCvvCode(params = {}) {
  274. return await withLoading(() => this.postAll("Host80", "/wasabi/query/cvv/verify/code", params));
  275. }
  276. // 全球速汇
  277. //创建订单
  278. async globalOrdersCreate(params = {}) {
  279. return await withLoading(() => this.postAll("Host80", "/ucard/global/create/order", params));
  280. }
  281. // 订单详情
  282. async globalOrdersDetail(params = {}) {
  283. return await withLoading(() => this.postAll("Host80", "/ucard/global/order/details", params));
  284. }
  285. //修改订单
  286. async globalOrderUpdate(params = {}) {
  287. return await withLoading(() => this.postAll("Host80", "/wasabi/update/global/order", params));
  288. }
  289. //查询已认证用户列表
  290. async cardUserList(params = {}) {
  291. return await withLoading(() => this.postAll("Host80", "/wasabi/card/query/user/list", params));
  292. }
  293. //查询手续费率和汇率
  294. async globalExchangeRate(params = {}) {
  295. return await withLoading(() => this.postAll("Host80", "/ucard/global/query/exchange/rate", params));
  296. }
  297. // 补充资料
  298. async globalSupplementary(params = {}) {
  299. return await withLoading(() => this.postAll("Host80", "/ucard/global/supplementary/data", params));
  300. }
  301. //取消交易订单
  302. async globalCancelOrder(params = {}) {
  303. return await withLoading(() => this.postAll("Host80", "/ucard/global/cancel/order", params));
  304. }
  305. // 生成钱包地址
  306. async getVaultodyAddress(params = {}) {
  307. return await withLoading(() => this.postAll("Host80", "/ucard/wallet/generate/deposit/address", params));
  308. }
  309. // 提现列表
  310. async getWalletPage(params = {}) {
  311. return await this.postAll("Host80", "/ucard/wallet/withdraw/page", params);
  312. }
  313. // 提现
  314. async getWalletApply(params = {}) {
  315. return await withLoading(() => this.postAll("Host80", "/ucard/wallet/withdraw/apply", params));
  316. }
  317. // 取消提现
  318. async getWalletCancel(params = {}) {
  319. return await withLoading(() => this.postAll("Host80", "/ucard/wallet/withdraw/cancel", params));
  320. }
  321. // 验证邮箱验证码
  322. async getWalletSendEmailCode(params = {}) {
  323. return await withLoading(() => this.postAll("Host80", "/ucard/wallet/send/email/code", params));
  324. }
  325. }
  326. export default new UcardService();