Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
safe-campus-bbs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
万成波
safe-campus-bbs
Commits
27c6e336
Commit
27c6e336
authored
Oct 09, 2025
by
yuwenwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改移动端起始页面,图片预览问题
parent
d4ea2053
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
100 additions
and
88 deletions
+100
-88
safe-campus-bbs-uniapp/components/Comment-Item.vue
safe-campus-bbs-uniapp/components/Comment-Item.vue
+26
-24
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
+25
-14
safe-campus-bbs-uniapp/pages.json
safe-campus-bbs-uniapp/pages.json
+26
-32
safe-campus-bbs-uniapp/pages/index/index.vue
safe-campus-bbs-uniapp/pages/index/index.vue
+1
-0
safe-campus-bbs-uniapp/pages/login/login.vue
safe-campus-bbs-uniapp/pages/login/login.vue
+0
-2
safe-campus-bbs-uniapp/static/styles/index.scss
safe-campus-bbs-uniapp/static/styles/index.scss
+14
-13
safe-campus-bbs-uniapp/store/modules/user.js
safe-campus-bbs-uniapp/store/modules/user.js
+8
-3
No files found.
safe-campus-bbs-uniapp/components/Comment-Item.vue
View file @
27c6e336
...
...
@@ -12,25 +12,28 @@
<view
class=
"comment-display-box"
v-else
>
<view
class=
"comment-item"
v-for=
"(item,index) in commentList"
>
<view
class=
"user-info"
>
<view
class=
"username"
>
{{
item
.
nickName
}}
:
</view>
<view
style=
"display: flex;align-items: center;"
>
<view
class=
"username"
>
{{
item
.
nickName
}}
</view>
<view
class=
"datetime"
>
{{
item
.
createTime
}}
</view>
</view>
<view
class=
"content"
>
<view
class=
"text"
v-if=
"!item.replyNickName"
@
click.stop=
"handleReplayComment(item)"
>
{{
item
.
content
}}
</view>
<view
class=
"text"
v-else
@
click.stop=
"handleReplayComment(item)"
>
回复
<span
style=
"color: #0058B6;"
>
{{
item
.
replyNickName
}}
:
</span>
{{
item
.
content
}}
</view>
<view
class=
"operation-text"
>
<view
class=
"add-text mr10"
v-if=
"form.isSelf==1&&activeIndex==1 &&item.isFeatured==0 &&form.isEnableFeaturedComment==1"
@
click=
"handleFeatured(item)"
>
加入精选
</view>
<view
class=
"mr10"
v-if=
"form.isSelf==1&&activeIndex==1 &&item.isFeatured==1&&form.isEnableFeaturedComment==1"
@
click=
"handleFeatured(item)"
>
取消精选
</view>
<view
v-if=
"activeIndex==0&&item.isFeatured==1"
style=
"color: #F2AC39;margin-right: 10rpx;"
>
精选
</view>
<view
v-if=
"item.isSelf==1
"
@
click.stop=
"handleDelete(item)"
>
删除
</view>
<view
style=
"color: #bbb;"
v-if=
"item.isSelf==1 || userInfo.bbsAdmin
"
@
click.stop=
"handleDelete(item)"
>
删除
</view>
</view>
</view>
<view
class=
"content"
>
<view
class=
"text"
v-if=
"!item.replyNickName"
@
click.stop=
"handleReplayComment(item)"
>
{{
item
.
content
}}
</view>
<view
class=
"text"
v-else
@
click.stop=
"handleReplayComment(item)"
>
回复
<span
style=
"color: #0058B6;"
>
{{
item
.
replyNickName
}}
</span>
{{
item
.
content
}}
</view>
</view>
</view>
<view
class=
"show-more-box"
v-if=
"commentList.length
<
total
"
@
click=
"loadMore"
>
加载更多
...
...
@@ -50,6 +53,7 @@
delComment
,
dynamicDetailComments
}
from
'
@/api/api.js
'
import
{
getUserInfo
}
from
'
@/utils/auth
'
;
export
default
{
name
:
"
Comment-Item
"
,
data
()
{
...
...
@@ -61,7 +65,8 @@
pageSize
:
10
,
momentId
:
''
},
total
:
0
total
:
0
,
userInfo
:{}
};
},
components
:
{
...
...
@@ -81,6 +86,7 @@
if
(
newVal
.
id
){
this
.
queryParams
.
momentId
=
newVal
.
id
;
this
.
commentList
=
[];
this
.
userInfo
=
JSON
.
parse
(
getUserInfo
())
this
.
getCommentList
()
}
}
...
...
@@ -220,19 +226,22 @@
.user-info
{
display
:
flex
;
justify-content
:
space-between
;
font-size
:
24rpx
;
.username
{
width
:
calc
(
100%
-
300rpx
);
color
:
black
;
color
:
#0058B6
;
}
.datetime
{
width
:
290rpx
;
text-align
:
right
;
margin-left
:
16rpx
;
color
:
#999999
;
}
.operation-text
{
width
:
180rpx
;
text-align
:
right
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
}
}
.content
{
...
...
@@ -244,14 +253,7 @@
width
:
calc
(
100%
-
180rpx
);
}
.operation-text
{
width
:
180rpx
;
text-align
:
right
;
font-size
:
24rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
}
.mr10
{
margin-right
:
12rpx
;
}
...
...
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
View file @
27c6e336
...
...
@@ -22,7 +22,7 @@
<rich-text
v-if=
"preNodes.length > 0"
:nodes=
"preNodes"
></rich-text>
<view
class=
"imgs"
v-if=
"form.type=='IMAGE'&&form.attachments && form.attachments.length > 0"
>
<
template
v-for=
"(item,index) in form.attachments"
>
<image
class=
"item"
:src=
"item.url"
@
click.stop=
"preview(
item.url
)"
></image>
<image
class=
"item"
:src=
"item.url"
@
click.stop=
"preview(
form.attachments,index
)"
></image>
</
template
>
</view>
<view
class=
"imgs"
v-if=
"form.type=='VIDEO'&&form.attachments && form.attachments.length > 0"
>
...
...
@@ -54,7 +54,7 @@
</view>
<view
class=
"pk-imgs"
v-if=
"form.voteOptionType=='IMAGE' && form.voteOptions.length>0 "
>
<
template
v-for=
"(item,index) in form.voteOptions"
>
<image
:src=
"item.imageUrl"
@
click.stop=
"preview(
item.imageUrl
)"
class=
"img"
></image>
<image
:src=
"item.imageUrl"
@
click.stop=
"preview(
form.voteOptions,index
)"
class=
"img"
></image>
</
template
>
</view>
<!-- 未投票 -->
...
...
@@ -102,20 +102,22 @@
<view
class=
"comment-display-box"
v-if=
"form.comments&& form.comments.length>0"
>
<view
class=
"comment-item"
v-for=
"(item,index) in form.comments"
>
<view
class=
"user-info"
>
<view
class=
"username"
>
{{item.nickName}}:
</view>
<view
style=
"display: flex;align-items: center;"
>
<view
class=
"username"
>
{{item.nickName}}
</view>
<view
class=
"datetime"
>
{{item.createTime}}
</view>
</view>
<view
class=
"operation-text"
>
<view
v-if=
"item.isFeatured==1"
style=
"color: #F2AC39;margin-right: 10rpx;"
>
精选
</view>
<view
style=
"color: #bbb;"
v-if=
"item.isSelf==1 || userInfo.bbsAdmin"
@
click.stop=
"handleDelete(item)"
>
删除
</view>
</view>
</view>
<view
class=
"content"
>
<view
class=
"text"
v-if=
"!item.replyNickName"
@
click.stop=
"handleReplayComment(item)"
>
{{item.content}}
</view>
<view
class=
"text"
v-else
@
click.stop=
"handleReplayComment(item)"
>
回复
<span
style=
"color: #0058B6;"
>
{{item.replyNickName}}:
</span>
{{item.content}}
</view>
<view
class=
"operation-text"
>
<view
v-if=
"item.isFeatured==1"
style=
"color: #F2AC39;margin-right: 10rpx;"
>
精选
</view>
<view
v-if=
"item.isSelf==1"
@
click.stop=
"handleDelete(item)"
>
删除
</view>
回复
<span
style=
"color: #0058B6;"
>
{{item.replyNickName}}
</span>
{{item.content}}
</view>
</view>
</view>
...
...
@@ -139,6 +141,7 @@
import
PublishComment
from
'
./PublishComment.vue
'
;
import
VideoPreview
from
'
./VideoPreview.vue
'
;
import
emotions
from
'
@/utils/emjo
'
;
import
{
getUserInfo
}
from
'
@/utils/auth
'
;
export
default
{
name
:
"
Dynamic-Item
"
,
data
()
{
...
...
@@ -150,7 +153,8 @@
clientY
:
0
,
showDelBtn
:
false
,
preNodes
:
[],
emotions
emotions
,
userInfo
:{}
};
},
components
:
{
...
...
@@ -175,6 +179,7 @@
if
(
val
===
oldVal
)
{
return
;
}
this
.
userInfo
=
JSON
.
parse
(
getUserInfo
())
this
.
preNodes
=
this
.
formatContent
(
val
)
}
}
...
...
@@ -335,10 +340,16 @@
});
},
// 预览图片
preview
(
url
)
{
preview
(
list
,
index
)
{
let
urls
=
list
.
map
((
item
)
=>
{
return
item
.
url
;
})
if
(
urls
.
length
>
0
){
uni
.
previewImage
({
urls
:
[
url
]
urls
:
urls
,
current
:
index
});
}
},
//预览视频
videoPreview
(
url
)
{
...
...
safe-campus-bbs-uniapp/pages.json
View file @
27c6e336
{
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/login/login"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/index/index"
,
"style"
:
{
...
...
@@ -15,47 +8,48 @@
}
},
{
"path"
:
"pages/topics/topics"
,
"style"
:
"path"
:
"pages/login/login"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
"navigationBarTitleText"
:
"话题"
,
"path"
:
"pages/topics/topics"
,
"style"
:
{
"navigationBarTitleText"
:
"话题"
,
"enablePullDownRefresh"
:
true
}
},
{
"path"
:
"pages/mine/mine"
,
"style"
:
{
"navigationBarTitleText"
:
"我的"
"path"
:
"pages/mine/mine"
,
"style"
:
{
"navigationBarTitleText"
:
"我的"
}
},
{
"path"
:
"pages/publish/publish"
,
"style"
:
{
"navigationBarTitleText"
:
"发布"
"path"
:
"pages/publish/publish"
,
"style"
:
{
"navigationBarTitleText"
:
"发布"
}
},
{
"path"
:
"pages/dynamic-detail/dynamic-detail"
,
"style"
:
{
"navigationBarTitleText"
:
"动态详情"
"path"
:
"pages/dynamic-detail/dynamic-detail"
,
"style"
:
{
"navigationBarTitleText"
:
"动态详情"
}
},
{
"path"
:
"pages/topic-detail/topic-detail"
,
"style"
:
{
"navigationBarTitleText"
:
"话题详情"
,
"path"
:
"pages/topic-detail/topic-detail"
,
"style"
:
{
"navigationBarTitleText"
:
"话题详情"
,
"enablePullDownRefresh"
:
true
}
},
{
"path"
:
"pages/pk-detail/pk-detail"
,
"style"
:
{
"navigationBarTitleText"
:
"PK详情"
"path"
:
"pages/pk-detail/pk-detail"
,
"style"
:
{
"navigationBarTitleText"
:
"PK详情"
}
}
],
...
...
safe-campus-bbs-uniapp/pages/index/index.vue
View file @
27c6e336
...
...
@@ -52,6 +52,7 @@
ListEmpty
},
onLoad
()
{
this
.
$store
.
dispatch
(
'
GetInfo
'
)
this
.
getList
()
let
_this
=
this
;
uni
.
$on
(
'
hanldeDynamicRefresh
'
,
function
()
{
...
...
safe-campus-bbs-uniapp/pages/login/login.vue
View file @
27c6e336
...
...
@@ -40,7 +40,6 @@
login
(
params
).
then
(
res
=>
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
setToken
(
res
.
data
)
this
.
$store
.
dispatch
(
'
GetInfo
'
)
uni
.
switchTab
({
url
:
'
/pages/index/index
'
})
...
...
@@ -51,7 +50,6 @@
})
}
if
(
res
.
code
==
401
){
// removeToken()
window
.
location
=
res
.
data
}
})
...
...
safe-campus-bbs-uniapp/static/styles/index.scss
View file @
27c6e336
...
...
@@ -50,6 +50,7 @@
grid-template-rows
:
auto
;
row-gap
:
6rpx
;
column-gap
:
6rpx
;
margin-top
:
12rpx
;
.item
{
width
:
100%
;
height
:
224rpx
;
...
...
@@ -237,34 +238,34 @@
.user-info
{
display
:
flex
;
justify-content
:
space-between
;
font-size
:
24rpx
;
.username
{
width
:
calc
(
100%
-
300rpx
);
color
:
black
;
color
:
#0058B6
;
}
.datetime
{
width
:
290rpx
;
text-align
:
right
;
color
:
#999999
;
}
}
.content
{
color
:
black
;
margin
:
10rpx
0
;
display
:
flex
;
.text
{
width
:
calc
(
100%
-
180rpx
);
margin-left
:
16rpx
;
}
.operation-text
{
width
:
180rpx
;
text-align
:
right
;
font-size
:
24rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
}
}
.content
{
color
:
black
;
margin
:
10rpx
0
;
display
:
flex
;
.text
{
width
:
100%
;
}
.mr10
{
margin-right
:
12rpx
;
}
...
...
safe-campus-bbs-uniapp/store/modules/user.js
View file @
27c6e336
...
...
@@ -55,9 +55,14 @@ const user = {
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getInfo
().
then
(
res
=>
{
if
(
res
.
code
==
200
){
const
user
=
res
.
data
commit
(
'
SET_USER_INFO
'
,
JSON
.
stringify
(
user
))
resolve
(
res
)
}
if
(
res
.
code
==
401
){
window
.
location
=
res
.
data
}
}).
catch
(
error
=>
{
reject
(
error
)
})
...
...
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