public ActionResult Index()
        {
            var userId   = CurrentUser.Id;
            var model    = _iMemberInviteService.GetMemberInviteInfo(userId);
            var rule     = _iMemberInviteService.GetInviteRule();
            var Integral = _iMemberIntegralService.GetIntegralChangeRule();

            if (Integral != null && Integral.IntegralPerMoney > 0)
            {
                ViewBag.IntergralMoney = (rule.InviteIntegral / Integral.IntegralPerMoney).ToString("f2");
            }
            string host = CurrentUrlHelper.CurrentUrlNoPort();

            model.InviteLink = String.Format("{0}/Register/index/{1}", host, userId);
            //rule.ShareIcon = string.Format("http://{0}{1}", host, rule.ShareIcon);
            rule.ShareIcon = !string.IsNullOrWhiteSpace(rule.ShareIcon) ? HimallIO.GetRomoteImagePath(rule.ShareIcon) : "";
            var          map = Core.Helper.QRCodeHelper.Create(model.InviteLink);
            MemoryStream ms  = new MemoryStream();

            map.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
            //  将图片内存流转成base64,图片以DataURI形式显示
            string strUrl = "data:image/gif;base64," + Convert.ToBase64String(ms.ToArray());

            ms.Dispose();
            model.QR       = strUrl;
            ViewBag.WeiXin = PlatformType == PlatformType.WeiXin;
            var m = new Tuple <UserInviteModel, Entities.InviteRuleInfo, Entities.MemberInfo>(model, rule, CurrentUser);

            return(View(m));
        }
Exemple #2
0
        public ActionResult InviteRegist(long id = 0, string openId = "", string unionid = "", string serviceProvider = "")
        {
            ViewBag.Introducer = id;
            var memberInfo = _iMemberService.GetMemberByUnionId(unionid);
            var settings   = SiteSettingApplication.SiteSettings;
            var inviteRule = _iMemberInviteService.GetInviteRule();
            var model      = _iMemberIntegralService.GetIntegralChangeRule();
            var perMoney   = model == null ? 0 : model.IntegralPerMoney;

            ViewBag.WXLogo = settings.WXLogo;
            string money;

            if (perMoney > 0)
            {
                money = (Convert.ToDouble(inviteRule.RegIntegral) / perMoney).ToString("f1");
            }
            else
            {
                money = "0.0";
            }


            int isRegist = 0;

            if (memberInfo != null)
            {
                isRegist = 1;
            }
            ViewBag.Money        = money;
            ViewBag.IsRegist     = isRegist;
            ViewBag.RegisterType = settings.RegisterType;
            return(View(inviteRule));
        }
Exemple #3
0
        /// <summary>
        /// 老用户
        /// </summary>
        /// <returns></returns>
        public ActionResult Share()
        {
            var userId = base.UserId;

            if (userId != 0)
            {
                var model    = _iMemberInviteService.GetMemberInviteInfo(userId);
                var rule     = _iMemberInviteService.GetInviteRule();
                var Integral = _iMemberIntegralService.GetIntegralChangeRule();
                if (Integral != null && Integral.IntegralPerMoney > 0)
                {
                    ViewBag.IntergralMoney = (rule.InviteIntegral.Value / Integral.IntegralPerMoney).ToString("f2");
                }
                string host = Request.Url.Host;
                host            += Request.Url.Port != 80 ? ":" + Request.Url.Port.ToString() : "";
                model.InviteLink = String.Format("http://{0}/Register/index/{1}", host, userId);
                //rule.ShareIcon = string.Format("http://{0}{1}", host, rule.ShareIcon);
                //var map = Core.Helper.QRCodeHelper.Create(model.InviteLink);
                //MemoryStream ms = new MemoryStream();
                //map.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
                ////  将图片内存流转成base64,图片以DataURI形式显示
                //string strUrl = "data:image/gif;base64," + Convert.ToBase64String(ms.ToArray());
                //ms.Dispose();
                //model.QR = strUrl;
                var m = new Tuple <UserInviteModel, InviteRuleInfo, UserMemberInfo>(model, rule, CurrentUser);

                return(View(m));
            }
            else
            {
                Response.Redirect("/m-Wap/Login/Entrance?returnUrl=" + HttpUtility.UrlEncode(Request.Url.ToString()));
                return(View());
            }
        }
Exemple #4
0
        public ActionResult Index()
        {
            var userId = CurrentUser.Id;
            var model  = _iMemberInviteService.GetMemberInviteInfo(userId);
            var rule   = _iMemberInviteService.GetInviteRule();

            string host   = Request.Url.Host;
            string scheme = Request.Url.Scheme;

            //host += Request.Url.Port != 80 ? ":"+Request.Url.Port.ToString() : "";
            model.InviteLink = String.Format("{0}://{1}/Register/index/{2}", scheme, host, userId);
            var          map = Core.Helper.QRCodeHelper.Create(model.InviteLink);
            MemoryStream ms  = new MemoryStream();

            map.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
            //  将图片内存流转成base64,图片以DataURI形式显示
            string strUrl = "data:image/gif;base64," + Convert.ToBase64String(ms.ToArray());

            ms.Dispose();
            model.QR = strUrl;
            var m = new Tuple <UserInviteModel, Entities.InviteRuleInfo, Entities.MemberInfo>(model, rule, CurrentUser);

            ViewBag.Keyword  = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword;
            ViewBag.Keywords = SiteSettings.HotKeyWords;
            return(View(m));
        }
Exemple #5
0
        public ActionResult Setting()
        {
            var model = _iMemberInviteService.GetInviteRule();
            //    Mapper.CreateMap<Mall.Entities.InviteRuleInfo, InviteRuleModel>();
            var mapModel = model.Map <InviteRuleModel>();

            return(View(mapModel));
        }
        public ActionResult Setting()
        {
            var model = _iMemberInviteService.GetInviteRule();

            Mapper.CreateMap <InviteRuleInfo, InviteRuleModel>();
            var mapModel = Mapper.Map <InviteRuleInfo, InviteRuleModel>(model);

            return(View(mapModel));
        }
Exemple #7
0
        // GET: Web/Invite
        public ActionResult Index()
        {
            var rule = _iMemberInviteService.GetInviteRule();

            return(View(rule));
        }