withdraw.vue 95 KB

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