├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── README.md ├── babel.config.js ├── deploy.sh ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── index.html ├── register.html └── static │ ├── css │ ├── base.css │ └── reset.css │ ├── 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 │ ├── close.png │ ├── edit.png │ ├── file.png │ ├── group.png │ ├── icon │ │ ├── add.svg │ │ ├── more.svg │ │ └── 三.svg │ ├── newfriend.jpg │ ├── select.png │ └── vue.jpg │ └── mp3 │ └── newMsg.mp3 ├── src ├── App.vue ├── assets │ ├── fonts │ │ ├── iconfont.css │ │ ├── iconfont.eot │ │ ├── iconfont.js │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ ├── icons │ │ ├── iconfont.css │ │ ├── iconfont.js │ │ ├── iconfont.json │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ └── iconfont.woff2 │ └── logo.png ├── components │ ├── chatlist │ │ ├── ChatList.vue │ │ ├── CreateGroupChat.vue │ │ ├── FriendChatInfo.vue │ │ └── GroupChatInfo.vue │ ├── friendlist │ │ └── FriendList.vue │ ├── info │ │ ├── FriendInfo.vue │ │ ├── GroupInfo.vue │ │ ├── Info.vue │ │ ├── NewFriendInfo.vue │ │ ├── man.png │ │ └── woman.png │ ├── message │ │ ├── FriendMessage.vue │ │ ├── GroupMessage.vue │ │ ├── MessageChat.vue │ │ └── more.svg │ ├── mycard │ │ └── MyCard.vue │ ├── other │ │ ├── Badge.vue │ │ ├── Switch.vue │ │ ├── confirm │ │ │ ├── CusConfirm.vue │ │ │ └── index.js │ │ ├── input │ │ │ ├── CheckBox.vue │ │ │ └── RoundCheckBox.vue │ │ ├── loading │ │ │ ├── Loading.vue │ │ │ └── PopupLoading.vue │ │ ├── menu │ │ │ ├── CMenu.vue │ │ │ └── HeadMenu.vue │ │ └── message │ │ │ ├── Message.vue │ │ │ └── index.js │ ├── search │ │ ├── Search.vue │ │ ├── SearchList.vue │ │ └── delete.png │ └── text │ │ └── Text.vue ├── config │ └── index.js ├── libs │ ├── directive │ │ └── index.js │ ├── notification.js │ ├── tools.js │ └── util.js ├── main.js ├── page │ ├── chat │ │ └── Chat.vue │ ├── friend │ │ └── Friend.vue │ ├── game │ │ └── Game.vue │ ├── login │ │ ├── Login.vue │ │ ├── account-choice.svg │ │ ├── account.svg │ │ ├── password-choice.svg │ │ └── password.svg │ └── wechat │ │ ├── Wechat.vue │ │ └── init.js ├── router │ ├── index.js │ └── routers.js └── store │ ├── index.js │ └── modules │ ├── chat.js │ ├── friend.js │ ├── groupchat.js │ ├── system.js │ └── user.js └── vue.config.js /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | }, 6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], 7 | parserOptions: { 8 | parser: "babel-eslint", 9 | }, 10 | rules: { 11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", 12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 一个模仿PC微信客户端的纯前端vue项目 2 | 3 | > 项目地址 4 | github: https://github.com/TomHusky/vue-wechat-demo 5 | gitee: https://gitee.com/luowenjie98/vue-wechat-demo 6 | 7 | 8 | 9 | ****在线demo:**** https://tomhusky.github.io/vue-wechat-demo/ 10 | 11 | 12 | 目前已经完成的功能点有 13 | 14 | - 登录 15 | - 页面拖拽移动 16 | - 好友聊天 17 | - 群聊 18 | - 消息通知提醒,免打扰,不显示聊天框 19 | - 表情消息,图片消息,文件消息 20 | - 通讯录 21 | - 加好友,创建群聊 22 | - 好友头像查看信息 23 | 24 | #### 登录页面 25 | 26 |  27 | 28 | #### 主页面 29 |  30 | 31 | 32 | #### 好友侧边栏 33 |  34 | 35 | #### 群聊侧边栏 36 |  37 | 38 | #### 表情 文件 图片 消息 39 |  40 | 41 | #### 图片放大预览 42 |  43 | 44 | #### 通讯录 45 |  46 | 47 | #### 信息弹出框 48 |  49 | 50 | ### 聊天列表右击菜单 51 |  52 | 53 | 54 | 55 | 56 | 57 | 58 | ## 项目启动 59 | 60 | 61 | ### 安装依赖 62 | ``` 63 | npm install 64 | ``` 65 | 66 | ### 启动服务 67 | ``` 68 | npm run serve 69 | ``` 70 | 71 | ### 构建输出 72 | ``` 73 | npm run build 74 | ``` 75 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"], 3 | }; 4 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 当发生错误时中止脚本 4 | set -e 5 | 6 | # 构建 7 | npm run build 8 | 9 | # cd 到构建输出的目录下 10 | cd dist 11 | 12 | # 部署到自定义域域名 13 | # echo 'www.example.com' > CNAME 14 | 15 | git init 16 | git add -A 17 | git commit -m 'deploy' 18 | 19 | # 部署到 https://.github.io 20 | # git push -f git@github.com:/.github.io.git master 21 | 22 | # 部署到 https://.github.io/ 23 | git push -f git@github.com:TomHusky/vue-wechat-demo.git master:gh-pages 24 | 25 | cd - -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-chat", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.6.5", 12 | "crypto-js": "^4.1.1", 13 | "identicon.js": "^2.3.3", 14 | "stylus": "^0.54.5", 15 | "stylus-loader": "^3.0.1", 16 | "vue": "^2.6.11", 17 | "vue-router": "^3.2.0", 18 | "vuex": "^3.4.0" 19 | }, 20 | "devDependencies": { 21 | "@vue/cli-plugin-babel": "^4.5.0", 22 | "@vue/cli-plugin-eslint": "^4.5.0", 23 | "@vue/cli-service": "^4.5.0", 24 | "@vue/eslint-config-prettier": "^6.0.0", 25 | "babel-eslint": "^10.1.0", 26 | "eslint": "^6.7.2", 27 | "eslint-plugin-prettier": "^3.3.1", 28 | "eslint-plugin-vue": "^6.2.2", 29 | "prettier": "^2.2.1", 30 | "terser-webpack-plugin": "^5.2.4", 31 | "vue-template-compiler": "^2.6.11", 32 | "webpack": "^4.23.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | wechat 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /public/static/css/base.css: -------------------------------------------------------------------------------- 1 | .division{ 2 | border-top: 1px solid #ECECEC; 3 | } -------------------------------------------------------------------------------- /public/static/css/reset.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | div, 4 | span, 5 | applet, 6 | object, 7 | iframe, 8 | h1, 9 | h2, 10 | h3, 11 | h4, 12 | h5, 13 | h6, 14 | p, 15 | blockquote, 16 | pre, 17 | a, 18 | abbr, 19 | acronym, 20 | address, 21 | big, 22 | cite, 23 | code, 24 | del, 25 | dfn, 26 | em, 27 | img, 28 | ins, 29 | kbd, 30 | q, 31 | s, 32 | samp, 33 | small, 34 | strike, 35 | strong, 36 | sub, 37 | sup, 38 | tt, 39 | var, 40 | b, 41 | u, 42 | i, 43 | center, 44 | dl, 45 | dt, 46 | dd, 47 | ol, 48 | ul, 49 | li, 50 | fieldset, 51 | form, 52 | label, 53 | legend, 54 | table, 55 | caption, 56 | tbody, 57 | tfoot, 58 | thead, 59 | tr, 60 | th, 61 | td, 62 | article, 63 | aside, 64 | canvas, 65 | details, 66 | embed, 67 | figure, 68 | figcaption, 69 | footer, 70 | header, 71 | menu, 72 | nav, 73 | output, 74 | ruby, 75 | section, 76 | summary, 77 | time, 78 | mark, 79 | audio, 80 | video, 81 | input { 82 | margin: 0; 83 | padding: 0; 84 | border: 0; 85 | font-size: 100%; 86 | font-weight: normal; 87 | vertical-align: baseline; 88 | } 89 | 90 | article, 91 | aside, 92 | details, 93 | figcaption, 94 | figure, 95 | footer, 96 | header, 97 | menu, 98 | nav, 99 | section { 100 | display: block; 101 | } 102 | 103 | body { 104 | line-height: 1; 105 | } 106 | 107 | blockquote, 108 | q { 109 | quotes: none; 110 | } 111 | 112 | blockquote:before, 113 | blockquote:after, 114 | q:before, 115 | q:after { 116 | content: none; 117 | } 118 | 119 | table { 120 | border-collapse: collapse; 121 | border-spacing: 0; 122 | } 123 | 124 | a { 125 | color: #7e8c8d; 126 | text-decoration: none; 127 | -webkit-backface-visibility: hidden; 128 | } 129 | 130 | li { 131 | list-style: none; 132 | } 133 | 134 | 135 | html, 136 | body { 137 | width: 100%; 138 | height: 100%; 139 | overflow-y: hidden; 140 | } 141 | 142 | body { 143 | -webkit-text-size-adjust: none; 144 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 145 | background-image: url(../images/bg.png); 146 | background-size: cover; 147 | } 148 | 149 | /* 设置滚动条的样式 */ 150 | ::-webkit-scrollbar { 151 | width: 6px; 152 | } 153 | 154 | /* 滚动条滑块 */ 155 | ::-webkit-scrollbar-thumb { 156 | border-radius: 6px; 157 | background: #D2D2D2; 158 | } 159 | 160 | 161 | button { 162 | margin: 0; 163 | background-color: transparent; 164 | border: 0px solid transparent; 165 | outline: none; 166 | } -------------------------------------------------------------------------------- /public/static/emoji/100.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/100.gif -------------------------------------------------------------------------------- /public/static/emoji/101.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/101.gif -------------------------------------------------------------------------------- /public/static/emoji/102.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/102.gif -------------------------------------------------------------------------------- /public/static/emoji/103.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/103.gif -------------------------------------------------------------------------------- /public/static/emoji/104.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/104.gif -------------------------------------------------------------------------------- /public/static/emoji/105.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/105.gif -------------------------------------------------------------------------------- /public/static/emoji/106.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/106.gif -------------------------------------------------------------------------------- /public/static/emoji/107.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/107.gif -------------------------------------------------------------------------------- /public/static/emoji/108.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/108.gif -------------------------------------------------------------------------------- /public/static/emoji/109.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/109.gif -------------------------------------------------------------------------------- /public/static/emoji/110.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/110.gif -------------------------------------------------------------------------------- /public/static/emoji/111.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/111.gif -------------------------------------------------------------------------------- /public/static/emoji/112.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/112.gif -------------------------------------------------------------------------------- /public/static/emoji/113.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/113.gif -------------------------------------------------------------------------------- /public/static/emoji/114.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/114.gif -------------------------------------------------------------------------------- /public/static/emoji/115.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/115.gif -------------------------------------------------------------------------------- /public/static/emoji/116.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/116.gif -------------------------------------------------------------------------------- /public/static/emoji/117.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/117.gif -------------------------------------------------------------------------------- /public/static/emoji/118.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/118.gif -------------------------------------------------------------------------------- /public/static/emoji/119.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/119.gif -------------------------------------------------------------------------------- /public/static/emoji/120.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/120.gif -------------------------------------------------------------------------------- /public/static/emoji/121.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/121.gif -------------------------------------------------------------------------------- /public/static/emoji/122.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/122.gif -------------------------------------------------------------------------------- /public/static/emoji/123.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/123.gif -------------------------------------------------------------------------------- /public/static/emoji/124.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/124.gif -------------------------------------------------------------------------------- /public/static/emoji/125.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/125.gif -------------------------------------------------------------------------------- /public/static/emoji/126.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/126.gif -------------------------------------------------------------------------------- /public/static/emoji/127.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/127.gif -------------------------------------------------------------------------------- /public/static/emoji/128.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/128.gif -------------------------------------------------------------------------------- /public/static/emoji/129.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/129.gif -------------------------------------------------------------------------------- /public/static/emoji/130.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/130.gif -------------------------------------------------------------------------------- /public/static/emoji/131.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/131.gif -------------------------------------------------------------------------------- /public/static/emoji/132.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/132.gif -------------------------------------------------------------------------------- /public/static/emoji/133.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/133.gif -------------------------------------------------------------------------------- /public/static/emoji/134.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/134.gif -------------------------------------------------------------------------------- /public/static/emoji/135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/135.gif -------------------------------------------------------------------------------- /public/static/emoji/136.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/136.gif -------------------------------------------------------------------------------- /public/static/emoji/137.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/137.gif -------------------------------------------------------------------------------- /public/static/emoji/138.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/138.gif -------------------------------------------------------------------------------- /public/static/emoji/139.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/139.gif -------------------------------------------------------------------------------- /public/static/emoji/140.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/140.gif -------------------------------------------------------------------------------- /public/static/emoji/141.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/141.gif -------------------------------------------------------------------------------- /public/static/emoji/142.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/142.gif -------------------------------------------------------------------------------- /public/static/emoji/143.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/143.gif -------------------------------------------------------------------------------- /public/static/emoji/144.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/144.gif -------------------------------------------------------------------------------- /public/static/emoji/145.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/145.gif -------------------------------------------------------------------------------- /public/static/emoji/146.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/146.gif -------------------------------------------------------------------------------- /public/static/emoji/147.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/147.gif -------------------------------------------------------------------------------- /public/static/emoji/148.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/148.gif -------------------------------------------------------------------------------- /public/static/emoji/149.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/149.gif -------------------------------------------------------------------------------- /public/static/emoji/150.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/150.gif -------------------------------------------------------------------------------- /public/static/emoji/151.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/151.gif -------------------------------------------------------------------------------- /public/static/emoji/152.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/152.gif -------------------------------------------------------------------------------- /public/static/emoji/153.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/153.gif -------------------------------------------------------------------------------- /public/static/emoji/154.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/154.gif -------------------------------------------------------------------------------- /public/static/emoji/155.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/155.gif -------------------------------------------------------------------------------- /public/static/emoji/156.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/156.gif -------------------------------------------------------------------------------- /public/static/emoji/157.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/157.gif -------------------------------------------------------------------------------- /public/static/emoji/158.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/158.gif -------------------------------------------------------------------------------- /public/static/emoji/159.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/159.gif -------------------------------------------------------------------------------- /public/static/emoji/160.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/160.gif -------------------------------------------------------------------------------- /public/static/emoji/161.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/161.gif -------------------------------------------------------------------------------- /public/static/emoji/162.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/162.gif -------------------------------------------------------------------------------- /public/static/emoji/163.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/163.gif -------------------------------------------------------------------------------- /public/static/emoji/164.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/164.gif -------------------------------------------------------------------------------- /public/static/emoji/165.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/165.gif -------------------------------------------------------------------------------- /public/static/emoji/166.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/166.gif -------------------------------------------------------------------------------- /public/static/emoji/167.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/167.gif -------------------------------------------------------------------------------- /public/static/emoji/168.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/168.gif -------------------------------------------------------------------------------- /public/static/emoji/169.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/169.gif -------------------------------------------------------------------------------- /public/static/emoji/170.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/170.gif -------------------------------------------------------------------------------- /public/static/emoji/171.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/171.gif -------------------------------------------------------------------------------- /public/static/emoji/172.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/172.gif -------------------------------------------------------------------------------- /public/static/emoji/173.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/173.gif -------------------------------------------------------------------------------- /public/static/emoji/174.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/174.gif -------------------------------------------------------------------------------- /public/static/emoji/175.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/175.gif -------------------------------------------------------------------------------- /public/static/emoji/176.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/176.gif -------------------------------------------------------------------------------- /public/static/emoji/177.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/177.gif -------------------------------------------------------------------------------- /public/static/emoji/178.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/178.gif -------------------------------------------------------------------------------- /public/static/emoji/179.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/179.gif -------------------------------------------------------------------------------- /public/static/emoji/180.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/180.gif -------------------------------------------------------------------------------- /public/static/emoji/181.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/181.gif -------------------------------------------------------------------------------- /public/static/emoji/182.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/182.gif -------------------------------------------------------------------------------- /public/static/emoji/183.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/183.gif -------------------------------------------------------------------------------- /public/static/emoji/184.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/184.gif -------------------------------------------------------------------------------- /public/static/emoji/185.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/185.gif -------------------------------------------------------------------------------- /public/static/emoji/186.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/186.gif -------------------------------------------------------------------------------- /public/static/emoji/187.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/187.gif -------------------------------------------------------------------------------- /public/static/emoji/188.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/188.gif -------------------------------------------------------------------------------- /public/static/emoji/189.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/189.gif -------------------------------------------------------------------------------- /public/static/emoji/190.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/190.gif -------------------------------------------------------------------------------- /public/static/emoji/191.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/191.gif -------------------------------------------------------------------------------- /public/static/emoji/192.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/192.gif -------------------------------------------------------------------------------- /public/static/emoji/193.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/193.gif -------------------------------------------------------------------------------- /public/static/emoji/194.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/194.gif -------------------------------------------------------------------------------- /public/static/emoji/195.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/195.gif -------------------------------------------------------------------------------- /public/static/emoji/196.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/196.gif -------------------------------------------------------------------------------- /public/static/emoji/197.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/197.gif -------------------------------------------------------------------------------- /public/static/emoji/198.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/198.gif -------------------------------------------------------------------------------- /public/static/emoji/199.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/199.gif -------------------------------------------------------------------------------- /public/static/emoji/meinv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/meinv.png -------------------------------------------------------------------------------- /public/static/emoji/shangxin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/shangxin.png -------------------------------------------------------------------------------- /public/static/emoji/weixiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/emoji/weixiao.png -------------------------------------------------------------------------------- /public/static/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/bg.png -------------------------------------------------------------------------------- /public/static/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/close.png -------------------------------------------------------------------------------- /public/static/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/edit.png -------------------------------------------------------------------------------- /public/static/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/file.png -------------------------------------------------------------------------------- /public/static/images/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/group.png -------------------------------------------------------------------------------- /public/static/images/icon/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/static/images/icon/more.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/static/images/icon/三.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/static/images/newfriend.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/newfriend.jpg -------------------------------------------------------------------------------- /public/static/images/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/select.png -------------------------------------------------------------------------------- /public/static/images/vue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/images/vue.jpg -------------------------------------------------------------------------------- /public/static/mp3/newMsg.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/public/static/mp3/newMsg.mp3 -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 94 | 137 | 138 | -------------------------------------------------------------------------------- /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-mute:before { content: "\e657"; } 21 | 22 | .icon-collection:before { content: "\e608"; } 23 | 24 | .icon-friend:before { content: "\e603"; } 25 | 26 | .icon-msg:before { content: "\e60a"; } 27 | 28 | .icon-look:before { content: "\e639"; } 29 | 30 | -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/assets/fonts/iconfont.eot -------------------------------------------------------------------------------- /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/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/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/assets/fonts/iconfont.woff -------------------------------------------------------------------------------- /src/assets/icons/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; /* Project id 2790053 */ 3 | src: url('iconfont.woff2?t=1637130830910') format('woff2'), 4 | url('iconfont.woff?t=1637130830910') format('woff'), 5 | url('iconfont.ttf?t=1637130830910') format('truetype'); 6 | } 7 | 8 | .iconfont { 9 | font-family: "iconfont" !important; 10 | font-size: 16px; 11 | font-style: normal; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | .icon-edit:before { 17 | content: "\e514"; 18 | } 19 | 20 | .icon-warn:before { 21 | content: "\e513"; 22 | } 23 | 24 | .icon-file:before { 25 | content: "\e512"; 26 | } 27 | 28 | .icon-img:before { 29 | content: "\e510"; 30 | } 31 | 32 | .icon-emoji:before { 33 | content: "\e511"; 34 | } 35 | 36 | .icon-add:before { 37 | content: "\e509"; 38 | } 39 | 40 | .icon-window-max:before { 41 | content: "\e501"; 42 | } 43 | 44 | .icon-window-ding:before { 45 | content: "\e502"; 46 | } 47 | 48 | .icon-window-min:before { 49 | content: "\e503"; 50 | } 51 | 52 | .icon-close:before { 53 | content: "\e504"; 54 | } 55 | 56 | .icon-account:before { 57 | content: "\e505"; 58 | } 59 | 60 | .icon-password:before { 61 | content: "\e506"; 62 | } 63 | 64 | .icon-san:before { 65 | content: "\e507"; 66 | } 67 | 68 | .icon-more:before { 69 | content: "\e508"; 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/assets/icons/iconfont.js: -------------------------------------------------------------------------------- 1 | !function(c){var t,e,o,i,l,n='',a=(a=document.getElementsByTagName("script"))[a.length-1].getAttribute("data-injectcss"),d=function(c,t){t.parentNode.insertBefore(c,t)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function h(){l||(l=!0,o())}function s(){try{i.documentElement.doScroll("left")}catch(c){return void setTimeout(s,50)}h()}t=function(){var c,t;(t=document.createElement("div")).innerHTML=n,n=null,(c=t.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",t=c,(c=document.body).firstChild?d(t,c.firstChild):c.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(e=function(){document.removeEventListener("DOMContentLoaded",e,!1),t()},document.addEventListener("DOMContentLoaded",e,!1)):document.attachEvent&&(o=t,i=c.document,l=!1,s(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,h())})}(window); -------------------------------------------------------------------------------- /src/assets/icons/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "2790053", 3 | "name": "vuechat", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "25777244", 10 | "name": "edit", 11 | "font_class": "edit", 12 | "unicode": "e514", 13 | "unicode_decimal": 58644 14 | }, 15 | { 16 | "icon_id": "25458489", 17 | "name": "warn", 18 | "font_class": "warn", 19 | "unicode": "e513", 20 | "unicode_decimal": 58643 21 | }, 22 | { 23 | "icon_id": "25182025", 24 | "name": "file", 25 | "font_class": "file", 26 | "unicode": "e512", 27 | "unicode_decimal": 58642 28 | }, 29 | { 30 | "icon_id": "25080143", 31 | "name": "img", 32 | "font_class": "img", 33 | "unicode": "e510", 34 | "unicode_decimal": 58640 35 | }, 36 | { 37 | "icon_id": "25080144", 38 | "name": "emoji", 39 | "font_class": "emoji", 40 | "unicode": "e511", 41 | "unicode_decimal": 58641 42 | }, 43 | { 44 | "icon_id": "24909999", 45 | "name": "add", 46 | "font_class": "add", 47 | "unicode": "e509", 48 | "unicode_decimal": 58633 49 | }, 50 | { 51 | "icon_id": "24715226", 52 | "name": "max", 53 | "font_class": "window-max", 54 | "unicode": "e501", 55 | "unicode_decimal": 58625 56 | }, 57 | { 58 | "icon_id": "24715227", 59 | "name": "ding", 60 | "font_class": "window-ding", 61 | "unicode": "e502", 62 | "unicode_decimal": 58626 63 | }, 64 | { 65 | "icon_id": "24715228", 66 | "name": "min", 67 | "font_class": "window-min", 68 | "unicode": "e503", 69 | "unicode_decimal": 58627 70 | }, 71 | { 72 | "icon_id": "24710152", 73 | "name": "close", 74 | "font_class": "close", 75 | "unicode": "e504", 76 | "unicode_decimal": 58628 77 | }, 78 | { 79 | "icon_id": "24462922", 80 | "name": "account", 81 | "font_class": "account", 82 | "unicode": "e505", 83 | "unicode_decimal": 58629 84 | }, 85 | { 86 | "icon_id": "24462928", 87 | "name": "password", 88 | "font_class": "password", 89 | "unicode": "e506", 90 | "unicode_decimal": 58630 91 | }, 92 | { 93 | "icon_id": "24106461", 94 | "name": "三", 95 | "font_class": "san", 96 | "unicode": "e507", 97 | "unicode_decimal": 58631 98 | }, 99 | { 100 | "icon_id": "24106460", 101 | "name": "more", 102 | "font_class": "more", 103 | "unicode": "e508", 104 | "unicode_decimal": 58632 105 | } 106 | ] 107 | } 108 | -------------------------------------------------------------------------------- /src/assets/icons/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/assets/icons/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/icons/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/assets/icons/iconfont.woff -------------------------------------------------------------------------------- /src/assets/icons/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/assets/icons/iconfont.woff2 -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/chatlist/ChatList.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 24 | 32 | 33 | 34 | 35 | {{ 36 | item.info.remark === null || item.info.remark === "" 37 | ? item.info.nickname 38 | : item.info.remark 39 | }} 40 | 41 | 42 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 置顶 60 | 61 | 标记为未读 62 | 63 | 64 | 标记为已读 65 | 66 | 67 | 消息免打扰 68 | 69 | 70 | 开启新消息提醒 71 | 72 | 不显示聊天 73 | 删除聊天 74 | 75 | 76 | 77 | 78 | 79 | 80 | 218 | 219 | 283 | -------------------------------------------------------------------------------- /src/components/chatlist/FriendChatInfo.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 添加 10 | 11 | 12 | 20 | 21 | {{ selectedChatFriend.nickname }} 22 | 23 | 24 | {{ selectedChatFriend.remark }} 25 | 26 | 27 | 28 | 29 | 30 | 31 | 消息免打扰 32 | 33 | 39 | 40 | 41 | 42 | 置顶聊天 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 128 | 129 | -------------------------------------------------------------------------------- /src/components/friendlist/FriendList.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ newfriend.initial }} 8 | 9 | 14 | 15 | 22 | 29 | 30 | 31 | {{ newfriend.remark }} 32 | 33 | 34 | 35 | 36 | {{ groupChat.initial }} 37 | 38 | 43 | 44 | {{ groupChat.remark }} 45 | 46 | 47 | 53 | {{ item.initial }} 54 | 59 | 60 | {{ item.remark }} 61 | 62 | 63 | 64 | 65 | 66 | 67 | 91 | 92 | 142 | -------------------------------------------------------------------------------- /src/components/info/FriendInfo.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ selectedFriend.nickname }} 10 | 15 | 16 | {{ selectedFriend.signature }} 17 | 18 | 19 | 25 | 26 | 27 | 28 | 29 | 备 注{{ selectedFriend.remark }} 30 | 31 | 35 | 地 区{{ selectedFriend.area }} 36 | 37 | 38 | 来 源{{ selectedFriend.origin }} 39 | 40 | 微信号{{ selectedFriend.wxid }} 41 | 42 | 43 | 发消息 44 | 45 | 46 | 47 | 48 | 49 | 97 | 98 | 198 | 199 | -------------------------------------------------------------------------------- /src/components/info/GroupInfo.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 全部群聊 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 添加 26 | 27 | 33 | 40 | 41 | {{ item.groupName }} 42 | 43 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | 107 | 108 | 178 | 179 | -------------------------------------------------------------------------------- /src/components/info/Info.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/components/info/NewFriendInfo.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ selectedFriend.nickname }} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | {{ item.nickname }} 25 | 26 | 27 | 已添加 28 | 已拒绝 31 | 36 | 拒绝 37 | 38 | 43 | 同意 44 | 45 | 46 | {{ item.info }} 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 92 | 93 | 186 | 187 | -------------------------------------------------------------------------------- /src/components/info/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/components/info/man.png -------------------------------------------------------------------------------- /src/components/info/woman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/components/info/woman.png -------------------------------------------------------------------------------- /src/components/message/MessageChat.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 | 33 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /src/components/message/more.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/mycard/MyCard.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 30 | 31 | 35 | 36 | 39 | 40 | 41 | 42 | 77 | 78 | 138 | -------------------------------------------------------------------------------- /src/components/other/Badge.vue: -------------------------------------------------------------------------------- 1 | 2 | 12 | 21 | {{ getShowNum }} 23 | 24 | 25 | 26 | 83 | 84 | -------------------------------------------------------------------------------- /src/components/other/Switch.vue: -------------------------------------------------------------------------------- 1 | 2 | 6 | 12 | 21 | 22 | 23 | 24 | 46 | 47 | -------------------------------------------------------------------------------- /src/components/other/confirm/CusConfirm.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | {{ title }} 18 | 19 | 20 | 21 | 22 | 29 | 确认 30 | 31 | 取消 32 | 33 | 34 | 35 | 36 | 37 | 82 | 83 | 205 | -------------------------------------------------------------------------------- /src/components/other/confirm/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import CusConfirm from './CusConfirm.vue' 3 | 4 | const Confirm = Vue.extend(CusConfirm) 5 | 6 | CusConfirm.install = function (data) { 7 | /** 8 | * options的其他情况自行判断添加默认值等等 9 | */ 10 | if (data === undefined || data === null) { 11 | data = { 12 | title: '确认' 13 | } 14 | } else if (typeof options === 'string' || typeof options === 'number') { 15 | options = { 16 | title: options 17 | } 18 | } 19 | 20 | let instance = new Confirm({ 21 | data 22 | }).$mount() 23 | 24 | document.body.appendChild(instance.$el) 25 | 26 | Vue.nextTick(() => { 27 | instance.flag = true //记得这里是控制弹窗显隐的状态,一定要同自定义组件里边 v-if 后面的值相同 28 | }) 29 | } 30 | 31 | export default CusConfirm 32 | -------------------------------------------------------------------------------- /src/components/other/input/CheckBox.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | {{ label }} 15 | 16 | 17 | 18 | 53 | 54 | -------------------------------------------------------------------------------- /src/components/other/input/RoundCheckBox.vue: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 43 | 44 | -------------------------------------------------------------------------------- /src/components/other/loading/Loading.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | Loading... 9 | 10 | 11 | 12 | 13 | 58 | 59 | -------------------------------------------------------------------------------- /src/components/other/loading/PopupLoading.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Loading... 5 | 6 | 7 | 8 | 9 | 54 | 55 | -------------------------------------------------------------------------------- /src/components/other/menu/CMenu.vue: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 59 | 60 | -------------------------------------------------------------------------------- /src/components/other/message/Message.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ content }} 7 | 12 | 13 | 14 | 15 | 16 | 17 | 41 | -------------------------------------------------------------------------------- /src/components/other/message/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Message from './Message.vue' 3 | 4 | const messageBox = Vue.extend(Message) 5 | 6 | Message.install = function (options, type) { 7 | if (options === undefined || options === null) { 8 | options = { 9 | content: '' 10 | } 11 | } else if (typeof options === 'string' || typeof options === 'number') { 12 | options = { 13 | content: options 14 | } 15 | if (type != undefined && options != null) { 16 | options.type = type; 17 | } 18 | } 19 | 20 | let instance = new messageBox({ 21 | data: options 22 | }).$mount() 23 | 24 | document.body.appendChild(instance.$el) 25 | 26 | Vue.nextTick(() => { 27 | instance.visible = true 28 | }) 29 | } 30 | 31 | export default Message -------------------------------------------------------------------------------- /src/components/search/Search.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 18 | 23 | 24 | 搜索 25 | 26 | 27 | 28 | 84 | 85 | 155 | -------------------------------------------------------------------------------- /src/components/search/SearchList.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 74 | 75 | 150 | -------------------------------------------------------------------------------- /src/components/search/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomHusky/vue-wechat-demo/8946fa020321f31839e7a95008615326550e71cf/src/components/search/delete.png -------------------------------------------------------------------------------- /src/config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | useI18n: false, 3 | publicPath: { 4 | // 本地环境发布目录 5 | dev: '/', 6 | // 生产环境发布目录 7 | pro: '/vue-wechat-demo/' 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /src/libs/directive/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | drag(el, data, vnode) { 3 | let that = vnode.context 4 | let odiv = el; //获取当前元素 5 | let moveDataelse = { 6 | appOffsetLeft: null, 7 | appOffsetTop: null, 8 | x: null, 9 | y: null 10 | } 11 | odiv.onmousedown = (event) => { 12 | let app = document.getElementById("wechat"); 13 | moveDataelse.x = event.pageX; 14 | moveDataelse.y = event.pageY; 15 | moveDataelse.appOffsetLeft = app.offsetLeft; 16 | moveDataelse.appOffsetTop = app.offsetTop; 17 | document.onmousemove = (event) => { 18 | let moveLeft = event.pageX - moveDataelse.x; 19 | let moveTop = event.pageY - moveDataelse.y; 20 | let resultLeft = moveDataelse.appOffsetLeft + moveLeft; 21 | let resultTop = moveDataelse.appOffsetTop + moveTop; 22 | if (resultLeft >= 5 && resultLeft <= that.$store.state.system.windowWidth - app.offsetWidth -5) { 23 | app.style.left = resultLeft + "px"; 24 | } 25 | if (resultTop >= 5 && resultTop <= that.$store.state.system.windowHeight - app.offsetHeight -5) { 26 | app.style.top = resultTop + "px"; 27 | } 28 | }; 29 | document.onmouseup = (event) => { 30 | document.onmousemove = null; 31 | document.onmouseup = null; 32 | moveDataelse.x = null; 33 | moveDataelse.y = null; 34 | moveDataelse.appOffsetLeft = null; 35 | moveDataelse.appOffsetTop = null; 36 | }; 37 | } 38 | }, 39 | } 40 | -------------------------------------------------------------------------------- /src/libs/notification.js: -------------------------------------------------------------------------------- 1 | export const sendNotifi = (that, msg,type) => { 2 | if (!document.hidden) { 3 | return; 4 | } 5 | let options = { 6 | body: msg.msgContent, 7 | silent: false, 8 | icon: msg.avatar, 9 | sound:'/static/mp3/newMsg.mp3' 10 | } 11 | 12 | let notification = new Notification(msg.remark, options); 13 | notification.onclick = function () { 14 | // window.open(`页面链接`, '_blank'); 15 | //可直接打开通知notification相关联的tab窗口 16 | window.focus(); 17 | notify.close(); 18 | } 19 | //标题栏闪动 20 | // let defaultTitle = document.title; 21 | // that.timer = setInterval(function () { 22 | // let title = document.title; 23 | // if (document.hidden) { 24 | // if (/你有新消息/.test(title) == false) { 25 | // document.title = '【你有新消息】'; 26 | // } else { 27 | // document.title = defaultTitle; 28 | // } 29 | // } else { 30 | // document.title = defaultTitle; 31 | // } 32 | // }, 500); 33 | } -------------------------------------------------------------------------------- /src/libs/util.js: -------------------------------------------------------------------------------- 1 | export const TOKEN_KEY = 'token' 2 | 3 | export const removeToken = () => { 4 | localStorage.removeItem(TOKEN_KEY); 5 | } 6 | 7 | export const setToken = (token, auto) => { 8 | if (auto) { 9 | localStorage.setItem(TOKEN_KEY, token) 10 | } else { 11 | localStorage.setItem(TOKEN_KEY, token) 12 | } 13 | } 14 | 15 | export const getToken = () => { 16 | const token = localStorage.getItem(TOKEN_KEY) 17 | if (token && token !== 'undefined') { 18 | return token 19 | } else { 20 | return false 21 | } 22 | } 23 | 24 | export const hasChild = (item) => { 25 | return item.children && item.children.length !== 0 26 | } 27 | 28 | /** 29 | * @param {String} url 30 | * @description 从URL中解析参数 31 | */ 32 | export const getParams = url => { 33 | let paramObj = {} 34 | if (url.indexOf('?') != -1) { 35 | const keyValueArr = url.split('?')[1].split('&') 36 | keyValueArr.forEach(item => { 37 | const keyValue = item.split('=') 38 | paramObj[keyValue[0]] = keyValue[1] 39 | }) 40 | } 41 | return paramObj 42 | } 43 | 44 | /** 45 | * @param {Number} times 回调函数需要执行的次数 46 | * @param {Function} callback 回调函数 47 | */ 48 | export const doCustomTimes = (times, callback) => { 49 | let i = -1 50 | while (++i < times) { 51 | callback(i) 52 | } 53 | } 54 | 55 | /** 56 | * @param {Object} file 从上传组件得到的文件对象 57 | * @returns {Promise} resolve参数是解析后的二维数组 58 | * @description 从Csv文件中解析出表格,解析成二维数组 59 | */ 60 | export const getArrayFromFile = (file) => { 61 | let nameSplit = file.name.split('.') 62 | let format = nameSplit[nameSplit.length - 1] 63 | return new Promise((resolve, reject) => { 64 | let reader = new FileReader() 65 | reader.readAsText(file) // 以文本格式读取 66 | let arr = [] 67 | reader.onload = function (evt) { 68 | let data = evt.target.result // 读到的数据 69 | let pasteData = data.trim() 70 | arr = pasteData.split((/[\n\u0085\u2028\u2029]|\r\n?/g)).map(row => { 71 | return row.split('\t') 72 | }).map(item => { 73 | return item[0].split(',') 74 | }) 75 | if (format === 'csv') { 76 | resolve(arr) 77 | } else { 78 | reject(new Error('[Format Error]:你上传的不是Csv文件')) 79 | } 80 | } 81 | }) 82 | } 83 | 84 | /** 85 | * @param {Array} array 表格数据二维数组 86 | * @returns {Object} { columns, tableData } 87 | * @description 从二维数组中获取表头和表格数据,将第一行作为表头,用于在iView的表格中展示数据 88 | */ 89 | export const getTableDataFromArray = (array) => { 90 | let columns = [] 91 | let tableData = [] 92 | if (array.length > 1) { 93 | let titles = array.shift() 94 | columns = titles.map(item => { 95 | return { 96 | title: item, 97 | key: item 98 | } 99 | }) 100 | tableData = array.map(item => { 101 | let res = {} 102 | item.forEach((col, i) => { 103 | res[titles[i]] = col 104 | }) 105 | return res 106 | }) 107 | } 108 | return { 109 | columns, 110 | tableData 111 | } 112 | } 113 | 114 | 115 | // scrollTop animation 116 | export const scrollTop = (el, from = 0, to, duration = 500, endCallback) => { 117 | if (!window.requestAnimationFrame) { 118 | window.requestAnimationFrame = ( 119 | window.webkitRequestAnimationFrame || 120 | window.mozRequestAnimationFrame || 121 | window.msRequestAnimationFrame || 122 | function (callback) { 123 | return window.setTimeout(callback, 1000 / 60) 124 | } 125 | ) 126 | } 127 | const difference = Math.abs(from - to) 128 | const step = Math.ceil(difference / duration * 50) 129 | 130 | const scroll = (start, end, step) => { 131 | if (start === end) { 132 | endCallback && endCallback() 133 | return 134 | } 135 | 136 | let d = (start + step > end) ? end : start + step 137 | if (start > end) { 138 | d = (start - step < end) ? end : start - step 139 | } 140 | 141 | if (el === window) { 142 | window.scrollTo(d, d) 143 | } else { 144 | el.scrollTop = d 145 | } 146 | window.requestAnimationFrame(() => scroll(d, end, step)) 147 | } 148 | scroll(from, to, step) 149 | } 150 | 151 | /** 152 | * 验证url 153 | * @param str_url 154 | * @returns {boolean} 155 | */ 156 | export const isURL = (url) => { 157 | let strRegex = '((https|http|ftp|rtsp|mms)?://)' 158 | let re = new RegExp(strRegex) 159 | return re.test(url) 160 | } 161 | 162 | 163 | export const startWith = (str, prefix) => { 164 | let reg = new RegExp('^' + prefix) 165 | return reg.test(str) 166 | } 167 | 168 | export const endWith = (str, suffix) => { 169 | let reg = new RegExp(suffix + '$') 170 | return reg.test(str) 171 | } 172 | 173 | /** 174 | * 判断终端以及浏览器 175 | * userAgent string User-Agent信息 176 | */ 177 | export const readUserAgent = (ua) => { 178 | let data = { 179 | terminal: '', 180 | browser: '', 181 | terminalType: {} 182 | } 183 | data.terminalType = { 184 | trident: ua.indexOf('Trident') > -1, // IE内核 185 | presto: ua.indexOf('Presto') > -1, // opera内核 186 | webKit: ua.indexOf('AppleWebKit') > -1, // 苹果、谷歌内核 187 | gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') == -1, // 火狐内核 188 | mobile: !!ua.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端 189 | ios: !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端 190 | android: ua.indexOf('Android') > -1 || ua.indexOf('Adr') > -1, // android终端 191 | iPhone: ua.indexOf('iPhone') > -1, // 是否为iPhone或者QQHD浏览器 192 | iPad: ua.indexOf('iPad') > -1, // 是否iPad 193 | webApp: ua.indexOf('Safari') == -1, // 是否web应该程序,没有头部与底部 194 | weixin: ua.indexOf('MicroMessenger') > -1, // 是否微信 (2015-01-22新增) 195 | qq: ua.match(/\sQQ/i) == ' qq' // 是否QQ 196 | } 197 | if (data.terminalType.ios || data.terminalType.iPhone || data.terminalType.iPad) { 198 | data.terminal = '苹果' 199 | } else if (data.terminalType.android) { 200 | data.terminal = '安卓' 201 | } else { 202 | data.terminal = 'PC' 203 | } 204 | if (/msie/i.test(ua) && !/opera/.test(ua)) { 205 | data.browser = 'IE' 206 | } else if (/firefox/i.test(ua)) { 207 | data.browser = 'Firefox' 208 | } else if (/chrome/i.test(ua) && /webkit/i.test(ua) && /mozilla/i.test(ua)) { 209 | data.browser = 'Chrome' 210 | } else if (/opera/i.test(ua)) { 211 | data.browser = 'Opera' 212 | } else if (/iPad/i.test(ua)) { 213 | data.browser = 'iPad' 214 | } else if (/webkit/i.test(ua) && !(/chrome/i.test(ua) && /webkit/i.test(ua) && /mozilla/i.test(ua))) { 215 | data.browser = 'Safari' 216 | } else { 217 | data.browser = '未知' 218 | } 219 | return data 220 | } 221 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | import router from './router' 4 | import config from '@/config' 5 | import store from './store/index.js' 6 | import cdire from './libs/directive/index' 7 | import '@/assets/icons/iconfont.css' 8 | 9 | //自定义全局组件 10 | import CusConfirm from '@/components/other/confirm/CusConfirm' 11 | Vue.prototype.$confirm = CusConfirm.install; 12 | 13 | 14 | import Message from '@/components/other/message' 15 | Vue.prototype.$message = Message.install; 16 | 17 | /** 18 | * @description 全局注册应用配置 19 | */ 20 | Vue.prototype.$config = config 21 | 22 | Vue.config.productionTip = false 23 | 24 | // 拖拽命令 25 | const directive = { 26 | 'drag': cdire.drag, 27 | } 28 | 29 | Object.keys(directive).forEach(key => { 30 | Vue.directive(key, directive[key]) 31 | }) 32 | 33 | 34 | new Vue({ 35 | el: '#app', 36 | router, 37 | store, 38 | render: h => h(App), 39 | }).$mount('#app') 40 | -------------------------------------------------------------------------------- /src/page/chat/Chat.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 70 | 71 | 105 | -------------------------------------------------------------------------------- /src/page/friend/Friend.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | {{ searchUser.nickname }} 35 | 40 | 41 | 49 | 50 | 51 | 52 | 53 | 账   号{{ searchUser.username }} 54 | 55 | 微信号{{ searchUser.wxid }} 56 | 57 | 地   区{{ searchUser.area }} 58 | 59 | 60 | 61 | 62 | 63 | 发送好友申请 64 | 65 | 66 | 67 | 备注名 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 147 | 148 | -------------------------------------------------------------------------------- /src/page/game/Game.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 269 | 270 | -------------------------------------------------------------------------------- /src/page/login/Login.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 登录 14 | 15 | 26 | 27 | 28 | 29 | 117 | 118 | -------------------------------------------------------------------------------- /src/page/login/account-choice.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/page/login/account.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/page/login/password-choice.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/page/login/password.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/page/wechat/Wechat.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 连接失败,请检查你的网络或刷新页面 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 122 | 198 | -------------------------------------------------------------------------------- /src/page/wechat/init.js: -------------------------------------------------------------------------------- 1 | import store from '@/store/index.js' 2 | export function initInfo() { 3 | initFriendList(); 4 | initGroupChatList(); 5 | } 6 | 7 | export function initSystemInfo() { 8 | initSystemIcon(); 9 | } 10 | 11 | function initSystemIcon() { 12 | if (store.state.system.systemFileIcon != null) { 13 | return; 14 | } 15 | // listSystemIcon().then((res) => { 16 | // if (res.code == 0) { 17 | // store.commit("system/setSystemFileIcon", res.data); 18 | // } 19 | // }) 20 | } 21 | 22 | function initFriendList() { 23 | // listFriendInfo() 24 | // .then((res) => { 25 | // if (res.code == 0) { 26 | // store.commit("friend/addFriendList", res.data); 27 | // } 28 | // }).catch(err => { 29 | // console.log(err); 30 | // }) 31 | } 32 | 33 | function initGroupChatList() { 34 | for (let group of store.state.groupchat.groupChatList) { 35 | let user = store.getters["user/getUser"]; 36 | user.groupNickname = user.nickname; 37 | let value = { 38 | groupNo: group.groupNo, 39 | user: user 40 | } 41 | store.commit("groupchat/groupAddUser", value); 42 | } 43 | // listGroupChat() 44 | // .then((res) => { 45 | // if (res.code == 0) { 46 | // store.commit("groupchat/addGroupChatList", res.data); 47 | // } 48 | // }) 49 | } -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import routes from './routers' 4 | import { 5 | getToken 6 | } from '@/libs/util' 7 | import config from '@/config' 8 | 9 | Vue.use(Router) 10 | 11 | let BASE_URL = '' 12 | switch (process.env.NODE_ENV) { 13 | case 'development': 14 | BASE_URL = config.publicPath.dev // 这里是本地的请求url 15 | break 16 | case 'production': 17 | BASE_URL = config.publicPath.pro // 生产环境url 18 | break 19 | } 20 | 21 | const router = new Router({ 22 | routes: routes, 23 | // mode: 'history', 24 | linkActiveClass: 'active', 25 | }) 26 | // router.push({ path: '/' }); 27 | 28 | router.beforeEach((to, from, next) => { 29 | let token = getToken(); 30 | if (to.path == "/login") { 31 | if (token) { 32 | next("/"); 33 | } else { 34 | next(); 35 | } 36 | } else { 37 | if (token) { 38 | if (to.path === '') { 39 | next("/chat"); 40 | } else { 41 | next(); 42 | } 43 | } else { 44 | next("/login"); 45 | } 46 | } 47 | }) 48 | export default router -------------------------------------------------------------------------------- /src/router/routers.js: -------------------------------------------------------------------------------- 1 | export default [{ 2 | path: '/login', 3 | name: 'login', 4 | component: () => import('@/page/login/Login.vue') 5 | }, 6 | { 7 | path: "/", 8 | component: () => import('@/page/wechat/Wechat.vue'), 9 | redirect: '/chat', 10 | children: [{ 11 | path: '/chat', 12 | component: () => import('@/page/chat/Chat.vue') 13 | }, 14 | { 15 | path: '/friend', 16 | component: () => import('@/page/friend/Friend.vue') 17 | }, 18 | { 19 | path: '/game', 20 | component: () => import('@/page/game/Game.vue') 21 | } 22 | ] 23 | }, 24 | ] -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | Vue.use(Vuex) 4 | 5 | // https://webpack.js.org/guides/dependency-management/#requirecontext 6 | const modulesFiles = require.context("./modules", true, /\.js$/); 7 | 8 | // you do not need `import app from './modules/app'` 9 | // it will auto require all vuex module from modules file 10 | const modules = modulesFiles.keys().reduce((modules, modulePath) => { 11 | // set './app.js' => 'app' 12 | const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, "$1"); 13 | const value = modulesFiles(modulePath); 14 | modules[moduleName] = value.default; 15 | return modules; 16 | }, {}); 17 | 18 | const store = new Vuex.Store({ 19 | modules 20 | }); 21 | export default store; 22 | -------------------------------------------------------------------------------- /src/store/modules/friend.js: -------------------------------------------------------------------------------- 1 | const state = { 2 | friendlist: [{ 3 | id: -1, 4 | wxid: "wx001", //微信号 5 | initial: 'A', //姓名首字母 6 | username: "99", 7 | avatar: 'static/images/vue.jpg', //头像 8 | signature: "他什么也没有说", //个性签名 9 | nickname: "机器人", //昵称 10 | sex: 0, //性别 1为男,0为女 11 | remark: "偷懒的机器人", //备注 12 | origin: "官方", 13 | area: "广东广州", //地区 14 | }, 15 | { 16 | "username": "1486842355", 17 | "wxid": "1486842355n7dg", 18 | "nickname": "面白い男", 19 | "email": "1486842355@qq.com", 20 | "phone": null, 21 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160332031-1473597366.jpg", 22 | "sex": 1, 23 | "signature": "", 24 | "remark": "胡裕嵩", 25 | "area": "湖南长沙", 26 | "origin": "扫一扫", 27 | "label": null, 28 | "notDisturb": false, 29 | "initial": "M" 30 | }, 31 | { 32 | "username": "1025431504", 33 | "wxid": "1025431504CtZx", 34 | "nickname": "简单丶爱才美", 35 | "email": "1025431504@qq.com", 36 | "phone": null, 37 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160401526-1461243363.jpg", 38 | "sex": 1, 39 | "signature": "", 40 | "remark": "简单丶爱才美", 41 | "area": null, 42 | "origin": "账号搜索", 43 | "label": null, 44 | "notDisturb": false, 45 | "initial": "J" 46 | }, 47 | { 48 | "username": "1398952749", 49 | "wxid": "1398952749sqK7", 50 | "nickname": "我不听", 51 | "email": "1398952749@qq.com", 52 | "phone": null, 53 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160406881-373503134.jpg", 54 | "sex": 1, 55 | "signature": "闪电五连鞭!", 56 | "remark": "我不听", 57 | "area": null, 58 | "origin": "账号搜索", 59 | "label": null, 60 | "notDisturb": false, 61 | "initial": "W" 62 | }, 63 | { 64 | "username": "1053692173", 65 | "wxid": "1053692173TTGF", 66 | "nickname": "元逍", 67 | "email": "1053692173@qq.com", 68 | "phone": null, 69 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160338342-264344984.jpg", 70 | "sex": 1, 71 | "signature": "", 72 | "remark": "元逍", 73 | "area": null, 74 | "origin": "账号搜索", 75 | "label": null, 76 | "notDisturb": false, 77 | "initial": "Y" 78 | }, 79 | { 80 | "username": "591754925", 81 | "wxid": "591754925KsbG", 82 | "nickname": "呆呆獸", 83 | "email": "591754925@qq.com", 84 | "phone": null, 85 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160411759-1598871399.jpg", 86 | "sex": 1, 87 | "signature": "", 88 | "remark": "呆呆獸", 89 | "area": null, 90 | "origin": "账号搜索", 91 | "label": null, 92 | "notDisturb": false, 93 | "initial": "D" 94 | }, 95 | { 96 | "username": "1653887048", 97 | "wxid": "1653887048KlA7", 98 | "nickname": "清风流水", 99 | "email": "1653887048@qq.com", 100 | "phone": null, 101 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160346563-821241686.jpg", 102 | "sex": 1, 103 | "signature": "", 104 | "remark": "清风流水", 105 | "area": null, 106 | "origin": "账号搜索", 107 | "label": null, 108 | "notDisturb": false, 109 | "initial": "Q" 110 | } 111 | ], 112 | // 好友请求列表 113 | newFriendList: [{ 114 | applyId: "apply_0101", 115 | username: "1737401145", 116 | wxid: "lwj11111", 117 | nickname: "码云", 118 | avatar: "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210929094050713-2085134549.png", 119 | sex: 1, 120 | info: "我是jack码", 121 | status: 0, 122 | userInfo: { 123 | username: "1737401145", 124 | wxid: "lwj11111", 125 | nickname: "码云", 126 | email: "1737401145@qq.com", 127 | phone: null, 128 | avatar: "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210929094050713-2085134549.png", 129 | sex: 1, 130 | signature: "你犯法了知道吗?", 131 | remark: "jack码", 132 | area: "广东广州", 133 | origin: "qq搜索", 134 | label: "警局", 135 | notDisturb: false, 136 | initial: "F" 137 | } 138 | }, ], 139 | newfriend: { 140 | id: 0, 141 | wxid: "1", //微信号 142 | username: "1", 143 | initial: "新的朋友", //姓名首字母 144 | avatar: "static/images/newfriend.jpg", //头像 145 | signature: "", //个性签名 146 | nickname: "新的朋友", //昵称 147 | sex: 0, //性别 1为男,0为女 148 | remark: "新的朋友", //备注 149 | area: "", //地区 150 | }, 151 | groupChat: { 152 | id: 0, 153 | wxid: "2", 154 | username: "2", 155 | initial: "群聊", 156 | avatar: "static/images/group.png", 157 | signature: "", 158 | nickname: "群聊", 159 | sex: 0, 160 | remark: "群聊", 161 | area: "", 162 | }, 163 | // 得知当前选择的是哪个好友 164 | selectFriendNo: '1' 165 | } 166 | const mutations = { 167 | // 得知用户当前选择的是哪个好友。 168 | selectFriend(state, value) { 169 | state.selectFriendNo = value 170 | }, 171 | addFriend(state, value) { 172 | let friend = state.friendlist.find(friend => friend.username === value.username); 173 | if (friend == null) { 174 | state.friendlist.push(value); 175 | } 176 | }, 177 | updateFriend(state, value) { 178 | let tmp = state.friendlist.find((i) => i.username === value.username) 179 | Object.assign(tmp, value); 180 | }, 181 | addFriendList(state, value) { 182 | state.friendlist = state.friendlist.filter((x, index) => { 183 | if (x.id == -1 || value.find((y) => x.username === y.username)) { 184 | return x; 185 | } 186 | }); 187 | let add = value.filter(x => !state.friendlist.find((y) => x.username === y.username)); 188 | for (let i = 0; i < add.length; i++) { 189 | state.friendlist.push(add[i]); 190 | } 191 | }, 192 | addNewFriend(state, value) { 193 | let add = value.filter(x => !state.newFriendList.find((y) => x.applyId === y.applyId)); 194 | for (let i = 0; i < add.length; i++) { 195 | state.newFriendList.push(add[i]); 196 | } 197 | }, 198 | updateNewFriendStatus(state, value) { 199 | let newFriend = state.newFriendList.find(msg => msg.applyId === value.applyId); 200 | newFriend.status = value.status; 201 | } 202 | } 203 | const actions = { 204 | selectFriend: ({ 205 | commit 206 | }, value) => commit('selectFriend', value), 207 | addFriendList: ({ 208 | commit 209 | }, value) => commit('addFriendList', value), 210 | updateFriend: ({ 211 | commit 212 | }, value) => commit('updateFriend', value), 213 | addFriend: ({ 214 | commit 215 | }, value) => commit('addFriend', value), 216 | addNewFriend: ({ 217 | commit 218 | }, value) => commit('addNewFriend', value), 219 | updateNewFriendStatus: ({ 220 | commit 221 | }, value) => commit('updateNewFriendStatus', value), 222 | } 223 | const getters = { 224 | getNewFriendNums(state) { 225 | let nums = 0; 226 | for (let i = 0; i < state.newFriendList.length; i++) { 227 | if (state.newFriendList[i].status == 0) { 228 | nums++; 229 | } 230 | } 231 | return nums; 232 | }, 233 | // 筛选出含有搜索值的好友列表 234 | searchedFriendlist(state, params, rootState) { 235 | let friends = state.friendlist.filter(friends => friends.remark.includes(rootState.system.searchText)); 236 | return friends 237 | }, 238 | // 通过当前选择是哪个好友匹配相应的好友 239 | selectedFriend(state) { 240 | if (state.selectFriendNo === '1') { 241 | return state.newfriend; 242 | } 243 | if (state.selectFriendNo === '2') { 244 | return state.groupChat; 245 | } 246 | let friend = state.friendlist.find(friend => friend.username === state.selectFriendNo); 247 | return friend 248 | }, 249 | selectedChatFriend(state, getters, rootState) { 250 | let friend = state.friendlist.find(friend => friend.username === rootState.chat.selectChatId); 251 | return friend 252 | }, 253 | selectedFriendByUsername(state) { 254 | return function (username) { 255 | return state.friendlist.find(friend => friend.username === username) 256 | } 257 | }, 258 | } 259 | 260 | export default { 261 | namespaced: true, 262 | // namespaced: true 的方式使其成为带命名空间的模块。保证在变量名一样的时候,添加一个父级名拼接。 263 | // 例: SET_NAME => user/SET_NAME 264 | state, 265 | mutations, 266 | actions, 267 | getters, 268 | } -------------------------------------------------------------------------------- /src/store/modules/groupchat.js: -------------------------------------------------------------------------------- 1 | const state = { 2 | groupChatList: [{ 3 | "ownerId": "1677900582", 4 | "groupName": "五道口职业技术学院校友会", 5 | "groupNo": "A_t431FMe74187", 6 | "notice": null, 7 | "remark": "校友会的叼毛们", 8 | "groupAvatar": "https://img2022.cnblogs.com/blog/1556860/202202/1556860-20220221135450877-25718536.jpg", 9 | "notDisturb": false, 10 | "userDetails": [{ 11 | "username": "1677900582", 12 | "wxid": "lwj123213", 13 | "type": 0, 14 | "nickname": "麻花藤", 15 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160352097-806662701.jpg", 16 | "sex": 1, 17 | "signature": "开心开不开心", 18 | "area": "广东深圳", 19 | "groupNickname": "马化腾" 20 | }, 21 | { 22 | "username": "1737401145", 23 | "wxid": "lwj11111", 24 | "type": 1, 25 | "nickname": "码云", 26 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210929094050713-2085134549.png", 27 | "sex": 1, 28 | "signature": "你犯法了知道吗?", 29 | "area": "广东广州", 30 | "groupNickname": "码云" 31 | }, 32 | { 33 | "username": "1486842355", 34 | "wxid": "1486842355n7dg", 35 | "type": 1, 36 | "nickname": "面白い男", 37 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160332031-1473597366.jpg", 38 | "sex": 1, 39 | "signature": "", 40 | "area": "湖南长沙", 41 | "groupNickname": "面白い男" 42 | }, 43 | { 44 | "username": "1025431504", 45 | "wxid": "1025431504CtZx", 46 | "type": 1, 47 | "nickname": "简单丶爱才美", 48 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160401526-1461243363.jpg", 49 | "sex": 1, 50 | "signature": "", 51 | "area": null, 52 | "groupNickname": "简单丶爱才美" 53 | }, 54 | { 55 | "username": "1398952749", 56 | "wxid": "1398952749sqK7", 57 | "type": 1, 58 | "nickname": "我不听", 59 | "avatar": "https://img2020.cnblogs.com/blog/1556860/202109/1556860-20210923160406881-373503134.jpg", 60 | "sex": 1, 61 | "signature": "闪电五连鞭!", 62 | "area": null, 63 | "groupNickname": "我不听" 64 | } 65 | ], 66 | }], 67 | searchText: "" 68 | } 69 | const mutations = { 70 | // 搜索值 71 | search(state, value) { 72 | state.searchText = value 73 | }, 74 | addGroupChat(state, value) { 75 | let groupChat = state.groupChatList.find(groupChat => groupChat.groupNo === value.groupNo); 76 | if (groupChat == null) { 77 | state.groupChatList.push(value); 78 | } 79 | }, 80 | groupAddUser(state, value) { 81 | let groupChat = state.groupChatList.find(groupChat => groupChat.groupNo === value.groupNo); 82 | if (groupChat != null) { 83 | groupChat.userDetails.unshift(value.user); 84 | } 85 | }, 86 | deleteGroupChat(state, value) { 87 | let index = -1; 88 | for (let i = 0; i < state.groupChatList.length; i++) { 89 | let x = state.groupChatList[i]; 90 | if (x.groupNo === value) { 91 | index = i; 92 | } 93 | } 94 | if (index != -1) { 95 | state.groupChatList.splice(index, 1); 96 | } 97 | }, 98 | addGroupChatList(state, value) { 99 | for (let i = 0; i < state.groupChatList.length; i++) { 100 | let x = state.groupChatList[i]; 101 | if (!value.find((y) => x.groupNo === y.groupNo)) { 102 | x.deleted = true; 103 | } 104 | } 105 | let add = value.filter(x => !state.groupChatList.find((y) => x.groupNo === y.groupNo)); 106 | for (let i = 0; i < add.length; i++) { 107 | state.groupChatList.push(add[i]); 108 | } 109 | } 110 | } 111 | const actions = { 112 | search: ({ 113 | commit 114 | }, value) => { 115 | setTimeout(() => { 116 | commit('search', value) 117 | }, 100) 118 | }, 119 | addGroupChat: ({ 120 | commit 121 | }, value) => commit('addGroupChat', value), 122 | groupAddUser: ({ 123 | commit 124 | }, value) => commit('groupAddUser', value), 125 | addGroupChatList: ({ 126 | commit 127 | }, value) => commit('addGroupChatList', value), 128 | deleteGroupChat: ({ 129 | commit 130 | }, value) => commit('deleteGroupChat', value), 131 | } 132 | const getters = { 133 | // 筛选出含有搜索值的好友列表 134 | searchedGroupChatList(state, params, rootState) { 135 | return state.groupChatList.filter(group => !group.deleted && (group.groupName.includes(state.searchText))); 136 | }, 137 | // 根据群编号获取群信息 138 | selectedGroupChat(state, params, rootState) { 139 | return state.groupChatList.find(group => group.groupNo === rootState.chat.selectChatId); 140 | }, 141 | selectedGroupChatByNo(state) { 142 | return function (groupNo) { 143 | return state.groupChatList.find(group => !group.deleted && (group.groupNo === groupNo)) 144 | } 145 | }, 146 | } 147 | 148 | export default { 149 | namespaced: true, 150 | // namespaced: true 的方式使其成为带命名空间的模块。保证在变量名一样的时候,添加一个父级名拼接。 151 | // 例: SET_NAME => user/SET_NAME 152 | state, 153 | mutations, 154 | actions, 155 | getters, 156 | } -------------------------------------------------------------------------------- /src/store/modules/user.js: -------------------------------------------------------------------------------- 1 | import { 2 | getAvatar 3 | } from '@/libs/tools' 4 | import { 5 | removeToken, 6 | setToken, 7 | getToken 8 | } from '@/libs/util' 9 | const state = { 10 | token: getToken(), 11 | // 当前登录用户 12 | info: { 13 | signature: "", 14 | sex: 1, 15 | wxid: "", 16 | area: "广州", 17 | nickname: '房东的Tom', 18 | avatar: null, 19 | username: "", 20 | }, 21 | } 22 | const mutations = { 23 | saveToken(state, { 24 | token, 25 | auto 26 | }) { 27 | if (token == null) { 28 | removeToken(); 29 | } else { 30 | state.token = token 31 | setToken(token, auto) 32 | } 33 | }, 34 | setUserInfo(state, info) { 35 | state.info = info; 36 | } 37 | } 38 | 39 | const actions = { 40 | setUserInfo: ({ 41 | commit 42 | }, info) => commit('setUserInfo', info), 43 | // 登录 44 | handleLogin({ 45 | state, 46 | commit 47 | }, { 48 | username, 49 | nickname, 50 | password, 51 | auto 52 | }) { 53 | username = username.trim(); 54 | return new Promise((resolve, reject) => { 55 | let token = "1212121"; 56 | commit('saveToken', { 57 | token, 58 | auto 59 | }) 60 | state.info.signature = "走别人的路,让别人无路可走"; 61 | state.info.sex = 1; 62 | state.info.wxid = "12345"; 63 | state.info.area = "奥林帕斯山"; 64 | state.info.nickname = nickname; 65 | state.info.avatar = getAvatar(nickname); 66 | state.info.username = username; 67 | resolve(state.info); 68 | }) 69 | }, 70 | // 退出登录 71 | handleLogout({ 72 | commit 73 | }) { 74 | commit('saveToken', { 75 | token: null, 76 | auto: true 77 | }) 78 | } 79 | } 80 | const getters = { 81 | getUser(state, mutations, rootState) { 82 | if (state.info.avatar == null || state.info.avatar === '') { 83 | state.info.avatar = getAvatar(state.info.nickname); 84 | } 85 | return state.info; 86 | } 87 | } 88 | 89 | 90 | export default { 91 | namespaced: true, 92 | // namespaced: true 的方式使其成为带命名空间的模块。保证在变量名一样的时候,添加一个父级名拼接。 93 | // 例: SET_NAME => user/SET_NAME 94 | state, 95 | mutations, 96 | actions, 97 | getters, 98 | } -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const TerserPlugin = require('terser-webpack-plugin'); 2 | const config = require('./src/config') 3 | 4 | 5 | let BASE_URL = '' 6 | switch (process.env.NODE_ENV) { 7 | case 'development': 8 | BASE_URL = config.publicPath.dev //这里是本地的请求url 9 | break 10 | case 'production': 11 | BASE_URL = config.publicPath.pro //生产环境url 12 | break 13 | } 14 | 15 | module.exports = { 16 | publicPath: BASE_URL, 17 | devServer: { 18 | port: 8000, // 端口 19 | }, 20 | // 如果你不需要使用eslint,把lintOnSave设为false即可 21 | lintOnSave: false, 22 | css: { 23 | loaderOptions: { 24 | less: { 25 | javascriptEnabled: true 26 | } 27 | } 28 | }, 29 | // 打包时不生成.map文件 30 | productionSourceMap: false, 31 | configureWebpack: (config) => { 32 | if (process.env.NODE_ENV === 'production') { 33 | config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true 34 | } 35 | }, 36 | } --------------------------------------------------------------------------------
35 | {{ 36 | item.info.remark === null || item.info.remark === "" 37 | ? item.info.nickname 38 | : item.info.remark 39 | }} 40 |
消息免打扰
33 | 39 |
置顶聊天
44 | 45 |
24 | {{ item.nickname }} 25 |
{{ item.info }}
发送好友申请
备注名
5 | 连接失败,请检查你的网络或刷新页面 7 |