withdrawal-select.vue 68 KB

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