withdrawal-select.vue 68 KB

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