Skip to content

Commit

Permalink
re
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Jun 9, 2017
1 parent 6ae6095 commit ced926a
Show file tree
Hide file tree
Showing 28 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

### 单人聊天、群聊

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/singlechat.gif" width="300" height="530" alt=""><img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/groupchat.gif" width="300" height="530" alt=""><img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/chatwo.gif" width="300" height="530" alt="">
<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/singlechat.gif" width="300" height="530" alt=""> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/chatwo.gif" width="300" height="530" alt=""> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/groupchat.gif" width="300" height="530" alt="">

### 发现

Expand Down
Binary file added printscreen/aboutwx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/cardbag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/chatset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/collect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified printscreen/commont.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/computer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified printscreen/find.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified printscreen/groupchat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/infor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified printscreen/like.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/newmess.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/notrao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/photo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/priat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/set.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified printscreen/shangchuan.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added printscreen/tongyong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/header/head.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
header{
@include widthHeight(100%,2.06933rem);
background:$black;
z-index:10;
z-index:200;
color:#fff;
position: fixed;
.logoPart{
Expand Down
50 changes: 25 additions & 25 deletions src/frames/conversation/groupchat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
</router-link>
</section>
</head-top>
<section class="coversation" ref="groupHeight" >
<section class="coversation" ref="groupHeight" @touchmove='loadMore'>
<section class="coversationlist">
<div class="underscore" v-if="underscore">————&nbsp;我是有底线的&nbsp;————</div>
<ul>
<!-- 群聊-->
<li v-for="item in groupconversine" >
Expand All @@ -29,7 +30,6 @@
</div>
</li>
</ul>
<div class="underscore" v-if="underscore">————&nbsp;我是有底线的&nbsp;————</div>
</section>
</section>
<div class="load" v-if="loadStatus">
Expand Down Expand Up @@ -206,7 +206,6 @@
import 'src/style/swiper.min.css'
import fetch from 'src/config/fetch'
const socket = io('http://cangdu.org:8003');
export default{
data(){
return{
Expand Down Expand Up @@ -248,7 +247,6 @@
socket.on('chat', function (data) {
console.log(data);
});
window.addEventListener('scroll', this.loadMore);
},
components:{
headTop,
Expand All @@ -260,33 +258,46 @@
},
beforeDestroy(){
clearTimeout(this.timer);
socket.removeAllListeners()
socket.removeAllListeners();
},
methods:{
...mapActions([
'getUserInfo',
]),
async groupList(offset){
const groupData = await fetch('/chat/history',{"offset":this.offset, "limit":20} )
this.loadStatus=false;
for(let i=0; i<groupData.history.length; i++){
this.imgS='';
this.imgS=Math.ceil(Math.random()*20);//随机图片
groupData.history[i].avatar=imgurl+this.imgS+'.jpg';
}
console.log(groupData)
if(groupData.status == 200){
this.groupconversine = [...this.groupconversine,...groupData.history]
for(let i=0; i<groupData.history.length; i++){
this.imgS='';
this.imgS=Math.ceil(Math.random()*2);//随机图片
groupData.history[i].avatar=imgurl+this.imgS+'.jpg';
}
this.groupconversine = [...groupData.history, ...this.groupconversine]
}
if(groupData.history.length < 20){
this.underscore=true;
}
this.$nextTick(() => {
this.loadStatus=false;
if (offset == 0) {
window.scrollTo(0, this.$refs.groupHeight.offsetHeight - window.innerHeight)
}else{
const scrollPosition = this.$refs.groupHeight.offsetHeight - this.lastPageHeight;
window.scrollTo(0,scrollPosition)
}
this.lastPageHeight = this.$refs.groupHeight.offsetHeight;
})
},
loadMore(){
if (this.loadStatus || this.underscore) {
return
}
this.scroll = document.body.scrollTop;
if(this.scroll >= this.$refs.groupHeight.offsetHeight - window.innerHeight){
if(this.scroll == 0){
this.loadStatus=true;
this.offset+=20;
this.groupList(this.offset);
this.loadStatus=true;
}
},
whatInput(){
Expand Down Expand Up @@ -346,7 +357,6 @@
transform:translateX(100%)
}
.load{
position: fixed;
z-index:100;
Expand Down Expand Up @@ -678,7 +688,6 @@
background:#000000;
top:0;
z-index:100;
img{
display:block;
width:100%;
Expand All @@ -704,49 +713,40 @@
from {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
100% {
opacity: 1;
}
}
@-webkit-keyframes zoomOut {
from {
opacity: 1;
}
50% {
opacity: 0;
-webkit-transform: scale3d(.3, .3, .3);
transform: scale3d(.3, .3, .3);
}
100% {
opacity: 0;
}
}
@keyframes zoomOut {
from {
opacity: 1;
}
50% {
opacity: 0;
-webkit-transform: scale3d(.3, .3, .3);
transform: scale3d(.3, .3, .3);
}
100% {
opacity: 0;
}
Expand Down
3 changes: 2 additions & 1 deletion src/frames/dialogue/dialogue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@
try{
const res = await fetch('/user/info')
if (res.status !== 200) {
this.LOGIN_COVER(true)
this.consumerthing=
this.LOGIN_COVER(false)
}
}catch(err){
console.log('获取用户信息失败', err)
Expand Down
4 changes: 2 additions & 2 deletions src/service/data/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ W:[
],
X:[
{
"wxid":"xulianjie442154157",
"wxid":"812571880",
"headurl":imgurl+'chen.jpg',
"petname":"徐连杰",
"petname":"百里辰",
"sex":1,
"sdasd":"披荆斩棘",
"phone":"15800319949",
Expand Down
4 changes: 2 additions & 2 deletions src/service/data/friendcircle.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export const circle= [
"flag":true,
"suporthtml":"赞",
},{
"wxid":"xulianjie442154157",
"wxid":"812571880",
"headurl":imgurl+'chen.jpg',
"petname":"徐连杰",
"petname":"百里辰",
"sex":1,
"remarks":"",
"statements":"身边总有几个这样的朋友,第一次遇见斯斯文文的,熟识之后会发与不知道是哪个精神病院放出来的。",
Expand Down
4 changes: 2 additions & 2 deletions src/service/data/groupchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export const groupchat={
"sendobject":1,
},
{
"username":"xulianjie442154157",
"username":"812571880",
"avatar":imgurl+'chen.jpg',
"petname":"徐连杰",
"petname":"百里辰",
"content":"今天下雨",
"sendobject":1,
},
Expand Down
2 changes: 1 addition & 1 deletion src/service/data/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {imgurl} from 'src/config/env';
export const userInfo = {
"wxid":"812571880",
"headurl":imgurl+'chen.jpg',
"petname":"徐连杰",
"petname":"百里辰",
"sex":1,
"sdasd":"逆天改命",
"phone":"15800319949",
Expand Down
2 changes: 1 addition & 1 deletion src/service/data/userword.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import {imgurl} from 'src/config/env';
export const userWord=[
{
"wxid":"xulianjie442154157",
"wxid":"812571880",
"headurl":imgurl+'chen.jpg',
"sendobject":0,
"Messageblob":"人生没有彩排,每天都是直播,不仅收视率低,而且工资不高。",
Expand Down

0 comments on commit ced926a

Please sign in to comment.