withdrawal-select.vue 69 KB

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