agent-transfer.vue 35 KB

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