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