Merge branch 'main' of http://18.167.251.121:10003/aidlab/FiDA_Front
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted, reactive, toRefs, computed } from "vue";
|
||||
import VersionTreeIndex from './versionTree/index.vue'
|
||||
import VersionTreeIndex from '@/views/home/agent/components/versionTree/index.vue'
|
||||
|
||||
import GenerateSketch from './generateSketch/index.vue'
|
||||
//const props = defineProps({
|
||||
//})
|
||||
@@ -73,14 +74,25 @@ const generateSketch = ()=>{
|
||||
sketchRestore('2')
|
||||
}
|
||||
|
||||
const sketchRestore = (id)=>{
|
||||
generateData.value.list.forEach((item)=>{
|
||||
if(item.id == id){
|
||||
item.type = 'waiting'
|
||||
const sketchRestore = (item)=>{
|
||||
generateData.value.list.forEach((generateDataItem)=>{
|
||||
if(item.id == generateDataItem.id){
|
||||
generateDataItem.type = 'waiting'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const sketchDelete = (item)=>{
|
||||
console.log(item)
|
||||
generateData.value.list.forEach((generateDataItem,index)=>{
|
||||
if(item.id == generateDataItem.id){
|
||||
generateData.value.list.splice(index,1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(()=>{
|
||||
})
|
||||
onUnmounted(()=>{
|
||||
@@ -99,7 +111,7 @@ const {} = toRefs(data);
|
||||
</div>
|
||||
<VersionTreeIndex v-model:versionTreeData="versionTreeData" />
|
||||
<div class="generateSketchBox">
|
||||
<GenerateSketch v-model:generateData="generateData"></GenerateSketch>
|
||||
<GenerateSketch v-model:generateData="generateData" @sketchRestore="sketchRestore" @sketchDelete="sketchDelete"></GenerateSketch>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -13,6 +13,30 @@
|
||||
<img :src="LoadingImg" alt="" />
|
||||
</div>
|
||||
</template>
|
||||
<div v-else class="reportBorder">
|
||||
<div class="report">
|
||||
<div v-if="false" class="report-content-null">
|
||||
<img :src="reportNull" alt="" />
|
||||
</div>
|
||||
<div v-else class="report-content">
|
||||
<div class="">
|
||||
|
||||
</div>
|
||||
<div class="downBtnBox">
|
||||
<div class="downBtn">
|
||||
<div class="icon">
|
||||
<SvgIcon name="reportDown" size="16"></SvgIcon>
|
||||
</div>
|
||||
<span>{{ $t('agent.Download') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
# 一级标题
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -20,6 +44,7 @@
|
||||
import { ref } from 'vue'
|
||||
import Menu from './Menu.vue'
|
||||
import LoadingImg from '@/assets/images/sketch-loading.gif'
|
||||
import reportNull from '@/assets/images/reportNull.png'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -45,6 +70,8 @@
|
||||
|
||||
<style lang="less" scoped>
|
||||
.preview-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
gap: 1.2rem;
|
||||
flex-wrap: wrap;
|
||||
.sketch-item {
|
||||
@@ -71,12 +98,75 @@
|
||||
border: 0.2rem solid #e5e5e5;
|
||||
font-family: 'GeneralMedium';
|
||||
font-size: 1.4rem;
|
||||
padding: 0 0.9rem 0 1.4rem;
|
||||
cursor: pointer;
|
||||
img{
|
||||
width: 1.8rem;
|
||||
height: 1.8rem;
|
||||
}
|
||||
padding: 0 0.9rem 0 1.4rem;
|
||||
cursor: pointer;
|
||||
img{
|
||||
width: 1.8rem;
|
||||
height: 1.8rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.reportBorder{
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
--border-width: 3px;
|
||||
flex: 1;
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background: linear-gradient(119.03deg, rgba(233, 121, 60, 0.3) 1.61%, rgba(255, 207, 144, 0.3) 101.01%);
|
||||
border-radius: 2.3rem;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: -50%;
|
||||
top: -50%;
|
||||
transform: translate(50%, 50%);
|
||||
}
|
||||
.report {
|
||||
background-color: #fff;
|
||||
width: calc(100% - var(--border-width) * 2);
|
||||
height: calc(100% - var(--border-width) * 2);
|
||||
border-radius: 2rem;
|
||||
display: flex;
|
||||
.report-content-null{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.report-content{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.downBtnBox{
|
||||
padding: 2.2rem 5.2rem 0;
|
||||
.downBtn{
|
||||
display: flex;
|
||||
width: 11.2rem;
|
||||
justify-content: center;
|
||||
margin-left: auto;
|
||||
line-height: 3.2rem;
|
||||
border-radius: 5px;
|
||||
background-color: #ff7a51;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
.icon{
|
||||
margin-right: .02rem;
|
||||
}
|
||||
span{
|
||||
font-weight: 500;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content{
|
||||
word-break: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,14 @@ const {} = toRefs(data)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="expandBtnBox">
|
||||
<div class="btn" @click="openTree(true)">
|
||||
<div class="versionExport">
|
||||
<SvgIcon name="versionExport" size="17" color="rgba(0, 0, 0, 0.6)" />
|
||||
</div>
|
||||
<span>{{ $t('VersionTree.export') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="expandBtnBox">
|
||||
<div class="btn" @click="openTree(true)">
|
||||
<div class="bg left" :class="{'active':treeState}"></div>
|
||||
@@ -135,96 +143,47 @@ const {} = toRefs(data)
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.versionTreeTitle {
|
||||
.versionTreeTitle{
|
||||
width: 100%;
|
||||
height: 8rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 0.8rem 0 2.4rem;
|
||||
border-bottom: 1px solid #c9c9c9;
|
||||
> span {
|
||||
padding: 0 .8rem 0 2.4rem;
|
||||
border-bottom: 1px solid #C9C9C9;
|
||||
> span{
|
||||
font-size: 2rem;
|
||||
font-weight: 600;
|
||||
font-family: 'SemiBold';
|
||||
}
|
||||
.versionTreeTitle{
|
||||
width: 100%;
|
||||
height: 8rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 .8rem 0 2.4rem;
|
||||
border-bottom: 1px solid #C9C9C9;
|
||||
> span{
|
||||
font-size: 2rem;
|
||||
font-weight: 600;
|
||||
font-family: 'SemiBold';
|
||||
}
|
||||
> .closeBtn{
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.expandBtnBox{
|
||||
padding: .4rem .7rem;
|
||||
border-radius: 1.1rem;
|
||||
background-color: #f3f3f3;
|
||||
display: flex;
|
||||
margin-left: auto;
|
||||
margin-top: 2.1rem;
|
||||
margin-right: 3rem;
|
||||
> .btn{
|
||||
padding: .6rem .5rem;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
> .bg{
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
border-radius: .6rem;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
transition: all .3s;
|
||||
top: 0;
|
||||
&.active{
|
||||
width: 100%;
|
||||
}
|
||||
&.left{
|
||||
right: 0;
|
||||
}
|
||||
&.right{
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
> span{
|
||||
position: relative;
|
||||
font-size: 1.3rem;
|
||||
line-height: 1.8rem;
|
||||
font-weight: 500;
|
||||
letter-spacing: -0.08px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.versionTreeBox{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
> .tree{
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 2.1rem 0 5.4rem 2.2rem;
|
||||
}
|
||||
> .detail{
|
||||
width: 35rem;
|
||||
margin: 2.1rem 3rem 5.4rem 3.4rem;
|
||||
height: calc(100% - 2.1rem - 5.4rem);
|
||||
overflow: hidden;
|
||||
}
|
||||
> .closeBtn{
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.expandBtnBox {
|
||||
.expandBtnBox{
|
||||
margin-left: auto;
|
||||
margin-top: 2.2rem;
|
||||
margin-right: 3rem;
|
||||
> .btn{
|
||||
padding: .6rem 1.8rem;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 8px;
|
||||
border: 1.5px solid #D9D9D9;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
> .versionExport{
|
||||
margin-right: .6rem;
|
||||
}
|
||||
> span{
|
||||
font-weight: 500;
|
||||
font-size: 1.4rem;
|
||||
letter-spacing: Letter Spacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
.versionTreeBox {
|
||||
flex: 1;
|
||||
@@ -234,11 +193,11 @@ const {} = toRefs(data)
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 2.1rem 0 5.4rem 2.2rem;
|
||||
padding: 2.5rem 0 5.4rem 2.2rem;
|
||||
}
|
||||
> .detail {
|
||||
width: 35rem;
|
||||
margin: 2.1rem 3rem 5.4rem 3.4rem;
|
||||
margin: 2.5rem 3rem 5.4rem 3.4rem;
|
||||
height: calc(100% - 2.1rem - 5.4rem);
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -1,19 +1,35 @@
|
||||
<template>
|
||||
<div class="agent-wrapper flex space-between">
|
||||
<Agent :title="agentTitle" />
|
||||
<div class="preview-wrapper">
|
||||
<Preview :type="previewType" />
|
||||
<div class="openVersionTree">
|
||||
<div class="btn" @click="versionTreeData.drawer = true">
|
||||
Version Tree
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<Agent :title="agentTitle" />
|
||||
<div class="preview-wrapper">
|
||||
<Preview :type="previewType" />
|
||||
</div>
|
||||
</div>
|
||||
<VersionTreeIndex v-model:versionTreeData="versionTreeData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import Agent from './components/Agent.vue'
|
||||
import Preview from './components/Preview.vue'
|
||||
import VersionTreeIndex from './components/versionTree/index.vue'
|
||||
|
||||
const agentTitle = ref('Retro Sofa Sketch')
|
||||
const previewType = ref<'sketch' | 'report'>('sketch')
|
||||
const previewType = ref<'sketch' | 'report'>('report')
|
||||
|
||||
const versionTreeData = ref({
|
||||
drawer:false,
|
||||
list:computed(()=>{
|
||||
return []
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@@ -21,7 +37,39 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-top: 0.1rem solid #c9c9c9;
|
||||
padding: 8rem 2.3rem 6rem 2.8rem;
|
||||
padding: 0rem 2.3rem 6rem 2.8rem;
|
||||
flex-direction: column;
|
||||
.openVersionTree{
|
||||
padding: 2rem 0rem;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
height: min-content;
|
||||
> .btn{
|
||||
padding: 1.5rem 1.45rem;
|
||||
font-weight: 500;
|
||||
font-size: 1.4rem;
|
||||
border-radius: 2rem;
|
||||
position: relative;
|
||||
background: white;
|
||||
cursor: pointer;
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -1px;
|
||||
background: linear-gradient(119.03deg, rgba(233, 121, 60, 0.8) 1.61%, rgba(255, 207, 144, 0.8) 101.01%);
|
||||
border-radius: 2.2rem;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-wrapper{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
justify-content: space-between;
|
||||
// overflow: hidden;
|
||||
}
|
||||
|
||||
.c-svg {
|
||||
width: initial;
|
||||
|
||||
@@ -12,8 +12,10 @@ const props = defineProps({
|
||||
},
|
||||
},
|
||||
})
|
||||
//const emit = defineEmits([
|
||||
//])
|
||||
const emit = defineEmits([
|
||||
'sketchRestore',
|
||||
'sketchDelete',
|
||||
])
|
||||
let data = reactive({
|
||||
})
|
||||
onMounted(()=>{
|
||||
@@ -26,7 +28,7 @@ const {} = toRefs(data);
|
||||
<template>
|
||||
<div class="generateSketch">
|
||||
<div v-for="item in generateData.list" :key="item.id" class="item">
|
||||
<GenerateItem :item="item" />
|
||||
<GenerateItem :item="item" @sketchRestore="()=>emit('sketchRestore',item)" @sketchDelete="()=>emit('sketchDelete',item)" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -15,12 +15,14 @@
|
||||
<div class="bottom-view"><router-view></router-view></div>
|
||||
</div>
|
||||
</div>
|
||||
<setting />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import LeftNav from './left-nav.vue'
|
||||
import TopNav from './top-nav.vue'
|
||||
import setting from './setting/index.vue'
|
||||
import { useGlobalStore } from '@/stores'
|
||||
const globalStore = useGlobalStore()
|
||||
const loading = computed(() => globalStore.state.loading)
|
||||
|
||||
52
src/views/home/setting/General.vue
Normal file
52
src/views/home/setting/General.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="label">User Name</div>
|
||||
<div class="value">张三</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Email</div>
|
||||
<div class="value">zhangsan@example.com</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Language</div>
|
||||
<dropdown-menu v-model="locale" :list="langs" @change="changeLang" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Log out on this device</div>
|
||||
<button class="logout-btn" @click="logout">Log out</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onBeforeUnmount, inject } from 'vue'
|
||||
import dropdownMenu from '@/components/dropdown-menu.vue'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { locale } = useI18n()
|
||||
const reload = inject('reload')
|
||||
const userInfoStore = useUserInfoStore()
|
||||
const langs = ref([
|
||||
{ label: 'English', value: 'ENGLISH' },
|
||||
{ label: '中文', value: 'CHINESE_SIMPLIFIED' }
|
||||
])
|
||||
const changeLang = (value: string) => {
|
||||
locale.value = value
|
||||
reload()
|
||||
}
|
||||
const logout = () => {
|
||||
userInfoStore.logOut()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.logout-btn {
|
||||
cursor: pointer;
|
||||
height: 3.7rem;
|
||||
width: 9.6rem;
|
||||
border-radius: 3.7rem;
|
||||
border: none;
|
||||
background-color: #ff7a51;
|
||||
color: #fff;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
</style>
|
||||
33
src/views/home/setting/LearnMore.vue
Normal file
33
src/views/home/setting/LearnMore.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="label">User Agreement</div>
|
||||
<button @click="onClickUserAgreement">View</button>
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Privacy Policy</div>
|
||||
<button @click="onClickPrivacy">View</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onBeforeUnmount, inject } from 'vue'
|
||||
|
||||
const onClickUserAgreement = () => {
|
||||
console.log('onClickUserAgreement')
|
||||
}
|
||||
const onClickPrivacy = () => {
|
||||
console.log('onClickPrivacy')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
button {
|
||||
width: 10rem;
|
||||
height: 3.73rem;
|
||||
background-color: transparent;
|
||||
border: 0.01rem solid #b5b5b5;
|
||||
color: #000;
|
||||
font-size: 1.4rem;
|
||||
border-radius: 3rem;
|
||||
}
|
||||
</style>
|
||||
75
src/views/home/setting/Profile.vue
Normal file
75
src/views/home/setting/Profile.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="label">Region</div>
|
||||
<dropdown-menu v-model="region" :list="regions" @change="changeRegion" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Role</div>
|
||||
<dropdown-menu v-model="role" :list="roles" @change="changeRole" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Current Agent Profile</div>
|
||||
<div class="group">
|
||||
<span class="icon"><svg-icon name="xiang" size="20" color="#000" /></span>
|
||||
<dropdown-menu v-model="agent" :list="agents" @change="changeAgent" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Current Notification Frequency</div>
|
||||
<div class="value">3–6 times per hour</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onBeforeUnmount, inject } from 'vue'
|
||||
import dropdownMenu from '@/components/dropdown-menu.vue'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { locale } = useI18n()
|
||||
const region = ref('China')
|
||||
const regions = ref([
|
||||
{ label: 'United States', value: 'United States' },
|
||||
{ label: 'Singapore', value: 'Singapore' },
|
||||
{ label: 'Australia', value: 'Australia' },
|
||||
{ label: 'South Korea', value: 'South Korea' },
|
||||
{ label: 'China', value: 'China' },
|
||||
{ label: 'Italy', value: 'Italy' },
|
||||
{ label: 'France', value: 'France' },
|
||||
{ label: 'Japan', value: 'Japan' },
|
||||
{ label: 'Canada', value: 'Canada' },
|
||||
{ label: 'Germany', value: 'Germany' }
|
||||
])
|
||||
const changeRegion = (value: string) => {
|
||||
console.log(value)
|
||||
}
|
||||
|
||||
const role = ref('Designer')
|
||||
const roles = ref([
|
||||
{ label: 'Designer', value: 'Designer' },
|
||||
{ label: 'Student', value: 'Student' },
|
||||
{ label: 'Teacher', value: 'Teacher' },
|
||||
{ label: 'Parent', value: 'Parent' }
|
||||
])
|
||||
const changeRole = (value: string) => {
|
||||
console.log(value)
|
||||
}
|
||||
|
||||
const agent = ref('Partner')
|
||||
const agents = ref([
|
||||
{ label: 'Partner', value: 'Partner' },
|
||||
{ label: 'Observer', value: 'Observer' },
|
||||
{ label: 'Mentor', value: 'Mentor' }
|
||||
])
|
||||
const changeAgent = (value: string) => {
|
||||
console.log(value)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
</style>
|
||||
126
src/views/home/setting/index.vue
Normal file
126
src/views/home/setting/index.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="setting"
|
||||
v-model="showDialog"
|
||||
align-center
|
||||
:show-close="false"
|
||||
width="70rem"
|
||||
style="border-radius: 2rem; padding: 3.8rem; --el-dialog-padding-primary: 1rem"
|
||||
>
|
||||
<template #header="{ close }">
|
||||
<div class="setting-header">
|
||||
<div class="title">Setting</div>
|
||||
<span class="close" @click="close">
|
||||
<svg-icon name="close" size="10" color="#000" />
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="setting-box">
|
||||
<div class="left">
|
||||
<div
|
||||
v-for="v in navs"
|
||||
:key="v.icon"
|
||||
:class="{ active: nav === v.icon }"
|
||||
@click="nav = v.icon"
|
||||
>
|
||||
<span class="icon"><svg-icon :name="v.icon" size="18" color="#000" /></span>
|
||||
<span class="label">{{ v.label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="view">
|
||||
<component :is="navs.find((v) => v.icon === nav).component" />
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import General from './General.vue'
|
||||
import Profile from './Profile.vue'
|
||||
import LearnMore from './LearnMore.vue'
|
||||
import MyEvent from '@/utils/myEvent'
|
||||
import { computed, ref, onBeforeUnmount, shallowRef } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { t: $t } = useI18n()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const showDialog = ref(false)
|
||||
const openSetting = () => {
|
||||
showDialog.value = true
|
||||
}
|
||||
MyEvent.add('openSettingDialog', openSetting)
|
||||
onBeforeUnmount(() => {
|
||||
MyEvent.remove('openSettingDialog', openSetting)
|
||||
})
|
||||
|
||||
const nav = ref('setting')
|
||||
const navs = shallowRef([
|
||||
{ icon: 'setting', label: 'General', component: General },
|
||||
{ icon: 'profile', label: 'Profile', component: Profile },
|
||||
{ icon: 'learn-more', label: 'Learn more', component: LearnMore }
|
||||
])
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.setting-header {
|
||||
margin-top: 0.2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 3.3rem;
|
||||
border-bottom: 0.1rem solid rgba(0, 0, 0, 0.1);
|
||||
> .title {
|
||||
font-family: Semibold;
|
||||
font-size: 1.6rem;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
.setting-box {
|
||||
width: 100%;
|
||||
height: 50rem;
|
||||
display: flex;
|
||||
> .left {
|
||||
margin-top: 1.8rem;
|
||||
> div {
|
||||
width: 16.4rem;
|
||||
height: 3.4rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// justify-content: center;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
> .icon {
|
||||
margin: 0 1rem;
|
||||
}
|
||||
> .label {
|
||||
color: #000;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
> .view {
|
||||
margin-left: 3.5rem;
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
&::v-deep(> div) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 6rem;
|
||||
border-bottom: 0.1rem solid rgba(0, 0, 0, 0.1);
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
> .value,
|
||||
> .label {
|
||||
font-size: 1.4rem;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -12,13 +12,38 @@
|
||||
<span class="link"></span>
|
||||
<span class="icon" @click="onShop"><svg-icon name="shop" size="21" /></span>
|
||||
</div>
|
||||
<img class="pic" src="@/assets/images/pic.jpg" />
|
||||
<el-popover
|
||||
placement="bottom-end"
|
||||
popper-style="width:auto; min-width: 22rem; padding: 0.8rem; border-radius: 1.4rem;"
|
||||
>
|
||||
<template #reference>
|
||||
<img class="pic" src="@/assets/images/pic.jpg" />
|
||||
</template>
|
||||
<div class="menu-box">
|
||||
<div>
|
||||
<span class="label">{{ email }}</span>
|
||||
</div>
|
||||
<p></p>
|
||||
<div class="btn" @click="onSetting">
|
||||
<span class="icon"><svg-icon name="setting" size="18" /></span>
|
||||
<span class="label">Settings</span>
|
||||
</div>
|
||||
<div class="btn" @click="onLogout">
|
||||
<span class="icon"><svg-icon name="logout" size="18" /></span>
|
||||
<span class="label">Log out</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import MyEvent from '@/utils/myEvent'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
const userInfoStore = useUserInfoStore()
|
||||
const email = computed(() => userInfoStore.state.userInfo.email || '------')
|
||||
const route = useRoute()
|
||||
const topNavStyle = computed(() => route.meta.topNavStyle)
|
||||
const router = useRouter()
|
||||
@@ -37,6 +62,12 @@
|
||||
loading.value = false
|
||||
}, 1500)
|
||||
}
|
||||
const onSetting = () => {
|
||||
MyEvent.emit('openSettingDialog')
|
||||
}
|
||||
const onLogout = () => {
|
||||
userInfoStore.logOut()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@@ -68,7 +99,7 @@
|
||||
height: 4.3rem;
|
||||
margin-right: 1rem;
|
||||
background-color: rgba(255, 252, 244, 1);
|
||||
border: 1px solid #FFCF90;
|
||||
border: 1px solid #ffcf90;
|
||||
border-radius: 0.8rem;
|
||||
> .credits {
|
||||
flex: 1;
|
||||
@@ -78,7 +109,7 @@
|
||||
> .link {
|
||||
height: 100%;
|
||||
width: 0;
|
||||
border-right: 1px solid #FFCF90;
|
||||
border-right: 1px solid #ffcf90;
|
||||
}
|
||||
> .icon {
|
||||
cursor: pointer;
|
||||
@@ -88,10 +119,46 @@
|
||||
animation: loading 0.6s linear infinite;
|
||||
}
|
||||
}
|
||||
> .pic {
|
||||
.pic {
|
||||
width: 4.65rem;
|
||||
height: 4.65rem;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.menu-box {
|
||||
user-select: none;
|
||||
> * {
|
||||
margin-bottom: 0.4rem;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
> div {
|
||||
height: 3.7rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// justify-content: center;
|
||||
&.btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
&.btn:hover {
|
||||
background-color: rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
> .label {
|
||||
font-size: 1.4rem;
|
||||
color: #000;
|
||||
margin-left: 0.8rem;
|
||||
}
|
||||
> .icon {
|
||||
margin-left: 1rem;
|
||||
--svg-icon-color: #000;
|
||||
}
|
||||
}
|
||||
> p {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
border-bottom: 0.1rem solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -56,11 +56,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Login } from '@/api/login'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { validateEmail, validatePass, validatePrivacy } from './tools'
|
||||
import OtherLogin from './other-login.vue'
|
||||
import VisibleCode from './visible-code.vue'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
const userInfoStore = useUserInfoStore()
|
||||
const router = useRouter()
|
||||
const ruleForm = reactive({
|
||||
email: [{ validator: validateEmail, trigger: 'blur' }],
|
||||
@@ -84,16 +87,32 @@
|
||||
const onSubmit = () => {
|
||||
formRef.value?.validate?.((valid) => {
|
||||
if (valid) {
|
||||
console.log('submit!')
|
||||
// console.log('submit!')
|
||||
isVisible.value = true
|
||||
} else {
|
||||
console.log('error submit!')
|
||||
console.warn('error submit!')
|
||||
}
|
||||
})
|
||||
}
|
||||
const onVerifyCode = (code: string) => {
|
||||
console.log(code)
|
||||
router.push({ name: 'mainInput' })
|
||||
// console.log(code)
|
||||
Login({
|
||||
email: formData.email,
|
||||
password: formData.password,
|
||||
verificationCode: code
|
||||
})
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
userInfoStore.setToken(res)
|
||||
userInfoStore.setUserInfo({
|
||||
email: formData.email
|
||||
})
|
||||
router.push({ name: 'mainInput' })
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn('error verify code!')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -60,11 +60,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Register } from '@/api/login'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { validateName, validateEmail, validatePass, validatePrivacy } from './tools'
|
||||
import OtherLogin from './other-login.vue'
|
||||
import VisibleCode from './visible-code.vue'
|
||||
import { useUserInfoStore } from '@/stores'
|
||||
const userInfoStore = useUserInfoStore()
|
||||
const router = useRouter()
|
||||
const ruleForm = reactive({
|
||||
name: [{ validator: validateName, trigger: 'blur' }],
|
||||
@@ -90,16 +93,34 @@
|
||||
const onSubmit = () => {
|
||||
formRef.value?.validate?.((valid) => {
|
||||
if (valid) {
|
||||
console.log('submit!')
|
||||
// console.log('submit!')
|
||||
isVisible.value = true
|
||||
} else {
|
||||
console.log('error submit!')
|
||||
console.warn('error submit!')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const onVerifyCode = (code: string) => {
|
||||
console.log(code)
|
||||
router.push({ name: 'nuic' })
|
||||
Register({
|
||||
username: formData.name,
|
||||
email: formData.email,
|
||||
password: formData.password,
|
||||
verificationCode: code
|
||||
})
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
userInfoStore.setToken(res)
|
||||
userInfoStore.setUserInfo({
|
||||
email: formData.email
|
||||
})
|
||||
router.push({ name: 'nuic' })
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn('error verify code!')
|
||||
})
|
||||
// router.push({ name: 'nuic' })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { SendVerificationCode } from '@/api/login'
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { CountDown } from '@/utils/tools'
|
||||
import InputCode from '@/components/input-code.vue'
|
||||
@@ -44,11 +45,20 @@
|
||||
clearTime()
|
||||
})
|
||||
onMounted(() => {
|
||||
setTime()
|
||||
onSendCode()
|
||||
})
|
||||
const onSendCode = async () => {
|
||||
const email = props.email
|
||||
if (!email) {
|
||||
console.warn('请输入邮箱')
|
||||
return
|
||||
}
|
||||
setTime()
|
||||
await SendVerificationCode({ email })
|
||||
}
|
||||
const onResend = () => {
|
||||
if (time.value > 0) return
|
||||
setTime()
|
||||
onSendCode()
|
||||
}
|
||||
const onVerify = () => {
|
||||
if (code.value.length !== 6) return
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="bg-2"></div>
|
||||
<div class="bg-1"></div>
|
||||
</div>
|
||||
<img class="loading-img" :class="{ loading }" src="@/assets/images/nuic/xiang.png" />
|
||||
<img class="loading-img" :class="{ loading }" src="@/assets/images/nuic/xiang.gif" />
|
||||
<div class="loading-tip" :class="{ loading }">{{ $t('Nuic.loadingTip') }}</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -167,7 +167,7 @@
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 14.4rem;
|
||||
width: 60rem;
|
||||
height: auto;
|
||||
opacity: 0;
|
||||
&.loading {
|
||||
|
||||
Reference in New Issue
Block a user