Пример #1
0
        public ActionResult SubmiteByCart(string cartItemIds)
        {
            MobileOrderDetailConfirmModel mobileSubmiteByCart = OrderApplication.GetMobileSubmiteByCart(base.UserId, cartItemIds);

            ViewBag.InvoiceContext   = mobileSubmiteByCart.InvoiceContext;
            ViewBag.InvoiceTitle     = mobileSubmiteByCart.InvoiceTitle;
            ViewBag.IsCashOnDelivery = mobileSubmiteByCart.IsCashOnDelivery;
            ViewBag.address          = mobileSubmiteByCart.Address;
            ViewBag.ConfirmModel     = mobileSubmiteByCart;
            string str = Guid.NewGuid().ToString("N");

            ViewBag.OrderTag         = str;
            base.Session["OrderTag"] = str;
            this.InitOrderSubmitModel(mobileSubmiteByCart);
            ViewBag.IsOpenStore = (SiteSettingApplication.GetSiteSettings() != null) && SiteSettingApplication.GetSiteSettings().IsOpenStore;
            bool flag = false;

            if (mobileSubmiteByCart.products != null)
            {
                foreach (MobileShopCartItemModel model2 in mobileSubmiteByCart.products)
                {
                    if (model2.shopId > 0L)
                    {
                        ShopInfo shop = ShopApplication.GetShop(model2.shopId, false);
                        if (!(!shop.ProvideInvoice.HasValue ? true : !shop.ProvideInvoice.Value))
                        {
                            flag = true;
                        }
                    }
                }
            }
            ViewBag.ProvideInvoice = flag;
            return(base.View("submit"));
        }
Пример #2
0
        /// <summary>
        /// 进入购物车提交页面
        /// </summary>
        /// <param name="cartItemIds">购物车物品id集合</param>
        public ActionResult SubmiteByCart(string cartItemIds, long shippingAddressId = 0, string couponIds = "")
        {
            var coupons = CouponApplication.ConvertUsedCoupon(couponIds);
            var result  = OrderApplication.GetMobileSubmiteByCart(UserId, cartItemIds, shippingAddressId, coupons);

            ViewBag.InvoiceContext   = result.InvoiceContext;
            ViewBag.InvoiceTitle     = result.InvoiceTitle;
            ViewBag.IsCashOnDelivery = result.IsCashOnDelivery;
            ViewBag.address          = null == result.Address || result.Address.NeedUpdate ? null : result.Address;
            ViewBag.ConfirmModel     = result;

            var orderTag = Guid.NewGuid().ToString("N");

            ViewBag.OrderTag    = orderTag;
            Session["OrderTag"] = orderTag;

            InitOrderSubmitModel(result);
            #region 是否开启门店授权
            ViewBag.IsOpenStore = SiteSettingApplication.SiteSettings != null && SiteSettingApplication.SiteSettings.IsOpenStore;
            #endregion
            #region TDO:ZYF 3.2注释是否提供发票
            //bool ProvideInvoice = false;
            //if (result.products != null)
            //    ProvideInvoice = ShopApplication.HasProvideInvoice(result.products.Select(p => p.shopId).ToList());
            //ViewBag.ProvideInvoice = ProvideInvoice;
            #endregion

            bool canIntegralPerMoney = true, canCapital = true;
            CanDeductible(out canIntegralPerMoney, out canCapital);
            ViewBag.CanIntegralPerMoney = canIntegralPerMoney;
            ViewBag.CanCapital          = canCapital;
            return(View("submit"));
        }
Пример #3
0
        /// <summary>
        /// 进入购物车提交页面
        /// </summary>
        /// <param name="cartItemIds">购物车物品id集合</param>
        public ActionResult SubmiteByCart(string cartItemIds, long shippingAddressId = 0, string couponIds = "")
        {
            var coupons = CouponApplication.ConvertUsedCoupon(couponIds);
            var result  = OrderApplication.GetMobileSubmiteByCart(UserId, cartItemIds, shippingAddressId, coupons);

            ViewBag.InvoiceContext   = result.InvoiceContext;
            ViewBag.InvoiceTitle     = result.InvoiceTitle;
            ViewBag.IsCashOnDelivery = result.IsCashOnDelivery;
            ViewBag.address          = null == result.Address || result.Address.NeedUpdate ? null : result.Address;
            ViewBag.ConfirmModel     = result;
            if (result.products.Count == 0)
            {
                return(Redirect("/" + ViewBag.AreaName));
            }

            if (result.shopBranchInfo == null)
            {
                throw new MallException("获取门店信息失败,不可提交非门店商品");
            }


            var orderTag = Guid.NewGuid().ToString("N");

            ViewBag.OrderTag = orderTag;
            HttpContext.Session.Set <string>("OrderTag", orderTag);

            InitOrderSubmitModel(result);
            #region 是否开启门店授权
            ViewBag.IsOpenStore = SiteSettingApplication.SiteSettings != null && SiteSettingApplication.SiteSettings.IsOpenStore;
            #endregion
            #region 是否提供发票
            bool ProvideInvoice = false;
            if (result.products != null)
            {
                ProvideInvoice = ShopApplication.HasProvideInvoice(result.products.Select(p => p.shopId).ToList());
            }
            ViewBag.ProvideInvoice = ProvideInvoice;
            #endregion

            bool canIntegralPerMoney = true, canCapital = true;
            CanDeductible(out canIntegralPerMoney, out canCapital);
            ViewBag.CanIntegralPerMoney = canIntegralPerMoney;
            ViewBag.CanCapital          = canCapital;
            ViewBag.productType         = 0;
            ViewBag.ShipperAddress      = "";
            ViewBag.ShipperTelPhone     = "";

            return(View("submit"));
        }
        public object GetSubmitByCartModel(string cartItemIds = "")
        {
            this.CheckUserLogin();
            MobileOrderDetailConfirmModel mobileSubmiteByCart = OrderApplication.GetMobileSubmiteByCart(this.CurrentUserId, cartItemIds);

            if (mobileSubmiteByCart.shopBranchInfo == null)
            {
                throw new HimallException("获取门店信息失败,不可提交非门店商品");
            }
            ShopBranch shopBranchById = ShopBranchApplication.GetShopBranchById(mobileSubmiteByCart.shopBranchInfo.Id);
            object     obj1           = (object)new ExpandoObject();
            object     obj2;

            if (mobileSubmiteByCart.Address != null)
            {
                string str = mobileSubmiteByCart.Address.AddressDetail ?? "";
                var    fAnonymousType30 = new
                {
                    Id       = mobileSubmiteByCart.Address.Id,
                    ShipTo   = mobileSubmiteByCart.Address.ShipTo,
                    Phone    = mobileSubmiteByCart.Address.Phone,
                    Address  = mobileSubmiteByCart.Address.RegionFullName + " " + mobileSubmiteByCart.Address.Address + " " + str,
                    RegionId = mobileSubmiteByCart.Address.RegionId
                };
                obj2 = (object)fAnonymousType30;
            }
            else
            {
                obj2 = (object)null;
            }
            return((object)this.Json(new
            {
                Success = "true",
                Address = obj2,
                IsCashOnDelivery = mobileSubmiteByCart.IsCashOnDelivery,
                InvoiceContext = mobileSubmiteByCart.InvoiceContext,
                InvoiceTitle = OrderApplication.GetInvoiceTitles(this.CurrentUserId),
                products = mobileSubmiteByCart.products,
                integralPerMoney = mobileSubmiteByCart.integralPerMoney,
                userIntegrals = mobileSubmiteByCart.userIntegrals,
                TotalAmount = mobileSubmiteByCart.totalAmount,
                Freight = mobileSubmiteByCart.Freight,
                orderAmount = mobileSubmiteByCart.orderAmount,
                shopBranchInfo = shopBranchById,
                IsOpenStore = SiteSettingApplication.GetSiteSettings() != null && SiteSettingApplication.GetSiteSettings().IsOpenStore,
                capitalAmount = mobileSubmiteByCart.capitalAmount
            }));
        }
Пример #5
0
        /// <summary>
        /// 获取购物车提交页面的数据
        /// </summary>
        /// <param name="cartItemIds">购物车物品id集合</param>
        /// <returns></returns>
        object GetSubmitByCartModel(string cartItemIds = "")
        {
            CheckUserLogin();
            var result = OrderApplication.GetMobileSubmiteByCart(CurrentUserId, cartItemIds);

            //解决循环引用的序列化的问题
            dynamic address = new System.Dynamic.ExpandoObject();

            if (result.Address != null)
            {
                var add = new
                {
                    ShippingId     = result.Address.Id,
                    ShipTo         = result.Address.ShipTo,
                    CellPhone      = result.Address.Phone,
                    FullRegionName = result.Address.RegionFullName,
                    FullAddress    = result.Address.RegionFullName + " " + result.Address.Address,
                    Address        = result.Address.Address,
                    RegionId       = result.Address.RegionId
                };
                address = add;
            }
            else
            {
                address = null;
            }

            return(Json(new
            {
                Status = "OK",
                Data = new
                {
                    Address = address,
                    IsCashOnDelivery = result.IsCashOnDelivery,
                    InvoiceContext = result.InvoiceContext,
                    products = result.products,
                    integralPerMoney = result.integralPerMoney,
                    userIntegrals = result.userIntegrals,
                    TotalAmount = result.totalAmount,
                    Freight = result.Freight,
                    orderAmount = result.orderAmount,
                    IsOpenStore = SiteSettingApplication.GetSiteSettings() != null && SiteSettingApplication.GetSiteSettings().IsOpenStore
                }
            }));
        }
Пример #6
0
        /// <summary>
        /// 进入购物车提交页面
        /// </summary>
        /// <param name="cartItemIds">购物车物品id集合</param>
        public ActionResult SubmiteByCart(string cartItemIds)
        {
            var result = OrderApplication.GetMobileSubmiteByCart(UserId, cartItemIds);

            ViewBag.InvoiceContext   = result.InvoiceContext;
            ViewBag.IsCashOnDelivery = result.IsCashOnDelivery;
            ViewBag.address          = result.Address;
            ViewBag.ConfirmModel     = result;

            var orderTag = Guid.NewGuid().ToString("N");

            ViewBag.OrderTag    = orderTag;
            Session["OrderTag"] = orderTag;

            InitOrderSubmitModel(result);
            #region 是否开启门店授权
            ViewBag.IsOpenStore = SiteSettingApplication.GetSiteSettings() != null && SiteSettingApplication.GetSiteSettings().IsOpenStore;
            #endregion

            return(View("submit"));
        }
Пример #7
0
        public object GetSubmitByCartModel(string cartItemIds = "", long shippingAddressId = 0, string couponIds = "")
        {
            CheckUserLogin();
            var coupons = CouponApplication.ConvertUsedCoupon(couponIds);
            var result = OrderApplication.GetMobileSubmiteByCart(CurrentUserId, cartItemIds, shippingAddressId, coupons);
            //门店订单
            Mall.DTO.ShopBranch storeInfo = null;
            if (result.shopBranchInfo == null)
                throw new MallException("获取门店信息失败,不可提交非门店商品");
            else
            {
                storeInfo = Application.ShopBranchApplication.GetShopBranchById(result.shopBranchInfo.Id);
            }

            //解决循环引用的序列化的问题
            dynamic address = new System.Dynamic.ExpandoObject();
            if (result.Address != null)
            {
                var addDetail = result.Address.AddressDetail ?? "";
                var add = new
                {
                    Id = result.Address.Id,
                    ShipTo = result.Address.ShipTo,
                    Phone = result.Address.Phone,
                    Address = result.Address.RegionFullName + " " + result.Address.Address + " " + addDetail,
                    RegionId = result.Address.RegionId
                };
                address = add;
            }
            else
                address = null;

            bool canIntegralPerMoney = true, canCapital = true;
            CanDeductible(out canIntegralPerMoney, out canCapital);

            var _result = new
            {
                success = true,
                Address = address,
                IsCashOnDelivery = result.IsCashOnDelivery,
                InvoiceContext = result.InvoiceContext,
                InvoiceTitle = result.InvoiceTitle,
                cellPhone = result.cellPhone,
                email = result.email,
                vatInvoice = result.vatInvoice,
                invoiceName = result.invoiceName,//默认抬头(普通、电子)
                invoiceCode = result.invoiceCode,//默认税号(普通、电子)
                products = result.products,
                TotalAmount = result.totalAmount,
                Freight = result.Freight,
                orderAmount = result.orderAmount,
                shopBranchInfo = storeInfo,
                IsOpenStore = SiteSettingApplication.SiteSettings != null && SiteSettingApplication.SiteSettings.IsOpenStore,
                capitalAmount = result.capitalAmount,
                ProvideInvoice = ShopApplication.HasProvideInvoice(result.products.Select(s => s.shopId).Distinct().ToList()),

                integralPerMoney = result.integralPerMoney,
                userIntegralMaxDeductible = result.userIntegralMaxDeductible,
                integralPerMoneyRate = result.integralPerMoneyRate,
                userIntegralMaxRate = SiteSettingApplication.SiteSettings.IntegralDeductibleRate,
                userIntegrals = result.userIntegrals,
                TotalMemberIntegral = result.memberIntegralInfo.AvailableIntegrals,
                canIntegralPerMoney = canIntegralPerMoney,
                canCapital = canCapital
            };
            return _result;
        }
Пример #8
0
        /// <summary>
        /// 获取购物车提交页面的数据
        /// </summary>
        /// <param name="cartItemIds">购物车物品id集合</param>
        /// <returns></returns>
        object GetSubmitByCartModel(string cartItemIds = "", long shippingAddressId = 0, IEnumerable <string[]> CouponIdsStr = null, bool isStore = false)
        {
            CheckUserLogin();
            var result = OrderApplication.GetMobileSubmiteByCart(CurrentUserId, cartItemIds, shippingAddressId, CouponIdsStr);

            Mall.DTO.ShopBranch storeInfo = null;
            if (isStore)
            {
                if (result.shopBranchInfo == null)
                {
                    throw new MallException("获取门店信息失败,不可提交非门店商品");
                }
                else
                {
                    storeInfo = Application.ShopBranchApplication.GetShopBranchById(result.shopBranchInfo.Id);
                }
            }
            //解决循环引用的序列化的问题
            dynamic address = new System.Dynamic.ExpandoObject();

            if (result.Address != null)
            {
                var add = new
                {
                    ShippingId     = result.Address.Id,
                    ShipTo         = result.Address.ShipTo,
                    CellPhone      = result.Address.Phone,
                    FullRegionName = result.Address.RegionFullName,
                    FullAddress    = result.Address.RegionFullName + " " + result.Address.Address + " " + result.Address.AddressDetail,
                    Address        = result.Address.Address,
                    RegionId       = result.Address.RegionId
                };
                address = add;
            }
            else
            {
                address = null;
            }

            bool canIntegralPerMoney = true, canCapital = true;

            CanDeductible(out canIntegralPerMoney, out canCapital);
            var data = new
            {
                Address                   = address,
                IsCashOnDelivery          = result.IsCashOnDelivery,
                InvoiceContext            = result.InvoiceContext,
                InvoiceTitle              = result.InvoiceTitle,
                cellPhone                 = result.cellPhone,
                email                     = result.email,
                vatInvoice                = result.vatInvoice,
                invoiceName               = result.invoiceName, //默认抬头(普通、电子)
                invoiceCode               = result.invoiceCode, //默认税号(普通、电子)
                products                  = result.products,
                TotalAmount               = result.totalAmount,
                Freight                   = result.Freight,
                orderAmount               = result.orderAmount,
                IsOpenStore               = SiteSettingApplication.SiteSettings != null && SiteSettingApplication.SiteSettings.IsOpenStore,
                integralPerMoney          = result.integralPerMoney,
                userIntegralMaxDeductible = result.userIntegralMaxDeductible,
                integralPerMoneyRate      = result.integralPerMoneyRate,
                userIntegralMaxRate       = SiteSettingApplication.SiteSettings.IntegralDeductibleRate,
                userIntegrals             = result.userIntegrals,
                TotalMemberIntegral       = result.memberIntegralInfo.AvailableIntegrals,
                canIntegralPerMoney       = canIntegralPerMoney,
                canCapital                = canCapital,
                capitalAmount             = result.capitalAmount,
                shopBranchInfo            = storeInfo,
                ProvideInvoice            = storeInfo == null ? false : ShopApplication.HasProvideInvoice(result.products.Select(s => s.shopId).Distinct().ToList())
            };

            return(Json(data));
        }