regist.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182
  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 cursor-pointer" :data-tooltip="t('Downloadpage.item16')" :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. disable: 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. })
  543. </script>
  544. <style lang="scss" scoped>
  545. .chat-icon {
  546. width: px2rpx(50);
  547. height: px2rpx(50);
  548. border-radius: 50%;
  549. background-color: #cf1322;
  550. display: flex;
  551. align-items: center;
  552. justify-content: center;
  553. position: fixed;
  554. bottom: px2rpx(25);
  555. right: px2rpx(0);
  556. z-index: 999;
  557. cursor: pointer;
  558. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  559. box-shadow: 0 px2rpx(8) px2rpx(20) rgba(0, 0, 0, 0.15);
  560. will-change: transform;
  561. }
  562. .chat-icon:hover {
  563. transform: scale(1.1);
  564. }
  565. .chat-icon-expanded {
  566. bottom: px2rpx(20);
  567. right: px2rpx(20);
  568. transform: scale(1.1);
  569. box-shadow: 0 px2rpx(12) px2rpx(30) rgba(0, 0, 0, 0.2);
  570. }
  571. .chat-icon-hidden {
  572. display: none;
  573. }
  574. .pwd {
  575. list-style: none;
  576. padding-left: 0;
  577. margin: 0;
  578. li {
  579. font-size: px2rpx(12);
  580. color: var(--bs-heading-color);
  581. line-height: px2rpx(20);
  582. position: relative;
  583. padding-left: px2rpx(16);
  584. &::before {
  585. content: '';
  586. position: absolute;
  587. left: 0;
  588. top: 50%;
  589. transform: translateY(-50%);
  590. width: px2rpx(6);
  591. height: px2rpx(6);
  592. border-radius: 50%;
  593. background-color: var(--bs-heading-color);
  594. }
  595. &.fit {
  596. color: #67c23a;
  597. &::before {
  598. background-color: #67c23a;
  599. }
  600. }
  601. }
  602. }
  603. </style>
  604. <style lang="scss" scoped>
  605. @import "@/uni.scss";
  606. :deep(uni-content) {
  607. padding-left: 0 !important;
  608. }
  609. .regist-page {
  610. height: 100vh;
  611. border: none;
  612. padding: 0;
  613. position: relative;
  614. display: flex;
  615. flex-direction: column;
  616. }
  617. .fixed {
  618. width: 100%;
  619. height: var(--status-bar-height);
  620. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  621. z-index: 9;
  622. }
  623. .global-header-bar {
  624. width: 100%;
  625. height: px2rpx(60);
  626. display: flex;
  627. align-items: center;
  628. justify-content: center;
  629. flex-shrink: 0;
  630. z-index: 100;
  631. &.pc-header {
  632. background-color: transparent;
  633. }
  634. .header-inner {
  635. width: 100%;
  636. padding: 0 5%;
  637. display: flex;
  638. justify-content: space-between;
  639. /* 两端对齐,可放logo和组件 */
  640. align-items: center;
  641. }
  642. }
  643. .mobile-header-bar {
  644. //position: absolute;
  645. //top: px2rpx(20);
  646. //right: px2rpx(20);
  647. z-index: 10;
  648. width: 100%;
  649. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  650. display: flex;
  651. justify-content: flex-end;
  652. }
  653. .main-content {
  654. flex: 1;
  655. overflow: hidden;
  656. background-repeat: no-repeat;
  657. background-size: cover;
  658. background-position: center center;
  659. }
  660. .demo-uni-row {
  661. height: 100%;
  662. margin: 0 !important;
  663. .left-bg {
  664. height: 100%;
  665. min-height: calc(100vh - 120px);
  666. display: flex;
  667. flex-direction: column;
  668. align-items: center;
  669. justify-content: center;
  670. .left-box {
  671. display: flex;
  672. flex-direction: column;
  673. justify-content: center;
  674. align-items: flex-start;
  675. width: 60%;
  676. //margin-top: px2rpx(0);
  677. .inner {
  678. width: 100%;
  679. text-align: start;
  680. margin-bottom: px2rpx(20);
  681. .section-title {
  682. margin-top: px2rpx(10);
  683. margin-bottom: px2rpx(10);
  684. }
  685. .title {
  686. font-size: px2rpx(50);
  687. line-height: 1.3;
  688. color: var(--bs-emphasis-color);
  689. font-weight: 700;
  690. text-align: left;
  691. }
  692. .w-700 {
  693. font-weight: 700;
  694. }
  695. .subtitle {
  696. width: 45%;
  697. font-size: px2rpx(18);
  698. letter-spacing: px2rpx(1);
  699. display: block;
  700. margin-bottom: px2rpx(24);
  701. color: #ffffff;
  702. line-height: px2rpx(15);
  703. font-weight: 500;
  704. padding: px2rpx(10) px2rpx(20);
  705. border-radius: px2rpx(100);
  706. text-transform: uppercase;
  707. background-color: #e61f1e;
  708. text-align: center;
  709. }
  710. .w-40 {
  711. max-width: 40%;
  712. }
  713. .text-white {
  714. margin-top: px2rpx(10);
  715. font-size: px2rpx(14);
  716. line-height: 1.6;
  717. color: var(--bs-emphasis-color);
  718. }
  719. }
  720. .img-fluid {
  721. width: 100%;
  722. max-width: px2rpx(240);
  723. }
  724. .mt--10 {
  725. margin-top: px2rpx(10);
  726. }
  727. .h1 {
  728. // text-align: center;
  729. color: var(--bs-emphasis-color);
  730. font-size: 30px;
  731. margin-top: 30px;
  732. line-height: 1.5;
  733. }
  734. .h6 {
  735. text-align: start;
  736. line-height: 20px;
  737. color: var(--bs-emphasis-color);
  738. font-size: 14px;
  739. margin-top: 10px;
  740. }
  741. .company {
  742. padding: px2rpx(10) 0 px2rpx(10) 0;
  743. position: relative;
  744. align-items: flex-start !important;
  745. width: 100%;
  746. }
  747. }
  748. .left-content {
  749. width: 100%;
  750. .des {
  751. text-align: start;
  752. line-height: 24px;
  753. color: var(--bs-emphasis-color);
  754. font-size: 14px;
  755. margin-top: px2rpx(20);
  756. padding: 0;
  757. :nth-child(n) {
  758. display: inline;
  759. word-break: break-all;
  760. word-wrap: break-word;
  761. }
  762. .doc-link {
  763. color: #e61f1e;
  764. text-decoration: underline;
  765. margin: 0 px2rpx(4);
  766. }
  767. }
  768. }
  769. }
  770. .right-f {
  771. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  772. padding: 0 px2rpx(24);
  773. height: 100%;
  774. box-sizing: border-box;
  775. .account {
  776. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  777. position: relative;
  778. height: calc(100vh - 120px);
  779. overflow-y: auto;
  780. display: flex;
  781. flex-direction: column;
  782. padding: px2rpx(32) 10%;
  783. .title {
  784. margin: px2rpx(32) 0;
  785. font-size: px2rpx(24);
  786. font-weight: bolder;
  787. color: #e4e4e4;
  788. text-align: center;
  789. i {
  790. margin-right: px2rpx(10);
  791. }
  792. .tit1 {
  793. font-size: px2rpx(34);
  794. line-height: 1.5;
  795. font-weight: bold;
  796. color: #000000;
  797. }
  798. .tit2 {
  799. font-size: px2rpx(16);
  800. line-height: 1.5;
  801. color: #cecece;
  802. font-weight: 500;
  803. }
  804. }
  805. .company {
  806. padding: px2rpx(50) 0 px2rpx(20) 0;
  807. position: relative;
  808. align-items: center !important;
  809. }
  810. .company-icon {
  811. width: px2rpx(234);
  812. }
  813. }
  814. }
  815. }
  816. .content-wrapper {
  817. max-width: px2rpx(1224);
  818. width: 100%;
  819. margin: 0 auto;
  820. padding-top: px2rpx(20);
  821. box-sizing: border-box;
  822. display: flex;
  823. flex-direction: column;
  824. justify-content: space-between;
  825. min-height: calc(100vh - 56px);
  826. }
  827. .regist-content {
  828. display: flex;
  829. align-items: center;
  830. justify-content: center;
  831. }
  832. .content {
  833. width: px2rpx(650);
  834. margin: 0 auto;
  835. }
  836. .regist-header {
  837. display: flex;
  838. justify-content: space-between;
  839. align-items: flex-end;
  840. margin: px2rpx(40) 0 px2rpx(20);
  841. padding-bottom: px2rpx(10);
  842. .title {
  843. font-size: px2rpx(28);
  844. font-weight: bold;
  845. color: var(--bs-emphasis-color);
  846. line-height: 1;
  847. }
  848. .login-link {
  849. font-size: px2rpx(14);
  850. color: var(--bs-emphasis-color);
  851. display: flex;
  852. align-items: center;
  853. line-height: 1;
  854. .text {
  855. margin-right: px2rpx(4);
  856. }
  857. }
  858. }
  859. .login-link {
  860. margin-top: px2rpx(20);
  861. text-align: start;
  862. display: flex;
  863. align-items: center;
  864. font-size: px2rpx(16);
  865. line-height: 1.6;
  866. }
  867. .link {
  868. color: #e61f1e;
  869. padding-bottom: 2px;
  870. cursor: pointer;
  871. font-size: px2rpx(14);
  872. }
  873. //display: flex;
  874. .logo {
  875. width: 100%;
  876. margin-top: px2rpx(40);
  877. display: flex;
  878. align-items: center;
  879. justify-content: center;
  880. }
  881. .agreemnet9 {
  882. text-align: initial;
  883. color: #e61f1e;
  884. }
  885. .company-icon {
  886. width: px2rpx(234);
  887. }
  888. .account-type {
  889. width: 100%;
  890. margin-top: px2rpx(20);
  891. padding: px2rpx(10);
  892. background-color: $uni-bg-color-hover;
  893. height: px2rpx(60);
  894. box-sizing: border-box;
  895. border-radius: px2rpx(20);
  896. display: flex;
  897. align-items: center;
  898. .type-btn {
  899. width: 50%;
  900. text-align: center;
  901. height: px2rpx(40);
  902. border-radius: px2rpx(20);
  903. line-height: px2rpx(40);
  904. font-size: px2rpx(18);
  905. cursor: pointer;
  906. &.active {
  907. background-color: var(--primary-color);
  908. }
  909. }
  910. }
  911. .formStyle {
  912. height: px2rpx(40);
  913. }
  914. .account-tip {
  915. width: 100%;
  916. text-align: center;
  917. margin: px2rpx(30) 0;
  918. .title {
  919. font-size: px2rpx(26);
  920. font-weight: bold;
  921. }
  922. .tip {
  923. margin-top: px2rpx(5);
  924. color: var(--gray);
  925. }
  926. }
  927. .formContent {
  928. padding: 0 10px;
  929. }
  930. // 修改表单组件高度。
  931. :deep(.uni-stat-box) {
  932. height: 100%;
  933. }
  934. :deep(.uni-select) {
  935. height: 100%;
  936. }
  937. :deep(.uni-easyinput__content) {
  938. height: 100%;
  939. }
  940. :deep(.uni-date-editor) {
  941. height: 100%;
  942. }
  943. :deep(.uni-date-editor--x) {
  944. height: 100%;
  945. }
  946. .btn-code {
  947. width: 120px;
  948. height: px2rpx(37);
  949. box-sizing: border-box;
  950. background-color: #102047;
  951. border: 1px solid rgb(229, 229, 229);
  952. color: var(--bs-emphasis-color);
  953. text-align: center;
  954. line-height: px2rpx(35);
  955. border-radius: 4px;
  956. cursor: pointer;
  957. font-size: 14px;
  958. flex-shrink: 0;
  959. }
  960. .check-box {
  961. padding: 0 px2rpx(10);
  962. margin-bottom: px2rpx(10);
  963. display: flex;
  964. align-items: center;
  965. cursor: pointer;
  966. .checkbox-label {
  967. font-size: px2rpx(14);
  968. color: #666666;
  969. margin-left: px2rpx(8);
  970. user-select: none;
  971. }
  972. :deep(.u-checkbox) {
  973. display: flex;
  974. align-items: flex-start;
  975. }
  976. }
  977. .regiset-btn {
  978. width: 100%;
  979. height: px2rpx(40);
  980. border-radius: px2rpx(4);
  981. background-color: var(--color-error);
  982. color: var(--bs-emphasis-color);
  983. font-weight: bold;
  984. }
  985. .or-title {
  986. font-size: px2rpx(16);
  987. line-height: 1.5;
  988. color: var(--bs-heading-color);
  989. font-weight: 500;
  990. text-align: center;
  991. margin: px2rpx(20) 0 px2rpx(18) 0;
  992. display: flex;
  993. align-items: center;
  994. justify-content: center;
  995. .line {
  996. flex: 1;
  997. height: 1px;
  998. background-color: #e4e4e4;
  999. }
  1000. .qr-tit2 {
  1001. margin: 0 px2rpx(12);
  1002. }
  1003. }
  1004. .login-btn {
  1005. width: 100%;
  1006. height: px2rpx(40);
  1007. border-radius: px2rpx(20);
  1008. background-color: #1EBF42;
  1009. color: var(--bs-emphasis-color);
  1010. font-weight: bold;
  1011. margin-bottom: px2rpx(20);
  1012. }
  1013. .code-text {
  1014. padding-right: px2rpx(20);
  1015. }
  1016. .des-bottom {
  1017. margin-top: px2rpx(20);
  1018. line-height: 20px;
  1019. color: #000;
  1020. font-size: 12px;
  1021. .desc-link {
  1022. display: inline-block;
  1023. color: #e61f1e;
  1024. text-decoration: underline;
  1025. }
  1026. }
  1027. .des {
  1028. width: 100%;
  1029. box-sizing: border-box;
  1030. text-align: start;
  1031. line-height: 20px;
  1032. color: #000;
  1033. font-size: 12px;
  1034. padding: px2rpx(20) px2rpx(30);
  1035. //display: none;
  1036. :nth-child(n) {
  1037. display: inline;
  1038. word-break: break-all;
  1039. word-wrap: break-word;
  1040. }
  1041. a {
  1042. color: #e61f1e;
  1043. }
  1044. }
  1045. :deep(.u-text__value) {
  1046. color: #ea002a !important;
  1047. font-size: px2rpx(14) !important;
  1048. }
  1049. </style>