Ejemplo n.º 1
0
        /// <summary>
        /// A8选区
        /// </summary>
        /// <param name="zoneCache"></param>
        private void SelectZoneA8(AllZoneinfoEntity zoneCache)
        {
            pf      = GetParam("pf");
            pfUrl   = zoneCache.ChargeUrl.Replace("pf", pf == "" ? "h5_a8" : pf);       //pfurl 是js文件  暂时占用chargeurl字段
            GetHost = Request.Url.AbsoluteUri.Split('?')[0].Replace("/Index.aspx", ""); //前端需要的域名

            openid       = GetParamNOUrlDecode("openid");
            state        = GetParam("state");
            nowTimestamp = GetParam("nowTimestamp");
            sessionId    = GetParam("sessionId");
            sign         = GetParam("sign");
            jsNeed       = GetParam("jsNeed");
            nickName     = GetParam("nickName");
            string qqOpenid    = GetParam("qqopenid");
            string qqOpenkey   = GetParam("qqopenkey");
            string qqPf        = GetParam("qqpf");
            string platform    = GetParam("platform");
            string share       = GetParam("share");
            string shareType   = GetParam("shareType");
            string isSubscribe = GetParam("isSubscribe");

            string isShare = GetParam("isShare");

            openid  = UAHelper.StrToUtf8(openid);
            skipUrl =
                string.Format(
                    "pfurl={0}&pf={1}&isSelectZone=1&nickName={2}&sessionId={3}&jsNeed={4}&state={5}&openid={6}&nowTimestamp={7}&httpRoot={8}&sign={9}&qqopenid={10}&qqopenkey={11}&qqpf={12}&platform={13}&share={14}&shareType={15}&isSubscribe={16}&isShare={17}",
                    pfUrl, pf, nickName, sessionId, jsNeed, state, openid, nowTimestamp, GetHost, sign, qqOpenid,
                    qqOpenkey, qqPf, platform, share, shareType, isSubscribe, isShare);
        }
Ejemplo n.º 2
0
        private void BuyPoint()
        {
            var teststr  = "11111";
            int mallcode = GetParamInt("mallcode");
            var resp     = reader.BuyPoint(UserAccount.ManagerId, mallcode);

            if (resp.Code == (int)MessageCode.Success && (ShareUtil.IsH5A8 || ShareUtil.IsTx))
            {
                try
                {
                    var pf   = UAFactory.Instance.GetPlatform(UAFactory.Instance.FactoryName);
                    var zone = UAFactory.Instance.GetZoneByZoneName(UAFactory.Instance.ZoneName);

                    //以下a8传参
                    var    itemId       = "";
                    var    url          = UAFactory.Instance.GetRedirectURL(UAFactory.Instance.FactoryName, "charge");
                    var    chargeKey    = pf.ChargeKey;
                    var    channelAlias = resp.Data.ChannelAlias;
                    string serverId     = "";
                    string serverName   = "";
                    var    qqOpenid     = "";
                    var    qqOpenkey    = "";
                    var    qqPf         = "";
                    var    platform     = "";
                    bool   isvip        = false;
                    if (zone != null)
                    {
                        serverId   = zone.PlatformZoneName;
                        serverName = zone.Name;
                    }
                    var ext     = resp.Data.Ext;
                    var openId3 = UserAccount.Account;
                    var oId     = UAHelper.StrToUtf8(openId3);
                    resp.Data.AccountId  = oId;
                    resp.Data.ServerId   = serverId;
                    resp.Data.ServerName = serverName;
                    resp.Data.IsJump     = false;
                    var score   = 0;
                    var zoneidd = "";
                    var appId   = AppsettingCache.Instance.GetAppSetting(EnumAppsetting.TxWb_AppId);
                    if (ShareUtil.IsTx)
                    {
                        var strCommon = resp.Data.StrCommon;

                        if (strCommon != null)
                        {
                            var strlist = strCommon.Split('|');

                            qqOpenid  = strlist[0];
                            qqOpenkey = strlist[1];
                            qqPf      = strlist[2];
                            platform  = strlist[3];
                        }
                        itemId = GetTxItemId(resp.Data.ItemCode, platform, ref zoneidd);
                    }
                    else
                    {
                        itemId = "" + resp.Data.ItemCode;
                    }

                    var str = "appKey=" + chargeKey + "&gameOrderId=" + resp.Data.OrderId + "&price=" +
                              resp.Data.Cash + "&" +
                              "goodsName=" + resp.Data.ItemName + "&" +
                              "goodsId=" + itemId + "&title=" + resp.Data.ItemName + "&csdkId=" +
                              (int)A8csdkEnum.csdkId + "&" +
                              "channelAlias=" + channelAlias + "&subChannel=&serverId=" + serverId + "&" +
                              "serverName=" + serverName + "&roleId=" + UserAccount.ManagerId + "&roleName=" +
                              resp.Data.DateEntity.Name + "&" +
                              "roleLevel=" + resp.Data.DateEntity.Level + "&sessionId=" + resp.Data.SessionId +
                              "&model=&release=&deviceId=" + resp.Data.IP + "&ext=" + ext +
                              "&uid=" + oId;

                    var result = UAHelper.HttpPost(url, str);
                    if (result.Length > 0)
                    {
                        JavaScriptSerializer serializer = new JavaScriptSerializer();
                        var json = serializer.Deserialize <JsonResult>(result);
                        if (json != null)
                        {
                            var ret = json.ret;
                            if (string.IsNullOrEmpty(ret))
                            {
                                resp.Code = (int)MessageCode.BuyPointFail;
                            }
                            else if (ret == "fail")
                            {
                                resp.Code = (int)MessageCode.BuyPointFail;
                            }
                            else if (ret == "success")
                            {
                                resp.PR   = json.payURL;
                                resp.Code = (int)MessageCode.Success;
                                var resultTx = "";
                                if (ShareUtil.IsTx)    //是否腾讯玩吧接口
                                {
                                    resultTx  = TxBuyItem(resp.Data, qqOpenid, qqOpenkey, qqPf, platform, itemId);
                                    resp.Code = IsSuccess(resultTx);
                                    SetVipInfo(UserAccount.Account, qqOpenid, qqOpenkey, qqPf, platform, ref score, ref isvip);
                                }
                                if (resp.Code == (int)MessageCode.NotSufficientFunds)
                                {
                                    var cash = resp.Data.Cash;
                                    resp.Data.IsJump  = true;
                                    resp.Data.Is_vip  = isvip;
                                    resp.Data.OpenId  = qqOpenid;
                                    resp.Data.OpenKey = qqOpenkey;
                                    resp.Data.Score   = score;
                                    if (isvip)
                                    {
                                        resp.Data.DefaultScore = "" + (double)cash * 0.8 / 10;  //价格单位  由分  改成1:10的 星星(达人传8折)
                                    }
                                    else
                                    {
                                        resp.Data.DefaultScore = "" + (double)cash / 10;    //价格单位  由分  改成1:10的 星星
                                    }
                                    resp.Data.AppId  = appId;
                                    resp.Data.ZoneId = zoneidd;
                                    resp.Code        = (int)MessageCode.Success;
                                }
                            }
                        }
                        else
                        {
                            resp.Code = (int)MessageCode.BuyPointFail;
                        }
                    }
                    else
                    {
                        resp.Code = (int)MessageCode.BuyPointFail;
                    }
                }
                catch (Exception ex)
                {
                    SystemlogMgr.Error("下单", ex);
                    resp.Code = (int)MessageCode.BuyPointFail;
                }
            }
            //小熊接口没有serverId字段
            if (ShareUtil.IsBear)
            {
                var s = resp.Data.ServerId;
                var o = resp.Data.OrderId;
                resp.Data.Ext = o + "|" + s;
            }
            if (ShareUtil.IsQunHei)
            {
                var pf = UAFactory.Instance.GetPlatform(UAFactory.Instance.FactoryName);
                resp.PR = pf.ChargeUrl;
            }
            OutputHelper.Output(resp);
        }