agent-transfer.vue 36 KB

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