Skip to content
Projets

À propos

Un salon de discussion sous forme de mini-programme WeChat.

Productivité et automatisation

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

wechat-chat

本项目使用 Gorilla WebSocket 作为聊天室后台 , Gorilla WebSocket 基于go语言开发,提供的demo实例中有聊天室源码,不需要任何修改就能生成一个聊天室项目(包含后台+web前台)

demo:
http://121.42.51.70:8080

##一、聊天室服务搭建步骤:
如果不想搭建服务器,可以跳过这个步骤,直接使用我的服务

  1. 安装 golang , 安装1.6以上版本,低版本问题较多。注:下载golang需要翻墙

  2. 安装Gorilla WebSocket模块

    go get github.com/gorilla/websocket
    
  3. 启动聊天室

    $ go get github.com/gorilla/websocket    
    $ cd `go list -f '{{.Dir}}' github.com/gorilla/   websocket/examples/chat`
    $ go run *.go  
    
  4. web客户端
    访问:http://ip:8080

##二、微信小程序客户端

  1. git clone https://github.com/ericzyh/wechat-chat.git

  2. 使用微信web开发者工具导入项目

  3. 修改服务地址 wechat-chat/utils/websockets.js 行1

##三、小程序开发问题 (Q&A)

  1. 如何通过js获取到某个组件? (发送消息后,清空输入框)
    A:

  2. text存英文超过屏幕宽度后,会出现横向滚动条?
    A: 和css一样加上样式:word-break:break-all;

  3. 有没有办法在view里通过js动态加入view?
    A:

##四、todo

  1. 发送消息后,清空输入框
  2. 名字可点击,实现1v1通讯
  3. 加入聊天间

Explorer des projets similaires

Chargement…