Commit 760aaabb authored by xieyishang's avatar xieyishang

1~

parent c3a95dfc
......@@ -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();
})
},
// 获取历史消息
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment