2015-1-14 sc源码分析

来源:互联网 发布:p衣服的软件 编辑:程序博客网 时间:2024/04/29 23:07

adb install "D:\yue31313\12-22 最新的QQ技巧\qqskill\bin\qqskill.apk"

原想依照自己的故事编写个剧本的,但是悲伤的故事我已不想提起.
真难想,那些这样做的的人,是受了多大的压抑心情。

=========

感恩回馈,免费体验黄钻豪华版

QQ空间黄钻用户现金券大派送

====== sc源码分析

ScPineapple extends CordovaActivity

bindService(new Intent(this, ZmqService.class), this.mConnectionZMQ, 1);
    this.mIsZmqBound = Boolean.valueOf(true);

   setRequestedOrientation(0);

    super.loadUrl(Config.getStartUrl());

---------

ZmqService 自动创建 

 public void onCreate()
  {
    super.onCreate();
    this.syncToken = new Object();
    this.mConnectivityChangeReceiver = new ConnectivityChangeReceiver();
    registerReceiver(this.mConnectivityChangeReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
    makeMsgHandler();
    this.mMsgReceiver = new MsgReceiver();
    registerReceiver(this.mMsgReceiver, new IntentFilter("activity_to_zmq"));
    this.mztIO = new ZmqThread();
    this.mztIO.start();
  }

----------

public class ConnectivityChangeReceiver extends BroadcastReceiver
  {
    public ConnectivityChangeReceiver()
    {
    }
    public void onReceive(Context paramContext, Intent paramIntent)
    {
      if (ZmqService.this.isConnectedToInternet())
      {
        if (ZmqService.this.hasEverConnected)
          break label51;
        Log.d("ZmqService", "connect first time");
        ZmqService.this.hasEverConnected = true;
        ZmqService.this.connect();
      }
      while (true)
      {
        ZmqService.this.checkIn();
        return;
        label51: Log.d("ZmqService", "reconnect");
        ZmqService.this.connect();
      }
    }
  }

-------

 public class MsgReceiver extends BroadcastReceiver
  {
    public MsgReceiver()
    {
    }
    public void onReceive(Context paramContext, Intent paramIntent)
    {
      Log.d("ZmqService", "MsgReceiver onReceive");
      String str1 = paramIntent.getStringExtra("activity_to_zmq");
      Log.v("ZmqService", str1);
      try
      {
        JSONObject localJSONObject = new JSONObject(str1);
        String str2;
        JSONArray localJSONArray;
        try
        {
          str2 = localJSONObject.getString("action");
          localJSONArray = localJSONObject.getJSONArray("args");
          Log.v("ZmqService", localJSONObject.toString());
          if ("getScene".equals(str2))
            synchronized (ZmqService.this.syncToken)
            {
              Log.d("ZmqService", "getScene");
              String str11 = localJSONArray.getString(0);
              ZmqService.this.getScene(str11);
              return;
            }
        }
        catch (JSONException localJSONException1)
        {
          label125: Log.e("ZmqService", "parse json failed");
          return;
        }
        if ("replyNextGame".equals(str2))
          synchronized (ZmqService.this.syncToken)
          {
            Log.d("ZmqService", "replyNextGame");
            String str9 = localJSONArray.getString(0);
            String str10 = localJSONArray.getString(1);
            ZmqService.this.replyNextGame(str9, str10);
            return;
          }
        if ("getContext".equals(str2))
          synchronized (ZmqService.this.syncToken)
          {
            Log.d("ZmqService", "getContext");
            ZmqService.this.getContext();
            return;
          }
        if ("pinup".equals(str2))
          synchronized (ZmqService.this.syncToken)
          {
            Log.d("ZmqService", "createPineapple");
            String str7 = localJSONArray.getString(0);
            int i = localJSONArray.getInt(1);
            String str8 = localJSONArray.getString(2);
            ZmqService.this.pinup(str7, i, str8);
            return;
          }
        if ("createPineapple".equals(str2))
          synchronized (ZmqService.this.syncToken)
          {
            Log.d("ZmqService", "createPineapple");
            String str4 = localJSONArray.getString(0);
            String str5 = localJSONArray.getString(1);
            String str6 = localJSONArray.getString(2);
            ZmqService.this.createPineapple(str4, str5, str6);
            return;
          }
        if ("trans".equals(str2))
          synchronized (ZmqService.this.syncToken)
          {
            String str3 = localJSONArray.getString(0);
            ZmqService.this.trans(str3);
            return;
          }
        if ("setUidAndKey".equals(str2))
          synchronized (ZmqService.this.syncToken)
          {
            Log.d("ZmqService", "set uid and key");
            ZmqService.this.hasLogined = Boolean.valueOf(true);
            ZmqService.this.uid = localJSONArray.getString(0);
            ZmqService.this.key = localJSONArray.getString(1);
            ZmqService.this.setUidAndKey(ZmqService.this.uid, ZmqService.this.key);
            ZmqService.this.checkIn();
            return;
          }
      }
      catch (JSONException localJSONException2)
      {
        break label125;
      }
    }
  }

-------------

public ZmqThread()
    {
      synchronized (ZmqService.this.syncToken)
      {
        makeMsgDispatcher();
        setListener(new ZmqService.MsgNotifier(ZmqService.this));
        return;
      }
    }

public void run()
    {
      Log.d("ZmqService", "run");
      dispatch();
    }

-------

 public class MsgNotifier
    implements MsgListener
  {
    public MsgNotifier()
    {
    }
    public void onCheckin(Checkin paramCheckin)
    {
      Log.d("ZmqService", "onCheckin, majorRelease: " + paramCheckin.majorRelease + " minorRelease: " + paramCheckin.minorRelease + " download_url: " + paramCheckin.downloadUrl + " desc: " + paramCheckin.desc);
    }

    public void onCreatePineapple(String paramString1, String paramString2, String paramString3, String paramString4, int paramInt1, int paramInt2, int paramInt3)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onCreatePineapple");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("player1", paramString2);
        localJSONObject2.put("player2", paramString3);
        localJSONObject2.put("player3", paramString4);
        localJSONObject2.put("duty", paramInt1);
        localJSONObject2.put("myScore", paramInt2);
        localJSONObject2.put("gameType", paramInt3);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onCreateTable(int paramInt1, String paramString1, String paramString2, String paramString3, int paramInt2)
    {
      Log.d("ZmqService", "onCreateTable");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onCreateTable");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("ackCode", paramInt1);
        localJSONObject2.put("creator", paramString1);
        localJSONObject2.put("player2", paramString2);
        localJSONObject2.put("player3", paramString3);
        localJSONObject2.put("myScore", paramInt2);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onEndPineapple(String paramString1, String paramString2)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onEndPineapple");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("game_id", paramString2);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onIssueFantasyHand(String paramString1, int paramInt, String paramString2, String paramString3, String paramString4)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onIssueFantasyHand");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("seat", paramInt);
        localJSONObject2.put("bricks", paramString2);
        localJSONObject2.put("sortedFace", paramString3);
        localJSONObject2.put("sortedSuit", paramString4);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onIssueFirstHand(String paramString1, int paramInt, String paramString2, String paramString3, String paramString4)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onIssueFirstHand");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("seat", paramInt);
        localJSONObject2.put("bricks", paramString2);
        localJSONObject2.put("sortedFace", paramString3);
        localJSONObject2.put("sortedSuit", paramString4);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onIssueOtherHand(String paramString1, int paramInt, String paramString2, String paramString3, String paramString4)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onIssueOtherHand");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("seat", paramInt);
        localJSONObject2.put("bricks", paramString2);
        localJSONObject2.put("sortedFace", paramString3);
        localJSONObject2.put("sortedSuit", paramString4);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onPinup(String paramString1, int paramInt, String paramString2)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onPinup");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("seat", paramInt);
        localJSONObject2.put("bricks", paramString2);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onPopupFantasyInfo(String paramString)
    {
      Log.d("ZmqService", "onPopupFantasyInfo");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onPopupFantasyInfo");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onQuitTable(String paramString1, String paramString2)
    {
      Log.d("ZmqService", "onQuitTable");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onQuitTable");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("player_id", paramString2);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onRequestNextGame(String paramString)
    {
      Log.d("ZmqService", "onRequestNextGame");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onRequestNextGame");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowBricks(String paramString1, int paramInt1, String paramString2, String paramString3, String paramString4, int paramInt2)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowBricks");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("seat", paramInt1);
        localJSONObject2.put("bricks", paramString2);
        localJSONObject2.put("sortedFace", paramString3);
        localJSONObject2.put("sortedSuit", paramString4);
        localJSONObject2.put("isFantasy", paramInt2);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowDealer(String paramString, int paramInt)
    {
      Log.d("ZmqService", "onShowDealer");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowDealer");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString);
        localJSONObject2.put("seat", paramInt);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowDuty(String paramString1, int paramInt, String paramString2)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowDuty");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("seat", paramInt);
        localJSONObject2.put("bricks", paramString2);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowRace(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowRace");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString1);
        localJSONObject2.put("game_id", paramString2);
        localJSONObject2.put("seat1_vs_seat2", paramString3);
        localJSONObject2.put("seat1_vs_seat3", paramString4);
        localJSONObject2.put("seat2_vs_seat3", paramString5);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowScore(String paramString, int paramInt1, int paramInt2, int paramInt3)
    {
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowScore");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString);
        localJSONObject2.put("seat1_score", paramInt1);
        localJSONObject2.put("seat2_score", paramInt2);
        localJSONObject2.put("seat3_score", paramInt3);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowSeat(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6)
    {
      Log.d("ZmqService", "onShowSeat");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowSeat");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table_id", paramString);
        localJSONObject2.put("seat1_score", paramInt1);
        localJSONObject2.put("seat1_status", paramInt2);
        localJSONObject2.put("seat2_score", paramInt3);
        localJSONObject2.put("seat2_status", paramInt4);
        localJSONObject2.put("seat3_score", paramInt5);
        localJSONObject2.put("seat3_status", paramInt6);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowTableCanvas(int paramInt)
    {
      Log.d("ZmqService", "onShowTableCanvas");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowTableCanvas");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("size", paramInt);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onShowTableSummary(String paramString1, int paramInt1, int paramInt2, int paramInt3, String paramString2, String paramString3, String paramString4, int paramInt4)
    {
      Log.d("ZmqService", "onShowTableSummary");
      JSONObject localJSONObject1 = new JSONObject();
      try
      {
        localJSONObject1.put("title", "onShowTableSummary");
        JSONObject localJSONObject2 = new JSONObject();
        localJSONObject2.put("table", paramString1);
        localJSONObject2.put("gameStatus", paramInt1);
        localJSONObject2.put("dutySeat", paramInt2);
        localJSONObject2.put("myScore", paramInt3);
        localJSONObject2.put("player1", paramString2);
        localJSONObject2.put("player2", paramString3);
        localJSONObject2.put("player3", paramString4);
        localJSONObject2.put("gameType", paramInt4);
        localJSONObject1.put("content", localJSONObject2);
        onTrans(localJSONObject1.toString());
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }


    public void onTrans(String paramString)
    {
      Log.d("ZmqService", "onTrans: " + paramString);
      Intent localIntent = new Intent("zmq_to_activity");
      localIntent.putExtra("zmq_to_activity", paramString);
      ZmqService.this.sendBroadcast(localIntent);
    }
  }

======

广播:

ConnectivityChangeReceiver ===  android.net.conn.CONNECTIVITY_CHANGE   服务zmp的时候注册, 系统发送

MsgReceiver  === activity_to_zmq  服务zmp的时候注册,MsgPlugin的callZmqService中发送该广播, 接收到 解析json执行相应的native方法

MsgPlugin.MsgReceiver  === zmq_to_activity  插件msg的时候注册, MsgNotifier的onTrans中发送该广播,接收到,将json数据 发送脚本到webview

=======

Ext.application({
    name: "ScPineapple",
    views: ["ScPineapple.view.NewGameList", "Ext.Label", "ScPineapple.view.NewPineappleConfirm", "ScPineapple.view.NewChooseView", "ScPineapple.view.NewPineappleAlert", "ScPineapple.view.NewUserList", "ScPineapple.view.PineappleAlert", "ScPineapple.view.PineappleConfirm", "ScPineapple.view.GameBtns", "ScPineapple.view.GameSettingBtns", "Ext.field.Hidden", "Ext.field.Search", "ScPineapple.view.SingleGameLeftTop", "ScPineapple.view.SingleGameRightBottom", "ScPineapple.view.DropPlace", "ScPineapple.view.SingleGameLeftBottom", "ScPineapple.view.MainCenter", "Ext.field.Password", "ScPineapple.view.More", "Login", "ScPineapple.view.StartGameTwoPeopleJ", "ScPineapple.view.TstartGameJ", "Main", "AddNewFriend", "ScPineapple.view.TopUp"],
    controllers: ["ScPineapple.controller.Main"],
    models: ["ScPineapple.model.UserListModel", "ScPineapple.model.GameListModel", "ScPineapple.model.AddNewFriendModel", "ScPineapple.model.ChoiceImg"],
    stores: ["ScPineapple.store.UserListStore", "ScPineapple.store.GameListStore", "ScPineapple.store.AddNewFriendStore", "ScPineapple.store.ChoiceImg"],
    icon: {
        "57": "resources/icons/Icon.png",
        "72": "resources/icons/Icon~ipad.png",
        "114": "resources/icons/Icon@2x.png",
        "144": "resources/icons/Icon~ipad@2x.png"
    },
    isIconPrecomposed: true,
    startupImage: {
        "320x460": "resources/startup/320x460.jpg",
        "640x920": "resources/startup/640x920.png",
        "768x1004": "resources/startup/768x1004.png",
        "748x1024": "resources/startup/748x1024.png",
        "1536x2008": "resources/startup/1536x2008.png",
        "1496x2048": "resources/startup/1496x2048.png"
    },
    launch: function() {
        Conn.upgrade(function() {});
        main_controller = this.getController("ScPineapple.controller.Main");
        Ext.Viewport.add(main_controller.getMainCenter());
        Ext.fly("appLoadingIndicator").destroy();
        var b = this;
        if (Ext.os.is("Android")) {
            document.addEventListener("backbutton", Ext.bind(a, this), false);
            function a(c) {
                c.preventDefault();
                var d = main_controller.getMainCenter().getActiveItem();
                if (backKey_flag && (d.$className == "ScPineapple.view.Login" || d.$className == "ScPineapple.view.Welcome")) {
                    if (exit_flag) {
                        Conn.logout(function(e) {});
                        if (typeof msg != "undefined") {
                            msg.destroy()
                        }
                        navigator.app.exitApp()
                    } else {
                        Rock.ux.st.Mask.showTip({
                            message: "再按一次退出登录",
                            type: "none"
                        });
                        exit_flag = true;
                        Ext.Function.defer(function() {
                            exit_flag = false
                        },
                        2000, this)
                    }
                } else {
                    main_controller.back()
                }
            }
        } else {
            Utils.log("Version " + Ext.os.version)
        }
    },
    onUpdated: function() {
        Ext.Msg.confirm("Application Update", "This application has just successfully been updated to the latest version. Reload now?",
        function(a) {
            if (a === "yes") {
                window.location.reload()
            }
        })
    }
});

-----------

Ext.define("ScPineapple.controller.Main", {
    extend: Ext.app.Controller,
    config: {
        refs: {
            mainCenter: {
                selector: "mainCenter",
                xtype: "mainCenter",
                autoCreate: true
            },
            welcome: {
                selector: "welcome",
                xtype: "welcome",
                autoCreate: true
            },
            login: {
                selector: "login",
                xtype: "login",
                autoCreate: true
            },
            newUserList: {
                selector: "newuserlist",
                xtype: "newuserlist",
                autoCreate: true
            },
            task: {
                selector: "task",
                xtype: "task",
                autoCreate: true
            },
            more: {
                selector: "more",
                xtype: "more",
                autoCreate: true
            },
            gameList: {
                selector: "gameList",
                xtype: "gameList",
                autoCreate: true
            },
            addNewFriend: {
                selector: "addnewfriend",
                xtype: "addnewfriend",
                autoCreate: true
            },
            tstartGameJ: {
                selector: "tstartGameJ",
                xtype: "tstartGameJ",
                autoCreate: true
            },
            startGameTwoPeopleJ: {
                selector: "startgametwopeoplej",
                xtype: "startgametwopeoplej",
                autoCreate: true
            },
            DragPlace: {
                selector: "DragPlace",
                xtype: "DragPlace",
                autoCreate: true
            },
            DropPlace: {
                selector: "DropPlace",
                xtype: "DropPlace",
                autoCreate: true
            },
            thistoryView: {
                selector: "THistoryView",
                xtype: "THistoryView",
                autoCreate: true
            },
            historyView: {
                selector: "HistoryView",
                xtype: "HistoryView",
                autoCreate: true
            },
            newChooseView: {
                selector: "newchooseview",
                xtype: "newchooseview",
                autoCreate: true
            },
            topUp: {
                selector: "TopUp",
                xtype: "TopUp",
                autoCreate: true
            },
            newGameList: {
                selector: "newgameList",
                xtype: "newgameList",
                autoCreate: true
            },
            gameBtns: {
                selector: "gamebtns",
                xtype: "gamebtns",
                autoCreate: true
            }
        },
        control: {
            login: {
                toUserList: "toUserList",
                toTask: "toTask",
                logintoNext: "logintoNext"
            },
            more: {
                toUserList: "toUserList",
                back: "back"
            },
            gameBtns: {
                toMore: "toMore",
                back: "back",
                toTask: "toTask",
                toGameList: "toGameList",
                toLogin: "toLogin",
                toHistory: "toHistory"
            },
            newGameList: {
                back: "back",
                toUserList: "toUserList",
                toTstartGameJ: "toTstartGameJ",
                toMore: "toMore",
                dailySigntoGameList: "dailySigntoGameList",
                toAddNewFriend: "toAddNewFriend",
                toChooseView: "toChooseView"
            },
            newUserList: {
                toStartGameTwoPeopleJ: "toStartGameTwoPeopleJ",
                toTstartGameJ: "toTstartGameJ",
                toAddNewFriend: "toAddNewFriend",
                back: "back"
            },
            userList: {
                toStartGameTwoPeopleJ: "toStartGameTwoPeopleJ",
                toTstartGameJ: "toTstartGameJ",
                toAddNewFriend: "toAddNewFriend",
                back: "back"
            },
            addNewFriend: {
                toUserList: "toUserList",
                back: "back"
            },
            task: {
                dailySigntoGameList: "dailySigntoGameList",
                toUserList: "toUserList",
                toGameList: "toGameList",
                back: "back",
                addFriendtoGameList: "addFriendtoGameList"
            },
            startGameTwoPeople: {},
            "addnewfriend dataview": {
                itemtap: "addNewFriendClicked"
            },
            mainCenter: {
                toUserList: "toUserList",
                toGameList: "toGameList",
                toMore: "toMore",
                toLogin: "toLogin",
                toTask: "toTask"
            },
            newChooseView: {
                toUserList: "toUserList"
            }
        }
    },
    toHistory: function(d, c) {
        if (Utils.isNull(d)) {
            return
        }
        var a = Utils.objToArray(TableDao.loadScene(d));
        if (Utils.isNull(a) || a.length == 0) {
            Rock.ux.st.Mask.showTip({
                message: "没有历史记录",
                type: "none"
            });
            return
        }
        var b;
        if (c) {
            b = this.getThistoryView()
        } else {
            b = this.getHistoryView()
        }
        this.getMainCenter().push(b);
        b.init(a)
    },
    toChooseView: function() {
        Ext.Viewport.add(this.getNewChooseView())
    },
    addFriendtoGameList: function(a) {
        var a = {
            mobile: a
        };
        Utils.log("addFriendtoGameList:" + url);
        Conn.addFriend(a,
        function(b) {
            localStorage.setItem("isDailySign", b.info);
            Utils.log(b.info)
        })
    },
    dailySigntoGameList: function() {
        Conn.dailySign(null,
        function(a) {
            Utils.log((new Date()).getTime());
            localStorage.setItem("DailySignTime", (new Date()).getTime())
        })
    },
    logintoNext: function(a) {
        var b = this;
        Conn.login(a,
        function(c) {
            Utils.log(c);
            if (c.success || c.success == "true") {
                localStorage.setItem("user_id", c.user.id);
                localStorage.setItem("loginPostData", JSON.stringify(a));
                setTimeout(function() {
                    UserAction.setMyInfo(c.user)
                },
                500);
                b.getMainCenter().push(b.getNewGameList())
            } else {
                Rock.ux.st.Mask.showTip({
                    message: c.info,
                    type: "none"
                })
            }
        })
    },
    sign_up: function(a) {
        var c = this;
        var b = URL_HEAD + "/sessions/sign_up.json";
        Utils.log("注册:" + b);
        Conn.signUp(a,
        function(d) {
            Utils.log(d);
            if (d.info == "sign up success") {
                Utils.log("登录");
                c.getMainCenter().pop(c.getLogin());
                Ext.getStore("GameListStore").setData("");
                Ext.getStore("UserListStore").setData("");
                Ext.getStore("AddNewFriendStore").setData("")
            } else {
                Utils.log("错误")
            }
        })
    },
    getVeryCode: function(b) {
        Utils.log("手机号为:" + b);
        var b = {
            commit: "获取验证码",
            spree_user: {
                mobile: b
            }
        };
        var a = URL_HEAD + "/mapi/sessions/verify_code.json";
        Utils.log(a);
        Ext.Ajax.request({
            url: a,
            withCredentials: true,
            useDefaultXhrHeader: false,
            disableCaching: false,
            method: "POST",
            jsonData: b,
            scope: this,
            success: function(c, d) {},
            failure: function(c, d) {
                var e = c.responseText;
                Utils.log("failure", e)
            }
        })
    },
    toUserList: function(a) {
        Utils.log("去好友列表");
        RefreshAction.addsList();
        var b = this.getNewUserList();
        b.isDaiWang = a;
        this.getMainCenter().push(b)
    },
    toRegisterUsers: function() {
        this.getMainCenter().push(this.getRegisterUsers())
    },
    addNewFriendClicked: function() {
        Utils.log(123)
    },
    toLogin: function() {
        this.getMainCenter().pop(this.getLogin())
    },
    back: function(b) {
        var c = this.getMainCenter();
        var a = (Ext.Viewport.getItems().length == 3);
        Utils.log("Ext.Viewport.getItems().length == 3:" + a);
        if (Ext.os.is.ios) {
            a = true
        }
        if (c.getInnerItems().length > 1 && a) {
            c.pop()
        }
    },
    toTask: function() {
        this.getMainCenter().push(this.getTask())
    },
    toGameList: function() {
        this.getMainCenter().pop(this.getGameList())
    },
    toMore: function() {
        this.getMainCenter().push(this.getMore())
    },
    toStartGameTwoPeopleJ: function() {
        this.getMainCenter().push(this.getStartGameTwoPeopleJ())
    },
    toAddNewFriend: function() {
        this.getMainCenter().push(this.getAddNewFriend())
    },
    toSignupTwo: function() {
        this.getMainCenter().push(this.getSignupTwo())
    },
    toSignupThree: function() {
        this.getMainCenter().push(this.getSignupThree())
    },
    toTstartGameJ: function() {
        this.getMainCenter().push(this.getTstartGameJ())
    }
});

========

明天把电脑弄到公司,把我的电脑配置一下这不得了. 早该这么做了

买个背包,把那几个应用云备份下.  还有一些数据源码.   把手机上的东西 及时处理.每天晚上收尾把东西給云存储下.  提高整理效率!!

现在想做的事,抓紧做. 残留很不好.

=======


0 0
原创粉丝点击