|
@@ -64,12 +64,12 @@
|
|
|
:class="isMobile ? 'company-icon-mini' : 'company-icon'" mode="widthFix"></image>
|
|
:class="isMobile ? 'company-icon-mini' : 'company-icon'" mode="widthFix"></image>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
-<!-- <view class="tab-list">-->
|
|
|
|
|
-<!-- <view v-for="tab in tabs" :key="tab.value" class="tab-item cursor-pointer" :class="{ active: activeTab === tab.value }"-->
|
|
|
|
|
-<!-- @click="handleClick(tab.value)" :data-tooltip="tab.text" data-placement="top">-->
|
|
|
|
|
-<!-- <text class="tab-label">{{ tab.text }}</text>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
-<!-- </view>-->
|
|
|
|
|
|
|
+ <!-- <view class="tab-list">-->
|
|
|
|
|
+ <!-- <view v-for="tab in tabs" :key="tab.value" class="tab-item cursor-pointer" :class="{ active: activeTab === tab.value }"-->
|
|
|
|
|
+ <!-- @click="handleClick(tab.value)" :data-tooltip="tab.text" data-placement="top">-->
|
|
|
|
|
+ <!-- <text class="tab-label">{{ tab.text }}</text>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
|
|
|
|
|
<view v-show="activeTab == 1" style="overflow-y: scroll;">
|
|
<view v-show="activeTab == 1" style="overflow-y: scroll;">
|
|
|
<view class="title">
|
|
<view class="title">
|
|
@@ -98,36 +98,38 @@
|
|
|
:label="t('newSignin.item5')" name="记住我" class="wcg-checkbox"></up-checkbox>
|
|
:label="t('newSignin.item5')" name="记住我" class="wcg-checkbox"></up-checkbox>
|
|
|
</up-checkbox-group>
|
|
</up-checkbox-group>
|
|
|
</view>
|
|
</view>
|
|
|
- <navigator url="/pages/login/reset" class="account-tip cursor-pointer" :data-tooltip="t('signin.forget')" data-placement="top">
|
|
|
|
|
|
|
+ <navigator url="/pages/login/reset" class="account-tip cursor-pointer"
|
|
|
|
|
+ :data-tooltip="t('signin.forget')" data-placement="top">
|
|
|
<text>{{ t('signin.forget') }}</text>
|
|
<text>{{ t('signin.forget') }}</text>
|
|
|
</navigator>
|
|
</navigator>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="cwg-button ">
|
|
<view class="cwg-button ">
|
|
|
- <button type="primary" class="" @click="submit" >
|
|
|
|
|
|
|
+ <button type="primary" class="" @click="submit">
|
|
|
{{ t('signin.login') }}
|
|
{{ t('signin.login') }}
|
|
|
</button>
|
|
</button>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="account-tip " >
|
|
|
|
|
|
|
+ <view class="account-tip ">
|
|
|
{{ t('signin.words') }}
|
|
{{ t('signin.words') }}
|
|
|
- <text @click="activeTab = 2" class="cursor-pointer" :data-tooltip="t('signin.signup')" data-placement="top">{{ t('signin.signup') }}</text>
|
|
|
|
|
|
|
+ <text @click="activeTab = 2" class="cursor-pointer" :data-tooltip="t('signin.signup')"
|
|
|
|
|
+ data-placement="top">{{ t('signin.signup') }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="des-bottom">
|
|
<view class="des-bottom">
|
|
|
<text v-t="'vu.login.agreemnet1'"></text>
|
|
<text v-t="'vu.login.agreemnet1'"></text>
|
|
|
- <cwg-link type="pdf" url='pdf/Client_Agreement.pdf' target="_blank" :title="'signup.agreemnet2'"
|
|
|
|
|
- class="desc-link" />
|
|
|
|
|
|
|
+ <cwg-link type="pdf" url='pdf/Client_Agreement.pdf' target="_blank" :title="'signup.agreemnet2'"
|
|
|
|
|
+ class="desc-link" />
|
|
|
<text v-t="'signup.agreemnet3'"></text>
|
|
<text v-t="'signup.agreemnet3'"></text>
|
|
|
<cwg-link type="pdf" url='pdf/Terms_Conditions.pdf' target="_blank" :title="'signup.agreemnet4'"
|
|
<cwg-link type="pdf" url='pdf/Terms_Conditions.pdf' target="_blank" :title="'signup.agreemnet4'"
|
|
|
- class="desc-link" />
|
|
|
|
|
|
|
+ class="desc-link" />
|
|
|
<text v-t="'signup.agreemnet5'"></text>
|
|
<text v-t="'signup.agreemnet5'"></text>
|
|
|
<cwg-link type="pdf" url='pdf/Privacy_Policy.pdf' target="_blank" :title="'signup.agreemnet6'"
|
|
<cwg-link type="pdf" url='pdf/Privacy_Policy.pdf' target="_blank" :title="'signup.agreemnet6'"
|
|
|
- class="desc-link" />
|
|
|
|
|
|
|
+ class="desc-link" />
|
|
|
<text v-t="'signup.agreemnet7'"></text>
|
|
<text v-t="'signup.agreemnet7'"></text>
|
|
|
</view>
|
|
</view>
|
|
|
<cwg-match-media :min-width="791">
|
|
<cwg-match-media :min-width="791">
|
|
|
- <view class="qr-container">
|
|
|
|
|
|
|
+ <view class="qr-container" v-show="activeTab == 1 && loginQrCode">
|
|
|
<view class="qr-title">
|
|
<view class="qr-title">
|
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
|
- <view class="qr-tit2">{{ t('newSignin.item2') }}</view>
|
|
|
|
|
|
|
+ <view class="qr-tit2">{{ t('vu.login.item16') }}</view>
|
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
|
</view>
|
|
</view>
|
|
|
<QrCode width="200" height="200" :text="loginQrCode"></QrCode>
|
|
<QrCode width="200" height="200" :text="loginQrCode"></QrCode>
|
|
@@ -161,7 +163,7 @@
|
|
|
<uni-col :xs="24" :md="12">
|
|
<uni-col :xs="24" :md="12">
|
|
|
<uni-forms-item name="birthDate" :label="t('newSignup.item18')">
|
|
<uni-forms-item name="birthDate" :label="t('newSignup.item18')">
|
|
|
<uni-datetime-picker type="date" v-model="formData.birthDate"
|
|
<uni-datetime-picker type="date" v-model="formData.birthDate"
|
|
|
- :placeholder="t('newSignup.item19')" @change="checkAge" />
|
|
|
|
|
|
|
+ :placeholder="t('newSignup.item19')" @change="checkAge" />
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
</uni-col>
|
|
</uni-col>
|
|
|
</uni-row>
|
|
</uni-row>
|
|
@@ -235,14 +237,15 @@
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
</uni-forms>
|
|
</uni-forms>
|
|
|
</view>
|
|
</view>
|
|
|
- <view >
|
|
|
|
|
|
|
+ <view>
|
|
|
<button class="regiset-btn" @click="register">
|
|
<button class="regiset-btn" @click="register">
|
|
|
{{ t('signup.button') }}
|
|
{{ t('signup.button') }}
|
|
|
</button>
|
|
</button>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="login-link " >
|
|
|
|
|
|
|
+ <view class="login-link ">
|
|
|
<text>{{ t('newSignup.item16') }}</text>
|
|
<text>{{ t('newSignup.item16') }}</text>
|
|
|
- <view class="link cursor-pointer" :data-tooltip="t('newSignup.item17')" data-placement="top" @click="activeTab = 1">{{ t('newSignup.item17') }}</view>
|
|
|
|
|
|
|
+ <view class="link cursor-pointer" :data-tooltip="t('newSignup.item17')" data-placement="top"
|
|
|
|
|
+ @click="activeTab = 1">{{ t('newSignup.item17') }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="des-bottom">
|
|
<view class="des-bottom">
|
|
|
<text v-t="'signup.agreemnet1'"></text>
|
|
<text v-t="'signup.agreemnet1'"></text>
|
|
@@ -261,15 +264,16 @@
|
|
|
</uni-col>
|
|
</uni-col>
|
|
|
</uni-row>
|
|
</uni-row>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="chat-icon cursor-pointer" :data-tooltip="t('Downloadpage.item16')" :class="{ 'chat-icon-expanded': isChatIconExpanded, 'chat-icon-hidden': type == 'chat' }"
|
|
|
|
|
|
|
+ <view class="chat-icon cursor-pointer" :data-tooltip="t('Downloadpage.item16')"
|
|
|
|
|
+ :class="{ 'chat-icon-expanded': isChatIconExpanded, 'chat-icon-hidden': type == 'chat' }"
|
|
|
@click="handleChatIconClick">
|
|
@click="handleChatIconClick">
|
|
|
<cwg-icon name="chat" color="#fff" />
|
|
<cwg-icon name="chat" color="#fff" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <cwg-global-popup/>
|
|
|
|
|
|
|
+ <cwg-global-popup />
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, watch, onMounted, computed } from 'vue'
|
|
|
|
|
|
|
+import { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
import ls from "@/utils/store2";
|
|
import ls from "@/utils/store2";
|
|
|
import QrCode from '@/components/QrCode.vue'
|
|
import QrCode from '@/components/QrCode.vue'
|
|
@@ -294,12 +298,13 @@ import LiveChatService from '@/utils/liveChat.js'
|
|
|
import { useWindowWidth } from '@/composables/useWindowWidth'
|
|
import { useWindowWidth } from '@/composables/useWindowWidth'
|
|
|
import { openLocalPdf } from '@/utils/pdf.js'
|
|
import { openLocalPdf } from '@/utils/pdf.js'
|
|
|
import { usePopup } from '@/hooks/usePopup'
|
|
import { usePopup } from '@/hooks/usePopup'
|
|
|
|
|
+import tool from '@/global/tool.js'
|
|
|
|
|
|
|
|
const windowWidth = useWindowWidth(300)
|
|
const windowWidth = useWindowWidth(300)
|
|
|
const isMobile = computed(() => windowWidth.value <= 991)
|
|
const isMobile = computed(() => windowWidth.value <= 991)
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
-const { t ,locale} = useI18n()
|
|
|
|
|
|
|
+const { t, locale } = useI18n()
|
|
|
const { Code } = Config
|
|
const { Code } = Config
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const globalStore = useGlobalStore()
|
|
const globalStore = useGlobalStore()
|
|
@@ -311,9 +316,19 @@ const tabs = computed(() => [
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
// 登录二维码
|
|
// 登录二维码
|
|
|
-const loginQrCode = ref('https://secure.44a5c8109e4.com/wgt/CWG Center.apk')
|
|
|
|
|
|
|
+const loginQrCode = ref('')
|
|
|
|
|
+const scanLoginScene = ref('')
|
|
|
|
|
+let scanLoginWs = null
|
|
|
|
|
+let scanLoginPollTimer = null
|
|
|
|
|
+let scanLoginHandled = false
|
|
|
|
|
+
|
|
|
|
|
+const SCAN_LOGIN_STATUS = {
|
|
|
|
|
+ INIT: 0,
|
|
|
|
|
+ CONFIRMED: 1,
|
|
|
|
|
+ EXPIRED: 2,
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-const { confirm,toast } = usePopup()
|
|
|
|
|
|
|
+const { confirm, toast } = usePopup()
|
|
|
const activeTab = ref(1)
|
|
const activeTab = ref(1)
|
|
|
|
|
|
|
|
// ========== 注册表单相关 ==========
|
|
// ========== 注册表单相关 ==========
|
|
@@ -344,7 +359,7 @@ const formData = ref({
|
|
|
ibInvalid: null,
|
|
ibInvalid: null,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const rules = computed(()=>({
|
|
|
|
|
|
|
+const rules = computed(() => ({
|
|
|
country: { rules: [{ required: true, errorMessage: t('vaildate.country.empty'), trigger: 'blur' }] },
|
|
country: { rules: [{ required: true, errorMessage: t('vaildate.country.empty'), trigger: 'blur' }] },
|
|
|
email: {
|
|
email: {
|
|
|
rules: [
|
|
rules: [
|
|
@@ -434,9 +449,9 @@ const rule2 = computed(() => {
|
|
|
return /^(?=.*?[a-z])(?=.*?[A-Z]).*$/.test(formData.value.password)
|
|
return /^(?=.*?[a-z])(?=.*?[A-Z]).*$/.test(formData.value.password)
|
|
|
})
|
|
})
|
|
|
const rule3 = computed(() => {
|
|
const rule3 = computed(() => {
|
|
|
- return /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[~!@&%$^*./\\(\\)\\+\\=#_-])[A-Za-z0-9~!@&%$^*./\\(\\)\\+\\=#_-]{8,16}$/.test(
|
|
|
|
|
- formData.value.password,
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ return /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[~!@&%$^*./\\(\\)\\+\\=#_-])[A-Za-z0-9~!@&%$^*./\\(\\)\\+\\=#_-]{8,16}$/.test(
|
|
|
|
|
+ formData.value.password,
|
|
|
|
|
+ );
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const isAgeValid = computed(() => {
|
|
const isAgeValid = computed(() => {
|
|
@@ -624,11 +639,11 @@ const register = async () => {
|
|
|
const xSystemValue = isChina ? 'B' : 'A'
|
|
const xSystemValue = isChina ? 'B' : 'A'
|
|
|
|
|
|
|
|
let resData = await loginApi.Register(
|
|
let resData = await loginApi.Register(
|
|
|
- { ...formData.value,agree: formData.value.agree ==1 ? true : false },
|
|
|
|
|
|
|
+ { ...formData.value, agree: formData.value.agree == 1 ? true : false },
|
|
|
{ headers: { 'X-System': xSystemValue } },
|
|
{ headers: { 'X-System': xSystemValue } },
|
|
|
)
|
|
)
|
|
|
if (resData.code == 200) {
|
|
if (resData.code == 200) {
|
|
|
- showToast(t('Msg.registerSuc'),'success')
|
|
|
|
|
|
|
+ showToast(t('Msg.registerSuc'), 'success')
|
|
|
registLogin()
|
|
registLogin()
|
|
|
} else {
|
|
} else {
|
|
|
confirm({
|
|
confirm({
|
|
@@ -638,14 +653,14 @@ const register = async () => {
|
|
|
confirmText: t('Btn.Confirm'),
|
|
confirmText: t('Btn.Confirm'),
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- }catch (e) {
|
|
|
|
|
|
|
+ } catch (e) {
|
|
|
confirm({
|
|
confirm({
|
|
|
title: t('Msg.SystemPrompt'),
|
|
title: t('Msg.SystemPrompt'),
|
|
|
content: e.msg,
|
|
content: e.msg,
|
|
|
showCancel: false,
|
|
showCancel: false,
|
|
|
confirmText: t('Btn.Confirm'),
|
|
confirmText: t('Btn.Confirm'),
|
|
|
})
|
|
})
|
|
|
- console.log(e,'err')
|
|
|
|
|
|
|
+ console.log(e, 'err')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -710,7 +725,6 @@ function submit() {
|
|
|
|
|
|
|
|
handleLogin()
|
|
handleLogin()
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
const customStyle = {
|
|
const customStyle = {
|
|
|
height: '48px',
|
|
height: '48px',
|
|
|
'border-radius': '8px',
|
|
'border-radius': '8px',
|
|
@@ -759,10 +773,10 @@ async function handleLogin() {
|
|
|
// console.log(12112);
|
|
// console.log(12112);
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- loginLoading.value =false
|
|
|
|
|
|
|
+ loginLoading.value = false
|
|
|
// console.log(error)
|
|
// console.log(error)
|
|
|
// uni.showToast({ title: error.msg, icon: 'error' })
|
|
// uni.showToast({ title: error.msg, icon: 'error' })
|
|
|
- toast(error.msg||t('common.error'))
|
|
|
|
|
|
|
+ toast(error.msg || t('common.error'))
|
|
|
// console.log(error, 19089);
|
|
// console.log(error, 19089);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -774,7 +788,7 @@ async function getCustomLoginInfo() {
|
|
|
uni.removeStorageSync('systemListCache')
|
|
uni.removeStorageSync('systemListCache')
|
|
|
// 登录更新金额
|
|
// 登录更新金额
|
|
|
uni.$emit('updatePayment')
|
|
uni.$emit('updatePayment')
|
|
|
- loginLoading.value =false
|
|
|
|
|
|
|
+ loginLoading.value = false
|
|
|
// uni.$emit('updateSystemList', 'login')
|
|
// uni.$emit('updateSystemList', 'login')
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
switch (modeStore.value) {
|
|
switch (modeStore.value) {
|
|
@@ -792,6 +806,7 @@ async function getCustomLoginInfo() {
|
|
|
default:
|
|
default:
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
|
|
+ cleanupScanLogin()
|
|
|
} else {
|
|
} else {
|
|
|
uni.$u.toast(res.msg || t('login.msg0'))
|
|
uni.$u.toast(res.msg || t('login.msg0'))
|
|
|
}
|
|
}
|
|
@@ -844,13 +859,121 @@ function pickFields(source, fields = ['content', 'enContent']) {
|
|
|
userStore.saveReasonsOptions(result)
|
|
userStore.saveReasonsOptions(result)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const cleanupScanLogin = () => {
|
|
|
|
|
+ if (scanLoginPollTimer) {
|
|
|
|
|
+ clearInterval(scanLoginPollTimer)
|
|
|
|
|
+ scanLoginPollTimer = null
|
|
|
|
|
+ }
|
|
|
|
|
+ if (scanLoginWs) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ scanLoginWs.close({})
|
|
|
|
|
+ } catch (e) { /* ignore */ }
|
|
|
|
|
+ scanLoginWs = null
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleScanLoginResult = async (data) => {
|
|
|
|
|
+ if (scanLoginHandled) return
|
|
|
|
|
+ if (data.scene && scanLoginScene.value && data.scene !== scanLoginScene.value) return
|
|
|
|
|
+
|
|
|
|
|
+ if (data.status === SCAN_LOGIN_STATUS.CONFIRMED && data.accessToken) {
|
|
|
|
|
+ scanLoginHandled = true
|
|
|
|
|
+ cleanupScanLogin()
|
|
|
|
|
+ userToken.value = data.accessToken
|
|
|
|
|
+ uni.showToast({ title: t('login.msg0_1'), icon: 'success' })
|
|
|
|
|
+ await getCustomLoginInfo()
|
|
|
|
|
+ reasonsRefusalList()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (data.status === SCAN_LOGIN_STATUS.EXPIRED) {
|
|
|
|
|
+ cleanupScanLogin()
|
|
|
|
|
+ scanLoginHandled = false
|
|
|
|
|
+ getLoginQrCode()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const initScanLoginWs = (socketAccessToken) => {
|
|
|
|
|
+ if (!socketAccessToken) return
|
|
|
|
|
+ const token = tool.tokenReplace(socketAccessToken)
|
|
|
|
|
+ const wsUrl = `${Config.HostWs}/webSocket?Access-Token=${token}`
|
|
|
|
|
+
|
|
|
|
|
+ // H5 必须传 success/complete,否则返回 Promise 而非 SocketTask,onMessage 无法绑定
|
|
|
|
|
+ scanLoginWs = uni.connectSocket({
|
|
|
|
|
+ url: wsUrl,
|
|
|
|
|
+ complete: () => { },
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ scanLoginWs.onOpen(() => {
|
|
|
|
|
+ console.log('scan login ws opened')
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ scanLoginWs.onMessage((res) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ let raw = res.data
|
|
|
|
|
+ if (raw instanceof ArrayBuffer) {
|
|
|
|
|
+ raw = new TextDecoder('utf-8').decode(raw)
|
|
|
|
|
+ }
|
|
|
|
|
+ const data = typeof raw === 'string' ? JSON.parse(raw) : raw
|
|
|
|
|
+ if (data.type === 'scan') {
|
|
|
|
|
+ handleScanLoginResult(data)
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) { }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ scanLoginWs.onError((err) => {
|
|
|
|
|
+ console.log('scan login ws error', err)
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const pollScanLoginStatus = async () => {
|
|
|
|
|
+ if (!scanLoginScene.value || scanLoginHandled) return
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await userApi.getAppScanLoginStatus({ scene: scanLoginScene.value })
|
|
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
|
|
+ handleScanLoginResult(res.data)
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) { /* ignore */ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const startScanLoginPoll = () => {
|
|
|
|
|
+ if (scanLoginPollTimer) clearInterval(scanLoginPollTimer)
|
|
|
|
|
+ scanLoginPollTimer = setInterval(pollScanLoginStatus, 5000)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const getLoginQrCode = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ cleanupScanLogin()
|
|
|
|
|
+ scanLoginHandled = false
|
|
|
|
|
+ scanLoginScene.value = ''
|
|
|
|
|
+ const res = await userApi.getAppScanLogin()
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ const { scene, qrContent, socketAccessToken } = res.data
|
|
|
|
|
+ scanLoginScene.value = scene
|
|
|
|
|
+ loginQrCode.value = qrContent || scene
|
|
|
|
|
+ initScanLoginWs(socketAccessToken)
|
|
|
|
|
+ startScanLoginPoll()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.$u.toast(res.msg || t('login.msg0'))
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ // console.log(error, 111);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
if (uni.getStorageSync('logoutToSystem') == 1) {
|
|
if (uni.getStorageSync('logoutToSystem') == 1) {
|
|
|
uni.removeStorageSync('logoutToSystem')
|
|
uni.removeStorageSync('logoutToSystem')
|
|
|
uni.removeStorageSync('systemListCache')
|
|
uni.removeStorageSync('systemListCache')
|
|
|
}
|
|
}
|
|
|
|
|
+ // #ifdef H5
|
|
|
|
|
+ if (!isMobile.value) {
|
|
|
|
|
+ // getLoginQrCode()
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
uni.$emit('updateSystemList', 'login')
|
|
uni.$emit('updateSystemList', 'login')
|
|
|
- uni.$on('updateAppSuccess',()=>{
|
|
|
|
|
|
|
+ uni.$on('updateAppSuccess', () => {
|
|
|
uni.showToast('')
|
|
uni.showToast('')
|
|
|
})
|
|
})
|
|
|
const accountInfo = userStore.accountInfo
|
|
const accountInfo = userStore.accountInfo
|
|
@@ -869,6 +992,11 @@ onMounted(() => {
|
|
|
getCountryMsg()
|
|
getCountryMsg()
|
|
|
globalStore.setMode(ls.get('mode') || 'customer');
|
|
globalStore.setMode(ls.get('mode') || 'customer');
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+onBeforeUnmount(() => {
|
|
|
|
|
+ cleanupScanLogin()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const inputType = ref('password')
|
|
const inputType = ref('password')
|
|
|
const isChatIconExpanded = ref(false)
|
|
const isChatIconExpanded = ref(false)
|
|
|
// 处理聊天图标点击
|
|
// 处理聊天图标点击
|