regist.vue 30 KB

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