Skip to content

Commit

Permalink
Merge pull request bailicangdu#6 from bailichen/master
Browse files Browse the repository at this point in the history
hebing
  • Loading branch information
bailicangdu authored Jun 18, 2017
2 parents 7c8082e + 1bb1bdf commit 55cd5e4
Show file tree
Hide file tree
Showing 38 changed files with 154 additions and 167 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
node_modules/
dist/
npm-debug.log
weixin/
npm-debug.log

183 changes: 91 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
## 前言

### 利用vue2+vuex写一个模仿微信app的单页面应用
使用SVG格式构建页面icon图
这个项目是利用工作之余写的一个模仿微信app的单页面应用,整个项目包含27个页面,涉及实时群聊,机器人聊天,同学录,朋友圈等等,后续页面还是开发中。写这个项目主要目的是练习和熟悉vue和vuex的配合使用,利用socket.io实现实时聊天。

欢迎各路大神Issuess

## 技术栈

```
vue2+vue-router+webpack+vuex+sass+svg构图+es6/7+socket.io+http-proxy-middleware
```

##### 项目运行

```
git clone https://github.com/bailichen/vue-weixin.git
cd vue-weixin
npm install
npm run buid (访问线上后台系统)
npm run dev (访问本地,运行后访问 http://localhost:8882)
```
### 效果演示

[项目演示请点击这里](http://cangdu.org:8003/dialogue) (请用chrome手机模式预览)


### 移动端扫描下方二维码

![](https://github.com/bailichen/vue-weixin/raw/master/printscreen/code.png)


### 说明

> 本项目主要用于熟悉vue2+vuex,svg的用法
> 如有问题请直接在Issues中提出,或加qq:812571880
> 如果觉得对您学习vue有点点帮助,请右上角star一下吧 ^_^
# 目标功能
- [x] 微信
Expand Down Expand Up @@ -31,92 +71,34 @@
- [x] 设置
- [x] 登录



# 页面部分截图

### 底部导航

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

### 通讯录

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/addressbook.jpg" width="300" height="530"/>

### 单人聊天

<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/single.jpg" 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/group.jpg" width="300" height="530" alt="">


### 发现

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/find.png" width="300" height="530"/>

### 朋友圈

###### 上传图片

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

###### 点赞

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

###### 评论

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

### 个人资料
<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/infor.png" width="300" height="530"/> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/photo.png" width="300" height="530"/>

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/collect.png" width="300" height="530"/> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/card.png" width="300" height="530"/>

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/cardbag.png" width="300" height="530"/> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/set.png" width="300" height="530"/>

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/newmess.png" width="300" height="530"/> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/notrao.png" width="300" height="530"/>

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/chatset.png" width="300" height="530"/> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/priat.png" width="300" height="530"/>

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/tongyong.png" width="300" height="530"/> <img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/aboutwx.png" width="300" height="530"/>

<img src="https://github.com/bailichen/vue-weixin/raw/master/printscreen/login.png" width="300" height="530"/>




# 项目布局

```
├── README.md// webpack配置文件
├── build// 项目打包路径
├── config// 上线项目文件,放在服务器即可正常访问
├── README.md // webpack配置文件
├── build // 项目打包路径
├── config // 上线项目文件,放在服务器即可正常访问
│   └── index.js
├── favicon.ico
├── index.html
├── package.json
├── printscreen
├── src// 源码目录
│   ├── App.vue// 页面入口文件
│   ├── components// 公共组件
├── src // 源码目录
│   ├── App.vue // 页面入口文件
│   ├── components // 公共组件
│   │   ├── findandMe
│   │   │   └── findandMe.vue// 发现和我共同的模块的列表
│   │   │   └── findandMe.vue // 发现和我共同的模块的列表
│   │   ├── footer
│   │   │   └── foot.vue// 底部微信导航
│   │   │   └── foot.vue // 底部微信导航
│   │   └── header
│   │   └── head.vue// 头部公共组件
│   ├── config// 基本配置
│   │   ├── env.js// 环境切换配置
│   │   ├── fetch.js// 获取数据
│   │   └── head.vue // 头部公共组件
│   ├── config // 基本配置
│   │   ├── env.js // 环境切换配置
│   │   ├── fetch.js // 获取数据
│   │   ├── iscroll.js
│   │   ├── mUtils.js// 工具
│   │   ├── rem.js// px转换rem
│   │   ├── swiper.min.js// 轮播图控件
│   │   ├── mUtils.js // 工具
│   │   ├── rem.js // px转换rem
│   │   ├── swiper.min.js // 轮播图控件
│   │   └── uploadPreview.js // 上传图片控件
│   ├── frames
│   │   ├── addressbook
Expand Down Expand Up @@ -165,38 +147,55 @@
│   │   │   └── wallet
│   │   │   └── wallet.vue // 我的钱包
│   │   ├── search
│   │   │   └── search.vue// 搜索
│   │   │   └── search.vue // 搜索
│   │   └── transfer
│   │   └── transfer.vue
│   ├── images
│   ├── main.js// 程序入口文件,加载各种公共组件
│   ├── main.js // 程序入口文件,加载各种公共组件
│   ├── router
│   │   └── router.js// 所有页面路由控制中心
│   │   └── router.js // 所有页面路由控制中心
│   ├── service
│   │   ├── data
│   │   │   ├── album.js// 个人相册
│   │   │   ├── burse.js// 钱包数据
│   │   │   ├── album.js // 个人相册
│   │   │   ├── burse.js // 钱包数据
│   │   │   ├── chatmore.js
│   │   │   ├── collect.js// 我的收藏
│   │   │   ├── collect.js // 我的收藏
│   │   │   ├── contacts.js // 联系人列表数据
│   │   │   ├── dialoglist.js // 对话列表
│   │   │   ├── friendcircle.js // 朋友圈数据
│   │   │   ├── groupchat.js // 群聊数据
│   │   │   ├── login.js// 个人用户信息
│   │   │   ├── search.js// 搜索的分类
│   │   │   ├── login.js // 个人用户信息
│   │   │   ├── search.js // 搜索的分类
│   │   │   └── userword.js
│   │   └── getData.js// 数据交互统一调配
│   │   └── getData.js // 数据交互统一调配
│   ├── style
│   │   ├── public.scss//公共样式
│   │   ├── public.scss //公共样式
│   │   └── swiper.min.css
│   └── vuex// vuex的状态管理
│   ├── action.js// 配置根actions
│   ├── index.js// 引用vuex,创建store
│   ├── mutation-types.js// 定义常量muations名
│   └── mutation.js// 配置根mutations
│   └── vuex // vuex的状态管理
│   ├── action.js // 配置根actions
│   ├── index.js // 引用vuex,创建store
│   ├── mutation-types.js // 定义常量muations名
│   └── mutation.js // 配置根mutations
└── tree.md
36 directories, 133 files
```
```

# 页面部分截图

### 单人聊天、群聊

<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/shangchuan.gif" width="300" height="530"/>

###### 点赞、评论

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

Binary file added printscreen/code.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/group.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 33 additions & 7 deletions src/frames/conversation/chatmessage/groupchatmessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
<section class="child_page">
<head-top crossover="聊天信息"></head-top>
<section class="groupchat">
<ul class="groupchat_ul clear">
<ul class="groupchat_ul clear" ref="groupUl" :class="{ beforeUl : notlook, afterUl : looking}">
<li v-for="item in allPeople">
<img :src="imgurl + item.avatar" alt="">
<span class="ellipsis">{{item.name}}</span>
</li>
</ul>
<div class="lookmore" v-if="lookgroup" @click="lookAll">
查看全部群成员
</div>
</section>
<section class="chat">
<ul class="groupChat_ul">
<ul>
<li>
<div>群聊名称</div>
<div class="voice-music">{{gropname}}</div>
</li>
<li>
<div>群公告</div>
</li>

</ul>
<ul>
<li>
Expand Down Expand Up @@ -63,7 +65,10 @@
return{
allPeople:[],
imgurl:imgurl,
gropname:''
gropname:'',
looking:false, //看全部
notlook:false, //多出隐藏
lookgroup:false, //查看全部群成员按钮
}
},
created(){
Expand All @@ -76,22 +81,30 @@
allgroup().then((res)=>{
if(res.status == 200){
this.allPeople=res.users
console.log(this.allPeople)
if(this.allPeople.length > 20){
this.lookgroup=true
this.notlook=true;
}
}else{
alert("获取数据失败,请检查网络是否正常!")
}
});
groupChat().then((res) => {
this.gropname=res.petname;
//this.groupconversine=[...res.grouphead];
});
},
components:{
headTop,
},
methods:{
lookAll(){
this.notlook=false;
this.looking=true;
this.lookgroup=false;
}
}
}
</script>
Expand All @@ -118,7 +131,7 @@
padding-top: 2.9rem;
background:#fff;
padding:2.9rem 0.8533333333rem 0;
ul{
.groupchat_ul{
box-sizing:border-box;
li{
float:left;
Expand All @@ -144,6 +157,19 @@
margin-right:0;
}
}
.beforeUl{
max-height:14rem;
overflow:hidden;
}
.afterUl{
overflow:auto;
height:auto;
}
.lookmore{
padding:0.64rem 0 0.8533333333rem;
text-align:center;
@include sizeColor(0.64rem,#666);
}
}
.chat{
margin-top:0.8533333333rem;
Expand Down
2 changes: 1 addition & 1 deletion src/frames/conversation/groupchat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
//this.groupconversine=[...res.grouphead];
});
socket.on('chat', (data) => {
console.log(data);//聊天返回内容
//console.log(data);//聊天返回内容
this.groupconversine.push(data);
this.$nextTick(()=>{
window.scrollTo(0,this.$refs.groupHeight.offsetHeight-window.innerHeight)
Expand Down
2 changes: 0 additions & 2 deletions weixin/static/js/aboutwc.9c74d87cc387ee4111f8.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/addressbook.5d39263890ed3ede07db.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion weixin/static/js/app.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions weixin/static/js/cardbag.90318e61cec278527fc7.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/chat.05c953354e291e31166d.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/chatmessage.3d061c6806f64ccf418d.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/collect.f3fd33fb32f0844acab2.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/computer.ff7cc7233e7b7877a0b8.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/currency.b03bdd3888dfc2e9ea08.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/details.de1579d98845e98db0b9.min.js

This file was deleted.

3 changes: 0 additions & 3 deletions weixin/static/js/dialogue.46089c131657fb2bb74c.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/disturbance.bcb6fb77cf27263d3a67.min.js

This file was deleted.

3 changes: 0 additions & 3 deletions weixin/static/js/find.af15925258481cff39cd.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/friendcircle.3fc5f2fcb8c152e6ff6a.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/groupchat.42537516fc0c70000aeb.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/groupchatmessage.53228650710dbfc45bfc.min.js

This file was deleted.

1 change: 0 additions & 1 deletion weixin/static/js/help.921fd815d4429fb33e03.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/login.4dc0ef82857be7d2fdaa.min.js

This file was deleted.

1 change: 1 addition & 0 deletions weixin/static/js/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions weixin/static/js/me.d7d77f4b6ff4ff18d5b6.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/miniapps.dd8190300e720cd9d93d.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/more.05001e89cc82b02c4dd8.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/newmessage.c35d953c5e58f59ed8f5.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/personaldetails.95d73ac31488f8465392.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/photoalbum.689c2ef2ac3d8f6858a1.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/privacy.da6b253f45c1494ec4c2.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/search.253bb1bfd867f42a25a8.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/settings.d0e019ad40a3b7339487.min.js

This file was deleted.

6 changes: 0 additions & 6 deletions weixin/static/js/singlechat.1deb64fdd89634f2d380.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions weixin/static/js/transfer.0d7e121c4218ca71671c.min.js

This file was deleted.

25 changes: 25 additions & 0 deletions weixin/static/js/vendor.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions weixin/static/js/wallet.3b5b23db142dfa123363.min.js

This file was deleted.

0 comments on commit 55cd5e4

Please sign in to comment.