/**
 * websocket相关
 *
 * @author CaiAoLin
 * @date 2017/7/6
 * @version
 */
$(document).ready(function() {

    // 连接socket服务器
    socket = io('http://'+ host +':3300');
    socket.on('connect', function () {
        socket.emit('join', roomId);
        console.log('连接成功');
    });

    // 接收到改变
    socket.on('dataChange', function(data) {
        data = JSON.parse(data);
        if (data.newValue === undefined) {
            return false;
        }
        changeInfo.push(data);
        $("#message").html('市场单位已被修改，<a href="javascript:void(0);" id="load-data">点击加载</a>');
        $("#notify").slideDown('fast');
    });

});