withdrawal.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Custom.Withdraw.Title')" />
  4. <view class="custom-withdraw">
  5. <!-- 步骤1:选择账户 -->
  6. <view class="box box-step1">
  7. <view class="b-card">
  8. <view class="card-top">
  9. <text class="tit"><text class="iconfont icon-caret-right"></text>{{ t('Custom.Deposit.Title11') }}</text>
  10. <view class="base-info-form">
  11. <view class="uni-row2">
  12. <cwg-combox :clearable="false" v-model:value="loginValue" :options="loginComboxOptions"
  13. :placeholder="t('placeholder.choose')" @change="onAccountChange" />
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 步骤2:支付通道列表 -->
  20. <view class="box box-step2" v-if="step2">
  21. <view class="b-card">
  22. <view class="card-top">
  23. <text class="tit"><text class="iconfont icon-caret-right"></text>{{ t('Custom.Deposit.Title22') }}</text>
  24. <view v-for="(group, groupKey) in tableData" :key="groupKey">
  25. <!-- 通道分组标题 -->
  26. <view class="channelType" v-if="group.length" v-t="groupTitleMap[groupKey]" />
  27. <PaymentMethodsList :list="group" @select="isShowStep3" />
  28. </view>
  29. <view v-if="step3" class="reselect-btn">
  30. <button class="s-btn reselect" type="primary" @click="showTable">{{ t('Custom.Deposit.Reselect')
  31. }}</button>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 步骤3:填写出金信息 -->
  37. <view class="box box-step3" v-if="step3">
  38. <view class="b-card">
  39. <view class="card-top">
  40. <!-- 注意事项 -->
  41. <view v-if="!isStep3" class="step3-attention">
  42. {{ introduce.value }}
  43. <view class="tips" v-if="(introduce.introduce || introduce.enIntroduce)">
  44. <view>
  45. <rich-text class="attention" :nodes="isZh ? introduce.introduce : introduce.enIntroduce" />
  46. </view>
  47. </view>
  48. <view class="btn-bottom">
  49. <text class="btn crm-cursor" @click="isStep3 = true">{{ t('Btn.Confirm') }}</text>
  50. </view>
  51. </view>
  52. <!-- 表单 -->
  53. <uni-forms ref="formRef" :model="form" :rules="rules" labelWidth="200" label-position="top" v-show="isStep3"
  54. class="base-info-form" validate-trigger="submit">
  55. <uni-row class="demo-uni-row uni-row1">
  56. <!-- 银行选择(针对有银行列表的通道) -->
  57. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8" v-if="bankDate.length">
  58. <uni-forms-item :label="t('Custom.Withdraw.Title5')" name="bankCode">
  59. <cwg-combox :clearable="false" v-model:value="form.bankCode" :options="bankOptions"
  60. :placeholder="t('placeholder.choose')" @change="selectCode" />
  61. </uni-forms-item>
  62. </uni-col>
  63. <!-- 电子钱包地址输入 -->
  64. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  65. v-if="['CHANNEL_TYPE_WALLET', 'CHANNEL_TYPE_ALI_WALLET'].includes(channelData.type)">
  66. <uni-forms-item :label="getWalletLabel" name="address">
  67. <uni-easyinput :clearable="false" v-model="form.address" :placeholder="t('placeholder.input')" />
  68. </uni-forms-item>
  69. </uni-col>
  70. <!-- 数字货币选择(从已保存地址中选择) -->
  71. <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="channelData.type === 'DIGITAL_CURRENCY'">
  72. <view class="add-back">
  73. <text>{{ t('blockchain.item10') }}</text>
  74. <text class="add-btn crm-cursor" @click="openAddBankCard('add_bankBlockchain')">{{
  75. t('Custom.Withdraw.addBank1') }}</text>
  76. </view>
  77. <uni-forms-item :label="t('Custom.Withdraw.Title6')">
  78. <cwg-combox :clearable="false" v-model:value="myId" :options="digitalOptions"
  79. :placeholder="t('placeholder.choose')" @change="onDigitalCurrencyChange"
  80. :disabled="!ruleForm.bankBlockchain.length" />
  81. </uni-forms-item>
  82. <uni-row>
  83. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  84. <uni-forms-item :label="t('blockchain.item3')">
  85. <uni-easyinput disabled v-model="form.addressName" />
  86. </uni-forms-item>
  87. </uni-col>
  88. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  89. <uni-forms-item :label="t('blockchain.item4')">
  90. <uni-easyinput disabled v-model="form.address" />
  91. </uni-forms-item>
  92. </uni-col>
  93. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8" v-if="form.addressProve">
  94. <uni-forms-item :label="t('blockchain.item5')">
  95. <view class="proof">
  96. <template v-if="form.addressProve && (form.addressProve.slice(-3).toLowerCase() === 'pdf')">
  97. <a :href="imgUrl + form.addressProve" target="_blank" class="state crm_state_blue">PDF</a>
  98. </template>
  99. <image v-else :src="imgUrl + form.addressProve" mode="aspectFit"
  100. style="width: 100rpx; height: 100rpx;" @click="previewImage(imgUrl + form.addressProve)" />
  101. </view>
  102. </uni-forms-item>
  103. </uni-col>
  104. </uni-row>
  105. <text class="tit"><text class="iconfont iconi"></text>{{ t('Custom.Deposit.Des') }}</text>
  106. </uni-col>
  107. <uni-col :span="24" class="card-tit"
  108. v-if="isStep3 && (channelData.type == 'BANK_TELEGRAPHIC' || channelData.type == 'BANK' || channelData.type == 'CHANNEL_TYPE_CARD')">
  109. <div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;">
  110. <view class="tit">
  111. <text>{{ t('Custom.Withdraw.Title4') }}</text>
  112. </view>
  113. <div class="add-back">
  114. <text v-if="channelData.type == 'BANK_TELEGRAPHIC'">{{
  115. t('Custom.Withdraw.addWire') }}</text>
  116. <text v-if="channelData.type == 'BANK_TELEGRAPHIC'" class="add-btn crm-cursor"
  117. @click="openAddBankCard('add_wireTransfer')">
  118. {{ t('Custom.Withdraw.addBank1') }}
  119. </text>
  120. <text v-if="channelData.type == 'BANK'">{{
  121. t('Custom.Withdraw.addBank')
  122. }}</text>
  123. <text v-if="channelData.type == 'BANK'" class="add-btn crm-cursor"
  124. @click="openAddBankCard('add_bankCard')">
  125. {{ t('Custom.Withdraw.addBank1') }}
  126. </text>
  127. <text v-if="channelData.type == 'CHANNEL_TYPE_CARD'">{{
  128. t('PersonalManagement.Label.addCreditCard') }}</text>
  129. <text v-if="channelData.type == 'CHANNEL_TYPE_CARD'" class="add-btn crm-cursor"
  130. @click="openAddBankCard('add_CreditCard')">
  131. {{ t('Custom.Withdraw.addBank1') }}
  132. </text>
  133. </div>
  134. </div>
  135. </uni-col>
  136. <!-- 银行卡/信用卡选择 -->
  137. <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"
  138. v-if="['BANK', 'BANK_TELEGRAPHIC', 'CHANNEL_TYPE_CARD'].includes(channelData.type)">
  139. <uni-forms-item>
  140. <cwg-combox :clearable="false" v-model:value="myId" :options="bankCardOptions" @change="chooseBank"
  141. :placeholder="t('placeholder.choose')" />
  142. </uni-forms-item>
  143. </uni-col>
  144. <!-- 通用银行信息展示 -->
  145. <template v-if="channelData.type == 'BANK'">
  146. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  147. <uni-forms-item :label="t('Custom.Withdraw.UserName')">
  148. <uni-easyinput disabled v-model="form.bankUname" />
  149. </uni-forms-item>
  150. </uni-col>
  151. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  152. <uni-forms-item :label="t('Custom.Withdraw.BankCardNum')">
  153. <uni-easyinput disabled v-model="form.bankCardNum" />
  154. </uni-forms-item>
  155. </uni-col>
  156. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  157. <uni-forms-item :label="t('Custom.Withdraw.BankName')">
  158. <uni-easyinput disabled v-model="form.bankName" />
  159. </uni-forms-item>
  160. </uni-col>
  161. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  162. <uni-forms-item :label="t('Custom.Withdraw.bankBranchName')">
  163. <uni-easyinput disabled v-model="form.bankBranchName" />
  164. </uni-forms-item>
  165. </uni-col>
  166. </template>
  167. <!-- 信用卡信息展示(针对有信用卡列表的通道) -->
  168. <template v-if="channelData.type == 'CHANNEL_TYPE_CARD'">
  169. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  170. <uni-forms-item :label="t('PersonalManagement.Label.CreditCardAccountName')">
  171. <uni-easyinput disabled v-model="form.bankUname" />
  172. </uni-forms-item>
  173. </uni-col>
  174. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  175. <uni-forms-item :label="t('PersonalManagement.Label.CreditCardAccount')">
  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. <uni-forms-item label="CVV">
  181. <uni-easyinput disabled v-model="form.cvv" />
  182. </uni-forms-item>
  183. </uni-col>
  184. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  185. <uni-forms-item :label="t('PersonalManagement.Label.ExpirationYear')">
  186. <uni-easyinput disabled v-model="form.expiryYearMonth" />
  187. </uni-forms-item>
  188. </uni-col>
  189. </template>
  190. <!-- 银行电汇转账信息展示(针对有银行转账列表的通道) -->
  191. <template v-if="channelData.type == 'BANK_TELEGRAPHIC'">
  192. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  193. <uni-forms-item :label="t('Custom.Withdraw.UserName')">
  194. <uni-easyinput disabled v-model="form.bankUname" />
  195. </uni-forms-item>
  196. </uni-col>
  197. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  198. <uni-forms-item :label="t('Custom.Withdraw.BankCardNum')">
  199. <uni-easyinput disabled v-model="form.bankCardNum" />
  200. </uni-forms-item>
  201. </uni-col>
  202. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  203. <uni-forms-item :label="t('Custom.Withdraw.BankName')">
  204. <uni-easyinput disabled v-model="form.bankName" />
  205. </uni-forms-item>
  206. </uni-col>
  207. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  208. <uni-forms-item :label="t('Custom.Withdraw.swiftCode')">
  209. <uni-easyinput disabled v-model="form.swiftCode" />
  210. </uni-forms-item>
  211. </uni-col>
  212. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  213. <uni-forms-item :label="t('Custom.Withdraw.bankCode')">
  214. <uni-easyinput disabled v-model="form.customBankCode" />
  215. </uni-forms-item>
  216. </uni-col>
  217. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  218. <uni-forms-item :label="t('Custom.Withdraw.bankAddr')">
  219. <uni-easyinput disabled v-model="form.bankAddr" />
  220. </uni-forms-item>
  221. </uni-col>
  222. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  223. <uni-forms-item label="Account Agency NO" name="agencyNo"
  224. v-if="channelData.code == 'PAY_RETAILER_REMIT_PAY_KEY_BRW'">
  225. <uni-easyinput v-model="form.agencyNo" />
  226. </uni-forms-item>
  227. <uni-forms-item label="Account Agency NO" v-else>
  228. <uni-easyinput v-model="form.agencyNo" />
  229. </uni-forms-item>
  230. </uni-col>
  231. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
  232. v-if="channelData.code == 'PAY_RETAILER_REMIT_PAY_KEY_BRW'">
  233. <uni-forms-item label="CPF" name="cpf">
  234. <uni-easyinput v-model="form.cpf" />
  235. </uni-forms-item>
  236. </uni-col>
  237. </template>
  238. <!-- 出金金额 -->
  239. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8" v-if="channelData.type !== 'BANK_TELEGRAPHIC'">
  240. <uni-forms-item :label="t('Custom.Withdraw.Title3') + '(' + channelData.currency + ')'" name="amount"
  241. :error-message="amountErrorMessage">
  242. <uni-easyinput v-model="form.amount" type="number" @blur="validateAmount" />
  243. </uni-forms-item>
  244. </uni-col>
  245. <template v-else>
  246. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  247. <uni-forms-item :label="t('Custom.Withdraw.CurrencyType')">
  248. <cwg-combox :clearable="false" v-model:value="form.currency"
  249. :options="[{ text: 'USD', value: 'USD' }]" @change="(val) => form.currency = val" />
  250. </uni-forms-item>
  251. </uni-col>
  252. <uni-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  253. <uni-forms-item :label="t('Custom.Withdraw.amount')" name="amount"
  254. :error-message="amountErrorMessage">
  255. <uni-easyinput v-model="form.amount" type="number" @blur="validateAmount" />
  256. </uni-forms-item>
  257. </uni-col>
  258. </template>
  259. </uni-row>
  260. <!-- 协议同意 -->
  261. <view class="agree">
  262. <uni-forms-item name="agree2">
  263. <checkbox-group :value="form.agree2 ? ['1'] : []" @change="onAgree2Change">
  264. <label class="checkbox">
  265. <checkbox value="1" :checked="form.agree2" />
  266. <text class="crm-cursor" style="text-decoration: underline;"
  267. @click.stop="dialogCheckTip = true">{{
  268. t('Custom.Withdraw.Des') }}</text>
  269. </label>
  270. </checkbox-group>
  271. </uni-forms-item>
  272. </view>
  273. <view class="agree" v-if="dialogTipsIsShow">
  274. <uni-forms-item name="agree3">
  275. <checkbox-group :value="form.agree3 ? ['1'] : []" @change="onAgree3Change">
  276. <label class="checkbox">
  277. <checkbox value="1" :checked="form.agree3" />
  278. <text>* {{ t('Custom.Withdraw.item1') }}<br>{{ t('Custom.Withdraw.item1_1') }}<br>{{
  279. t('Custom.Withdraw.item1_2') }}</text>
  280. </label>
  281. </checkbox-group>
  282. </uni-forms-item>
  283. </view>
  284. <button class="s-btn" type="primary" @click="openTips">{{ t('Btn.Submit') }}</button>
  285. </uni-forms>
  286. </view>
  287. </view>
  288. </view>
  289. <!-- 提示弹窗 -->
  290. <cwg-tips-popup v-model:visible="dialogTips" content="Custom.Withdraw.item2" @confirm="closeTipsConfirm" />
  291. <!-- 弹窗:确认信息 -->
  292. <cwg-check-confirm-popup v-model:visible="dialogCheckConfirm" :title="t('Home.page_customer.item3')"
  293. :channelData="channelData" :code="code" :selectCodes="selectCodes" :params="form" :FreeNumber="FreeNumber"
  294. :userName="userName" :dialogCheckConfirm_form="dialogCheckConfirm_form" :login="loginValue"
  295. :loginDoc="loginValueDoc" @confirm="submit" />
  296. <!-- 协议弹窗 -->
  297. <cwg-tips-popup v-model:visible="dialogCheckTip"
  298. :introduce="isZh.value ? introduce.introduce : introduce.enIntroduce" />
  299. <!-- 等待弹窗 -->
  300. <cwg-wait-popup v-model:visible="dialogCheckWait" type="center" :mask-click="false" :showFooters="false" />
  301. <!-- 最后失败弹窗 -->
  302. <cwg-error-popup v-model:visible="dialogError" @confirm="closeDia" :responseMessage="RES" />
  303. <!-- 最后成功弹窗 -->
  304. <cwg-success-popup v-model:visible="dialogSuccess" @confirm="closeDia" />
  305. <!-- kyc成功弹窗 -->
  306. <cwg-kyc-popup v-model:visible="dialogKyc" :qrText="text1" />
  307. <!--验证码-->
  308. <cwg-email-code-popup v-model:visible="dialogDealResult" @confirm="submitCode" :api="emailCodeApi" />
  309. <!-- 新增银行弹窗 -->
  310. <add-bank-dialog ref="addBankDialogRef" @success="addSuccess" />
  311. </view>
  312. </cwg-page-wrapper>
  313. </template>
  314. <script setup>
  315. import { ref, reactive, computed, onMounted, nextTick, watch, getCurrentInstance } from 'vue'
  316. import { onLoad } from '@dcloudio/uni-app'
  317. import { showToast } from "@/utils/toast";
  318. import { isAfterJuly28 } from '@/utils/dateUtils'
  319. // import Drawer from "@/views/global/Drawer"
  320. import { customApi } from "@/service/custom"
  321. import { financialApi } from "@/service/financial"
  322. import { activityApi } from "@/service/activity"
  323. import Config from "@/config/index"
  324. import Decimal from "decimal.js"
  325. import QrCode from "@/components/QRCode.vue"
  326. // import logoImage from "@/assets/images/MTBG.jpg"
  327. import AddBankDialog from '@/components/AddBankDialog.vue';
  328. import PaymentMethodsList from './components/PaymentMethodsList.vue'
  329. import CwgCheckConfirmPopup from './components/WithdrawCheckConfirmPopup.vue'
  330. import CwgKycPopup from './components/KycPopup.vue'
  331. let { Code, Host80 } = Config
  332. import { useI18n } from 'vue-i18n'
  333. const { t, locale } = useI18n()
  334. const isZh = computed(() => ['cn', 'zhHant'].includes(locale.value))
  335. // 获取组件实例,用于访问全局挂载的属性和方法(替代 this)
  336. const { proxy } = getCurrentInstance()
  337. // -------------------- data --------------------
  338. const loginValue = ref("")
  339. const loginValueDoc = ref("")
  340. const hiddenSelect = ref(false)
  341. const metaInfo = ref(null)
  342. const text1 = ref("")
  343. // const logoImageRef = logoImage
  344. const dialogCheck1 = ref(false)
  345. const flag = ref(false)
  346. const RES = ref("")
  347. //银行
  348. const openType = ref("") //弹出类别
  349. const dialogInfoTradingAdd = ref(false) //新增
  350. const ruleForm = reactive({
  351. bankInfo: [], //银行信息
  352. bankWrit: [], //电汇信息
  353. xykInfo: [], //信用卡信息
  354. bankBlockchain: [], //区块链
  355. })
  356. const imgUrl = Host80 //图片地址
  357. const loginOptions = ref([])
  358. const value = ref("") //账号
  359. const code = ref("") //通道code
  360. const bankValid = ref("") //通道是否有银行
  361. const requestUrl = ref("") //通道地址
  362. const isStep3 = ref(false)
  363. const step2 = ref(false)
  364. const step3 = ref(false)
  365. const dialogCheckTip = ref(false)
  366. const isChannel = ref(true)
  367. const pictLoading = ref(false)
  368. const tableData = reactive({
  369. Ucard_Wallet: [],
  370. Digital_Currency: [],
  371. China_UnionPay: [],
  372. Electronic_Wallet: [],
  373. International_Transfer: [],
  374. CHANNEL_TYPE_CARD: [],
  375. CHANNEL_TYPE_ALI_WALLET: [],
  376. }) //通道table-选择前后
  377. const bankDate = ref([]) //通道下的银行列表
  378. const channelData = ref({}) //当前选择的通道信息
  379. const WireTransferAccount = ref({}) //银行电汇信息
  380. //表单
  381. const form = reactive({
  382. currency: "USD",
  383. amount: "",
  384. amount1: "",
  385. bankCode: '', // 银行代码(普通银行通道选择)
  386. address: '', // 电子钱包地址 / 数字货币地址(输入/展示)
  387. addressName: '', // 数字货币地址名称(展示)
  388. addressProve: '', // 数字货币地址证明文件路径(仅展示))
  389. bankUname: '', // 持卡人姓名
  390. bankCardNum: '', // 银行卡号
  391. bankName: '', // 银行名称
  392. bankBranchName: '', // 支行名称
  393. swiftCode: '', // SWIFT代码
  394. customBankCode: '', // 自定义银行代码
  395. bankAddr: '', // 银行地址
  396. agencyNo: '', // 代理机构编号(电汇专用,可编辑)
  397. cpf: '', // CPF号码(电汇专用,可编辑)
  398. cvv: '', // CVV码(电汇专用,可编辑)
  399. expiryYearMonth: '', // 过期年(电汇专用,可编辑)
  400. agree2: false, // 协议勾选2
  401. agree3: false // 协议勾选3(当dialogTipsIsShow为true时显示)
  402. })
  403. const formRef = ref(null)
  404. const resetForm = () => {
  405. //表单重置后,需要手动重置一些状态
  406. form.amount = ""
  407. form.amount1 = ""
  408. form.bankCode = ""
  409. form.address = ""
  410. form.addressName = ""
  411. form.addressProve = ""
  412. form.bankUname = ""
  413. form.bankCardNum = ""
  414. form.swiftCode = ""
  415. form.customBankCode = ""
  416. form.bankAddr = ""
  417. form.agencyNo = ""
  418. form.bankName = ""
  419. form.cpf = ""
  420. form.bankBranchName = ""
  421. form.cpf = ""
  422. form.cvv = ""
  423. form.expiryYearMonth = ""
  424. form.agree2 = false
  425. form.agree3 = false
  426. amountErrorMessage.value = ""
  427. }
  428. //数量区间
  429. const mAmount = reactive({
  430. minAmount: "",
  431. maxAmount: "",
  432. })
  433. const introduce = reactive({
  434. introduce: "",
  435. enIntroduce: "",
  436. })
  437. //银行列表
  438. const bankInfoList = ref([])
  439. const bank = ref("")
  440. const myId = ref(null) //银行列表id
  441. const bankPayType = ref("") //临时放置通道code
  442. //银联/数字货币
  443. const step3_bank_cur = ref("")
  444. const agree2 = ref(false) //条款
  445. //数字表单
  446. const form1 = ref({})
  447. const dialogCheck = ref(false)
  448. const dialogKyc = ref(false)
  449. const dialogVisible = ref(false)
  450. const dialogCheckWait = ref(false)
  451. //新建银行弹窗
  452. const dialogNewBank = ref(false)
  453. const params = reactive({
  454. bankCardNum: "",
  455. bankUname: "",
  456. bankName: "",
  457. bankBranchName: "",
  458. bankAddr: "",
  459. swiftCode: "",
  460. bankFront: "",
  461. bankBack: "",
  462. defaultBank: false,
  463. })
  464. const dialogDealResult = ref(false)
  465. const emailCodeApi = ref(financialApi.withdrawCode)
  466. const dialogDealResult_form = reactive({
  467. emailCode: "", //数字货币出金,验证码
  468. })
  469. const dialogTips = ref(false) //提交时的确认弹窗
  470. const dialogTipsIsShow = ref(true) //提交时的确认弹窗-是否显示
  471. const dialogFreeNumber = ref(false) //可减免手续费用次数弹窗
  472. const FreeNumber = ref(0)
  473. const dialogCheckConfirm = ref(false)
  474. const dialogCheckConfirm_form = reactive({
  475. amount: "",
  476. feeAmount: "",
  477. })
  478. const tableDataNewYear24Flag = ref(false) //24新年庆典
  479. const tableDataNewYear24 = ref(false) //24新年庆典
  480. const NewYear24Data = reactive({
  481. balance: 0,
  482. income: 0,
  483. rate: 0,
  484. })
  485. const rules = computed(() => ({
  486. myId: {
  487. rules: [
  488. {
  489. required: true,
  490. errorMessage: t('vaildate.select.empty'),
  491. trigger: 'change',
  492. },
  493. ],
  494. },
  495. bankUname: {
  496. rules: [
  497. {
  498. required: true,
  499. errorMessage: t('vaildate.select.empty'),
  500. trigger: 'change',
  501. },
  502. ],
  503. },
  504. bankCode: {
  505. rules: [
  506. {
  507. required: true,
  508. errorMessage: t('vaildate.select.empty'),
  509. trigger: 'change',
  510. },
  511. ],
  512. },
  513. address: {
  514. rules: [
  515. {
  516. required: true,
  517. errorMessage: t('vaildate.input.empty'),
  518. trigger: 'blur',
  519. },
  520. ],
  521. },
  522. amount: {
  523. rules: [
  524. {
  525. required: true,
  526. errorMessage: t('vaildate.amount.format'),
  527. },
  528. {
  529. validateFunction: (rule, value, data, callback) => {
  530. if (
  531. !!value &&
  532. (mAmount.minAmount > value || mAmount.maxAmount < value)
  533. ) {
  534. callback(
  535. t('vaildate.amount.amount') +
  536. mAmount.minAmount +
  537. ' - ' +
  538. mAmount.maxAmount
  539. );
  540. return false;
  541. }
  542. if (/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
  543. return true;
  544. } else {
  545. callback(t('vaildate.amount.format'));
  546. return false;
  547. }
  548. },
  549. trigger: 'blur',
  550. },
  551. ],
  552. },
  553. agree2: {
  554. rules: [
  555. {
  556. validateFunction: (rule, value, data, callback) => {
  557. if (form.agree2) {
  558. return true;
  559. } else {
  560. callback(t('vaildate.agree.empty'));
  561. return false;
  562. }
  563. },
  564. trigger: 'change',
  565. },
  566. ],
  567. },
  568. agree3: {
  569. rules: [
  570. {
  571. validateFunction: (rule, value, data, callback) => {
  572. if (form.agree3) {
  573. return true;
  574. } else {
  575. callback(t('vaildate.agree.empty'));
  576. return false;
  577. }
  578. },
  579. trigger: 'change',
  580. },
  581. ],
  582. },
  583. agencyNo: {
  584. rules: [
  585. {
  586. required: true,
  587. errorMessage: t('vaildate.input.empty'),
  588. trigger: 'blur',
  589. },
  590. ],
  591. },
  592. cpf: {
  593. rules: [
  594. {
  595. required: true,
  596. errorMessage: t('vaildate.input.empty'),
  597. trigger: 'blur',
  598. },
  599. ],
  600. },
  601. emailCode: {
  602. rules: [
  603. {
  604. required: true,
  605. errorMessage: t('vaildate.code.empty'),
  606. trigger: 'blur',
  607. },
  608. ],
  609. },
  610. }));
  611. // 验证金额
  612. const amountErrorMessage = ref('')
  613. const validateAmount = () => {
  614. const amount = form.amount
  615. if (!amount && amount !== 0) {
  616. amountErrorMessage.value = t('vaildate.amount.format')
  617. return false
  618. }
  619. if (mAmount.minAmount && mAmount.maxAmount) {
  620. const min = Number(mAmount.minAmount);
  621. const max = Number(mAmount.maxAmount);
  622. const numValue = Number(amount);
  623. if (numValue < min || numValue > max) {
  624. amountErrorMessage.value = t('vaildate.amount.amount') + min + '-' + max
  625. return false
  626. }
  627. }
  628. if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(amount)) {
  629. amountErrorMessage.value = t('vaildate.amount.format')
  630. return false
  631. }
  632. amountErrorMessage.value = ''
  633. return true
  634. }
  635. // 分组标题映射
  636. const groupTitleMap = {
  637. 'Ucard_Wallet': 'card.title',
  638. 'Digital_Currency': 'Custom.Deposit.Channel3',
  639. 'China_UnionPay': 'Custom.Deposit.Channel2',
  640. 'Electronic_Wallet': 'Custom.Deposit.Channel4',
  641. 'International_Transfer': 'Custom.Deposit.Channel1',
  642. 'CHANNEL_TYPE_CARD': 'PersonalManagement.Label.CreditCard',
  643. 'CHANNEL_TYPE_ALI_WALLET': 'Label.Ali'
  644. }
  645. // -------------------- computed --------------------
  646. const getWalletLabel = computed(() => {
  647. if (channelData.value.type === 'CHANNEL_TYPE_WALLET') return t('Custom.Withdraw.Title7')
  648. if (channelData.value.type === 'UCARD_WALLET') return t('card.title')
  649. if (channelData.value.type === 'CHANNEL_TYPE_ALI_WALLET') return t('Label.AliAccout')
  650. return ''
  651. })
  652. // 最后确认
  653. const dialogSuccess = computed(() => dialogCheck.value && dialogVisible.value)
  654. // 最后失败
  655. const dialogError = computed(() => dialogCheck.value && !dialogVisible.value)
  656. const loginComboxOptions = computed(() => {
  657. return loginOptions.value.map((item, index) => ({
  658. text: item.label,
  659. value: item.login
  660. }))
  661. })
  662. const bankOptions = computed(() => {
  663. return bankDate.value.map((item, index) => ({
  664. text: isZh.value ? item.name : item.enName,
  665. value: item.code
  666. }))
  667. })
  668. const digitalOptions = computed(() => {
  669. return ruleForm.bankBlockchain.map((item, index) => ({
  670. text: `${item.addressName}-${item.address}`,
  671. value: item.id,
  672. disable: item.authStatus == 0,
  673. }))
  674. })
  675. const bankCardOptions = computed(() => {
  676. return bankList.value.map((item, index) => ({
  677. text: getBankLabel(item),
  678. value: item.id
  679. }))
  680. })
  681. const getBankLabel = (item) => {
  682. if (channelData.value.type === 'BANK' || channelData.value.type === 'BANK_TELEGRAPHIC') {
  683. return `${item.bankName}-${item.bankCardNum}`
  684. } else if (channelData.value.type === 'CHANNEL_TYPE_CARD') {
  685. return item.bankCardNum
  686. }
  687. return ''
  688. }
  689. const bankList = computed(() => {
  690. if (channelData.value.type === 'BANK') return ruleForm.bankInfo
  691. if (channelData.value.type === 'BANK_TELEGRAPHIC') return ruleForm.bankWrit
  692. if (channelData.value.type === 'CHANNEL_TYPE_CARD') return ruleForm.xykInfo
  693. if (channelData.value.type === 'DIGITAL_CURRENCY') return ruleForm.bankBlockchain
  694. return []
  695. })
  696. const isFree = computed(() => {
  697. let flag = false;
  698. let startTime1 = "2024/11/01 00:00:00";
  699. let timezone = 2; //目标时区时间,东3区 东时区正数 西市区负数
  700. let offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
  701. let nowDate = new Date().getTime(); // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
  702. let now = new Date(
  703. nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000
  704. ).getTime();
  705. let start = new Date(startTime1).getTime();
  706. if (now > start) {
  707. flag = true;
  708. }
  709. return flag;
  710. })
  711. // -------------------- methods --------------------
  712. const groupCurrency = (type) => {
  713. const symbol = { GBP: '£', USD: '$', EUR: '€', USC: '¢' }[type] || '$'
  714. return `: ${symbol}`
  715. }
  716. const groupCurrency1 = (type) => {
  717. const symbol = { GBP: '£', USD: '$', EUR: '€', USC: '¢' }[type] || '$'
  718. return `${symbol}`
  719. }
  720. function groupTypeName(type) {
  721. if (type == "1") {
  722. return t("AccountType.ClassicAccount");
  723. } else if (type == "2") {
  724. return t("AccountType.SeniorAccount");
  725. } else if (type == "3") {
  726. return isAfterJuly28() ? "--" : t("AccountType.AgencyAccount");
  727. } else if (type == "5") {
  728. return t("AccountType.SpeedAccount");
  729. } else if (type == "6") {
  730. return t("AccountType.SpeedAccount");
  731. } else if (type == "7") {
  732. return t("AccountType.StandardAccount");
  733. } else if (type == "8") {
  734. return t("AccountType.CentAccount");
  735. }
  736. }
  737. //回显
  738. const onAgree3Change = (e) => {
  739. form.agree3 = e.detail.value.length > 0
  740. }
  741. const onAgree2Change = (e) => {
  742. form.agree2 = e.detail.value.length > 0
  743. }
  744. function selectChange() {
  745. // proxy.$forceUpdate();
  746. }
  747. //新增
  748. // function openAddBankCard(type) {
  749. // if (type == "add_bankCard") {
  750. // if (ruleForm.bankInfo.length == 2) {
  751. // proxy.$pigeon.MessageConfirm(
  752. // t("Msg.UnionPayCARDS"),
  753. // t("Msg.SystemPrompt"),
  754. // t("Btn.Confirm"),
  755. // t("Btn.Cancel"),
  756. // async function () { },
  757. // function () { }
  758. // );
  759. // } else {
  760. // openType.value = "add_bankCard";
  761. // dialogInfoTradingAdd.value = true;
  762. // }
  763. // } else if (type == "add_wireTransfer") {
  764. // if (ruleForm.bankWrit.length == 2) {
  765. // proxy.$pigeon.MessageConfirm(
  766. // t("Msg.WireTransfers"),
  767. // t("Msg.SystemPrompt"),
  768. // t("Btn.Confirm"),
  769. // t("Btn.Cancel"),
  770. // async function () { },
  771. // function () { }
  772. // );
  773. // } else {
  774. // openType.value = "add_wireTransfer";
  775. // dialogInfoTradingAdd.value = true;
  776. // }
  777. // } else if (type == "add_CreditCard") {
  778. // openType.value = "add_CreditCard";
  779. // dialogInfoTradingAdd.value = true;
  780. // } else if (type == "add_bankBlockchain") {
  781. // if (ruleForm.bankBlockchain.length == 2) {
  782. // proxy.$pigeon.MessageConfirm(
  783. // t("blockchain.item9"),
  784. // t("Msg.SystemPrompt"),
  785. // t("Btn.Confirm"),
  786. // t("Btn.Cancel"),
  787. // async function () { },
  788. // function () { }
  789. // );
  790. // } else {
  791. // openType.value = "add_bankBlockchain";
  792. // dialogInfoTradingAdd.value = true;
  793. // }
  794. // }
  795. // }
  796. // 新增银行信息
  797. const addBankDialogRef = ref(null);
  798. function openAddBankCard(type) {
  799. console.log(type, 121212)
  800. switch (type) {
  801. case 'add_bankBlockchain':
  802. openAddCrypto()
  803. break;
  804. case 'add_bankCard':
  805. openAddUnionpay()
  806. break;
  807. case 'add_wireTransfer':
  808. openAddBank()
  809. break;
  810. case 'add_CreditCard':
  811. openAddCredit()
  812. break;
  813. }
  814. }
  815. function openAddCrypto() {
  816. const wallets = bankCardOptions.value || []
  817. // 1️⃣ 没有钱包
  818. if (wallets.length === 0) {
  819. addBankDialogRef.value?.open(4);
  820. return;
  821. }
  822. // 2️⃣ 是否存在未认证钱包
  823. const hasUnAuth = wallets.some(
  824. item => item.authStatus === 0 || item.approveStatus === 1
  825. );
  826. if (hasUnAuth) {
  827. uni.showToast({
  828. title: "加密钱包未认证",
  829. icon: "none"
  830. });
  831. return;
  832. }
  833. // 3️⃣ 是否达到上限
  834. if (wallets.length >= 2) {
  835. uni.showToast({
  836. title: t('blockchain.item9'),
  837. icon: "none"
  838. });
  839. return;
  840. }
  841. // 4️⃣ 正常打开
  842. addBankDialogRef.value?.open(4);
  843. }
  844. function openAddUnionpay() {
  845. const wallets = bankCardOptions.value || []
  846. if (wallets.length === 0) {
  847. addBankDialogRef.value?.open(1);
  848. return;
  849. }
  850. if (wallets.length >= 2) {
  851. uni.showToast({
  852. title: t('Msg.UnionPayCARDS'),
  853. icon: "none"
  854. });
  855. return;
  856. }
  857. addBankDialogRef.value?.open(1);
  858. }
  859. function openAddBank() {
  860. const wallets = bankCardOptions.value || []
  861. if (wallets.length === 0) {
  862. addBankDialogRef.value?.open(2);
  863. return;
  864. }
  865. if (wallets.length >= 2) {
  866. uni.showToast({
  867. title: t('Msg.WireTransfers'),
  868. icon: "none"
  869. });
  870. return;
  871. }
  872. addBankDialogRef.value?.open(2);
  873. }
  874. function openAddCredit() {
  875. const wallets = bankCardOptions.value || []
  876. if (wallets.length === 0) {
  877. addBankDialogRef.value?.open(3);
  878. return;
  879. }
  880. addBankDialogRef.value?.open(3);
  881. }
  882. // 新增银行信息成功回调
  883. const addSuccess = (e) => {
  884. getBankInfo();
  885. }
  886. function closeDiaAdd() {
  887. dialogInfoTradingAdd.value = false;
  888. }
  889. function closeAdd(val) {
  890. dialogInfoTradingAdd.value = val;
  891. }
  892. function confirmToReload() {
  893. dialogInfoTradingAdd.value = false;
  894. getBankInfo();
  895. }
  896. const getBankInfo = async () => {
  897. const res = await financialApi.customBankList({})
  898. if (res.code === Code.StatusOK) {
  899. ruleForm.bankInfo = []
  900. ruleForm.bankWrit = []
  901. ruleForm.xykInfo = []
  902. ruleForm.bankBlockchain = []
  903. res.data.forEach(item => {
  904. item.customBankCode = item.bankCode
  905. item.bankCode = null
  906. if (item.type === 1) ruleForm.bankInfo.push(item)
  907. else if (item.type === 2) ruleForm.bankWrit.push(item)
  908. else if (item.type === 3) {
  909. item.expiryYearMonth = `${item.expiryYear}/${item.expiryMonth}`
  910. ruleForm.xykInfo.push(item)
  911. } else if (item.type === 4) ruleForm.bankBlockchain.push(item)
  912. })
  913. // 如果有默认选中
  914. const findDefault = (list, type) => list.find(b => b.defaultBank && b.type === type)
  915. const defaultBank = findDefault(ruleForm.bankInfo, 1)
  916. const defaultWire = findDefault(ruleForm.bankWrit, 2)
  917. const defaultCard = findDefault(ruleForm.xykInfo, 3)
  918. const defaultDigital = findDefault(ruleForm.bankBlockchain, 4)
  919. if (channelData.value.type === 'BANK' && defaultBank) selectBankCard(defaultBank)
  920. if (channelData.value.type === 'BANK_TELEGRAPHIC' && defaultWire) selectBankCard(defaultWire)
  921. if (channelData.value.type === 'CHANNEL_TYPE_CARD' && defaultCard) selectBankCard(defaultCard)
  922. if (channelData.value.type === 'DIGITAL_CURRENCY' && defaultDigital && defaultDigital.authStatus === 1) selectDigital(defaultDigital)
  923. } else {
  924. uni.showToast({ title: res.msg, icon: 'none' })
  925. }
  926. }
  927. const selectBankCard = (item) => {
  928. const index = bankList.value.findIndex(b => b.id === item.id)
  929. if (index !== -1) {
  930. myId.value = item.id
  931. nextTick(() => {
  932. Object.assign(form, item)
  933. })
  934. }
  935. }
  936. const selectDigital = (item) => {
  937. const index = ruleForm.bankBlockchain.findIndex(b => b.id === item.id)
  938. if (index !== -1) {
  939. selectedDigitalIndex.value = item.id
  940. form.addressName = item.addressName
  941. form.address = item.address
  942. form.addressProve = item.addressProve
  943. }
  944. }
  945. const onDigitalCurrencyChange = (val) => {
  946. const item = ruleForm.bankBlockchain.find(b => b.id === val)
  947. chooseBank(item.id)
  948. }
  949. function chooseBank(id) {
  950. const item = bankList.value.find(b => b.id === id)
  951. if (channelData.value.type == "DIGITAL_CURRENCY") {
  952. if (item.authStatus == 0) {
  953. showToast(t("Msg.item11"));
  954. return;
  955. }
  956. }
  957. let codeTmp = "";
  958. if (form.bankCode) {
  959. codeTmp = form.bankCode;
  960. }
  961. Object.assign(form, item);
  962. form.agree2 = false;
  963. form.agree3 = false;
  964. if (channelData.value.type == "BANK_TELEGRAPHIC") {
  965. form.currency = "USD";
  966. if (codeTmp) {
  967. form.bankCode = codeTmp;
  968. }
  969. }
  970. }
  971. function selectCode(codeVal) {
  972. bankDate.value.forEach((item) => {
  973. if (item.code == codeVal) {
  974. // item.rate = 1
  975. // mAmount.minAmount = item.minAmount || mAmount.minAmount;
  976. // mAmount.maxAmount = item.maxAmount || mAmount.maxAmount;
  977. channelData.value.rate = item.rate || channelData.value.rate;
  978. channelData.value.transformCurrency =
  979. item.currency || channelData.value.transformCurrency;
  980. channelData.value.feeTypeBank = item.feeType || null;
  981. channelData.value.freeBank = item.free || 0;
  982. channelData.value.feeAmountBank = item.feeAmount || null;
  983. }
  984. });
  985. }
  986. //关闭提交后的弹出框
  987. function closeDia() {
  988. resetForm()
  989. isStep3.value = false;
  990. step2.value = false;
  991. showTable();
  992. loginValue.value = "";
  993. dialogCheck.value = false;
  994. dialogVisible.value = false;
  995. }
  996. //取消
  997. function cancelCode() {
  998. dialogDealResult.value = false;
  999. }
  1000. //提交前弹窗确认
  1001. async function openTips() {
  1002. if (channelData.value.type == "BANK_TELEGRAPHIC" && !myId.value) {
  1003. showToast(t("vaildate.withdrawBank.empty"));
  1004. return;
  1005. }
  1006. if (channelData.value.type == "BANK" && !myId.value) {
  1007. showToast(t("vaildate.withdrawBank.empty"));
  1008. return;
  1009. }
  1010. if (channelData.value.type == "CHANNEL_TYPE_CARD" && !myId.value) {
  1011. showToast(t("vaildate.withdrawBank.empty"));
  1012. return;
  1013. }
  1014. if (channelData.value.type == "DIGITAL_CURRENCY" && !myId.value) {
  1015. showToast(t("blockchain.item11"));
  1016. return;
  1017. }
  1018. try {
  1019. if (formRef.value) {
  1020. const valid = await formRef.value.validate()
  1021. console.log(valid, 1212);
  1022. if (dialogTipsIsShow.value) {
  1023. dialogTips.value = true;
  1024. } else {
  1025. submit("form");
  1026. }
  1027. }
  1028. } catch (error) {
  1029. if (error instanceof Array) {
  1030. showToast(error[0].errorMessage);
  1031. return
  1032. } else {
  1033. RES.value = error.msg;
  1034. }
  1035. }
  1036. }
  1037. // 提示同意提交出金
  1038. function closeTipsConfirm() {
  1039. if (isFree.value) {
  1040. dialogTips.value = false;
  1041. if (channelData.value.feeTypeBank) {
  1042. if (channelData.value.feeTypeBank == 1) {
  1043. dialogCheckConfirm_form.feeAmount =
  1044. Number(form.amount || 0) *
  1045. (Number(channelData.value.freeBank || 0) / 100);
  1046. } else if (channelData.value.feeTypeBank == 2) {
  1047. dialogCheckConfirm_form.feeAmount = Number(
  1048. channelData.value.feeAmountBank || 0
  1049. );
  1050. }
  1051. } else {
  1052. if (channelData.value.feeType == 1) {
  1053. dialogCheckConfirm_form.feeAmount =
  1054. Number(form.amount || 0) *
  1055. (Number(channelData.value.free || 0) / 100);
  1056. } else if (channelData.value.feeType == 2) {
  1057. dialogCheckConfirm_form.feeAmount = Number(
  1058. channelData.value.feeAmount || 0
  1059. );
  1060. }
  1061. }
  1062. if (FreeNumber.value > 0) {
  1063. dialogCheckConfirm_form.amount = new Decimal(
  1064. Number(form.amount || 0)
  1065. )
  1066. .mul(new Decimal(Number(channelData.value.rate || 0)))
  1067. .toNumber();
  1068. } else {
  1069. dialogCheckConfirm_form.amount = new Decimal(
  1070. Number(form.amount || 0)
  1071. )
  1072. .sub(
  1073. new Decimal(Number(dialogCheckConfirm_form.feeAmount || 0))
  1074. )
  1075. .mul(new Decimal(Number(channelData.value.rate || 0)))
  1076. .toNumber();
  1077. }
  1078. if (
  1079. ["CNY", "THB", "VND"].indexOf(channelData.value.transformCurrency) > -1
  1080. ) {
  1081. dialogCheckConfirm_form.feeAmount = parseInt(
  1082. dialogCheckConfirm_form.feeAmount
  1083. );
  1084. dialogCheckConfirm_form.amount = parseInt(
  1085. dialogCheckConfirm_form.amount
  1086. );
  1087. }
  1088. dialogCheckConfirm.value = true;
  1089. } else {
  1090. dialogTips.value = false;
  1091. submit("form");
  1092. }
  1093. }
  1094. function getMetaInfo() {
  1095. metaInfo.value = window.getMetaInfo();
  1096. metaInfo.value = { ...metaInfo.value, deviceType: "h5" };
  1097. }
  1098. async function qrCode(serial) {
  1099. // if (getInfoStatus.kycType == 3) {
  1100. // getMetaInfo();
  1101. // }
  1102. getMetaInfo()
  1103. let res = await customApi.getWebsdkLink({
  1104. serial,
  1105. metaInfo: metaInfo.value,
  1106. });
  1107. if (res.code == Code.StatusOK) {
  1108. text1.value = JSON.parse(res.data).url;
  1109. dialogKyc.value = true;
  1110. flag.value = false;
  1111. } else {
  1112. flag.value = false;
  1113. }
  1114. }
  1115. const submitCode = async (code) => {
  1116. if (channelData.value.type == "DIGITAL_CURRENCY") {
  1117. dialogDealResult_form.emailCode = code;
  1118. submit("form");
  1119. }
  1120. }
  1121. //提交
  1122. async function submit(formName) {
  1123. if (channelData.value.type == "BANK_TELEGRAPHIC" && !myId.value) {
  1124. showToast(t("vaildate.withdrawBank.empty"));
  1125. return;
  1126. }
  1127. if (channelData.value.type == "BANK" && !myId.value) {
  1128. showToast(t("vaildate.withdrawBank.empty"));
  1129. return;
  1130. }
  1131. if (channelData.value.type == "CHANNEL_TYPE_CARD" && !myId.value) {
  1132. showToast(t("vaildate.withdrawBank.empty"));
  1133. return;
  1134. }
  1135. if (channelData.value.type == "DIGITAL_CURRENCY" && !myId.value) {
  1136. showToast(t("blockchain.item11"));
  1137. return;
  1138. }
  1139. try {
  1140. if (formRef.value) {
  1141. await formRef.value.validate()
  1142. if (
  1143. channelData.value.type == "DIGITAL_CURRENCY" &&
  1144. !dialogDealResult_form.emailCode
  1145. ) {
  1146. // let res = await financialApi.withdrawCode({});
  1147. // if (res.code == Code.StatusOK) {
  1148. // dialogDealResult = true;
  1149. // } else {
  1150. // $pigeon.MessageWarning(res.msg);
  1151. // }
  1152. dialogDealResult.value = true;
  1153. return;
  1154. }
  1155. // 检查活动参与情况
  1156. // let selectedAccount = loginOptions.find(item => item.login === value);
  1157. // if (selectedAccount) {
  1158. // let activityRes = await activityApi.ActivityGiveLoginParticipate({
  1159. // login: value,
  1160. // platform: selectedAccount.platform,
  1161. // amount: form.amount
  1162. // });
  1163. //
  1164. // if (activityRes.code == Code.StatusOK && activityRes.data === false) {
  1165. // // 使用 Promise 包装确认对话框,等待用户选择
  1166. // try {
  1167. // await new Promise((resolve, reject) => {
  1168. // $pigeon.MessageConfirm(
  1169. // "您参加的活动正在进行中,发起申请后结束活动",
  1170. // $i18n.t("Msg.SystemPrompt"),
  1171. // $i18n.t("Btn.Confirm"),
  1172. // $i18n.t("Btn.Cancel"),
  1173. // () => {
  1174. // resolve(); // 确认时继续执行
  1175. // },
  1176. // () => {
  1177. // reject(); // 取消时阻止执行
  1178. // }
  1179. // );
  1180. // });
  1181. // } catch {
  1182. // return; // 用户点击取消,阻止执行
  1183. // }
  1184. // }
  1185. // }
  1186. if (flag.value) {
  1187. return;
  1188. } else {
  1189. flag.value = true;
  1190. }
  1191. dialogCheckWait.value = true;
  1192. if (channelData.value.type == "DIGITAL_CURRENCY") {
  1193. let res = await financialApi.WithdrawAapplyDigitalCurrency(
  1194. channelData.value.requestUrl,
  1195. {
  1196. login: loginValue.value,
  1197. payType: channelData.value.code,
  1198. emailCode: dialogDealResult_form.emailCode,
  1199. ...form,
  1200. }
  1201. );
  1202. if (res.code == Code.StatusOK) {
  1203. flag.value = false;
  1204. dialogCheck.value = true;
  1205. dialogVisible.value = true;
  1206. // qrCode(res.data)
  1207. } else {
  1208. RES.value = res.msg;
  1209. dialogCheck.value = true;
  1210. dialogVisible.value = false;
  1211. flag.value = false;
  1212. }
  1213. cancelCode();
  1214. } else if (
  1215. channelData.value.type == "CHANNEL_TYPE_WALLET" ||
  1216. channelData.value.type == "UCARD_WALLET" ||
  1217. channelData.value.type == "CHANNEL_TYPE_ALI_WALLET"
  1218. ) {
  1219. let res = await financialApi.WithdrawAapplyDigitalCurrency(
  1220. channelData.value.requestUrl,
  1221. {
  1222. login: loginValue.value,
  1223. payType: channelData.value.code,
  1224. ...form,
  1225. }
  1226. );
  1227. if (res.code == Code.StatusOK) {
  1228. flag.value = false;
  1229. dialogCheck.value = true;
  1230. dialogVisible.value = true;
  1231. // qrCode(res.data)
  1232. } else {
  1233. RES.value = res.msg;
  1234. dialogCheck.value = true;
  1235. dialogVisible.value = false;
  1236. flag.value = false;
  1237. }
  1238. console.log(res, 'res', RES.value);
  1239. } else if (channelData.value.type == "BANK") {
  1240. let res = await financialApi.WithdrawApplyBank(
  1241. channelData.value.requestUrl,
  1242. {
  1243. login: loginValue.value,
  1244. payType: channelData.value.code,
  1245. ...form,
  1246. }
  1247. );
  1248. if (res.code == Code.StatusOK) {
  1249. flag.value = false;
  1250. dialogCheck.value = true;
  1251. dialogVisible.value = true;
  1252. // qrCode(res.data)
  1253. } else {
  1254. RES.value = res.msg;
  1255. dialogCheck.value = true;
  1256. dialogVisible.value = false;
  1257. flag.value = false;
  1258. }
  1259. } else if (channelData.value.type == "BANK_TELEGRAPHIC") {
  1260. let res = await financialApi.WithdrawApplyBank(
  1261. channelData.value.requestUrl,
  1262. {
  1263. login: loginValue.value,
  1264. payType: channelData.value.code,
  1265. ...form,
  1266. }
  1267. );
  1268. if (res.code == Code.StatusOK) {
  1269. flag.value = false;
  1270. dialogCheck.value = true;
  1271. dialogVisible.value = true;
  1272. // qrCode(res.data)
  1273. } else {
  1274. RES.value = res.msg;
  1275. dialogCheck.value = true;
  1276. dialogVisible.value = false;
  1277. flag.value = false;
  1278. }
  1279. } else if (channelData.value.type == "CHANNEL_TYPE_CARD") {
  1280. let res = await financialApi.WithdrawApplyBank(
  1281. channelData.value.requestUrl,
  1282. {
  1283. login: loginValue.value,
  1284. payType: channelData.value.code,
  1285. ...form,
  1286. }
  1287. );
  1288. if (res.code == Code.StatusOK) {
  1289. flag.value = false;
  1290. dialogCheck.value = true;
  1291. dialogVisible.value = true;
  1292. // qrCode(res.data)
  1293. } else {
  1294. RES.value = res.msg;
  1295. dialogCheck.value = true;
  1296. dialogVisible.value = false;
  1297. flag.value = false;
  1298. }
  1299. }
  1300. dialogCheckWait.value = false;
  1301. }
  1302. } catch (error) {
  1303. if (error instanceof Array) {
  1304. showToast(error[0].errorMessage);
  1305. return
  1306. } else {
  1307. RES.value = error.msg;
  1308. dialogCheck.value = true;
  1309. dialogCheckWait.value = false;
  1310. dialogVisible.value = false;
  1311. flag.value = false;
  1312. }
  1313. }
  1314. }
  1315. //初始化
  1316. function Initialize() {
  1317. loginValue.value = "";
  1318. isStep3.value = false;
  1319. step2.value = false;
  1320. step3.value = false;
  1321. showTable();
  1322. }
  1323. //手续费减免次数接口
  1324. async function getFreeNumber() {
  1325. if (!isFree.value) {
  1326. return;
  1327. }
  1328. dialogFreeNumber.value = true;
  1329. let res = await financialApi.remainingReductionNumber({});
  1330. if (res.code == Code.StatusOK) {
  1331. FreeNumber.value = res.data || 0;
  1332. } else {
  1333. showToast(res.msg);
  1334. }
  1335. }
  1336. function toShop() {
  1337. // $router.push({ path: "/shop/home" }).catch((arr) => arr);
  1338. // uni-app 中可能需要使用 uni.navigateTo,此处保留原逻辑但注释掉,因为原代码是 Vue Router
  1339. // 若需要可以改为 uni.navigateTo
  1340. }
  1341. //选择支付方式
  1342. function isShowStep3(row) {
  1343. console.log(row, 222);
  1344. dialogCheckWait.value = false;
  1345. dialogVisible.value = false;
  1346. flag.value = false;
  1347. //判断是否有bank
  1348. if (row.bankValid && isChannel.value) {
  1349. getBankList(row);
  1350. isChannel.value = false;
  1351. step3.value = true;
  1352. channelData.value = row;
  1353. mAmount.minAmount = row.minAmount;
  1354. mAmount.maxAmount = row.maxAmount;
  1355. } else {
  1356. step3.value = true;
  1357. bankDate.value = [];
  1358. channelData.value = row;
  1359. mAmount.minAmount = row.minAmount;
  1360. mAmount.maxAmount = row.maxAmount;
  1361. }
  1362. if (row.code == "UNION_PAY_TELEGRAPHIC") {
  1363. WireTransferAccount.value = JSON.parse(row.property);
  1364. }
  1365. if (['BANK', 'BANK_TELEGRAPHIC', 'CHANNEL_TYPE_CARD', 'DIGITAL_CURRENCY'].includes(row.type)) {
  1366. getBankInfo();
  1367. step3_bank_cur.value = "bank";
  1368. form.login = loginValue.value;
  1369. form.payType = row.code;
  1370. bankPayType.value = row.code;
  1371. }
  1372. tableData.Ucard_Wallet = []
  1373. tableData.Digital_Currency = []
  1374. tableData.China_UnionPay = []
  1375. tableData.Electronic_Wallet = []
  1376. tableData.International_Transfer = []
  1377. tableData.CHANNEL_TYPE_CARD = []
  1378. tableData.CHANNEL_TYPE_ALI_WALLET = []
  1379. if (row.type === 'UCARD_WALLET') tableData.Ucard_Wallet = [row]
  1380. if (row.type === 'DIGITAL_CURRENCY') tableData.Digital_Currency = [row]
  1381. if (row.type === 'BANK') tableData.China_UnionPay = [row]
  1382. if (row.type === 'CHANNEL_TYPE_WALLET') tableData.Electronic_Wallet = [row]
  1383. if (row.type === 'BANK_TELEGRAPHIC') tableData.International_Transfer = [row]
  1384. if (row.type === 'CHANNEL_TYPE_CARD') tableData.CHANNEL_TYPE_CARD = [row]
  1385. if (row.type === 'CHANNEL_TYPE_ALI_WALLET') tableData.CHANNEL_TYPE_ALI_WALLET = [row]
  1386. introduce.introduce = row.introduce
  1387. introduce.enIntroduce = row.enIntroduce
  1388. }
  1389. //更换支付方式
  1390. function showTable() {
  1391. resetForm()
  1392. myId.value = null;
  1393. step3.value = false;
  1394. isStep3.value = false;
  1395. isChannel.value = true;
  1396. getDepositList();
  1397. form.currency = "USD";
  1398. }
  1399. //获取账户信息
  1400. async function getDateList() {
  1401. let res = await customApi.CustomDropdown({ platform: "" });
  1402. if (res.code == Code.StatusOK) {
  1403. loginOptions.value = res.data.map(item => ({
  1404. ...item,
  1405. label: `${item.login} - ${groupTypeName(item.type)} - ${t('Custom.Deposit.AvailableBalance')}${groupCurrency(item.currency)}${item.balance}`
  1406. }))
  1407. const route = getCurrentPages().pop().$page.options
  1408. if (route.login) {
  1409. const found = loginOptions.value.find(opt => opt.login === Number(route.login))
  1410. loginValue.value = found.login
  1411. loginValueDoc.value = found.label
  1412. step2.value = true;
  1413. // showTable();
  1414. }
  1415. } else {
  1416. showToast(res.msg);
  1417. }
  1418. }
  1419. //获取出金通道
  1420. async function getDepositList() {
  1421. pictLoading.value = true;
  1422. tableData.Ucard_Wallet = [];
  1423. tableData.Digital_Currency = [];
  1424. tableData.China_UnionPay = [];
  1425. tableData.Electronic_Wallet = [];
  1426. tableData.International_Transfer = [];
  1427. tableData.CHANNEL_TYPE_CARD = [];
  1428. tableData.CHANNEL_TYPE_ALI_WALLET = [];
  1429. let res = await financialApi.RemitChannelList({});
  1430. if (res.code == Code.StatusOK) {
  1431. res.data.forEach(item => {
  1432. if (item.type === 'UCARD_WALLET') tableData.Ucard_Wallet.push(item)
  1433. if (item.type === 'DIGITAL_CURRENCY') tableData.Digital_Currency.push(item)
  1434. if (item.type === 'BANK') tableData.China_UnionPay.push(item)
  1435. if (item.type === 'CHANNEL_TYPE_WALLET') tableData.Electronic_Wallet.push(item)
  1436. if (item.type === 'BANK_TELEGRAPHIC') tableData.International_Transfer.push(item)
  1437. if (item.type === 'CHANNEL_TYPE_CARD') tableData.CHANNEL_TYPE_CARD.push(item)
  1438. if (item.type === 'CHANNEL_TYPE_ALI_WALLET') tableData.CHANNEL_TYPE_ALI_WALLET.push(item)
  1439. })
  1440. pictLoading.value = false;
  1441. } else {
  1442. showToast(res.msg);
  1443. pictLoading.value = false;
  1444. }
  1445. }
  1446. //获取出金通道银行列表
  1447. async function getBankList(row) {
  1448. let res = await financialApi.BankList({
  1449. channelCode: row.code,
  1450. });
  1451. if (res.code == Code.StatusOK) {
  1452. let bank = res.data;
  1453. let data = [];
  1454. bank.forEach((j) => {
  1455. if (!j.minAmount && j.minAmount != 0) {
  1456. j.minAmount = row.minAmount;
  1457. }
  1458. if (!j.maxAmount && j.maxAmount != 0) {
  1459. j.maxAmount = row.maxAmount;
  1460. }
  1461. j.payType = row.code;
  1462. data.push(j);
  1463. });
  1464. bankDate.value = data;
  1465. } else {
  1466. showToast(res.msg);
  1467. }
  1468. }
  1469. //取消
  1470. function cancelBank() {
  1471. dialogNewBank.value = false;
  1472. }
  1473. //24新年庆典
  1474. //是否到期-2023-11-25 00:00:00-2023-12-31 23:59:59
  1475. function isNewYear24Open() {
  1476. let endTime1 = "2025/3/31 23:59:59";
  1477. let startTime1 = "2025/1/1 00:00:00";
  1478. let timezone = 2; //目标时区时间,东3区 东时区正数 西市区负数
  1479. let offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
  1480. let nowDate = new Date().getTime(); // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
  1481. let now = new Date(
  1482. nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000
  1483. ).getTime();
  1484. let end = new Date(endTime1).getTime();
  1485. let start = new Date(startTime1).getTime();
  1486. if (now < end && start < now) {
  1487. ActivityNewYear24();
  1488. }
  1489. }
  1490. async function ActivityNewYear24() {
  1491. let res = await activityApi.ActivityNewYear24({});
  1492. if (res.code == Code.StatusOK) {
  1493. tableDataNewYear24.value = res.data;
  1494. if (typeof tableDataNewYear24.value == "object") {
  1495. toIncome();
  1496. }
  1497. } else {
  1498. showToast(res.msg);
  1499. }
  1500. }
  1501. function toIncome() {
  1502. NewYear24Data.balance = Number(tableDataNewYear24.value.balance) || 0;
  1503. // let rate = 0;
  1504. tableDataNewYear24.value.details.forEach((item) => {
  1505. if (
  1506. NewYear24Data.balance > item.min &&
  1507. NewYear24Data.balance <= item.max
  1508. ) {
  1509. NewYear24Data.rate = item.rate;
  1510. } else if (
  1511. NewYear24Data.balance > item.min &&
  1512. NewYear24Data.balance >= item.max &&
  1513. item.max == 0
  1514. ) {
  1515. NewYear24Data.rate = item.rate;
  1516. }
  1517. });
  1518. // console.log(NewYear24Data);
  1519. NewYear24Data.income = (
  1520. ((NewYear24Data.balance * NewYear24Data.rate) / 100 / 365) *
  1521. NewYear24RemainingTime()
  1522. ).toFixed(2);
  1523. tableDataNewYear24Flag.value = true;
  1524. }
  1525. function NewYear24RemainingTime() {
  1526. // let endTime1 = '2025/3/31 23:59:59';
  1527. // let startTime1 = '2025/1/1 00:00:00';
  1528. let timezone = 2; //目标时区时间,东3区 东时区正数 西市区负数
  1529. let offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
  1530. let nowDate = new Date().getTime(); // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
  1531. let now = new Date(
  1532. nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000
  1533. ).getTime();
  1534. // 获取当前月份的最后一天
  1535. let lastDayOfMonth = getFirstDayOfNextMonth();
  1536. // console.log(lastDayOfMonth);
  1537. let end = new Date(lastDayOfMonth).getTime();
  1538. // let now = new Date('2025/1/31 21:59:59').getTime();
  1539. // let end = new Date('2025/1/31 23:59:59').getTime();
  1540. let time = (end - now) / 60 / 60 / 1000 / 24;
  1541. time = Math.ceil(time);
  1542. return time;
  1543. }
  1544. function getFirstDayOfNextMonth() {
  1545. let timezone = 2; //目标时区时间,东3区 东时区正数 西市区负数
  1546. let offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
  1547. let nowDate = new Date().getTime(); // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
  1548. let now = new Date(
  1549. nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000
  1550. );
  1551. let lastDayOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0);
  1552. // console.log(lastDayOfMonth);
  1553. return lastDayOfMonth;
  1554. // const nextMonth = now.getMonth() + 1; // 当前月份加1
  1555. // const nextYear = now.getFullYear(); // 获取当前年份
  1556. // // 如果下个月大于11(即12月),年份需要增加1
  1557. // if (nextMonth > 11) {
  1558. // return new Date(nextYear + 1, 0, 1); // 下一年的1月1日
  1559. // } else {
  1560. // return new Date(nextYear, nextMonth, 1); // 下个月的1日
  1561. // }
  1562. }
  1563. // -------------------- watch --------------------
  1564. watch(loginValue, (newVal) => {
  1565. if (newVal) {
  1566. step2.value = true;
  1567. const found = loginOptions.value.find(opt => opt.login === Number(newVal))
  1568. loginValueDoc.value = found.label
  1569. showTable();
  1570. }
  1571. });
  1572. watch(isStep3, async (newVal) => {
  1573. if (newVal) {
  1574. await nextTick();
  1575. formRef.value?.clearValidate(); // 先清除旧错误
  1576. await nextTick();
  1577. formRef.value?.clearValidate(); // 再次清除可能因数据重置产生的新错误
  1578. }
  1579. });
  1580. watch(() => form.amount, (newVal) => {
  1581. if (newVal && channelData.value.rate) {
  1582. // form.amount1 = (newVal * channelData.rate).toFixed(2);
  1583. if (isFree.value) {
  1584. let feeAmount = 0;
  1585. if (channelData.value.feeTypeBank) {
  1586. if (channelData.value.feeTypeBank == 1) {
  1587. feeAmount =
  1588. Number(newVal || 0) *
  1589. (Number(channelData.value.freeBank || 0) / 100);
  1590. } else if (channelData.value.feeTypeBank == 2) {
  1591. feeAmount = Number(channelData.value.feeAmountBank || 0);
  1592. }
  1593. } else {
  1594. if (channelData.value.feeType == 1) {
  1595. feeAmount =
  1596. Number(newVal || 0) *
  1597. (Number(channelData.value.free || 0) / 100);
  1598. } else if (channelData.value.feeType == 2) {
  1599. feeAmount = Number(channelData.value.feeAmount || 0);
  1600. }
  1601. }
  1602. if (FreeNumber.value > 0) {
  1603. form.amount1 = new Decimal(Number(newVal || 0))
  1604. .mul(new Decimal(Number(channelData.value.rate || 0)))
  1605. .toNumber();
  1606. } else {
  1607. form.amount1 = new Decimal(Number(newVal || 0))
  1608. .sub(new Decimal(Number(feeAmount || 0)))
  1609. .mul(new Decimal(Number(channelData.value.rate || 0)))
  1610. .toNumber();
  1611. }
  1612. } else {
  1613. form.amount1 = (newVal * channelData.value.rate).toFixed(2);
  1614. }
  1615. if (
  1616. ["CNY", "THB", "VND"].indexOf(channelData.value.transformCurrency) > -1
  1617. ) {
  1618. form.amount1 = parseInt(form.amount1);
  1619. }
  1620. }
  1621. });
  1622. // -------------------- lifecycle --------------------
  1623. onMounted(() => {
  1624. getDateList();
  1625. //调用手续费减免次数接口
  1626. getFreeNumber();
  1627. isNewYear24Open();
  1628. });
  1629. </script>
  1630. <style lang="scss" scoped>
  1631. @import "@/uni.scss";
  1632. .custom-withdraw {
  1633. .box {
  1634. margin-bottom: px2rpx(20);
  1635. .b-card {
  1636. background: #fff;
  1637. border-radius: px2rpx(12);
  1638. padding: px2rpx(20);
  1639. box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.03);
  1640. .card-top {
  1641. .tit {
  1642. font-size: px2rpx(16);
  1643. font-weight: 600;
  1644. margin-bottom: px2rpx(16);
  1645. display: flex;
  1646. align-items: center;
  1647. color: var(--color-navy-900);
  1648. position: relative;
  1649. padding-left: 20px;
  1650. &:after {
  1651. content: '';
  1652. position: absolute;
  1653. left: 0;
  1654. top: 50%;
  1655. transform: translateY(-50%);
  1656. width: 0;
  1657. height: 0;
  1658. border-top: 6px solid transparent;
  1659. border-bottom: 6px solid transparent;
  1660. border-left: 8px solid currentColor;
  1661. }
  1662. .iconfont {
  1663. margin-right: px2rpx(8);
  1664. color: var(--color-primary);
  1665. font-size: px2rpx(18);
  1666. }
  1667. }
  1668. }
  1669. .channelType {
  1670. font-size: px2rpx(15);
  1671. font-weight: 600;
  1672. margin: px2rpx(24) 0 px2rpx(12);
  1673. color: var(--color-navy-700);
  1674. padding-left: px2rpx(8);
  1675. border-left: px2rpx(4) solid var(--color-primary);
  1676. }
  1677. }
  1678. }
  1679. .reselect-btn {
  1680. margin-top: px2rpx(20);
  1681. display: flex;
  1682. justify-content: flex-end;
  1683. }
  1684. .s-btn {
  1685. &.reselect {
  1686. background-color: var(--color-zinc-100);
  1687. color: var(--color-navy-700);
  1688. border: none;
  1689. font-size: px2rpx(14);
  1690. padding: px2rpx(8) px2rpx(20);
  1691. border-radius: px2rpx(8);
  1692. &:active {
  1693. background-color: var(--color-zinc-200);
  1694. }
  1695. }
  1696. &[type="primary"] {
  1697. width: 100%;
  1698. height: px2rpx(48);
  1699. background: var(--color-navy-900);
  1700. color: #fff;
  1701. border-radius: px2rpx(12);
  1702. font-size: px2rpx(16);
  1703. font-weight: 600;
  1704. display: flex;
  1705. align-items: center;
  1706. justify-content: center;
  1707. border: none;
  1708. margin-top: px2rpx(30);
  1709. transition: all 0.2s;
  1710. &:active {
  1711. transform: scale(0.98);
  1712. background: var(--color-navy-800);
  1713. }
  1714. }
  1715. }
  1716. .add-back {
  1717. display: flex;
  1718. justify-content: space-between;
  1719. align-items: center;
  1720. margin-bottom: px2rpx(12);
  1721. padding: px2rpx(12) px2rpx(16);
  1722. background: var(--color-zinc-100);
  1723. border-radius: px2rpx(8);
  1724. text {
  1725. font-size: px2rpx(14);
  1726. color: var(--color-navy-700);
  1727. font-weight: 500;
  1728. }
  1729. .add-btn {
  1730. color: var(--color-primary);
  1731. font-weight: 600;
  1732. text-decoration: underline;
  1733. &:active {
  1734. opacity: 0.7;
  1735. }
  1736. }
  1737. }
  1738. .proof {
  1739. margin-top: px2rpx(8);
  1740. border: px2rpx(1) dashed var(--color-zinc-300);
  1741. border-radius: px2rpx(8);
  1742. padding: px2rpx(8);
  1743. display: flex;
  1744. justify-content: center;
  1745. align-items: center;
  1746. background: var(--color-zinc-50);
  1747. .state {
  1748. padding: px2rpx(4) px2rpx(12);
  1749. border-radius: px2rpx(4);
  1750. font-size: px2rpx(12);
  1751. font-weight: bold;
  1752. }
  1753. }
  1754. .agree {
  1755. margin: px2rpx(24) 0;
  1756. display: flex;
  1757. align-items: flex-start;
  1758. .checkbox {
  1759. display: flex;
  1760. align-items: flex-start;
  1761. gap: px2rpx(8);
  1762. :deep(uni-checkbox .uni-checkbox-input) {
  1763. border-radius: px2rpx(4);
  1764. width: px2rpx(18);
  1765. height: px2rpx(18);
  1766. }
  1767. text {
  1768. font-size: px2rpx(13);
  1769. color: var(--color-zinc-500);
  1770. line-height: 1.5;
  1771. }
  1772. }
  1773. }
  1774. .step3-attention {
  1775. // background: var(--color-error-50, #fff1f0);
  1776. border-radius: px2rpx(12);
  1777. margin-bottom: px2rpx(20);
  1778. .tips {
  1779. line-height: 1.8;
  1780. font-size: px2rpx(12);
  1781. color: #909399;
  1782. padding: px2rpx(12);
  1783. border-radius: px2rpx(4);
  1784. border-left: px2rpx(2) solid #409eff;
  1785. .title {
  1786. font-weight: 600;
  1787. margin-bottom: px2rpx(6);
  1788. color: #606266;
  1789. }
  1790. }
  1791. .attention {
  1792. font-size: px2rpx(14);
  1793. // color: var(--color-error-600, #cf1322);
  1794. line-height: 1.6;
  1795. }
  1796. .btn-bottom {
  1797. margin-top: px2rpx(20);
  1798. display: flex;
  1799. justify-content: center;
  1800. .btn {
  1801. background: var(--color-error-600, #cf1322);
  1802. color: #fff;
  1803. padding: px2rpx(10) px2rpx(48);
  1804. border-radius: px2rpx(24);
  1805. font-size: px2rpx(15);
  1806. font-weight: 700;
  1807. box-shadow: 0 px2rpx(4) px2rpx(10) rgba(207, 19, 34, 0.2);
  1808. transition: all 0.2s;
  1809. &:active {
  1810. transform: scale(0.96);
  1811. opacity: 0.8;
  1812. }
  1813. }
  1814. }
  1815. }
  1816. :deep(.base-info-form) {
  1817. .uni-row1 {
  1818. .uni-col {
  1819. padding: 0 px2rpx(10) !important;
  1820. }
  1821. .uni-forms-item {
  1822. min-height: px2rpx(79);
  1823. margin-bottom: px2rpx(10);
  1824. }
  1825. .uni-select,
  1826. .uni-combox,
  1827. .uni-easyinput__content,
  1828. .uni-date-editor--x {
  1829. border: none !important;
  1830. background-color: var(--color-zinc-100) !important;
  1831. border-radius: px2rpx(8) !important;
  1832. }
  1833. .uni-date-x {
  1834. border: none !important;
  1835. background-color: rgba(195, 195, 195, 0) !important;
  1836. }
  1837. .uni-easyinput__content-input {
  1838. height: px2rpx(35) !important;
  1839. }
  1840. }
  1841. }
  1842. @keyframes rotate {
  1843. from {
  1844. transform: rotate(0deg);
  1845. }
  1846. to {
  1847. transform: rotate(360deg);
  1848. }
  1849. }
  1850. }
  1851. </style>