withdraw.vue 93 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216
  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 cursor-pointer" :data-tooltip="t('vu.tooltip.t13')"
  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. import { useFilters } from '@/composables/useFilters'
  701. const { numberDecimal } = useFilters()
  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. watch(locale, () => {
  1102. formRef.value?.clearValidate()
  1103. setTipsAmount()
  1104. })
  1105. const amountErrorMessage = ref('')
  1106. const setTipsAmount = () => {
  1107. const min = Number(mAmount.minAmount);
  1108. const max = Number(mAmount.maxAmount);
  1109. nextTick(() => {
  1110. amountErrorMessage.value = t('vaildate.amount.amount') + min + '-' + max
  1111. })
  1112. }
  1113. const validateAmount = () => {
  1114. const amount = Number(form.amount)
  1115. if (mAmount.minAmount && mAmount.maxAmount) {
  1116. const min = Number(mAmount.minAmount);
  1117. const max = Number(mAmount.maxAmount);
  1118. if (!amount && amount !== 0) {
  1119. amountErrorMessage.value = t('vaildate.amount.amount') + min + '-' + max
  1120. return false
  1121. }
  1122. if (amount < min || amount > max) {
  1123. amountErrorMessage.value = t('vaildate.amount.amount') + min + '-' + max
  1124. return false
  1125. }
  1126. }
  1127. if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(amount)) {
  1128. amountErrorMessage.value = t('vaildate.amount.format')
  1129. return false
  1130. }
  1131. if (amount > balance.value) {
  1132. amountErrorMessage.value = t('Label.LoginBalance') + ':$' + balance.value
  1133. return false
  1134. }
  1135. amountErrorMessage.value = ''
  1136. return true
  1137. }
  1138. // ---------- 计算属性 ----------
  1139. const loginComboxOptions = computed(() => {
  1140. return loginOptions.value.map((item, index) => ({
  1141. text: `${item.login} - ${groupTypeName(item.type)} - ${t('Custom.Deposit.AvailableBalance')}${groupCurrency(item.currency)}${numberDecimal(item.balance)}`,
  1142. value: item.login
  1143. }))
  1144. })
  1145. const digitalOptions = computed(() => {
  1146. return ruleForm.bankBlockchain.map((item, index) => ({
  1147. text: `${item.addressName}-${item.address}`,
  1148. value: item.id,
  1149. disable: item.authStatus == 0
  1150. }))
  1151. })
  1152. const groupTitleMap = {
  1153. 'Ucard_Wallet': 'card.title',
  1154. 'Digital_Currency': 'Custom.Deposit.Channel3',
  1155. 'China_UnionPay': 'Custom.Deposit.Channel2',
  1156. 'Electronic_Wallet': 'Custom.Deposit.Channel4',
  1157. 'International_Transfer': 'Custom.Deposit.Channel1',
  1158. 'CHANNEL_TYPE_CARD': 'PersonalManagement.Label.CreditCard',
  1159. 'CHANNEL_TYPE_ALI_WALLET': 'Label.Ali'
  1160. }
  1161. const getWalletLabel = computed(() => {
  1162. if (channelData.value.type === 'CHANNEL_TYPE_WALLET') return t('Custom.Withdraw.Title7')
  1163. if (channelData.value.type === 'CHANNEL_TYPE_ALI_WALLET') return t('Label.AliAccout')
  1164. return ''
  1165. })
  1166. const bankCardOptions = computed(() => {
  1167. return bankList.value.map((item, index) => ({
  1168. text: getBankLabel(item),
  1169. value: item.id
  1170. }))
  1171. })
  1172. const getBankLabel = (item) => {
  1173. if (channelData.value.type === 'BANK' || channelData.value.type === 'BANK_TELEGRAPHIC') {
  1174. return `${item.bankName}-${item.bankCardNum}`
  1175. } else if (channelData.value.type === 'CHANNEL_TYPE_CARD') {
  1176. return item.bankCardNum
  1177. }
  1178. return ''
  1179. }
  1180. const bankList = computed(() => {
  1181. if (channelData.value.type === 'BANK') return ruleForm.bankInfo
  1182. if (channelData.value.type === 'BANK_TELEGRAPHIC') return ruleForm.bankWrit
  1183. if (channelData.value.type === 'CHANNEL_TYPE_CARD') return ruleForm.xykInfo
  1184. if (channelData.value.type === 'DIGITAL_CURRENCY') return ruleForm.bankBlockchain
  1185. return []
  1186. })
  1187. const bankOptions = computed(() => {
  1188. return bankDate.value.map((item, index) => ({
  1189. text: (locale.value === 'cn' || locale.value === 'zhHant') ? item.name : item.enName,
  1190. value: item.code
  1191. }))
  1192. })
  1193. // 最后确认
  1194. const dialogSuccess = computed(() => dialogCheck.value && dialogVisible.value)
  1195. // 最后失败
  1196. const dialogError = computed(() => dialogCheck.value && !dialogVisible.value)
  1197. const userStore = useUserStore()
  1198. const ibInfo = computed(() => {
  1199. return userStore?.userInfo?.ibInfo || {}
  1200. })
  1201. const getInfoStatus5 = computed(() => {
  1202. if (ibInfo.value.closeFunctions && ibInfo.value.closeFunctions.length > 0) {
  1203. return ibInfo.value.closeFunctions.indexOf("8") !== -1
  1204. }
  1205. return false
  1206. })
  1207. const isFree = computed(() => {
  1208. let flagVal = false
  1209. const startTime1 = "2024/11/01 00:00:00"
  1210. const timezone = 2 // 目标时区偏移小时数
  1211. const now = new Date()
  1212. const utc = now.getTime() + now.getTimezoneOffset() * 60000
  1213. const targetTime = new Date(utc + timezone * 3600000).getTime()
  1214. const start = new Date(startTime1).getTime()
  1215. if (targetTime > start) flagVal = true
  1216. return flagVal
  1217. })
  1218. // ---------- 方法 ----------
  1219. const getFreeNumber = async () => {
  1220. if (!isFree.value) return
  1221. if (getInfoStatus5.value === false) {
  1222. dialogFreeNumber.value = true
  1223. }
  1224. const res = await financialApi.remainingReductionNumber({})
  1225. if (res.code === Code.StatusOK) {
  1226. FreeNumber.value = res.data || 0
  1227. } else {
  1228. uni.showToast({ title: res.msg, icon: 'none' })
  1229. }
  1230. }
  1231. const toHome = () => {
  1232. uni.reLaunch({ url: "/pages/ib/index" })
  1233. InfoStatus5.value = false
  1234. }
  1235. const isShowDialog = () => {
  1236. const startTime1 = "2025/2/15 00:00:00"
  1237. const timezone = 8
  1238. const now = new Date()
  1239. const utc = now.getTime() + now.getTimezoneOffset() * 60000
  1240. const targetTime = new Date(utc + timezone * 3600000).getTime()
  1241. const start = new Date(startTime1).getTime()
  1242. if (targetTime > start) {
  1243. dialogCheckInto.value = false
  1244. // dialogCheckInto1.value = true
  1245. } else {
  1246. dialogCheckInto.value = true
  1247. dialogCheckInto1.value = false
  1248. }
  1249. }
  1250. const onAgree3Change = (e) => {
  1251. form.agree3 = e.detail.value.length > 0
  1252. }
  1253. const onAgree2Change = (e) => {
  1254. form.agree2 = e.detail.value.length > 0
  1255. }
  1256. const selectChange = () => {
  1257. // 强制更新视图
  1258. }
  1259. // const openAddBankCard = (type) => {
  1260. // if (type === "add_bankCard") {
  1261. // if (ruleForm.bankInfo.length === 2) {
  1262. // $pigeon.MessageConfirm(
  1263. // t("Msg.UnionPayCARDS"),
  1264. // t("Msg.SystemPrompt"),
  1265. // t("Btn.Confirm"),
  1266. // t("Btn.Cancel"),
  1267. // async () => { },
  1268. // () => { }
  1269. // )
  1270. // } else {
  1271. // openType.value = "add_bankCard"
  1272. // dialogInfoTradingAdd.value = true
  1273. // }
  1274. // } else if (type === "add_wireTransfer") {
  1275. // if (ruleForm.bankWrit.length === 2) {
  1276. // $pigeon.MessageConfirm(
  1277. // t("Msg.WireTransfers"),
  1278. // t("Msg.SystemPrompt"),
  1279. // t("Btn.Confirm"),
  1280. // t("Btn.Cancel"),
  1281. // async () => { },
  1282. // () => { }
  1283. // )
  1284. // } else {
  1285. // openType.value = "add_wireTransfer"
  1286. // dialogInfoTradingAdd.value = true
  1287. // }
  1288. // } else if (type === "add_CreditCard") {
  1289. // openType.value = "add_CreditCard"
  1290. // dialogInfoTradingAdd.value = true
  1291. // } else if (type === "add_bankBlockchain") {
  1292. // if (ruleForm.bankBlockchain.length === 2) {
  1293. // $pigeon.MessageConfirm(
  1294. // t("blockchain.item9"),
  1295. // t("Msg.SystemPrompt"),
  1296. // t("Btn.Confirm"),
  1297. // t("Btn.Cancel"),
  1298. // async () => { },
  1299. // () => { }
  1300. // )
  1301. // } else {
  1302. // openType.value = "add_bankBlockchain"
  1303. // dialogInfoTradingAdd.value = true
  1304. // }
  1305. // }
  1306. // }
  1307. // 新增银行信息
  1308. const addBankDialogRef = ref(null);
  1309. function openAddBankCard(type) {
  1310. switch (type) {
  1311. case 'add_bankBlockchain':
  1312. openAddCrypto()
  1313. break;
  1314. case 'add_bankCard':
  1315. openAddUnionpay()
  1316. break;
  1317. case 'add_wireTransfer':
  1318. openAddBank()
  1319. break;
  1320. case 'add_CreditCard':
  1321. openAddCredit()
  1322. break;
  1323. }
  1324. }
  1325. function openAddCrypto() {
  1326. const wallets = bankCardOptions.value || []
  1327. // 1️⃣ 没有钱包
  1328. if (wallets.length === 0) {
  1329. addBankDialogRef.value?.open(4);
  1330. return;
  1331. }
  1332. // 2️⃣ 是否存在未认证钱包
  1333. const hasUnAuth = wallets.some(
  1334. item => item.authStatus === 0 || item.approveStatus === 1
  1335. );
  1336. if (hasUnAuth) {
  1337. uni.showToast({
  1338. title: "加密钱包未认证",
  1339. icon: "none"
  1340. });
  1341. return;
  1342. }
  1343. // 3️⃣ 是否达到上限
  1344. if (wallets.length >= 2) {
  1345. uni.showToast({
  1346. title: t('blockchain.item9'),
  1347. icon: "none"
  1348. });
  1349. return;
  1350. }
  1351. // 4️⃣ 正常打开
  1352. addBankDialogRef.value?.open(4);
  1353. }
  1354. function openAddUnionpay() {
  1355. const wallets = bankCardOptions.value || []
  1356. if (wallets.length === 0) {
  1357. addBankDialogRef.value?.open(1);
  1358. return;
  1359. }
  1360. if (wallets.length >= 2) {
  1361. uni.showToast({
  1362. title: t('Msg.UnionPayCARDS'),
  1363. icon: "none"
  1364. });
  1365. return;
  1366. }
  1367. addBankDialogRef.value?.open(1);
  1368. }
  1369. function openAddBank() {
  1370. const wallets = bankCardOptions.value || []
  1371. if (wallets.length === 0) {
  1372. addBankDialogRef.value?.open(2);
  1373. return;
  1374. }
  1375. if (wallets.length >= 2) {
  1376. uni.showToast({
  1377. title: t('Msg.WireTransfers'),
  1378. icon: "none"
  1379. });
  1380. return;
  1381. }
  1382. addBankDialogRef.value?.open(2);
  1383. }
  1384. function openAddCredit() {
  1385. const wallets = bankCardOptions.value || []
  1386. if (wallets.length === 0) {
  1387. addBankDialogRef.value?.open(3);
  1388. return;
  1389. }
  1390. addBankDialogRef.value?.open(3);
  1391. }
  1392. // 新增银行信息成功回调
  1393. const addSuccess = (e) => {
  1394. getBankInfo();
  1395. }
  1396. const closeDiaAdd = () => {
  1397. dialogInfoTradingAdd.value = false
  1398. }
  1399. const closeAdd = (val) => {
  1400. dialogInfoTradingAdd.value = val
  1401. }
  1402. const confirmToReload = () => {
  1403. dialogInfoTradingAdd.value = false
  1404. getBankInfo()
  1405. }
  1406. const getBankInfo = async () => {
  1407. const res = await financialApi.customBankList({})
  1408. if (res.code === Code.StatusOK) {
  1409. ruleForm.bankInfo = []
  1410. ruleForm.bankWrit = []
  1411. ruleForm.xykInfo = []
  1412. ruleForm.bankBlockchain = []
  1413. res.data.forEach(item => {
  1414. if (item.type === 1) {
  1415. item.customBankCode = item.bankCode
  1416. item.bankCode = null
  1417. ruleForm.bankInfo.push(item)
  1418. } else if (item.type === 2) {
  1419. item.customBankCode = item.bankCode
  1420. item.bankCode = null
  1421. ruleForm.bankWrit.push(item)
  1422. } else if (item.type === 3) {
  1423. item.customBankCode = item.bankCode
  1424. item.bankCode = null
  1425. item.expiryYearMonth = (item.expiryYear || "") + "/" + (item.expiryMonth || "")
  1426. ruleForm.xykInfo.push(item)
  1427. } else if (item.type === 4) {
  1428. item.customBankCode = item.bankCode
  1429. item.bankCode = null
  1430. ruleForm.bankBlockchain.push(item)
  1431. }
  1432. if (channelData.value.type === "BANK" && item.defaultBank && item.type === 1) {
  1433. Object.assign(form, item)
  1434. myId.value = form.id
  1435. }
  1436. if (channelData.value.type === "BANK_TELEGRAPHIC" && item.defaultBank && item.type === 2) {
  1437. Object.assign(form, item)
  1438. myId.value = form.id
  1439. }
  1440. if (channelData.value.type === "CHANNEL_TYPE_CARD" && item.defaultBank && item.type === 3) {
  1441. myId.value = item.id
  1442. Object.assign(form, item)
  1443. }
  1444. if (channelData.value.type === "DIGITAL_CURRENCY" && item.defaultBank && item.type === 4 && item.authStatus != 0) {
  1445. myId.value = item.id
  1446. Object.assign(form, item)
  1447. }
  1448. })
  1449. bankList.value = ref.data
  1450. } else {
  1451. uni.showToast({ title: res.msg, icon: 'none' })
  1452. }
  1453. }
  1454. const onDigitalCurrencyChange = (val) => {
  1455. const item = ruleForm.bankBlockchain.find(b => b.id === val)
  1456. chooseBank(item.id)
  1457. }
  1458. const chooseBank = (id) => {
  1459. const item = bankList.value.find(b => b.id === id)
  1460. if (channelData.value.type == "DIGITAL_CURRENCY") {
  1461. if (item.authStatus == 0) {
  1462. showToast(t("Msg.item11"));
  1463. return;
  1464. }
  1465. }
  1466. console.log(234234);
  1467. let codeTmp = "";
  1468. if (form.bankCode) {
  1469. codeTmp = form.bankCode;
  1470. }
  1471. Object.assign(form, item)
  1472. form.agree2 = false
  1473. form.agree3 = false
  1474. if (channelData.value.type == "BANK_TELEGRAPHIC") {
  1475. form.currency = "USD";
  1476. if (codeTmp) {
  1477. form.bankCode = codeTmp;
  1478. }
  1479. }
  1480. }
  1481. const openTips = async () => {
  1482. if (channelData.value.type === "BANK_TELEGRAPHIC" && !myId.value) {
  1483. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1484. return
  1485. }
  1486. if (channelData.value.type === "BANK" && !myId.value) {
  1487. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1488. return
  1489. }
  1490. if (channelData.value.type === "CHANNEL_TYPE_CARD" && !myId.value) {
  1491. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1492. return
  1493. }
  1494. if (channelData.value.type === "DIGITAL_CURRENCY" && !myId.value) {
  1495. $pigeon.MessageWarning(t("blockchain.item11"))
  1496. return
  1497. }
  1498. // 此处模拟表单验证,实际应调用 uni-forms 的 validate
  1499. try {
  1500. if (formRef.value) {
  1501. const valid = await formRef.value.validate()
  1502. if (dialogTipsIsShow.value) {
  1503. dialogTips.value = true
  1504. } else {
  1505. submit("form")
  1506. }
  1507. }
  1508. } catch (error) {
  1509. if (error instanceof Array) {
  1510. showToast(error[0].errorMessage);
  1511. return
  1512. } else {
  1513. RES.value = error.msg;
  1514. }
  1515. }
  1516. }
  1517. const openTipsConfirm = () => {
  1518. dialogCheckConfirm.value = false
  1519. submit("form")
  1520. }
  1521. const closeTipsConfirm = () => {
  1522. dialogTips.value = false
  1523. dialogCheckConfirm.value = true
  1524. }
  1525. const closeDia = () => {
  1526. resetForm()
  1527. dialogCheck.value = false
  1528. dialogVisible.value = false
  1529. showTable()
  1530. }
  1531. const qrCode = async (serial) => {
  1532. metaInfo.value = getMetaInfo()
  1533. const res = await customApi.getWebsdkLink1({
  1534. serial,
  1535. metaInfo: metaInfo.value
  1536. })
  1537. if (res.code === Code.StatusOK) {
  1538. text1.value = JSON.parse(res.data).url
  1539. dialogKyc.value = true
  1540. flag.value = false
  1541. } else {
  1542. flag.value = false
  1543. }
  1544. }
  1545. const submit = async (formName) => {
  1546. if (channelData.value.type === "BANK_TELEGRAPHIC" && !myId.value) {
  1547. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1548. return
  1549. }
  1550. if (channelData.value.type === "BANK" && !myId.value) {
  1551. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1552. return
  1553. }
  1554. if (channelData.value.type === "CHANNEL_TYPE_CARD" && !myId.value) {
  1555. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1556. return
  1557. }
  1558. if (channelData.value.type === "DIGITAL_CURRENCY" && !myId.value) {
  1559. $pigeon.MessageWarning(t("blockchain.item11"))
  1560. return
  1561. }
  1562. // 模拟表单验证
  1563. try {
  1564. if (formRef.value) {
  1565. await formRef.value.validate()
  1566. if (flag.value) return
  1567. flag.value = true
  1568. dialogCheckWait.value = true
  1569. form.amount = Number(form.amount)
  1570. let res
  1571. if (channelData.value.type === "DIGITAL_CURRENCY") {
  1572. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1573. // login: loginValue.value,
  1574. payType: channelData.value.code,
  1575. ...form
  1576. })
  1577. } else if (["CHANNEL_TYPE_WALLET", "UCARD_WALLET", "CHANNEL_TYPE_ALI_WALLET"].includes(channelData.value.type)) {
  1578. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1579. // login: loginValue.value,
  1580. payType: channelData.value.code,
  1581. ...form
  1582. })
  1583. } else if (channelData.value.type === "BANK" || channelData.value.type === "BANK_TELEGRAPHIC") {
  1584. res = await financialApi.ibWithdrawApplyBank(channelData.value.requestUrl, {
  1585. // login: loginValue.value,
  1586. payType: channelData.value.code,
  1587. ...form
  1588. })
  1589. } else if (channelData.value.type === "CHANNEL_TYPE_CARD") {
  1590. res = await financialApi.WithdrawApplyBank(channelData.value.requestUrl, {
  1591. // login: loginValue.value,
  1592. payType: channelData.value.code,
  1593. ...form
  1594. })
  1595. }
  1596. if (res && res.code === Code.StatusOK) {
  1597. dialogCheck.value = true
  1598. dialogVisible.value = true
  1599. // qrCode(res.data)
  1600. flag.value = false
  1601. } else {
  1602. RES.value = res?.msg || "error"
  1603. dialogCheck.value = true
  1604. dialogVisible.value = false
  1605. flag.value = false
  1606. }
  1607. dialogCheckWait.value = false
  1608. }
  1609. } catch (error) {
  1610. if (error instanceof Array) {
  1611. showToast(error[0].errorMessage);
  1612. return
  1613. } else {
  1614. RES.value = error.msg;
  1615. dialogCheck.value = true;
  1616. dialogCheckWait.value = false;
  1617. dialogVisible.value = false;
  1618. flag.value = false;
  1619. }
  1620. }
  1621. }
  1622. const Initialize = () => {
  1623. loginValue.value = ""
  1624. isStep3.value = true
  1625. step2.value = false
  1626. step3.value = false
  1627. showTable()
  1628. }
  1629. const isShowStep3 = (row) => {
  1630. if (row.bankValid && isChannel.value) {
  1631. getBankList(row)
  1632. isChannel.value = false
  1633. channelData.value = row
  1634. mAmount.minAmount = row.minAmount
  1635. mAmount.maxAmount = row.maxAmount
  1636. } else {
  1637. bankDate.value = []
  1638. channelData.value = row
  1639. mAmount.minAmount = row.minAmount
  1640. mAmount.maxAmount = row.maxAmount
  1641. }
  1642. if (row.code === "UNION_PAY_TELEGRAPHIC") {
  1643. WireTransferAccount.value = JSON.parse(row.property)
  1644. }
  1645. if (["BANK", "BANK_TELEGRAPHIC", "CHANNEL_TYPE_CARD", "DIGITAL_CURRENCY"].includes(row.type)) {
  1646. getBankInfo()
  1647. step3_bank_cur.value = "bank"
  1648. form.login = loginValue.value
  1649. form.payType = row.code
  1650. bankPayType.value = row.code
  1651. }
  1652. // 重置 tableData
  1653. tableData.International_Transfer = []
  1654. tableData.China_UnionPay = []
  1655. tableData.Digital_Currency = []
  1656. tableData.CHANNEL_TYPE_CARD = []
  1657. tableData.Electronic_Wallet = []
  1658. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1659. tableData.UCARD_WALLET = []
  1660. if (row.type === "BANK_TELEGRAPHIC") tableData.International_Transfer[0] = row
  1661. if (row.type === "BANK") tableData.China_UnionPay[0] = row
  1662. if (row.type === "DIGITAL_CURRENCY") tableData.Digital_Currency[0] = row
  1663. if (row.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet[0] = row
  1664. if (row.type === "UCARD_WALLET") tableData.UCARD_WALLET[0] = row
  1665. if (row.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD[0] = row
  1666. if (row.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET[0] = row
  1667. introduce.introduce = row.introduce
  1668. introduce.enIntroduce = row.enIntroduce
  1669. loading.value = false
  1670. }
  1671. const showTable = () => {
  1672. resetForm()
  1673. myId.value = null
  1674. isChannel.value = true
  1675. getDepositList()
  1676. // 重置表单
  1677. form.currency = "USD"
  1678. // 其他重置...
  1679. }
  1680. const getDepositList = async () => {
  1681. pictLoading.value = true
  1682. tableData.International_Transfer = []
  1683. tableData.China_UnionPay = []
  1684. tableData.Digital_Currency = []
  1685. tableData.CHANNEL_TYPE_CARD = []
  1686. tableData.Electronic_Wallet = []
  1687. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1688. tableData.UCARD_WALLET = []
  1689. const res = await financialApi.RemitChannelList({})
  1690. if (res.code === Code.StatusOK) {
  1691. res.data.forEach(item => {
  1692. if (item.type === "BANK_TELEGRAPHIC") tableData.International_Transfer.push(item)
  1693. if (item.type === "BANK") tableData.China_UnionPay.push(item)
  1694. if (item.type === "DIGITAL_CURRENCY") tableData.Digital_Currency.push(item)
  1695. if (item.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet.push(item)
  1696. if (item.type === "UCARD_WALLET") tableData.UCARD_WALLET.push(item)
  1697. if (item.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD.push(item)
  1698. if (item.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET.push(item)
  1699. })
  1700. pictLoading.value = false
  1701. } else {
  1702. uni.showToast({ title: res.msg, icon: 'none' })
  1703. pictLoading.value = false
  1704. }
  1705. }
  1706. const getBankList = async (row) => {
  1707. const res = await financialApi.BankList({ channelCode: row.code })
  1708. if (res.code === Code.StatusOK) {
  1709. const bank = res.data
  1710. const data = []
  1711. bank.forEach(j => {
  1712. if (!j.minAmount && j.minAmount !== 0) j.minAmount = row.minAmount
  1713. if (!j.maxAmount && j.maxAmount !== 0) j.maxAmount = row.maxAmount
  1714. j.payType = row.code
  1715. data.push(j)
  1716. })
  1717. bankDate.value = data
  1718. } else {
  1719. uni.showToast({ title: res.msg, icon: 'none' })
  1720. }
  1721. }
  1722. const cancelBank = () => {
  1723. dialogNewBank.value = false
  1724. // 重置 params 表单
  1725. Object.assign(params, {
  1726. bankCardNum: "",
  1727. bankUname: "",
  1728. bankName: "",
  1729. bankBranchName: "",
  1730. bankAddr: "",
  1731. swiftCode: "",
  1732. bankFront: "",
  1733. bankBack: "",
  1734. defaultBank: false
  1735. })
  1736. }
  1737. // 新改内容
  1738. // userStore.paymentChannel.value
  1739. // userStore.channelList.value
  1740. const channel = computed(() => userStore.paymentChannel)
  1741. const channelList = computed(() => userStore.channelList)
  1742. const channelListOptions = ref([])
  1743. const channelId = ref(null)
  1744. const loading = ref(false)
  1745. const allTabs = computed(() => {
  1746. return {
  1747. "International_Transfer": t('Custom.Deposit.Channel1'),
  1748. "China_UnionPay": t('Custom.Deposit.Channel2'),
  1749. "Digital_Currency": t('Custom.Deposit.Channel3'),
  1750. "Electronic_Wallet": t('Custom.Deposit.Channel4'),
  1751. "CHANNEL_TYPE_CARD": t('PersonalManagement.Label.CreditCard'),
  1752. "CHANNEL_TYPE_ALI_WALLET": t('Label.Ali'),
  1753. "UCARD_WALLET": t('card.title'),
  1754. }
  1755. })
  1756. // 固定顺序(和上面 allTabs 完全一致)
  1757. const tabOrder = [
  1758. "International_Transfer",
  1759. "China_UnionPay",
  1760. "Digital_Currency",
  1761. "Electronic_Wallet",
  1762. "CHANNEL_TYPE_CARD",
  1763. "CHANNEL_TYPE_ALI_WALLET",
  1764. "UCARD_WALLET"
  1765. ]
  1766. function formatChannels(data) {
  1767. const result = []
  1768. // 按照固定顺序遍历,保证顺序不乱
  1769. for (const key of tabOrder) {
  1770. const list = data[key] || []
  1771. if (list.length) {
  1772. // 加入分类标题
  1773. result.push({
  1774. text: allTabs.value[key],
  1775. value: key,
  1776. disable: true
  1777. })
  1778. // 加入子项
  1779. list.forEach(item => {
  1780. result.push({
  1781. ...item,
  1782. text: item.name,
  1783. value: item.code
  1784. })
  1785. })
  1786. }
  1787. }
  1788. return result
  1789. }
  1790. // ---------- 生命周期 ----------
  1791. onMounted(() => {
  1792. loading.value = true
  1793. if (channelList.value) {
  1794. channelListOptions.value = formatChannels(channelList.value)
  1795. }
  1796. channelId.value = channel.value
  1797. getDateList()
  1798. // getDepositList()
  1799. getFreeNumber()
  1800. isShowDialog()
  1801. if (getInfoStatus5.value) {
  1802. InfoStatus5.value = true
  1803. return
  1804. }
  1805. })
  1806. onUnmounted(() => {
  1807. userStore.savePaymentChannel('')
  1808. userStore.saveChannelList('')
  1809. })
  1810. watch(channelId, async (newVal) => {
  1811. if (newVal) {
  1812. showTable()
  1813. let row = channelListOptions.value.find(item => item.code == newVal)
  1814. isShowStep3(row)
  1815. setTipsAmount()
  1816. }
  1817. });
  1818. // 监听 value 变化
  1819. // 监听 form.amount 变化
  1820. watch(() => form.amount, (newVal) => {
  1821. if (newVal && channelData.value.rate) {
  1822. form.amount1 = (newVal * channelData.value.rate).toFixed(2)
  1823. }
  1824. })
  1825. </script>
  1826. <style lang="scss" scoped>
  1827. @import "@/uni.scss";
  1828. .tips{
  1829. color: var(--bs-emphasis-color);
  1830. }
  1831. .custom-withdraw {
  1832. width: px2rpx(566);
  1833. flex-shrink: 0;
  1834. .box {
  1835. margin-bottom: px2rpx(20);
  1836. .b-card {
  1837. border: 1px solid var(--bs-border-color);
  1838. .card-top {
  1839. .tit {
  1840. font-size: px2rpx(16);
  1841. font-weight: 600;
  1842. margin-bottom: px2rpx(16);
  1843. display: flex;
  1844. align-items: center;
  1845. color: var(--bs-heading-color);
  1846. position: relative;
  1847. padding-left: 20px;
  1848. &:after {
  1849. content: '';
  1850. position: absolute;
  1851. left: 0;
  1852. top: 50%;
  1853. transform: translateY(-50%);
  1854. width: 0;
  1855. height: 0;
  1856. border-top: 6px solid transparent;
  1857. border-bottom: 6px solid transparent;
  1858. border-left: 8px solid currentColor;
  1859. }
  1860. .iconfont {
  1861. margin-right: px2rpx(8);
  1862. color: var(--color-primary);
  1863. font-size: px2rpx(18);
  1864. }
  1865. }
  1866. }
  1867. .channelType {
  1868. font-size: px2rpx(15);
  1869. font-weight: 600;
  1870. margin: px2rpx(24) 0 px2rpx(12);
  1871. color: var(--color-navy-700);
  1872. padding-left: px2rpx(8);
  1873. border-left: px2rpx(4) solid var(--color-primary);
  1874. }
  1875. }
  1876. }
  1877. .reselect-btn {
  1878. margin-top: px2rpx(20);
  1879. display: flex;
  1880. justify-content: flex-end;
  1881. }
  1882. .s-btn {
  1883. &.reselect {
  1884. background-color: var(--color-zinc-100);
  1885. color: var(--color-navy-700);
  1886. border: none;
  1887. font-size: px2rpx(14);
  1888. padding: px2rpx(8) px2rpx(20);
  1889. border-radius: px2rpx(8);
  1890. &:active {
  1891. background-color: var(--color-zinc-200);
  1892. }
  1893. }
  1894. &[type="primary"] {
  1895. width: 100%;
  1896. height: px2rpx(48);
  1897. background-color: #cf1322;
  1898. color: var(--bs-emphasis-color);
  1899. border-radius: px2rpx(12);
  1900. font-size: px2rpx(16);
  1901. font-weight: 600;
  1902. display: flex;
  1903. align-items: center;
  1904. justify-content: center;
  1905. border: none;
  1906. margin-top: px2rpx(30);
  1907. transition: all 0.2s;
  1908. &:active {
  1909. transform: scale(0.98);
  1910. background-color: #cf1322;
  1911. }
  1912. }
  1913. }
  1914. .add-back {
  1915. display: flex;
  1916. justify-content: space-between;
  1917. align-items: center;
  1918. margin-bottom: px2rpx(12);
  1919. padding: px2rpx(12) px2rpx(16);
  1920. text {
  1921. font-size: px2rpx(14);
  1922. color: var(--color-navy-700);
  1923. font-weight: 500;
  1924. }
  1925. .add-btn {
  1926. color: var(--color-primary);
  1927. font-weight: 600;
  1928. text-decoration: underline;
  1929. &:active {
  1930. opacity: 0.7;
  1931. }
  1932. }
  1933. }
  1934. .proof {
  1935. margin-top: px2rpx(8);
  1936. border: px2rpx(1) dashed var(--color-zinc-300);
  1937. border-radius: px2rpx(8);
  1938. padding: px2rpx(8);
  1939. display: flex;
  1940. justify-content: center;
  1941. align-items: center;
  1942. background: var(--color-zinc-50);
  1943. .state {
  1944. padding: px2rpx(4) px2rpx(12);
  1945. border-radius: px2rpx(4);
  1946. font-size: px2rpx(12);
  1947. font-weight: bold;
  1948. }
  1949. }
  1950. .step3-attention {
  1951. // background: var(--color-error-50, #fff1f0);
  1952. border-radius: px2rpx(12);
  1953. margin-bottom: px2rpx(20);
  1954. .tips {
  1955. line-height: 1.8;
  1956. font-size: px2rpx(12);
  1957. color: var(--bs-heading-color);
  1958. background-color: rgba(var(--bs-body-bg-rgb), 1) !important;
  1959. padding: px2rpx(12);
  1960. border-radius: px2rpx(4);
  1961. border-left: px2rpx(2) solid #cf1322;
  1962. .title {
  1963. font-weight: 600;
  1964. margin-bottom: px2rpx(6);
  1965. color: var(--bs-heading-color);
  1966. }
  1967. }
  1968. .attention {
  1969. font-size: px2rpx(14);
  1970. // color: var(--color-error-600, #cf1322);
  1971. line-height: 1.6;
  1972. }
  1973. .btn-bottom {
  1974. margin-top: px2rpx(20);
  1975. display: flex;
  1976. justify-content: center;
  1977. .btn {
  1978. background: var(--color-error-600, #cf1322);
  1979. color: var(--bs-emphasis-color);
  1980. padding: px2rpx(10) px2rpx(48);
  1981. border-radius: px2rpx(24);
  1982. font-size: px2rpx(15);
  1983. font-weight: 700;
  1984. box-shadow: 0 px2rpx(4) px2rpx(10) rgba(207, 19, 34, 0.2);
  1985. transition: all 0.2s;
  1986. &:active {
  1987. transform: scale(0.96);
  1988. opacity: 0.8;
  1989. }
  1990. }
  1991. }
  1992. }
  1993. // :deep(.base-info-form) {
  1994. // .uni-row1 {
  1995. // .uni-col {
  1996. // padding: 0 px2rpx(10) !important;
  1997. // }
  1998. // .uni-forms-item {
  1999. // min-height: px2rpx(36);
  2000. // margin-bottom: px2rpx(28);
  2001. // }
  2002. // .uni-easyinput__content-input {
  2003. // height: px2rpx(35) !important;
  2004. // }
  2005. // }
  2006. // }
  2007. @keyframes rotate {
  2008. from {
  2009. transform: rotate(0deg);
  2010. }
  2011. to {
  2012. transform: rotate(360deg);
  2013. }
  2014. }
  2015. }
  2016. .agree {
  2017. margin-top: px2rpx(24);
  2018. display: flex;
  2019. align-items: flex-start;
  2020. .checkbox {
  2021. display: flex;
  2022. align-items: flex-start;
  2023. gap: px2rpx(8);
  2024. :deep(uni-checkbox .uni-checkbox-input) {
  2025. border-radius: px2rpx(4);
  2026. width: px2rpx(18);
  2027. height: px2rpx(18);
  2028. }
  2029. text {
  2030. font-size: px2rpx(13);
  2031. color: var(--color-zinc-500);
  2032. line-height: 1.5;
  2033. }
  2034. }
  2035. }
  2036. @media (max-width: 992px) {
  2037. .custom-withdraw {
  2038. width: 100%;
  2039. margin-top: px2rpx(20);
  2040. }
  2041. .custom-deposit-container {
  2042. display: flex;
  2043. gap: px2rpx(30);
  2044. flex-wrap: wrap;
  2045. }
  2046. }
  2047. .amount-box {
  2048. display: flex;
  2049. align-items: center;
  2050. gap: px2rpx(12);
  2051. .amount-input {
  2052. flex: 1;
  2053. }
  2054. .btn {
  2055. margin-bottom: px2rpx(22);
  2056. }
  2057. }
  2058. .amount-box1 {
  2059. align-items: flex-start;
  2060. .btn {
  2061. margin-top: px2rpx(0);
  2062. }
  2063. }
  2064. .custom-deposit-container {
  2065. width: 100%;
  2066. display: flex;
  2067. gap: px2rpx(60);
  2068. justify-content: space-between;
  2069. }
  2070. @media (max-width: 992px) {
  2071. .custom-deposit {
  2072. width: 100%;
  2073. margin-top: px2rpx(20);
  2074. }
  2075. .custom-deposit-container {
  2076. display: flex;
  2077. gap: px2rpx(30);
  2078. flex-wrap: wrap;
  2079. }
  2080. }
  2081. .check-text{
  2082. display: inline-block;
  2083. margin-left: 10px;
  2084. color: #333;
  2085. line-height: 2;
  2086. font-size: px2rpx(13);
  2087. }
  2088. </style>