withdraw.vue 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Home.page_ib.item5')" />
  4. <view class="custom-withdraw">
  5. <!-- 步骤2:支付通道列表 -->
  6. <view class="box box-step2">
  7. <view class="b-card">
  8. <view class="card-top">
  9. <text class="tit">{{ t('Custom.Deposit.Title22')
  10. }}</text>
  11. <cwg-asset-tabs v-if="tabsConfig.length > 0" v-model="activeTab" :tabs="tabsConfig" />
  12. <uni-loading v-if="currentTableData.length == 0" />
  13. <view v-if="currentTableData.length">
  14. <PaymentMethodsList :list="currentTableData" @select="isShowStep3" />
  15. </view>
  16. <view v-if="step3" class="reselect-btn">
  17. <button class="s-btn reselect" type="primary" @click="showTable">{{
  18. t('Custom.Deposit.Reselect')
  19. }}</button>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 步骤3:填写出金信息 -->
  25. <view class="box box-step3" v-if="step3">
  26. <view class="b-card">
  27. <view class="card-top">
  28. <!-- 注意事项 -->
  29. <view v-if="!isStep3" class="step3-attention">
  30. <view class="tips" v-if="(introduce.introduce || introduce.enIntroduce)">
  31. <view>
  32. <rich-text class="attention"
  33. :nodes="isZh ? introduce.introduce : introduce.enIntroduce" />
  34. </view>
  35. </view>
  36. <view class="btn-bottom">
  37. <text class="btn crm-cursor" @click="isStep3 = true">{{ t('Btn.Confirm') }}</text>
  38. </view>
  39. </view>
  40. <!-- 表单 -->
  41. <uni-forms ref="formRef" :model="form" :rules="rules" label-width="200" label-position="top"
  42. v-if="isStep3" class="form base-info-form" validate-trigger="submit">
  43. <uni-row class="demo-uni-row uni-row1">
  44. <!-- 银行选择区域(当有银行列表时) -->
  45. <uni-col :span="24" v-if="bankDate.length && isStep3">
  46. <view class="tit">
  47. <text>{{ t('Custom.Withdraw.Title5') }}</text>
  48. </view>
  49. </uni-col>
  50. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="bankDate.length && isStep3">
  51. <uni-forms-item name="bankCode">
  52. <cwg-combox filterable v-model:value="form.bankCode" :options="bankOptions"
  53. :placeholder="t('placeholder.choose')" />
  54. </uni-forms-item>
  55. </uni-col>
  56. <!-- 电子钱包标题 -->
  57. <uni-col :span="24"
  58. v-if="['CHANNEL_TYPE_WALLET', 'CHANNEL_TYPE_ALI_WALLET'].includes(channelData.type)">
  59. <view class="tit">
  60. <text>{{ getWalletLabel }}</text>
  61. </view>
  62. </uni-col>
  63. <!-- 电子钱包地址输入 -->
  64. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  65. v-if="(channelData.type == 'CHANNEL_TYPE_WALLET' || channelData.type == 'CHANNEL_TYPE_ALI_WALLET') && isStep3">
  66. <uni-forms-item name="address">
  67. <uni-easyinput v-model="form.address" :placeholder="t('placeholder.input')"
  68. autocomplete="off" />
  69. </uni-forms-item>
  70. </uni-col>
  71. <!-- 数字货币区域 -->
  72. <uni-col :span="24" class="card-tit"
  73. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  74. <div
  75. style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;">
  76. <view class="tit">
  77. <text>{{ t('Custom.Withdraw.Title6') }}</text>
  78. </view>
  79. <div class="add-back">
  80. <text>{{ t('blockchain.item10') }}</text>
  81. <text class="add-btn crm-cursor"
  82. @click="openAddBankCard('add_bankBlockchain')">
  83. {{ t('Custom.Withdraw.addBank1') }}
  84. </text>
  85. </div>
  86. </div>
  87. </uni-col>
  88. <uni-col :span="24" v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  89. <uni-forms-item>
  90. <cwg-combox filterable v-model:value="myId" :options="digitalOptions"
  91. :placeholder="t('placeholder.choose')" @change="onDigitalCurrencyChange"
  92. :disabled="!ruleForm.bankBlockchain.length" />
  93. </uni-forms-item>
  94. </uni-col>
  95. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  96. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  97. <uni-forms-item :label="t('blockchain.item3')">
  98. <uni-easyinput disabled v-model="form.addressName" />
  99. </uni-forms-item>
  100. </uni-col>
  101. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  102. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  103. <uni-forms-item :label="t('blockchain.item4')">
  104. <uni-easyinput disabled v-model="form.address" />
  105. </uni-forms-item>
  106. </uni-col>
  107. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  108. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3 && form.addressProve">
  109. <uni-forms-item :label="t('blockchain.item5')">
  110. <div style="height: 100%; width: 100%" v-if="form.addressProve">
  111. <cwg-link type="pdf1"
  112. v-if="form.addressProve && (form.addressProve.slice(-3).toLowerCase() === 'pdf')"
  113. :url="imgUrl + form.addressProve" target="_blank"
  114. style="text-decoration: none; min-width: auto; width: auto; color: #ffffff; padding: 5px 10px;"
  115. class="state crm_state_blue">
  116. PDF
  117. </cwg-link>
  118. <image v-else style="width: 50px; height: 50px"
  119. :src="imgUrl + form.addressProve" mode="aspectFill"
  120. @click="previewImage(imgUrl + form.addressProve)" />
  121. </div>
  122. </uni-forms-item>
  123. </uni-col>
  124. <uni-col :span="24" v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  125. <view class="tit" style="margin: 0 0 20px">
  126. <i class="iconfont iconi"></i>
  127. <text>{{ t('Custom.Deposit.Des') }}</text>
  128. </view>
  129. </uni-col>
  130. <!-- 银行卡/电汇/信用卡区域 -->
  131. <uni-col :span="24" class="card-tit"
  132. v-if="isStep3 && (channelData.type == 'BANK_TELEGRAPHIC' || channelData.type == 'BANK' || channelData.type == 'CHANNEL_TYPE_CARD')">
  133. <div
  134. style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;">
  135. <view class="tit">
  136. <text>{{ t('Custom.Withdraw.Title4') }}</text>
  137. </view>
  138. <div class="add-back">
  139. <text v-if="channelData.type == 'BANK_TELEGRAPHIC'">{{
  140. t('Custom.Withdraw.addWire') }}</text>
  141. <text v-if="channelData.type == 'BANK_TELEGRAPHIC'"
  142. class="add-btn crm-cursor" @click="openAddBankCard('add_wireTransfer')">
  143. {{ t('Custom.Withdraw.addBank1') }}
  144. </text>
  145. <text v-if="channelData.type == 'BANK'">{{
  146. t('Custom.Withdraw.addBank')
  147. }}</text>
  148. <text v-if="channelData.type == 'BANK'" class="add-btn crm-cursor"
  149. @click="openAddBankCard('add_bankCard')">
  150. {{ t('Custom.Withdraw.addBank1') }}
  151. </text>
  152. <text v-if="channelData.type == 'CHANNEL_TYPE_CARD'">{{
  153. t('PersonalManagement.Label.addCreditCard') }}</text>
  154. <text v-if="channelData.type == 'CHANNEL_TYPE_CARD'"
  155. class="add-btn crm-cursor" @click="openAddBankCard('add_CreditCard')">
  156. {{ t('Custom.Withdraw.addBank1') }}
  157. </text>
  158. </div>
  159. </div>
  160. </uni-col>
  161. <!-- 网银支付信息(BANK) -->
  162. <uni-col :span="24" v-if="channelData.type == 'BANK' && isStep3">
  163. <uni-forms-item>
  164. <cwg-combox v-model:value="myId" :options="bankCardOptions"
  165. :placeholder="t('placeholder.choose')" @change="chooseBank" />
  166. </uni-forms-item>
  167. </uni-col>
  168. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  169. v-if="channelData.type == 'BANK' && isStep3">
  170. <uni-forms-item :label="t('Custom.Withdraw.UserName')">
  171. <uni-easyinput disabled v-model="form.bankUname" />
  172. </uni-forms-item>
  173. </uni-col>
  174. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  175. v-if="channelData.type == 'BANK' && isStep3">
  176. <uni-forms-item :label="t('Custom.Withdraw.BankCardNum')">
  177. <uni-easyinput disabled v-model="form.bankCardNum" />
  178. </uni-forms-item>
  179. </uni-col>
  180. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  181. v-if="channelData.type == 'BANK' && isStep3">
  182. <uni-forms-item :label="t('Custom.Withdraw.BankName')">
  183. <uni-easyinput disabled v-model="form.bankName" />
  184. </uni-forms-item>
  185. </uni-col>
  186. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  187. v-if="channelData.type == 'BANK' && isStep3">
  188. <uni-forms-item :label="t('Custom.Withdraw.bankBranchName')">
  189. <uni-easyinput disabled v-model="form.bankBranchName" />
  190. </uni-forms-item>
  191. </uni-col>
  192. <!-- 信用卡信息 -->
  193. <uni-col :span="24" v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  194. <uni-forms-item>
  195. <cwg-combox v-model:value="myId" :options="bankCardOptions"
  196. :placeholder="t('placeholder.choose')" @change="chooseBank" />
  197. </uni-forms-item>
  198. </uni-col>
  199. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  200. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  201. <uni-forms-item :label="t('PersonalManagement.Label.CreditCardAccountName')">
  202. <uni-easyinput disabled v-model="form.bankUname" />
  203. </uni-forms-item>
  204. </uni-col>
  205. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  206. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  207. <uni-forms-item :label="t('PersonalManagement.Label.CreditCardAccount')">
  208. <uni-easyinput disabled v-model="form.bankCardNum" />
  209. </uni-forms-item>
  210. </uni-col>
  211. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  212. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  213. <uni-forms-item label="CVV">
  214. <uni-easyinput disabled v-model="form.cvv" />
  215. </uni-forms-item>
  216. </uni-col>
  217. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  218. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  219. <uni-forms-item :label="t('PersonalManagement.Label.ExpirationYear')">
  220. <uni-easyinput disabled v-model="form.expiryYearMonth" />
  221. </uni-forms-item>
  222. </uni-col>
  223. <!-- 电汇信息 -->
  224. <uni-col :span="24" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  225. <uni-forms-item>
  226. <cwg-combox v-model:value="myId" :options="bankCardOptions"
  227. :placeholder="t('placeholder.choose')" @change="chooseBank" />
  228. </uni-forms-item>
  229. </uni-col>
  230. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  231. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  232. <uni-forms-item :label="t('Custom.Withdraw.UserName')">
  233. <uni-easyinput disabled v-model="form.bankUname" />
  234. </uni-forms-item>
  235. </uni-col>
  236. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  237. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  238. <uni-forms-item :label="t('Custom.Withdraw.BankCardNum')">
  239. <uni-easyinput disabled v-model="form.bankCardNum" />
  240. </uni-forms-item>
  241. </uni-col>
  242. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  243. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  244. <uni-forms-item :label="t('Custom.Withdraw.BankName')">
  245. <uni-easyinput disabled v-model="form.bankName" />
  246. </uni-forms-item>
  247. </uni-col>
  248. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  249. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  250. <uni-forms-item :label="t('Custom.Withdraw.swiftCode')">
  251. <uni-easyinput disabled v-model="form.swiftCode" />
  252. </uni-forms-item>
  253. </uni-col>
  254. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  255. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  256. <uni-forms-item :label="t('Custom.Withdraw.bankCode')">
  257. <uni-easyinput disabled v-model="form.customBankCode" />
  258. </uni-forms-item>
  259. </uni-col>
  260. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  261. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  262. <uni-forms-item :label="t('Custom.Withdraw.bankAddr')">
  263. <uni-easyinput disabled v-model="form.bankAddr" />
  264. </uni-forms-item>
  265. </uni-col>
  266. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  267. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  268. <!-- Account Agency NO -->
  269. <uni-forms-item :label="'Account Agency NO'" name="agencyNo">
  270. <uni-easyinput v-model="form.agencyNo" />
  271. </uni-forms-item>
  272. </uni-col>
  273. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  274. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3 && channelData.code == 'PAY_RETAILER_REMIT_PAY_KEY_BRW'">
  275. <uni-forms-item label="CPF" name="cpf">
  276. <uni-easyinput v-model="form.cpf" />
  277. </uni-forms-item>
  278. </uni-col>
  279. <!-- 电汇金额区域 -->
  280. <uni-col :span="24" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  281. <view class="tit">
  282. <text>{{ t('Custom.Withdraw.Title3') }}</text>
  283. </view>
  284. </uni-col>
  285. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  286. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  287. <uni-forms-item :label="t('Custom.Withdraw.CurrencyType')" name="currency">
  288. <cwg-combox filterable v-model:value="form.currency"
  289. :options="[{ text: 'USD', value: 'USD' }]" />
  290. </uni-forms-item>
  291. </uni-col>
  292. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  293. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  294. <uni-forms-item :label="t('Custom.Withdraw.amount')" name="amount"
  295. :error-message="amountErrorMessage">
  296. <uni-easyinput v-model.trim="form.amount" type="number"
  297. @blur="validateAmount" />
  298. </uni-forms-item>
  299. </uni-col>
  300. <!-- 非电汇的金额区域 -->
  301. <uni-col :span="24" v-if="channelData.type != 'BANK_TELEGRAPHIC' && isStep3">
  302. <view class="tit">
  303. <text>{{ t('Custom.Withdraw.Title3') + '(' + channelData.currency + ')'
  304. }}</text>
  305. </view>
  306. </uni-col>
  307. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  308. v-if="channelData.type != 'BANK_TELEGRAPHIC' && isStep3">
  309. <uni-forms-item name="amount" :error-message="amountErrorMessage">
  310. <uni-easyinput v-model.trim="form.amount" autocomplete="off" type="number"
  311. @blur="validateAmount" />
  312. </uni-forms-item>
  313. </uni-col>
  314. </uni-row>
  315. <view class="agree">
  316. <uni-forms-item name="agree2">
  317. <checkbox-group :value="form.agree2 ? ['1'] : []" @change="onAgree2Change">
  318. <label class="checkbox">
  319. <checkbox value="1" :checked="form.agree2" />
  320. <view class="crm-cursor"
  321. style="text-decoration: underline; display: inline-block; margin-left: 10px;"
  322. @click.stop="dialogCheckTip = true">
  323. {{ t('Custom.Withdraw.Des') }}
  324. </view>
  325. </label>
  326. </checkbox-group>
  327. </uni-forms-item>
  328. </view>
  329. <view class="agree" v-if="dialogTipsIsShow">
  330. <uni-forms-item name="agree3">
  331. <checkbox-group :value="form.agree3 ? ['1'] : []" @change="onAgree3Change">
  332. <label class="checkbox">
  333. <checkbox value="1" :checked="form.agree3" />
  334. <view class="crm-cursor" style="display: inline-block; margin-left: 10px;">
  335. * {{ t('Custom.Withdraw.item1') }}<br />
  336. {{ t('Custom.Withdraw.item1_1') }}<br />
  337. {{ t('Custom.Withdraw.item1_2') }}
  338. </view>
  339. </label>
  340. </checkbox-group>
  341. </uni-forms-item>
  342. </view>
  343. <button class="s-btn" type="primary" @click="openTips">{{ t('Btn.Submit') }}</button>
  344. </uni-forms>
  345. </view>
  346. </view>
  347. </view>
  348. <!-- 提示弹窗 -->
  349. <cwg-tips-popup v-model:visible="dialogTips" content="Custom.Withdraw.item2" @confirm="closeTipsConfirm" />
  350. <cwg-tips-popup v-model:visible="dialogCheckInto" content="ApplicationDialog.Des42_1"
  351. title="ApplicationDialog.Des41_1" @confirm="closeTipsConfirm" />
  352. <cwg-tips-popup v-model:visible="dialogCheckInto1" content="ApplicationDialog.Des42"
  353. title="ApplicationDialog.Des41" @confirm="closeTipsConfirm" />
  354. <!-- 弹窗:确认信息 -->
  355. <cwg-check-confirm-popup v-model:visible="dialogCheckConfirm" :title="t('Home.page_customer.item3')"
  356. :channelData="channelData" :code="code" :selectCodes="selectCodes" :params="form"
  357. :FreeNumber="FreeNumber" :userName="userName" :dialogCheckConfirm_form="dialogCheckConfirm_form"
  358. :login="loginValue" type="IB" @confirm="submit" />
  359. <!-- 协议弹窗 -->
  360. <cwg-tips-popup v-model:visible="dialogCheckTip"
  361. :introduce="isZh ? introduce.introduce : introduce.enIntroduce" />
  362. <!-- 等待弹窗 -->
  363. <cwg-wait-popup v-model:visible="dialogCheckWait" type="center" :mask-click="false" :showFooters="false" />
  364. <!-- 最后失败弹窗 -->
  365. <cwg-error-popup v-model:visible="dialogError" @confirm="closeDia" :responseMessage="RES" />
  366. <!-- 最后成功弹窗 -->
  367. <cwg-success-popup v-model:visible="dialogSuccess" @confirm="closeDia" />
  368. <!-- 功能关闭弹出 -->
  369. <cwg-function-disabled-popup v-model:visible="InfoStatus5" :showFooters="false" @confirm="toHome" />
  370. <!-- kyc成功弹窗 -->
  371. <cwg-kyc-popup v-model:visible="dialogKyc" :qrText="text1" />
  372. <!--验证码-->
  373. <!-- 新增银行弹窗 -->
  374. <add-bank-dialog ref="addBankDialogRef" @success="addSuccess" />
  375. </view>
  376. </cwg-page-wrapper>
  377. </template>
  378. <script setup>
  379. import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue'
  380. import { onLoad } from '@dcloudio/uni-app'
  381. import { showToast } from "@/utils/toast";
  382. import useUserStore from '@/stores/use-user-store'
  383. import { customApi } from "@/service/custom"
  384. import { financialApi } from "@/service/financial"
  385. import Config from "@/config/index"
  386. import AddBankDialog from '@/components/AddBankDialog.vue';
  387. import CwgCheckConfirmPopup from '../customer/components/WithdrawCheckConfirmPopup.vue'
  388. import CwgKycPopup from '../customer/components/KycPopup.vue'
  389. import PaymentMethodsList from '../customer/components/PaymentMethodsList.vue'
  390. import { useI18n } from 'vue-i18n'
  391. const { t, locale } = useI18n()
  392. const { Code, Host80 } = Config
  393. const isZh = computed(() => ['cn', 'zhHant'].includes(locale.value))
  394. // ---------- 辅助函数:替代原 this.Session ----------
  395. // 弹窗辅助(替代原 this.$pigeon)
  396. const $pigeon = {
  397. MessageError(msg) {
  398. uni.showToast({ title: msg, icon: 'none' })
  399. },
  400. MessageWarning(msg) {
  401. uni.showToast({ title: msg, icon: 'none' })
  402. },
  403. MessageConfirm(content, title, confirmText, cancelText, confirmCallback, cancelCallback) {
  404. uni.showModal({
  405. title,
  406. content,
  407. confirmText,
  408. cancelText,
  409. success(res) {
  410. if (res.confirm) confirmCallback && confirmCallback()
  411. else cancelCallback && cancelCallback()
  412. }
  413. })
  414. }
  415. }
  416. // 获取 metaInfo(用于二维码)
  417. const getMetaInfo = () => {
  418. const systemInfo = uni.getSystemInfoSync()
  419. return {
  420. userAgent: systemInfo.platform,
  421. screenWidth: systemInfo.screenWidth,
  422. screenHeight: systemInfo.screenHeight,
  423. deviceType: 'h5'
  424. }
  425. }
  426. // ---------- 响应式数据(完全保留原 data 结构) ----------
  427. const dialogFreeNumber = ref(false)
  428. const FreeNumber = ref(0)
  429. const InfoStatus5 = ref(false)
  430. const metaInfo = ref(null)
  431. const text1 = ref("")
  432. const flag = ref(false)
  433. const RES = ref("")
  434. const openType = ref("")
  435. const dialogInfoTradingAdd = ref(false)
  436. const ruleForm = reactive({
  437. bankInfo: [],
  438. bankWrit: [],
  439. xykInfo: [],
  440. bankBlockchain: []
  441. })
  442. const imgUrl = Host80
  443. const loginOptions = ref([])
  444. const loginValue = ref("")
  445. const code = ref("")
  446. const bankValid = ref("")
  447. const requestUrl = ref("")
  448. const isStep3 = ref(false)
  449. const step2 = ref(false)
  450. const step3 = ref(false)
  451. const dialogCheckTip = ref(false)
  452. const isChannel = ref(true)
  453. const pictLoading = ref(false)
  454. const tableData = reactive({
  455. International_Transfer: [],
  456. China_UnionPay: [],
  457. Digital_Currency: [],
  458. CHANNEL_TYPE_CARD: [],
  459. Electronic_Wallet: [],
  460. CHANNEL_TYPE_ALI_WALLET: [],
  461. UCARD_WALLET: []
  462. })
  463. //通道table-选择前后
  464. const activeTab = ref(1)
  465. // 🔥 自动过滤掉空数据的 tab
  466. const tabsConfig = computed(() => {
  467. const allTabs = [
  468. { text: t('Custom.Deposit.Channel3'), value: 1, type: 'Digital_Currency' },
  469. { text: t('Custom.Deposit.Channel2'), value: 2, type: 'China_UnionPay' },
  470. { text: t('Custom.Deposit.Channel4'), value: 3, type: 'Electronic_Wallet' },
  471. { text: t('Custom.Deposit.Channel1'), value: 4, type: 'International_Transfer' },
  472. { text: t('PersonalManagement.Label.CreditCard'), value: 5, type: 'CHANNEL_TYPE_CARD' },
  473. { text: t('card.title'), value: 6, type: 'UCARD_WALLET' },
  474. { text: t('Label.Ali'), value: 7, type: 'CHANNEL_TYPE_ALI_WALLET' },
  475. ]
  476. // ✅ 只保留有数据的 tab
  477. return allTabs.filter(tab => {
  478. console.log(tableData[tab.type], tab.type);
  479. return tableData[tab.type]?.length > 0
  480. })
  481. })
  482. // 当前选中的 tab 项
  483. const currentTab = computed(() => tabsConfig.value.find(t => t.value === activeTab.value))
  484. // 当前要渲染的表格数据
  485. const currentTableData = computed(() => {
  486. const type = currentTab.value?.type
  487. return type ? tableData[type] || [] : []
  488. })
  489. // ✅ 监听 tab 变化,自动选中第一个有数据的 tab
  490. watch(
  491. tabsConfig,
  492. (newTabs) => {
  493. if (newTabs.length > 0) {
  494. activeTab.value = newTabs[0].value // 选中第一个
  495. }
  496. },
  497. { immediate: true }
  498. )
  499. const bankDate = ref([])
  500. const channelData = ref({})
  501. const WireTransferAccount = ref({})
  502. const formRef = ref(null)
  503. const form = reactive({
  504. currency: "USD",
  505. amount: "",
  506. bankCode: '', // 银行代码(普通银行通道选择)
  507. address: '', // 电子钱包地址 / 数字货币地址(输入/展示)
  508. addressName: '', // 数字货币地址名称(展示)
  509. addressProve: '', // 数字货币地址证明文件路径(仅展示))
  510. bankUname: '', // 持卡人姓名
  511. bankCardNum: '', // 银行卡号
  512. bankName: '', // 银行名称
  513. bankBranchName: '', // 支行名称
  514. swiftCode: '', // SWIFT代码
  515. customBankCode: '', // 自定义银行代码
  516. bankAddr: '', // 银行地址
  517. agencyNo: '', // 代理机构编号(电汇专用,可编辑)
  518. cpf: '', // CPF号码(电汇专用,可编辑)
  519. cvv: '', // CVV码(电汇专用,可编辑)
  520. expiryYearMonth: '', // 过期年(电汇专用,可编辑)
  521. agree2: false,
  522. agree3: false,
  523. })
  524. const mAmount = reactive({
  525. minAmount: "",
  526. maxAmount: ""
  527. })
  528. const introduce = reactive({
  529. introduce: "",
  530. enIntroduce: ""
  531. })
  532. const bankInfoList = ref([])
  533. const bank = ref("")
  534. const myId = ref("")
  535. const bankPayType = ref("")
  536. const step3_bank_cur = ref("")
  537. const agree2 = ref(false)
  538. const form1 = ref({})
  539. const dialogCheck = ref(false)
  540. const dialogKyc = ref(false)
  541. const dialogVisible = ref(false)
  542. const dialogCheckWait = ref(false)
  543. const dialogCheckInto = ref(false)
  544. const dialogCheckInto1 = ref(false)
  545. const dialogNewBank = ref(false)
  546. const params = reactive({
  547. bankCardNum: "",
  548. bankUname: "",
  549. bankName: "",
  550. bankBranchName: "",
  551. bankAddr: "",
  552. swiftCode: "",
  553. bankFront: "",
  554. bankBack: "",
  555. defaultBank: false
  556. })
  557. const resetForm = async () => {
  558. await nextTick();
  559. formRef.value?.clearValidate(); // 再次清除可能因数据重置产生的新错误
  560. params.bankCardNum = ""
  561. params.bankUname = ""
  562. params.bankName = ""
  563. params.bankBranchName = ""
  564. params.bankAddr = ""
  565. params.swiftCode = ""
  566. params.bankFront = ""
  567. params.bankBack = ""
  568. params.defaultBank = false
  569. form.amount = ""
  570. form.amount1 = ""
  571. form.bankCode = ""
  572. form.address = ""
  573. form.addressName = ""
  574. form.addressProve = ""
  575. form.bankUname = ""
  576. form.bankCardNum = ""
  577. form.swiftCode = ""
  578. form.customBankCode = ""
  579. form.bankAddr = ""
  580. form.agencyNo = ""
  581. form.bankName = ""
  582. form.cpf = ""
  583. form.bankBranchName = ""
  584. form.cpf = ""
  585. form.cvv = ""
  586. form.expiryYearMonth = ""
  587. form.agree2 = false
  588. form.agree3 = false
  589. amountErrorMessage.value = ""
  590. flag.value = false
  591. loginValue.value = ""
  592. dialogCheck.value = false
  593. dialogVisible.value = false
  594. }
  595. const dialogTips = ref(false)
  596. const dialogTipsIsShow = ref(true)
  597. const dialogCheckConfirm = ref(false)
  598. const dialogCheckConfirm_form = reactive({
  599. amount: "",
  600. feeAmount: ""
  601. })
  602. // 验证规则(保留原结构,实际验证需配合表单组件)
  603. const rules = computed(() => ({
  604. bankCardNum: {
  605. rules: [
  606. {
  607. required: true,
  608. errorMessage: t('vaildate.input.empty'),
  609. trigger: 'blur',
  610. },
  611. ],
  612. },
  613. bankUname: {
  614. rules: [
  615. {
  616. required: true,
  617. errorMessage: t('vaildate.input.empty'),
  618. trigger: 'blur',
  619. },
  620. ],
  621. },
  622. bankName: {
  623. rules: [
  624. {
  625. required: true,
  626. errorMessage: t('vaildate.input.empty'),
  627. trigger: 'blur',
  628. },
  629. ],
  630. },
  631. bankBranchName: {
  632. rules: [
  633. {
  634. required: true,
  635. errorMessage: t('vaildate.input.empty'),
  636. trigger: 'blur',
  637. },
  638. ],
  639. },
  640. bankAddr: {
  641. rules: [
  642. {
  643. required: true,
  644. errorMessage: t('vaildate.input.empty'),
  645. trigger: 'blur',
  646. },
  647. ],
  648. },
  649. swiftCode: {
  650. rules: [
  651. {
  652. required: true,
  653. errorMessage: t('vaildate.input.empty'),
  654. trigger: 'blur',
  655. },
  656. ],
  657. },
  658. defaultBank: {
  659. rules: [
  660. {
  661. required: true,
  662. errorMessage: t('vaildate.select.empty'),
  663. trigger: 'change',
  664. },
  665. ],
  666. },
  667. bankCode: {
  668. rules: [
  669. {
  670. required: true,
  671. errorMessage: t('vaildate.select.empty'),
  672. trigger: 'change',
  673. },
  674. ],
  675. },
  676. message: {
  677. rules: [
  678. {
  679. required: true,
  680. errorMessage: t('vaildate.input.empty'),
  681. trigger: 'blur',
  682. },
  683. ],
  684. },
  685. address: {
  686. rules: [
  687. {
  688. required: true,
  689. errorMessage: t('vaildate.input.empty'),
  690. trigger: 'blur',
  691. },
  692. ],
  693. },
  694. amount: {
  695. rules: [
  696. {
  697. required: true,
  698. errorMessage: t('vaildate.amount.format'),
  699. },
  700. {
  701. validateFunction: (rule, value, data, callback) => {
  702. if (value && (Number(mAmount.minAmount) > Number(value) || Number(mAmount.maxAmount) < Number(value))) {
  703. callback(t('vaildate.amount.amount') + mAmount.minAmount + ' - ' + mAmount.maxAmount);
  704. return false;
  705. }
  706. if (/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
  707. return true;
  708. } else {
  709. callback(t('vaildate.amount.format'));
  710. return false;
  711. }
  712. },
  713. trigger: 'blur',
  714. },
  715. ],
  716. },
  717. agree2: {
  718. rules: [
  719. {
  720. validateFunction: (rule, value, data, callback) => {
  721. if (form.agree2) {
  722. return true;
  723. } else {
  724. callback(t('vaildate.agree.empty'));
  725. return false;
  726. }
  727. },
  728. trigger: 'change',
  729. },
  730. ],
  731. },
  732. agree3: {
  733. rules: [
  734. {
  735. validateFunction: (rule, value, data, callback) => {
  736. if (form.agree3) {
  737. return true;
  738. } else {
  739. callback(t('vaildate.agree.empty'));
  740. return false;
  741. }
  742. },
  743. trigger: 'change',
  744. },
  745. ],
  746. },
  747. agencyNo: {
  748. rules: [
  749. {
  750. required: true,
  751. errorMessage: t('vaildate.input.empty'),
  752. trigger: 'blur',
  753. },
  754. ],
  755. },
  756. cpf: {
  757. rules: [
  758. {
  759. required: true,
  760. errorMessage: t('vaildate.input.empty'),
  761. trigger: 'blur',
  762. },
  763. ],
  764. },
  765. }));
  766. const amountErrorMessage = ref('')
  767. const validateAmount = () => {
  768. const amount = form.amount
  769. if (!amount && amount !== 0) {
  770. amountErrorMessage.value = t('vaildate.amount.format')
  771. return false
  772. }
  773. if (mAmount.minAmount && mAmount.maxAmount) {
  774. const min = Number(mAmount.minAmount);
  775. const max = Number(mAmount.maxAmount);
  776. const numValue = Number(amount);
  777. if (numValue < min || numValue > max) {
  778. amountErrorMessage.value = t('vaildate.amount.amount') + min + '-' + max
  779. return false
  780. }
  781. }
  782. if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(amount)) {
  783. amountErrorMessage.value = t('vaildate.amount.format')
  784. return false
  785. }
  786. amountErrorMessage.value = ''
  787. return true
  788. }
  789. // ---------- 计算属性 ----------
  790. const loginComboxOptions = computed(() => {
  791. return loginOptions.value.map((item, index) => ({
  792. text: item.label,
  793. value: item.login
  794. }))
  795. })
  796. const digitalOptions = computed(() => {
  797. return ruleForm.bankBlockchain.map((item, index) => ({
  798. text: `${item.addressName}-${item.address}`,
  799. value: item.id
  800. }))
  801. })
  802. const groupTitleMap = {
  803. 'Ucard_Wallet': 'card.title',
  804. 'Digital_Currency': 'Custom.Deposit.Channel3',
  805. 'China_UnionPay': 'Custom.Deposit.Channel2',
  806. 'Electronic_Wallet': 'Custom.Deposit.Channel4',
  807. 'International_Transfer': 'Custom.Deposit.Channel1',
  808. 'CHANNEL_TYPE_CARD': 'PersonalManagement.Label.CreditCard',
  809. 'CHANNEL_TYPE_ALI_WALLET': 'Label.Ali'
  810. }
  811. const getWalletLabel = computed(() => {
  812. if (channelData.value.type === 'CHANNEL_TYPE_WALLET') return t('Custom.Withdraw.Title7')
  813. if (channelData.value.type === 'CHANNEL_TYPE_ALI_WALLET') return t('Label.AliAccout')
  814. return ''
  815. })
  816. const bankCardOptions = computed(() => {
  817. return bankList.value.map((item, index) => ({
  818. text: getBankLabel(item),
  819. value: item.id
  820. }))
  821. })
  822. const getBankLabel = (item) => {
  823. if (channelData.value.type === 'BANK' || channelData.value.type === 'BANK_TELEGRAPHIC') {
  824. return `${item.bankName}-${item.bankCardNum}`
  825. } else if (channelData.value.type === 'CHANNEL_TYPE_CARD') {
  826. return item.bankCardNum
  827. }
  828. return ''
  829. }
  830. const bankList = computed(() => {
  831. if (channelData.value.type === 'BANK') return ruleForm.bankInfo
  832. if (channelData.value.type === 'BANK_TELEGRAPHIC') return ruleForm.bankWrit
  833. if (channelData.value.type === 'CHANNEL_TYPE_CARD') return ruleForm.xykInfo
  834. return []
  835. })
  836. const bankOptions = computed(() => {
  837. return bankDate.value.map((item, index) => ({
  838. text: (locale.value === 'cn' || locale.value === 'zhHant') ? item.name : item.enName,
  839. value: item.code
  840. }))
  841. })
  842. // 最后确认
  843. const dialogSuccess = computed(() => dialogCheck.value && dialogVisible.value)
  844. // 最后失败
  845. const dialogError = computed(() => dialogCheck.value && !dialogVisible.value)
  846. const userStore = useUserStore()
  847. const ibInfo = computed(() => {
  848. return userStore?.userInfo?.ibInfo || {}
  849. })
  850. const getInfoStatus5 = computed(() => {
  851. if (ibInfo.value.closeFunctions && ibInfo.value.closeFunctions.length > 0) {
  852. return ibInfo.value.closeFunctions.indexOf("8") !== -1
  853. }
  854. return false
  855. })
  856. const isFree = computed(() => {
  857. let flagVal = false
  858. const startTime1 = "2024/11/01 00:00:00"
  859. const timezone = 2 // 目标时区偏移小时数
  860. const now = new Date()
  861. const utc = now.getTime() + now.getTimezoneOffset() * 60000
  862. const targetTime = new Date(utc + timezone * 3600000).getTime()
  863. const start = new Date(startTime1).getTime()
  864. if (targetTime > start) flagVal = true
  865. return flagVal
  866. })
  867. // ---------- 方法 ----------
  868. const getFreeNumber = async () => {
  869. if (!isFree.value) return
  870. if (getInfoStatus5.value === false) {
  871. dialogFreeNumber.value = true
  872. }
  873. const res = await financialApi.remainingReductionNumber({})
  874. if (res.code === Code.StatusOK) {
  875. FreeNumber.value = res.data || 0
  876. } else {
  877. $pigeon.MessageError(res.msg)
  878. }
  879. }
  880. const toHome = () => {
  881. uni.reLaunch({ url: "/pages/ib/index" })
  882. InfoStatus5.value = false
  883. }
  884. const isShowDialog = () => {
  885. const startTime1 = "2025/2/15 00:00:00"
  886. const timezone = 8
  887. const now = new Date()
  888. const utc = now.getTime() + now.getTimezoneOffset() * 60000
  889. const targetTime = new Date(utc + timezone * 3600000).getTime()
  890. const start = new Date(startTime1).getTime()
  891. if (targetTime > start) {
  892. dialogCheckInto.value = false
  893. // dialogCheckInto1.value = true
  894. } else {
  895. dialogCheckInto.value = true
  896. dialogCheckInto1.value = false
  897. }
  898. }
  899. const onAgree3Change = (e) => {
  900. form.agree3 = e.detail.value.length > 0
  901. }
  902. const onAgree2Change = (e) => {
  903. form.agree2 = e.detail.value.length > 0
  904. }
  905. const selectChange = () => {
  906. // 强制更新视图
  907. }
  908. // const openAddBankCard = (type) => {
  909. // if (type === "add_bankCard") {
  910. // if (ruleForm.bankInfo.length === 2) {
  911. // $pigeon.MessageConfirm(
  912. // t("Msg.UnionPayCARDS"),
  913. // t("Msg.SystemPrompt"),
  914. // t("Btn.Confirm"),
  915. // t("Btn.Cancel"),
  916. // async () => { },
  917. // () => { }
  918. // )
  919. // } else {
  920. // openType.value = "add_bankCard"
  921. // dialogInfoTradingAdd.value = true
  922. // }
  923. // } else if (type === "add_wireTransfer") {
  924. // if (ruleForm.bankWrit.length === 2) {
  925. // $pigeon.MessageConfirm(
  926. // t("Msg.WireTransfers"),
  927. // t("Msg.SystemPrompt"),
  928. // t("Btn.Confirm"),
  929. // t("Btn.Cancel"),
  930. // async () => { },
  931. // () => { }
  932. // )
  933. // } else {
  934. // openType.value = "add_wireTransfer"
  935. // dialogInfoTradingAdd.value = true
  936. // }
  937. // } else if (type === "add_CreditCard") {
  938. // openType.value = "add_CreditCard"
  939. // dialogInfoTradingAdd.value = true
  940. // } else if (type === "add_bankBlockchain") {
  941. // if (ruleForm.bankBlockchain.length === 2) {
  942. // $pigeon.MessageConfirm(
  943. // t("blockchain.item9"),
  944. // t("Msg.SystemPrompt"),
  945. // t("Btn.Confirm"),
  946. // t("Btn.Cancel"),
  947. // async () => { },
  948. // () => { }
  949. // )
  950. // } else {
  951. // openType.value = "add_bankBlockchain"
  952. // dialogInfoTradingAdd.value = true
  953. // }
  954. // }
  955. // }
  956. // 新增银行信息
  957. const addBankDialogRef = ref(null);
  958. function openAddBankCard(type) {
  959. console.log(type, 121212)
  960. switch (type) {
  961. case 'add_bankBlockchain':
  962. openAddCrypto()
  963. break;
  964. case 'add_bankCard':
  965. openAddUnionpay()
  966. break;
  967. case 'add_wireTransfer':
  968. openAddBank()
  969. break;
  970. case 'add_CreditCard':
  971. openAddCredit()
  972. break;
  973. }
  974. }
  975. function openAddCrypto() {
  976. const wallets = bankCardOptions.value || []
  977. console.log(wallets, 12121212);
  978. // 1️⃣ 没有钱包
  979. if (wallets.length === 0) {
  980. addBankDialogRef.value?.open(4);
  981. return;
  982. }
  983. // 2️⃣ 是否存在未认证钱包
  984. const hasUnAuth = wallets.some(
  985. item => item.authStatus === 0 || item.approveStatus === 1
  986. );
  987. if (hasUnAuth) {
  988. uni.showToast({
  989. title: "加密钱包未认证",
  990. icon: "none"
  991. });
  992. return;
  993. }
  994. // 3️⃣ 是否达到上限
  995. if (wallets.length >= 2) {
  996. uni.showToast({
  997. title: t('blockchain.item9'),
  998. icon: "none"
  999. });
  1000. return;
  1001. }
  1002. // 4️⃣ 正常打开
  1003. addBankDialogRef.value?.open(4);
  1004. }
  1005. function openAddUnionpay() {
  1006. const wallets = bankCardOptions.value || []
  1007. console.log(wallets, 12121212);
  1008. if (wallets.length === 0) {
  1009. addBankDialogRef.value?.open(1);
  1010. return;
  1011. }
  1012. if (wallets.length >= 2) {
  1013. uni.showToast({
  1014. title: t('Msg.UnionPayCARDS'),
  1015. icon: "none"
  1016. });
  1017. return;
  1018. }
  1019. addBankDialogRef.value?.open(1);
  1020. }
  1021. function openAddBank() {
  1022. const wallets = bankCardOptions.value || []
  1023. console.log(wallets, 121212)
  1024. if (wallets.length === 0) {
  1025. addBankDialogRef.value?.open(2);
  1026. return;
  1027. }
  1028. if (wallets.length >= 2) {
  1029. uni.showToast({
  1030. title: t('Msg.WireTransfers'),
  1031. icon: "none"
  1032. });
  1033. return;
  1034. }
  1035. addBankDialogRef.value?.open(2);
  1036. }
  1037. function openAddCredit() {
  1038. const wallets = bankCardOptions.value || []
  1039. console.log(wallets, 12121212);
  1040. if (wallets.length === 0) {
  1041. addBankDialogRef.value?.open(3);
  1042. return;
  1043. }
  1044. addBankDialogRef.value?.open(3);
  1045. }
  1046. // 新增银行信息成功回调
  1047. const addSuccess = (e) => {
  1048. getBankInfo();
  1049. }
  1050. const closeDiaAdd = () => {
  1051. dialogInfoTradingAdd.value = false
  1052. }
  1053. const closeAdd = (val) => {
  1054. dialogInfoTradingAdd.value = val
  1055. }
  1056. const confirmToReload = () => {
  1057. dialogInfoTradingAdd.value = false
  1058. getBankInfo()
  1059. }
  1060. const getBankInfo = async () => {
  1061. const res = await financialApi.customBankList({})
  1062. if (res.code === Code.StatusOK) {
  1063. ruleForm.bankInfo = []
  1064. ruleForm.bankWrit = []
  1065. ruleForm.xykInfo = []
  1066. ruleForm.bankBlockchain = []
  1067. res.data.forEach(item => {
  1068. if (item.type === 1) {
  1069. item.customBankCode = item.bankCode
  1070. item.bankCode = null
  1071. ruleForm.bankInfo.push(item)
  1072. } else if (item.type === 2) {
  1073. item.customBankCode = item.bankCode
  1074. item.bankCode = null
  1075. ruleForm.bankWrit.push(item)
  1076. } else if (item.type === 3) {
  1077. item.customBankCode = item.bankCode
  1078. item.bankCode = null
  1079. item.expiryYearMonth = (item.expiryYear || "") + "/" + (item.expiryMonth || "")
  1080. ruleForm.xykInfo.push(item)
  1081. } else if (item.type === 4) {
  1082. item.customBankCode = item.bankCode
  1083. item.bankCode = null
  1084. ruleForm.bankBlockchain.push(item)
  1085. }
  1086. if (channelData.value.type === "BANK" && item.defaultBank && item.type === 1) {
  1087. Object.assign(form, item)
  1088. myId.value = form.id
  1089. }
  1090. if (channelData.value.type === "BANK_TELEGRAPHIC" && item.defaultBank && item.type === 2) {
  1091. Object.assign(form, item)
  1092. myId.value = form.id
  1093. }
  1094. if (channelData.value.type === "CHANNEL_TYPE_CARD" && item.defaultBank && item.type === 3) {
  1095. myId.value = item.id
  1096. Object.assign(form, item)
  1097. }
  1098. if (channelData.value.type === "DIGITAL_CURRENCY" && item.defaultBank && item.type === 4) {
  1099. myId.value = item.id
  1100. Object.assign(form, item)
  1101. }
  1102. })
  1103. } else {
  1104. $pigeon.MessageError(res.msg)
  1105. }
  1106. }
  1107. const onDigitalCurrencyChange = (val) => {
  1108. const item = ruleForm.bankBlockchain.find(b => b.id === val)
  1109. chooseBank(item.id)
  1110. }
  1111. const chooseBank = (id) => {
  1112. const item = bankList.value.find(b => b.id === id)
  1113. // if (!item) {
  1114. // showToast(t("Msg.item11"));
  1115. // return;
  1116. // }
  1117. let codeCache = ""
  1118. if (form.bankCode) codeCache = form.bankCode
  1119. Object.assign(form, item)
  1120. form.agree2 = false
  1121. form.agree3 = false
  1122. if (channelData.value.type === "BANK_TELEGRAPHIC") {
  1123. form.currency = "USD"
  1124. if (codeCache) form.bankCode = codeCache
  1125. }
  1126. }
  1127. const openTips = async () => {
  1128. if (channelData.value.type === "BANK_TELEGRAPHIC" && !myId.value) {
  1129. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1130. return
  1131. }
  1132. if (channelData.value.type === "BANK" && !myId.value) {
  1133. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1134. return
  1135. }
  1136. if (channelData.value.type === "CHANNEL_TYPE_CARD" && !myId.value) {
  1137. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1138. return
  1139. }
  1140. if (channelData.value.type === "DIGITAL_CURRENCY" && !myId.value) {
  1141. $pigeon.MessageWarning(t("blockchain.item11"))
  1142. return
  1143. }
  1144. // 此处模拟表单验证,实际应调用 uni-forms 的 validate
  1145. try {
  1146. if (formRef.value) {
  1147. const valid = await formRef.value.validate()
  1148. if (dialogTipsIsShow.value) {
  1149. dialogTips.value = true
  1150. } else {
  1151. submit("form")
  1152. }
  1153. }
  1154. } catch (error) {
  1155. if (error instanceof Array) {
  1156. showToast(error[0].errorMessage);
  1157. return
  1158. } else {
  1159. RES.value = error.msg;
  1160. }
  1161. }
  1162. }
  1163. const openTipsConfirm = () => {
  1164. dialogCheckConfirm.value = false
  1165. submit("form")
  1166. }
  1167. const closeTipsConfirm = () => {
  1168. dialogTips.value = false
  1169. dialogCheckConfirm.value = true
  1170. }
  1171. const closeDia = () => {
  1172. resetForm()
  1173. isStep3.value = false
  1174. step2.value = false
  1175. dialogCheck.value = false
  1176. dialogVisible.value = false
  1177. showTable()
  1178. }
  1179. const qrCode = async (serial) => {
  1180. metaInfo.value = getMetaInfo()
  1181. const res = await customApi.getWebsdkLink1({
  1182. serial,
  1183. metaInfo: metaInfo.value
  1184. })
  1185. if (res.code === Code.StatusOK) {
  1186. text1.value = JSON.parse(res.data).url
  1187. dialogKyc.value = true
  1188. flag.value = false
  1189. } else {
  1190. flag.value = false
  1191. }
  1192. }
  1193. const submit = async (formName) => {
  1194. if (channelData.value.type === "BANK_TELEGRAPHIC" && !myId.value) {
  1195. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1196. return
  1197. }
  1198. if (channelData.value.type === "BANK" && !myId.value) {
  1199. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1200. return
  1201. }
  1202. if (channelData.value.type === "CHANNEL_TYPE_CARD" && !myId.value) {
  1203. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1204. return
  1205. }
  1206. if (channelData.value.type === "DIGITAL_CURRENCY" && !myId.value) {
  1207. $pigeon.MessageWarning(t("blockchain.item11"))
  1208. return
  1209. }
  1210. // 模拟表单验证
  1211. try {
  1212. if (formRef.value) {
  1213. await formRef.value.validate()
  1214. if (flag.value) return
  1215. flag.value = true
  1216. dialogCheckWait.value = true
  1217. form.amount = Number(form.amount)
  1218. let res
  1219. if (channelData.value.type === "DIGITAL_CURRENCY") {
  1220. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1221. // login: loginValue.value,
  1222. payType: channelData.value.code,
  1223. ...form
  1224. })
  1225. } else if (["CHANNEL_TYPE_WALLET", "UCARD_WALLET", "CHANNEL_TYPE_ALI_WALLET"].includes(channelData.value.type)) {
  1226. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1227. // login: loginValue.value,
  1228. payType: channelData.value.code,
  1229. ...form
  1230. })
  1231. } else if (channelData.value.type === "BANK" || channelData.value.type === "BANK_TELEGRAPHIC") {
  1232. res = await financialApi.ibWithdrawApplyBank(channelData.value.requestUrl, {
  1233. // login: loginValue.value,
  1234. payType: channelData.value.code,
  1235. ...form
  1236. })
  1237. } else if (channelData.value.type === "CHANNEL_TYPE_CARD") {
  1238. res = await financialApi.WithdrawApplyBank(channelData.value.requestUrl, {
  1239. // login: loginValue.value,
  1240. payType: channelData.value.code,
  1241. ...form
  1242. })
  1243. }
  1244. if (res && res.code === Code.StatusOK) {
  1245. dialogCheck.value = true
  1246. dialogVisible.value = true
  1247. // qrCode(res.data)
  1248. flag.value = false
  1249. } else {
  1250. RES.value = res?.msg || "error"
  1251. dialogCheck.value = true
  1252. dialogVisible.value = false
  1253. flag.value = false
  1254. }
  1255. dialogCheckWait.value = false
  1256. }
  1257. } catch (error) {
  1258. if (error instanceof Array) {
  1259. showToast(error[0].errorMessage);
  1260. return
  1261. } else {
  1262. RES.value = error.msg;
  1263. dialogCheck.value = true;
  1264. dialogCheckWait.value = false;
  1265. dialogVisible.value = false;
  1266. flag.value = false;
  1267. }
  1268. }
  1269. }
  1270. const Initialize = () => {
  1271. loginValue.value = ""
  1272. isStep3.value = false
  1273. step2.value = false
  1274. step3.value = false
  1275. showTable()
  1276. }
  1277. const isShowStep3 = (row) => {
  1278. if (row.bankValid && isChannel.value) {
  1279. getBankList(row)
  1280. isChannel.value = false
  1281. step3.value = true
  1282. channelData.value = row
  1283. mAmount.minAmount = row.minAmount
  1284. mAmount.maxAmount = row.maxAmount
  1285. } else {
  1286. step3.value = true
  1287. bankDate.value = []
  1288. channelData.value = row
  1289. mAmount.minAmount = row.minAmount
  1290. mAmount.maxAmount = row.maxAmount
  1291. }
  1292. if (row.code === "UNION_PAY_TELEGRAPHIC") {
  1293. WireTransferAccount.value = JSON.parse(row.property)
  1294. }
  1295. if (["BANK", "BANK_TELEGRAPHIC", "CHANNEL_TYPE_CARD", "DIGITAL_CURRENCY"].includes(row.type)) {
  1296. getBankInfo()
  1297. step3_bank_cur.value = "bank"
  1298. form.login = loginValue.value
  1299. form.payType = row.code
  1300. bankPayType.value = row.code
  1301. }
  1302. // 重置 tableData
  1303. tableData.International_Transfer = []
  1304. tableData.China_UnionPay = []
  1305. tableData.Digital_Currency = []
  1306. tableData.CHANNEL_TYPE_CARD = []
  1307. tableData.Electronic_Wallet = []
  1308. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1309. tableData.UCARD_WALLET = []
  1310. if (row.type === "BANK_TELEGRAPHIC") tableData.International_Transfer[0] = row
  1311. if (row.type === "BANK") tableData.China_UnionPay[0] = row
  1312. if (row.type === "DIGITAL_CURRENCY") tableData.Digital_Currency[0] = row
  1313. if (row.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet[0] = row
  1314. if (row.type === "UCARD_WALLET") tableData.UCARD_WALLET[0] = row
  1315. if (row.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD[0] = row
  1316. if (row.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET[0] = row
  1317. introduce.introduce = row.introduce
  1318. introduce.enIntroduce = row.enIntroduce
  1319. }
  1320. const showTable = () => {
  1321. resetForm()
  1322. myId.value = null
  1323. step3.value = false
  1324. isStep3.value = false
  1325. isChannel.value = true
  1326. getDepositList()
  1327. // 重置表单
  1328. form.currency = "USD"
  1329. // 其他重置...
  1330. }
  1331. const getDateList = async () => {
  1332. const res = await customApi.CustomDropdown({ platform: "" })
  1333. if (res.code === Code.StatusOK) {
  1334. loginOptions.value = res.data
  1335. } else {
  1336. $pigeon.MessageError(res.msg)
  1337. }
  1338. }
  1339. const getDepositList = async () => {
  1340. pictLoading.value = true
  1341. tableData.International_Transfer = []
  1342. tableData.China_UnionPay = []
  1343. tableData.Digital_Currency = []
  1344. tableData.CHANNEL_TYPE_CARD = []
  1345. tableData.Electronic_Wallet = []
  1346. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1347. tableData.UCARD_WALLET = []
  1348. const res = await financialApi.RemitChannelList({})
  1349. if (res.code === Code.StatusOK) {
  1350. res.data.forEach(item => {
  1351. if (item.type === "BANK_TELEGRAPHIC") tableData.International_Transfer.push(item)
  1352. if (item.type === "BANK") tableData.China_UnionPay.push(item)
  1353. if (item.type === "DIGITAL_CURRENCY") tableData.Digital_Currency.push(item)
  1354. if (item.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet.push(item)
  1355. if (item.type === "UCARD_WALLET") tableData.UCARD_WALLET.push(item)
  1356. if (item.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD.push(item)
  1357. if (item.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET.push(item)
  1358. })
  1359. pictLoading.value = false
  1360. } else {
  1361. $pigeon.MessageError(res.msg)
  1362. pictLoading.value = false
  1363. }
  1364. }
  1365. const getBankList = async (row) => {
  1366. const res = await financialApi.BankList({ channelCode: row.code })
  1367. if (res.code === Code.StatusOK) {
  1368. const bank = res.data
  1369. const data = []
  1370. bank.forEach(j => {
  1371. if (!j.minAmount && j.minAmount !== 0) j.minAmount = row.minAmount
  1372. if (!j.maxAmount && j.maxAmount !== 0) j.maxAmount = row.maxAmount
  1373. j.payType = row.code
  1374. data.push(j)
  1375. })
  1376. bankDate.value = data
  1377. } else {
  1378. $pigeon.MessageError(res.msg)
  1379. }
  1380. }
  1381. const cancelBank = () => {
  1382. dialogNewBank.value = false
  1383. // 重置 params 表单
  1384. Object.assign(params, {
  1385. bankCardNum: "",
  1386. bankUname: "",
  1387. bankName: "",
  1388. bankBranchName: "",
  1389. bankAddr: "",
  1390. swiftCode: "",
  1391. bankFront: "",
  1392. bankBack: "",
  1393. defaultBank: false
  1394. })
  1395. }
  1396. // ---------- 生命周期 ----------
  1397. onMounted(() => {
  1398. if (getInfoStatus5.value) {
  1399. InfoStatus5.value = true
  1400. return
  1401. }
  1402. getFreeNumber()
  1403. isShowDialog()
  1404. // getDateList()
  1405. getDepositList()
  1406. })
  1407. // 监听 value 变化
  1408. watch(loginValue, (newVal) => {
  1409. if (newVal) {
  1410. step2.value = true
  1411. showTable()
  1412. }
  1413. })
  1414. // 监听 form.amount 变化
  1415. watch(() => form.amount, (newVal) => {
  1416. if (newVal && channelData.value.rate) {
  1417. form.amount1 = (newVal * channelData.value.rate).toFixed(2)
  1418. }
  1419. })
  1420. </script>
  1421. <style lang="scss" scoped>
  1422. @import "@/uni.scss";
  1423. .custom-withdraw {
  1424. .box {
  1425. margin-bottom: px2rpx(20);
  1426. .b-card {
  1427. background: #fff;
  1428. border-radius: px2rpx(12);
  1429. padding: px2rpx(20);
  1430. box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.03);
  1431. .card-top {
  1432. .tit {
  1433. font-size: px2rpx(16);
  1434. font-weight: 600;
  1435. margin-bottom: px2rpx(16);
  1436. display: flex;
  1437. align-items: center;
  1438. color: var(--color-navy-900);
  1439. position: relative;
  1440. padding-left: 20px;
  1441. &:after {
  1442. content: '';
  1443. position: absolute;
  1444. left: 0;
  1445. top: 50%;
  1446. transform: translateY(-50%);
  1447. width: 0;
  1448. height: 0;
  1449. border-top: 6px solid transparent;
  1450. border-bottom: 6px solid transparent;
  1451. border-left: 8px solid currentColor;
  1452. }
  1453. .iconfont {
  1454. margin-right: px2rpx(8);
  1455. color: var(--color-primary);
  1456. font-size: px2rpx(18);
  1457. }
  1458. }
  1459. }
  1460. .channelType {
  1461. font-size: px2rpx(15);
  1462. font-weight: 600;
  1463. margin: px2rpx(24) 0 px2rpx(12);
  1464. color: var(--color-navy-700);
  1465. padding-left: px2rpx(8);
  1466. border-left: px2rpx(4) solid var(--color-primary);
  1467. }
  1468. }
  1469. }
  1470. .reselect-btn {
  1471. margin-top: px2rpx(20);
  1472. display: flex;
  1473. justify-content: flex-end;
  1474. }
  1475. .s-btn {
  1476. &.reselect {
  1477. background-color: var(--color-zinc-100);
  1478. color: var(--color-navy-700);
  1479. border: none;
  1480. font-size: px2rpx(14);
  1481. padding: px2rpx(8) px2rpx(20);
  1482. border-radius: px2rpx(8);
  1483. &:active {
  1484. background-color: var(--color-zinc-200);
  1485. }
  1486. }
  1487. &[type="primary"] {
  1488. width: 100%;
  1489. height: px2rpx(48);
  1490. background: var(--color-navy-900);
  1491. color: #fff;
  1492. border-radius: px2rpx(12);
  1493. font-size: px2rpx(16);
  1494. font-weight: 600;
  1495. display: flex;
  1496. align-items: center;
  1497. justify-content: center;
  1498. border: none;
  1499. margin-top: px2rpx(30);
  1500. transition: all 0.2s;
  1501. &:active {
  1502. transform: scale(0.98);
  1503. background: var(--color-navy-800);
  1504. }
  1505. }
  1506. }
  1507. .add-back {
  1508. display: flex;
  1509. justify-content: space-between;
  1510. align-items: center;
  1511. margin-bottom: px2rpx(12);
  1512. padding: px2rpx(12) px2rpx(16);
  1513. background: var(--color-zinc-100);
  1514. border-radius: px2rpx(8);
  1515. text {
  1516. font-size: px2rpx(14);
  1517. color: var(--color-navy-700);
  1518. font-weight: 500;
  1519. }
  1520. .add-btn {
  1521. color: var(--color-primary);
  1522. font-weight: 600;
  1523. text-decoration: underline;
  1524. &:active {
  1525. opacity: 0.7;
  1526. }
  1527. }
  1528. }
  1529. .proof {
  1530. margin-top: px2rpx(8);
  1531. border: px2rpx(1) dashed var(--color-zinc-300);
  1532. border-radius: px2rpx(8);
  1533. padding: px2rpx(8);
  1534. display: flex;
  1535. justify-content: center;
  1536. align-items: center;
  1537. background: var(--color-zinc-50);
  1538. .state {
  1539. padding: px2rpx(4) px2rpx(12);
  1540. border-radius: px2rpx(4);
  1541. font-size: px2rpx(12);
  1542. font-weight: bold;
  1543. }
  1544. }
  1545. .agree {
  1546. margin: px2rpx(24) 0;
  1547. display: flex;
  1548. align-items: flex-start;
  1549. .checkbox {
  1550. display: flex;
  1551. align-items: flex-start;
  1552. gap: px2rpx(8);
  1553. :deep(uni-checkbox .uni-checkbox-input) {
  1554. border-radius: px2rpx(4);
  1555. width: px2rpx(18);
  1556. height: px2rpx(18);
  1557. }
  1558. text {
  1559. font-size: px2rpx(13);
  1560. color: var(--color-zinc-500);
  1561. line-height: 1.5;
  1562. }
  1563. }
  1564. }
  1565. .step3-attention {
  1566. // background: var(--color-error-50, #fff1f0);
  1567. border-radius: px2rpx(12);
  1568. margin-bottom: px2rpx(20);
  1569. .tips {
  1570. line-height: 1.8;
  1571. font-size: px2rpx(12);
  1572. color: #909399;
  1573. background-color: #f9f9f9;
  1574. padding: px2rpx(12);
  1575. border-radius: px2rpx(4);
  1576. border-left: px2rpx(2) solid #409eff;
  1577. .title {
  1578. font-weight: 600;
  1579. margin-bottom: px2rpx(6);
  1580. color: #606266;
  1581. }
  1582. }
  1583. .attention {
  1584. font-size: px2rpx(14);
  1585. // color: var(--color-error-600, #cf1322);
  1586. line-height: 1.6;
  1587. }
  1588. .btn-bottom {
  1589. margin-top: px2rpx(20);
  1590. display: flex;
  1591. justify-content: center;
  1592. .btn {
  1593. background: var(--color-error-600, #cf1322);
  1594. color: #fff;
  1595. padding: px2rpx(10) px2rpx(48);
  1596. border-radius: px2rpx(24);
  1597. font-size: px2rpx(15);
  1598. font-weight: 700;
  1599. box-shadow: 0 px2rpx(4) px2rpx(10) rgba(207, 19, 34, 0.2);
  1600. transition: all 0.2s;
  1601. &:active {
  1602. transform: scale(0.96);
  1603. opacity: 0.8;
  1604. }
  1605. }
  1606. }
  1607. }
  1608. :deep(.base-info-form) {
  1609. .uni-row1 {
  1610. .uni-col {
  1611. padding: 0 px2rpx(10) !important;
  1612. }
  1613. .uni-forms-item {
  1614. min-height: px2rpx(36);
  1615. margin-bottom: px2rpx(28);
  1616. }
  1617. .uni-select,
  1618. .uni-combox,
  1619. .uni-easyinput__content,
  1620. .uni-date-editor--x {
  1621. border: none !important;
  1622. background-color: var(--color-zinc-100) !important;
  1623. border-radius: px2rpx(8) !important;
  1624. }
  1625. .uni-date-x {
  1626. border: none !important;
  1627. background-color: rgba(195, 195, 195, 0) !important;
  1628. }
  1629. .uni-easyinput__content-input {
  1630. height: px2rpx(35) !important;
  1631. }
  1632. }
  1633. }
  1634. @keyframes rotate {
  1635. from {
  1636. transform: rotate(0deg);
  1637. }
  1638. to {
  1639. transform: rotate(360deg);
  1640. }
  1641. }
  1642. }
  1643. </style>