public override void Pay(rechargeData data)
        {
            debug.Log("begin-pay");
            Variant v = new Variant();

            debug.Log("serverId:" + Globle.curServerD.sid);
            v["serverId"]   = Globle.curServerD.sid;
            v["serverIds"]  = Globle.curServerD.sids;
            v["serverName"] = Globle.curServerD.server_name;
            v["serverDesc"] = Globle.curServerD.sid;
            v["roleId"]     = PlayerModel.getInstance().cid;
            v["roleName"]   = PlayerModel.getInstance().name;
            v["productId"]  = data.payid;
            debug.Log("rechargeData:" + RechargeModel.getInstance().getRechargeDataById(data.id));

            debug.Log("name:" + data.name);
            v["productName"]  = data.name;
            v["productPrice"] = data.golden;
            v["productCount"] = 1;
            v["productDesc"]  = "description";
            v["change_rate"]  = 0;
            v["productyb"]    = data.golden_value;

            debug.Log("end-pay");

            string LanPayInfoJsonString = JsonManager.VariantToString(v);

            AnyPlotformSDK.Call_Cmd("pay", "lanPay", LanPayInfoJsonString);
        }
        public override void Pay(rechargeData data)
        {
            // "{\"serverId\":\"300001\",\"serverName\":\"双线1区\",\"serverDesc\":\"s1\",
            // \"roleId\":\"1\",\"roleName\":\"haha\",\"productId\":\"1\",\"productName\":\"asdf\",
            // \"productPrice\":\"1\",\"productCount\":\"1\",\"productDesc\":\"description\",\"change_rate\":\"0\",\"productyb\":\"10\"}";

            debug.Log("begin-pay");
            Variant v = new Variant();

            debug.Log("serverId:" + Globle.curServerD.sid);
            v["gpuid"]          = Globle.YR_srvlists__platuid;
            v["serverId"]       = Globle.curServerD.sid;
            v["serverIds"]      = Globle.curServerD.sids;
            v["serverName"]     = Globle.curServerD.server_name;
            v["serverDesc"]     = Globle.curServerD.sid;
            v["roleId"]         = PlayerModel.getInstance().cid;
            v["roleName"]       = PlayerModel.getInstance().name;
            v["productId"]      = data.payid;
            v["roleCreateTime"] = PlayerModel.getInstance().crttm;
            v["roleLevel"]      = getlv(PlayerModel.getInstance().up_lvl, PlayerModel.getInstance().lvl);

            if (Application.platform == RuntimePlatform.Android)
            {
                v["productShopId"] = data.pay_android_id;
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                v["productShopId"] = data.pay_ios_id;
            }

            debug.Log("rechargeData:" + RechargeModel.getInstance().getRechargeDataById(data.id));

            debug.Log("name:" + data.name);
            v["productName"]  = data.name;
            v["productPrice"] = data.golden;
            v["productCount"] = 1;
            v["productDesc"]  = data.desc1;
            v["change_rate"]  = 0;
            v["productyb"]    = data.golden_value;

            debug.Log("end-pay");

            string LanPayInfoJsonString = JsonManager.VariantToString(v);

            AnyPlotformSDK.Call_Cmd("pay", "lanPay", LanPayInfoJsonString);
        }
Example #3
0
        void onSelfAttchange(Variant msgData)
        {
            debug.Log("属性变换" + msgData.dump());
            if (msgData.ContainsKey("mpleft"))
            {
                PlayerModel.getInstance().modMp(msgData["mpleft"]);
            }
            if (msgData.ContainsKey("hp"))
            {
                PlayerModel.getInstance().modHp(msgData["hp"]);
            }

            if (msgData.ContainsKey("vipcard_life"))
            {
                if (msgData["vipcard_life"] == 1)
                {
                    A3_signProxy.getInstance().yueka = 2;
                }
                else
                {
                    if (msgData.ContainsKey("vipcard_month_end_time"))
                    {
                        if (msgData["vipcard_month_end_time"] <= NetClient.instance.CurServerTimeStamp)
                        {
                            A3_signProxy.getInstance().yueka = 0;
                        }
                        else
                        {
                            A3_signProxy.getInstance().yueka = 1;
                        }
                    }
                }
                if (a3_Recharge.isshow)
                {
                    a3_Recharge.isshow.refre_recharge();
                }
                A3_signProxy.getInstance().sendproxy(1, 0);
            }

            if (msgData.ContainsKey("first_double"))
            {
                foreach (int info in msgData["first_double"]._arr)
                {
                    if (RechargeModel.getInstance().rechargeMenu.ContainsKey(info))
                    {
                        if (RechargeModel.getInstance().rechargeMenu[info].first_double >= 1)
                        {
                            if (!RechargeModel.getInstance().firsted.Contains(info))
                            {
                                RechargeModel.getInstance().firsted.Add(info);
                            }
                        }
                        if (a3_Recharge.isshow)
                        {
                            a3_Recharge.isshow.refre_recharge();
                        }
                    }
                }
            }

            PlayerModel.getInstance().attrChangeCheck(msgData);
            PlayerModel.getInstance().attPointCheck(msgData);
            if (msgData.ContainsKey("max_hp"))
            {
                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modHp", "model/PlayerModel", PlayerModel.getInstance().hp, msgData["max_hp"]._int);
            }
            if (msgData.ContainsKey("max_mp"))
            {
                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modMp", "model/PlayerModel", PlayerModel.getInstance().mp, msgData["max_mp"]._int);
            }
        }
Example #4
0
        //刷新充值种类列表
        public void recharge_Refresh()
        {
            if (retra.Count > 0)
            {
                return;
            }
            GameObject    inem = this.transform.FindChild("buy_bg/item").gameObject;
            RectTransform con  = this.transform.FindChild("buy_bg/scrollview/con").GetComponent <RectTransform>();
            Dictionary <int, rechargeData> data = new Dictionary <int, rechargeData> ();

            data = RechargeModel.getInstance().rechargeMenu;
            int num = 0;

            foreach (int i in data.Keys)
            {
                if (data[i].ka > 0)
                {
                    if (A3_signProxy.getInstance().yueka == 1)
                    {
                        if (data[i].ka == 1)
                        {
                            continue;
                        }
                    }
                    else if (A3_signProxy.getInstance().yueka == 2)
                    {
                        if (data[i].ka == 1 || data[i].ka == 2)
                        {
                            continue;
                        }
                    }
                }

                GameObject clon = (GameObject)Instantiate(inem);
                clon.SetActive(true);
                clon.transform.SetParent(con, false);
                Text name = clon.transform.FindChild("name").GetComponent <Text>();
                name.text = data[i].name;
                Text money = clon.transform.FindChild("money/Text").GetComponent <Text>();
                money.text = "¥" + data[i].golden;
                Text item_text = clon.transform.FindChild("item_text").GetComponent <Text>();

                if (data[i].first_double > 0)
                {
                    clon.transform.FindChild("double").gameObject.SetActive(true);
                }
                else
                {
                    clon.transform.FindChild("double").gameObject.SetActive(false);
                }

                if (RechargeModel.getInstance().firsted.Contains(i))
                {
                    item_text.text = StringUtils.formatText(data[i].desc2);
                    clon.transform.FindChild("double").gameObject.SetActive(false);
                }
                else
                {
                    item_text.text = StringUtils.formatText(data[i].desc);
                }

                clon.transform.FindChild("icon_di/icon_Img").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_recharge_" + data[i].id.ToString());

                rechargeData dta       = data[i];
                BaseButton   btn_monet = new BaseButton(clon.transform.FindChild("money"));
                btn_monet.onClick = delegate(GameObject go) {
                    onEnsure(dta);
                };
                num++;
                retra[i] = clon;
            }
            float   childSizeX = con.GetComponent <GridLayoutGroup>().cellSize.x;
            Vector2 newSize    = new Vector2(num * childSizeX, con.sizeDelta.y);

            con.sizeDelta = newSize;
        }