regist.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183
  1. <template>
  2. <view class="regist-page" :isHeaderFixed="true" :isLoginPage="true">
  3. <view class="fixed" />
  4. <view class="main-content" :style="{ backgroundImage: `url(${loginBg})` }">
  5. <!-- 全局顶部栏:占据一整行,带有占位和背景 -->
  6. <cwg-match-media :min-width="991">
  7. <view class="global-header-bar pc-header">
  8. <view class="header-inner">
  9. <view class="logo-placeholder"></view> <!-- 左侧可预留放logo或留空 -->
  10. <LoginHeaderGroup text-color="#fff" icon-color="#fff" />
  11. </view>
  12. </view>
  13. </cwg-match-media>
  14. <!-- 移动端顶部栏:悬浮在上方,深色文字 -->
  15. <cwg-match-media :max-width="991">
  16. <view class="mobile-header-bar">
  17. <LoginHeaderGroup text-color="#141d22" icon-color="#141d22" />
  18. </view>
  19. </cwg-match-media>
  20. <uni-row class="demo-uni-row">
  21. <cwg-match-media :min-width="991">
  22. <uni-col :xs="24" :sm="24" :md="12" :lg="14" :xl="16">
  23. <view class="left-bg">
  24. <view class="left-box">
  25. <view class="inner">
  26. <view class="section-title">
  27. <text class="bg-secondary-opacity subtitle w-40" v-t="'newLoop.item11'"></text>
  28. </view>
  29. <view class="title w-700">
  30. <text v-t="'newLoop.item12'"></text>
  31. <text>&nbsp;</text>
  32. <text class="color-white" v-t="'newLoop.item13'"></text>
  33. </view>
  34. <view class="text-white" v-t="'newLoop.item14'"></view>
  35. </view>
  36. <image src="/static/images/trust-pilot.png" class="img-fluid mt--10" mode="widthFix"></image>
  37. <view class="left-content">
  38. <view class="des text-white">
  39. <text v-html="t('newSignin.item12')"></text>
  40. <br />
  41. <text v-html="t('newSignin.item12_1')"></text>
  42. <br />
  43. <text v-html="t('newSignin.item10')"></text>
  44. <br />
  45. <text v-html="t('newSignin.item11')"></text>
  46. <br />
  47. <text v-t="'newSignin.item13'"></text>
  48. <cwg-link type="pdf" :title="'newSignin.item13_1'"
  49. :url="`pdf/Risk-Disclosures-and-Acknowledgements-2020-09.pdf`" target="_blank"
  50. v-t="'newSignin.item13_1'" class="doc-link" />
  51. <text v-t="'newSignin.item13_2'"></text>
  52. <!-- <view v-t="'newSignin.item13_3'"></view>
  53. <text v-t="'newSignin.item13_4'"></text> -->
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </uni-col>
  59. </cwg-match-media>
  60. <uni-col :xs="24" :sm="24" :md="12" :lg="10" :xl="8" class="right-f">
  61. <view class="account">
  62. <cwg-match-media :max-width="991">
  63. <view class="company u-flex-y u-flex-y-center">
  64. <image src="/static/images/logo-full.svg" class="company-icon" mode="widthFix"></image>
  65. </view>
  66. </cwg-match-media>
  67. <view class="title">
  68. <view class="tit1">{{ t('newSignup.item1') }}</view>
  69. <view class="tit2">{{ t('newSignup.item2') }}</view>
  70. </view>
  71. <view>
  72. <uni-forms ref="form" :modelValue="formData" :rules="rules" validate-trigger="blur" label-position="top"
  73. label-width="120">
  74. <uni-row :gutter="20" class="formContent">
  75. <uni-col :xs="24" :md="12">
  76. <uni-forms-item name="country" :label="t('newSignup.item3')">
  77. <cwg-combox v-model:value="formData.country" :options="countryOptions" filterable>
  78. </cwg-combox>
  79. </uni-forms-item>
  80. </uni-col>
  81. <uni-col :xs="24" :md="12">
  82. <uni-forms-item name="phone" :label="t('newSignup.item5')">
  83. <uni-easyinput v-model="formData.phone"></uni-easyinput>
  84. </uni-forms-item>
  85. </uni-col>
  86. <uni-col :xs="24" :md="24">
  87. <cwg-match-media :max-width="991">
  88. <uni-forms-item name="birthDate" :label="t('newSignup.item18')">
  89. <uni-datetime-picker type="date" v-model="formData.birthDate"
  90. :placeholder="t('newSignup.item19')" @change="checkAge" />
  91. </uni-forms-item>
  92. </cwg-match-media>
  93. <cwg-match-media :min-width="992">
  94. <uni-forms-item name="birthDate" :label="t('newSignup.item18')">
  95. <uni-datetime-picker style="width: 50%;" type="date" v-model="formData.birthDate"
  96. :placeholder="t('newSignup.item19')" @change="checkAge" />
  97. </uni-forms-item>
  98. </cwg-match-media>
  99. </uni-col>
  100. <uni-col :xs="24" :md="12">
  101. <uni-forms-item name="email" :label="t('newSignup.item7')">
  102. <uni-easyinput v-model="formData.email" :placeholder="t('newSignup.item8')"
  103. :disabled="!isAgeValid || !formData.birthDate"></uni-easyinput>
  104. </uni-forms-item>
  105. </uni-col>
  106. <uni-col :xs="24" :md="12">
  107. <uni-forms-item name="emailCode" :label="t('newSignup.item9')">
  108. <view style="display: flex; gap: 8px;">
  109. <view style="flex: 1;">
  110. <uni-easyinput :disabled="!isAgeValid || !formData.birthDate" v-model="formData.emailCode"
  111. :placeholder="t('newSignup.item10')">
  112. </uni-easyinput>
  113. </view>
  114. <view class="btn-code" @click="(!isAgeValid || !formData.birthDate) ? '' : handleGetCode()">
  115. {{ getCodeString }}
  116. </view>
  117. </view>
  118. </uni-forms-item>
  119. </uni-col>
  120. <uni-col :xs="24" :md="24">
  121. <view class="agreemnet9">*{{ t('signup.agreemnet9') }}</view>
  122. </uni-col>
  123. <uni-col :xs="24" :md="12">
  124. <uni-forms-item name="password" :label="t('newSignup.item12')">
  125. <uni-easyinput v-model.trim="formData.password" :disabled="!isAgeValid || !formData.birthDate"
  126. :placeholder="t('newSignup.item13')" type="password"></uni-easyinput>
  127. </uni-forms-item>
  128. <uni-col :xs="24" :md="24">
  129. <uni-forms-item>
  130. <ul class="pwd">
  131. <li :class="{ fit: rule1 }" v-t="'signup.form.rules.1st'"></li>
  132. <li :class="{ fit: rule2 }" v-t="'signup.form.rules.2nd'"></li>
  133. <li :class="{ fit: rule3 }" v-t="'signup.form.rules.3rd'"></li>
  134. </ul>
  135. </uni-forms-item>
  136. </uni-col>
  137. </uni-col>
  138. <uni-col :xs="24" :md="12">
  139. <uni-forms-item v-if="!isRouteHasId" name="linkValue" :label="t('newSignup.item14')">
  140. <uni-easyinput v-model.trim="formData.linkValue" :disabled="!isAgeValid || !formData.birthDate"
  141. :placeholder="t('newSignup.item15')" @input="limitAgentIdLength"></uni-easyinput>
  142. </uni-forms-item>
  143. </uni-col>
  144. </uni-row>
  145. <uni-forms-item name="agree">
  146. <view class="check-box" @click="toggleAgree">
  147. <up-checkbox-group v-model="agreeGroup" @change="onAgreeChange">
  148. <up-checkbox size="14" labelSize="14" labelColor="#666666" activeColor="#ea002a" name="agree"
  149. class="wcg-checkbox"></up-checkbox>
  150. </up-checkbox-group>
  151. <text class="checkbox-label">{{ t('signup.agree') }}</text>
  152. </view>
  153. </uni-forms-item>
  154. <uni-forms-item name="isSubscribeEmail">
  155. <view class="check-box" @click="toggleSubscribeEmail">
  156. <up-checkbox-group v-model="subscribeEmailGroup" @change="onSubscribeEmailChange">
  157. <up-checkbox size="14" labelSize="14" labelColor="#666666" activeColor="#ea002a"
  158. name="subscribeEmail" class="wcg-checkbox"></up-checkbox>
  159. </up-checkbox-group>
  160. <text class="checkbox-label">{{ t('signup.agree1') }}</text>
  161. </view>
  162. </uni-forms-item>
  163. </uni-forms>
  164. </view>
  165. <view>
  166. <u-button class="regiset-btn" @click="register">
  167. {{ t('signup.button') }}
  168. </u-button>
  169. </view>
  170. <view class="login-link">
  171. <text>{{ t('newSignup.item16') }}</text>
  172. <navigator url="/pages/login/index" class="link" hover-class="none">{{ t('newSignup.item17') }}
  173. </navigator>
  174. </view>
  175. <view class="des-bottom">
  176. <text v-t="'signup.agreemnet1'"></text>
  177. <cwg-link type="pdf" url='pdf/Client_Agreement.pdf' target="_blank" :title="'signup.agreemnet2'"
  178. class="desc-link" />
  179. <text v-t="'signup.agreemnet3'"></text>
  180. <cwg-link type="pdf" url='pdf/Terms_Conditions.pdf' target="_blank" :title="'signup.agreemnet4'"
  181. class="desc-link" />
  182. <text v-t="'signup.agreemnet5'"></text>
  183. <cwg-link type="pdf" url='pdf/Privacy_Policy.pdf' target="_blank" :title="'signup.agreemnet6'"
  184. class="desc-link" />
  185. <text v-t="'signup.agreemnet7'"></text>
  186. </view>
  187. </view>
  188. </uni-col>
  189. </uni-row>
  190. </view>
  191. <view class="chat-icon cursor-pointer" :data-tooltip="t('Downloadpage.item16')"
  192. :class="{ 'chat-icon-expanded': isChatIconExpanded, 'chat-icon-hidden': type == 'chat' }"
  193. @click="handleChatIconClick">
  194. <cwg-icon name="chat" color="#fff" />
  195. </view>
  196. </view>
  197. </template>
  198. <script setup>
  199. import { ref, watch, onMounted, computed } from 'vue'
  200. import { useI18n } from 'vue-i18n'
  201. import { useEmailCountdown } from '@/hooks/useEmailCountdown'
  202. import { loginApi } from '@/api/login'
  203. import { countryApi } from '@/api/country'
  204. import Config from '@/config/index'
  205. import { showToast } from '@/utils/toast'
  206. import { onLoad } from '@dcloudio/uni-app'
  207. import useUserStore from '@/stores/use-user-store'
  208. import { userToken } from '@/composables/config'
  209. import { userApi } from '@/api/user'
  210. import { openLocalPdf } from '@/utils/pdf.js'
  211. import ImportModel from './components/ImportModel.vue'
  212. import logoImage from '@/static/images/logo3.png'
  213. import loginBg from '@/static/images/login-bg.jpeg'
  214. import QrCode from '@/components/QrCode.vue'
  215. import LoginHeaderGroup from './components/LoginHeaderGroup.vue'
  216. import { useWindowWidth } from '@/composables/useWindowWidth'
  217. const windowWidth = useWindowWidth(300)
  218. const isMobile = computed(() => windowWidth.value <= 991)
  219. const { t } = useI18n()
  220. const { Code } = Config
  221. const userStore = useUserStore()
  222. import LiveChatService from '@/utils/liveChat.js'
  223. const {
  224. time,
  225. text: getCodeString,
  226. canSend,
  227. start,
  228. restore,
  229. } = useEmailCountdown()
  230. const status = ref(false)
  231. const isRouteHasId = ref(false)
  232. const formData = ref({
  233. country: 'CN',
  234. phone: '',
  235. birthDate: '',
  236. email: '',
  237. code: '',
  238. password: '',
  239. linkValue: '',
  240. agree: 0,
  241. isSubscribeEmail: 0,
  242. sourceCode: null,
  243. w: '',
  244. subId: '',
  245. oc: '',
  246. agentId: null,
  247. ibInvalid: null,
  248. })
  249. const rules = {
  250. country: { rules: [{ required: true, errorMessage: t('vaildate.country.empty'), trigger: 'blur' }] },
  251. email: {
  252. rules: [
  253. { required: true, errorMessage: t('vaildate.email.empty'), trigger: 'blur' },
  254. { pattern: Config.Pattern.Email, errorMessage: t('vaildate.email.format'), trigger: 'blur' },
  255. ],
  256. },
  257. emailCode: { rules: [{ required: true, errorMessage: t('vaildate.code.empty'), trigger: 'blur' }] },
  258. password: {
  259. rules: [
  260. { required: true, errorMessage: t('vaildate.password.format'), trigger: 'blur' },
  261. { pattern: Config.Pattern.Password, errorMessage: t('vaildate.password.format'), trigger: 'blur' },
  262. ],
  263. },
  264. agree: {
  265. rules: [
  266. {
  267. validateFunction: (rule, value) => {
  268. if (value) return true
  269. return t('vaildate.agree.empty')
  270. },
  271. trigger: 'change',
  272. },
  273. ],
  274. },
  275. phone: {
  276. rules: [
  277. { required: true, errorMessage: t('vaildate.phone.format'), trigger: 'blur' },
  278. { pattern: Config.Pattern.NonNegInt, errorMessage: t('vaildate.phone.format'), trigger: 'blur' },
  279. ],
  280. },
  281. birthDate: { rules: [{ required: true, errorMessage: t('vaildate.birthDate.empty'), trigger: 'change' }] },
  282. }
  283. const agreeGroup = ref([])
  284. const subscribeEmailGroup = ref([])
  285. watch(() => formData.value.agree, (val) => {
  286. agreeGroup.value = val === 1 ? ['agree'] : []
  287. }, { immediate: true })
  288. watch(() => formData.value.isSubscribeEmail, (val) => {
  289. subscribeEmailGroup.value = val === 1 ? ['subscribeEmail'] : []
  290. }, { immediate: true })
  291. const onAgreeChange = (e) => {
  292. formData.value.agree = e && e.length ? 1 : 0
  293. }
  294. const onSubscribeEmailChange = (e) => {
  295. formData.value.isSubscribeEmail = e && e.length ? 1 : 0
  296. }
  297. const toggleAgree = () => {
  298. const next = agreeGroup.value.length ? [] : ['agree']
  299. agreeGroup.value = next
  300. onAgreeChange(next)
  301. }
  302. const isChatIconExpanded = ref(false)
  303. // 处理聊天图标点击
  304. const handleChatIconClick = () => {
  305. // 如果还没显示 → 先滑出来
  306. if (!isChatIconExpanded.value) {
  307. isChatIconExpanded.value = true
  308. return
  309. }
  310. if (isMobile.value) {
  311. router.push('/pages/common/chat')
  312. } else {
  313. if (LiveChatService) {
  314. LiveChatService.showChat();
  315. }
  316. }
  317. setTimeout(() => {
  318. isChatIconExpanded.value = false
  319. }, 300)
  320. }
  321. const toggleSubscribeEmail = () => {
  322. const next = subscribeEmailGroup.value.length ? [] : ['subscribeEmail']
  323. subscribeEmailGroup.value = next
  324. onSubscribeEmailChange(next)
  325. }
  326. const rule1 = computed(() => {
  327. if (!formData.value.password) return false
  328. return /^.{8,16}$/.test(formData.value.password)
  329. })
  330. const rule2 = computed(() => {
  331. return /^(?=.*?[a-z])(?=.*?[A-Z]).*$/.test(formData.value.password)
  332. })
  333. const rule3 = computed(() => {
  334. return /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\(\)#_]).*\1.*\1)[A-Za-z0-9~!@&%$^\(\)#_]{8,16}$/.test(
  335. formData.value.password,
  336. )
  337. })
  338. const openUrl = (url) => {
  339. openLocalPdf(url)
  340. }
  341. // 检查是否满18周岁
  342. const isAgeValid = computed(() => {
  343. if (!formData.value.birthDate) {
  344. return false // 如果还没选择日期,不允许继续
  345. }
  346. const today = new Date()
  347. const birthDate = new Date(formData.value.birthDate)
  348. let age = today.getFullYear() - birthDate.getFullYear()
  349. const monthDiff = today.getMonth() - birthDate.getMonth()
  350. if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {
  351. age--
  352. }
  353. return age >= 18
  354. })
  355. // 检查年龄并提示
  356. const checkAge = () => {
  357. if (formData.value.birthDate && !isAgeValid.value) {
  358. uni.showModal({
  359. title: t('Msg.SystemPrompt'),
  360. content: t('signup.ageRestriction'),
  361. showCancel: false,
  362. confirmText: t('Btn.Confirm'),
  363. success: function (res) {
  364. if (res.confirm) {
  365. // 用户点击确认后的操作
  366. }
  367. },
  368. })
  369. }
  370. }
  371. const limitAgentIdLength = (val) => {
  372. if (val == null || val === '') return
  373. // 推荐码只能输入数字和英文
  374. const filtered = val.toString().replace(/[^0-9a-zA-Z]/g, '').slice(0, 10)
  375. if (formData.value.linkValue !== filtered) {
  376. formData.value.linkValue = filtered
  377. }
  378. }
  379. onLoad((options) => {
  380. if (options) {
  381. formData.value.sourceCode = options.ex || null
  382. formData.value.w = options.w || ''
  383. formData.value.subId = options.SUBID || ''
  384. formData.value.oc = options.oc || ''
  385. formData.value.email = options.emailAdvertisement || ''
  386. console.log(options, '-----')
  387. if (options.id) {
  388. isRouteHasId.value = true
  389. formData.value.agentId = Number(options.id)
  390. formData.value.linkValue = options.commission || ''
  391. switch (options.ibInvalid) {
  392. case 'B0':
  393. formData.value.ibInvalid = 0
  394. break
  395. case 'B1':
  396. formData.value.ibInvalid = 1
  397. break
  398. }
  399. }
  400. }
  401. })
  402. const ho = ref('')
  403. const form = ref(null)
  404. const value = ref('')
  405. const mock_options = ref([])
  406. const countryCode = ref('my')
  407. const countryOptions = computed(() => {
  408. return mock_options.value.map(item => ({
  409. text: item.enName,
  410. value: item.code,
  411. disable: item.isOpenAccount == 0 || item.isOpenAccount === null ? true : false,
  412. }))
  413. })
  414. // 国家列表
  415. async function getCountry() {
  416. try {
  417. let res = await countryApi.Country({})
  418. if (res.code == 200) { // Code.StatusOK
  419. mock_options.value = res.data
  420. } else {
  421. showToast(res.msg)
  422. }
  423. } catch (error) {
  424. console.error(error)
  425. }
  426. }
  427. //获取当前国家编码
  428. const getCountryMsg = async () => {
  429. let res = await countryApi.CountryGet({})
  430. if (res.code == Code.StatusOK) {
  431. countryCode.value = res.msg
  432. } else {
  433. console.log(res)
  434. }
  435. }
  436. // 获取验证码按钮点击
  437. async function handleGetCode() {
  438. if (!formData.value.birthDate) {
  439. showToast(t('vaildate.birthDate.empty'))
  440. return
  441. }
  442. if (!isAgeValid.value) {
  443. showToast(t('signup.ageRestriction'))
  444. return
  445. }
  446. if (!formData.value.country) {
  447. showToast(t('vaildate.country.empty'))
  448. return
  449. }
  450. if (!formData.value.email) {
  451. showToast(t('vaildate.email.empty'))
  452. return
  453. }
  454. if (!Config.Pattern.Email.test(formData.value.email)) {
  455. showToast(t('vaildate.email.format'))
  456. return
  457. }
  458. if (!canSend.value) return
  459. await sendEmailCode()
  460. }
  461. // 发送邮箱验证码
  462. async function sendEmailCode() {
  463. const res = await loginApi.Code({
  464. ...formData.value,
  465. })
  466. if (res.code === 200) {
  467. showToast(t('Msg.CodeSuccess'))
  468. start()
  469. return true
  470. } else {
  471. showToast(t('Msg.CodeFail'))
  472. return false
  473. }
  474. }
  475. const handleModelConfirm = () => {
  476. // 弹窗确认后的处理
  477. status.value = false
  478. }
  479. const register = async () => {
  480. if (countryCode.value == 'MY' || countryCode.value == 'ID') {
  481. status.value = true
  482. return
  483. }
  484. form.value.validate().then(async (res) => {
  485. // 中国(含港澳台)使用 X-System: B,非中国使用 X-System: A
  486. const chinaCountryCodes = ['CN']
  487. const isChina = chinaCountryCodes.includes(formData.value.country)
  488. const xSystemValue = isChina ? 'B' : 'A'
  489. let resData = await loginApi.Register(
  490. { ...formData.value },
  491. { headers: { 'X-System': xSystemValue } },
  492. )
  493. if (resData.code == 200) { // Code.StatusOK
  494. showToast(t('Msg.registerSuc'))
  495. login()
  496. } else {
  497. showToast(resData.msg)
  498. }
  499. }).catch(err => {
  500. console.log('表单错误信息:', err)
  501. showToast(err.msg)
  502. return false
  503. })
  504. }
  505. const login = async () => {
  506. try {
  507. let res = await userApi.login({
  508. loginName: formData.value.email,
  509. password: formData.value.password,
  510. })
  511. if (res.code == 200) { // Code.StatusOK
  512. userToken.value = res.data
  513. getLoginInfo()
  514. } else {
  515. showToast(res.msg)
  516. }
  517. } catch (error) {
  518. console.error(error)
  519. }
  520. }
  521. const getLoginInfo = async () => {
  522. try {
  523. let res = await userApi.getUserInfo()
  524. if (res.code == 200) { // Code.StatusOK
  525. userStore.saveUserInfo(res.data)
  526. showToast(t('Msg.LoginSuccess'))
  527. setTimeout(() => {
  528. uni.reLaunch({
  529. url: '/pages/customer/index',
  530. })
  531. // this.$store.commit("isActiveTab", "0"); (可能需要适配相应的逻辑)
  532. }, 1000)
  533. } else {
  534. showToast(t('Msg.SystemError'))
  535. }
  536. } catch (error) {
  537. console.error(error)
  538. }
  539. }
  540. onMounted(() => {
  541. getCountry()
  542. getCountryMsg()
  543. })
  544. </script>
  545. <style lang="scss" scoped>
  546. .chat-icon {
  547. width: px2rpx(50);
  548. height: px2rpx(50);
  549. border-radius: 50%;
  550. background-color: #cf1322;
  551. display: flex;
  552. align-items: center;
  553. justify-content: center;
  554. position: fixed;
  555. bottom: px2rpx(25);
  556. right: px2rpx(0);
  557. z-index: 999;
  558. cursor: pointer;
  559. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  560. box-shadow: 0 px2rpx(8) px2rpx(20) rgba(0, 0, 0, 0.15);
  561. will-change: transform;
  562. }
  563. .chat-icon:hover {
  564. transform: scale(1.1);
  565. }
  566. .chat-icon-expanded {
  567. bottom: px2rpx(20);
  568. right: px2rpx(20);
  569. transform: scale(1.1);
  570. box-shadow: 0 px2rpx(12) px2rpx(30) rgba(0, 0, 0, 0.2);
  571. }
  572. .chat-icon-hidden {
  573. display: none;
  574. }
  575. .pwd {
  576. list-style: none;
  577. padding-left: 0;
  578. margin: 0;
  579. li {
  580. font-size: px2rpx(12);
  581. color: var(--bs-heading-color);
  582. line-height: px2rpx(20);
  583. position: relative;
  584. padding-left: px2rpx(16);
  585. &::before {
  586. content: '';
  587. position: absolute;
  588. left: 0;
  589. top: 50%;
  590. transform: translateY(-50%);
  591. width: px2rpx(6);
  592. height: px2rpx(6);
  593. border-radius: 50%;
  594. background-color: var(--bs-heading-color);
  595. }
  596. &.fit {
  597. color: #67c23a;
  598. &::before {
  599. background-color: #67c23a;
  600. }
  601. }
  602. }
  603. }
  604. </style>
  605. <style lang="scss" scoped>
  606. @import "@/uni.scss";
  607. :deep(uni-content) {
  608. padding-left: 0 !important;
  609. }
  610. .regist-page {
  611. height: 100vh;
  612. border: none;
  613. padding: 0;
  614. position: relative;
  615. display: flex;
  616. flex-direction: column;
  617. }
  618. .fixed {
  619. width: 100%;
  620. height: var(--status-bar-height);
  621. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  622. z-index: 9;
  623. }
  624. .global-header-bar {
  625. width: 100%;
  626. height: px2rpx(60);
  627. display: flex;
  628. align-items: center;
  629. justify-content: center;
  630. flex-shrink: 0;
  631. z-index: 100;
  632. &.pc-header {
  633. background-color: transparent;
  634. }
  635. .header-inner {
  636. width: 100%;
  637. padding: 0 5%;
  638. display: flex;
  639. justify-content: space-between;
  640. /* 两端对齐,可放logo和组件 */
  641. align-items: center;
  642. }
  643. }
  644. .mobile-header-bar {
  645. //position: absolute;
  646. //top: px2rpx(20);
  647. //right: px2rpx(20);
  648. z-index: 10;
  649. width: 100%;
  650. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  651. display: flex;
  652. justify-content: flex-end;
  653. }
  654. .main-content {
  655. flex: 1;
  656. overflow: hidden;
  657. background-repeat: no-repeat;
  658. background-size: cover;
  659. background-position: center center;
  660. }
  661. .demo-uni-row {
  662. height: 100%;
  663. margin: 0 !important;
  664. .left-bg {
  665. height: 100%;
  666. min-height: calc(100vh - 120px);
  667. display: flex;
  668. flex-direction: column;
  669. align-items: center;
  670. justify-content: center;
  671. .left-box {
  672. display: flex;
  673. flex-direction: column;
  674. justify-content: center;
  675. align-items: flex-start;
  676. width: 60%;
  677. //margin-top: px2rpx(0);
  678. .inner {
  679. width: 100%;
  680. text-align: start;
  681. margin-bottom: px2rpx(20);
  682. .section-title {
  683. margin-top: px2rpx(10);
  684. margin-bottom: px2rpx(10);
  685. }
  686. .title {
  687. font-size: px2rpx(50);
  688. line-height: 1.3;
  689. color: var(--bs-emphasis-color);
  690. font-weight: 700;
  691. text-align: left;
  692. }
  693. .w-700 {
  694. font-weight: 700;
  695. }
  696. .subtitle {
  697. width: 45%;
  698. font-size: px2rpx(18);
  699. letter-spacing: px2rpx(1);
  700. display: block;
  701. margin-bottom: px2rpx(24);
  702. color: #ffffff;
  703. line-height: px2rpx(15);
  704. font-weight: 500;
  705. padding: px2rpx(10) px2rpx(20);
  706. border-radius: px2rpx(100);
  707. text-transform: uppercase;
  708. background-color: #e61f1e;
  709. text-align: center;
  710. }
  711. .w-40 {
  712. max-width: 40%;
  713. }
  714. .text-white {
  715. margin-top: px2rpx(10);
  716. font-size: px2rpx(14);
  717. line-height: 1.6;
  718. color: var(--bs-emphasis-color);
  719. }
  720. }
  721. .img-fluid {
  722. width: 100%;
  723. max-width: px2rpx(240);
  724. }
  725. .mt--10 {
  726. margin-top: px2rpx(10);
  727. }
  728. .h1 {
  729. // text-align: center;
  730. color: var(--bs-emphasis-color);
  731. font-size: 30px;
  732. margin-top: 30px;
  733. line-height: 1.5;
  734. }
  735. .h6 {
  736. text-align: start;
  737. line-height: 20px;
  738. color: var(--bs-emphasis-color);
  739. font-size: 14px;
  740. margin-top: 10px;
  741. }
  742. .company {
  743. padding: px2rpx(10) 0 px2rpx(10) 0;
  744. position: relative;
  745. align-items: flex-start !important;
  746. width: 100%;
  747. }
  748. }
  749. .left-content {
  750. width: 100%;
  751. .des {
  752. text-align: start;
  753. line-height: 24px;
  754. color: var(--bs-emphasis-color);
  755. font-size: 14px;
  756. margin-top: px2rpx(20);
  757. padding: 0;
  758. :nth-child(n) {
  759. display: inline;
  760. word-break: break-all;
  761. word-wrap: break-word;
  762. }
  763. .doc-link {
  764. color: #e61f1e;
  765. text-decoration: underline;
  766. margin: 0 px2rpx(4);
  767. }
  768. }
  769. }
  770. }
  771. .right-f {
  772. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  773. padding: 0 px2rpx(24);
  774. height: 100%;
  775. box-sizing: border-box;
  776. .account {
  777. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  778. position: relative;
  779. height: calc(100vh - 120px);
  780. overflow-y: auto;
  781. display: flex;
  782. flex-direction: column;
  783. padding: px2rpx(32) 10%;
  784. .title {
  785. margin: px2rpx(32) 0;
  786. font-size: px2rpx(24);
  787. font-weight: bolder;
  788. color: #e4e4e4;
  789. text-align: center;
  790. i {
  791. margin-right: px2rpx(10);
  792. }
  793. .tit1 {
  794. font-size: px2rpx(34);
  795. line-height: 1.5;
  796. font-weight: bold;
  797. color: #000000;
  798. }
  799. .tit2 {
  800. font-size: px2rpx(16);
  801. line-height: 1.5;
  802. color: #cecece;
  803. font-weight: 500;
  804. }
  805. }
  806. .company {
  807. padding: px2rpx(50) 0 px2rpx(20) 0;
  808. position: relative;
  809. align-items: center !important;
  810. }
  811. .company-icon {
  812. width: px2rpx(234);
  813. }
  814. }
  815. }
  816. }
  817. .content-wrapper {
  818. max-width: px2rpx(1224);
  819. width: 100%;
  820. margin: 0 auto;
  821. padding-top: px2rpx(20);
  822. box-sizing: border-box;
  823. display: flex;
  824. flex-direction: column;
  825. justify-content: space-between;
  826. min-height: calc(100vh - 56px);
  827. }
  828. .regist-content {
  829. display: flex;
  830. align-items: center;
  831. justify-content: center;
  832. }
  833. .content {
  834. width: px2rpx(650);
  835. margin: 0 auto;
  836. }
  837. .regist-header {
  838. display: flex;
  839. justify-content: space-between;
  840. align-items: flex-end;
  841. margin: px2rpx(40) 0 px2rpx(20);
  842. padding-bottom: px2rpx(10);
  843. .title {
  844. font-size: px2rpx(28);
  845. font-weight: bold;
  846. color: var(--bs-emphasis-color);
  847. line-height: 1;
  848. }
  849. .login-link {
  850. font-size: px2rpx(14);
  851. color: var(--bs-emphasis-color);
  852. display: flex;
  853. align-items: center;
  854. line-height: 1;
  855. .text {
  856. margin-right: px2rpx(4);
  857. }
  858. }
  859. }
  860. .login-link {
  861. margin-top: px2rpx(20);
  862. text-align: start;
  863. display: flex;
  864. align-items: center;
  865. font-size: px2rpx(16);
  866. line-height: 1.6;
  867. }
  868. .link {
  869. color: #e61f1e;
  870. padding-bottom: 2px;
  871. cursor: pointer;
  872. font-size: px2rpx(14);
  873. }
  874. //display: flex;
  875. .logo {
  876. width: 100%;
  877. margin-top: px2rpx(40);
  878. display: flex;
  879. align-items: center;
  880. justify-content: center;
  881. }
  882. .agreemnet9 {
  883. text-align: initial;
  884. color: #e61f1e;
  885. }
  886. .company-icon {
  887. width: px2rpx(234);
  888. }
  889. .account-type {
  890. width: 100%;
  891. margin-top: px2rpx(20);
  892. padding: px2rpx(10);
  893. background-color: $uni-bg-color-hover;
  894. height: px2rpx(60);
  895. box-sizing: border-box;
  896. border-radius: px2rpx(20);
  897. display: flex;
  898. align-items: center;
  899. .type-btn {
  900. width: 50%;
  901. text-align: center;
  902. height: px2rpx(40);
  903. border-radius: px2rpx(20);
  904. line-height: px2rpx(40);
  905. font-size: px2rpx(18);
  906. cursor: pointer;
  907. &.active {
  908. background-color: var(--primary-color);
  909. }
  910. }
  911. }
  912. .formStyle {
  913. height: px2rpx(40);
  914. }
  915. .account-tip {
  916. width: 100%;
  917. text-align: center;
  918. margin: px2rpx(30) 0;
  919. .title {
  920. font-size: px2rpx(26);
  921. font-weight: bold;
  922. }
  923. .tip {
  924. margin-top: px2rpx(5);
  925. color: var(--gray);
  926. }
  927. }
  928. .formContent {
  929. padding: 0 10px;
  930. }
  931. // 修改表单组件高度。
  932. :deep(.uni-stat-box) {
  933. height: 100%;
  934. }
  935. :deep(.uni-select) {
  936. height: 100%;
  937. }
  938. :deep(.uni-easyinput__content) {
  939. height: 100%;
  940. }
  941. :deep(.uni-date-editor) {
  942. height: 100%;
  943. }
  944. :deep(.uni-date-editor--x) {
  945. height: 100%;
  946. }
  947. .btn-code {
  948. width: 120px;
  949. height: px2rpx(37);
  950. box-sizing: border-box;
  951. background-color: #102047;
  952. border: 1px solid rgb(229, 229, 229);
  953. color: var(--bs-emphasis-color);
  954. text-align: center;
  955. line-height: px2rpx(35);
  956. border-radius: 4px;
  957. cursor: pointer;
  958. font-size: 14px;
  959. flex-shrink: 0;
  960. }
  961. .check-box {
  962. padding: 0 px2rpx(10);
  963. margin-bottom: px2rpx(10);
  964. display: flex;
  965. align-items: center;
  966. cursor: pointer;
  967. .checkbox-label {
  968. font-size: px2rpx(14);
  969. color: #666666;
  970. margin-left: px2rpx(8);
  971. user-select: none;
  972. }
  973. :deep(.u-checkbox) {
  974. display: flex;
  975. align-items: flex-start;
  976. }
  977. }
  978. .regiset-btn {
  979. width: 100%;
  980. height: px2rpx(40);
  981. border-radius: px2rpx(4);
  982. background-color: var(--color-error);
  983. color: var(--bs-emphasis-color);
  984. font-weight: bold;
  985. }
  986. .or-title {
  987. font-size: px2rpx(16);
  988. line-height: 1.5;
  989. color: var(--bs-heading-color);
  990. font-weight: 500;
  991. text-align: center;
  992. margin: px2rpx(20) 0 px2rpx(18) 0;
  993. display: flex;
  994. align-items: center;
  995. justify-content: center;
  996. .line {
  997. flex: 1;
  998. height: 1px;
  999. background-color: #e4e4e4;
  1000. }
  1001. .qr-tit2 {
  1002. margin: 0 px2rpx(12);
  1003. }
  1004. }
  1005. .login-btn {
  1006. width: 100%;
  1007. height: px2rpx(40);
  1008. border-radius: px2rpx(20);
  1009. background-color: #1EBF42;
  1010. color: var(--bs-emphasis-color);
  1011. font-weight: bold;
  1012. margin-bottom: px2rpx(20);
  1013. }
  1014. .code-text {
  1015. padding-right: px2rpx(20);
  1016. }
  1017. .des-bottom {
  1018. margin-top: px2rpx(20);
  1019. line-height: 20px;
  1020. color: #000;
  1021. font-size: 12px;
  1022. .desc-link {
  1023. display: inline-block;
  1024. color: #e61f1e;
  1025. text-decoration: underline;
  1026. }
  1027. }
  1028. .des {
  1029. width: 100%;
  1030. box-sizing: border-box;
  1031. text-align: start;
  1032. line-height: 20px;
  1033. color: #000;
  1034. font-size: 12px;
  1035. padding: px2rpx(20) px2rpx(30);
  1036. //display: none;
  1037. :nth-child(n) {
  1038. display: inline;
  1039. word-break: break-all;
  1040. word-wrap: break-word;
  1041. }
  1042. a {
  1043. color: #e61f1e;
  1044. }
  1045. }
  1046. :deep(.u-text__value) {
  1047. color: #ea002a !important;
  1048. font-size: px2rpx(14) !important;
  1049. }
  1050. </style>