withdraw.vue 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Home.page_ib.item5')" />
  4. <view class="custom-withdraw">
  5. <!-- 步骤2:支付通道列表 -->
  6. <view class="box box-step2">
  7. <view class="b-card">
  8. <view class="card-top">
  9. <text class="tit">{{ t('Custom.Deposit.Title22')
  10. }}</text>
  11. <view v-for="(group, groupKey) in tableData" :key="groupKey">
  12. <!-- 通道分组标题 -->
  13. <view class="channelType" v-if="group.length" v-t="groupTitleMap[groupKey]" />
  14. <PaymentMethodsList :list="group" @select="isShowStep3" />
  15. </view>
  16. <view v-if="step3" class="reselect-btn">
  17. <button class="s-btn reselect" type="primary" @click="showTable">{{
  18. t('Custom.Deposit.Reselect')
  19. }}</button>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 步骤3:填写出金信息 -->
  25. <view class="box box-step3" v-if="step3">
  26. <view class="b-card">
  27. <view class="card-top">
  28. <!-- 注意事项 -->
  29. <view v-if="!isStep3" class="step3-attention">
  30. <view class="tips" v-if="(introduce.introduce || introduce.enIntroduce)">
  31. <view>
  32. <rich-text class="attention"
  33. :nodes="isZh ? introduce.introduce : introduce.enIntroduce" />
  34. </view>
  35. </view>
  36. <view class="btn-bottom">
  37. <text class="btn crm-cursor" @click="isStep3 = true">{{ t('Btn.Confirm') }}</text>
  38. </view>
  39. </view>
  40. <!-- 表单 -->
  41. <uni-forms ref="formRef" :model="form" :rules="rules" label-width="200" label-position="top"
  42. v-if="isStep3" class="form base-info-form" validate-trigger="submit">
  43. <uni-row class="demo-uni-row uni-row1">
  44. <!-- 银行选择区域(当有银行列表时) -->
  45. <uni-col :span="24" v-if="bankDate.length && isStep3">
  46. <view class="tit">
  47. <text>{{ t('Custom.Withdraw.Title5') }}</text>
  48. </view>
  49. </uni-col>
  50. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="bankDate.length && isStep3">
  51. <uni-forms-item name="bankCode">
  52. <cwg-combox filterable v-model:value="form.bankCode" :options="bankOptions"
  53. :placeholder="t('placeholder.choose')" />
  54. </uni-forms-item>
  55. </uni-col>
  56. <!-- 电子钱包标题 -->
  57. <uni-col :span="24"
  58. v-if="['CHANNEL_TYPE_WALLET', 'CHANNEL_TYPE_ALI_WALLET'].includes(channelData.type)">
  59. <view class="tit">
  60. <text>{{ getWalletLabel }}</text>
  61. </view>
  62. </uni-col>
  63. <!-- 电子钱包地址输入 -->
  64. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  65. v-if="(channelData.type == 'CHANNEL_TYPE_WALLET' || channelData.type == 'CHANNEL_TYPE_ALI_WALLET') && isStep3">
  66. <uni-forms-item name="address">
  67. <uni-easyinput v-model="form.address" :placeholder="t('placeholder.input')"
  68. autocomplete="off" />
  69. </uni-forms-item>
  70. </uni-col>
  71. <!-- 数字货币区域 -->
  72. <uni-col :span="24" class="card-tit"
  73. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  74. <div
  75. style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;">
  76. <view class="tit">
  77. <text>{{ t('Custom.Withdraw.Title6') }}</text>
  78. </view>
  79. <div class="add-back">
  80. <text>{{ t('blockchain.item10') }}</text>
  81. <text class="add-btn crm-cursor"
  82. @click="openAddBankCard('add_bankBlockchain')">
  83. {{ t('Custom.Withdraw.addBank1') }}
  84. </text>
  85. </div>
  86. </div>
  87. </uni-col>
  88. <uni-col :span="24" v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  89. <uni-forms-item>
  90. <cwg-combox filterable v-model:value="myId" :options="digitalOptions"
  91. :placeholder="t('placeholder.choose')" @change="onDigitalCurrencyChange"
  92. :disabled="!ruleForm.bankBlockchain.length" />
  93. </uni-forms-item>
  94. </uni-col>
  95. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  96. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  97. <uni-forms-item :label="t('blockchain.item3')">
  98. <uni-easyinput disabled v-model="form.addressName" />
  99. </uni-forms-item>
  100. </uni-col>
  101. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  102. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  103. <uni-forms-item :label="t('blockchain.item4')">
  104. <uni-easyinput disabled v-model="form.address" />
  105. </uni-forms-item>
  106. </uni-col>
  107. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  108. v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3 && form.addressProve">
  109. <uni-forms-item :label="t('blockchain.item5')">
  110. <div style="height: 100%; width: 100%" v-if="form.addressProve">
  111. <a v-if="form.addressProve && (form.addressProve.slice(-3).toLowerCase() === 'pdf')"
  112. :href="imgUrl + form.addressProve" target="_blank"
  113. style="text-decoration: none; min-width: auto; width: auto; color: #ffffff; padding: 5px 10px;"
  114. class="state crm_state_blue">
  115. PDF
  116. </a>
  117. <image v-else style="width: 50px; height: 50px"
  118. :src="imgUrl + form.addressProve" mode="aspectFill"
  119. @click="previewImage(imgUrl + form.addressProve)" />
  120. </div>
  121. </uni-forms-item>
  122. </uni-col>
  123. <uni-col :span="24" v-if="channelData.type == 'DIGITAL_CURRENCY' && isStep3">
  124. <view class="tit" style="margin: 0 0 20px">
  125. <i class="iconfont iconi"></i>
  126. <text>{{ t('Custom.Deposit.Des') }}</text>
  127. </view>
  128. </uni-col>
  129. <!-- 银行卡/电汇/信用卡区域 -->
  130. <uni-col :span="24" class="card-tit"
  131. v-if="isStep3 && (channelData.type == 'BANK_TELEGRAPHIC' || channelData.type == 'BANK' || channelData.type == 'CHANNEL_TYPE_CARD')">
  132. <div
  133. style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;">
  134. <view class="tit">
  135. <text>{{ t('Custom.Withdraw.Title4') }}</text>
  136. </view>
  137. <div class="add-back">
  138. <text v-if="channelData.type == 'BANK_TELEGRAPHIC'">{{
  139. t('Custom.Withdraw.addWire') }}</text>
  140. <text v-if="channelData.type == 'BANK_TELEGRAPHIC'"
  141. class="add-btn crm-cursor" @click="openAddBankCard('add_wireTransfer')">
  142. {{ t('Custom.Withdraw.addBank1') }}
  143. </text>
  144. <text v-if="channelData.type == 'BANK'">{{
  145. t('Custom.Withdraw.addBank')
  146. }}</text>
  147. <text v-if="channelData.type == 'BANK'" class="add-btn crm-cursor"
  148. @click="openAddBankCard('add_bankCard')">
  149. {{ t('Custom.Withdraw.addBank1') }}
  150. </text>
  151. <text v-if="channelData.type == 'CHANNEL_TYPE_CARD'">{{
  152. t('PersonalManagement.Label.addCreditCard') }}</text>
  153. <text v-if="channelData.type == 'CHANNEL_TYPE_CARD'"
  154. class="add-btn crm-cursor" @click="openAddBankCard('add_CreditCard')">
  155. {{ t('Custom.Withdraw.addBank1') }}
  156. </text>
  157. </div>
  158. </div>
  159. </uni-col>
  160. <!-- 网银支付信息(BANK) -->
  161. <uni-col :span="24" v-if="channelData.type == 'BANK' && isStep3">
  162. <uni-forms-item>
  163. <cwg-combox v-model:value="myId" :options="bankCardOptions"
  164. :placeholder="t('placeholder.choose')" @change="chooseBank" />
  165. </uni-forms-item>
  166. </uni-col>
  167. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  168. v-if="channelData.type == 'BANK' && isStep3">
  169. <uni-forms-item :label="t('Custom.Withdraw.UserName')">
  170. <uni-easyinput disabled v-model="form.bankUname" />
  171. </uni-forms-item>
  172. </uni-col>
  173. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  174. v-if="channelData.type == 'BANK' && isStep3">
  175. <uni-forms-item :label="t('Custom.Withdraw.BankCardNum')">
  176. <uni-easyinput disabled v-model="form.bankCardNum" />
  177. </uni-forms-item>
  178. </uni-col>
  179. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  180. v-if="channelData.type == 'BANK' && isStep3">
  181. <uni-forms-item :label="t('Custom.Withdraw.BankName')">
  182. <uni-easyinput disabled v-model="form.bankName" />
  183. </uni-forms-item>
  184. </uni-col>
  185. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  186. v-if="channelData.type == 'BANK' && isStep3">
  187. <uni-forms-item :label="t('Custom.Withdraw.bankBranchName')">
  188. <uni-easyinput disabled v-model="form.bankBranchName" />
  189. </uni-forms-item>
  190. </uni-col>
  191. <!-- 信用卡信息 -->
  192. <uni-col :span="24" v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  193. <uni-forms-item>
  194. <cwg-combox v-model:value="myId" :options="bankCardOptions"
  195. :placeholder="t('placeholder.choose')" @change="chooseBank" />
  196. </uni-forms-item>
  197. </uni-col>
  198. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  199. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  200. <uni-forms-item :label="t('PersonalManagement.Label.CreditCardAccountName')">
  201. <uni-easyinput disabled v-model="form.bankUname" />
  202. </uni-forms-item>
  203. </uni-col>
  204. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  205. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  206. <uni-forms-item :label="t('PersonalManagement.Label.CreditCardAccount')">
  207. <uni-easyinput disabled v-model="form.bankCardNum" />
  208. </uni-forms-item>
  209. </uni-col>
  210. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  211. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  212. <uni-forms-item label="CVV">
  213. <uni-easyinput disabled v-model="form.cvv" />
  214. </uni-forms-item>
  215. </uni-col>
  216. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  217. v-if="channelData.type == 'CHANNEL_TYPE_CARD' && isStep3">
  218. <uni-forms-item :label="t('PersonalManagement.Label.ExpirationYear')">
  219. <uni-easyinput disabled v-model="form.expiryYearMonth" />
  220. </uni-forms-item>
  221. </uni-col>
  222. <!-- 电汇信息 -->
  223. <uni-col :span="24" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  224. <uni-forms-item>
  225. <cwg-combox v-model:value="myId" :options="bankCardOptions"
  226. :placeholder="t('placeholder.choose')" @change="chooseBank" />
  227. </uni-forms-item>
  228. </uni-col>
  229. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  230. <uni-forms-item :label="t('Custom.Withdraw.UserName')">
  231. <uni-easyinput disabled v-model="form.bankUname" />
  232. </uni-forms-item>
  233. </uni-col>
  234. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  235. <uni-forms-item :label="t('Custom.Withdraw.BankCardNum')">
  236. <uni-easyinput disabled v-model="form.bankCardNum" />
  237. </uni-forms-item>
  238. </uni-col>
  239. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  240. <uni-forms-item :label="t('Custom.Withdraw.BankName')">
  241. <uni-easyinput disabled v-model="form.bankName" />
  242. </uni-forms-item>
  243. </uni-col>
  244. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  245. <uni-forms-item :label="t('Custom.Withdraw.swiftCode')">
  246. <uni-easyinput disabled v-model="form.swiftCode" />
  247. </uni-forms-item>
  248. </uni-col>
  249. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  250. <uni-forms-item :label="t('Custom.Withdraw.bankCode')">
  251. <uni-easyinput disabled v-model="form.customBankCode" />
  252. </uni-forms-item>
  253. </uni-col>
  254. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  255. <uni-forms-item :label="t('Custom.Withdraw.bankAddr')">
  256. <uni-easyinput disabled v-model="form.bankAddr" />
  257. </uni-forms-item>
  258. </uni-col>
  259. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  260. <!-- Account Agency NO -->
  261. <uni-forms-item :label="'Account Agency NO'" name="agencyNo">
  262. <uni-easyinput v-model="form.agencyNo" />
  263. </uni-forms-item>
  264. </uni-col>
  265. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"
  266. v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3 && channelData.code == 'PAY_RETAILER_REMIT_PAY_KEY_BRW'">
  267. <uni-forms-item label="CPF" name="cpf">
  268. <uni-easyinput v-model="form.cpf" />
  269. </uni-forms-item>
  270. </uni-col>
  271. <!-- 电汇金额区域 -->
  272. <uni-col :span="24" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  273. <view class="tit">
  274. <text>{{ t('Custom.Withdraw.Title3') }}</text>
  275. </view>
  276. </uni-col>
  277. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  278. <uni-forms-item :label="t('Custom.Withdraw.CurrencyType')" name="currency">
  279. <cwg-combox filterable v-model:value="form.currency"
  280. :options="[{ text: 'USD', value: 'USD' }]" />
  281. </uni-forms-item>
  282. </uni-col>
  283. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type == 'BANK_TELEGRAPHIC' && isStep3">
  284. <uni-forms-item :label="t('Custom.Withdraw.amount')" name="amount"
  285. :error-message="amountErrorMessage">
  286. <uni-easyinput v-model.trim="form.amount" type="number"
  287. @blur="validateAmount" />
  288. </uni-forms-item>
  289. </uni-col>
  290. <!-- 非电汇的金额区域 -->
  291. <uni-col :span="24" v-if="channelData.type != 'BANK_TELEGRAPHIC' && isStep3">
  292. <view class="tit">
  293. <text>{{ t('Custom.Withdraw.Title3') + '(' + channelData.currency + ')'
  294. }}</text>
  295. </view>
  296. </uni-col>
  297. <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" v-if="channelData.type != 'BANK_TELEGRAPHIC' && isStep3">
  298. <uni-forms-item name="amount" :error-message="amountErrorMessage">
  299. <uni-easyinput v-model.trim="form.amount" autocomplete="off" type="number"
  300. @blur="validateAmount" />
  301. </uni-forms-item>
  302. </uni-col>
  303. </uni-row>
  304. <view class="agree">
  305. <uni-forms-item name="agree2">
  306. <checkbox-group :value="form.agree2 ? ['1'] : []" @change="onAgree2Change">
  307. <label class="checkbox">
  308. <checkbox value="1" :checked="form.agree2" />
  309. <view class="crm-cursor"
  310. style="text-decoration: underline; display: inline-block; margin-left: 10px;"
  311. @click.stop="dialogCheckTip = true">
  312. {{ t('Custom.Withdraw.Des') }}
  313. </view>
  314. </label>
  315. </checkbox-group>
  316. </uni-forms-item>
  317. </view>
  318. <view class="agree" v-if="dialogTipsIsShow">
  319. <uni-forms-item name="agree3">
  320. <checkbox-group :value="form.agree3 ? ['1'] : []" @change="onAgree3Change">
  321. <label class="checkbox">
  322. <checkbox value="1" :checked="form.agree3" />
  323. <view class="crm-cursor" style="display: inline-block; margin-left: 10px;">
  324. * {{ t('Custom.Withdraw.item1') }}<br />
  325. {{ t('Custom.Withdraw.item1_1') }}<br />
  326. {{ t('Custom.Withdraw.item1_2') }}
  327. </view>
  328. </label>
  329. </checkbox-group>
  330. </uni-forms-item>
  331. </view>
  332. <button class="s-btn" type="primary" @click="openTips">{{ t('Btn.Submit') }}</button>
  333. </uni-forms>
  334. </view>
  335. </view>
  336. </view>
  337. <!-- 提示弹窗 -->
  338. <cwg-tips-popup v-model:visible="dialogTips" content="Custom.Withdraw.item2" @confirm="closeTipsConfirm" />
  339. <cwg-tips-popup v-model:visible="dialogCheckInto" content="ApplicationDialog.Des42_1"
  340. title="ApplicationDialog.Des41_1" @confirm="closeTipsConfirm" />
  341. <cwg-tips-popup v-model:visible="dialogCheckInto1" content="ApplicationDialog.Des42"
  342. title="ApplicationDialog.Des41" @confirm="closeTipsConfirm" />
  343. <!-- 弹窗:确认信息 -->
  344. <cwg-check-confirm-popup v-model:visible="dialogCheckConfirm" :title="t('Home.page_customer.item3')"
  345. :channelData="channelData" :code="code" :selectCodes="selectCodes" :params="form"
  346. :FreeNumber="FreeNumber" :userName="userName" :dialogCheckConfirm_form="dialogCheckConfirm_form"
  347. :login="loginValue" type="IB" @confirm="submit" />
  348. <!-- 协议弹窗 -->
  349. <cwg-tips-popup v-model:visible="dialogCheckTip"
  350. :introduce="isZh ? introduce.introduce : introduce.enIntroduce" />
  351. <!-- 等待弹窗 -->
  352. <cwg-wait-popup v-model:visible="dialogCheckWait" type="center" :mask-click="false" :showFooters="false" />
  353. <!-- 最后失败弹窗 -->
  354. <cwg-error-popup v-model:visible="dialogError" @confirm="closeDia" :responseMessage="RES" />
  355. <!-- 最后成功弹窗 -->
  356. <cwg-success-popup v-model:visible="dialogSuccess" @confirm="closeDia" />
  357. <!-- 功能关闭弹出 -->
  358. <cwg-function-disabled-popup v-model:visible="InfoStatus5" :showFooters="false" @confirm="toHome" />
  359. <!-- kyc成功弹窗 -->
  360. <cwg-kyc-popup v-model:visible="dialogKyc" :qrText="text1" />
  361. <!--验证码-->
  362. <!-- 新增银行弹窗 -->
  363. <add-bank-dialog ref="addBankDialogRef" @success="addSuccess" />
  364. </view>
  365. </cwg-page-wrapper>
  366. </template>
  367. <script setup>
  368. import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue'
  369. import { onLoad } from '@dcloudio/uni-app'
  370. import { showToast } from "@/utils/toast";
  371. import useUserStore from '@/stores/use-user-store'
  372. import { customApi } from "@/service/custom"
  373. import { financialApi } from "@/service/financial"
  374. import Config from "@/config/index"
  375. import AddBankDialog from '@/components/AddBankDialog.vue';
  376. import CwgCheckConfirmPopup from '../customer/components/WithdrawCheckConfirmPopup.vue'
  377. import CwgKycPopup from '../customer/components/KycPopup.vue'
  378. import PaymentMethodsList from '../customer/components/PaymentMethodsList.vue'
  379. import { useI18n } from 'vue-i18n'
  380. const { t, locale } = useI18n()
  381. const { Code, Host80 } = Config
  382. const isZh = computed(() => ['cn', 'zhHant'].includes(locale.value))
  383. // ---------- 辅助函数:替代原 this.Session ----------
  384. // 弹窗辅助(替代原 this.$pigeon)
  385. const $pigeon = {
  386. MessageError(msg) {
  387. uni.showToast({ title: msg, icon: 'none' })
  388. },
  389. MessageWarning(msg) {
  390. uni.showToast({ title: msg, icon: 'none' })
  391. },
  392. MessageConfirm(content, title, confirmText, cancelText, confirmCallback, cancelCallback) {
  393. uni.showModal({
  394. title,
  395. content,
  396. confirmText,
  397. cancelText,
  398. success(res) {
  399. if (res.confirm) confirmCallback && confirmCallback()
  400. else cancelCallback && cancelCallback()
  401. }
  402. })
  403. }
  404. }
  405. // 获取 metaInfo(用于二维码)
  406. const getMetaInfo = () => {
  407. const systemInfo = uni.getSystemInfoSync()
  408. return {
  409. userAgent: systemInfo.platform,
  410. screenWidth: systemInfo.screenWidth,
  411. screenHeight: systemInfo.screenHeight,
  412. deviceType: 'h5'
  413. }
  414. }
  415. // ---------- 响应式数据(完全保留原 data 结构) ----------
  416. const dialogFreeNumber = ref(false)
  417. const FreeNumber = ref(0)
  418. const InfoStatus5 = ref(false)
  419. const metaInfo = ref(null)
  420. const text1 = ref("")
  421. const flag = ref(false)
  422. const RES = ref("")
  423. const openType = ref("")
  424. const dialogInfoTradingAdd = ref(false)
  425. const ruleForm = reactive({
  426. bankInfo: [],
  427. bankWrit: [],
  428. xykInfo: [],
  429. bankBlockchain: []
  430. })
  431. const imgUrl = Host80
  432. const loginOptions = ref([])
  433. const loginValue = ref("")
  434. const code = ref("")
  435. const bankValid = ref("")
  436. const requestUrl = ref("")
  437. const isStep3 = ref(false)
  438. const step2 = ref(false)
  439. const step3 = ref(false)
  440. const dialogCheckTip = ref(false)
  441. const isChannel = ref(true)
  442. const pictLoading = ref(false)
  443. const tableData = reactive({
  444. International_Transfer: [],
  445. China_UnionPay: [],
  446. Digital_Currency: [],
  447. CHANNEL_TYPE_CARD: [],
  448. Electronic_Wallet: [],
  449. CHANNEL_TYPE_ALI_WALLET: [],
  450. UCARD_WALLET: []
  451. })
  452. const bankDate = ref([])
  453. const channelData = ref({})
  454. const WireTransferAccount = ref({})
  455. const formRef = ref(null)
  456. const form = reactive({
  457. currency: "USD",
  458. amount: "",
  459. bankCode: '', // 银行代码(普通银行通道选择)
  460. address: '', // 电子钱包地址 / 数字货币地址(输入/展示)
  461. addressName: '', // 数字货币地址名称(展示)
  462. addressProve: '', // 数字货币地址证明文件路径(仅展示))
  463. bankUname: '', // 持卡人姓名
  464. bankCardNum: '', // 银行卡号
  465. bankName: '', // 银行名称
  466. bankBranchName: '', // 支行名称
  467. swiftCode: '', // SWIFT代码
  468. customBankCode: '', // 自定义银行代码
  469. bankAddr: '', // 银行地址
  470. agencyNo: '', // 代理机构编号(电汇专用,可编辑)
  471. cpf: '', // CPF号码(电汇专用,可编辑)
  472. cvv: '', // CVV码(电汇专用,可编辑)
  473. expiryYearMonth: '', // 过期年(电汇专用,可编辑)
  474. agree2: false,
  475. agree3: false,
  476. })
  477. const mAmount = reactive({
  478. minAmount: "",
  479. maxAmount: ""
  480. })
  481. const introduce = reactive({
  482. introduce: "",
  483. enIntroduce: ""
  484. })
  485. const bankInfoList = ref([])
  486. const bank = ref("")
  487. const myId = ref("")
  488. const bankPayType = ref("")
  489. const step3_bank_cur = ref("")
  490. const agree2 = ref(false)
  491. const form1 = ref({})
  492. const dialogCheck = ref(false)
  493. const dialogKyc = ref(false)
  494. const dialogVisible = ref(false)
  495. const dialogCheckWait = ref(false)
  496. const dialogCheckInto = ref(false)
  497. const dialogCheckInto1 = ref(false)
  498. const dialogNewBank = ref(false)
  499. const params = reactive({
  500. bankCardNum: "",
  501. bankUname: "",
  502. bankName: "",
  503. bankBranchName: "",
  504. bankAddr: "",
  505. swiftCode: "",
  506. bankFront: "",
  507. bankBack: "",
  508. defaultBank: false
  509. })
  510. const resetForm = async () => {
  511. await nextTick();
  512. formRef.value?.clearValidate(); // 再次清除可能因数据重置产生的新错误
  513. params.bankCardNum = ""
  514. params.bankUname = ""
  515. params.bankName = ""
  516. params.bankBranchName = ""
  517. params.bankAddr = ""
  518. params.swiftCode = ""
  519. params.bankFront = ""
  520. params.bankBack = ""
  521. params.defaultBank = false
  522. form.amount = ""
  523. form.amount1 = ""
  524. form.bankCode = ""
  525. form.address = ""
  526. form.addressName = ""
  527. form.addressProve = ""
  528. form.bankUname = ""
  529. form.bankCardNum = ""
  530. form.swiftCode = ""
  531. form.customBankCode = ""
  532. form.bankAddr = ""
  533. form.agencyNo = ""
  534. form.bankName = ""
  535. form.cpf = ""
  536. form.bankBranchName = ""
  537. form.cpf = ""
  538. form.cvv = ""
  539. form.expiryYearMonth = ""
  540. form.agree2 = false
  541. form.agree3 = false
  542. amountErrorMessage.value = ""
  543. flag.value = false
  544. loginValue.value = ""
  545. dialogCheck.value = false
  546. dialogVisible.value = false
  547. }
  548. const dialogTips = ref(false)
  549. const dialogTipsIsShow = ref(true)
  550. const dialogCheckConfirm = ref(false)
  551. const dialogCheckConfirm_form = reactive({
  552. amount: "",
  553. feeAmount: ""
  554. })
  555. // 验证规则(保留原结构,实际验证需配合表单组件)
  556. const rules = computed(() => ({
  557. bankCardNum: {
  558. rules: [
  559. {
  560. required: true,
  561. errorMessage: t('vaildate.input.empty'),
  562. trigger: 'blur',
  563. },
  564. ],
  565. },
  566. bankUname: {
  567. rules: [
  568. {
  569. required: true,
  570. errorMessage: t('vaildate.input.empty'),
  571. trigger: 'blur',
  572. },
  573. ],
  574. },
  575. bankName: {
  576. rules: [
  577. {
  578. required: true,
  579. errorMessage: t('vaildate.input.empty'),
  580. trigger: 'blur',
  581. },
  582. ],
  583. },
  584. bankBranchName: {
  585. rules: [
  586. {
  587. required: true,
  588. errorMessage: t('vaildate.input.empty'),
  589. trigger: 'blur',
  590. },
  591. ],
  592. },
  593. bankAddr: {
  594. rules: [
  595. {
  596. required: true,
  597. errorMessage: t('vaildate.input.empty'),
  598. trigger: 'blur',
  599. },
  600. ],
  601. },
  602. swiftCode: {
  603. rules: [
  604. {
  605. required: true,
  606. errorMessage: t('vaildate.input.empty'),
  607. trigger: 'blur',
  608. },
  609. ],
  610. },
  611. defaultBank: {
  612. rules: [
  613. {
  614. required: true,
  615. errorMessage: t('vaildate.select.empty'),
  616. trigger: 'change',
  617. },
  618. ],
  619. },
  620. bankCode: {
  621. rules: [
  622. {
  623. required: true,
  624. errorMessage: t('vaildate.select.empty'),
  625. trigger: 'change',
  626. },
  627. ],
  628. },
  629. message: {
  630. rules: [
  631. {
  632. required: true,
  633. errorMessage: t('vaildate.input.empty'),
  634. trigger: 'blur',
  635. },
  636. ],
  637. },
  638. address: {
  639. rules: [
  640. {
  641. required: true,
  642. errorMessage: t('vaildate.input.empty'),
  643. trigger: 'blur',
  644. },
  645. ],
  646. },
  647. amount: {
  648. rules: [
  649. {
  650. required: true,
  651. errorMessage: t('vaildate.amount.format'),
  652. },
  653. {
  654. validateFunction: (rule, value, data, callback) => {
  655. if (value && (Number(mAmount.minAmount) > Number(value) || Number(mAmount.maxAmount) < Number(value))) {
  656. callback(t('vaildate.amount.amount') + mAmount.minAmount + ' - ' + mAmount.maxAmount);
  657. return false;
  658. }
  659. if (/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
  660. return true;
  661. } else {
  662. callback(t('vaildate.amount.format'));
  663. return false;
  664. }
  665. },
  666. trigger: 'blur',
  667. },
  668. ],
  669. },
  670. agree2: {
  671. rules: [
  672. {
  673. validateFunction: (rule, value, data, callback) => {
  674. if (form.agree2) {
  675. return true;
  676. } else {
  677. callback(t('vaildate.agree.empty'));
  678. return false;
  679. }
  680. },
  681. trigger: 'change',
  682. },
  683. ],
  684. },
  685. agree3: {
  686. rules: [
  687. {
  688. validateFunction: (rule, value, data, callback) => {
  689. if (form.agree3) {
  690. return true;
  691. } else {
  692. callback(t('vaildate.agree.empty'));
  693. return false;
  694. }
  695. },
  696. trigger: 'change',
  697. },
  698. ],
  699. },
  700. agencyNo: {
  701. rules: [
  702. {
  703. required: true,
  704. errorMessage: t('vaildate.input.empty'),
  705. trigger: 'blur',
  706. },
  707. ],
  708. },
  709. cpf: {
  710. rules: [
  711. {
  712. required: true,
  713. errorMessage: t('vaildate.input.empty'),
  714. trigger: 'blur',
  715. },
  716. ],
  717. },
  718. }));
  719. const amountErrorMessage = ref('')
  720. const validateAmount = () => {
  721. const amount = form.amount
  722. if (!amount && amount !== 0) {
  723. amountErrorMessage.value = t('vaildate.amount.format')
  724. return false
  725. }
  726. if (mAmount.minAmount && mAmount.maxAmount) {
  727. const min = Number(mAmount.minAmount);
  728. const max = Number(mAmount.maxAmount);
  729. const numValue = Number(amount);
  730. if (numValue < min || numValue > max) {
  731. amountErrorMessage.value = t('vaildate.amount.amount') + min + '-' + max
  732. return false
  733. }
  734. }
  735. if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(amount)) {
  736. amountErrorMessage.value = t('vaildate.amount.format')
  737. return false
  738. }
  739. amountErrorMessage.value = ''
  740. return true
  741. }
  742. // ---------- 计算属性 ----------
  743. const loginComboxOptions = computed(() => {
  744. return loginOptions.value.map((item, index) => ({
  745. text: item.label,
  746. value: item.login
  747. }))
  748. })
  749. const digitalOptions = computed(() => {
  750. return ruleForm.bankBlockchain.map((item, index) => ({
  751. text: `${item.addressName}-${item.address}`,
  752. value: item.id
  753. }))
  754. })
  755. const groupTitleMap = {
  756. 'Ucard_Wallet': 'card.title',
  757. 'Digital_Currency': 'Custom.Deposit.Channel3',
  758. 'China_UnionPay': 'Custom.Deposit.Channel2',
  759. 'Electronic_Wallet': 'Custom.Deposit.Channel4',
  760. 'International_Transfer': 'Custom.Deposit.Channel1',
  761. 'CHANNEL_TYPE_CARD': 'PersonalManagement.Label.CreditCard',
  762. 'CHANNEL_TYPE_ALI_WALLET': 'Label.Ali'
  763. }
  764. const getWalletLabel = computed(() => {
  765. if (channelData.value.type === 'CHANNEL_TYPE_WALLET') return t('Custom.Withdraw.Title7')
  766. if (channelData.value.type === 'CHANNEL_TYPE_ALI_WALLET') return t('Label.AliAccout')
  767. return ''
  768. })
  769. const bankCardOptions = computed(() => {
  770. return bankList.value.map((item, index) => ({
  771. text: getBankLabel(item),
  772. value: item.id
  773. }))
  774. })
  775. const getBankLabel = (item) => {
  776. if (channelData.value.type === 'BANK' || channelData.value.type === 'BANK_TELEGRAPHIC') {
  777. return `${item.bankName}-${item.bankCardNum}`
  778. } else if (channelData.value.type === 'CHANNEL_TYPE_CARD') {
  779. return item.bankCardNum
  780. }
  781. return ''
  782. }
  783. const bankList = computed(() => {
  784. if (channelData.value.type === 'BANK') return ruleForm.bankInfo
  785. if (channelData.value.type === 'BANK_TELEGRAPHIC') return ruleForm.bankWrit
  786. if (channelData.value.type === 'CHANNEL_TYPE_CARD') return ruleForm.xykInfo
  787. return []
  788. })
  789. const bankOptions = computed(() => {
  790. return bankDate.value.map((item, index) => ({
  791. text: (locale.value === 'cn' || locale.value === 'zhHant') ? item.name : item.enName,
  792. value: item.code
  793. }))
  794. })
  795. // 最后确认
  796. const dialogSuccess = computed(() => dialogCheck.value && dialogVisible.value)
  797. // 最后失败
  798. const dialogError = computed(() => dialogCheck.value && !dialogVisible.value)
  799. const userStore = useUserStore()
  800. const ibInfo = computed(() => {
  801. return userStore?.userInfo?.ibInfo || {}
  802. })
  803. const getInfoStatus5 = computed(() => {
  804. if (ibInfo.value.closeFunctions && ibInfo.value.closeFunctions.length > 0) {
  805. return ibInfo.value.closeFunctions.indexOf("8") !== -1
  806. }
  807. return false
  808. })
  809. const isFree = computed(() => {
  810. let flagVal = false
  811. const startTime1 = "2024/11/01 00:00:00"
  812. const timezone = 2 // 目标时区偏移小时数
  813. const now = new Date()
  814. const utc = now.getTime() + now.getTimezoneOffset() * 60000
  815. const targetTime = new Date(utc + timezone * 3600000).getTime()
  816. const start = new Date(startTime1).getTime()
  817. if (targetTime > start) flagVal = true
  818. return flagVal
  819. })
  820. // ---------- 方法 ----------
  821. const getFreeNumber = async () => {
  822. if (!isFree.value) return
  823. if (getInfoStatus5.value === false) {
  824. dialogFreeNumber.value = true
  825. }
  826. const res = await financialApi.remainingReductionNumber({})
  827. if (res.code === Code.StatusOK) {
  828. FreeNumber.value = res.data || 0
  829. } else {
  830. $pigeon.MessageError(res.msg)
  831. }
  832. }
  833. const toHome = () => {
  834. uni.reLaunch({ url: "/pages/ib/index" })
  835. InfoStatus5.value = false
  836. }
  837. const isShowDialog = () => {
  838. const startTime1 = "2025/2/15 00:00:00"
  839. const timezone = 8
  840. const now = new Date()
  841. const utc = now.getTime() + now.getTimezoneOffset() * 60000
  842. const targetTime = new Date(utc + timezone * 3600000).getTime()
  843. const start = new Date(startTime1).getTime()
  844. if (targetTime > start) {
  845. dialogCheckInto.value = false
  846. // dialogCheckInto1.value = true
  847. } else {
  848. dialogCheckInto.value = true
  849. dialogCheckInto1.value = false
  850. }
  851. }
  852. const onAgree3Change = (e) => {
  853. form.agree3 = e.detail.value.length > 0
  854. }
  855. const onAgree2Change = (e) => {
  856. form.agree2 = e.detail.value.length > 0
  857. }
  858. const selectChange = () => {
  859. // 强制更新视图
  860. }
  861. // const openAddBankCard = (type) => {
  862. // if (type === "add_bankCard") {
  863. // if (ruleForm.bankInfo.length === 2) {
  864. // $pigeon.MessageConfirm(
  865. // t("Msg.UnionPayCARDS"),
  866. // t("Msg.SystemPrompt"),
  867. // t("Btn.Confirm"),
  868. // t("Btn.Cancel"),
  869. // async () => { },
  870. // () => { }
  871. // )
  872. // } else {
  873. // openType.value = "add_bankCard"
  874. // dialogInfoTradingAdd.value = true
  875. // }
  876. // } else if (type === "add_wireTransfer") {
  877. // if (ruleForm.bankWrit.length === 2) {
  878. // $pigeon.MessageConfirm(
  879. // t("Msg.WireTransfers"),
  880. // t("Msg.SystemPrompt"),
  881. // t("Btn.Confirm"),
  882. // t("Btn.Cancel"),
  883. // async () => { },
  884. // () => { }
  885. // )
  886. // } else {
  887. // openType.value = "add_wireTransfer"
  888. // dialogInfoTradingAdd.value = true
  889. // }
  890. // } else if (type === "add_CreditCard") {
  891. // openType.value = "add_CreditCard"
  892. // dialogInfoTradingAdd.value = true
  893. // } else if (type === "add_bankBlockchain") {
  894. // if (ruleForm.bankBlockchain.length === 2) {
  895. // $pigeon.MessageConfirm(
  896. // t("blockchain.item9"),
  897. // t("Msg.SystemPrompt"),
  898. // t("Btn.Confirm"),
  899. // t("Btn.Cancel"),
  900. // async () => { },
  901. // () => { }
  902. // )
  903. // } else {
  904. // openType.value = "add_bankBlockchain"
  905. // dialogInfoTradingAdd.value = true
  906. // }
  907. // }
  908. // }
  909. // 新增银行信息
  910. const addBankDialogRef = ref(null);
  911. function openAddBankCard(type) {
  912. console.log(type, 121212)
  913. switch (type) {
  914. case 'add_bankBlockchain':
  915. openAddCrypto()
  916. break;
  917. case 'add_bankCard':
  918. openAddUnionpay()
  919. break;
  920. case 'add_wireTransfer':
  921. openAddBank()
  922. break;
  923. case 'add_CreditCard':
  924. openAddCredit()
  925. break;
  926. }
  927. }
  928. function openAddCrypto() {
  929. const wallets = bankCardOptions.value || []
  930. console.log(wallets, 12121212);
  931. // 1️⃣ 没有钱包
  932. if (wallets.length === 0) {
  933. addBankDialogRef.value?.open(4);
  934. return;
  935. }
  936. // 2️⃣ 是否存在未认证钱包
  937. const hasUnAuth = wallets.some(
  938. item => item.authStatus === 0 || item.approveStatus === 1
  939. );
  940. if (hasUnAuth) {
  941. uni.showToast({
  942. title: "加密钱包未认证",
  943. icon: "none"
  944. });
  945. return;
  946. }
  947. // 3️⃣ 是否达到上限
  948. if (wallets.length >= 2) {
  949. uni.showToast({
  950. title: t('blockchain.item9'),
  951. icon: "none"
  952. });
  953. return;
  954. }
  955. // 4️⃣ 正常打开
  956. addBankDialogRef.value?.open(4);
  957. }
  958. function openAddUnionpay() {
  959. const wallets = bankCardOptions.value || []
  960. console.log(wallets, 12121212);
  961. if (wallets.length === 0) {
  962. addBankDialogRef.value?.open(1);
  963. return;
  964. }
  965. if (wallets.length >= 2) {
  966. uni.showToast({
  967. title: t('Msg.UnionPayCARDS'),
  968. icon: "none"
  969. });
  970. return;
  971. }
  972. addBankDialogRef.value?.open(1);
  973. }
  974. function openAddBank() {
  975. const wallets = bankCardOptions.value || []
  976. console.log(wallets, 121212)
  977. if (wallets.length === 0) {
  978. addBankDialogRef.value?.open(2);
  979. return;
  980. }
  981. if (wallets.length >= 2) {
  982. uni.showToast({
  983. title: t('Msg.WireTransfers'),
  984. icon: "none"
  985. });
  986. return;
  987. }
  988. addBankDialogRef.value?.open(2);
  989. }
  990. function openAddCredit() {
  991. const wallets = bankCardOptions.value || []
  992. console.log(wallets, 12121212);
  993. if (wallets.length === 0) {
  994. addBankDialogRef.value?.open(3);
  995. return;
  996. }
  997. addBankDialogRef.value?.open(3);
  998. }
  999. // 新增银行信息成功回调
  1000. const addSuccess = (e) => {
  1001. getBankInfo();
  1002. }
  1003. const closeDiaAdd = () => {
  1004. dialogInfoTradingAdd.value = false
  1005. }
  1006. const closeAdd = (val) => {
  1007. dialogInfoTradingAdd.value = val
  1008. }
  1009. const confirmToReload = () => {
  1010. dialogInfoTradingAdd.value = false
  1011. getBankInfo()
  1012. }
  1013. const getBankInfo = async () => {
  1014. const res = await financialApi.customBankList({})
  1015. if (res.code === Code.StatusOK) {
  1016. ruleForm.bankInfo = []
  1017. ruleForm.bankWrit = []
  1018. ruleForm.xykInfo = []
  1019. ruleForm.bankBlockchain = []
  1020. res.data.forEach(item => {
  1021. if (item.type === 1) {
  1022. item.customBankCode = item.bankCode
  1023. item.bankCode = null
  1024. ruleForm.bankInfo.push(item)
  1025. } else if (item.type === 2) {
  1026. item.customBankCode = item.bankCode
  1027. item.bankCode = null
  1028. ruleForm.bankWrit.push(item)
  1029. } else if (item.type === 3) {
  1030. item.customBankCode = item.bankCode
  1031. item.bankCode = null
  1032. item.expiryYearMonth = (item.expiryYear || "") + "/" + (item.expiryMonth || "")
  1033. ruleForm.xykInfo.push(item)
  1034. } else if (item.type === 4) {
  1035. item.customBankCode = item.bankCode
  1036. item.bankCode = null
  1037. ruleForm.bankBlockchain.push(item)
  1038. }
  1039. if (channelData.value.type === "BANK" && item.defaultBank && item.type === 1) {
  1040. Object.assign(form, item)
  1041. myId.value = form.id
  1042. }
  1043. if (channelData.value.type === "BANK_TELEGRAPHIC" && item.defaultBank && item.type === 2) {
  1044. Object.assign(form, item)
  1045. myId.value = form.id
  1046. }
  1047. if (channelData.value.type === "CHANNEL_TYPE_CARD" && item.defaultBank && item.type === 3) {
  1048. myId.value = item.id
  1049. Object.assign(form, item)
  1050. }
  1051. if (channelData.value.type === "DIGITAL_CURRENCY" && item.defaultBank && item.type === 4) {
  1052. myId.value = item.id
  1053. Object.assign(form, item)
  1054. }
  1055. })
  1056. } else {
  1057. $pigeon.MessageError(res.msg)
  1058. }
  1059. }
  1060. const onDigitalCurrencyChange = (val) => {
  1061. const item = ruleForm.bankBlockchain.find(b => b.id === val)
  1062. chooseBank(item.id)
  1063. }
  1064. const chooseBank = (id) => {
  1065. const item = bankList.value.find(b => b.id === id)
  1066. // if (!item) {
  1067. // showToast(t("Msg.item11"));
  1068. // return;
  1069. // }
  1070. let codeCache = ""
  1071. if (form.bankCode) codeCache = form.bankCode
  1072. Object.assign(form, item)
  1073. form.agree2 = false
  1074. form.agree3 = false
  1075. if (channelData.value.type === "BANK_TELEGRAPHIC") {
  1076. form.currency = "USD"
  1077. if (codeCache) form.bankCode = codeCache
  1078. }
  1079. }
  1080. const openTips = async () => {
  1081. if (channelData.value.type === "BANK_TELEGRAPHIC" && !myId.value) {
  1082. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1083. return
  1084. }
  1085. if (channelData.value.type === "BANK" && !myId.value) {
  1086. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1087. return
  1088. }
  1089. if (channelData.value.type === "CHANNEL_TYPE_CARD" && !myId.value) {
  1090. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1091. return
  1092. }
  1093. if (channelData.value.type === "DIGITAL_CURRENCY" && !myId.value) {
  1094. $pigeon.MessageWarning(t("blockchain.item11"))
  1095. return
  1096. }
  1097. // 此处模拟表单验证,实际应调用 uni-forms 的 validate
  1098. try {
  1099. if (formRef.value) {
  1100. const valid = await formRef.value.validate()
  1101. if (dialogTipsIsShow.value) {
  1102. dialogTips.value = true
  1103. } else {
  1104. submit("form")
  1105. }
  1106. }
  1107. } catch (error) {
  1108. if (error instanceof Array) {
  1109. showToast(error[0].errorMessage);
  1110. return
  1111. } else {
  1112. RES.value = error.msg;
  1113. }
  1114. }
  1115. }
  1116. const openTipsConfirm = () => {
  1117. dialogCheckConfirm.value = false
  1118. submit("form")
  1119. }
  1120. const closeTipsConfirm = () => {
  1121. dialogTips.value = false
  1122. dialogCheckConfirm.value = true
  1123. }
  1124. const closeDia = () => {
  1125. resetForm()
  1126. isStep3.value = false
  1127. step2.value = false
  1128. dialogCheck.value = false
  1129. dialogVisible.value = false
  1130. showTable()
  1131. }
  1132. const qrCode = async (serial) => {
  1133. metaInfo.value = getMetaInfo()
  1134. const res = await customApi.getWebsdkLink1({
  1135. serial,
  1136. metaInfo: metaInfo.value
  1137. })
  1138. if (res.code === Code.StatusOK) {
  1139. text1.value = JSON.parse(res.data).url
  1140. dialogKyc.value = true
  1141. flag.value = false
  1142. } else {
  1143. flag.value = false
  1144. }
  1145. }
  1146. const submit = async (formName) => {
  1147. if (channelData.value.type === "BANK_TELEGRAPHIC" && !myId.value) {
  1148. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1149. return
  1150. }
  1151. if (channelData.value.type === "BANK" && !myId.value) {
  1152. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1153. return
  1154. }
  1155. if (channelData.value.type === "CHANNEL_TYPE_CARD" && !myId.value) {
  1156. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1157. return
  1158. }
  1159. if (channelData.value.type === "DIGITAL_CURRENCY" && !myId.value) {
  1160. $pigeon.MessageWarning(t("blockchain.item11"))
  1161. return
  1162. }
  1163. // 模拟表单验证
  1164. try {
  1165. if (formRef.value) {
  1166. await formRef.value.validate()
  1167. if (flag.value) return
  1168. flag.value = true
  1169. dialogCheckWait.value = true
  1170. form.amount = Number(form.amount)
  1171. let res
  1172. if (channelData.value.type === "DIGITAL_CURRENCY") {
  1173. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1174. // login: loginValue.value,
  1175. payType: channelData.value.code,
  1176. ...form
  1177. })
  1178. } else if (["CHANNEL_TYPE_WALLET", "UCARD_WALLET", "CHANNEL_TYPE_ALI_WALLET"].includes(channelData.value.type)) {
  1179. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1180. // login: loginValue.value,
  1181. payType: channelData.value.code,
  1182. ...form
  1183. })
  1184. } else if (channelData.value.type === "BANK" || channelData.value.type === "BANK_TELEGRAPHIC") {
  1185. res = await financialApi.ibWithdrawApplyBank(channelData.value.requestUrl, {
  1186. // login: loginValue.value,
  1187. payType: channelData.value.code,
  1188. ...form
  1189. })
  1190. } else if (channelData.value.type === "CHANNEL_TYPE_CARD") {
  1191. res = await financialApi.WithdrawApplyBank(channelData.value.requestUrl, {
  1192. // login: loginValue.value,
  1193. payType: channelData.value.code,
  1194. ...form
  1195. })
  1196. }
  1197. if (res && res.code === Code.StatusOK) {
  1198. dialogCheck.value = true
  1199. dialogVisible.value = true
  1200. // qrCode(res.data)
  1201. flag.value = false
  1202. } else {
  1203. RES.value = res?.msg || "error"
  1204. dialogCheck.value = true
  1205. dialogVisible.value = false
  1206. flag.value = false
  1207. }
  1208. dialogCheckWait.value = false
  1209. }
  1210. } catch (error) {
  1211. if (error instanceof Array) {
  1212. showToast(error[0].errorMessage);
  1213. return
  1214. } else {
  1215. RES.value = error.msg;
  1216. dialogCheck.value = true;
  1217. dialogCheckWait.value = false;
  1218. dialogVisible.value = false;
  1219. flag.value = false;
  1220. }
  1221. }
  1222. }
  1223. const Initialize = () => {
  1224. loginValue.value = ""
  1225. isStep3.value = false
  1226. step2.value = false
  1227. step3.value = false
  1228. showTable()
  1229. }
  1230. const isShowStep3 = (row) => {
  1231. if (row.bankValid && isChannel.value) {
  1232. getBankList(row)
  1233. isChannel.value = false
  1234. step3.value = true
  1235. channelData.value = row
  1236. mAmount.minAmount = row.minAmount
  1237. mAmount.maxAmount = row.maxAmount
  1238. } else {
  1239. step3.value = true
  1240. bankDate.value = []
  1241. channelData.value = row
  1242. mAmount.minAmount = row.minAmount
  1243. mAmount.maxAmount = row.maxAmount
  1244. }
  1245. if (row.code === "UNION_PAY_TELEGRAPHIC") {
  1246. WireTransferAccount.value = JSON.parse(row.property)
  1247. }
  1248. if (["BANK", "BANK_TELEGRAPHIC", "CHANNEL_TYPE_CARD", "DIGITAL_CURRENCY"].includes(row.type)) {
  1249. getBankInfo()
  1250. step3_bank_cur.value = "bank"
  1251. form.login = loginValue.value
  1252. form.payType = row.code
  1253. bankPayType.value = row.code
  1254. }
  1255. // 重置 tableData
  1256. tableData.International_Transfer = []
  1257. tableData.China_UnionPay = []
  1258. tableData.Digital_Currency = []
  1259. tableData.CHANNEL_TYPE_CARD = []
  1260. tableData.Electronic_Wallet = []
  1261. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1262. tableData.UCARD_WALLET = []
  1263. if (row.type === "BANK_TELEGRAPHIC") tableData.International_Transfer[0] = row
  1264. if (row.type === "BANK") tableData.China_UnionPay[0] = row
  1265. if (row.type === "DIGITAL_CURRENCY") tableData.Digital_Currency[0] = row
  1266. if (row.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet[0] = row
  1267. if (row.type === "UCARD_WALLET") tableData.UCARD_WALLET[0] = row
  1268. if (row.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD[0] = row
  1269. if (row.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET[0] = row
  1270. introduce.introduce = row.introduce
  1271. introduce.enIntroduce = row.enIntroduce
  1272. }
  1273. const showTable = () => {
  1274. resetForm()
  1275. myId.value = null
  1276. step3.value = false
  1277. isStep3.value = false
  1278. isChannel.value = true
  1279. getDepositList()
  1280. // 重置表单
  1281. form.currency = "USD"
  1282. // 其他重置...
  1283. }
  1284. const getDateList = async () => {
  1285. const res = await customApi.CustomDropdown({ platform: "" })
  1286. if (res.code === Code.StatusOK) {
  1287. loginOptions.value = res.data
  1288. } else {
  1289. $pigeon.MessageError(res.msg)
  1290. }
  1291. }
  1292. const getDepositList = async () => {
  1293. pictLoading.value = true
  1294. tableData.International_Transfer = []
  1295. tableData.China_UnionPay = []
  1296. tableData.Digital_Currency = []
  1297. tableData.CHANNEL_TYPE_CARD = []
  1298. tableData.Electronic_Wallet = []
  1299. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1300. tableData.UCARD_WALLET = []
  1301. const res = await financialApi.RemitChannelList({})
  1302. if (res.code === Code.StatusOK) {
  1303. res.data.forEach(item => {
  1304. if (item.type === "BANK_TELEGRAPHIC") tableData.International_Transfer.push(item)
  1305. if (item.type === "BANK") tableData.China_UnionPay.push(item)
  1306. if (item.type === "DIGITAL_CURRENCY") tableData.Digital_Currency.push(item)
  1307. if (item.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet.push(item)
  1308. if (item.type === "UCARD_WALLET") tableData.UCARD_WALLET.push(item)
  1309. if (item.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD.push(item)
  1310. if (item.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET.push(item)
  1311. })
  1312. pictLoading.value = false
  1313. } else {
  1314. $pigeon.MessageError(res.msg)
  1315. pictLoading.value = false
  1316. }
  1317. }
  1318. const getBankList = async (row) => {
  1319. const res = await financialApi.BankList({ channelCode: row.code })
  1320. if (res.code === Code.StatusOK) {
  1321. const bank = res.data
  1322. const data = []
  1323. bank.forEach(j => {
  1324. if (!j.minAmount && j.minAmount !== 0) j.minAmount = row.minAmount
  1325. if (!j.maxAmount && j.maxAmount !== 0) j.maxAmount = row.maxAmount
  1326. j.payType = row.code
  1327. data.push(j)
  1328. })
  1329. bankDate.value = data
  1330. } else {
  1331. $pigeon.MessageError(res.msg)
  1332. }
  1333. }
  1334. const cancelBank = () => {
  1335. dialogNewBank.value = false
  1336. // 重置 params 表单
  1337. Object.assign(params, {
  1338. bankCardNum: "",
  1339. bankUname: "",
  1340. bankName: "",
  1341. bankBranchName: "",
  1342. bankAddr: "",
  1343. swiftCode: "",
  1344. bankFront: "",
  1345. bankBack: "",
  1346. defaultBank: false
  1347. })
  1348. }
  1349. // ---------- 生命周期 ----------
  1350. onMounted(() => {
  1351. if (getInfoStatus5.value) {
  1352. InfoStatus5.value = true
  1353. return
  1354. }
  1355. getFreeNumber()
  1356. isShowDialog()
  1357. // getDateList()
  1358. getDepositList()
  1359. })
  1360. // 监听 value 变化
  1361. watch(loginValue, (newVal) => {
  1362. if (newVal) {
  1363. step2.value = true
  1364. showTable()
  1365. }
  1366. })
  1367. // 监听 form.amount 变化
  1368. watch(() => form.amount, (newVal) => {
  1369. if (newVal && channelData.value.rate) {
  1370. form.amount1 = (newVal * channelData.value.rate).toFixed(2)
  1371. }
  1372. })
  1373. </script>
  1374. <style lang="scss" scoped>
  1375. @import "@/uni.scss";
  1376. .custom-withdraw {
  1377. .box {
  1378. margin-bottom: px2rpx(20);
  1379. .b-card {
  1380. background: #fff;
  1381. border-radius: px2rpx(12);
  1382. padding: px2rpx(20);
  1383. box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.03);
  1384. .card-top {
  1385. .tit {
  1386. font-size: px2rpx(16);
  1387. font-weight: 600;
  1388. margin-bottom: px2rpx(16);
  1389. display: flex;
  1390. align-items: center;
  1391. color: var(--color-navy-900);
  1392. position: relative;
  1393. padding-left: 20px;
  1394. &:after {
  1395. content: '';
  1396. position: absolute;
  1397. left: 0;
  1398. top: 50%;
  1399. transform: translateY(-50%);
  1400. width: 0;
  1401. height: 0;
  1402. border-top: 6px solid transparent;
  1403. border-bottom: 6px solid transparent;
  1404. border-left: 8px solid currentColor;
  1405. }
  1406. .iconfont {
  1407. margin-right: px2rpx(8);
  1408. color: var(--color-primary);
  1409. font-size: px2rpx(18);
  1410. }
  1411. }
  1412. }
  1413. .channelType {
  1414. font-size: px2rpx(15);
  1415. font-weight: 600;
  1416. margin: px2rpx(24) 0 px2rpx(12);
  1417. color: var(--color-navy-700);
  1418. padding-left: px2rpx(8);
  1419. border-left: px2rpx(4) solid var(--color-primary);
  1420. }
  1421. }
  1422. }
  1423. .reselect-btn {
  1424. margin-top: px2rpx(20);
  1425. display: flex;
  1426. justify-content: flex-end;
  1427. }
  1428. .s-btn {
  1429. &.reselect {
  1430. background-color: var(--color-zinc-100);
  1431. color: var(--color-navy-700);
  1432. border: none;
  1433. font-size: px2rpx(14);
  1434. padding: px2rpx(8) px2rpx(20);
  1435. border-radius: px2rpx(8);
  1436. &:active {
  1437. background-color: var(--color-zinc-200);
  1438. }
  1439. }
  1440. &[type="primary"] {
  1441. width: 100%;
  1442. height: px2rpx(48);
  1443. background: var(--color-navy-900);
  1444. color: #fff;
  1445. border-radius: px2rpx(12);
  1446. font-size: px2rpx(16);
  1447. font-weight: 600;
  1448. display: flex;
  1449. align-items: center;
  1450. justify-content: center;
  1451. border: none;
  1452. margin-top: px2rpx(30);
  1453. transition: all 0.2s;
  1454. &:active {
  1455. transform: scale(0.98);
  1456. background: var(--color-navy-800);
  1457. }
  1458. }
  1459. }
  1460. .add-back {
  1461. display: flex;
  1462. justify-content: space-between;
  1463. align-items: center;
  1464. margin-bottom: px2rpx(12);
  1465. padding: px2rpx(12) px2rpx(16);
  1466. background: var(--color-zinc-100);
  1467. border-radius: px2rpx(8);
  1468. text {
  1469. font-size: px2rpx(14);
  1470. color: var(--color-navy-700);
  1471. font-weight: 500;
  1472. }
  1473. .add-btn {
  1474. color: var(--color-primary);
  1475. font-weight: 600;
  1476. text-decoration: underline;
  1477. &:active {
  1478. opacity: 0.7;
  1479. }
  1480. }
  1481. }
  1482. .proof {
  1483. margin-top: px2rpx(8);
  1484. border: px2rpx(1) dashed var(--color-zinc-300);
  1485. border-radius: px2rpx(8);
  1486. padding: px2rpx(8);
  1487. display: flex;
  1488. justify-content: center;
  1489. align-items: center;
  1490. background: var(--color-zinc-50);
  1491. .state {
  1492. padding: px2rpx(4) px2rpx(12);
  1493. border-radius: px2rpx(4);
  1494. font-size: px2rpx(12);
  1495. font-weight: bold;
  1496. }
  1497. }
  1498. .agree {
  1499. margin: px2rpx(24) 0;
  1500. display: flex;
  1501. align-items: flex-start;
  1502. .checkbox {
  1503. display: flex;
  1504. align-items: flex-start;
  1505. gap: px2rpx(8);
  1506. :deep(uni-checkbox .uni-checkbox-input) {
  1507. border-radius: px2rpx(4);
  1508. width: px2rpx(18);
  1509. height: px2rpx(18);
  1510. }
  1511. text {
  1512. font-size: px2rpx(13);
  1513. color: var(--color-zinc-500);
  1514. line-height: 1.5;
  1515. }
  1516. }
  1517. }
  1518. .step3-attention {
  1519. // background: var(--color-error-50, #fff1f0);
  1520. border-radius: px2rpx(12);
  1521. margin-bottom: px2rpx(20);
  1522. .tips {
  1523. line-height: 1.8;
  1524. font-size: px2rpx(12);
  1525. color: #909399;
  1526. background-color: #f9f9f9;
  1527. padding: px2rpx(12);
  1528. border-radius: px2rpx(4);
  1529. border-left: px2rpx(2) solid #409eff;
  1530. .title {
  1531. font-weight: 600;
  1532. margin-bottom: px2rpx(6);
  1533. color: #606266;
  1534. }
  1535. }
  1536. .attention {
  1537. font-size: px2rpx(14);
  1538. // color: var(--color-error-600, #cf1322);
  1539. line-height: 1.6;
  1540. }
  1541. .btn-bottom {
  1542. margin-top: px2rpx(20);
  1543. display: flex;
  1544. justify-content: center;
  1545. .btn {
  1546. background: var(--color-error-600, #cf1322);
  1547. color: #fff;
  1548. padding: px2rpx(10) px2rpx(48);
  1549. border-radius: px2rpx(24);
  1550. font-size: px2rpx(15);
  1551. font-weight: 700;
  1552. box-shadow: 0 px2rpx(4) px2rpx(10) rgba(207, 19, 34, 0.2);
  1553. transition: all 0.2s;
  1554. &:active {
  1555. transform: scale(0.96);
  1556. opacity: 0.8;
  1557. }
  1558. }
  1559. }
  1560. }
  1561. :deep(.base-info-form) {
  1562. .uni-row1 {
  1563. .uni-col {
  1564. padding: 0 px2rpx(10) !important;
  1565. }
  1566. .uni-forms-item {
  1567. min-height: px2rpx(36);
  1568. margin-bottom: px2rpx(28);
  1569. }
  1570. .uni-select,
  1571. .uni-combox,
  1572. .uni-easyinput__content,
  1573. .uni-date-editor--x {
  1574. border: none !important;
  1575. background-color: var(--color-zinc-100) !important;
  1576. border-radius: px2rpx(8) !important;
  1577. }
  1578. .uni-date-x {
  1579. border: none !important;
  1580. background-color: rgba(195, 195, 195, 0) !important;
  1581. }
  1582. .uni-easyinput__content-input {
  1583. height: px2rpx(35) !important;
  1584. }
  1585. }
  1586. }
  1587. @keyframes rotate {
  1588. from {
  1589. transform: rotate(0deg);
  1590. }
  1591. to {
  1592. transform: rotate(360deg);
  1593. }
  1594. }
  1595. }
  1596. </style>