withdraw.vue 93 KB

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