agent-transfer.vue 37 KB

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