agent-transfer.vue 35 KB

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