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