withdrawal-select.vue 66 KB

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