Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lumastoreapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xieyishang
lumastoreapp
Commits
760aaabb
Commit
760aaabb
authored
Nov 17, 2021
by
xieyishang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1~
parent
c3a95dfc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
154 additions
and
98 deletions
+154
-98
pages/chat/chat/chat.vue
pages/chat/chat/chat.vue
+140
-98
pages/chat/chat/global.scss
pages/chat/chat/global.scss
+14
-0
No files found.
pages/chat/chat/chat.vue
View file @
760aaabb
...
...
@@ -44,6 +44,7 @@
<!-- 单聊 type=1 群聊 type=2 -->
<!-- push 发出 pull 收到 -->
<scroll-view
:style=
"
{height: scrollheight+'px'}" class="scrollview" scroll-y :scroll-top="scrollTop" :scroll-with-animation="false">
<view
class=
"chatboxtwo"
id=
"list-box"
@
tap.stop=
"listboxtap"
>
<view
class=
"talk-list"
>
<view
v-for=
"(item,index) in msgslist"
:key=
"index"
:id=
"`msg-$
{item.msgId}`">
...
...
@@ -147,6 +148,7 @@
</view>
</view>
</scroll-view>
<view
class=
"chatboxinps"
id=
"chatboxinps"
>
<view
class=
"flex_col lineinputboxs textbox"
>
...
...
@@ -318,6 +320,9 @@
if
(
item
.
url_imageList
){
if
(
item
.
url_imageList
.
length
!=
0
){
url
=
item
.
url_imageList
[
0
].
url
;
if
(
item
.
url_imageList
.
length
>
1
){
url
=
item
.
url_imageList
[
1
].
url
;
}
}
}
// #endif
...
...
@@ -403,6 +408,8 @@
IMtitle
:
"
聊天
"
,
dfuinfo
:{},
//单聊对方的信息
scrollTop
:
0
,
scrollheight
:
513
,
}
},
computed
:
{
...
...
@@ -422,12 +429,16 @@
msgslist
()
{
if
(
this
.
type
==
1
)
{
if
(
this
.
msgslist
.
length
!=
0
){
setTimeout
(()
=>
{
this
.
ToTheBottom
();
},
200
);
}
this
.
markC2CMessageAsReadfun
();
}
else
if
(
this
.
type
==
2
)
{
if
(
this
.
msgslist
.
length
!=
0
){
setTimeout
(()
=>
{
this
.
ToTheBottom
();
},
200
);
}
this
.
markGroupMessageAsRead
();
}
...
...
@@ -436,6 +447,19 @@
},
onLoad
(
options
)
{
try
{
//获取设备信息
let
resinfo
=
uni
.
getSystemInfoSync
();
console
.
info
(
resinfo
,
"
resinfo
"
);
let
windowHeight
=
resinfo
.
windowHeight
;
//可使用窗口高度 768
//上面的是95 下面的是56
//上面44 下面 42
let
scrollheight
=
windowHeight
-
44
-
43
-
resinfo
.
statusBarHeight
;
this
.
scrollheight
=
scrollheight
;
//可滑动区域的高度 计算出来是
}
catch
(
error
){
console
.
error
(
"
error
"
,
error
);
}
setTimeout
(()
=>
{
this
.
statusBarHeight
=
uni
.
getSystemInfoSync
().
statusBarHeight
*
2
;
},
10
)
...
...
@@ -485,6 +509,8 @@
//删除缓存消息
//......
this
.
$store
.
commit
(
"
setqunmsgslist
"
,
[]);
this
.
$store
.
commit
(
"
Setmsgslist
"
,
[]);
},
onPageScroll
(
e
)
{
if
(
e
.
scrollTop
<
5
)
{
...
...
@@ -574,18 +600,34 @@
//页面置底
ToTheBottom
()
{
console
.
info
(
"
置底
"
);
// this.$nextTick(() => {
// // dom元素更新后执行,因此这里能正确打印更改之后的值
// let curRoute = this.$mp.page.route;
// if(curRoute=='pages/chat/chat/chat'){
// uni.pageScrollTo({
// scrollTop: 9999999999, // 设置一个超大值,以保证滚动条滚动到底部
// duration: 0
// });
// }else{
// console.info("不在当前页面了 不能置底");
// }
// })
this
.
$nextTick
(()
=>
{
// dom元素更新后执行,因此这里能正确打印更改之后的值
let
curRoute
=
this
.
$mp
.
page
.
route
;
if
(
curRoute
==
'
pages/chat/chat/chat
'
){
uni
.
pageScrollTo
({
scrollTop
:
9999999999
,
// 设置一个超大值,以保证滚动条滚动到底部
duration
:
0
});
let
view
=
uni
.
createSelectorQuery
().
select
(
"
.chatboxtwo
"
);
view
.
boundingClientRect
((
data
)
=>
{
//获取固定尾部的高度=data.height
// that.style.footViewHeight = data.height
// console.info(" data.height", data.height);
if
(
data
){
this
.
scrollTop
=
data
.
height
+
460
;
}
else
{
console
.
info
(
"
不在当前页面了 不能置底
"
);
console
.
info
(
"
加载快了
"
);
this
.
scrollTop
=
999999999
;
}
}).
exec
();
})
},
// 获取历史消息
...
...
pages/chat/chat/global.scss
View file @
760aaabb
...
...
@@ -445,6 +445,20 @@ page{
}
}
.talk-list.isbottoms
{
padding-bottom
:
375upx
;
}
::-webkit-scrollbar
{
width
:
0
;
height
:
0
;
color
:
transparent
;
}
/
deep
/
:
:-
webkit-scrollbar
{
display
:
none
;
width
:
0
;
height
:
0
;
}
.isread
{
color
:
#999999
;
@at-root
margin-top
:
10upx
;
...
...
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