withdrawal-select.vue 70 KB

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