withdrawal-select.vue 66 KB

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