withdraw.vue 93 KB

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