/// <summary>
        /// 个人入驻商家信息
        /// </summary>
        /// <returns></returns>
        public ActionResult Steps1()
        {
            long   CompanyRegionId         = 0;
            long   BusinessLicenceRegionId = 0;
            string RefuseReason            = "";
            var    step1 = ShopApplication.GetShopProfileSteps1(CurrentSellerManager.ShopId, out CompanyRegionId, out BusinessLicenceRegionId, out RefuseReason);

            ViewBag.CompanyRegionIds         = RegionApplication.GetRegionPath((int)CompanyRegionId);
            ViewBag.BusinessLicenceRegionIds = RegionApplication.GetRegionPath((int)BusinessLicenceRegionId);
            ViewBag.RefuseReason             = RefuseReason;

            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            //管理员信息
            var model = MemberApplication.GetMembers(uid);

            step1.RealName = model.RealName;
            Mall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
            step1.MemberEmail = mMemberAccountSafety.Email;
            step1.MemberPhone = mMemberAccountSafety.Phone;

            //温馨提示
            ModelState.AddModelError("Phone", "多个联系方式用,号分隔");
            ModelState.AddModelError("ContactPhone", "多个联系方式用,号分隔");
            return(View(step1));
        }
Example #2
0
        /// <summary>
        /// 绑定管理员手机号
        /// </summary>
        /// <returns></returns>
        public JsonResult setPhone(string pluginId, string code, string phone)
        {
            long uid    = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            int  result = MemberApplication.CheckMemberCode(pluginId, code, phone, uid);

            if (result > 0)
            {
                return(Json(new Result()
                {
                    success = true, msg = "修改成功"
                }));
            }
            else if (result == -1)
            {
                return(Json(new Result()
                {
                    success = false, msg = "此联系方式已被绑定!"
                }));
            }
            else
            {
                return(Json(new Result()
                {
                    success = false, msg = "验证码错误"
                }));
            }
        }
Example #3
0
        public JsonResult verificationCode(string pluginId, string code)
        {
            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);

            Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
            string destination = "";

            if (pluginId.Equals("Himall.Plugin.Message.Email"))
            {
                destination = mMemberAccountSafety.Email;
            }
            else
            {
                destination = mMemberAccountSafety.Phone;
            }

            int result = MemberApplication.CheckCode(pluginId, code, destination, uid);

            if (result > 0)
            {
                return(Json(new Result()
                {
                    success = true
                }));
            }
            else
            {
                return(Json(new Result()
                {
                    success = false
                }));
            }
        }
Example #4
0
        public ActionResult Weixin()
        {
            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);

            Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
            ViewBag.MemberEmail = mMemberAccountSafety.Email;
            ViewBag.MemberPhone = mMemberAccountSafety.Phone;
            return(View());
        }
Example #5
0
        public JsonResult EditProfiles1(ShopProfileSteps1 shopProfileStep1)
        {
            //公司信息
            Cache.Remove(CacheKeyCollection.CACHE_SHOP(CurrentSellerManager.ShopId, false));
            Cache.Remove(CacheKeyCollection.CACHE_SHOPDTO(CurrentSellerManager.ShopId, false));
            Himall.DTO.Shop shopInfo = ShopApplication.GetShop(CurrentSellerManager.ShopId);
            shopInfo.Id                   = CurrentSellerManager.ShopId;
            shopInfo.CompanyName          = shopProfileStep1.CompanyName;
            shopInfo.CompanyAddress       = shopProfileStep1.Address;
            shopInfo.CompanyRegionId      = shopProfileStep1.CityRegionId;
            shopInfo.CompanyRegionAddress = shopProfileStep1.Address;
            shopInfo.Stage                = ShopInfo.ShopStage.FinancialInfo;
            shopInfo.BusinessLicenseCert  = Request.Form["BusinessLicenseCert"];
            shopInfo.ProductCert          = Request.Form["ProductCert"];
            shopInfo.OtherCert            = Request.Form["OtherCert"];
            shopInfo.IDCard               = shopProfileStep1.IDCard;
            shopInfo.IDCardUrl            = shopProfileStep1.IDCardUrl;
            shopInfo.IDCardUrl2           = shopProfileStep1.IDCardUrl2;
            ShopApplication.UpdateShop(shopInfo);

            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            //管理员信息
            var model = MemberApplication.GetMemberAccountSafety(uid);

            if (shopProfileStep1.MemberPhone.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证手机!" }));
            }

            //修改真实姓名
            var member = MemberApplication.GetMembers(uid);

            member.RealName = shopProfileStep1.RealName;
            MemberApplication.UpdateMember(member);

            if (shopProfileStep1.MemberPhone != null && !shopProfileStep1.MemberPhone.Equals(model.Phone))
            {
                string pluginId = "Himall.Plugin.Message.SMS";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.PhoneCode, shopProfileStep1.MemberPhone, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "手机验证码错误!"; break;

                case -1: strMsg = "此手机号已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }
            return(Json(new { success = true, msg = "成功!" }));
        }
Example #6
0
        public JsonResult SendCode(string pluginId, string destination)
        {
            long uid    = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            var  member = MemberApplication.GetMembers(uid);
            var  status = MemberApplication.SendMemberCode(pluginId, destination, member.UserName, SiteSettings.SiteName);
            bool result = status == SendMemberCodeReturn.success;

            return(Json(new Result()
            {
                success = result, msg = status.ToDescription()
            }));
        }
Example #7
0
        public ActionResult SendPhoneCode(string pluginId, string destination)
        {
            long uid   = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            var  model = MemberApplication.GetMembers(uid);

            Himall.CommonModel.SendMemberCodeReturn status = MemberApplication.SendMemberCode(pluginId, destination, model.UserName, SiteSettings.SiteName);

            bool bo = status.Equals(Himall.CommonModel.SendMemberCodeReturn.success);

            return(Json(new Result()
            {
                success = bo, msg = status.ToDescription()
            }));
        }
Example #8
0
 public JsonResult Edit5(string RealName)
 {
     if (!RealName.Equals(""))
     {
         long uid    = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
         var  member = MemberApplication.GetMembers(uid);
         member.RealName = RealName;
         MemberApplication.UpdateMember(member);
         return(Json(new { success = true }));
     }
     else
     {
         return(Json(new { success = false, msg = "真实姓名不能为空" }));
     }
 }
Example #9
0
        public ActionResult SendCode(string pluginId, string destination)
        {
            long uid   = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            var  model = MemberApplication.GetMembers(uid);

            if (!MemberApplication.SendCode(pluginId, destination, model.UserName, SiteSettings.SiteName))
            {
                return(Json(new Result()
                {
                    success = false, msg = "120秒内只允许请求一次,请稍后重试!"
                }));
            }
            return(Json(new Result()
            {
                success = true, msg = "发送成功"
            }));
        }
Example #10
0
        /// <summary>
        /// 个人或企业账户信息
        /// </summary>
        /// <returns></returns>
        public ActionResult Step3()
        {
            var modelShop = ShopApplication.GetShop(CurrentSellerManager.ShopId);

            #region 个人/企业信息
            long   companyRegionId         = 0;
            long   businessLicenceRegionId = 0;
            string refuseReason            = "";
            if (modelShop.BusinessType.Equals(Himall.CommonModel.ShopBusinessType.Personal))
            {
                var step1 = ShopApplication.GetShopProfileSteps1(CurrentSellerManager.ShopId, out companyRegionId, out businessLicenceRegionId, out refuseReason);
                ViewBag.CompanyRegionIds = RegionApplication.GetRegionPath((int)companyRegionId);
                ViewBag.RefuseReason     = refuseReason;
                ViewBag.fullName         = RegionApplication.GetFullName((int)companyRegionId);

                long uid   = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
                var  model = MemberApplication.GetMembers(uid);
                step1.RealName = model.RealName;
                Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
                step1.MemberEmail = mMemberAccountSafety.Email;
                step1.MemberPhone = mMemberAccountSafety.Phone;

                ModelState.AddModelError("Phone", "多个联系方式用,号分隔");
                ModelState.AddModelError("ContactPhone", "多个联系方式用,号分隔");
                return(View("Steps3", step1));
            }
            else
            {
                var step1 = ShopApplication.GetShopProfileStep1(CurrentSellerManager.ShopId, out companyRegionId, out businessLicenceRegionId, out refuseReason);
                ViewBag.CompanyRegionIds = RegionApplication.GetRegionPath((int)companyRegionId);
                ViewBag.RefuseReason     = refuseReason;
                ViewBag.fullName         = RegionApplication.GetFullName((int)companyRegionId);

                long uid   = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
                var  model = MemberApplication.GetMembers(uid);
                step1.RealName = model.RealName;
                Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
                step1.MemberEmail = mMemberAccountSafety.Email;
                step1.MemberPhone = mMemberAccountSafety.Phone;

                ModelState.AddModelError("Phone", "多个联系方式用,号分隔");
                ModelState.AddModelError("ContactPhone", "多个联系方式用,号分隔");
                return(View(step1));
            }
            #endregion
        }
Example #11
0
        public JsonResult getWinxin(string pluginId, string destination)
        {
            long uid         = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            var  siteSetting = SiteSettingApplication.SiteSettings;

            //微信二维码
            if (string.IsNullOrWhiteSpace(siteSetting.WeixinAppId) || string.IsNullOrWhiteSpace(siteSetting.WeixinAppSecret))
            {
                throw new HimallException("未配置公众号参数");
            }
            var token = AccessTokenContainer.TryGetToken(siteSetting.WeixinAppId, siteSetting.WeixinAppSecret);

            SceneModel scene = new SceneModel(QR_SCENE_Type.Binding)
            {
                Object = uid.ToString()
            };
            SceneHelper helper  = new SceneHelper();
            var         sceneid = helper.SetModel(scene);
            var         ticket  = Senparc.Weixin.MP.AdvancedAPIs.QrCode.QrCodeApi.Create(token, 300, sceneid);

            return(Json(new { success = true, msg = "成功", ticket = ticket.ticket, Sceneid = sceneid }));
        }
Example #12
0
        public ActionResult ShopDetail()
        {
            //Note:DZY[151010] 有form数据返回,传参暂时不能改
            var shopid = CurrentSellerManager.ShopId;
            var shop   = _iShopService.GetShop(shopid, true);
            var model  = new ShopModel(shop);

            model.BusinessCategory = new List <CategoryKeyVal>();
            foreach (var key in shop.BusinessCategory.Keys)
            {
                model.BusinessCategory.Add(new CategoryKeyVal
                {
                    CommisRate = shop.BusinessCategory[key],
                    Name       = _iCategoryService.GetCategory(key).Name
                });
            }
            ViewBag.CompanyRegionIds    = _iRegionService.GetRegionPath(shop.CompanyRegionId);
            ViewBag.BusinessLicenseCert = shop.BusinessLicenseCert;
            //var model= _iShopService.GetShopBasicInfo(shopid);

            string businessLicenseCerts = "";
            string productCerts         = "";
            string otherCerts           = "";

            for (int i = 0; i < 3; i++)
            {
                if (HimallIO.ExistFile(shop.BusinessLicenseCert + string.Format("{0}.png", i + 1)))
                {
                    businessLicenseCerts += HimallIO.GetImagePath(shop.BusinessLicenseCert + string.Format("{0}.png", i + 1)) + ",";
                }
                else
                {
                    businessLicenseCerts += "null,";
                }
                if (HimallIO.ExistFile(shop.ProductCert + string.Format("{0}.png", i + 1)))
                {
                    productCerts += HimallIO.GetImagePath(shop.ProductCert + string.Format("{0}.png", i + 1)) + ",";
                }
                else
                {
                    productCerts += "null,";
                }
                if (HimallIO.ExistFile(shop.OtherCert + string.Format("{0}.png", i + 1)))
                {
                    otherCerts = HimallIO.GetImagePath(shop.OtherCert + string.Format("{0}.png", i + 1)) + ",";
                }
                else
                {
                    otherCerts += "null,";
                }
            }
            ViewBag.BusinessLicenseCerts = businessLicenseCerts.TrimEnd(',');
            ViewBag.ProductCerts         = productCerts.TrimEnd(',');
            ViewBag.OtherCerts           = otherCerts.TrimEnd(',');

            //管理员信息
            long uid   = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            var  mUser = MemberApplication.GetMembers(uid);

            ViewBag.RealName = mUser.RealName;
            Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
            ViewBag.MemberEmail = mMemberAccountSafety.Email;
            ViewBag.MemberPhone = mMemberAccountSafety.Phone;

            if (model.BusinessType.Equals(Himall.CommonModel.ShopBusinessType.Enterprise))
            {
                return(View(model));
            }
            else
            {
                return(View("ShopPersonalDetail", model));
            }
        }
Example #13
0
        public JsonResult EditProfiles1(ShopProfileSteps1 shopProfileStep1)
        {
            //公司信息
            Mall.DTO.Shop shopInfo = ShopApplication.GetShop(CurrentSellerManager.ShopId);
            shopInfo.Id                   = CurrentSellerManager.ShopId;
            shopInfo.CompanyName          = shopProfileStep1.CompanyName;
            shopInfo.CompanyAddress       = shopProfileStep1.Address;
            shopInfo.CompanyRegionId      = shopProfileStep1.CityRegionId;
            shopInfo.CompanyRegionAddress = shopProfileStep1.Address;
            shopInfo.Stage                = Entities.ShopInfo.ShopStage.CompanyInfo;
            shopInfo.BusinessLicenseCert  = Request.Form["BusinessLicenseCert"];
            shopInfo.ProductCert          = Request.Form["ProductCert"];
            shopInfo.OtherCert            = Request.Form["OtherCert"];
            shopInfo.IDCard               = shopProfileStep1.IDCard;
            shopInfo.IDCardUrl            = shopProfileStep1.IDCardUrl;
            shopInfo.IDCardUrl2           = shopProfileStep1.IDCardUrl2;

            ShopApplication.UpdateShop(shopInfo);

            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            //管理员信息
            var mTheme = ShopApplication.GetSettled();
            var model  = MemberApplication.GetMemberAccountSafety(uid);

            if (!mTheme.SelfVerificationType.Equals(Mall.CommonModel.VerificationType.VerifyEmail) && shopProfileStep1.MemberPhone.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证手机!" }));
            }
            if (!mTheme.SelfVerificationType.Equals(Mall.CommonModel.VerificationType.VerifyPhone) && shopProfileStep1.MemberEmail.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证邮箱!" }));
            }

            //修改真实姓名
            var member = MemberApplication.GetMembers(uid);

            member.RealName = shopProfileStep1.RealName;
            MemberApplication.UpdateMember(member);

            //手机认证
            if (shopProfileStep1.MemberPhone != null && !shopProfileStep1.MemberPhone.Equals(model.Phone))
            {
                string pluginId = "Mall.Plugin.Message.SMS";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.PhoneCode, shopProfileStep1.MemberPhone, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "手机验证码错误!"; break;

                case -1: strMsg = "此手机号已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }

            //邮箱认证
            if (shopProfileStep1.MemberEmail != null && !shopProfileStep1.MemberEmail.ToString().Equals(model.Email))
            {
                string pluginId = "Mall.Plugin.Message.Email";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.EmailCode, shopProfileStep1.MemberEmail, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "邮箱验证码错误!"; break;

                case -1: strMsg = "此邮箱已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }


            ShopApplication.SetShopStage(Entities.ShopInfo.ShopStage.FinancialInfo, CurrentSellerManager.ShopId);//设置成功,则才是进入财务信息
            return(Json(new { success = true, msg = "成功!" }));
        }
Example #14
0
        public JsonResult EditProfile1(ShopProfileStep1 shopProfileStep1)
        {
            if (ShopApplication.ExistCompanyName(shopProfileStep1.CompanyName, CurrentSellerManager.ShopId))
            {
                return(Json(new { success = false, msg = "该公司名已存在!" }));
            }
            if (ShopApplication.ExistBusinessLicenceNumber(shopProfileStep1.BusinessLicenceNumber, CurrentSellerManager.ShopId))
            {
                return(Json(new { success = false, msg = "该营业执照号已存在!" }));
            }

            //公司信息
            Mall.DTO.Shop shopInfo = ShopApplication.GetShop(CurrentSellerManager.ShopId);
            shopInfo.Id                         = CurrentSellerManager.ShopId;
            shopInfo.CompanyName                = shopProfileStep1.CompanyName;
            shopInfo.CompanyAddress             = shopProfileStep1.Address;
            shopInfo.CompanyRegionId            = shopProfileStep1.CityRegionId;
            shopInfo.CompanyRegionAddress       = shopProfileStep1.Address;
            shopInfo.CompanyPhone               = shopProfileStep1.Phone;
            shopInfo.CompanyEmployeeCount       = shopProfileStep1.EmployeeCount;
            shopInfo.CompanyRegisteredCapital   = shopProfileStep1.RegisterMoney;
            shopInfo.ContactsName               = shopProfileStep1.ContactName;
            shopInfo.ContactsPhone              = shopProfileStep1.ContactPhone;
            shopInfo.ContactsEmail              = shopProfileStep1.Email;
            shopInfo.BusinessLicenceNumber      = shopProfileStep1.BusinessLicenceNumber;
            shopInfo.BusinessLicenceRegionId    = shopProfileStep1.BusinessLicenceArea;
            shopInfo.BusinessLicenceStart       = shopProfileStep1.BusinessLicenceValidStart;
            shopInfo.BusinessLicenceEnd         = shopProfileStep1.BusinessLicenceValidEnd;
            shopInfo.BusinessSphere             = shopProfileStep1.BusinessSphere;
            shopInfo.BusinessLicenceNumberPhoto = shopProfileStep1.BusinessLicenceNumberPhoto;
            shopInfo.OrganizationCode           = shopProfileStep1.OrganizationCode;
            shopInfo.OrganizationCodePhoto      = shopProfileStep1.OrganizationCodePhoto;
            shopInfo.GeneralTaxpayerPhot        = shopProfileStep1.GeneralTaxpayerPhoto;
            shopInfo.Stage                      = Entities.ShopInfo.ShopStage.CompanyInfo;
            shopInfo.BusinessLicenseCert        = Request.Form["BusinessLicenseCert"];
            shopInfo.ProductCert                = Request.Form["ProductCert"];
            shopInfo.OtherCert                  = Request.Form["OtherCert"];
            shopInfo.legalPerson                = shopProfileStep1.legalPerson;
            shopInfo.CompanyFoundingDate        = shopProfileStep1.CompanyFoundingDate;

            ShopApplication.UpdateShop(shopInfo);

            //管理员信息
            long uid    = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            var  mTheme = ShopApplication.GetSettled();
            var  model  = MemberApplication.GetMemberAccountSafety(uid);

            if (!mTheme.CompanyVerificationType.Equals(VerificationType.VerifyEmail) && shopProfileStep1.MemberPhone.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证手机!" }));
            }
            if (!mTheme.CompanyVerificationType.Equals(Mall.CommonModel.VerificationType.VerifyPhone) && shopProfileStep1.MemberEmail.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证邮箱!" }));
            }

            //修改真实姓名
            var member = MemberApplication.GetMembers(uid);

            member.RealName = shopProfileStep1.RealName;
            MemberApplication.UpdateMember(member);

            //手机认证
            if (!shopProfileStep1.MemberPhone.Equals(model.Phone))
            {
                string pluginId = "Mall.Plugin.Message.SMS";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.PhoneCode, shopProfileStep1.MemberPhone, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "手机验证码错误!"; break;

                case -1: strMsg = "此手机号已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }

            //邮箱认证
            if (!shopProfileStep1.MemberEmail.Equals(model.Email))
            {
                string pluginId = "Mall.Plugin.Message.Email";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.EmailCode, shopProfileStep1.MemberEmail, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "邮箱验证码错误!"; break;

                case -1: strMsg = "此邮箱已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }

            ShopApplication.SetShopStage(Entities.ShopInfo.ShopStage.FinancialInfo, CurrentSellerManager.ShopId);//设置成功,则才是进入财务信息

            return(Json(new { success = true, msg = "成功!" }));
        }