瀏覽代碼

Merge branch 'talksec' of 121.43.114.153:/home/git/repositories/shopnc into talksec

stanley-king 6 年之前
父節點
當前提交
3b1f40d331

+ 80 - 0
data/resource/mobile/comm/new_websocket.js

@@ -0,0 +1,80 @@
+var BaseClientWebsocket = function(addr,token,room,user,autoLogin){
+    this.seq = 1;
+    this.token = token;
+    this.addr = addr;
+    this.room = room;
+    this.user = user;
+    this.autoLogin = autoLogin;
+    this.client = null;
+};
+
+BaseClientWebsocket.prototype = {
+    init: function () {
+        var _self = this;
+        if(!window.WebSocket) {
+            console.log('您的设备不支持WebSocket');
+            return;
+        }
+        this.client = new WebSocket(this.addr);
+        this.client.onopen = function () {
+            if(_self.autoLogin) {
+                _self.login();
+            }
+        };
+        this.client.onerror = function(){
+            console.log("onerror");
+        };
+        this.client.onclose = function(){
+            console.log("onclose");
+            _self.reconnect();
+        };
+        this.client.onmessage = function(data){
+
+        };
+    },
+    login: function(){
+        var msg = {
+            act: 'access',
+            op: 'login',
+            seq : this.seq++,
+            token: this.token
+        };
+        this.client.send(JSON.stringify(msg));
+    },
+    reconnect:function(){
+        var _self = this;
+        setTimeout(function(){
+            console.log("websocket重连中...");
+            _self.init();
+        },1000);
+    }
+};
+
+
+
+var ShakeClientWebsocket = function(){
+    BaseClientWebsocket.apply(this,arguments);
+    this.init();
+    this.shake_bonus = function(msg){
+        this.client.send(msg)
+    }
+};
+ShakeClientWebsocket.prototype = new BaseClientWebsocket();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 1 - 1
data/resource/mobile/fcode/js/fcode.js

@@ -83,7 +83,7 @@ var app = function()
     if (app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
         href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
     } else if (app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1) {
-        href = "http://p.lrlz.com/hfive/android_down/index.html";
+        href = "https://passport.lrlz.com/hfive/android_down/index.html";
     }
     else {
         href="javascript:void(0)";

+ 1 - 1
data/resource/mobile/ugc/js/main.js

@@ -1189,7 +1189,7 @@ function app() {
     if (app_nav.indexOf('iphone') > -1 && app.indexOf('iphone')) {
         href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
     } else if (app.indexOf('micromessenger') > -1 && app_nav.indexOf('android') > -1) {
-        href = "http://p.lrlz.com/hfive/android_down/index.html";
+        href = "https://passport.lrlz.com/hfive/android_down/index.html";
     }
     else {
         href = "javascript:void(0)";