agent-transfer.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104
  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. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  650. margin-bottom: px2rpx(10);
  651. border-radius: px2rpx(6);
  652. box-shadow: 0 px2rpx(1) px2rpx(6) 0 rgba(0, 0, 0, 0.05);
  653. &:hover {
  654. box-shadow: 0 px2rpx(2) px2rpx(8) 0 rgba(0, 0, 0, 0.1);
  655. }
  656. .card-top {
  657. padding: px2rpx(15) px2rpx(20);
  658. box-sizing: border-box;
  659. .card-row {
  660. margin-bottom: px2rpx(12);
  661. &:last-child {
  662. margin-bottom: 0;
  663. }
  664. }
  665. .tit {
  666. font-size: px2rpx(16);
  667. font-weight: 600;
  668. margin-bottom: px2rpx(16);
  669. display: flex;
  670. align-items: center;
  671. color: var(--bs-heading-color);
  672. position: relative;
  673. padding-left: 20px;
  674. &:after {
  675. content: '';
  676. position: absolute;
  677. left: 0;
  678. top: 50%;
  679. transform: translateY(-50%);
  680. width: 0;
  681. height: 0;
  682. border-top: 6px solid transparent;
  683. border-bottom: 6px solid transparent;
  684. border-left: 8px solid currentColor;
  685. }
  686. .iconfont {
  687. margin-right: px2rpx(8);
  688. color: var(--color-primary);
  689. font-size: px2rpx(18);
  690. }
  691. }
  692. .title-wrapper {
  693. display: flex;
  694. justify-content: space-between;
  695. align-items: center;
  696. }
  697. }
  698. }
  699. }
  700. .box-step2 {
  701. .form-row {
  702. display: flex;
  703. flex-wrap: wrap;
  704. margin-bottom: px2rpx(12);
  705. gap: px2rpx(12);
  706. &:last-child {
  707. margin-bottom: 0;
  708. }
  709. .form-col {
  710. flex: 1;
  711. min-width: px2rpx(140);
  712. @media screen and (max-width: 991px) {
  713. flex: 0 0 100%;
  714. width: 100%;
  715. }
  716. }
  717. .amount-box {
  718. display: flex;
  719. align-items: center;
  720. gap: px2rpx(12);
  721. .amount-input {
  722. flex: 1;
  723. }
  724. .btn {
  725. display: flex;
  726. align-items: center;
  727. justify-content: center;
  728. font-size: px2rpx(14);
  729. color: var(--color-zinc-600);
  730. margin-bottom: px2rpx(20);
  731. height: px2rpx(35);
  732. background-color: #cf1322;
  733. color: var(--bs-emphasis-color);
  734. border-radius: px2rpx(4);
  735. font-weight: 600;
  736. display: flex;
  737. align-items: center;
  738. justify-content: center;
  739. border: none;
  740. padding: 0 px2rpx(20);
  741. cursor: pointer;
  742. margin-top: px2rpx(34);
  743. }
  744. }
  745. .form-col-full {
  746. width: 100%;
  747. padding: 0 px2rpx(5);
  748. }
  749. }
  750. .tips {
  751. line-height: 1.8;
  752. font-size: px2rpx(12);
  753. color: #909399;
  754. background-color: #f9f9f9;
  755. padding: px2rpx(12);
  756. border-radius: px2rpx(4);
  757. border-left: px2rpx(2) solid #cf1322;
  758. .title {
  759. font-weight: 600;
  760. margin-bottom: px2rpx(6);
  761. color: #606266;
  762. }
  763. }
  764. }
  765. }
  766. .picker-select {
  767. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  768. border: 1px solid #dcdfe6;
  769. border-radius: px2rpx(4);
  770. padding: px2rpx(12) px2rpx(14);
  771. font-size: px2rpx(14);
  772. color: #606266;
  773. line-height: 1.4;
  774. width: 100%;
  775. box-sizing: border-box;
  776. &:hover {
  777. border-color: #409eff;
  778. }
  779. &.picker-disabled {
  780. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  781. color: #c0c4cc;
  782. cursor: not-allowed;
  783. }
  784. }
  785. .disabled-input {
  786. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  787. border: 1px solid #dcdfe6;
  788. border-radius: px2rpx(4);
  789. padding: px2rpx(12) px2rpx(14);
  790. font-size: px2rpx(14);
  791. color: #606266;
  792. width: 100%;
  793. box-sizing: border-box;
  794. }
  795. .m-input {
  796. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  797. border: 1px solid #dcdfe6;
  798. border-radius: px2rpx(4);
  799. padding: px2rpx(12) px2rpx(14);
  800. font-size: px2rpx(14);
  801. width: 100%;
  802. box-sizing: border-box;
  803. &:focus {
  804. border-color: #409eff;
  805. outline: none;
  806. box-shadow: 0 0 0 px2rpx(1) rgba(64, 158, 255, 0.2);
  807. }
  808. }
  809. .popup-content {
  810. padding: px2rpx(30) px2rpx(20);
  811. text-align: center;
  812. min-width: px2rpx(250);
  813. max-width: 80%;
  814. margin: 0 auto;
  815. @media screen and (max-width: 991px) {
  816. min-width: 80%;
  817. max-width: 90%;
  818. margin: 0 px2rpx(10);
  819. }
  820. position: relative;
  821. .icon {
  822. .iconfont {
  823. font-size: px2rpx(60);
  824. display: block;
  825. margin: 0 auto;
  826. }
  827. .icon-chenggong {
  828. color: #67c23a;
  829. }
  830. .icon-jingshi {
  831. color: #f56c6c;
  832. }
  833. .icon-dengdai {
  834. color: #e6a23c;
  835. }
  836. }
  837. .des1 {
  838. font-weight: 600;
  839. font-size: px2rpx(16);
  840. margin: px2rpx(20) 0 px2rpx(15);
  841. color: #303133;
  842. line-height: 1.4;
  843. padding: 0 px2rpx(10);
  844. }
  845. .dialog-footer {
  846. display: flex;
  847. justify-content: center;
  848. gap: px2rpx(10);
  849. margin-top: px2rpx(10);
  850. @media (max-width: 750rpx) {
  851. flex-direction: column;
  852. align-items: center;
  853. gap: px2rpx(6);
  854. }
  855. button {
  856. min-width: px2rpx(90);
  857. padding: 0 px2rpx(12);
  858. border-radius: px2rpx(4);
  859. font-size: px2rpx(14);
  860. transition: all 0.3s ease;
  861. cursor: pointer;
  862. &[type="primary"] {
  863. background-color: #409eff;
  864. color: var(--bs-emphasis-color);
  865. border: none;
  866. &:hover {
  867. background-color: #66b1ff;
  868. transform: translateY(px2rpx(-1));
  869. box-shadow: 0 px2rpx(2) px2rpx(6) 0 rgba(64, 158, 255, 0.3);
  870. }
  871. &:active {
  872. background-color: #3a8ee6;
  873. transform: translateY(0);
  874. }
  875. }
  876. &:not([type="primary"]) {
  877. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  878. border: 1px solid #dcdfe6;
  879. color: #606266;
  880. &:hover {
  881. border-color: #409eff;
  882. color: #409eff;
  883. transform: translateY(px2rpx(-1));
  884. }
  885. &:active {
  886. transform: translateY(0);
  887. }
  888. }
  889. }
  890. }
  891. }
  892. .wait-popup {
  893. .des1 {
  894. margin-top: px2rpx(10);
  895. }
  896. .icon {
  897. .iconfont {
  898. animation: spin 1s linear infinite;
  899. }
  900. }
  901. }
  902. }
  903. // 动画
  904. @keyframes popupFadeIn {
  905. from {
  906. opacity: 0;
  907. transform: scale(0.9);
  908. }
  909. to {
  910. opacity: 1;
  911. transform: scale(1);
  912. }
  913. }
  914. @keyframes fadeIn {
  915. from {
  916. opacity: 0;
  917. transform: translateY(px2rpx(10));
  918. }
  919. to {
  920. opacity: 1;
  921. transform: translateY(0);
  922. }
  923. }
  924. @keyframes pulse {
  925. 0% {
  926. transform: scale(1);
  927. }
  928. 50% {
  929. transform: scale(1.05);
  930. }
  931. 100% {
  932. transform: scale(1);
  933. }
  934. }
  935. @keyframes spin {
  936. from {
  937. transform: rotate(0deg);
  938. }
  939. to {
  940. transform: rotate(360deg);
  941. }
  942. }
  943. // 表单错误信息样式
  944. .uni-forms-item__error {
  945. font-size: px2rpx(12);
  946. color: #f56c6c;
  947. margin-top: px2rpx(4);
  948. }
  949. // 适配不同屏幕尺寸(媒体查询中的 750rpx 保持不变)
  950. @media (max-width: 750rpx) {
  951. .transfer-page {
  952. .main-content {
  953. padding: px2rpx(8);
  954. .box {
  955. .b-card {
  956. .card-top {
  957. padding: px2rpx(12) px2rpx(16);
  958. .tit {
  959. font-size: px2rpx(14);
  960. .iconfont {
  961. font-size: px2rpx(16);
  962. }
  963. }
  964. }
  965. }
  966. }
  967. }
  968. .s-btn {
  969. font-size: px2rpx(14);
  970. padding: px2rpx(10) px2rpx(16);
  971. }
  972. .popup-content {
  973. padding: px2rpx(20) px2rpx(16);
  974. .icon {
  975. .iconfont {
  976. font-size: px2rpx(50);
  977. }
  978. }
  979. .des1 {
  980. font-size: px2rpx(14);
  981. margin: px2rpx(15) 0 px2rpx(10);
  982. }
  983. .dialog-footer {
  984. button {
  985. min-width: px2rpx(80);
  986. font-size: px2rpx(13);
  987. }
  988. }
  989. }
  990. }
  991. }
  992. </style>