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
6cc1d54f
Commit
6cc1d54f
authored
Sep 08, 2025
by
yuwenwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移动端问题修改
parent
cd3c81fd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
29 deletions
+70
-29
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
+7
-2
safe-campus-bbs-uniapp/components/ImageUpload.vue
safe-campus-bbs-uniapp/components/ImageUpload.vue
+2
-1
safe-campus-bbs-uniapp/pages/index/index.vue
safe-campus-bbs-uniapp/pages/index/index.vue
+49
-21
safe-campus-bbs-uniapp/pages/publish/publish.vue
safe-campus-bbs-uniapp/pages/publish/publish.vue
+9
-2
safe-campus-bbs-uniapp/static/styles/index.scss
safe-campus-bbs-uniapp/static/styles/index.scss
+3
-3
No files found.
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
View file @
6cc1d54f
...
...
@@ -13,11 +13,16 @@
</view>
<view
class=
"dynamic-content-box"
>
<view
class=
"text"
>
{{form.content}}
</view>
<view
class=
"imgs"
v-if=
"form.attachments && form.attachments.length > 0"
>
<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"
></image>
</
template
>
</view>
<view
class=
"imgs"
v-if=
"form.type=='VIDEO'&&form.attachments && form.attachments.length > 0"
>
<
template
v-for=
"(item,index) in form.attachments"
>
<video
class=
"item"
:src=
"item.url"
></video>
</
template
>
</view>
</view>
<view
class=
"datetime-box"
>
{{form.createTime}}
</view>
<view
class=
"operation-box"
>
...
...
@@ -164,7 +169,7 @@
},
toDynamicDetailPage
()
{
let
pathName
=
window
.
location
.
pathname
if
(
pathName
==
'
/pages/dynamic-detail/dynamic-detail
'
){
if
(
pathName
.
indexOf
(
'
/pages/dynamic-detail/dynamic-detail
'
)
>
-
1
){
return
;
}
uni
.
navigateTo
({
...
...
safe-campus-bbs-uniapp/components/ImageUpload.vue
View file @
6cc1d54f
...
...
@@ -150,7 +150,7 @@
const
extension
=
'
.
'
+
newlist
[
0
].
url
.
split
(
'
.
'
).
pop
().
toLowerCase
();
_this
.
isVideo
=
videoExtensions
.
includes
(
extension
);
}
else
{
_this
.
isVideo
=
false
_this
.
isVideo
=
false
;
}
if
(
newlist
&&
newlist
.
length
>
0
)
{
const
imgExtensions
=
[
'
.png
'
,
'
.jpg
'
,
'
.jpeg
'
,
'
.PNG
'
,
'
.JPG
'
,
'
.JPEG
'
,
'
.svg
'
];
...
...
@@ -161,6 +161,7 @@
}
_this
.
fileList
=
newlist
;
this
.
limiData
=
this
.
limit
-
newlist
.
length
_this
.
$emit
(
'
componentsType
'
,
_this
.
isVideo
?
'
VIDEO
'
:
'
IMAGE
'
)
},
immediate
:
true
}
...
...
safe-campus-bbs-uniapp/pages/index/index.vue
View file @
6cc1d54f
...
...
@@ -7,41 +7,46 @@
<scroll-view
class=
"scroll-view-index"
scroll-y
:show-scrollbar=
"false"
@
scrolltolower=
"loadMore"
>
<template
v-for=
"(item,index) in list"
>
<dynamic-item
:form=
"item"
@
refresh=
"getList"
></dynamic-item>
<dynamic-item
:form=
"item"
@
refresh=
"getList"
></dynamic-item>
</
template
>
</scroll-view>
<!-- 发布按钮 -->
<view
class=
"add-dynamic-box"
@
click=
"toPublishPage"
>
<movable-area
class=
"movable-area"
>
<movable-view
class=
"add-dynamic-box move-button"
:x=
"area.x"
:y=
"area.y"
direction=
"all"
@
change=
"onChange"
damping=
"30"
@
click=
"toPublishPage"
>
<image
class=
"icon"
src=
"/static/images/publish-icon.png"
></image>
</view>
</movable-view>
</movable-area>
</view>
</template>
<
script
>
import
DynamicItem
from
'
@/components/Dynamic-Item.vue
'
import
{
dynamicList
}
from
'
@/api/api.js
'
import
{
dynamicList
}
from
'
@/api/api.js
'
export
default
{
data
()
{
return
{
list
:
[],
queryParams
:{
pageNum
:
1
,
pageSize
:
10
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
},
total
:
0
,
total
:
0
,
area
:
{
x
:
330
,
y
:
600
}
}
},
components
:{
components
:
{
DynamicItem
},
onLoad
()
{
this
.
getList
()
let
_this
=
this
;
uni
.
$on
(
'
hanldeDynamicRefresh
'
,
function
()
{
uni
.
$on
(
'
hanldeDynamicRefresh
'
,
function
()
{
_this
.
getList
()
})
},
...
...
@@ -49,8 +54,8 @@
uni
.
$off
(
'
hanldeDynamicRefresh
'
)
},
methods
:
{
getList
(){
dynamicList
(
this
.
queryParams
).
then
(
res
=>
{
getList
()
{
dynamicList
(
this
.
queryParams
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
list
=
res
.
rows
})
...
...
@@ -58,15 +63,19 @@
loadMore
()
{
},
toPublishPage
(){
toPublishPage
()
{
uni
.
navigateTo
({
url
:
'
/pages/publish/publish
'
url
:
'
/pages/publish/publish
'
})
},
toPKDetailPage
(){
toPKDetailPage
()
{
uni
.
navigateTo
({
url
:
'
/pages/pk-detail/pk-detail
'
url
:
'
/pages/pk-detail/pk-detail
'
})
},
onChange
(
e
)
{
this
.
area
.
y
=
e
.
detail
.
y
;
this
.
area
.
x
=
e
.
detail
.
x
}
}
}
...
...
@@ -74,4 +83,23 @@
<
style
lang=
"scss"
scoped
>
@import
'@/static/styles/index.scss'
;
.movable-area
{
position
:
fixed
;
height
:
100%
;
width
:
100%
;
z-index
:
999
;
pointer-events
:
none
;
left
:
0
;
top
:
0
;
.move-button
{
pointer-events
:
auto
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
pointer-events
:
auto
;
border-radius
:
50%
;
}
}
</
style
>
\ No newline at end of file
safe-campus-bbs-uniapp/pages/publish/publish.vue
View file @
6cc1d54f
...
...
@@ -8,7 +8,7 @@
<view
class=
"publish-box"
>
<textarea
class=
"textarea"
v-model=
"form.content"
placeholder=
"分享有趣事~"
placeholder-class=
"placeholder-class"
/>
<image-upload
v-model=
"form.attachments"
:limit=
"9"
:showIcons=
"true"
@
handleTopic=
"handleOpenTopicSelection"
></image-upload>
<image-upload
v-model=
"form.attachments"
:limit=
"9"
:showIcons=
"true"
@
componentsType=
"handleSetComponentsType"
@
handleTopic=
"handleOpenTopicSelection"
></image-upload>
</view>
<view
class=
"permission-box"
>
<view
class=
"item"
>
...
...
@@ -123,7 +123,7 @@
topicList
:
[],
form
:
{
content
:
''
,
type
:
'
IMAGE
'
,
type
:
'
TEXT
'
,
topicNames
:
[],
topicIds
:
[],
linkUrl
:
''
,
...
...
@@ -165,6 +165,13 @@
console
.
log
(
e
)
this
.
form
.
voteOptionType
=
e
.
detail
.
value
},
handleSetComponentsType
(
type
){
if
(
type
&&
this
.
form
.
attachments
.
length
>
0
){
this
.
form
.
type
=
type
}
else
{
this
.
form
.
type
=
'
TEXT
'
}
},
// 发布动态
handleSubmit
(){
if
(
this
.
topicList
.
length
>
0
){
...
...
safe-campus-bbs-uniapp/static/styles/index.scss
View file @
6cc1d54f
...
...
@@ -269,9 +269,9 @@
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
right
:
34rpx
;
top
:
700rpx
;
//
position: fixed;
//
right: 34rpx;
//
top: 700rpx;
.icon
{
width
:
44rpx
;
height
:
44rpx
;
...
...
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