regist.vue 30 KB

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