withdraw.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649
  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.format'),
  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.format')
  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.format')
  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. dialogCheck.value = false
  1095. dialogVisible.value = false
  1096. showTable()
  1097. }
  1098. const qrCode = async (serial) => {
  1099. metaInfo.value = getMetaInfo()
  1100. const res = await customApi.getWebsdkLink1({
  1101. serial,
  1102. metaInfo: metaInfo.value
  1103. })
  1104. if (res.code === Code.StatusOK) {
  1105. text1.value = JSON.parse(res.data).url
  1106. dialogKyc.value = true
  1107. flag.value = false
  1108. } else {
  1109. flag.value = false
  1110. }
  1111. }
  1112. const submit = async (formName) => {
  1113. if (channelData.value.type === "BANK_TELEGRAPHIC" && !myId.value) {
  1114. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1115. return
  1116. }
  1117. if (channelData.value.type === "BANK" && !myId.value) {
  1118. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1119. return
  1120. }
  1121. if (channelData.value.type === "CHANNEL_TYPE_CARD" && !myId.value) {
  1122. $pigeon.MessageWarning(t("vaildate.withdrawBank.empty"))
  1123. return
  1124. }
  1125. if (channelData.value.type === "DIGITAL_CURRENCY" && !myId.value) {
  1126. $pigeon.MessageWarning(t("blockchain.item11"))
  1127. return
  1128. }
  1129. // 模拟表单验证
  1130. try {
  1131. if (formRef.value) {
  1132. await formRef.value.validate()
  1133. if (flag.value) return
  1134. flag.value = true
  1135. dialogCheckWait.value = true
  1136. form.amount = Number(form.amount)
  1137. let res
  1138. if (channelData.value.type === "DIGITAL_CURRENCY") {
  1139. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1140. // login: loginValue.value,
  1141. payType: channelData.value.code,
  1142. ...form
  1143. })
  1144. } else if (["CHANNEL_TYPE_WALLET", "UCARD_WALLET", "CHANNEL_TYPE_ALI_WALLET"].includes(channelData.value.type)) {
  1145. res = await financialApi.ibWithdrawAapplyDigitalCurrency(channelData.value.requestUrl, {
  1146. // login: loginValue.value,
  1147. payType: channelData.value.code,
  1148. ...form
  1149. })
  1150. } else if (channelData.value.type === "BANK" || channelData.value.type === "BANK_TELEGRAPHIC") {
  1151. res = await financialApi.ibWithdrawApplyBank(channelData.value.requestUrl, {
  1152. // login: loginValue.value,
  1153. payType: channelData.value.code,
  1154. ...form
  1155. })
  1156. } else if (channelData.value.type === "CHANNEL_TYPE_CARD") {
  1157. res = await financialApi.WithdrawApplyBank(channelData.value.requestUrl, {
  1158. // login: loginValue.value,
  1159. payType: channelData.value.code,
  1160. ...form
  1161. })
  1162. }
  1163. if (res && res.code === Code.StatusOK) {
  1164. dialogCheck.value = true
  1165. dialogVisible.value = true
  1166. // qrCode(res.data)
  1167. flag.value = false
  1168. } else {
  1169. RES.value = res?.msg || "error"
  1170. dialogCheck.value = true
  1171. dialogVisible.value = false
  1172. flag.value = false
  1173. }
  1174. dialogCheckWait.value = false
  1175. }
  1176. } catch (error) {
  1177. if (error instanceof Array) {
  1178. showToast(error[0].errorMessage);
  1179. return
  1180. } else {
  1181. RES.value = error.msg;
  1182. dialogCheck.value = true;
  1183. dialogCheckWait.value = false;
  1184. dialogVisible.value = false;
  1185. flag.value = false;
  1186. }
  1187. }
  1188. }
  1189. const Initialize = () => {
  1190. loginValue.value = ""
  1191. isStep3.value = false
  1192. step2.value = false
  1193. step3.value = false
  1194. showTable()
  1195. }
  1196. const isShowStep3 = (row) => {
  1197. if (row.bankValid && isChannel.value) {
  1198. getBankList(row)
  1199. isChannel.value = false
  1200. step3.value = true
  1201. channelData.value = row
  1202. mAmount.minAmount = row.minAmount
  1203. mAmount.maxAmount = row.maxAmount
  1204. } else {
  1205. step3.value = true
  1206. bankDate.value = []
  1207. channelData.value = row
  1208. mAmount.minAmount = row.minAmount
  1209. mAmount.maxAmount = row.maxAmount
  1210. }
  1211. if (row.code === "UNION_PAY_TELEGRAPHIC") {
  1212. WireTransferAccount.value = JSON.parse(row.property)
  1213. }
  1214. if (["BANK", "BANK_TELEGRAPHIC", "CHANNEL_TYPE_CARD", "DIGITAL_CURRENCY"].includes(row.type)) {
  1215. getBankInfo()
  1216. step3_bank_cur.value = "bank"
  1217. form.login = loginValue.value
  1218. form.payType = row.code
  1219. bankPayType.value = row.code
  1220. }
  1221. // 重置 tableData
  1222. tableData.International_Transfer = []
  1223. tableData.China_UnionPay = []
  1224. tableData.Digital_Currency = []
  1225. tableData.CHANNEL_TYPE_CARD = []
  1226. tableData.Electronic_Wallet = []
  1227. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1228. tableData.UCARD_WALLET = []
  1229. if (row.type === "BANK_TELEGRAPHIC") tableData.International_Transfer[0] = row
  1230. if (row.type === "BANK") tableData.China_UnionPay[0] = row
  1231. if (row.type === "DIGITAL_CURRENCY") tableData.Digital_Currency[0] = row
  1232. if (row.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet[0] = row
  1233. if (row.type === "UCARD_WALLET") tableData.UCARD_WALLET[0] = row
  1234. if (row.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD[0] = row
  1235. if (row.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET[0] = row
  1236. introduce.introduce = row.introduce
  1237. introduce.enIntroduce = row.enIntroduce
  1238. }
  1239. const showTable = () => {
  1240. resetForm()
  1241. myId.value = null
  1242. step3.value = false
  1243. isStep3.value = false
  1244. isChannel.value = true
  1245. getDepositList()
  1246. // 重置表单
  1247. form.currency = "USD"
  1248. // 其他重置...
  1249. }
  1250. const getDateList = async () => {
  1251. const res = await customApi.CustomDropdown({ platform: "" })
  1252. if (res.code === Code.StatusOK) {
  1253. loginOptions.value = res.data
  1254. } else {
  1255. $pigeon.MessageError(res.msg)
  1256. }
  1257. }
  1258. const getDepositList = async () => {
  1259. pictLoading.value = true
  1260. tableData.International_Transfer = []
  1261. tableData.China_UnionPay = []
  1262. tableData.Digital_Currency = []
  1263. tableData.CHANNEL_TYPE_CARD = []
  1264. tableData.Electronic_Wallet = []
  1265. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1266. tableData.UCARD_WALLET = []
  1267. const res = await financialApi.RemitChannelList({})
  1268. if (res.code === Code.StatusOK) {
  1269. res.data.forEach(item => {
  1270. if (item.type === "BANK_TELEGRAPHIC") tableData.International_Transfer.push(item)
  1271. if (item.type === "BANK") tableData.China_UnionPay.push(item)
  1272. if (item.type === "DIGITAL_CURRENCY") tableData.Digital_Currency.push(item)
  1273. if (item.type === "CHANNEL_TYPE_WALLET") tableData.Electronic_Wallet.push(item)
  1274. if (item.type === "UCARD_WALLET") tableData.UCARD_WALLET.push(item)
  1275. if (item.type === "CHANNEL_TYPE_CARD") tableData.CHANNEL_TYPE_CARD.push(item)
  1276. if (item.type === "CHANNEL_TYPE_ALI_WALLET") tableData.CHANNEL_TYPE_ALI_WALLET.push(item)
  1277. })
  1278. pictLoading.value = false
  1279. } else {
  1280. $pigeon.MessageError(res.msg)
  1281. pictLoading.value = false
  1282. }
  1283. }
  1284. const getBankList = async (row) => {
  1285. const res = await financialApi.BankList({ channelCode: row.code })
  1286. if (res.code === Code.StatusOK) {
  1287. const bank = res.data
  1288. const data = []
  1289. bank.forEach(j => {
  1290. if (!j.minAmount && j.minAmount !== 0) j.minAmount = row.minAmount
  1291. if (!j.maxAmount && j.maxAmount !== 0) j.maxAmount = row.maxAmount
  1292. j.payType = row.code
  1293. data.push(j)
  1294. })
  1295. bankDate.value = data
  1296. } else {
  1297. $pigeon.MessageError(res.msg)
  1298. }
  1299. }
  1300. const cancelBank = () => {
  1301. dialogNewBank.value = false
  1302. // 重置 params 表单
  1303. Object.assign(params, {
  1304. bankCardNum: "",
  1305. bankUname: "",
  1306. bankName: "",
  1307. bankBranchName: "",
  1308. bankAddr: "",
  1309. swiftCode: "",
  1310. bankFront: "",
  1311. bankBack: "",
  1312. defaultBank: false
  1313. })
  1314. }
  1315. // ---------- 生命周期 ----------
  1316. onMounted(() => {
  1317. if (getInfoStatus5.value) {
  1318. InfoStatus5.value = true
  1319. return
  1320. }
  1321. getFreeNumber()
  1322. isShowDialog()
  1323. // getDateList()
  1324. getDepositList()
  1325. })
  1326. // 监听 value 变化
  1327. watch(loginValue, (newVal) => {
  1328. if (newVal) {
  1329. step2.value = true
  1330. showTable()
  1331. }
  1332. })
  1333. // 监听 form.amount 变化
  1334. watch(() => form.amount, (newVal) => {
  1335. if (newVal && channelData.value.rate) {
  1336. form.amount1 = (newVal * channelData.value.rate).toFixed(2)
  1337. }
  1338. })
  1339. </script>
  1340. <style lang="scss" scoped>
  1341. @import "@/uni.scss";
  1342. .custom-withdraw {
  1343. .box {
  1344. margin-bottom: px2rpx(20);
  1345. .b-card {
  1346. background: #fff;
  1347. border-radius: px2rpx(12);
  1348. padding: px2rpx(20);
  1349. box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.03);
  1350. .card-top {
  1351. .tit {
  1352. font-size: px2rpx(16);
  1353. font-weight: 600;
  1354. margin-bottom: px2rpx(16);
  1355. display: flex;
  1356. align-items: center;
  1357. color: var(--color-navy-900);
  1358. position: relative;
  1359. padding-left: 20px;
  1360. &:after {
  1361. content: '';
  1362. position: absolute;
  1363. left: 0;
  1364. top: 50%;
  1365. transform: translateY(-50%);
  1366. width: 0;
  1367. height: 0;
  1368. border-top: 6px solid transparent;
  1369. border-bottom: 6px solid transparent;
  1370. border-left: 8px solid currentColor;
  1371. }
  1372. .iconfont {
  1373. margin-right: px2rpx(8);
  1374. color: var(--color-primary);
  1375. font-size: px2rpx(18);
  1376. }
  1377. }
  1378. }
  1379. .channelType {
  1380. font-size: px2rpx(15);
  1381. font-weight: 600;
  1382. margin: px2rpx(24) 0 px2rpx(12);
  1383. color: var(--color-navy-700);
  1384. padding-left: px2rpx(8);
  1385. border-left: px2rpx(4) solid var(--color-primary);
  1386. }
  1387. }
  1388. }
  1389. .reselect-btn {
  1390. margin-top: px2rpx(20);
  1391. display: flex;
  1392. justify-content: flex-end;
  1393. }
  1394. .s-btn {
  1395. &.reselect {
  1396. background-color: var(--color-zinc-100);
  1397. color: var(--color-navy-700);
  1398. border: none;
  1399. font-size: px2rpx(14);
  1400. padding: px2rpx(8) px2rpx(20);
  1401. border-radius: px2rpx(8);
  1402. &:active {
  1403. background-color: var(--color-zinc-200);
  1404. }
  1405. }
  1406. &[type="primary"] {
  1407. width: 100%;
  1408. height: px2rpx(48);
  1409. background: var(--color-navy-900);
  1410. color: #fff;
  1411. border-radius: px2rpx(12);
  1412. font-size: px2rpx(16);
  1413. font-weight: 600;
  1414. display: flex;
  1415. align-items: center;
  1416. justify-content: center;
  1417. border: none;
  1418. margin-top: px2rpx(30);
  1419. transition: all 0.2s;
  1420. &:active {
  1421. transform: scale(0.98);
  1422. background: var(--color-navy-800);
  1423. }
  1424. }
  1425. }
  1426. .add-back {
  1427. display: flex;
  1428. justify-content: space-between;
  1429. align-items: center;
  1430. margin-bottom: px2rpx(12);
  1431. padding: px2rpx(12) px2rpx(16);
  1432. background: var(--color-zinc-100);
  1433. border-radius: px2rpx(8);
  1434. text {
  1435. font-size: px2rpx(14);
  1436. color: var(--color-navy-700);
  1437. font-weight: 500;
  1438. }
  1439. .add-btn {
  1440. color: var(--color-primary);
  1441. font-weight: 600;
  1442. text-decoration: underline;
  1443. &:active {
  1444. opacity: 0.7;
  1445. }
  1446. }
  1447. }
  1448. .proof {
  1449. margin-top: px2rpx(8);
  1450. border: px2rpx(1) dashed var(--color-zinc-300);
  1451. border-radius: px2rpx(8);
  1452. padding: px2rpx(8);
  1453. display: flex;
  1454. justify-content: center;
  1455. align-items: center;
  1456. background: var(--color-zinc-50);
  1457. .state {
  1458. padding: px2rpx(4) px2rpx(12);
  1459. border-radius: px2rpx(4);
  1460. font-size: px2rpx(12);
  1461. font-weight: bold;
  1462. }
  1463. }
  1464. .agree {
  1465. margin: px2rpx(24) 0;
  1466. display: flex;
  1467. align-items: flex-start;
  1468. .checkbox {
  1469. display: flex;
  1470. align-items: flex-start;
  1471. gap: px2rpx(8);
  1472. :deep(uni-checkbox .uni-checkbox-input) {
  1473. border-radius: px2rpx(4);
  1474. width: px2rpx(18);
  1475. height: px2rpx(18);
  1476. }
  1477. text {
  1478. font-size: px2rpx(13);
  1479. color: var(--color-zinc-500);
  1480. line-height: 1.5;
  1481. }
  1482. }
  1483. }
  1484. .step3-attention {
  1485. // background: var(--color-error-50, #fff1f0);
  1486. border-radius: px2rpx(12);
  1487. margin-bottom: px2rpx(20);
  1488. .tips {
  1489. line-height: 1.8;
  1490. font-size: px2rpx(12);
  1491. color: #909399;
  1492. background-color: #f9f9f9;
  1493. padding: px2rpx(12);
  1494. border-radius: px2rpx(4);
  1495. border-left: px2rpx(2) solid #409eff;
  1496. .title {
  1497. font-weight: 600;
  1498. margin-bottom: px2rpx(6);
  1499. color: #606266;
  1500. }
  1501. }
  1502. .attention {
  1503. font-size: px2rpx(14);
  1504. // color: var(--color-error-600, #cf1322);
  1505. line-height: 1.6;
  1506. }
  1507. .btn-bottom {
  1508. margin-top: px2rpx(20);
  1509. display: flex;
  1510. justify-content: center;
  1511. .btn {
  1512. background: var(--color-error-600, #cf1322);
  1513. color: #fff;
  1514. padding: px2rpx(10) px2rpx(48);
  1515. border-radius: px2rpx(24);
  1516. font-size: px2rpx(15);
  1517. font-weight: 700;
  1518. box-shadow: 0 px2rpx(4) px2rpx(10) rgba(207, 19, 34, 0.2);
  1519. transition: all 0.2s;
  1520. &:active {
  1521. transform: scale(0.96);
  1522. opacity: 0.8;
  1523. }
  1524. }
  1525. }
  1526. }
  1527. :deep(.base-info-form) {
  1528. .uni-row1 {
  1529. .uni-col {
  1530. padding: 0 px2rpx(10) !important;
  1531. }
  1532. .uni-forms-item {
  1533. min-height: px2rpx(79);
  1534. margin-bottom: px2rpx(10);
  1535. }
  1536. .uni-select,
  1537. .uni-combox,
  1538. .uni-easyinput__content,
  1539. .uni-date-editor--x {
  1540. border: none !important;
  1541. background-color: var(--color-zinc-100) !important;
  1542. border-radius: px2rpx(8) !important;
  1543. }
  1544. .uni-date-x {
  1545. border: none !important;
  1546. background-color: rgba(195, 195, 195, 0) !important;
  1547. }
  1548. .uni-easyinput__content-input {
  1549. height: px2rpx(35) !important;
  1550. }
  1551. }
  1552. }
  1553. @keyframes rotate {
  1554. from {
  1555. transform: rotate(0deg);
  1556. }
  1557. to {
  1558. transform: rotate(360deg);
  1559. }
  1560. }
  1561. }
  1562. </style>