withdraw.vue 63 KB

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