agent-transfer.vue 36 KB

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