withdraw.vue 62 KB

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