{"id":13654399,"url":"https://github.com/ericzyh/wechat-chat","last_synced_at":"2026-04-09T04:34:10.683Z","repository":{"id":57447946,"uuid":"69469761","full_name":"ericzyh/wechat-chat","owner":"ericzyh","description":"微信小程序版聊天室","archived":false,"fork":false,"pushed_at":"2018-03-28T15:42:46.000Z","size":5,"stargazers_count":406,"open_issues_count":6,"forks_count":176,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-11-10T06:32:18.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericzyh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-28T14:08:17.000Z","updated_at":"2024-11-04T06:12:27.000Z","dependencies_parsed_at":"2022-08-30T10:11:07.377Z","dependency_job_id":null,"html_url":"https://github.com/ericzyh/wechat-chat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzyh%2Fwechat-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzyh%2Fwechat-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzyh%2Fwechat-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericzyh%2Fwechat-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericzyh","download_url":"https://codeload.github.com/ericzyh/wechat-chat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250407704,"owners_count":21425548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T03:00:31.772Z","updated_at":"2026-04-09T04:34:10.658Z","avatar_url":"https://github.com/ericzyh.png","language":"JavaScript","funding_links":[],"categories":["Demo","Uncategorized"],"sub_categories":["Uncategorized","数据接口有问题"],"readme":"# wechat-chat\n\n本项目使用 [Gorilla WebSocket](https://github.com/gorilla/websocket) 作为聊天室后台 , Gorilla WebSocket 基于go语言开发，提供的demo实例中有聊天室源码，不需要任何修改就能生成一个聊天室项目(包含后台+web前台)\n\ndemo:   \n[http://121.42.51.70:8080](http://121.42.51.70:8080)\n\n\n##一、聊天室服务搭建步骤:   \n*如果不想搭建服务器，可以跳过这个步骤，直接使用我的服务*\n\n1. 安装 [golang](https://golang.org/) , 安装1.6以上版本，低版本问题较多。*注:下载golang需要翻墙*\n\n2. 安装Gorilla WebSocket模块   \n   ```\n   go get github.com/gorilla/websocket\n   ``` \n     \n3. 启动聊天室\n   ```\n   $ go get github.com/gorilla/websocket    \n   $ cd `go list -f '{{.Dir}}' github.com/gorilla/   websocket/examples/chat`\n   $ go run *.go  \n   ```\n\n4. web客户端   \n   访问:http://ip:8080\n\n\n##二、微信小程序客户端\n1. git clone https://github.com/ericzyh/wechat-chat.git\n\n2. 使用[微信web开发者工具](https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/devtools.html)导入项目\n\n3. 修改服务地址\n   wechat-chat/utils/websockets.js 行1\n   \n   \n##三、小程序开发问题 （Q\u0026A）   \n1. 如何通过js获取到某个组件? （发送消息后，清空输入框）   \nA: \n\n2. text存英文超过屏幕宽度后，会出现横向滚动条?    \nA: 和css一样加上样式:```word-break:break-all;```    \n\n3. 有没有办法在view里通过js动态加入view？    \nA:    \n\n\n##四、todo\n1. 发送消息后，清空输入框   \n2. 名字可点击，实现1v1通讯\n3. 加入聊天间\n\n   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericzyh%2Fwechat-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericzyh%2Fwechat-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericzyh%2Fwechat-chat/lists"}