withdraw.vue 93 KB

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