withdraw.vue 93 KB

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