withdraw.vue 62 KB

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