|
@@ -2,7 +2,7 @@
|
|
* @Author: wjc
|
|
* @Author: wjc
|
|
* @Date: 2024-06-06 14:51:25
|
|
* @Date: 2024-06-06 14:51:25
|
|
* @LastEditors: wjc
|
|
* @LastEditors: wjc
|
|
- * @LastEditTime: 2024-06-11 17:33:05
|
|
|
|
|
|
+ * @LastEditTime: 2024-06-12 17:22:09
|
|
* @Description:
|
|
* @Description:
|
|
-->
|
|
-->
|
|
<template>
|
|
<template>
|
|
@@ -30,13 +30,14 @@
|
|
</up-form-item>
|
|
</up-form-item>
|
|
</up-form>
|
|
</up-form>
|
|
<view class="flex items-center color-gray text-14px mt-24px mb-24px">
|
|
<view class="flex items-center color-gray text-14px mt-24px mb-24px">
|
|
- <up-checkbox
|
|
|
|
- shape="circle"
|
|
|
|
- name="isCheck"
|
|
|
|
- :checked="formState.isCheck"
|
|
|
|
- label="我已阅读同意"
|
|
|
|
- :label-size="14"
|
|
|
|
- ></up-checkbox>
|
|
|
|
|
|
+ <up-checkbox-group v-model="isChecks">
|
|
|
|
+ <up-checkbox
|
|
|
|
+ shape="circle"
|
|
|
|
+ name="isCheck"
|
|
|
|
+ label="我已阅读同意"
|
|
|
|
+ :label-size="14"
|
|
|
|
+ ></up-checkbox>
|
|
|
|
+ </up-checkbox-group>
|
|
<text class="font-500 color-black" @click="goPrivacy">《绘管家个人信息保护政策》</text>
|
|
<text class="font-500 color-black" @click="goPrivacy">《绘管家个人信息保护政策》</text>
|
|
</view>
|
|
</view>
|
|
<up-button type="primary" class="btn-primary" @click="onSubmit">登录</up-button>
|
|
<up-button type="primary" class="btn-primary" @click="onSubmit">登录</up-button>
|
|
@@ -46,23 +47,25 @@
|
|
<view>2016-{{ new Date().getFullYear() }} Ⓒ 海南智慧城科技有限公司</view>
|
|
<view>2016-{{ new Date().getFullYear() }} Ⓒ 海南智慧城科技有限公司</view>
|
|
<view>琼ICP备18001846号-4A</view>
|
|
<view>琼ICP备18001846号-4A</view>
|
|
</view>
|
|
</view>
|
|
- <PrivacyModal></PrivacyModal>
|
|
|
|
|
|
+ <PrivacyModal @privacy="handlePrivacy"></PrivacyModal>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
+ import { useUserStore } from '@/stores/modules/userStore'
|
|
import logo from '@/static/images/logo.png'
|
|
import logo from '@/static/images/logo.png'
|
|
import PrivacyModal from './components/privacy.vue'
|
|
import PrivacyModal from './components/privacy.vue'
|
|
|
|
|
|
defineOptions({ name: 'Login' })
|
|
defineOptions({ name: 'Login' })
|
|
|
|
|
|
|
|
+ const userStore = useUserStore()
|
|
const formRef = ref(null)
|
|
const formRef = ref(null)
|
|
const formState = ref({
|
|
const formState = ref({
|
|
entCode: '',
|
|
entCode: '',
|
|
- account: '',
|
|
|
|
|
|
+ account: '18889757900',
|
|
password: undefined,
|
|
password: undefined,
|
|
- isCheck: false,
|
|
|
|
})
|
|
})
|
|
|
|
+ const isChecks = ref([])
|
|
const rules = ref({
|
|
const rules = ref({
|
|
entCode: {
|
|
entCode: {
|
|
type: 'number',
|
|
type: 'number',
|
|
@@ -77,7 +80,7 @@
|
|
trigger: ['blur', 'change'],
|
|
trigger: ['blur', 'change'],
|
|
},
|
|
},
|
|
password: {
|
|
password: {
|
|
- type: 'number',
|
|
|
|
|
|
+ type: 'string',
|
|
required: true,
|
|
required: true,
|
|
message: '请输入密码',
|
|
message: '请输入密码',
|
|
trigger: ['blur', 'change'],
|
|
trigger: ['blur', 'change'],
|
|
@@ -87,23 +90,47 @@
|
|
const goPrivacy = () => {
|
|
const goPrivacy = () => {
|
|
uni.navigateTo({ url: '/pages/privacy/index' })
|
|
uni.navigateTo({ url: '/pages/privacy/index' })
|
|
}
|
|
}
|
|
|
|
+
|
|
const onSubmit = () => {
|
|
const onSubmit = () => {
|
|
formRef.value
|
|
formRef.value
|
|
.validate()
|
|
.validate()
|
|
.then((valid) => {
|
|
.then((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- console.log(124)
|
|
|
|
|
|
+ if (isChecks.value.length === 0) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '请先阅读并勾选绘管家个人信息保护政策',
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ userStore.loginAction(formState.value).then((res) => {
|
|
|
|
+ if (res) {
|
|
|
|
+ userStore.getUserInfoAction().then((res) => {
|
|
|
|
+ if (res) {
|
|
|
|
+ uni.reLaunch({
|
|
|
|
+ url: '/pages/index/index',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
// 处理验证错误
|
|
// 处理验证错误
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ const handlePrivacy = (data: boolean) => {
|
|
|
|
+ if (data) {
|
|
|
|
+ isChecks.value = ['isCheck']
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
.login-container {
|
|
.login-container {
|
|
- @apply h-full p-24px;
|
|
|
|
|
|
+ @apply wh-full p-24px box-border;
|
|
background: url('@/static/images/login/bg.png') no-repeat;
|
|
background: url('@/static/images/login/bg.png') no-repeat;
|
|
background-size: contain;
|
|
background-size: contain;
|
|
.header {
|
|
.header {
|