Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
c4c63901
Commit
c4c63901
authored
Apr 30, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增企业卡片,调整登录信息
parent
cb2e9081
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
52 additions
and
29 deletions
+52
-29
UserCard.vue
src/components/User/UserCard.vue
+2
-3
customer.ts
src/configs/customer.ts
+1
-0
user.ts
src/store/user.ts
+20
-1
Login.vue
src/views/Auth/Login.vue
+1
-2
Index.vue
src/views/Index.vue
+26
-16
Index.vue
src/views/TemplateCenter/Index.vue
+0
-1
colour.vue
src/views/TemplateCenter/colour.vue
+0
-1
nation.vue
src/views/TemplateCenter/nation.vue
+0
-1
Index.vue
src/views/UserCenter/Index.vue
+1
-2
Setting.vue
src/views/UserCenter/Setting.vue
+1
-2
No files found.
src/components/User/UserCard.vue
View file @
c4c63901
...
...
@@ -6,7 +6,7 @@
<el-dropdown
trigger=
"click"
>
<el-avatar
:size=
"size"
:src=
"userInfo.photo
&& userInfo.photo.includes('http') ? userInfo.photo:USER_DEFAULT_HEADER
"
:src=
"userInfo.photo"
shape=
"square"
style=
"background-color: #e6ddf5; color: #7b35ef"
class=
"q-mx-lg cusor-pointer"
...
...
@@ -20,7 +20,7 @@
<el-avatar
:size=
"40"
shape=
"square"
:src=
"userInfo.photo
&& userInfo.photo.includes('http') ? userInfo.photo:USER_DEFAULT_HEADER
"
:src=
"userInfo.photo"
style=
"background-color: #e6ddf5; color: #7b35ef"
class=
"q-mr-lg cusor-pointer shrink"
></el-avatar>
...
...
@@ -109,7 +109,6 @@ import { ref } from "vue";
import
{
useUserStore
}
from
"@/store"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
useRouter
}
from
"vue-router"
;
import
{
USER_DEFAULT_HEADER
}
from
'@/configs/customer'
import
{
openNewBlank
}
from
"@/utils/common"
;
import
temDesign
from
"@/components/home/temDesign.vue"
;
const
props
=
defineProps
({
...
...
src/configs/customer.ts
View file @
c4c63901
...
...
@@ -20,6 +20,7 @@ export const TME_USER_THEME:CustomerTheme = {name:'TME',bg:'linear-gradient(270d
export
const
CustomerThemeConfig
:
CustomerTheme
[]
=
[
FREE_USER_THEME
,
VIP_USER_THEME
,
ENT_USER_THEME
,
TME_USER_THEME
]
export
const
USER_DEFAULT_HEADER
=
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1713839840000_239.png'
export
const
ENTERPRISE_DEFAULT_HEADER
=
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1714387862000_894.png'
const
ALL_MEMBER_RIGHTS
:
MemberRights
[]
=
[
{
name
:
'创建行程数量'
,
value
:
'1'
,
sub
:
'(无法上传自有模板)'
,
range
:[
'F'
]},
...
...
src/store/user.ts
View file @
c4c63901
...
...
@@ -4,6 +4,7 @@ import UserService from '@/services/UserService';
import
{
defineStore
}
from
'pinia'
;
import
{
StorageLike
}
from
'pinia-plugin-persistedstate'
;
import
SecureLS
from
'secure-ls'
;
import
{
USER_DEFAULT_HEADER
,
ENTERPRISE_DEFAULT_HEADER
}
from
'@/configs/customer'
const
ls
=
new
SecureLS
({
isCompression
:
false
,
...
...
@@ -58,8 +59,14 @@ export const useUserStore = defineStore('user', {
d
.
isTemplate
=
d
.
IsEditTripTemplate
d
.
ia
=
0
d
.
it
=
true
d
.
expire
=
d
.
Expire
this
.
userInfo
=
d
if
(
!
this
.
userInfo
.
photo
||
!
this
.
userInfo
.
photo
.
includes
(
'http://'
)
||
!
this
.
userInfo
.
photo
.
includes
(
'https://'
)){
this
.
userInfo
.
photo
=
USER_DEFAULT_HEADER
}
if
(
!
this
.
userInfo
.
logo
||
!
this
.
userInfo
.
logo
.
includes
(
'http://'
)
||
!
this
.
userInfo
.
logo
.
includes
(
'https://'
)){
this
.
userInfo
.
logo
=
ENTERPRISE_DEFAULT_HEADER
}
return
true
}
}
catch
(
error
)
{}
...
...
@@ -73,6 +80,12 @@ export const useUserStore = defineStore('user', {
setNewUserInfo
(
user
:
any
){
this
.
token
=
user
.
token
this
.
userInfo
=
user
.
userinfo
if
(
!
this
.
userInfo
.
photo
||
!
this
.
userInfo
.
photo
.
includes
(
'http://'
)
||
!
this
.
userInfo
.
photo
.
includes
(
'https://'
)){
this
.
userInfo
.
photo
=
USER_DEFAULT_HEADER
}
if
(
!
this
.
userInfo
.
logo
||
!
this
.
userInfo
.
logo
.
includes
(
'http://'
)
||
!
this
.
userInfo
.
logo
.
includes
(
'https://'
)){
this
.
userInfo
.
logo
=
ENTERPRISE_DEFAULT_HEADER
}
},
async
setUserPasswordLoginAsync
(
account
:
string
,
pwd
:
string
,
tid
:
string
=
''
)
{
try
{
...
...
@@ -81,6 +94,12 @@ export const useUserStore = defineStore('user', {
if
(
!
Array
.
isArray
(
response
.
data
.
data
))
{
this
.
token
=
response
.
data
.
data
.
token
this
.
userInfo
=
response
.
data
.
data
.
userinfo
if
(
!
this
.
userInfo
.
photo
||
!
this
.
userInfo
.
photo
.
includes
(
'http://'
)
||
!
this
.
userInfo
.
photo
.
includes
(
'https://'
)){
this
.
userInfo
.
photo
=
USER_DEFAULT_HEADER
}
if
(
!
this
.
userInfo
.
logo
||
!
this
.
userInfo
.
logo
.
includes
(
'http://'
)
||
!
this
.
userInfo
.
logo
.
includes
(
'https://'
)){
this
.
userInfo
.
logo
=
ENTERPRISE_DEFAULT_HEADER
}
return
{
status
:
'SUCCESS'
}
as
UserLoginResult
}
else
{
return
{
status
:
'CHOSEN'
,
data
:
response
.
data
.
data
}
as
UserLoginResult
...
...
src/views/Auth/Login.vue
View file @
c4c63901
...
...
@@ -66,7 +66,7 @@
<div
style=
"font-size: 36px; "
class=
"text-dark"
>
已登录
</div>
<div
class=
"text-info text-small"
>
你的创作空间
</div>
<div
class=
"q-py-xl flex-center items-center column"
>
<el-avatar
:size=
"100"
shape=
"square"
class=
"bg-transparent"
:src=
"userInfo.photo
&& userInfo.photo.includes('http') ? userInfo.photo:USER_DEFAULT_HEADER
"
></el-avatar>
<el-avatar
:size=
"100"
shape=
"square"
class=
"bg-transparent"
:src=
"userInfo.photo"
></el-avatar>
<div
class=
"q-mt-md text-weight-bold"
style=
"font-size: 18px;"
>
{{ userInfo.nickname }}
</div>
<div
class=
"q-mt-md text-small text-info"
>
{{ userInfo.company }}
</div>
<div
class=
"q-mt-lg row items-center"
>
...
...
@@ -81,7 +81,6 @@
import
{
useUserStore
}
from
'@/store/user'
;
import
{
ElMessage
,
FormInstance
,
FormRules
}
from
'element-plus'
;
import
{
reactive
,
ref
}
from
'vue'
;
import
{
USER_DEFAULT_HEADER
}
from
'@/configs/customer'
interface
RuleForm
{
account
:
string
password
:
string
...
...
src/views/Index.vue
View file @
c4c63901
...
...
@@ -137,23 +137,32 @@
</div>
</
template
>
<div
class=
"q-pa-md rounded"
>
<
template
v-if=
"!userInfo.it"
>
<div
class=
"row items-center"
>
<div
class=
"row items-center"
v-if=
"!userInfo.it"
>
<div
class=
"text-info text-small col"
>
未加入任何企业
</div>
<el-button
type=
"primary"
@
click=
"createEnterpriseHandler"
link
icon=
"officeBuilding"
>
立即创建企业
</el-button>
</div>
<div
class=
"row"
v-if=
"userInfo.it"
>
<el-avatar
:size=
"50"
:src=
"userInfo.logo"
shape=
"square"
></el-avatar>
<div
class=
"col q-ml-md"
>
<div
class=
"text-weight-bld text-dark"
style=
"font-size: 18px;"
>
{{ userInfo.company }}
</div>
<div
class=
"text-small text-info q-mt-sm"
>
有效期至:{{ userInfo.expire }}
</div>
</div>
</div>
<el-divider
/>
<el-menu
mode=
"vertical"
>
<el-menu-item
index=
"1
"
>
<el-menu-item
index=
"1"
class=
"rounded"
v-if=
"!userInfo.it
"
>
<el-icon><Plus
/></el-icon>
<span>
加入企业
</span>
</el-menu-item>
<el-menu-item
index=
"2"
v-if=
"userInfo.it && userInfo.ia"
>
<el-menu-item
index=
"2"
class=
"rounded"
v-if=
"userInfo.it && userInfo.ia"
>
<el-icon><Setting
/></el-icon>
<span>
设置
</span>
<span>
管理团队/企业
</span>
</el-menu-item>
<el-menu-item
index=
"3"
class=
"rounded"
v-if=
"userInfo.it"
>
<IconLogout
size=
"18"
style=
"margin-right: 8px"
/>
<span>
退出团队/企业
</span>
</el-menu-item>
</el-menu>
</
template
>
</div>
</el-popover>
</div>
...
...
@@ -184,6 +193,7 @@ import OrderService from "@/services/OrderService";
import
{
ApiResult
}
from
"@/configs/axios"
;
const
{
userInfo
}
=
storeToRefs
(
useUserStore
());
console
.
log
(
userInfo
.
value
)
const
sellStore
=
useSellTemplateStore
()
const
orderVisible
=
ref
(
false
)
const
router
=
useRouter
()
...
...
src/views/TemplateCenter/Index.vue
View file @
c4c63901
...
...
@@ -100,7 +100,6 @@
import
{
ENT_USER_THEME
,
VIP_USER_THEME
}
from
"@/configs/customer"
;
import
{
useUserStore
,
useFontStore
}
from
"@/store"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
USER_DEFAULT_HEADER
}
from
'@/configs/customer'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
CustomerFonts
}
from
'@/store/font'
import
{
getFonts
}
from
'@/utils/psdParser/index'
...
...
src/views/TemplateCenter/colour.vue
View file @
c4c63901
...
...
@@ -85,7 +85,6 @@
import
{
ENT_USER_THEME
,
VIP_USER_THEME
}
from
"@/configs/customer"
;
import
{
useUserStore
,
useFontStore
}
from
"@/store"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
USER_DEFAULT_HEADER
}
from
'@/configs/customer'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
CustomerFonts
}
from
'@/store/font'
import
{
getFonts
}
from
'@/utils/psdParser/index'
...
...
src/views/TemplateCenter/nation.vue
View file @
c4c63901
...
...
@@ -57,7 +57,6 @@
import
{
ENT_USER_THEME
,
VIP_USER_THEME
}
from
"@/configs/customer"
;
import
{
useUserStore
,
useFontStore
}
from
"@/store"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
USER_DEFAULT_HEADER
}
from
'@/configs/customer'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
CustomerFonts
}
from
'@/store/font'
import
{
getFonts
}
from
'@/utils/psdParser/index'
...
...
src/views/UserCenter/Index.vue
View file @
c4c63901
<
template
>
<div
class=
"user-header rounded row items-center"
:style=
"
{ background: userTheme?.bg }">
<el-avatar
:size=
"64"
:src=
"userInfo.photo
&& userInfo.photo.includes('http') ? userInfo.photo:USER_DEFAULT_HEADER
"
shape=
"square"
:style=
"
{ BackgroundColor: userTheme?.color }" style="font-size: 36px;font-weight: bold;">
</el-avatar>
<el-avatar
:size=
"64"
:src=
"userInfo.photo"
shape=
"square"
:style=
"
{ BackgroundColor: userTheme?.color }" style="font-size: 36px;font-weight: bold;">
</el-avatar>
<div
class=
"q-ml-lg text-white col"
>
<div
class=
""
style=
"font-size: 20px;"
>
{{
userInfo
.
nickname
}}
</div>
<div
class=
"q-mt-sm text-info"
>
个人账号ID:
{{
userInfo
.
cardno
??
'8027970449819221090'
}}
</div>
...
...
@@ -112,7 +112,6 @@ import { ENT_USER_THEME, VIP_USER_THEME } from "@/configs/customer";
import
{
useUserStore
}
from
"@/store"
;
import
{
storeToRefs
}
from
"pinia"
;
import
{
ref
}
from
"vue"
;
import
{
USER_DEFAULT_HEADER
}
from
'@/configs/customer'
const
useUser
=
useUserStore
()
const
{
userInfo
}
=
storeToRefs
(
useUser
)
...
...
src/views/UserCenter/Setting.vue
View file @
c4c63901
...
...
@@ -2,7 +2,7 @@
<div
class=
"user-setting"
>
<div
class=
"row flex-center"
>
<el-upload
drag
action=
"https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
class=
"avatar-upload"
>
<el-avatar
:size=
"72"
:src=
"userInfo.photo
&& userInfo.photo.includes('http') ? userInfo.photo:USER_DEFAULT_HEADER
"
shape=
"square"
class=
"bg-transparent"
></el-avatar>
<el-avatar
:size=
"72"
:src=
"userInfo.photo"
shape=
"square"
class=
"bg-transparent"
></el-avatar>
<div
class=
"after-overlayer"
>
上传
</div>
</el-upload>
</div>
...
...
@@ -68,7 +68,6 @@ import { useUserStore } from "@/store";
import
{
storeToRefs
}
from
"pinia"
;
import
{
nextTick
}
from
"vue"
;
import
{
ref
}
from
"vue"
;
import
{
USER_DEFAULT_HEADER
}
from
'@/configs/customer'
const
useUser
=
useUserStore
()
const
{
userInfo
}
=
storeToRefs
(
useUser
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment