withdraw.vue 95 KB

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