withdrawal-select.vue 70 KB

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