├── static ├── .gitkeep ├── emoji │ ├── 100.gif │ ├── 101.gif │ ├── 102.gif │ ├── 103.gif │ ├── 104.gif │ ├── 105.gif │ ├── 106.gif │ ├── 107.gif │ ├── 108.gif │ ├── 109.gif │ ├── 110.gif │ ├── 111.gif │ ├── 112.gif │ ├── 113.gif │ ├── 114.gif │ ├── 115.gif │ ├── 116.gif │ ├── 117.gif │ ├── 118.gif │ ├── 119.gif │ ├── 120.gif │ ├── 121.gif │ ├── 122.gif │ ├── 123.gif │ ├── 124.gif │ ├── 125.gif │ ├── 126.gif │ ├── 127.gif │ ├── 128.gif │ ├── 129.gif │ ├── 130.gif │ ├── 131.gif │ ├── 132.gif │ ├── 133.gif │ ├── 134.gif │ ├── 135.gif │ ├── 136.gif │ ├── 137.gif │ ├── 138.gif │ ├── 139.gif │ ├── 140.gif │ ├── 141.gif │ ├── 142.gif │ ├── 143.gif │ ├── 144.gif │ ├── 145.gif │ ├── 146.gif │ ├── 147.gif │ ├── 148.gif │ ├── 149.gif │ ├── 150.gif │ ├── 151.gif │ ├── 152.gif │ ├── 153.gif │ ├── 154.gif │ ├── 155.gif │ ├── 156.gif │ ├── 157.gif │ ├── 158.gif │ ├── 159.gif │ ├── 160.gif │ ├── 161.gif │ ├── 162.gif │ ├── 163.gif │ ├── 164.gif │ ├── 165.gif │ ├── 166.gif │ ├── 167.gif │ ├── 168.gif │ ├── 169.gif │ ├── 170.gif │ ├── 171.gif │ ├── 172.gif │ ├── 173.gif │ ├── 174.gif │ ├── 175.gif │ ├── 176.gif │ ├── 177.gif │ ├── 178.gif │ ├── 179.gif │ ├── 180.gif │ ├── 181.gif │ ├── 182.gif │ ├── 183.gif │ ├── 184.gif │ ├── 185.gif │ ├── 186.gif │ ├── 187.gif │ ├── 188.gif │ ├── 189.gif │ ├── 190.gif │ ├── 191.gif │ ├── 192.gif │ ├── 193.gif │ ├── 194.gif │ ├── 195.gif │ ├── 196.gif │ ├── 197.gif │ ├── 198.gif │ ├── 199.gif │ ├── meinv.png │ ├── shangxin.png │ └── weixiao.png ├── images │ ├── bg.png │ ├── 悟空.jpg │ ├── Guai.jpg │ ├── vue.jpg │ ├── 加菲猫.jpg │ ├── 大飞哥.jpg │ ├── 小姨妈.jpg │ ├── 新之助.jpg │ ├── 萌萌俊.jpg │ ├── father.jpg │ ├── microzz.jpg │ ├── mother.jpg │ ├── orange.jpg │ ├── newfriend.jpg │ └── UserAvatar.jpg └── css │ └── reset.css ├── config ├── prod.env.js ├── dev.env.js └── index.js ├── .gitignore ├── src ├── components │ ├── info │ │ ├── man.png │ │ ├── woman.png │ │ └── info.vue │ ├── search │ │ ├── delete.png │ │ └── search.vue │ ├── friendlist │ │ └── friendlist.vue │ ├── chatlist │ │ └── chatlist.vue │ ├── mycard │ │ └── mycard.vue │ ├── message │ │ └── message.vue │ └── text │ │ └── text.vue ├── assets │ └── fonts │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ ├── iconfont.css │ │ ├── iconfont.svg │ │ └── iconfont.js ├── page │ ├── resume │ │ └── resume.vue │ ├── friend │ │ └── friend.vue │ └── chat │ │ └── chat.vue ├── main.js ├── router │ └── index.js ├── App.vue └── store.js ├── .editorconfig ├── .postcssrc.js ├── .babelrc ├── index.html ├── README.md └── package.json /static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /static/emoji/100.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/100.gif -------------------------------------------------------------------------------- /static/emoji/101.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/101.gif -------------------------------------------------------------------------------- /static/emoji/102.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/102.gif -------------------------------------------------------------------------------- /static/emoji/103.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/103.gif -------------------------------------------------------------------------------- /static/emoji/104.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/104.gif -------------------------------------------------------------------------------- /static/emoji/105.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/105.gif -------------------------------------------------------------------------------- /static/emoji/106.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/106.gif -------------------------------------------------------------------------------- /static/emoji/107.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/107.gif -------------------------------------------------------------------------------- /static/emoji/108.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/108.gif -------------------------------------------------------------------------------- /static/emoji/109.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/109.gif -------------------------------------------------------------------------------- /static/emoji/110.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/110.gif -------------------------------------------------------------------------------- /static/emoji/111.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/111.gif -------------------------------------------------------------------------------- /static/emoji/112.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/112.gif -------------------------------------------------------------------------------- /static/emoji/113.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/113.gif -------------------------------------------------------------------------------- /static/emoji/114.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/114.gif -------------------------------------------------------------------------------- /static/emoji/115.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/115.gif -------------------------------------------------------------------------------- /static/emoji/116.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/116.gif -------------------------------------------------------------------------------- /static/emoji/117.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/117.gif -------------------------------------------------------------------------------- /static/emoji/118.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/118.gif -------------------------------------------------------------------------------- /static/emoji/119.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/119.gif -------------------------------------------------------------------------------- /static/emoji/120.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/120.gif -------------------------------------------------------------------------------- /static/emoji/121.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/121.gif -------------------------------------------------------------------------------- /static/emoji/122.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/122.gif -------------------------------------------------------------------------------- /static/emoji/123.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/123.gif -------------------------------------------------------------------------------- /static/emoji/124.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/124.gif -------------------------------------------------------------------------------- /static/emoji/125.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/125.gif -------------------------------------------------------------------------------- /static/emoji/126.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/126.gif -------------------------------------------------------------------------------- /static/emoji/127.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/127.gif -------------------------------------------------------------------------------- /static/emoji/128.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/128.gif -------------------------------------------------------------------------------- /static/emoji/129.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/129.gif -------------------------------------------------------------------------------- /static/emoji/130.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/130.gif -------------------------------------------------------------------------------- /static/emoji/131.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/131.gif -------------------------------------------------------------------------------- /static/emoji/132.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/132.gif -------------------------------------------------------------------------------- /static/emoji/133.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/133.gif -------------------------------------------------------------------------------- /static/emoji/134.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/134.gif -------------------------------------------------------------------------------- /static/emoji/135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/135.gif -------------------------------------------------------------------------------- /static/emoji/136.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/136.gif -------------------------------------------------------------------------------- /static/emoji/137.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/137.gif -------------------------------------------------------------------------------- /static/emoji/138.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/138.gif -------------------------------------------------------------------------------- /static/emoji/139.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/139.gif -------------------------------------------------------------------------------- /static/emoji/140.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/140.gif -------------------------------------------------------------------------------- /static/emoji/141.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/141.gif -------------------------------------------------------------------------------- /static/emoji/142.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/142.gif -------------------------------------------------------------------------------- /static/emoji/143.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/143.gif -------------------------------------------------------------------------------- /static/emoji/144.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/144.gif -------------------------------------------------------------------------------- /static/emoji/145.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/145.gif -------------------------------------------------------------------------------- /static/emoji/146.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/146.gif -------------------------------------------------------------------------------- /static/emoji/147.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/147.gif -------------------------------------------------------------------------------- /static/emoji/148.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/148.gif -------------------------------------------------------------------------------- /static/emoji/149.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/149.gif -------------------------------------------------------------------------------- /static/emoji/150.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/150.gif -------------------------------------------------------------------------------- /static/emoji/151.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/151.gif -------------------------------------------------------------------------------- /static/emoji/152.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/152.gif -------------------------------------------------------------------------------- /static/emoji/153.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/153.gif -------------------------------------------------------------------------------- /static/emoji/154.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/154.gif -------------------------------------------------------------------------------- /static/emoji/155.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/155.gif -------------------------------------------------------------------------------- /static/emoji/156.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/156.gif -------------------------------------------------------------------------------- /static/emoji/157.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/157.gif -------------------------------------------------------------------------------- /static/emoji/158.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/158.gif -------------------------------------------------------------------------------- /static/emoji/159.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/159.gif -------------------------------------------------------------------------------- /static/emoji/160.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/160.gif -------------------------------------------------------------------------------- /static/emoji/161.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/161.gif -------------------------------------------------------------------------------- /static/emoji/162.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/162.gif -------------------------------------------------------------------------------- /static/emoji/163.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/163.gif -------------------------------------------------------------------------------- /static/emoji/164.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/164.gif -------------------------------------------------------------------------------- /static/emoji/165.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/165.gif -------------------------------------------------------------------------------- /static/emoji/166.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/166.gif -------------------------------------------------------------------------------- /static/emoji/167.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/167.gif -------------------------------------------------------------------------------- /static/emoji/168.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/168.gif -------------------------------------------------------------------------------- /static/emoji/169.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/169.gif -------------------------------------------------------------------------------- /static/emoji/170.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/170.gif -------------------------------------------------------------------------------- /static/emoji/171.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/171.gif -------------------------------------------------------------------------------- /static/emoji/172.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/172.gif -------------------------------------------------------------------------------- /static/emoji/173.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/173.gif -------------------------------------------------------------------------------- /static/emoji/174.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/174.gif -------------------------------------------------------------------------------- /static/emoji/175.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/175.gif -------------------------------------------------------------------------------- /static/emoji/176.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/176.gif -------------------------------------------------------------------------------- /static/emoji/177.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/177.gif -------------------------------------------------------------------------------- /static/emoji/178.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/178.gif -------------------------------------------------------------------------------- /static/emoji/179.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/179.gif -------------------------------------------------------------------------------- /static/emoji/180.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/180.gif -------------------------------------------------------------------------------- /static/emoji/181.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/181.gif -------------------------------------------------------------------------------- /static/emoji/182.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/182.gif -------------------------------------------------------------------------------- /static/emoji/183.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/183.gif -------------------------------------------------------------------------------- /static/emoji/184.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/184.gif -------------------------------------------------------------------------------- /static/emoji/185.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/185.gif -------------------------------------------------------------------------------- /static/emoji/186.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/186.gif -------------------------------------------------------------------------------- /static/emoji/187.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/187.gif -------------------------------------------------------------------------------- /static/emoji/188.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/188.gif -------------------------------------------------------------------------------- /static/emoji/189.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/189.gif -------------------------------------------------------------------------------- /static/emoji/190.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/190.gif -------------------------------------------------------------------------------- /static/emoji/191.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/191.gif -------------------------------------------------------------------------------- /static/emoji/192.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/192.gif -------------------------------------------------------------------------------- /static/emoji/193.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/193.gif -------------------------------------------------------------------------------- /static/emoji/194.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/194.gif -------------------------------------------------------------------------------- /static/emoji/195.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/195.gif -------------------------------------------------------------------------------- /static/emoji/196.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/196.gif -------------------------------------------------------------------------------- /static/emoji/197.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/197.gif -------------------------------------------------------------------------------- /static/emoji/198.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/198.gif -------------------------------------------------------------------------------- /static/emoji/199.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/199.gif -------------------------------------------------------------------------------- /static/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/bg.png -------------------------------------------------------------------------------- /static/images/悟空.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/悟空.jpg -------------------------------------------------------------------------------- /static/emoji/meinv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/meinv.png -------------------------------------------------------------------------------- /static/images/Guai.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/Guai.jpg -------------------------------------------------------------------------------- /static/images/vue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/vue.jpg -------------------------------------------------------------------------------- /static/images/加菲猫.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/加菲猫.jpg -------------------------------------------------------------------------------- /static/images/大飞哥.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/大飞哥.jpg -------------------------------------------------------------------------------- /static/images/小姨妈.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/小姨妈.jpg -------------------------------------------------------------------------------- /static/images/新之助.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/新之助.jpg -------------------------------------------------------------------------------- /static/images/萌萌俊.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/萌萌俊.jpg -------------------------------------------------------------------------------- /static/emoji/shangxin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/shangxin.png -------------------------------------------------------------------------------- /static/emoji/weixiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/emoji/weixiao.png -------------------------------------------------------------------------------- /static/images/father.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/father.jpg -------------------------------------------------------------------------------- /static/images/microzz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/microzz.jpg -------------------------------------------------------------------------------- /static/images/mother.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/mother.jpg -------------------------------------------------------------------------------- /static/images/orange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/orange.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | -------------------------------------------------------------------------------- /src/components/info/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/src/components/info/man.png -------------------------------------------------------------------------------- /static/images/newfriend.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/newfriend.jpg -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/src/assets/fonts/iconfont.eot -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/src/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/src/assets/fonts/iconfont.woff -------------------------------------------------------------------------------- /src/components/info/woman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/src/components/info/woman.png -------------------------------------------------------------------------------- /static/images/UserAvatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/static/images/UserAvatar.jpg -------------------------------------------------------------------------------- /src/components/search/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdxofgithub/WeChat-vue/HEAD/src/components/search/delete.png -------------------------------------------------------------------------------- /src/page/resume/resume.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 14 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": ["transform-runtime"], 7 | "comments": false, 8 | "env": { 9 | "test": { 10 | "presets": ["env", "stage-2"], 11 | "plugins": [ "istanbul" ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WeChat 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WeChat 2 | 3 | > 仿PC端微信的单页面应用 4 | 5 | [在线预览](http://cdxwangwang.cn/wechat) 6 | 7 | ## Build Setup 8 | 9 | ``` bash 10 | # install dependencies 11 | npm install 12 | 13 | # serve with hot reload at localhost:8080 14 | npm run dev 15 | 16 | # build for production with minification 17 | npm run build 18 | ``` 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import store from './store' 7 | 8 | import VueResource from 'vue-resource' 9 | Vue.use(VueResource) 10 | 11 | Vue.config.productionTip = false 12 | 13 | /* eslint-disable no-new */ 14 | new Vue({ 15 | el: '#app', 16 | router, 17 | store, 18 | template: '', 19 | components: { App } 20 | }) 21 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | 4 | Vue.use(Router) 5 | 6 | const router = new Router({ 7 | routes: [ 8 | { 9 | path: '/chat', 10 | component: require('@/page/chat/chat.vue') 11 | }, 12 | { 13 | path: '/friend', 14 | component: require('@/page/friend/friend.vue') 15 | }, 16 | { 17 | path: '/my', 18 | component: require('@/page/resume/resume.vue') 19 | } 20 | ], 21 | linkActiveClass: 'active' //用 active 替换点击时添加的class 22 | }) 23 | router.push({path: '/chat'}); 24 | export default router 25 | -------------------------------------------------------------------------------- /src/page/friend/friend.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 25 | 26 | 36 | -------------------------------------------------------------------------------- /src/page/chat/chat.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 28 | 29 | 39 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 29 | 30 | 47 | 48 | -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('iconfont.eot?t=1495519142886'); /* IE9*/ 4 | src: url('iconfont.eot?t=1495519142886#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('iconfont.woff?t=1495519142886') format('woff'), /* chrome, firefox */ 6 | url('iconfont.ttf?t=1495519142886') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('iconfont.svg?t=1495519142886#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-search:before { content: "\e607"; } 19 | 20 | .icon-more:before { content: "\e606"; } 21 | 22 | .icon-warn:before { content: "\e657"; } 23 | 24 | .icon-collection:before { content: "\e608"; } 25 | 26 | .icon-friend:before { content: "\e603"; } 27 | 28 | .icon-msg:before { content: "\e60a"; } 29 | 30 | .icon-look:before { content: "\e639"; } 31 | 32 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | dev: { 25 | env: require('./dev.env'), 26 | port: 8080, 27 | autoOpenBrowser: true, 28 | assetsSubDirectory: 'static', 29 | assetsPublicPath: '/', 30 | proxyTable: {}, 31 | // CSS Sourcemaps off by default because relative paths are "buggy" 32 | // with this option, according to the CSS-Loader README 33 | // (https://github.com/webpack/css-loader#sourcemaps) 34 | // In our experience, they generally work as expected, 35 | // just be aware of this issue when enabling this option. 36 | cssSourceMap: false 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /static/css/reset.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video, input { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font-size: 100%; 18 | font-weight: normal; 19 | vertical-align: baseline; 20 | } 21 | 22 | article, aside, details, figcaption, figure, 23 | footer, header, menu, nav, section { 24 | display: block; 25 | } 26 | 27 | body { 28 | line-height: 1; 29 | } 30 | 31 | blockquote, q { 32 | quotes: none; 33 | } 34 | 35 | blockquote:before, blockquote:after, 36 | q:before, q:after { 37 | content: none; 38 | } 39 | 40 | table { 41 | border-collapse: collapse; 42 | border-spacing: 0; 43 | } 44 | 45 | a { 46 | color: #7e8c8d; 47 | text-decoration: none; 48 | -webkit-backface-visibility: hidden; 49 | } 50 | 51 | li { 52 | list-style: none; 53 | } 54 | 55 | 56 | html, body { 57 | width: 100%; 58 | height: 100%; 59 | overflow-y: hidden 60 | } 61 | body { 62 | -webkit-text-size-adjust: none; 63 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 64 | background-image: url(../images/bg.png); 65 | background-size: cover; 66 | } 67 | /* 设置滚动条的样式 */ 68 | ::-webkit-scrollbar { 69 | width: 8px; 70 | } 71 | /* 滚动条滑块 */ 72 | ::-webkit-scrollbar-thumb { 73 | border-radius: 6px; 74 | background: rgba(0,0,0,0.1); 75 | } -------------------------------------------------------------------------------- /src/components/friendlist/friendlist.vue: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 35 | 36 | 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WeChat", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "CDXwangwang <2501494354@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "start": "node build/dev-server.js", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "vue": "^2.2.6", 14 | "vue-router": "^2.3.1" 15 | }, 16 | "devDependencies": { 17 | "autoprefixer": "^6.7.2", 18 | "babel-core": "^6.22.1", 19 | "babel-loader": "^6.2.10", 20 | "babel-plugin-transform-runtime": "^6.22.0", 21 | "babel-preset-env": "^1.3.2", 22 | "babel-preset-stage-2": "^6.22.0", 23 | "babel-register": "^6.22.0", 24 | "chalk": "^1.1.3", 25 | "connect-history-api-fallback": "^1.3.0", 26 | "copy-webpack-plugin": "^4.0.1", 27 | "css-loader": "^0.28.0", 28 | "eventsource-polyfill": "^0.9.6", 29 | "express": "^4.14.1", 30 | "extract-text-webpack-plugin": "^2.0.0", 31 | "file-loader": "^0.11.1", 32 | "friendly-errors-webpack-plugin": "^1.1.3", 33 | "html-webpack-plugin": "^2.28.0", 34 | "http-proxy-middleware": "^0.17.3", 35 | "webpack-bundle-analyzer": "^2.2.1", 36 | "semver": "^5.3.0", 37 | "shelljs": "^0.7.6", 38 | "opn": "^4.0.2", 39 | "optimize-css-assets-webpack-plugin": "^1.3.0", 40 | "ora": "^1.2.0", 41 | "rimraf": "^2.6.0", 42 | "url-loader": "^0.5.8", 43 | "vue-loader": "^11.3.4", 44 | "vue-style-loader": "^2.0.5", 45 | "vue-template-compiler": "^2.2.6", 46 | "webpack": "^2.3.3", 47 | "webpack-dev-middleware": "^1.10.0", 48 | "webpack-hot-middleware": "^2.18.0", 49 | "webpack-merge": "^4.1.0" 50 | }, 51 | "engines": { 52 | "node": ">= 4.0.0", 53 | "npm": ">= 3.0.0" 54 | }, 55 | "browserslist": [ 56 | "> 1%", 57 | "last 2 versions", 58 | "not ie <= 8" 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /src/components/search/search.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 40 | 41 | 82 | 83 | -------------------------------------------------------------------------------- /src/components/chatlist/chatlist.vue: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 50 | 51 | 92 | -------------------------------------------------------------------------------- /src/components/mycard/mycard.vue: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 42 | 43 | 96 | -------------------------------------------------------------------------------- /src/components/info/info.vue: -------------------------------------------------------------------------------- 1 | 2 | 34 | 35 | 52 | 53 | 121 | 122 | -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Created by FontForge 20120731 at Tue May 23 13:59:02 2017 6 | By admin 7 | 8 | 9 | 10 | 24 | 26 | 28 | 30 | 32 | 34 | 38 | 41 | 43 | 46 | 48 | 51 | 53 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/components/message/message.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 77 | 78 | 148 | -------------------------------------------------------------------------------- /src/components/text/text.vue: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 112 | 113 | 199 | -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.js: -------------------------------------------------------------------------------- 1 | (function(window){var svgSprite=""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+""+""+''+""+''+""+""+""+''+""+''+""+''+""+''+""+''+""+""+""+"";var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) -------------------------------------------------------------------------------- /src/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import router from './router' 4 | Vue.use(Vuex) 5 | 6 | //获取当前时间 7 | const now = new Date(); 8 | const state = { 9 | // 输入的搜索值 10 | searchText: '', 11 | // more弹出层 12 | more_show: false, 13 | // 当前登录用户 14 | user: { 15 | name: 'ratel', 16 | img: 'static/images/UserAvatar.jpg' 17 | }, 18 | // 对话好友列表 19 | chatlist: [ 20 | { 21 | id: 1, 22 | user: { 23 | name: '妈咪', 24 | img: 'static/images/mother.jpg' 25 | }, 26 | messages: [ 27 | { 28 | content: '么么哒,妈咪爱你', //聊天内容 29 | date: now //时间 30 | }, 31 | { 32 | content: '按回车可以发送信息,还可以给我发送表情哟', 33 | date: now 34 | } 35 | ], 36 | index: 1 // 当前在聊天列表中的位置,从1开始 37 | 38 | }, 39 | { 40 | id: 2, 41 | user: { 42 | name: 'father', 43 | img: 'static/images/father.jpg' 44 | }, 45 | messages: [ 46 | { 47 | content: 'Are you kidding me?', 48 | date: now 49 | } 50 | ], 51 | index: 2 52 | }, 53 | { 54 | id: 3, 55 | user: { 56 | name: '机器人', 57 | img: 'static/images/vue.jpg' 58 | }, 59 | messages: [ 60 | { 61 | content: '我会跟你聊聊天的哟', 62 | date: now 63 | } 64 | ], 65 | index: 3 66 | } 67 | ], 68 | // 好友列表 69 | friendlist: [ 70 | { 71 | id: 0, 72 | wxid: "", //微信号 73 | initial: '新的朋友', //姓名首字母 74 | img: 'static/images/newfriend.jpg', //头像 75 | signature: "", //个性签名 76 | nickname: "新的朋友", //昵称 77 | sex: 0, //性别 1为男,0为女 78 | remark: "新的朋友", //备注 79 | area: "", //地区 80 | }, 81 | { 82 | id: 1, 83 | wxid: "AmorAres-", //微信号 84 | initial: 'A', //姓名首字母 85 | img: 'static/images/小姨妈.jpg', //头像 86 | signature: "每天我就萌萌哒", //个性签名 87 | nickname: "Amor", //昵称 88 | sex: 0, //性别 1为男,0为女 89 | remark: "Amor", //备注 90 | area: "浙江 宁波", //地区 91 | }, 92 | { 93 | id: 2, 94 | wxid: "Big-fly", 95 | initial: 'B', 96 | img: 'static/images/大飞哥.jpg', 97 | signature: "你不知道的js", 98 | nickname: "fly", 99 | sex: 1, 100 | remark: "大飞哥", 101 | area: "奥地利 布尔根兰", 102 | }, 103 | { 104 | id: 3, 105 | wxid: "microzz", 106 | initial: 'D', 107 | img: 'static/images/microzz.jpg', 108 | signature: "学习让我快乐让我成长", 109 | nickname: "microzz", 110 | sex: 1, 111 | remark: "大佬", 112 | area: "江西 赣州", 113 | }, 114 | { 115 | id: 4, 116 | wxid: "hwn0366", 117 | initial: 'F', 118 | img: 'static/images/father.jpg', 119 | signature: "学习让我快乐让我成长", 120 | nickname: "丢", 121 | sex: 1, 122 | remark: "father", 123 | area: "江西 抚州", 124 | }, 125 | { 126 | id: 5, 127 | wxid: "orange66", 128 | initial: 'J', 129 | img: 'static/images/orange.jpg', 130 | signature: "你可以笑的很阳光!", 131 | nickname: "orange", 132 | sex: 1, 133 | remark: "橘子", 134 | area: "江西 赣州", 135 | }, 136 | { 137 | id: 6, 138 | wxid: "Seto_L", 139 | img: 'static/images/加菲猫.jpg', 140 | signature: "自强不息", 141 | nickname: "21", 142 | sex: 1, 143 | remark: "加菲", 144 | area: "北京 海淀", 145 | }, 146 | { 147 | id: 7, 148 | wxid: "wxid_itjz73t1ajt722", 149 | initial: 'M', 150 | img: 'static/images/mother.jpg', 151 | signature: "开开心心就好", 152 | nickname: "娄娄", 153 | sex: 0, 154 | remark: "妈咪", 155 | area: "江西 抚州", 156 | }, 157 | { 158 | id: 8, 159 | wxid: "hj960503", 160 | img: 'static/images/萌萌俊.jpg', 161 | signature: "原谅我有点蠢。。", 162 | nickname: "。。。。。", 163 | sex: 1, 164 | remark: "萌萌均", 165 | area: "江西 萍乡", 166 | } 167 | 168 | ], 169 | //emoji表情 170 | emojis: [ 171 | { file: '100.gif', code: '/::)', title: '微笑', reg: /\/::\)/g }, 172 | { file: '101.gif', code: '/::~', title: '伤心', reg: /\/::~/g }, 173 | { file: '102.gif', code: '/::B', title: '美女', reg: /\/::B/g }, 174 | { file: '103.gif', code: '/::|', title: '发呆', reg: /\/::\|/g }, 175 | { file: '104.gif', code: '/:8-)', title: '墨镜', reg: /\/:8-\)/g }, 176 | { file: '105.gif', code: '/::<', title: '哭', reg: /\/::', title: '高兴', reg: /\/::>/g }, 200 | { file: '129.gif', code: '/::,@', title: '闲', reg: /\/::,@/g }, 201 | { file: '130.gif', code: '/:,@f', title: '努力', reg: /\/:,@f/g }, 202 | { file: '131.gif', code: '/::-S', title: '骂', reg: /\/::-S/g }, 203 | { file: '133.gif', code: '/:,@x', title: '秘密', reg: /\/:,@x/g }, 204 | { file: '134.gif', code: '/:,@@', title: '乱', reg: /\/:,@@/g }, 205 | { file: '135.gif', code: '/::8', title: '疯', reg: /\/::8/g }, 206 | { file: '136.gif', code: '/:,@!', title: '哀', reg: /\/:,@!/g }, 207 | { file: '137.gif', code: '/:!!!', title: '鬼', reg: /\/:!!!/g }, 208 | { file: '138.gif', code: '/:xx', title: '打击', reg: /\/:xx/g }, 209 | { file: '139.gif', code: '/:bye', title: 'bye', reg: /\/:bye/g }, 210 | { file: '142.gif', code: '/:handclap', title: '鼓掌', reg: /\/:handclap/g }, 211 | { file: '145.gif', code: '/:<@', title: '什么', reg: /\/:<@/g }, 212 | { file: '147.gif', code: '/::-O', title: '累', reg: /\/::-O/g }, 213 | { file: '153.gif', code: '/:@x', title: '吓', reg: /\/:@x/g }, 214 | { file: '155.gif', code: '/:pd', title: '刀', reg: /\/:pd/g }, 215 | { file: '156.gif', code: '/:', title: '水果', reg: /\/:/g }, 216 | { file: '157.gif', code: '/:beer', title: '酒', reg: /\/:beer/g }, 217 | { file: '158.gif', code: '/:basketb', title: '篮球', reg: /\/:basketb/g }, 218 | { file: '159.gif', code: '/:oo', title: '乒乓', reg: /\/:oo/g }, 219 | { file: '195.gif', code: '/:circle', title: '跳舞', reg: /\/:circle/g }, 220 | { file: '160.gif', code: '/:coffee', title: '咖啡', reg: /\/:coffee/g } 221 | ], 222 | // 得知当前选择的是哪个对话 223 | selectId: 1, 224 | // 得知当前选择的是哪个好友 225 | selectFriendId: 0 226 | } 227 | 228 | const mutations = { 229 | // 从localStorage 中获取数据 230 | initData(state) { 231 | let data = localStorage.getItem('vue-chat'); 232 | if (data) { 233 | state.chatlist = JSON.parse(data); 234 | } 235 | }, 236 | // 获取搜索值 237 | search(state, value) { 238 | state.searchText = value 239 | }, 240 | // 得知用户当前选择的是哪个对话。便于匹配对应的对话框 241 | selectSession(state, value) { 242 | state.selectId = value 243 | }, 244 | // 更改more的弹出框 245 | m_show(state, value) { 246 | state.more_show = value 247 | }, 248 | // 得知用户当前选择的是哪个好友。 249 | selectFriend(state, value) { 250 | state.selectFriendId = value 251 | }, 252 | // 发送信息 253 | sendMessage(state, msg) { 254 | let result = state.chatlist.find(session => session.id === state.selectId); 255 | result.messages.push({ 256 | content: msg.content, 257 | date: new Date(), 258 | self: true 259 | }); 260 | if (result.user.name === '机器人') { 261 | setTimeout(() => { 262 | result.messages.push({ 263 | content: msg.reply, 264 | date: new Date(), 265 | self: false 266 | }); 267 | }, 500) 268 | } 269 | }, 270 | 271 | // 选择好友后,点击发送信息。判断在聊天列表中是否有该好友,有的话跳到该好友对话。没有的话 272 | // 添加该好友的对话 并置顶 273 | send(state) { 274 | let result = state.friendlist.find(friend => friend.id === state.selectFriendId) 275 | let msg = state.chatlist.find(msg => msg.user.name === result.remark) 276 | if (!msg) { 277 | state.selectId = 1 278 | for (let i = 0; i < state.chatlist.length; i++) { 279 | state.chatlist[i].id++; 280 | state.chatlist[i].index++; 281 | } 282 | state.chatlist.unshift({ 283 | id: 1, 284 | user: { 285 | name: result.remark, 286 | img: result.img 287 | }, 288 | messages: [ 289 | { 290 | content: '已经置顶聊天,可以给我发信息啦!', 291 | date: new Date() 292 | } 293 | ], 294 | index: 1 295 | }) 296 | } else { 297 | state.selectId = msg.index 298 | router.push({ path: '/chat' }) 299 | } 300 | } 301 | } 302 | const getters = { 303 | // 筛选出含有搜索值的聊天列表 304 | searchedChatlist(state) { 305 | let sessions = state.chatlist.filter(sessions => sessions.user.name.includes(state.searchText)); 306 | return sessions 307 | }, 308 | // 筛选出含有搜索值的好友列表 309 | searchedFriendlist(state) { 310 | let friends = state.friendlist.filter(friends => friends.remark.includes(state.searchText)); 311 | return friends 312 | }, 313 | // 通过当前选择是哪个对话匹配相应的对话 314 | selectedChat(state) { 315 | let session = state.chatlist.find(session => session.id === state.selectId); 316 | return session 317 | }, 318 | // 通过当前选择是哪个好友匹配相应的好友 319 | selectedFriend(state) { 320 | let friend = state.friendlist.find(friend => friend.id === state.selectFriendId); 321 | return friend 322 | }, 323 | messages(state) { 324 | let session = state.chatlist.find(session => session.id === state.selectId); 325 | return session.messages 326 | } 327 | } 328 | 329 | const actions = { 330 | search: ({ commit }, value) => { 331 | setTimeout(() => { 332 | commit('search', value) 333 | }, 100) 334 | }, 335 | selectSession: ({ commit }, value) => commit('selectSession', value), 336 | selectFriend: ({ commit }, value) => commit('selectFriend', value), 337 | sendMessage: ({ commit }, msg) => commit('sendMessage', msg), 338 | send: ({ commit }) => commit('send'), 339 | initData: ({ commit }) => commit('initData'), 340 | m_show: ({ commit }, value) => commit('m_show', value) 341 | } 342 | const store = new Vuex.Store({ 343 | state, 344 | mutations, 345 | getters, 346 | actions 347 | }) 348 | 349 | // 监听聊天列表的值, 发生变化就保存在localStorage中 350 | store.watch( 351 | (state) => state.chatlist, 352 | (val) => { 353 | localStorage.setItem('vue-chat', JSON.stringify(val)); 354 | }, 355 | { 356 | deep: true 357 | } 358 | ) 359 | export default store; 360 | --------------------------------------------------------------------------------