withdraw-select.vue 66 KB

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