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
a659c077
Commit
a659c077
authored
Nov 07, 2025
by
yuwenwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移动端调整(不换行)
parent
79e3bfa9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
22 deletions
+67
-22
safe-campus-bbs-uniapp/components/Comment-Item.vue
safe-campus-bbs-uniapp/components/Comment-Item.vue
+2
-0
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
+1
-1
safe-campus-bbs-uniapp/pages/index/index.vue
safe-campus-bbs-uniapp/pages/index/index.vue
+57
-21
safe-campus-bbs-uniapp/static/styles/index.scss
safe-campus-bbs-uniapp/static/styles/index.scss
+7
-0
No files found.
safe-campus-bbs-uniapp/components/Comment-Item.vue
View file @
a659c077
...
...
@@ -251,6 +251,8 @@
.text
{
width
:
calc
(
100%
-
180rpx
);
word-wrap
:
break-word
;
word-break
:
break-all
;
}
...
...
safe-campus-bbs-uniapp/components/Dynamic-Item.vue
View file @
a659c077
...
...
@@ -20,7 +20,7 @@
</view>
<view
class=
"dynamic-content-box"
>
<rich-text
v-if=
"preNodes.length > 0"
:nodes=
"preNodes"
></rich-text>
<rich-text
v-if=
"preNodes.length > 0"
:nodes=
"preNodes"
class=
"text"
></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(form.attachments,index)"
></image>
...
...
safe-campus-bbs-uniapp/pages/index/index.vue
View file @
a659c077
...
...
@@ -11,19 +11,26 @@
<scroll-view
class=
"scroll-view-index"
scroll-y
:show-scrollbar=
"false"
v-if=
"list.length>0"
@
scrolltolower=
"loadMore"
>
<template
v-for=
"(item,index) in list"
>
<dynamic-item
:form=
"item"
@
refresh=
"refreshContentList"
@
refreshCurrent=
"refreshCurrent"
></dynamic-item>
<dynamic-item
:form=
"item"
@
refresh=
"refreshContentList"
@
refreshCurrent=
"refreshCurrent"
></dynamic-item>
</
template
>
</scroll-view>
<scroll-view
class=
"scroll-view-index"
scroll-y
:show-scrollbar=
"false"
v-else
>
<list-empty></list-empty>
</scroll-view>
<!-- 发布按钮 -->
<movable-area
class=
"movable-area"
>
<
!-- <
movable-area class="movable-area">
<movable-view class="add-dynamic-box move-button" :x="area.x+'rpx'" :y="area.y + 'rpx'" direction="all"
@change="onChange" damping="30" @click="toPublishPage">
<image class="icon" src="/static/images/publish-icon.png"></image>
</movable-view>
</movable-area>
</movable-area> -->
<!-- 发布按钮 -->
<view
class=
"add-dynamic-box"
@
click=
"toPublishPage"
:style=
"{ left: iconLeft + 'px', top: iconTop + 'px' }"
@
touchstart=
"handleTouchStart"
@
touchmove=
"handleTouchMove"
@
touchend=
"handleTouchEnd"
>
<image
class=
"icon"
src=
"/static/images/publish-icon.png"
></image>
</view>
</view>
</template>
...
...
@@ -49,7 +56,10 @@
y
:
1060
},
emotions
,
scrollTop
:
0
scrollTop
:
0
,
iconLeft
:
310
,
iconTop
:
480
,
isMoving
:
false
}
},
components
:
{
...
...
@@ -141,6 +151,49 @@
});
}
})
},
// 触摸开始
handleTouchStart
(
e
)
{
this
.
isMoving
=
true
;
// 记录触摸起点(相对于屏幕)
this
.
startX
=
e
.
touches
[
0
].
clientX
;
this
.
startY
=
e
.
touches
[
0
].
clientY
;
// 记录图标当前位置
this
.
initialLeft
=
this
.
iconLeft
;
this
.
initialTop
=
this
.
iconTop
;
},
// 触摸移动
handleTouchMove
(
e
)
{
if
(
!
this
.
isMoving
)
return
;
// 防止页面滚动
e
.
preventDefault
();
// 计算当前触摸位置与起点的偏移量
const
moveX
=
e
.
touches
[
0
].
clientX
-
this
.
startX
;
const
moveY
=
e
.
touches
[
0
].
clientY
-
this
.
startY
;
// 计算新位置(初始位置 + 偏移量)
let
newLeft
=
this
.
initialLeft
+
moveX
;
let
newTop
=
this
.
initialTop
+
moveY
;
// 限制图标在屏幕内(可选)
const
windowWidth
=
uni
.
getSystemInfoSync
().
windowWidth
;
const
windowHeight
=
uni
.
getSystemInfoSync
().
windowHeight
;
const
iconSize
=
50
;
// 图标宽高(根据实际调整)
// 左右边界
newLeft
=
Math
.
max
(
0
,
Math
.
min
(
newLeft
,
windowWidth
-
iconSize
));
// 上下边界
newTop
=
Math
.
max
(
0
,
Math
.
min
(
newTop
,
windowHeight
-
iconSize
));
// 更新位置
this
.
iconLeft
=
newLeft
;
this
.
iconTop
=
newTop
;
},
// 触摸结束
handleTouchEnd
()
{
this
.
isMoving
=
false
;
}
}
}
...
...
@@ -148,21 +201,4 @@
<
style
lang=
"scss"
scoped
>
@import
'@/static/styles/index.scss'
;
.movable-area
{
position
:
fixed
;
height
:
calc
(
100vh
-
3
.75rem
);
width
:
100%
;
z-index
:
998
;
pointer-events
:
none
;
left
:
0
;
top
:
0
;
.move-button
{
pointer-events
:
auto
;
pointer-events
:
auto
;
}
}
</
style
>
\ No newline at end of file
safe-campus-bbs-uniapp/static/styles/index.scss
View file @
a659c077
...
...
@@ -43,6 +43,8 @@
color
:
rgba
(
16
,
16
,
16
,
1
);
font-size
:
32rpx
;
margin-bottom
:
20rpx
;
word-wrap
:
break-word
;
word-break
:
break-all
;
}
.imgs
{
// display: grid;
...
...
@@ -100,6 +102,8 @@
.text
{
color
:
rgba
(
142
,
153
,
171
,
1
);
font-size
:
28rpx
;
word-wrap
:
break-word
;
word-break
:
break-all
;
}
}
}
...
...
@@ -265,6 +269,8 @@
display
:
flex
;
.text
{
width
:
100%
;
word-wrap
:
break-word
;
word-break
:
break-all
;
}
...
...
@@ -285,6 +291,7 @@
}
.add-dynamic-box
{
position
:
fixed
;
width
:
76rpx
;
height
:
76rpx
;
border-radius
:
50%
;
...
...
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