Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_page
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_page
Commits
3b4f4843
提交
3b4f4843
authored
7月 18, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:对接个人中心接口、修改退出逻辑
上级
93efece7
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
385 行增加
和
156 行删除
+385
-156
App.vue
src/App.vue
+13
-2
user.js
src/api/user.js
+28
-0
index.vue
src/components/NavBar/index.vue
+10
-3
main.js
src/main.js
+1
-0
permission.js
src/permission.js
+41
-0
user.js
src/store/modules/user.js
+2
-1
index.vue
src/views/login/index.vue
+1
-1
index.vue
src/views/personal/components/Card/index.vue
+3
-26
Collection.vue
src/views/personal/components/Collection.vue
+75
-48
Footprint.vue
src/views/personal/components/Footprint.vue
+114
-27
Info.vue
src/views/personal/components/Info.vue
+6
-2
Like.vue
src/views/personal/components/Like.vue
+87
-27
index.vue
src/views/personal/index.vue
+4
-19
没有找到文件。
src/App.vue
浏览文件 @
3b4f4843
<
template
>
<div
id=
"app"
>
<NavBar
/>
<router-view
:key=
"$route.fullPath"
/>
<router-view
:key=
"$route.fullPath"
v-if=
"isRouterAlive"
/>
<Footer
/>
</div>
</
template
>
...
...
@@ -10,8 +10,19 @@ import NavBar from "@/components/NavBar";
import
Footer
from
"@/components/Footer"
;
export
default
{
components
:
{
NavBar
,
Footer
},
data
()
{
return
{
isRouterAlive
:
true
,
};
},
methods
:
{
reload
()
{
this
.
isRouterAlive
=
false
;
this
.
$nextTick
(()
=>
(
this
.
isRouterAlive
=
true
));
},
},
};
</
script
>
<
style
lang=
"scss"
>
@import
url(
'@/assets/styles/index.scss'
)
;
@import
url(
"@/assets/styles/index.scss"
)
;
</
style
>
src/api/user.js
浏览文件 @
3b4f4843
...
...
@@ -50,6 +50,34 @@ export function toggleLike(data) {
})
}
// 查看点赞列表
export
function
getLikeList
(
data
)
{
return
request
({
url
:
'/bizCollection/listByPage'
,
method
:
'post'
,
data
})
}
// 查看收藏列表
export
function
getCollectionList
(
data
)
{
return
request
({
url
:
'/bizLove/listByPage'
,
method
:
'post'
,
data
})
}
// 查看浏览数据
export
function
getViewList
(
data
)
{
return
request
({
url
:
'/bizBrowseHistory/listByPage'
,
method
:
'post'
,
data
})
}
// /** *
// * 上传头像
...
...
src/components/NavBar/index.vue
浏览文件 @
3b4f4843
...
...
@@ -14,7 +14,9 @@
>
</div>
<div
class=
"operation"
>
<span
v-if=
"hasToken"
class=
"operation-item"
>
欢迎你,
{{
userInfo
.
username
}}
</span>
<span
v-if=
"hasToken && userInfo.username"
class=
"operation-item"
>
欢迎你,
{{
userInfo
.
username
}}
</span
>
<!--
<router-link
v-if=
"!hasToken"
to=
"/login"
class=
"operation-item"
>
登陆
</router-link
>
-->
...
...
@@ -96,12 +98,17 @@ export default {
};
},
methods
:
{
handleToLogin
(){
this
.
$router
.
push
(
'/login?redirect='
+
this
.
$route
.
fullPath
)
handleToLogin
()
{
this
.
$router
.
push
(
"/login?redirect="
+
this
.
$route
.
fullPath
);
},
async
handleLogOut
()
{
await
this
.
$store
.
dispatch
(
"user/logout"
);
this
.
logoutDialogVisible
=
false
;
// 如果当前的path为/personal,需跳转到首页
let
path
=
this
.
$route
.
fullPath
;
if
(
path
.
indexOf
(
"/personal"
)
!=
-
1
)
{
this
.
$router
.
push
(
"/"
);
}
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
},
handleClickTab
(
tab
)
{
...
...
src/main.js
浏览文件 @
3b4f4843
...
...
@@ -7,6 +7,7 @@ import ElementUI from 'element-ui';
import
'element-ui/lib/theme-chalk/index.css'
;
// import * as echarts from 'echarts'
import
'./icons'
// import '@/permission' // permission control
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ElementUI
);
...
...
src/permission.js
0 → 100644
浏览文件 @
3b4f4843
import
router
from
'./router'
import
store
from
'./store'
import
{
Message
}
from
'element-ui'
// import NProgress from 'nprogress' // progress bar
// import 'nprogress/nprogress.css' // progress bar style
import
{
getToken
}
from
'@/utils/auth'
// get token from cookie
// import getPageTitle from '@/utils/get-page-title'
// NProgress.configure({
// showSpinner: false
// }) // NProgress Configuration
// const whiteList = ['/login'] // no redirect whitelist
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
// debugger
console
.
log
(
'to'
,
to
);
console
.
log
(
'from'
,
from
);
const
hasToken
=
getToken
()
console
.
log
(
'hasToken'
,
hasToken
);
if
(
!
hasToken
)
{
if
(
to
.
path
===
'/personal'
)
{
next
({
path
:
'/'
})
}
else
{
next
()
}
}
else
{
next
()
}
})
// router.afterEach(() => {
// // finish progress bar
// NProgress.done()
// })
src/store/modules/user.js
浏览文件 @
3b4f4843
...
...
@@ -13,7 +13,6 @@ import {
removeUserInfo
}
from
'@/utils/auth'
const
getDefaultState
=
()
=>
{
return
{
token
:
getToken
(),
...
...
@@ -71,7 +70,9 @@ const actions = {
commit
(
'SET_USERINFO'
,
data
)
setToken
(
data
.
accessToken
)
setUserInfo
(
data
)
// window.location.reload()
resolve
()
// window.location.reload()
}).
catch
(
error
=>
{
reject
(
error
)
})
...
...
src/views/login/index.vue
浏览文件 @
3b4f4843
...
...
@@ -106,7 +106,7 @@ export default {
this
.
$store
.
dispatch
(
"user/login"
,
this
.
loginForm
)
.
then
(()
=>
{
debugger
//
debugger
this
.
$router
.
push
({
path
:
this
.
$route
.
query
.
redirect
||
"/"
});
this
.
loading
=
false
;
})
...
...
src/
components/CulturalRelic
Card/index.vue
→
src/
views/personal/components/
Card/index.vue
浏览文件 @
3b4f4843
<
template
>
<div
class=
"display-item"
>
<img
src=
"@/assets/imgs/display2.png"
width=
"100%"
:alt=
"title"
/>
<img
:src=
"url"
width=
"100%"
:alt=
"title"
height=
"200px"
/>
<div
class=
"display-desc"
>
<div
class=
"desc-title"
>
<h4>
{{
title
}}
</h4>
</div>
<div
class=
"desc-time"
>
<span>
{{
time
}}
</span>
</div>
<a
class=
"desc-content"
:alt=
"content"
>
{{
content
}}
</a>
</div>
</div>
</
template
>
...
...
@@ -19,30 +13,21 @@
export
default
{
name
:
"CulturalRelicCard"
,
props
:
{
img
:
{
url
:
{
type
:
String
,
default
:
""
,
},
title
:
{
type
:
String
,
default
:
""
,
},
time
:
{
type
:
String
,
default
:
""
,
},
content
:
{
type
:
String
,
default
:
""
,
},
},
};
</
script
>
<
style
lang=
'scss'
scoped
>
.display-item
{
width
:
330px
;
width
:
100%
;
margin-bottom
:
32px
;
border-radius
:
16px
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.1
);
...
...
@@ -63,12 +48,5 @@ export default {
display
:
block
;
}
}
.display-source
{
margin-top
:
8px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
0
16px
;
}
}
</
style
>
\ No newline at end of file
src/views/personal/components/Collection.vue
浏览文件 @
3b4f4843
<
template
>
<div
class=
"like"
>
<el-tabs
:tab-position=
"'top'"
>
<el-tab-pane
label=
"文物"
>
<div
class=
"display-group"
>
<div
v-for=
"(item, index) in relateRelics"
:key=
"index"
>
<CulturalRelicCard
:title=
"item.title"
:content=
"item.content"
:time=
"item.time"
/>
</div>
</div>
</el-tab-pane>
<el-tab-pane
label=
"展览"
>
<el-row
:gutter=
"16"
>
<el-col
:span=
"6"
v-for=
"(item, index) in exhibitions"
:key=
"index"
@
click
.
native=
"handleClick"
<el-tabs
:tab-position=
"'top'"
v-model=
"activeName"
>
<el-tab-pane
:key=
"tab.name"
v-for=
"tab in Tabs"
:label=
"tab.title"
:name=
"tab.name"
>
<DisplayCard
:title=
"item.title"
:content=
"item.content"
/>
</el-col>
</el-row
></el-tab-pane>
<el-row
:gutter=
"20"
>
<el-col
:span=
"6"
v-for=
"(item, index) in list.records"
:key=
"index"
>
<Card
:title=
"item.title"
:url=
"item.faceImageUrl"
/></el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"
current
"
:page-sizes=
"[1
2, 28, 4
0]"
:page-size=
"
size
"
:current-page=
"
Number(list.current)
"
:page-sizes=
"[1
0, 20, 5
0]"
:page-size=
"
Number(list.size)
"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"
total
"
:total=
"
Number(list.total)
"
>
</el-pagination>
</div>
...
...
@@ -40,13 +30,14 @@
</
template
>
<
script
>
import
DisplayCard
from
"@/components/DisplayCard"
;
import
CulturalRelicCard
from
"@/components/CulturalRelicCard"
;
import
Card
from
"./Card"
;
// import CulturalRelicCard from "@/components/CulturalRelicCard";
import
{
getCollectionList
}
from
"@/api/user"
;
export
default
{
name
:
"
Collection
"
,
name
:
"
Like
"
,
components
:
{
Display
Card
,
CulturalRelicCard
,
Card
,
//
CulturalRelicCard,
},
props
:
{
relateRelics
:
{
...
...
@@ -57,29 +48,65 @@ export default {
type
:
Array
,
default
:
()
=>
[],
},
size
:
{
type
:
Number
,
default
:
10
,
},
current
:
{
type
:
Number
,
default
:
1
,
// watch: {
// activeName(type) {
// console.log('type',type);
// this.loadList(type);
// },
// },
data
()
{
return
{
Tabs
:
[
{
name
:
"biz_cultural_relic"
,
title
:
"文物"
,
},
total
:
{
type
:
Number
,
default
:
100
,
{
name
:
"biz_exhibition"
,
title
:
"展览"
,
},
],
activeName
:
"biz_cultural_relic"
,
list
:
{
records
:
{},
size
:
10
,
current
:
1
,
total
:
0
,
},
methods
:{
handleSizeChange
(
value
)
{
console
.
log
(
"handleSizeChange"
,
value
);
this
.
$emit
(
'handleSizeChange'
,
value
)
};
},
watch
:
{
activeName
(
name
)
{
// 重置current
this
.
list
.
current
=
1
;
this
.
loadList
(
name
);
},
},
mounted
()
{
let
type
=
"biz_cultural_relic"
;
this
.
loadList
(
type
);
},
methods
:
{
async
loadList
(
type
)
{
// biz_cultural_relic 文物 biz_exhibition 展览
const
params
=
{
sourceType
:
type
,
//默认先加载文物
limit
:
this
.
list
.
size
,
page
:
this
.
list
.
current
,
};
let
res
=
await
getCollectionList
(
params
);
this
.
list
=
res
.
data
;
},
handleSizeChange
(
size
)
{
this
.
list
.
size
=
size
;
this
.
loadList
(
this
.
activeName
);
},
handleCurrentChange
(
current
)
{
this
.
list
.
current
=
current
;
this
.
loadList
(
this
.
activeName
);
},
handleCurrentChange
(
value
)
{
console
.
log
(
"handleCurrentChange"
,
value
);
this
.
$emit
(
'handleCurrentChange'
,
value
)
},
}
};
</
script
>
...
...
src/views/personal/components/Footprint.vue
浏览文件 @
3b4f4843
<
template
>
<div
class=
"like"
>
<el-tabs
:tab-position=
"'top'"
>
<el-tab-pane
label=
"文物"
>
<div
class=
"display-group"
>
<div
v-for=
"(item, index) in relateRelics"
:key=
"index"
>
<CulturalRelicCard
:title=
"item.title"
:content=
"item.content"
:time=
"item.time"
/>
</div>
</div>
</el-tab-pane>
<el-tab-pane
label=
"展览"
>
<el-row
:gutter=
"16"
>
<el-col
:span=
"6"
v-for=
"(item, index) in exhibitions"
:key=
"index"
@
click
.
native=
"handleClick"
<el-tabs
:tab-position=
"'top'"
v-model=
"activeName"
>
<el-tab-pane
:key=
"tab.name"
v-for=
"tab in Tabs"
:label=
"tab.title"
:name=
"tab.name"
>
<DisplayCard
:title=
"item.title"
:content=
"item.content"
/>
</el-col>
</el-row
></el-tab-pane>
<el-row
:gutter=
"20"
>
<el-col
:span=
"6"
v-for=
"(item, index) in list.records"
:key=
"index"
>
<Card
:title=
"item.title"
:url=
"item.faceImageUrl"
/></el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"Number(list.current)"
:page-sizes=
"[10, 20, 50]"
:page-size=
"Number(list.size)"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"Number(list.total)"
>
</el-pagination>
</div>
</div>
</
template
>
<
script
>
import
DisplayCard
from
"@/components/DisplayCard"
;
import
CulturalRelicCard
from
"@/components/CulturalRelicCard"
;
import
Card
from
"./Card"
;
// import CulturalRelicCard from "@/components/CulturalRelicCard";
import
{
getViewList
}
from
"@/api/user"
;
export
default
{
name
:
"
Footprint
"
,
name
:
"
Like
"
,
components
:
{
Display
Card
,
CulturalRelicCard
,
Card
,
//
CulturalRelicCard,
},
props
:
{
relateRelics
:
{
...
...
@@ -46,6 +49,58 @@ export default {
default
:
()
=>
[],
},
},
data
()
{
return
{
Tabs
:
[
{
name
:
"biz_cultural_relic"
,
title
:
"文物"
,
},
{
name
:
"biz_exhibition"
,
title
:
"展览"
,
},
],
activeName
:
"biz_cultural_relic"
,
list
:
{
records
:
{},
size
:
10
,
current
:
1
,
total
:
0
,
},
};
},
watch
:
{
activeName
(
name
)
{
// 重置current
this
.
list
.
current
=
1
;
this
.
loadList
(
name
);
},
},
mounted
()
{
let
type
=
"biz_cultural_relic"
;
this
.
loadList
(
type
);
},
methods
:
{
async
loadList
(
type
)
{
// biz_cultural_relic 文物 biz_exhibition 展览
const
params
=
{
sourceType
:
type
,
//默认先加载文物
limit
:
this
.
list
.
size
,
page
:
this
.
list
.
current
,
};
let
res
=
await
getViewList
(
params
);
this
.
list
=
res
.
data
;
},
handleSizeChange
(
size
)
{
this
.
list
.
size
=
size
;
this
.
loadList
(
this
.
activeName
);
},
handleCurrentChange
(
current
)
{
this
.
list
.
current
=
current
;
this
.
loadList
(
this
.
activeName
);
},
},
};
</
script
>
...
...
@@ -56,6 +111,37 @@ export default {
margin-top
:
24px
;
display
:
flex
;
flex-flow
:
row
wrap
;
.display-item
{
width
:
330px
;
margin-bottom
:
32px
;
border-radius
:
16px
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.1
);
padding
:
0
0
32px
0
;
background-color
:
#fff
;
margin-right
:
10px
;
cursor
:
pointer
;
img
{
border-radius
:
16px
16px
0
0
;
}
.display-desc
{
padding
:
0
16px
;
.desc-content
{
text-indent
:
16px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
block
;
}
}
.display-source
{
margin-top
:
8px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
0
16px
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/personal/components/Info.vue
浏览文件 @
3b4f4843
<
template
>
<div
class=
"personal-info"
>
<el-form
ref=
"form"
label-width=
"80px"
>
<el-form-item
label=
"账号"
>
{{
userInfo
.
username
}}
</el-form-item>
<el-form-item
label=
"手机号"
>
{{
userInfo
.
phone
}}
</el-form-item>
<el-form-item
label=
"账号"
v-if=
"userInfo && userInfo.name"
>
{{
userInfo
.
username
}}
</el-form-item>
<el-form-item
label=
"手机号"
v-if=
"userInfo && userInfo.phone"
>
{{
userInfo
.
phone
}}
</el-form-item
>
<!--
<el-form-item>
<el-button
@
click=
"editInfo"
>
修改个人信息
</el-button>
<el-button
@
click=
"editPassword"
>
修改密码
</el-button>
...
...
src/views/personal/components/Like.vue
浏览文件 @
3b4f4843
<
template
>
<div
class=
"like"
>
<el-tabs
:tab-position=
"'top'"
>
<el-tab-pane
label=
"文物"
>
<div
class=
"display-group"
>
<div
v-for=
"(item, index) in relateRelics"
:key=
"index"
>
<CulturalRelicCard
:title=
"item.title"
:content=
"item.content"
:time=
"item.time"
/>
</div>
</div>
</el-tab-pane>
<el-tab-pane
label=
"展览"
>
<el-row
:gutter=
"16"
>
<el-col
:span=
"6"
v-for=
"(item, index) in exhibitions"
:key=
"index"
@
click
.
native=
"handleClick"
<el-tabs
:tab-position=
"'top'"
v-model=
"activeName"
>
<el-tab-pane
:key=
"tab.name"
v-for=
"tab in Tabs"
:label=
"tab.title"
:name=
"tab.name"
>
<DisplayCard
:title=
"item.title"
:content=
"item.content"
/>
</el-col>
</el-row
></el-tab-pane>
<el-row
:gutter=
"20"
>
<el-col
:span=
"6"
v-for=
"(item, index) in list.records"
:key=
"index"
>
<Card
:title=
"item.title"
:url=
"item.faceImageUrl"
/></el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<div
class=
"pagination"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"Number(list.current)"
:page-sizes=
"[10, 20, 50]"
:page-size=
"Number(list.size)"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"Number(list.total)"
>
</el-pagination>
</div>
</div>
</
template
>
<
script
>
import
DisplayCard
from
"@/components/Display
Card"
;
import
CulturalRelicCard
from
"@/components/CulturalRelicCard"
;
import
Card
from
"./
Card"
;
//
import CulturalRelicCard from "@/components/CulturalRelicCard";
import
{
getLikeList
}
from
"@/api/user"
;
export
default
{
name
:
"Like"
,
components
:
{
Display
Card
,
CulturalRelicCard
,
Card
,
//
CulturalRelicCard,
},
props
:
{
relateRelics
:
{
...
...
@@ -47,6 +49,64 @@ export default {
default
:
()
=>
[],
},
},
// watch: {
// activeName(type) {
// console.log('type',type);
// this.loadList(type);
// },
// },
data
()
{
return
{
Tabs
:
[
{
name
:
"biz_cultural_relic"
,
title
:
"文物"
,
},
{
name
:
"biz_exhibition"
,
title
:
"展览"
,
},
],
activeName
:
"biz_cultural_relic"
,
list
:
{
records
:
{},
size
:
10
,
current
:
1
,
total
:
0
,
},
};
},
watch
:
{
activeName
(
name
)
{
// 重置current
this
.
list
.
current
=
1
;
this
.
loadList
(
name
);
},
},
mounted
()
{
let
type
=
"biz_cultural_relic"
;
this
.
loadList
(
type
);
},
methods
:
{
async
loadList
(
type
)
{
// biz_cultural_relic 文物 biz_exhibition 展览
const
params
=
{
sourceType
:
type
,
//默认先加载文物
limit
:
this
.
list
.
size
,
page
:
this
.
list
.
current
,
};
let
res
=
await
getLikeList
(
params
);
this
.
list
=
res
.
data
;
},
handleSizeChange
(
size
)
{
this
.
list
.
size
=
size
;
this
.
loadList
(
this
.
activeName
);
},
handleCurrentChange
(
current
)
{
this
.
list
.
current
=
current
;
this
.
loadList
(
this
.
activeName
);
},
},
};
</
script
>
...
...
src/views/personal/index.vue
浏览文件 @
3b4f4843
...
...
@@ -3,28 +3,13 @@
<!--
<NavBar
/>
-->
<el-tabs
:tab-position=
"'left'"
type=
"card"
>
<el-tab-pane
label=
"我的点赞"
>
<Like
:exhibitions=
"exhibitions"
:relateRelics=
"relateRelics"
@
handleSizeChange=
"handleSizeChange"
@
handleCurrentChange=
"handleCurrentChange"
/>
<Like
/>
</el-tab-pane>
<el-tab-pane
label=
"我的收藏"
>
<Collection
:exhibitions=
"exhibitions"
:relateRelics=
"relateRelics"
@
handleSizeChange=
"handleSizeChange"
@
handleCurrentChange=
"handleCurrentChange"
/>
<Collection
/>
</el-tab-pane>
<el-tab-pane
label=
"浏览记录"
>
<Footprint
:exhibitions=
"exhibitions"
:relateRelics=
"relateRelics"
@
handleSizeChange=
"handleSizeChange"
@
handleCurrentChange=
"handleCurrentChange"
/>
<Footprint
/>
</el-tab-pane>
<el-tab-pane
label=
"个人信息"
><Info
/></el-tab-pane>
</el-tabs>
...
...
@@ -36,7 +21,7 @@
import
{
relateRelics
,
exhibitions
}
from
"@/mock/mock"
;
import
Like
from
"./components/Like.vue"
;
import
Collection
from
"./components/Collection.vue"
;
import
Footprint
from
"./components/
Collection
.vue"
;
import
Footprint
from
"./components/
Footprint
.vue"
;
import
Info
from
"./components/Info.vue"
;
import
NavBar
from
"@/components/NavBar"
;
import
Footer
from
"@/components/Footer"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论