transfer.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Home.page_customer.item5')" />
  4. <view id="custom_Transfer" class="transfer-page">
  5. <view class="main-content">
  6. <!-- 步骤1:选择转出账户 -->
  7. <view class="box box-step1">
  8. <view class="b-card">
  9. <view class="card-top">
  10. <view class="card-row">
  11. <view class="tit">
  12. <text class="iconfont icon-caret-right"></text>
  13. <span>{{ t('Custom.Transfer.Title1') }}</span>
  14. </view>
  15. </view>
  16. <view class="card-row">
  17. <cwg-combox v-model:value="loginValue" :clearable="false" :options="withdrawDisplayList"
  18. :placeholder="t('placeholder.choose')" />
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 步骤2:转账表单 -->
  24. <view class="box box-step2" v-if="step2">
  25. <view class="b-card">
  26. <view class="card-top">
  27. <view class="card-row card-tit">
  28. <view class="title-wrapper">
  29. <view class="tit">
  30. <text class="iconfont icon-caret-right"></text>
  31. <span>{{ t('Custom.Transfer.Title2') }}</span>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="card-row">
  36. <cwg-combox v-model:value="transferType" :clearable="false"
  37. :options="transferTypeOptions" :placeholder="t('placeholder.choose')" />
  38. </view>
  39. <uni-forms ref="formRef" :model="form" :rules="rules" label-position="top"
  40. validate-trigger="submit">
  41. <view class="form-row">
  42. <view class="form-col">
  43. <!-- 转出账户 -->
  44. <uni-forms-item :label="t('Custom.Transfer.TransferAccounts')"
  45. name="withdrawLogin">
  46. <cwg-combox :disabled="true" v-model:value="form.withdrawLogin"
  47. :clearable="false" :options="withdrawDisplayList"
  48. :placeholder="t('placeholder.choose')" />
  49. </uni-forms-item>
  50. </view>
  51. <view class="form-col">
  52. <!-- 转入账户 -->
  53. <uni-forms-item :label="t('Custom.Transfer.IntoAccount')" name="depositLogin"
  54. :error-message="depositErrorMessage">
  55. <cwg-combox v-model:value="form.depositLogin" :clearable="false"
  56. :options="depositDisplayList" :placeholder="t('placeholder.choose')" />
  57. </uni-forms-item>
  58. </view>
  59. </view>
  60. <view class="form-row">
  61. <view class="form-col">
  62. <!-- 货币类型 -->
  63. <uni-forms-item :label="t('Custom.Transfer.CurrencyType')" name="currency">
  64. <cwg-combox v-model:value="form.currency" :clearable="false"
  65. :options="currencyOptions" :placeholder="t('placeholder.choose')" />
  66. </uni-forms-item>
  67. </view>
  68. <view class="form-col">
  69. <!-- 转账金额 -->
  70. <uni-forms-item :label="t('Custom.Transfer.Amount')" name="amount"
  71. :error-message="amountErrorMessage">
  72. <uni-easyinput v-model="form.amount" :placeholder="t('placeholder.input')"
  73. @blur="validateAmount" />
  74. </uni-forms-item>
  75. </view>
  76. </view>
  77. <view class="form-row">
  78. <view class="form-col-full">
  79. <uni-forms-item>
  80. <view class="tips">
  81. <view class="title">{{ t('Custom.Transfer.Tips') }}</view>
  82. <view>{{ t('Custom.Transfer.Tips1') }}</view>
  83. <view>{{ t('Custom.Transfer.Tips2') }}</view>
  84. <view>{{ t('Custom.Transfer.Tips3') }}</view>
  85. <view>{{ t('Custom.Transfer.Tips4') }}</view>
  86. </view>
  87. </uni-forms-item>
  88. </view>
  89. </view>
  90. <view class="form-row">
  91. <button class="s-btn reselect" type="primary" @click="toTransfer">{{ locale === 'es'
  92. ?
  93. 'Enviar solicitud' : t('Btn.Submit') }}</button>
  94. </view>
  95. </uni-forms>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <!-- 失败弹窗 -->
  101. <cwg-error-popup v-model:visible="dialogError" @confirm="closeDia" />
  102. <!-- 成功弹窗 -->
  103. <cwg-success-popup v-model:visible="dialogSuccess" @confirm="closeDia" />
  104. <!-- 等待弹窗 -->
  105. <cwg-wait-popup v-model:visible="dialogCheckWait" type="center" :mask-click="false" :showFooters="false" />
  106. </view>
  107. </cwg-page-wrapper>
  108. </template>
  109. <script setup>
  110. import { ref, reactive, computed, onMounted, watch } from 'vue'
  111. import { useI18n } from 'vue-i18n'
  112. import { onLoad, onReady } from '@dcloudio/uni-app'
  113. import { getCurrentInstance } from 'vue'
  114. import { isAfterJuly28 } from '@/utils/dateUtils'
  115. import { customApi } from '@/service/custom'
  116. import { financialApi } from '@/service/financial'
  117. import { ibApi } from '@/service/ib'
  118. // import ServiceA from "@/service/activity"; // 原注释保留
  119. import useUserStore from '@/stores/use-user-store'
  120. const userStore = useUserStore()
  121. const customInfo = computed(() => {
  122. return userStore?.userInfo?.customInfo || {}
  123. })
  124. import Config from '@/config/index'
  125. const { Code } = Config
  126. const { t } = useI18n()
  127. // 获取全局实例(用于访问 Session、$pigeon 等)
  128. const { proxy } = getCurrentInstance()
  129. const Session = proxy?.Session
  130. const $pigeon = proxy?.$pigeon
  131. // 响应式数据
  132. const loginValue = ref('')
  133. const flag = ref(false)
  134. const responseMessage = ref('') // 弹窗响应信息
  135. const loginOptions = ref([])
  136. const toOptions = ref([])
  137. // 跨系统内转下拉数据
  138. const accountList = ref([])
  139. const systemTransferType = ref(0)
  140. const step2 = ref(false)
  141. const transferType = ref('internal')
  142. const amountLimits = reactive({
  143. minAmount: '',
  144. maxAmount: '',
  145. })
  146. const form = reactive({
  147. currency: 'USD',
  148. depositLogin: null,
  149. withdrawLogin: null,
  150. amount: ''
  151. })
  152. const dialogSuccess = computed(() => dialogCheck.value && dialogVisible.value)
  153. const dialogError = computed(() => dialogCheck.value && !dialogVisible.value)
  154. const dialogCheck = ref(false)
  155. const dialogVisible = ref(false)
  156. const dialogCheckWait = ref(false)
  157. const pageQuery = ref({})
  158. const rules = {
  159. withdrawLogin: {
  160. rules: [
  161. {
  162. required: true,
  163. errorMessage: t('vaildate.select.empty')
  164. },
  165. ],
  166. },
  167. depositLogin: {
  168. rules: [
  169. {
  170. required: true,
  171. errorMessage: t('vaildate.select.empty')
  172. },
  173. ],
  174. },
  175. amount: {
  176. rules: [
  177. {
  178. required: true,
  179. errorMessage: t('vaildate.amount.format'),
  180. },
  181. {
  182. validateFunction: (rule, value, data, callback) => {
  183. console.log(rule, value, data, callback, 2121212);
  184. if (!value) {
  185. callback(t('vaildate.amount.format'))
  186. } else if (
  187. amountLimits.minAmount &&
  188. amountLimits.maxAmount &&
  189. (parseFloat(amountLimits.minAmount) > parseFloat(value) ||
  190. parseFloat(amountLimits.maxAmount) < parseFloat(value))
  191. ) {
  192. callback(t('vaildate.amount.amount') +
  193. amountLimits.minAmount +
  194. '-' +
  195. amountLimits.maxAmount)
  196. } else if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
  197. callback(t('vaildate.amount.format'))
  198. }
  199. return true
  200. }
  201. },
  202. ],
  203. }
  204. }
  205. function validateAmount() {
  206. const amount = form.amount
  207. if (!amount) {
  208. amountErrorMessage.value = t('vaildate.amount.format')
  209. return false
  210. }
  211. const numValue = parseFloat(amount)
  212. if (isNaN(numValue)) {
  213. amountErrorMessage.value = t('vaildate.amount.format')
  214. return false
  215. }
  216. if (amountLimits.minAmount && numValue < parseFloat(amountLimits.minAmount)) {
  217. amountErrorMessage.value = t('vaildate.amount.amount') + amountLimits.minAmount + '-' + amountLimits.maxAmount
  218. return false
  219. }
  220. if (amountLimits.maxAmount && numValue > parseFloat(amountLimits.maxAmount)) {
  221. amountErrorMessage.value = t('vaildate.amount.amount') + amountLimits.minAmount + '-' + amountLimits.maxAmount
  222. return false
  223. }
  224. if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(amount)) {
  225. amountErrorMessage.value = t('vaildate.amount.format')
  226. return false
  227. }
  228. amountErrorMessage.value = ''
  229. return true
  230. }
  231. // 模板引用(对应原 this.$refs.form)
  232. const formRef = ref(null)
  233. // 计算属性
  234. const getInfoAgentTransfer = computed(() => {
  235. return customInfo.value?.agentTransfer
  236. })
  237. // 单位类型
  238. function groupCurrency(type) {
  239. const map = { GBP: ': £', USD: ': $', EUR: ': €', USC: ': ¢' }
  240. return map[type] || ': $'
  241. }
  242. // 单位类型
  243. function groupCurrency1(type) {
  244. const map = { GBP: '£', USD: '$', EUR: '€', USC: '¢' }
  245. return map[type] || '$'
  246. }
  247. // 账户类型
  248. function groupTypeName(type) {
  249. const typeMap = {
  250. '1': t('AccountType.ClassicAccount'),
  251. '2': t('AccountType.SeniorAccount'),
  252. '3': isAfterJuly28() ? '--' : t('AccountType.AgencyAccount'),
  253. '5': t('AccountType.SpeedAccount'),
  254. '6': t('AccountType.SpeedAccount'),
  255. '7': t('AccountType.StandardAccount'),
  256. '8': t('AccountType.CentAccount')
  257. }
  258. return typeMap[type] || ''
  259. }
  260. const closeDia = () => {
  261. formRef.value?.clearValidate()
  262. step2.value = false
  263. loginValue.value = ''
  264. form.depositLogin = null
  265. form.withdrawLogin = null
  266. form.amount = ''
  267. transferType.value = 'internal'
  268. dialogCheck.value = false
  269. dialogVisible.value = false
  270. }
  271. const submitting = ref(false);
  272. const toTransfer = async () => {
  273. // 防止重复提交
  274. if (submitting.value) return;
  275. submitting.value = true;
  276. try {
  277. // 表单验证(验证失败会抛出异常)
  278. await formRef.value?.validate()
  279. // 检查活动参与情况(仅内部转账检查转出账户)[保留注释]
  280. if (transferType.value === 'internal') {
  281. // 活动检查代码已注释,保留原样
  282. }
  283. dialogCheckWait.value = true;
  284. let res;
  285. if (transferType.value === 'internal') {
  286. res = await financialApi.TransferApply({ ...form });
  287. } else if (transferType.value === 'agent') {
  288. res = await ibApi.agentTransCtaferApply({ ...form });
  289. } else if (transferType.value === 'system') {
  290. const selectedAccount = accountList.value.find(item => item.login === form.depositLogin);
  291. res = await financialApi.transferSystemApply({
  292. currency: form.currency,
  293. depositLogin: form.depositLogin,
  294. withdrawLogin: form.withdrawLogin,
  295. amount: form.amount,
  296. depositPlatform: selectedAccount?.platform || 'MT4',
  297. depositCurrency: selectedAccount?.currency || form.currency,
  298. depositType: selectedAccount?.type || 2,
  299. });
  300. }
  301. dialogCheckWait.value = false;
  302. if (res.code == Code.StatusOK) {
  303. dialogCheck.value = true;
  304. dialogVisible.value = true;
  305. } else {
  306. responseMessage.value = res.msg;
  307. dialogCheck.value = true;
  308. dialogVisible.value = false;
  309. }
  310. } catch (error) {
  311. console.log(error, 12121);
  312. if (error instanceof Array) {
  313. uni.showToast({ title: error[0].errorMessage, icon: 'none' });
  314. return
  315. } else {
  316. console.log(232312);
  317. responseMessage.value = error.msg;
  318. dialogCheck.value = true;
  319. dialogVisible.value = false;
  320. }
  321. } finally {
  322. submitting.value = false;
  323. if (dialogCheckWait.value) dialogCheckWait.value = false;
  324. }
  325. };
  326. const cancle = () => {
  327. step2.value = false
  328. loginValue.value = ''
  329. transferType.value = 'internal'
  330. }
  331. // 转出账户列表
  332. const withdrawDisplayList = computed(() => {
  333. return loginOptions.value.map(item => ({
  334. text: `${item.login} - ${groupTypeName(item.type)} - ${t('Custom.Deposit.AvailableBalance')}${groupCurrency(item.currency)}${item.balance}`,
  335. value: item.login,
  336. disable: isWithdrawDisabled(item)
  337. }))
  338. })
  339. const transferTypeOptions = computed(() => [
  340. { value: 'internal', text: t('Home.page_customer.item5') },
  341. ...(getInfoAgentTransfer.value ? [{ value: 'agent', text: t('Home.page_ib.item9') }] : []),
  342. ...(systemTransferType.value === 1 ? [{ value: 'system', text: t('Custom.Transfer.SystemTransfer') }] : []),
  343. ]);
  344. const currencyOptions = ref([{ value: 'USD', text: 'USD' }])
  345. // 转入账户列表
  346. const depositDisplayList = computed(() => {
  347. return toOptions.value.map(item => ({
  348. text: `${item.login} - ${groupTypeName(item.type)} - ${t('Custom.Deposit.AvailableBalance')}${groupCurrency(item.currency)}${item.balance}`,
  349. value: item.login,
  350. disable: isDepositDisabled(item)
  351. }))
  352. })
  353. // 转出账户是否禁用
  354. const isWithdrawDisabled = (item) => {
  355. const closeFunc = item.closeFunctions || []
  356. const transType = transferType.value // transferType 是 ref
  357. return (
  358. closeFunc.indexOf('5') !== -1 || // 包含'5'时禁用
  359. closeFunc.indexOf('6') !== -1 || // 包含'6'时禁用
  360. (transType === 'agent' && closeFunc.indexOf('3') !== -1) ||
  361. (transType === 'internal' && closeFunc.indexOf('7') !== -1) ||
  362. (transType === 'system' && closeFunc.indexOf('7') !== -1)
  363. )
  364. }
  365. // 转入账户是否禁用
  366. function isDepositDisabled(item) {
  367. const closeFunc = item.closeFunctions || []
  368. if (transferType.value === 'agent' && closeFunc.indexOf('3') !== -1) return true
  369. if (transferType.value === 'internal' && closeFunc.indexOf('7') !== -1) return true
  370. if (transferType.value === 'system' && closeFunc.indexOf('7') !== -1) return true
  371. return false
  372. }
  373. const getDateList = async () => {
  374. let res = await customApi.CustomDropdown({ platform: '' })
  375. if (res.code == Code.StatusOK) {
  376. loginOptions.value = res.data
  377. } else {
  378. $pigeon?.MessageError(res.msg)
  379. }
  380. }
  381. // 获取代理列表
  382. const getAgentList = async () => {
  383. let res = await financialApi.getAgentList({})
  384. if (res.code == Code.StatusOK) {
  385. toOptions.value = res.data
  386. } else {
  387. $pigeon?.MessageError(res.msg)
  388. }
  389. }
  390. //获取内转数额区间
  391. const getAmount = async () => {
  392. let res = await financialApi.transferInfo({})
  393. if (res.code == Code.StatusOK) {
  394. Object.assign(amountLimits, res.data)
  395. } else {
  396. $pigeon?.MessageError(res.msg)
  397. }
  398. }
  399. // 获取跨系统转账下拉列表
  400. const getTransferSystemDropdown = async () => {
  401. let res = await financialApi.transferSystemDropdown({})
  402. if (res.code == Code.StatusOK && res.data) {
  403. systemTransferType.value = res.data.transferType ?? 0
  404. console.log(systemTransferType.value, 'systemTransferType')
  405. accountList.value = res.data.accountList || []
  406. }
  407. }
  408. // 生命周期
  409. onLoad((options) => {
  410. pageQuery.value = options
  411. if (options.login) {
  412. handleRouteParams(options)
  413. }
  414. })
  415. // 更新转出账户选项
  416. function updateToOptions() {
  417. toOptions.value = []
  418. form.depositLogin = null
  419. if (transferType.value === 'internal') {
  420. loginOptions.value.forEach(item => {
  421. if (item.login != form.withdrawLogin) {
  422. toOptions.value.push(item)
  423. }
  424. })
  425. } else if (transferType.value === 'agent') {
  426. getAgentList()
  427. } else if (transferType.value === 'system') {
  428. toOptions.value = accountList.value.filter(item => item.login != form.withdrawLogin)
  429. }
  430. }
  431. // 处理路由参数
  432. function handleRouteParams(options) {
  433. form.withdrawLogin = Number(options.login)
  434. step2.value = true
  435. loginValue.value = options.login
  436. updateToOptions()
  437. }
  438. onMounted(() => {
  439. getDateList()
  440. getAmount()
  441. getTransferSystemDropdown()
  442. })
  443. // 侦听器
  444. watch(loginValue, (newVal) => {
  445. if (newVal) {
  446. step2.value = true
  447. form.withdrawLogin = Number(loginValue.value)
  448. toOptions.value = []
  449. if (transferType.value === 'internal') {
  450. // 内部转账逻辑
  451. loginOptions.value.forEach((item) => {
  452. if (item.login != newVal) {
  453. toOptions.value.push(item)
  454. }
  455. })
  456. } else if (transferType.value === 'agent') {
  457. // 代理内转逻辑
  458. getAgentList()
  459. } else if (transferType.value === 'system') {
  460. // 跨系统内转,排除当前选择的转出账户
  461. toOptions.value = accountList.value.filter(
  462. (item) => item.login != form.withdrawLogin
  463. )
  464. }
  465. }
  466. })
  467. watch(transferType, (newVal) => {
  468. if (form.depositLogin) {
  469. form.depositLogin = null
  470. }
  471. if (loginValue.value && step2.value) {
  472. toOptions.value = []
  473. if (newVal === 'internal') {
  474. // 内部转账逻辑
  475. loginOptions.value.forEach((item) => {
  476. if (item.login != loginValue.value) {
  477. toOptions.value.push(item)
  478. }
  479. })
  480. } else if (newVal === 'agent') {
  481. // 代理内转逻辑
  482. getAgentList()
  483. } else if (newVal === 'system') {
  484. // 跨系统内转,排除当前选择的转出账户
  485. toOptions.value = accountList.value.filter(
  486. (item) => item.login != form.withdrawLogin
  487. )
  488. }
  489. }
  490. })
  491. </script>
  492. <style lang="scss" scoped>
  493. @import "@/uni.scss";
  494. .transfer-page {
  495. width: 100%;
  496. padding-bottom: px2rpx(20);
  497. .main-content {
  498. text-align: left;
  499. .box {
  500. padding-top: px2rpx(5);
  501. color: #303133;
  502. .b-card {
  503. background-color: #fff;
  504. margin-bottom: px2rpx(10);
  505. border-radius: px2rpx(6);
  506. box-shadow: 0 px2rpx(1) px2rpx(6) 0 rgba(0, 0, 0, 0.05);
  507. &:hover {
  508. box-shadow: 0 px2rpx(2) px2rpx(8) 0 rgba(0, 0, 0, 0.1);
  509. }
  510. .card-top {
  511. padding: px2rpx(15) px2rpx(20);
  512. .card-row {
  513. margin-bottom: px2rpx(12);
  514. &:last-child {
  515. margin-bottom: 0;
  516. }
  517. }
  518. .tit {
  519. font-size: px2rpx(16);
  520. margin-bottom: px2rpx(12);
  521. font-weight: 600;
  522. .iconfont {
  523. font-size: px2rpx(18);
  524. margin-right: px2rpx(8);
  525. color: #409eff;
  526. }
  527. }
  528. .title-wrapper {
  529. display: flex;
  530. justify-content: space-between;
  531. align-items: center;
  532. }
  533. }
  534. }
  535. }
  536. .box-step2 {
  537. .form-row {
  538. display: flex;
  539. flex-wrap: wrap;
  540. margin: 0 px2rpx(-5);
  541. margin-bottom: px2rpx(12);
  542. gap: px2rpx(12);
  543. &:last-child {
  544. margin-bottom: 0;
  545. }
  546. .form-col {
  547. flex: 1;
  548. min-width: px2rpx(140);
  549. @media screen and (max-width: 991px) {
  550. flex: 0 0 100%;
  551. width: 100%;
  552. }
  553. }
  554. .form-col-full {
  555. width: 100%;
  556. padding: 0 px2rpx(5);
  557. }
  558. }
  559. .tips {
  560. line-height: 1.8;
  561. font-size: px2rpx(12);
  562. color: #909399;
  563. background-color: #f9f9f9;
  564. padding: px2rpx(12);
  565. border-radius: px2rpx(4);
  566. border-left: px2rpx(2) solid #409eff;
  567. .title {
  568. font-weight: 600;
  569. margin-bottom: px2rpx(6);
  570. color: #606266;
  571. }
  572. }
  573. }
  574. }
  575. .picker-select {
  576. background-color: #f5f7fa;
  577. border: 1px solid #dcdfe6;
  578. border-radius: px2rpx(4);
  579. padding: px2rpx(12) px2rpx(14);
  580. font-size: px2rpx(14);
  581. color: #606266;
  582. line-height: 1.4;
  583. width: 100%;
  584. box-sizing: border-box;
  585. &:hover {
  586. border-color: #409eff;
  587. }
  588. &.picker-disabled {
  589. background-color: #f5f7fa;
  590. color: #c0c4cc;
  591. cursor: not-allowed;
  592. }
  593. }
  594. .disabled-input {
  595. background-color: #f5f7fa;
  596. border: 1px solid #dcdfe6;
  597. border-radius: px2rpx(4);
  598. padding: px2rpx(12) px2rpx(14);
  599. font-size: px2rpx(14);
  600. color: #606266;
  601. width: 100%;
  602. box-sizing: border-box;
  603. }
  604. .m-input {
  605. background-color: #f5f7fa;
  606. border: 1px solid #dcdfe6;
  607. border-radius: px2rpx(4);
  608. padding: px2rpx(12) px2rpx(14);
  609. font-size: px2rpx(14);
  610. width: 100%;
  611. box-sizing: border-box;
  612. &:focus {
  613. border-color: #409eff;
  614. outline: none;
  615. box-shadow: 0 0 0 px2rpx(1) rgba(64, 158, 255, 0.2);
  616. }
  617. }
  618. .popup-content {
  619. padding: px2rpx(30) px2rpx(20);
  620. text-align: center;
  621. min-width: px2rpx(250);
  622. max-width: 80%;
  623. margin: 0 auto;
  624. @media screen and (max-width: 991px) {
  625. min-width: 80%;
  626. max-width: 90%;
  627. margin: 0 px2rpx(10);
  628. }
  629. position: relative;
  630. .icon {
  631. .iconfont {
  632. font-size: px2rpx(60);
  633. display: block;
  634. margin: 0 auto;
  635. }
  636. .icon-chenggong {
  637. color: #67c23a;
  638. }
  639. .icon-jingshi {
  640. color: #f56c6c;
  641. }
  642. .icon-dengdai {
  643. color: #e6a23c;
  644. }
  645. }
  646. .des1 {
  647. font-weight: 600;
  648. font-size: px2rpx(16);
  649. margin: px2rpx(20) 0 px2rpx(15);
  650. color: #303133;
  651. line-height: 1.4;
  652. padding: 0 px2rpx(10);
  653. }
  654. .dialog-footer {
  655. display: flex;
  656. justify-content: center;
  657. gap: px2rpx(10);
  658. margin-top: px2rpx(10);
  659. @media (max-width: 750rpx) {
  660. flex-direction: column;
  661. align-items: center;
  662. gap: px2rpx(6);
  663. }
  664. button {
  665. min-width: px2rpx(90);
  666. padding: 0 px2rpx(12);
  667. border-radius: px2rpx(4);
  668. font-size: px2rpx(14);
  669. transition: all 0.3s ease;
  670. cursor: pointer;
  671. &[type="primary"] {
  672. background-color: #409eff;
  673. color: #fff;
  674. border: none;
  675. &:hover {
  676. background-color: #66b1ff;
  677. transform: translateY(px2rpx(-1));
  678. box-shadow: 0 px2rpx(2) px2rpx(6) 0 rgba(64, 158, 255, 0.3);
  679. }
  680. &:active {
  681. background-color: #3a8ee6;
  682. transform: translateY(0);
  683. }
  684. }
  685. &:not([type="primary"]) {
  686. background-color: #fff;
  687. border: 1px solid #dcdfe6;
  688. color: #606266;
  689. &:hover {
  690. border-color: #409eff;
  691. color: #409eff;
  692. transform: translateY(px2rpx(-1));
  693. }
  694. &:active {
  695. transform: translateY(0);
  696. }
  697. }
  698. }
  699. }
  700. }
  701. .wait-popup {
  702. .des1 {
  703. margin-top: px2rpx(10);
  704. }
  705. .icon {
  706. .iconfont {
  707. animation: spin 1s linear infinite;
  708. }
  709. }
  710. }
  711. }
  712. // 动画
  713. @keyframes popupFadeIn {
  714. from {
  715. opacity: 0;
  716. transform: scale(0.9);
  717. }
  718. to {
  719. opacity: 1;
  720. transform: scale(1);
  721. }
  722. }
  723. @keyframes fadeIn {
  724. from {
  725. opacity: 0;
  726. transform: translateY(px2rpx(10));
  727. }
  728. to {
  729. opacity: 1;
  730. transform: translateY(0);
  731. }
  732. }
  733. @keyframes pulse {
  734. 0% {
  735. transform: scale(1);
  736. }
  737. 50% {
  738. transform: scale(1.05);
  739. }
  740. 100% {
  741. transform: scale(1);
  742. }
  743. }
  744. @keyframes spin {
  745. from {
  746. transform: rotate(0deg);
  747. }
  748. to {
  749. transform: rotate(360deg);
  750. }
  751. }
  752. // 表单错误信息样式
  753. .uni-forms-item__error {
  754. font-size: px2rpx(12);
  755. color: #f56c6c;
  756. margin-top: px2rpx(4);
  757. }
  758. // 适配不同屏幕尺寸(媒体查询中的 750rpx 保持不变)
  759. @media (max-width: 750rpx) {
  760. .transfer-page {
  761. .main-content {
  762. padding: px2rpx(8);
  763. .box {
  764. .b-card {
  765. .card-top {
  766. padding: px2rpx(12) px2rpx(16);
  767. .tit {
  768. font-size: px2rpx(14);
  769. .iconfont {
  770. font-size: px2rpx(16);
  771. }
  772. }
  773. }
  774. }
  775. }
  776. }
  777. .s-btn {
  778. font-size: px2rpx(14);
  779. padding: px2rpx(10) px2rpx(16);
  780. }
  781. .popup-content {
  782. padding: px2rpx(20) px2rpx(16);
  783. .icon {
  784. .iconfont {
  785. font-size: px2rpx(50);
  786. }
  787. }
  788. .des1 {
  789. font-size: px2rpx(14);
  790. margin: px2rpx(15) 0 px2rpx(10);
  791. }
  792. .dialog-footer {
  793. button {
  794. min-width: px2rpx(80);
  795. font-size: px2rpx(13);
  796. }
  797. }
  798. }
  799. }
  800. }
  801. </style>