transfer.vue 29 KB

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