agent-transfer.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Home.page_ib.item9')" />
  4. <uni-loading v-if="loading" />
  5. <view id="custom_IbTransfer" class="transfer-page" v-else>
  6. <view class="main-content">
  7. <!-- 步骤1:选择转出账户 -->
  8. <view class="box box-step1">
  9. <view class="b-card">
  10. <view class="card-top">
  11. <view class="card-row">
  12. <view class="tit">
  13. <text class="iconfont icon-caret-right"></text>
  14. <span>{{ t('Custom.Transfer.Title1') }}</span>
  15. </view>
  16. </view>
  17. <view class="card-row">
  18. <cwg-combox v-model:value="loginValue" :clearable="false" :options="withdrawDisplayList"
  19. :placeholder="t('placeholder.choose')" />
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 步骤2:转账表单 -->
  25. <view class="box box-step2" v-if="step2">
  26. <view class="b-card">
  27. <view class="card-top">
  28. <view class="card-row card-tit">
  29. <view class="title-wrapper">
  30. <view class="tit">
  31. <text class="iconfont icon-caret-right"></text>
  32. <span>{{ t('Custom.Transfer.Title2') }}</span>
  33. </view>
  34. </view>
  35. </view>
  36. <uni-forms ref="formRef" :model="form" :rules="rules" label-width="300" label-position="top"
  37. validate-trigger="submit">
  38. <view class="form-row">
  39. <view class="form-col">
  40. <!-- 转入账户 -->
  41. <uni-forms-item :label="t('Custom.Transfer.IntoAccount')" name="depositLogin">
  42. <cwg-combox v-model:value="form.depositLogin" :clearable="false"
  43. :options="depositDisplayList" :placeholder="t('placeholder.choose')" />
  44. </uni-forms-item>
  45. </view>
  46. </view>
  47. <view class="form-row">
  48. <view class="form-col">
  49. <!-- 确认转入账户 -->
  50. <uni-forms-item :label="t('Custom.Transfer.ConfirmIntoAccount')"
  51. name="depositLogin1">
  52. <cwg-combox v-model:value="form.depositLogin1" :clearable="false"
  53. :options="depositDisplayList" :placeholder="t('placeholder.choose')" />
  54. </uni-forms-item>
  55. </view>
  56. </view>
  57. <view class="form-row">
  58. <view class="form-col amount-box">
  59. <!-- 转账金额 -->
  60. <uni-forms-item :label="t('Custom.Transfer.Amount')" name="amount"
  61. :error-message="amountErrorMessage" class="amount-input">
  62. <uni-easyinput v-model="form.amount" :placeholder="t('placeholder.input')"
  63. @blur="validateAmount" />
  64. </uni-forms-item>
  65. <view class="btn" v-t="'State.All'" @click="setAllAmount"></view>
  66. </view>
  67. </view>
  68. <!-- 20%赠金-年中赠金 -->
  69. <view class="form-row" v-if="tableData4TwoFlag">
  70. <view class="form-col-full">
  71. <uni-forms-item class="agree">
  72. <view class="agree-content">
  73. <checkbox :checked="form.agree5" @click="form.agree5 = !form.agree5" />
  74. <view class="agree-text">
  75. <view class="agree-title">{{
  76. t('news_add_field1.activitiesNZTwo.itemDeposit1') }}</view>
  77. </view>
  78. </view>
  79. </uni-forms-item>
  80. <view class="agree-detail">
  81. <text>{{ t('news_add_field1.activitiesNZTwo.itemDeposit2') }}</text>
  82. <text class="clause crm-cursor" style="text-decoration: underline;"
  83. @click="dialogClauseNZTwo = true">{{
  84. t('news_add_field1.activitiesNZTwo.itemDeposit3') }}</text>
  85. <text>{{ t('news_add_field1.activitiesNZTwo.itemDeposit4') }}</text>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 赠送活动 -->
  90. <view class="form-row" v-if="tableDataNewListFlag">
  91. <view class="form-col-full">
  92. <uni-forms-item class="agree">
  93. <view class="agree-content">
  94. <checkbox :checked="form.agree6" @click="form.agree6 = !form.agree6" />
  95. <view class="agree-text">
  96. <view class="agree-title">{{ tableDataNewList.title }}</view>
  97. </view>
  98. </view>
  99. </uni-forms-item>
  100. <view class="agree-detail">
  101. <text>{{ t('news_add_field1.activitiesNewList.item1') }}</text>
  102. <text class="clause" @click="dialogClauseNewList = true">{{
  103. tableDataNewList.title }}</text>
  104. <text>{{ t('news_add_field1.activitiesNewList.item2') }}</text>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="form-row">
  109. <view class="form-col-full">
  110. <uni-forms-item>
  111. <view class="tips">
  112. <view class="title">{{ t('Custom.Transfer.Tips') }}</view>
  113. <view>{{ t('Custom.Transfer.Tips1') }}</view>
  114. <view>{{ t('Custom.Transfer.Tips5') }}</view>
  115. <view>{{ t('Custom.Transfer.Tips3') }}</view>
  116. <view>{{ t('Custom.Transfer.Tips4') }}</view>
  117. </view>
  118. </uni-forms-item>
  119. </view>
  120. </view>
  121. <view class="form-row">
  122. <button class="s-btn reselect" type="primary" @click="toTransfer">{{ locale === 'es'
  123. ?
  124. 'Enviar solicitud' : t('Btn.Submit') }}</button>
  125. </view>
  126. </uni-forms>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. <!-- 失败弹窗 -->
  132. <cwg-error-popup v-model:visible="dialogError" @confirm="closeDia" :responseMessage="RES" />
  133. <!-- 成功弹窗 -->
  134. <cwg-success-popup v-model:visible="dialogSuccess" @confirm="closeDia" />
  135. <!-- 等待弹窗 -->
  136. <cwg-wait-popup v-model:visible="dialogCheckWait" type="center" :mask-click="false" :showFooters="false" />
  137. <!-- 不参加活动弹出框 -->
  138. <cwg-dont-active-popup v-model:visible="dialogDontActive" :showFooters="true" @confirm="tosubmitConfirm" />
  139. <!-- 功能关闭弹出 -->
  140. <cwg-function-disabled-popup v-model:visible="InfoStatus5" :showFooters="false" @confirm="toHome" />
  141. <!-- 赠金协议20年中 -->
  142. <BonusAgreementPopup v-model:visible="dialogClauseNZTwo" :title="t('news_add_field1.activitiesNZTwo.item6')"
  143. type="nzTwo" :tableData4Two="tableData4Two" />
  144. <!-- 赠送活动协议 -->
  145. <BonusAgreementPopup v-model:visible="dialogClauseNewList" :title="tableDataNewList.title"
  146. :content="tableDataNewList.content" type="newList" />
  147. </view>
  148. <cwg-confirm-popup />
  149. </cwg-page-wrapper>
  150. </template>
  151. <script setup>
  152. import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue'
  153. import { useI18n } from 'vue-i18n'
  154. import { onLoad } from '@dcloudio/uni-app'
  155. import { getCurrentInstance } from 'vue'
  156. import { ibApi } from '@/service/ib'
  157. import { activityApi } from '@/service/activity'
  158. import { financialApi } from '@/service/financial'
  159. import Config from '@/config/index'
  160. import useUserStore from '@/stores/use-user-store'
  161. import BonusAgreementPopup from './components/BonusAgreementPopup.vue'
  162. import { useConfirm } from '@/hooks/useConfirm'
  163. const confirm = useConfirm()
  164. const userStore = useUserStore()
  165. const ibInfo = computed(() => {
  166. return userStore?.userInfo?.ibInfo || {}
  167. })
  168. const { Code } = Config
  169. const { t, locale } = useI18n()
  170. // 获取全局实例(用于访问 Session、$pigeon 等)
  171. const { proxy } = getCurrentInstance()
  172. const $pigeon = proxy?.$pigeon
  173. // 响应式数据
  174. const loginValue = ref(null)
  175. const flag = ref(false)
  176. const RES = ref('') // 弹窗响应信息
  177. const giveLoginJoin = ref('')
  178. const loginOptions = ref([])
  179. const toOptions = ref([])
  180. const step2 = ref(false)
  181. const amountLimits = reactive({
  182. minAmount: '',
  183. maxAmount: '',
  184. })
  185. const form = reactive({
  186. currency: 'USD',
  187. depositLogin: null,
  188. depositLogin1: null,
  189. withdrawLogin: null,
  190. amount: '',
  191. agree5: false,
  192. agree6: false,
  193. })
  194. const resetForm = async () => {
  195. await nextTick();
  196. formRef.value?.clearValidate(); // 再次清除可能因数据重置产生的新错误
  197. form.customBankCode = ""
  198. form.depositLogin = null
  199. form.depositLogin1 = null
  200. form.withdrawLogin = null
  201. form.amount = ""
  202. form.agree5 = false
  203. form.agree6 = false
  204. amountErrorMessage.value = ""
  205. submitting.value = false
  206. flag.value = false
  207. }
  208. const dialogSuccess = computed(() => dialogCheck.value && dialogVisible.value)
  209. const dialogError = computed(() => dialogCheck.value && !dialogVisible.value)
  210. const dialogCheck = ref(false)
  211. const dialogVisible = ref(false)
  212. const dialogCheckWait = ref(false)
  213. const InfoStatus5 = ref(false)
  214. const dialogClauseNZTwo = ref(false)
  215. const tableData4TwoFlag = ref(false)
  216. const tableData4Two = ref({})
  217. const dialogClauseNewList = ref(false)
  218. const tableDataNewListFlag = ref(false)
  219. const tableDataNewList = ref({})
  220. const dialogDontActive = ref(false)
  221. const submitting = ref(false)
  222. // 错误信息
  223. const amountErrorMessage = ref('')
  224. // 表单验证规则
  225. const rules = {
  226. withdrawLogin: {
  227. rules: [
  228. {
  229. required: true,
  230. errorMessage: t('vaildate.select.empty')
  231. },
  232. ],
  233. },
  234. depositLogin: {
  235. rules: [
  236. {
  237. required: true,
  238. errorMessage: t('vaildate.select.empty')
  239. },
  240. ],
  241. },
  242. depositLogin1: {
  243. rules: [
  244. {
  245. required: true,
  246. errorMessage: t('Custom.Transfer.ConfirmIntoAccount1')
  247. },
  248. {
  249. validateFunction: (rule, value, data, callback) => {
  250. if (value !== form.depositLogin) {
  251. callback(t('Custom.Transfer.ConfirmIntoAccount1'))
  252. }
  253. return true
  254. }
  255. },
  256. ],
  257. },
  258. amount: {
  259. rules: [
  260. {
  261. required: true,
  262. errorMessage: t('vaildate.amount.format'),
  263. },
  264. {
  265. validateFunction: (rule, value, data, callback) => {
  266. if (!value) {
  267. callback(t('vaildate.amount.format'))
  268. } else if (
  269. amountLimits.minAmount &&
  270. amountLimits.maxAmount &&
  271. (parseFloat(amountLimits.minAmount) > parseFloat(value) ||
  272. parseFloat(amountLimits.maxAmount) < parseFloat(value))
  273. ) {
  274. callback(t('vaildate.amount.amount') +
  275. amountLimits.minAmount +
  276. '-' +
  277. amountLimits.maxAmount)
  278. } else if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
  279. callback(t('vaildate.amount.format'))
  280. }
  281. return true
  282. }
  283. },
  284. ],
  285. }
  286. }
  287. function validateAmount() {
  288. const amount = form.amount
  289. if (!amount) {
  290. amountErrorMessage.value = t('vaildate.amount.format')
  291. return false
  292. }
  293. const numValue = parseFloat(amount)
  294. if (isNaN(numValue)) {
  295. amountErrorMessage.value = t('vaildate.amount.format')
  296. return false
  297. }
  298. if (amountLimits.minAmount && numValue < parseFloat(amountLimits.minAmount)) {
  299. amountErrorMessage.value = t('vaildate.amount.amount') + amountLimits.minAmount + '-' + amountLimits.maxAmount
  300. return false
  301. }
  302. if (amountLimits.maxAmount && numValue > parseFloat(amountLimits.maxAmount)) {
  303. amountErrorMessage.value = t('vaildate.amount.amount') + amountLimits.minAmount + '-' + amountLimits.maxAmount
  304. return false
  305. }
  306. if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(amount)) {
  307. amountErrorMessage.value = t('vaildate.amount.format')
  308. return false
  309. }
  310. amountErrorMessage.value = ''
  311. return true
  312. }
  313. const setAllAmount = () => {
  314. const found = loginOptions.value.find(opt => opt.login === Number(loginValue.value))
  315. form.amount = found.balance
  316. validateAmount()
  317. }
  318. // 模板引用
  319. const formRef = ref(null)
  320. // 计算属性
  321. const getInfoStatus5 = computed(() => {
  322. if (ibInfo.value?.closeFunctions) {
  323. return ibInfo.value.closeFunctions.indexOf('5') !== -1
  324. }
  325. return false
  326. })
  327. // 单位类型
  328. function groupCurrency(type) {
  329. const map = { GBP: ': £', USD: ': $', EUR: ': €', USC: ': ¢' }
  330. return map[type] || ': $'
  331. }
  332. function groupCurrency1(type) {
  333. const map = { GBP: '£', USD: '$', EUR: '€', USC: '¢' }
  334. return map[type] || '$'
  335. }
  336. // 账户类型
  337. function groupTypeName(type) {
  338. const typeMap = {
  339. '1': t('AccountType.ClassicAccount'),
  340. '2': t('AccountType.SeniorAccount'),
  341. '5': t('AccountType.SpeedAccount'),
  342. '6': t('AccountType.SpeedAccount'),
  343. '7': t('AccountType.StandardAccount'),
  344. '8': t('AccountType.CentAccount')
  345. }
  346. return typeMap[type] || ''
  347. }
  348. // 转出账户列表
  349. const withdrawDisplayList = computed(() => {
  350. return loginOptions.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: item.closeFunctions?.indexOf('3') != -1 || item.closeFunctions?.indexOf('5') != -1
  354. }))
  355. })
  356. // 转入账户列表
  357. const depositDisplayList = computed(() => {
  358. return toOptions.value.map(item => ({
  359. text: `${item.login} - ${groupTypeName(item.type)} - ${t('Custom.Deposit.AvailableBalance')}${groupCurrency(item.currency)}${item.balance}`,
  360. value: item.login
  361. }))
  362. })
  363. const currencyOptions = ref([{ value: 'USD', text: 'USD' }])
  364. function toHome() {
  365. uni.navigateTo({ url: '/pages/ib/index' })
  366. InfoStatus5.value = false
  367. }
  368. function closeDia() {
  369. resetForm()
  370. formRef.value?.resetFields?.()
  371. step2.value = false
  372. loginValue.value = null
  373. dialogCheck.value = false
  374. dialogVisible.value = false
  375. tableData4TwoFlag.value = false
  376. tableDataNewListFlag.value = false
  377. }
  378. // 内转
  379. async function toTransfer() {
  380. if (submitting.value) return
  381. try {
  382. const valid = await formRef.value?.validate()
  383. if (!valid) {
  384. console.log('表单验证失败')
  385. return
  386. }
  387. openDontActive()
  388. } catch (error) {
  389. console.error('验证失败:', error)
  390. }
  391. }
  392. // 打开不参加活动弹窗
  393. function openDontActive() {
  394. tosubmitConfirm()
  395. }
  396. function tosubmitConfirm() {
  397. dialogDontActive.value = false
  398. transferConfig()
  399. }
  400. async function transferConfig() {
  401. if (submitting.value) return
  402. submitting.value = true
  403. try {
  404. if (flag.value) {
  405. return
  406. }
  407. flag.value = true
  408. form.activityTwoPercentGive = form.agree5 ? 1 : 0
  409. form.activityGive = form.agree6 ? 1 : 0
  410. dialogCheckWait.value = true
  411. const res = await ibApi.agentTransferApply({ ...form })
  412. dialogCheckWait.value = false
  413. if (res.code == Code.StatusOK) {
  414. dialogCheck.value = true
  415. dialogVisible.value = true
  416. flag.value = false
  417. } else {
  418. RES.value = res.msg
  419. dialogCheck.value = true
  420. dialogVisible.value = false
  421. flag.value = false
  422. }
  423. } catch (error) {
  424. console.error('转账失败:', error)
  425. RES.value = error.msg
  426. dialogCheck.value = true
  427. dialogVisible.value = false
  428. } finally {
  429. resetForm()
  430. if (dialogCheckWait.value) dialogCheckWait.value = false
  431. }
  432. }
  433. // 取消
  434. function cancle() {
  435. step2.value = false
  436. loginValue.value = null
  437. }
  438. // 获取账户信息
  439. async function getDateList() {
  440. const res = await ibApi.CustomDropdown({ platform: '' })
  441. if (res.code == Code.StatusOK) {
  442. loginOptions.value = res.data
  443. } else {
  444. uni.showToast({ title: res.msg, icon: 'none' })
  445. }
  446. }
  447. const loading = ref(false)
  448. // 获取转入账户信息
  449. async function getToDateList() {
  450. loading.value = true
  451. const res = await ibApi.accountCustomList({})
  452. if (res.code == Code.StatusOK) {
  453. toOptions.value = res.data
  454. } else {
  455. uni.showToast({ title: res.msg, icon: 'none' })
  456. }
  457. loading.value = false
  458. }
  459. // 获取内转数额区间
  460. async function getAmount() {
  461. const res = await financialApi.transferInfo({})
  462. if (res.code == Code.StatusOK) {
  463. Object.assign(amountLimits, res.data)
  464. } else {
  465. uni.showToast({ title: res.msg, icon: 'none' })
  466. }
  467. }
  468. async function Activity24nianzhongTwoInfo() {
  469. const res = await activityApi.Activity23nianzhongTwoInfo({})
  470. if (res.code == Code.StatusOK) {
  471. tableData4Two.value = res.data
  472. } else {
  473. uni.showToast({ title: res.msg, icon: 'none' })
  474. }
  475. }
  476. // 活动相关方法
  477. function togetActivity() {
  478. get23nianzhongTwoLogin()
  479. getActivityExtensionGiveLogin()
  480. getActivityExtensionGiveLoginJoin()
  481. }
  482. async function get23nianzhongTwoLogin() {
  483. const res = await activityApi.Activity23nianzhongTwoLogin({
  484. login: form.depositLogin,
  485. })
  486. if (res.code == Code.StatusOK) {
  487. tableData4Two.value = res.data
  488. if (tableData4Two.value.show == 1) {
  489. tableData4TwoFlag.value = true
  490. } else if (tableData4Two.value.show == 0) {
  491. tableData4TwoFlag.value = false
  492. }
  493. } else {
  494. uni.showToast({ title: res.msg, icon: 'none' })
  495. }
  496. }
  497. async function getActivityExtensionGiveLogin() {
  498. const res = await activityApi.ActivityExtensionGiveLogin({
  499. login: form.depositLogin,
  500. })
  501. if (res.code == Code.StatusOK) {
  502. tableDataNewList.value = res.data
  503. if (tableDataNewList.value.show == 1) {
  504. tableDataNewListFlag.value = true
  505. } else if (tableDataNewList.value.show == 0) {
  506. tableDataNewListFlag.value = false
  507. }
  508. } else {
  509. uni.showToast({ title: res.msg, icon: 'none' })
  510. }
  511. }
  512. async function getActivityExtensionGiveLoginJoin() {
  513. const res = await activityApi.ActivityExtensionGiveLoginJoin({
  514. login: form.depositLogin,
  515. })
  516. if (res.code == Code.StatusOK) {
  517. giveLoginJoin.value = res.data
  518. } else {
  519. uni.showToast({ title: res.msg, icon: 'none' })
  520. giveLoginJoin.value = ''
  521. }
  522. }
  523. const showCentAccountTransferTip = (login) => {
  524. const selectedAccount = loginOptions.value.find(
  525. (item) => item.login == login,
  526. );
  527. if (!selectedAccount) {
  528. return;
  529. }
  530. const isCentAccount =
  531. selectedAccount.type == "8" || selectedAccount.currency === "USC";
  532. if (isCentAccount) {
  533. confirm({
  534. title: t("Msg.SystemPrompt"),
  535. content: t("vu.item14") + t("vu.item15") + t("vu.item16"),
  536. confirmText: t("Btn.Confirm"),
  537. cancelText: t("Btn.Cancel"),
  538. })
  539. }
  540. }
  541. // 监听 loginValue 变化
  542. watch(loginValue, (newVal) => {
  543. if (newVal != null) {
  544. step2.value = true
  545. form.withdrawLogin = Number(newVal)
  546. showCentAccountTransferTip(newVal)
  547. form.depositLogin = null
  548. form.depositLogin1 = null
  549. form.amount = ''
  550. form.agree5 = false
  551. form.agree6 = false
  552. amountErrorMessage.value = ''
  553. }
  554. })
  555. // 监听 loginValue 变化
  556. watch(form.depositLogin, (newVal) => {
  557. if (newVal) {
  558. togetActivity()
  559. }
  560. })
  561. // 监听 agree6 变化
  562. watch(() => form.agree6, (newVal) => {
  563. if (newVal && giveLoginJoin.value?.flag === false) {
  564. let tips = ''
  565. if (giveLoginJoin.value.promptType == 1) {
  566. tips = t('surplusList.item10')
  567. } else {
  568. tips = t('surplusList.item11')
  569. }
  570. return
  571. // 活动相关方法,后续需要在调整
  572. if (giveLoginJoin.value.activityCategory == 1) {
  573. $pigeon?.MessageConfirm(
  574. tips,
  575. t('Msg.SystemPrompt'),
  576. t('surplusList.item12'),
  577. t('Home.msg.item3'),
  578. () => {
  579. $pigeon?.MessageConfirm(
  580. t('surplusList.item13'),
  581. t('Msg.SystemPrompt'),
  582. t('Btn.Confirm'),
  583. t('Btn.Cancel'),
  584. async () => {
  585. try {
  586. const res = await activityApi.ActivityGiveCancel({
  587. login: loginValue.value,
  588. })
  589. if (res.code == Code.StatusOK) {
  590. $pigeon?.MessageOK(res.msg || t('Msg.Success'))
  591. } else {
  592. uni.showToast({ title: res.msg, icon: 'none' })
  593. }
  594. } catch (error) {
  595. $pigeon?.MessageError(t('Msg.Fail'))
  596. }
  597. },
  598. () => {
  599. form.agree6 = false
  600. }
  601. )
  602. },
  603. () => {
  604. form.agree6 = false
  605. }
  606. )
  607. } else {
  608. $pigeon?.MessageConfirm(
  609. tips,
  610. t('Msg.SystemPrompt'),
  611. t('Btn.Confirm'),
  612. t('Btn.Cancel'),
  613. () => { },
  614. () => {
  615. form.agree6 = false
  616. }
  617. )
  618. }
  619. }
  620. })
  621. onMounted(() => {
  622. if (getInfoStatus5.value) {
  623. InfoStatus5.value = true
  624. }
  625. getDateList()
  626. getToDateList()
  627. getAmount()
  628. // Activity24nianzhongTwoInfo()
  629. })
  630. onLoad((options) => {
  631. if (options?.login) {
  632. loginValue.value = Number(options.login)
  633. step2.value = true
  634. form.withdrawLogin = Number(options.login)
  635. }
  636. })
  637. </script>
  638. <style lang="scss" scoped>
  639. @import "@/uni.scss";
  640. .transfer-page {
  641. width: 100%;
  642. padding-bottom: px2rpx(20);
  643. .main-content {
  644. text-align: left;
  645. .box {
  646. padding-top: px2rpx(5);
  647. color: #303133;
  648. .b-card {
  649. border: 1px solid var(--bs-border-color);
  650. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  651. margin-bottom: px2rpx(10);
  652. border-radius: px2rpx(6);
  653. box-shadow: 0 px2rpx(1) px2rpx(6) 0 rgba(0, 0, 0, 0.05);
  654. &:hover {
  655. box-shadow: 0 px2rpx(2) px2rpx(8) 0 rgba(0, 0, 0, 0.1);
  656. }
  657. .card-top {
  658. padding: px2rpx(15) px2rpx(20);
  659. box-sizing: border-box;
  660. .card-row {
  661. margin-bottom: px2rpx(12);
  662. &:last-child {
  663. margin-bottom: 0;
  664. }
  665. }
  666. .tit {
  667. font-size: px2rpx(16);
  668. font-weight: 600;
  669. margin-bottom: px2rpx(16);
  670. display: flex;
  671. align-items: center;
  672. color: var(--bs-heading-color);
  673. position: relative;
  674. padding-left: 20px;
  675. &:after {
  676. content: '';
  677. position: absolute;
  678. left: 0;
  679. top: 50%;
  680. transform: translateY(-50%);
  681. width: 0;
  682. height: 0;
  683. border-top: 6px solid transparent;
  684. border-bottom: 6px solid transparent;
  685. border-left: 8px solid currentColor;
  686. }
  687. .iconfont {
  688. margin-right: px2rpx(8);
  689. color: var(--color-primary);
  690. font-size: px2rpx(18);
  691. }
  692. }
  693. .title-wrapper {
  694. display: flex;
  695. justify-content: space-between;
  696. align-items: center;
  697. }
  698. }
  699. }
  700. }
  701. .box-step2 {
  702. .form-row {
  703. display: flex;
  704. flex-wrap: wrap;
  705. margin-bottom: px2rpx(12);
  706. gap: px2rpx(12);
  707. &:last-child {
  708. margin-bottom: 0;
  709. }
  710. .form-col {
  711. flex: 1;
  712. min-width: px2rpx(140);
  713. @media screen and (max-width: 991px) {
  714. flex: 0 0 100%;
  715. width: 100%;
  716. }
  717. }
  718. .amount-box {
  719. display: flex;
  720. align-items: center;
  721. gap: px2rpx(12);
  722. .amount-input {
  723. flex: 1;
  724. }
  725. .btn {
  726. display: flex;
  727. align-items: center;
  728. justify-content: center;
  729. font-size: px2rpx(14);
  730. color: var(--color-zinc-600);
  731. margin-bottom: px2rpx(20);
  732. height: px2rpx(35);
  733. background-color: #cf1322;
  734. color: var(--bs-emphasis-color);
  735. border-radius: px2rpx(4);
  736. font-weight: 600;
  737. display: flex;
  738. align-items: center;
  739. justify-content: center;
  740. border: none;
  741. padding: 0 px2rpx(20);
  742. cursor: pointer;
  743. margin-top: px2rpx(34);
  744. }
  745. }
  746. .form-col-full {
  747. width: 100%;
  748. padding: 0 px2rpx(5);
  749. }
  750. }
  751. .tips {
  752. line-height: 1.8;
  753. font-size: px2rpx(12);
  754. color: var(--bs-heading-color);
  755. background-color: rgba(var(--bs-body-bg-rgb), 1) !important;
  756. padding: px2rpx(12);
  757. border-radius: px2rpx(4);
  758. border-left: px2rpx(2) solid #cf1322;
  759. .title {
  760. font-weight: 600;
  761. margin-bottom: px2rpx(6);
  762. color: var(--bs-heading-color);
  763. }
  764. }
  765. }
  766. }
  767. .picker-select {
  768. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  769. border: 1px solid #dcdfe6;
  770. border-radius: px2rpx(4);
  771. padding: px2rpx(12) px2rpx(14);
  772. font-size: px2rpx(14);
  773. color: #606266;
  774. line-height: 1.4;
  775. width: 100%;
  776. box-sizing: border-box;
  777. &:hover {
  778. border-color: #409eff;
  779. }
  780. &.picker-disabled {
  781. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  782. color: #c0c4cc;
  783. cursor: not-allowed;
  784. }
  785. }
  786. .disabled-input {
  787. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  788. border: 1px solid #dcdfe6;
  789. border-radius: px2rpx(4);
  790. padding: px2rpx(12) px2rpx(14);
  791. font-size: px2rpx(14);
  792. color: #606266;
  793. width: 100%;
  794. box-sizing: border-box;
  795. }
  796. .m-input {
  797. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  798. border: 1px solid #dcdfe6;
  799. border-radius: px2rpx(4);
  800. padding: px2rpx(12) px2rpx(14);
  801. font-size: px2rpx(14);
  802. width: 100%;
  803. box-sizing: border-box;
  804. &:focus {
  805. border-color: #409eff;
  806. outline: none;
  807. box-shadow: 0 0 0 px2rpx(1) rgba(64, 158, 255, 0.2);
  808. }
  809. }
  810. .popup-content {
  811. padding: px2rpx(30) px2rpx(20);
  812. text-align: center;
  813. min-width: px2rpx(250);
  814. max-width: 80%;
  815. margin: 0 auto;
  816. @media screen and (max-width: 991px) {
  817. min-width: 80%;
  818. max-width: 90%;
  819. margin: 0 px2rpx(10);
  820. }
  821. position: relative;
  822. .icon {
  823. .iconfont {
  824. font-size: px2rpx(60);
  825. display: block;
  826. margin: 0 auto;
  827. }
  828. .icon-chenggong {
  829. color: #67c23a;
  830. }
  831. .icon-jingshi {
  832. color: #f56c6c;
  833. }
  834. .icon-dengdai {
  835. color: #e6a23c;
  836. }
  837. }
  838. .des1 {
  839. font-weight: 600;
  840. font-size: px2rpx(16);
  841. margin: px2rpx(20) 0 px2rpx(15);
  842. color: #303133;
  843. line-height: 1.4;
  844. padding: 0 px2rpx(10);
  845. }
  846. .dialog-footer {
  847. display: flex;
  848. justify-content: center;
  849. gap: px2rpx(10);
  850. margin-top: px2rpx(10);
  851. @media (max-width: 750rpx) {
  852. flex-direction: column;
  853. align-items: center;
  854. gap: px2rpx(6);
  855. }
  856. button {
  857. min-width: px2rpx(90);
  858. padding: 0 px2rpx(12);
  859. border-radius: px2rpx(4);
  860. font-size: px2rpx(14);
  861. transition: all 0.3s ease;
  862. cursor: pointer;
  863. &[type="primary"] {
  864. background-color: #409eff;
  865. color: var(--bs-emphasis-color);
  866. border: none;
  867. &:hover {
  868. background-color: #66b1ff;
  869. transform: translateY(px2rpx(-1));
  870. box-shadow: 0 px2rpx(2) px2rpx(6) 0 rgba(64, 158, 255, 0.3);
  871. }
  872. &:active {
  873. background-color: #3a8ee6;
  874. transform: translateY(0);
  875. }
  876. }
  877. &:not([type="primary"]) {
  878. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  879. border: 1px solid #dcdfe6;
  880. color: #606266;
  881. &:hover {
  882. border-color: #409eff;
  883. color: #409eff;
  884. transform: translateY(px2rpx(-1));
  885. }
  886. &:active {
  887. transform: translateY(0);
  888. }
  889. }
  890. }
  891. }
  892. }
  893. .wait-popup {
  894. .des1 {
  895. margin-top: px2rpx(10);
  896. }
  897. .icon {
  898. .iconfont {
  899. animation: spin 1s linear infinite;
  900. }
  901. }
  902. }
  903. }
  904. // 动画
  905. @keyframes popupFadeIn {
  906. from {
  907. opacity: 0;
  908. transform: scale(0.9);
  909. }
  910. to {
  911. opacity: 1;
  912. transform: scale(1);
  913. }
  914. }
  915. @keyframes fadeIn {
  916. from {
  917. opacity: 0;
  918. transform: translateY(px2rpx(10));
  919. }
  920. to {
  921. opacity: 1;
  922. transform: translateY(0);
  923. }
  924. }
  925. @keyframes pulse {
  926. 0% {
  927. transform: scale(1);
  928. }
  929. 50% {
  930. transform: scale(1.05);
  931. }
  932. 100% {
  933. transform: scale(1);
  934. }
  935. }
  936. @keyframes spin {
  937. from {
  938. transform: rotate(0deg);
  939. }
  940. to {
  941. transform: rotate(360deg);
  942. }
  943. }
  944. // 表单错误信息样式
  945. .uni-forms-item__error {
  946. font-size: px2rpx(12);
  947. color: #f56c6c;
  948. margin-top: px2rpx(4);
  949. }
  950. // 适配不同屏幕尺寸(媒体查询中的 750rpx 保持不变)
  951. @media (max-width: 750rpx) {
  952. .transfer-page {
  953. .main-content {
  954. padding: px2rpx(8);
  955. .box {
  956. .b-card {
  957. .card-top {
  958. padding: px2rpx(12) px2rpx(16);
  959. .tit {
  960. font-size: px2rpx(14);
  961. .iconfont {
  962. font-size: px2rpx(16);
  963. }
  964. }
  965. }
  966. }
  967. }
  968. }
  969. .s-btn {
  970. font-size: px2rpx(14);
  971. padding: px2rpx(10) px2rpx(16);
  972. }
  973. .popup-content {
  974. padding: px2rpx(20) px2rpx(16);
  975. .icon {
  976. .iconfont {
  977. font-size: px2rpx(50);
  978. }
  979. }
  980. .des1 {
  981. font-size: px2rpx(14);
  982. margin: px2rpx(15) 0 px2rpx(10);
  983. }
  984. .dialog-footer {
  985. button {
  986. min-width: px2rpx(80);
  987. font-size: px2rpx(13);
  988. }
  989. }
  990. }
  991. }
  992. }
  993. </style>