Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_page
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_page
Commits
5842f90d
提交
5842f90d
authored
11月 03, 2023
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复文物图片加载失败问题;修复点赞后无法更新的问题
上级
6c241513
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
128 行增加
和
66 行删除
+128
-66
index.vue
src/components/ReaderOperations/index.vue
+53
-39
index.vue
src/components/Viewer3d/index.vue
+1
-1
index.js
src/router/index.js
+1
-1
app.js
src/store/modules/app.js
+1
-1
user.js
src/store/modules/user.js
+1
-1
request.js
src/utils/request.js
+22
-14
detail.vue
src/views/3d/detail.vue
+9
-2
index.vue
src/views/3d/index.vue
+10
-2
baseInfo.vue
src/views/culturalRelic/components/baseInfo.vue
+10
-2
imgs.vue
src/views/culturalRelic/components/imgs.vue
+20
-3
没有找到文件。
src/components/ReaderOperations/index.vue
浏览文件 @
5842f90d
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
mapGetters
}
from
"vuex"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
{
debounce
,
formatNum
}
from
"@/utils/index"
;
import
{
debounce
,
formatNum
}
from
"@/utils/index"
;
export
default
{
export
default
{
name
:
"ReaderOperations"
,
name
:
"ReaderOperations"
,
...
@@ -131,67 +131,81 @@ export default {
...
@@ -131,67 +131,81 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapGetters
([
"token"
,
"showLoginDialog"
]),
...
mapGetters
([
"token"
,
"showLoginDialog"
]),
isCulturalRelic
()
{
if
(
!
this
.
sourceType
)
{
return
;
}
return
this
.
sourceType
==
"biz_cultural_relic"
;
},
isExhibiton
()
{
if
(
!
this
.
sourceType
)
{
return
;
}
return
this
.
sourceType
==
"biz_exhibition"
;
},
},
},
methods
:
{
methods
:
{
handleCollect
:
debounce
(
function
()
{
...
mapActions
(
"user"
,
[
"toggleCollect"
,
"toggleLike"
]),
handleCollect
:
debounce
(
async
function
()
{
if
(
this
.
token
)
{
if
(
this
.
token
)
{
let
sourceId
;
let
sourceId
;
let
title
;
let
title
;
if
(
this
.
sourceType
==
"biz_cultural_relic"
)
{
if
(
this
.
isCulturalRelic
)
{
sourceId
=
this
.
info
.
crId
;
const
{
crId
,
name
}
=
this
.
info
;
title
=
this
.
info
.
name
;
sourceId
=
crId
;
}
else
if
(
this
.
sourceType
==
"biz_exhibition"
)
{
title
=
name
;
sourceId
=
this
.
info
.
exhibitionId
;
}
else
if
(
this
.
isExhibiton
)
{
title
=
this
.
info
.
title
;
const
{
exhibitionId
,
title
}
=
this
.
info
;
sourceId
=
exhibitionId
;
title
=
title
;
}
}
const
params
=
{
const
params
=
{
sourceType
:
this
.
sourceType
,
sourceType
:
this
.
sourceType
,
sourceId
,
sourceId
,
title
,
title
,
};
};
this
.
$store
.
dispatch
(
"user/toggleCollect"
,
params
).
then
(()
=>
{
if
(
!
this
.
info
.
collectCountStatus
)
{
try
{
// 点赞
await
this
.
toggleCollect
(
params
);
this
.
$message
.
success
(
"已收藏!"
);
const
msg
=
this
.
info
.
collectCountStatus
}
else
{
?
"已取消收藏!"
this
.
$message
.
success
(
"已取消收藏!"
);
:
"已收藏!"
;
}
this
.
$message
.
success
(
msg
);
setTimeout
(()
=>
{
const
id
=
this
.
info
.
crId
||
this
.
info
.
exhibitionId
;
this
.
$emit
(
"reload"
,
this
.
info
.
crId
||
this
.
info
.
exhibitionId
);
this
.
$emit
(
"reload"
,
id
);
},
300
);
}
catch
(
error
)
{
});
this
.
$message
.
error
(
"操作失败:"
+
error
);
}
else
{
}
this
.
loginDialogVisible
=
true
;
}
}
}),
}),
// 点赞
// 点赞
handleLike
:
debounce
(
function
()
{
handleLike
:
debounce
(
async
function
()
{
if
(
this
.
token
)
{
if
(
this
.
token
)
{
let
sourceId
;
let
sourceId
;
let
title
;
let
title
;
if
(
this
.
sourceType
==
"biz_cultural_relic"
)
{
if
(
this
.
isCulturalRelic
)
{
sourceId
=
this
.
info
.
crId
;
const
{
crId
,
name
}
=
this
.
info
;
title
=
this
.
info
.
name
;
sourceId
=
crId
;
}
else
if
(
this
.
sourceType
==
"biz_exhibition"
)
{
title
=
name
;
sourceId
=
this
.
info
.
exhibitionId
;
}
else
if
(
this
.
isExhibiton
)
{
title
=
this
.
info
.
title
;
const
{
exhibitionId
,
title
}
=
this
.
info
;
sourceId
=
exhibitionId
;
title
=
title
;
}
}
const
params
=
{
const
params
=
{
sourceType
:
this
.
sourceType
,
sourceType
:
this
.
sourceType
,
sourceId
,
sourceId
,
title
,
title
,
};
};
this
.
$store
.
dispatch
(
"user/toggleLike"
,
params
).
then
(()
=>
{
try
{
if
(
!
this
.
info
.
loveCountStatus
)
{
await
this
.
toggleLike
(
params
);
// 点赞
const
msg
=
this
.
info
.
loveCountStatus
?
"已取消点赞!"
:
"已点赞!"
;
this
.
$message
.
success
(
"已点赞!"
);
this
.
$message
.
success
(
msg
);
}
else
{
const
id
=
this
.
info
.
crId
||
this
.
info
.
exhibitionId
;
this
.
$message
.
success
(
"已取消点赞!"
);
this
.
$emit
(
"reload"
,
id
);
}
}
catch
(
error
)
{
setTimeout
(()
=>
{
this
.
$message
.
error
(
"操作失败:"
+
error
);
this
.
$emit
(
"reload"
,
this
.
info
.
crId
||
this
.
info
.
exhibitionId
);
}
},
300
);
});
}
else
{
}
else
{
this
.
loginDialogVisible
=
true
;
this
.
loginDialogVisible
=
true
;
}
}
...
...
src/components/Viewer3d/index.vue
浏览文件 @
5842f90d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<!-- online_3d_viewer -->
<!-- online_3d_viewer -->
<div
<div
class=
"online_3d_viewer"
class=
"online_3d_viewer"
model=
"/static/3d/yshl.FBX
"
:model=
"url
"
:backgroundcolor=
"backgroundcolor"
:backgroundcolor=
"backgroundcolor"
></div>
></div>
</
template
>
</
template
>
...
...
src/router/index.js
浏览文件 @
5842f90d
...
@@ -188,7 +188,7 @@ const routes = [
...
@@ -188,7 +188,7 @@ const routes = [
import
(
"@/views/3d/index.vue"
),
import
(
"@/views/3d/index.vue"
),
},
},
{
{
path
:
"/3d
/:id
"
,
path
:
"/3d
Detail
"
,
name
:
"3dDetail"
,
name
:
"3dDetail"
,
component
:
()
=>
component
:
()
=>
import
(
"@/views/3d/detail.vue"
),
import
(
"@/views/3d/detail.vue"
),
...
...
src/store/modules/app.js
浏览文件 @
5842f90d
...
@@ -3,7 +3,7 @@ const getDefaultState = () => {
...
@@ -3,7 +3,7 @@ const getDefaultState = () => {
curPath
:
null
,
curPath
:
null
,
navBarFixed
:
false
,
navBarFixed
:
false
,
showLoginDialog
:
null
,
showLoginDialog
:
null
,
navbarHeight
:
null
,
navbarHeight
:
null
,
navbarStyle
:
'1'
,
//1-默认蓝色;2-中国风;3-红色
navbarStyle
:
'1'
,
//1-默认蓝色;2-中国风;3-红色
}
}
}
}
...
...
src/store/modules/user.js
浏览文件 @
5842f90d
...
@@ -61,7 +61,7 @@ const actions = {
...
@@ -61,7 +61,7 @@ const actions = {
setUserInfo
(
data
)
setUserInfo
(
data
)
resolve
(
response
)
resolve
(
response
)
}
}
// else{
// else{
// console.log('222',response);
// console.log('222',response);
// resolve(response)
// resolve(response)
...
...
src/utils/request.js
浏览文件 @
5842f90d
import
axios
from
'axios'
import
axios
from
'axios'
import
{
import
{
MessageBox
,
Message
,
Loading
Loading
}
from
'element-ui'
}
from
'element-ui'
import
store
from
'@/store'
import
messageup
from
'./resetMessage'
import
messageup
from
'./resetMessage'
import
{
import
{
getToken
getToken
,
removeToken
,
removeUserInfo
}
from
'@/utils/auth'
}
from
'@/utils/auth'
console
.
log
(
'process.env'
,
process
.
env
);
import
store
from
'@/store'
// create an axios instance
const
service
=
axios
.
create
({
const
service
=
axios
.
create
({
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
timeout
:
1000
*
10
,
timeout
:
1000
*
10
,
...
@@ -42,9 +40,10 @@ service.interceptors.request.use(
...
@@ -42,9 +40,10 @@ service.interceptors.request.use(
}
}
)
)
// response interceptor
// response interceptor
service
.
interceptors
.
response
.
use
(
service
.
interceptors
.
response
.
use
(
response
=>
{
async
response
=>
{
num
--
num
--
if
(
num
===
0
)
{
if
(
num
===
0
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -52,30 +51,39 @@ service.interceptors.response.use(
...
@@ -52,30 +51,39 @@ service.interceptors.response.use(
},
500
);
},
500
);
}
}
const
res
=
response
.
data
const
res
=
response
.
data
if
(
response
.
config
.
url
===
'/sys/getVerify'
)
{
// 验证码接口
const
isVerify
=
response
.
config
.
url
===
'/sys/getVerify'
// 组织机构树接口
const
isSysRegionTree
=
response
.
config
.
url
===
'/sysRegion/tree'
// 先处理一些不需要经过拦截器的或者单独处理的
if
(
isVerify
)
{
return
res
return
res
}
}
if
(
isSysRegionTree
)
{
if
(
response
.
config
.
url
===
'/sysRegion/tree'
)
{
let
arr
=
res
.
data
let
arr
=
res
.
data
if
(
arr
&&
arr
.
length
>
0
)
{
if
(
arr
&&
arr
.
length
>
0
)
{
if
(
arr
[
0
].
code
===
'520000000000'
&&
arr
.
length
===
1
)
{
if
(
arr
[
0
].
code
===
'520000000000'
&&
arr
.
length
===
1
)
{
arr
=
arr
[
0
].
children
arr
=
arr
[
0
].
children
}
}
}
}
res
.
data
=
arr
res
.
data
=
arr
return
res
return
res
}
}
// debugger
// if the custom code is not 20000, it is judged as an error.
if
(
res
.
code
!==
0
)
{
if
(
res
.
code
!==
0
)
{
messageup
({
messageup
({
type
:
'error'
,
type
:
'error'
,
showClose
:
true
,
showClose
:
true
,
message
:
res
.
msg
||
'Error'
message
:
res
.
msg
||
'Error'
})
})
// 401001l令牌过期,此时调用logout依旧显示令牌过期,因此直接Remove用户信息
const
isExpired
=
res
.
code
===
401001
if
(
isExpired
)
{
removeToken
()
removeUserInfo
()
commit
(
'RESET_STATE'
)
location
.
reload
()
store
.
commit
(
'app/OPEN_LOGIN_DIALOG'
,
true
)
}
return
Promise
.
reject
(
res
.
msg
||
'Error'
)
return
Promise
.
reject
(
res
.
msg
||
'Error'
)
}
else
{
}
else
{
return
res
return
res
...
...
src/views/3d/detail.vue
浏览文件 @
5842f90d
<
template
>
<
template
>
<div
class=
"container-3d"
>
<div
class=
"container-3d"
>
<Viewer3d
backgroundcolor=
"linear(0, 0, 0,40%)"
/>
<Viewer3d
backgroundcolor=
"linear(0, 0, 0,40%)"
:url=
"file3dUrl"
v-if=
"file3dUrl"
/>
<div
class=
"left-text"
>
<div
class=
"left-text"
>
<div>
多彩贵州
</div>
<div>
多彩贵州
</div>
<div>
博物
<br
/>
盛筵
</div>
<div>
博物
<br
/>
盛筵
</div>
...
@@ -93,7 +97,10 @@ export default {
...
@@ -93,7 +97,10 @@ export default {
};
};
},
},
mounted
()
{
mounted
()
{
console
.
log
(
this
.
$router
);
const
{
file3dUrl
}
=
this
.
$route
.
query
;
if
(
file3dUrl
)
{
this
.
file3dUrl
=
file3dUrl
;
}
},
},
methods
:
{
methods
:
{
handleChangeButton
(
item
)
{
handleChangeButton
(
item
)
{
...
...
src/views/3d/index.vue
浏览文件 @
5842f90d
...
@@ -122,8 +122,16 @@ export default {
...
@@ -122,8 +122,16 @@ export default {
},
},
methods
:
{
methods
:
{
handleOpen3d
(
item
)
{
handleOpen3d
(
item
)
{
const
newPage
=
this
.
$router
.
resolve
({
path
:
"/3d/"
+
item
});
const
path
=
"/3dDetail"
;
window
.
open
(
newPage
.
href
,
"_blank"
);
const
{
file3dUrl
}
=
item
;
if
(
file3dUrl
)
{
const
query
=
{
file3dUrl
:
encodeURI
(
file3dUrl
),
};
this
.
$bizCommon
.
openNewPage
(
path
,
query
);
}
else
{
this
.
$message
.
error
(
"3d文件为空或无效!"
);
}
},
},
},
},
};
};
...
...
src/views/culturalRelic/components/baseInfo.vue
浏览文件 @
5842f90d
...
@@ -71,12 +71,17 @@ export default {
...
@@ -71,12 +71,17 @@ export default {
getPropValue
(
prop
)
{
getPropValue
(
prop
)
{
return
this
.
detail
[
prop
]
||
"暂无"
;
return
this
.
detail
[
prop
]
||
"暂无"
;
},
},
loadDetail
()
{
loadDetail
(
id
)
{
this
.
$emit
(
"loadDetail"
);
this
.
$emit
(
"loadDetail"
,
id
);
},
},
handleTo3D
()
{
handleTo3D
()
{
const
{
file3dUrl
,
url3d
}
=
this
.
detail
;
const
{
file3dUrl
,
url3d
}
=
this
.
detail
;
if
(
file3dUrl
)
{
if
(
file3dUrl
)
{
const
path
=
"/3dDetail"
;
const
query
=
{
file3dUrl
:
encodeURI
(
file3dUrl
),
};
this
.
$bizCommon
.
openNewPage
(
path
,
query
);
return
;
return
;
}
}
if
(
url3d
)
{
if
(
url3d
)
{
...
@@ -106,6 +111,9 @@ export default {
...
@@ -106,6 +111,9 @@ export default {
margin-right
:
8px
;
margin-right
:
8px
;
}
}
}
}
.view-3d
{
cursor
:
pointer
;
}
.basic-info
{
.basic-info
{
color
:
#333
;
color
:
#333
;
...
...
src/views/culturalRelic/components/imgs.vue
浏览文件 @
5842f90d
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
<div
class=
"imgs"
>
<div
class=
"imgs"
>
<div
class=
"common-title"
>
文物图片
</div>
<div
class=
"common-title"
>
文物图片
</div>
<swiper
:options=
"swiperOption"
ref=
"imgSwiper"
>
<swiper
:options=
"swiperOption"
ref=
"imgSwiper"
>
<swiper-slide
v-for=
"(item, i) in
detail.
imagesVo"
:key=
"i"
>
<swiper-slide
v-for=
"(item, i) in imagesVo"
:key=
"i"
>
<div
<div
title=
"点击查看大图"
title=
"点击查看大图"
class=
"img-container"
class=
"img-container"
@
click
.
stop=
"handelPreviewImages(
detail.
imagesVo, i)"
@
click
.
stop=
"handelPreviewImages(imagesVo, i)"
>
>
<img
:src=
"$getFullUrl(item.middleUrl || item.url)"
alt=
""
/>
<img
:src=
"$getFullUrl(item.middleUrl || item.url)"
alt=
""
/>
<div
class=
"search"
title=
"搜索类似图片"
>
<div
class=
"search"
title=
"搜索类似图片"
>
...
@@ -44,12 +44,29 @@ export default {
...
@@ -44,12 +44,29 @@ export default {
default
:
()
=>
({}),
default
:
()
=>
({}),
},
},
},
},
computed
:
{
imagesVo
()
{
if
(
!
this
.
detail
.
imagesVo
)
{
return
;
}
if
(
this
.
detail
.
imagesVo
.
length
>
0
)
{
return
this
.
detail
.
imagesVo
;
}
else
{
return
[
{
pressUrl
:
this
.
detail
.
faceImagePressUrl
,
url
:
this
.
detail
.
faceImageUrl
,
middleUrl
:
this
.
detail
.
faceImageMiddleUrl
,
},
];
}
},
},
data
()
{
data
()
{
return
{
return
{
swiperOption
:
imgSwiperOption
,
swiperOption
:
imgSwiperOption
,
};
};
},
},
mounted
()
{},
methods
:
{
methods
:
{
handelPreviewImages
(
items
,
index
)
{
handelPreviewImages
(
items
,
index
)
{
this
.
imgList
=
items
.
map
((
item
)
=>
this
.
$getFullUrl
(
item
.
url
));
this
.
imgList
=
items
.
map
((
item
)
=>
this
.
$getFullUrl
(
item
.
url
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论