agent-transfer.vue 35 KB

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