agent-transfer.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  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(
  593. () => form.agree6,
  594. async (newVal) => {
  595. if (newVal && giveLoginJoin.value?.flag === false) {
  596. let tips = ''
  597. if (giveLoginJoin.value.promptType == 1) {
  598. tips = t('surplusList.item10')
  599. } else {
  600. tips = t('surplusList.item11')
  601. }
  602. if (giveLoginJoin.value.activityCategory == 1) {
  603. try {
  604. await confirm({
  605. title: t('Msg.SystemPrompt'),
  606. content: tips,
  607. confirmText: t('surplusList.item12'),
  608. cancelText: t('Home.msg.item3'),
  609. })
  610. } catch {
  611. return
  612. }
  613. await new Promise((resolve) => {
  614. setTimeout(() => resolve(true), 300)
  615. })
  616. try {
  617. await confirm({
  618. title: t('Msg.SystemPrompt'),
  619. content: t('surplusList.item13'),
  620. confirmText: t('Btn.Confirm'),
  621. cancelText: t('Btn.Cancel'),
  622. })
  623. } catch {
  624. form.agree6 = false
  625. return
  626. }
  627. try {
  628. const res = await activityApi.ActivityGiveCancel({
  629. login: form.depositLogin,
  630. })
  631. if (res.code == Code.StatusOK) {
  632. uni.showToast({ title: res.msg || t('Msg.Success'), icon: 'none' })
  633. } else {
  634. uni.showToast({ title: res.msg, icon: 'none' })
  635. }
  636. } catch {
  637. uni.showToast({ title: t('Msg.Fail'), icon: 'none' })
  638. }
  639. } else if (giveLoginJoin.value.activityCategory == 2) {
  640. try {
  641. await confirm({
  642. title: t('Msg.SystemPrompt'),
  643. content: tips,
  644. confirmText: '跳转',
  645. cancelText: t('Btn.Cancel'),
  646. })
  647. } catch {
  648. return
  649. }
  650. await new Promise((resolve) => {
  651. setTimeout(() => resolve(true), 300)
  652. })
  653. try {
  654. await confirm({
  655. title: t('Msg.SystemPrompt'),
  656. content: '是否跳转到对应活动取消',
  657. confirmText: t('Btn.Confirm'),
  658. cancelText: t('Btn.Cancel'),
  659. })
  660. uni.navigateTo({
  661. url: '/pages/activities/monthly-list',
  662. })
  663. } catch {
  664. form.agree6 = false
  665. }
  666. } else {
  667. try {
  668. await confirm({
  669. title: t('Msg.SystemPrompt'),
  670. content: tips,
  671. confirmText: t('Btn.Confirm'),
  672. cancelText: t('Btn.Cancel'),
  673. })
  674. } catch {
  675. form.agree6 = false
  676. }
  677. }
  678. }
  679. },
  680. )
  681. onMounted(() => {
  682. if (getInfoStatus5.value) {
  683. InfoStatus5.value = true
  684. }
  685. getDateList()
  686. getToDateList()
  687. getAmount()
  688. // Activity24nianzhongTwoInfo()
  689. })
  690. onLoad((options) => {
  691. if (options?.login) {
  692. loginValue.value = Number(options.login)
  693. step2.value = true
  694. form.withdrawLogin = Number(options.login)
  695. }
  696. })
  697. </script>
  698. <style lang="scss" scoped>
  699. @import "@/uni.scss";
  700. .container {
  701. padding: 0;
  702. }
  703. .text-color {
  704. color: var(--bs-emphasis-color);
  705. font-size: px2rpx(14);
  706. line-height: 1.5;
  707. }
  708. .amount-box {
  709. display: flex;
  710. align-items: center;
  711. gap: px2rpx(12);
  712. .amount-input {
  713. flex: 1;
  714. }
  715. .btn {
  716. margin-bottom: px2rpx(20);
  717. }
  718. }
  719. .transfer-page {
  720. width: 100%;
  721. padding-bottom: px2rpx(20);
  722. .main-content {
  723. text-align: left;
  724. .box {
  725. padding-top: px2rpx(5);
  726. color: #303133;
  727. .b-card {
  728. border: 1px solid var(--bs-border-color);
  729. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  730. margin-bottom: px2rpx(10);
  731. border-radius: px2rpx(6);
  732. box-shadow: 0 px2rpx(1) px2rpx(6) 0 rgba(0, 0, 0, 0.05);
  733. &:hover {
  734. box-shadow: 0 px2rpx(2) px2rpx(8) 0 rgba(0, 0, 0, 0.1);
  735. }
  736. .card-top {
  737. padding: px2rpx(15) px2rpx(20);
  738. box-sizing: border-box;
  739. .card-row {
  740. margin-bottom: px2rpx(12);
  741. &:last-child {
  742. margin-bottom: 0;
  743. }
  744. }
  745. .tit {
  746. font-size: px2rpx(16);
  747. font-weight: 600;
  748. margin-bottom: px2rpx(16);
  749. display: flex;
  750. align-items: center;
  751. color: var(--bs-heading-color);
  752. position: relative;
  753. padding-left: 20px;
  754. &:after {
  755. content: '';
  756. position: absolute;
  757. left: 0;
  758. top: 50%;
  759. transform: translateY(-50%);
  760. width: 0;
  761. height: 0;
  762. border-top: 6px solid transparent;
  763. border-bottom: 6px solid transparent;
  764. border-left: 8px solid currentColor;
  765. }
  766. .iconfont {
  767. margin-right: px2rpx(8);
  768. color: var(--color-primary);
  769. font-size: px2rpx(18);
  770. }
  771. }
  772. .title-wrapper {
  773. display: flex;
  774. justify-content: space-between;
  775. align-items: center;
  776. }
  777. }
  778. }
  779. }
  780. .box-step2 {
  781. .form-row {
  782. display: flex;
  783. flex-wrap: wrap;
  784. margin-bottom: px2rpx(12);
  785. gap: px2rpx(12);
  786. &:last-child {
  787. margin-bottom: 0;
  788. }
  789. .form-col {
  790. flex: 1;
  791. min-width: px2rpx(140);
  792. @media screen and (max-width: 991px) {
  793. flex: 0 0 100%;
  794. width: 100%;
  795. }
  796. }
  797. .form-col-full {
  798. width: 100%;
  799. padding: 0 px2rpx(5);
  800. }
  801. }
  802. .tips {
  803. line-height: 1.8;
  804. font-size: px2rpx(12);
  805. color: var(--bs-heading-color);
  806. background-color: rgba(var(--bs-body-bg-rgb), 1) !important;
  807. padding: px2rpx(12);
  808. border-radius: px2rpx(4);
  809. border-left: px2rpx(2) solid #cf1322;
  810. .title {
  811. font-weight: 600;
  812. margin-bottom: px2rpx(6);
  813. color: var(--bs-heading-color);
  814. }
  815. }
  816. }
  817. }
  818. .picker-select {
  819. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  820. border: 1px solid #dcdfe6;
  821. border-radius: px2rpx(4);
  822. padding: px2rpx(12) px2rpx(14);
  823. font-size: px2rpx(14);
  824. color: #606266;
  825. line-height: 1.4;
  826. width: 100%;
  827. box-sizing: border-box;
  828. &:hover {
  829. border-color: #409eff;
  830. }
  831. &.picker-disabled {
  832. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  833. color: #c0c4cc;
  834. cursor: not-allowed;
  835. }
  836. }
  837. .disabled-input {
  838. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  839. border: 1px solid #dcdfe6;
  840. border-radius: px2rpx(4);
  841. padding: px2rpx(12) px2rpx(14);
  842. font-size: px2rpx(14);
  843. color: #606266;
  844. width: 100%;
  845. box-sizing: border-box;
  846. }
  847. .m-input {
  848. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  849. border: 1px solid #dcdfe6;
  850. border-radius: px2rpx(4);
  851. padding: px2rpx(12) px2rpx(14);
  852. font-size: px2rpx(14);
  853. width: 100%;
  854. box-sizing: border-box;
  855. &:focus {
  856. border-color: #409eff;
  857. outline: none;
  858. box-shadow: 0 0 0 px2rpx(1) rgba(64, 158, 255, 0.2);
  859. }
  860. }
  861. .popup-content {
  862. padding: px2rpx(30) px2rpx(20);
  863. text-align: center;
  864. min-width: px2rpx(250);
  865. max-width: 80%;
  866. margin: 0 auto;
  867. @media screen and (max-width: 991px) {
  868. min-width: 80%;
  869. max-width: 90%;
  870. margin: 0 px2rpx(10);
  871. }
  872. position: relative;
  873. .icon {
  874. .iconfont {
  875. font-size: px2rpx(60);
  876. display: block;
  877. margin: 0 auto;
  878. }
  879. .icon-chenggong {
  880. color: #67c23a;
  881. }
  882. .icon-jingshi {
  883. color: #f56c6c;
  884. }
  885. .icon-dengdai {
  886. color: #e6a23c;
  887. }
  888. }
  889. .des1 {
  890. font-weight: 600;
  891. font-size: px2rpx(16);
  892. margin: px2rpx(20) 0 px2rpx(15);
  893. color: #303133;
  894. line-height: 1.4;
  895. padding: 0 px2rpx(10);
  896. }
  897. .dialog-footer {
  898. display: flex;
  899. justify-content: center;
  900. gap: px2rpx(10);
  901. margin-top: px2rpx(10);
  902. @media (max-width: 750rpx) {
  903. flex-direction: column;
  904. align-items: center;
  905. gap: px2rpx(6);
  906. }
  907. button {
  908. min-width: px2rpx(90);
  909. padding: 0 px2rpx(12);
  910. border-radius: px2rpx(4);
  911. font-size: px2rpx(14);
  912. transition: all 0.3s ease;
  913. cursor: pointer;
  914. &[type="primary"] {
  915. background-color: #409eff;
  916. color: var(--bs-emphasis-color);
  917. border: none;
  918. &:hover {
  919. background-color: #66b1ff;
  920. transform: translateY(px2rpx(-1));
  921. box-shadow: 0 px2rpx(2) px2rpx(6) 0 rgba(64, 158, 255, 0.3);
  922. }
  923. &:active {
  924. background-color: #3a8ee6;
  925. transform: translateY(0);
  926. }
  927. }
  928. &:not([type="primary"]) {
  929. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  930. border: 1px solid #dcdfe6;
  931. color: #606266;
  932. &:hover {
  933. border-color: #409eff;
  934. color: #409eff;
  935. transform: translateY(px2rpx(-1));
  936. }
  937. &:active {
  938. transform: translateY(0);
  939. }
  940. }
  941. }
  942. }
  943. }
  944. .wait-popup {
  945. .des1 {
  946. margin-top: px2rpx(10);
  947. }
  948. .icon {
  949. .iconfont {
  950. animation: spin 1s linear infinite;
  951. }
  952. }
  953. }
  954. }
  955. // 动画
  956. @keyframes popupFadeIn {
  957. from {
  958. opacity: 0;
  959. transform: scale(0.9);
  960. }
  961. to {
  962. opacity: 1;
  963. transform: scale(1);
  964. }
  965. }
  966. @keyframes fadeIn {
  967. from {
  968. opacity: 0;
  969. transform: translateY(px2rpx(10));
  970. }
  971. to {
  972. opacity: 1;
  973. transform: translateY(0);
  974. }
  975. }
  976. @keyframes pulse {
  977. 0% {
  978. transform: scale(1);
  979. }
  980. 50% {
  981. transform: scale(1.05);
  982. }
  983. 100% {
  984. transform: scale(1);
  985. }
  986. }
  987. @keyframes spin {
  988. from {
  989. transform: rotate(0deg);
  990. }
  991. to {
  992. transform: rotate(360deg);
  993. }
  994. }
  995. // 表单错误信息样式
  996. .uni-forms-item__error {
  997. font-size: px2rpx(12);
  998. color: #f56c6c;
  999. margin-top: px2rpx(4);
  1000. }
  1001. // 适配不同屏幕尺寸(媒体查询中的 750rpx 保持不变)
  1002. @media (max-width: 750rpx) {
  1003. .transfer-page {
  1004. .main-content {
  1005. padding: px2rpx(8);
  1006. .box {
  1007. .b-card {
  1008. .card-top {
  1009. padding: px2rpx(12) px2rpx(16);
  1010. .tit {
  1011. font-size: px2rpx(14);
  1012. .iconfont {
  1013. font-size: px2rpx(16);
  1014. }
  1015. }
  1016. }
  1017. }
  1018. }
  1019. }
  1020. .s-btn {
  1021. font-size: px2rpx(14);
  1022. padding: px2rpx(10) px2rpx(16);
  1023. }
  1024. .popup-content {
  1025. padding: px2rpx(20) px2rpx(16);
  1026. .icon {
  1027. .iconfont {
  1028. font-size: px2rpx(50);
  1029. }
  1030. }
  1031. .des1 {
  1032. font-size: px2rpx(14);
  1033. margin: px2rpx(15) 0 px2rpx(10);
  1034. }
  1035. .dialog-footer {
  1036. button {
  1037. min-width: px2rpx(80);
  1038. font-size: px2rpx(13);
  1039. }
  1040. }
  1041. }
  1042. }
  1043. }
  1044. </style>