private void SetControlsValue(CountDownInfo countDownInfo) { this.skuSubmitOrder.CountDownId = countDownInfo.CountDownId; this.skuSubmitOrder.CountDownInfo = countDownInfo; this.skuSubmitOrder.OrderBusiness = 2; HtmlInputHidden htmlInputHidden = this.hdCountDownId; int num = countDownInfo.CountDownId; htmlInputHidden.Value = num.ToString(); this.hiddenIsLogin.Value = HiContext.Current.UserId.ToString(); SiteSettings masterSettings = SettingsManager.GetMasterSettings(); this.hidRecommend.Value = (masterSettings.Store_IsRecommend ? "1" : "0"); StoreProductQuery storeProductQuery = new StoreProductQuery { ProductId = countDownInfo.ProductId, StoreId = this.storeId, CountDownId = this.countDownId }; string cookie = WebHelper.GetCookie("UserCoordinateCookie", "NewCoordinate"); if (!string.IsNullOrEmpty(cookie)) { string[] array = cookie.Split(','); storeProductQuery.Position = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0)); storeProductQuery.Position.CityId = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0); storeProductQuery.Position.AreaId = WebHelper.GetCookie("UserCoordinateCookie", "RegionId").ToInt(0); StoreEntityQuery storeEntityQuery = new StoreEntityQuery(); storeEntityQuery.Position = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0)); storeEntityQuery.RegionId = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0); storeEntityQuery.FullAreaPath = WebHelper.GetCookie("UserCoordinateCookie", "FullRegionPath"); this.hidLanLng.Value = JsonConvert.SerializeObject(storeEntityQuery); } else { storeProductQuery.Position = new PositionInfo(0.0, 0.0); storeProductQuery.Position.CityId = 0; storeProductQuery.Position.AreaId = 0; } this.hidStoreId.Value = this.storeId.ToString(); HtmlInputHidden htmlInputHidden2 = this.hidStoreType; num = countDownInfo.StoreType; htmlInputHidden2.Value = num.ToString(); ProductModel storeProduct = ProductBrowser.GetStoreProduct(storeProductQuery); if (storeProduct == null || storeProduct.SaleStatus == ProductSaleStatus.Delete) { this.ShowWapMessage("抢购商品已不存在", "Default.aspx"); } else { if (!storeProduct.SaleStatus.Equals(ProductSaleStatus.OnSale)) { this.hidden_IsOver.Value = "pullOff"; } this.litShortDescription.Text = storeProduct.ShortDescription; this.divShortDescription.Visible = !string.IsNullOrEmpty(storeProduct.ShortDescription); if (!countDownInfo.IsJoin) { this.hidden_IsOver.Value = "nojoin"; } else if (countDownInfo.StartDate > DateTime.Now) { this.hidden_IsOver.Value = "AboutToBegin"; } else if (countDownInfo.EndDate < DateTime.Now) { this.hidden_IsOver.Value = "over"; } else if (!countDownInfo.IsRunning) { this.hidden_IsOver.Value = "true"; } if (storeProduct.SaleStatus != ProductSaleStatus.OnSale) { this.ShowWapMessage("此商品已下架", "Default.aspx"); } if (this.expandAttr != null) { this.expandAttr.ProductId = storeProduct.ProductId; } this.skuSubmitOrder.ProductInfo = storeProduct; this.litProdcutName.SetWhenIsNotNull(storeProduct.ProductName); Literal control = this.litminCount; num = countDownInfo.MaxCount; control.SetWhenIsNotNull(num.ToString()); storeProduct.ImgUrlList.ForEach(delegate(string i) { Literal literal4 = this.litPdImgSlides; literal4.Text += $"<img src=\"{i}\" />"; }); if (this.litDescription != null && !string.IsNullOrWhiteSpace(storeProduct.Description)) { Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); this.litDescription.Text = regex.Replace(storeProduct.Description, "").Replace("src", "data-url"); } this.litprice.SetWhenIsNotNull(PromoteHelper.GetCountDownSalePrice(this.countDownId).F2ToString("f2")); this.litLeftSeconds.SetWhenIsNotNull(Math.Ceiling((countDownInfo.EndDate - DateTime.Now).TotalSeconds).ToString()); this.litcontent.SetWhenIsNotNull(countDownInfo.Content); HtmlInputControl control2 = this.litGroupBuyId; num = countDownInfo.CountDownId; control2.SetWhenIsNotNull(num.ToString()); if (storeProduct.MarketPrice > decimal.Zero) { this.salePrice.SetWhenIsNotNull(storeProduct.MarketPrice.F2ToString("f2")); } else { this.salePrice.Text = storeProduct.MaxSalePrice.F2ToString("f2"); } HtmlInputControl control3 = this.txtProductId; num = countDownInfo.ProductId; control3.SetWhenIsNotNull(num.ToString()); Literal control4 = this.litConsultationsCount; num = storeProduct.ConsultationCount; control4.SetWhenIsNotNull(num.ToString()); Literal control5 = this.litReviewsCount; num = storeProduct.ReviewCount; control5.SetWhenIsNotNull(num.ToString()); this.litGroupbuyDescription.SetWhenIsNotNull(countDownInfo.Content); Literal control6 = this.litMaxCount; num = countDownInfo.MaxCount; control6.SetWhenIsNotNull(num.ToString()); this.nowTime = (HtmlInputHidden)this.FindControl("nowTime"); HtmlInputHidden control7 = this.nowTime; DateTime dateTime = DateTime.Now; control7.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo)); HtmlInputHidden control8 = this.startTime; dateTime = countDownInfo.StartDate; control8.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss")); HtmlInputHidden control9 = this.endTime; dateTime = countDownInfo.EndDate; control9.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss")); HtmlInputHidden control10 = this.groupBuyMaxCount; num = countDownInfo.MaxCount; control10.SetWhenIsNotNull(num.ToString()); if (storeProduct.StoreInfo.IsInServiceArea) { this.ltlStoreName = (Literal)this.FindControl("ltlStoreName"); this.ltlStoreName.Text = storeProduct.StoreInfo.StoreName; this.ltlDistance = (Literal)this.FindControl("ltlDistance"); this.ltlDistance.Text = storeProduct.StoreInfo.Distance; this.ltlDelivery = (Literal)this.FindControl("ltlDelivery"); this.ltlDelivery.Text = storeProduct.StoreInfo.Delivery.DeliveryList.Aggregate(string.Empty, (string t, string n) => "<li>" + t + "</li><li>" + n + "</li>"); this.ltlDeliveryDetail = (Literal)this.FindControl("ltlDeliveryDetail"); if (storeProduct.StoreInfo.Delivery.IsStoreDelive) { if (storeProduct.StoreInfo.Delivery.MinOrderPrice > decimal.Zero) { Literal literal = this.ltlDeliveryDetail; num = storeProduct.StoreInfo.Delivery.MinOrderPrice.ToInt(0); literal.Text = $"¥<em>{num.ToString()}</em>起送"; if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero) { Literal literal2 = this.ltlDeliveryDetail; string text = literal2.Text; num = storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0); literal2.Text = text + $",配送费¥<em>{num.ToString()}</em>"; } else { Literal literal3 = this.ltlDeliveryDetail; literal3.Text += string.Format(",免配送费"); } } else if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero) { this.ltlDeliveryDetail.Text = $"配送费¥<em>{storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0)}</em>"; } else { this.ltlDeliveryDetail.Text = string.Format("免配送费"); } } this.ltlStoreAddress = (Literal)this.FindControl("ltlStoreAddress"); this.ltlStoreAddress.Text = storeProduct.StoreInfo.AddressSimply; this.hidLngLat.Value = $"{storeProduct.StoreInfo.Position.Longitude},{storeProduct.StoreInfo.Position.Latitude}"; this.hidStoreName.Value = storeProduct.StoreInfo.StoreName; this.hidQQMapKey.Value = masterSettings.QQMapAPIKey; } if (storeProduct.ExStatus == DetailException.Nomal) { this.hidNoData.Value = "0"; } else { this.hidNoData.Value = "1"; } this.litUnit.SetWhenIsNotNull(string.IsNullOrEmpty(storeProduct.Unit) ? "件" : storeProduct.Unit); this.SetWXShare(countDownInfo, storeProduct); this.ProcessException(storeProduct); } }
public static ProductModel GetStoreProduct(StoreProductQuery query) { ProductBrowseDao productBrowseDao = new ProductBrowseDao(); productBrowseDao.AddVistiCounts(query.ProductId); SiteSettings masterSettings = SettingsManager.GetMasterSettings(); ProductModel result = productBrowseDao.GetProductModel(query); if (string.IsNullOrEmpty(result.SubmitOrderImg)) { result.SubmitOrderImg = masterSettings.DefaultProductThumbnail4; } if (result.StoreInfo != null && !string.IsNullOrEmpty(result.StoreInfo.FullRegionPath)) { string tempAllRegions = result.StoreInfo.FullRegionPath + ","; Dictionary <string, string> regionName = RegionHelper.GetRegionName(tempAllRegions); result.StoreInfo.AddressSimply = StoreListHelper.ProcessAddress(regionName, result.StoreInfo.FullRegionPath, result.StoreInfo.Address); } if (result.ImgUrlList != null && result.ImgUrlList.Count > 0) { string[] array = new string[result.ImgUrlList.Count]; Array.Copy(result.ImgUrlList.ToArray(), array, result.ImgUrlList.Count); result.ImgUrlList = new List <string>(); array.ForEach(delegate(string t) { if (!string.IsNullOrEmpty(t)) { result.ImgUrlList.Add(t); } }); } else { result.ImgUrlList = new List <string> { masterSettings.DefaultProductImage }; } if (result.ImgUrlList.Count == 0) { result.ImgUrlList = new List <string> { masterSettings.DefaultProductImage }; } MemberInfo user = HiContext.Current.User; if (user.UserId != 0) { int gradeId = user.GradeId; if (query.CountDownId == 0) { MemberGradeInfo memberGrade = MemberHelper.GetMemberGrade(gradeId); if (memberGrade != null) { result.GradeName = memberGrade.Name; result.MinSalePrice = (decimal)memberGrade.Discount * result.MinSalePrice / 100m; result.MaxSalePrice = (decimal)memberGrade.Discount * result.MaxSalePrice / 100m; } result.Skus.ForEach(delegate(SKUItem sk) { sk.SalePrice = (decimal)memberGrade.Discount * sk.SalePrice / 100m; }); } result.IsFavorite = ProductBrowser.ExistsProduct(result.ProductId, user.UserId, result.StoreId); if (user != null && user.IsReferral() && (!(masterSettings.SubMemberDeduct <= decimal.Zero) || result.SubMemberDeduct.HasValue)) { if (!result.SubMemberDeduct.HasValue) { goto IL_0381; } decimal?subMemberDeduct = result.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_0381; } } goto IL_03b9; } goto IL_0445; IL_0445: if (result.StoreInfo == null) { result.ExStatus = DetailException.StopService; } else if (!result.StoreInfo.IsOpen && result.StoreInfo.CloseEndTime.HasValue && result.StoreInfo.CloseStartTime.HasValue && result.StoreInfo.CloseEndTime.Value > DateTime.Now && result.StoreInfo.CloseStartTime.Value < DateTime.Now) { result.ExStatus = DetailException.StopService; } else if (result.Stock == 0) { result.ExStatus = DetailException.NoStock; } else if (!result.StoreInfo.IsInServiceArea) { result.ExStatus = DetailException.OverServiceArea; } else if (!masterSettings.Store_IsOrderInClosingTime) { DateTime dateTime = DateTime.Now; string str = dateTime.ToString("yyyy-MM-dd"); dateTime = result.StoreInfo.OpenStartTime; DateTime value = (str + " " + dateTime.ToString("HH:mm")).ToDateTime().Value; dateTime = DateTime.Now; string str2 = dateTime.ToString("yyyy-MM-dd"); dateTime = result.StoreInfo.OpenEndTime; DateTime dateTime2 = (str2 + " " + dateTime.ToString("HH:mm")).ToDateTime().Value; if (dateTime2 <= value) { dateTime2 = dateTime2.AddDays(1.0); } if (DateTime.Now < value || DateTime.Now > dateTime2) { result.ExStatus = DetailException.IsNotWorkTime; } } BrowsedProductQueue.EnQueue(query.ProductId); return(result); IL_0381: int num; if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user.Referral != null) { num = (user.Referral.IsRepeled ? 1 : 0); goto IL_03ba; } goto IL_03b9; IL_03ba: if (num != 0) { result.ProductReduce = ""; } else { decimal d = result.SubMemberDeduct.HasValue ? result.SubMemberDeduct.Value : masterSettings.SubMemberDeduct; result.ProductReduce = (result.MinSalePrice * d / 100m).F2ToString("f2"); } goto IL_0445; IL_03b9: num = 1; goto IL_03ba; }
protected override void AttachChildControls() { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { this.ShowWapMessage("错误的商品ID", "Default.aspx"); } if (base.ClientType.Equals(ClientType.VShop)) { FightGroupActivitiyModel fightGroupActivitiyModel = VShopHelper.GetFightGroupActivities(new FightGroupActivitiyQuery { PageIndex = 1, PageSize = 1, ProductId = this.productId, Status = EnumFightGroupActivitiyStatus.BeingCarried }).Models.FirstOrDefault(); if (fightGroupActivitiyModel != null) { this.Page.Response.Redirect("FightGroupActivityDetails.aspx?fightGroupActivityId=" + fightGroupActivitiyModel.FightGroupActivityId); } } this.hidStoreId = (HtmlInputHidden)this.FindControl("hidStoreId"); this.hidSupplier = (HtmlInputHidden)this.FindControl("hidSupplier"); this.litSupplierName = (Literal)this.FindControl("litSupplierName"); this.aCountDownUrl = (HyperLink)this.FindControl("aCountDownUrl"); this.aCountDownUrl.Visible = false; this.divCountDownUrl = (HtmlGenericControl)this.FindControl("divCountDownUrl"); this.hidCanTakeOnStore = (HtmlInputHidden)this.FindControl("hidCanTakeOnStore"); this.HasActivitiesToJumpUrl(); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.rptCouponList = (WapTemplatedRepeater)this.FindControl("rptCouponList"); this.rp_guest = (WapTemplatedRepeater)this.FindControl("rp_guest"); this.rp_com = (WapTemplatedRepeater)this.FindControl("rp_com"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litSalePrice = (Literal)this.FindControl("litSalePrice"); this.litMarketPrice = (Literal)this.FindControl("litMarketPrice"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.ltlcombinamaininfo = (Literal)this.FindControl("ltlcombinamaininfo"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.skuStoreSubmitOrder = (Common_SKUSubmitStoreOrder)this.FindControl("skuStoreSubmitOrder"); this.expandAttr = (Common_ExpandAttributes)this.FindControl("ExpandAttributes"); this.litSoldCount = (Literal)this.FindControl("litSoldCount"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litHasCollected = (HtmlInputHidden)this.FindControl("litHasCollected"); this.hidden_skus = (HtmlInputHidden)this.FindControl("hidden_skus"); this.ltlOrderPromotion = (Literal)this.FindControl("ltlOrderPromotion"); this.ltlOrderPromotion2 = (Literal)this.FindControl("ltlOrderPromotion2"); this.ltlProductSendGifts2 = (Literal)this.FindControl("ltlProductSendGifts2"); this.ltlProductSendGifts = (Literal)this.FindControl("ltlProductSendGifts"); this.liOrderPromotions = (HtmlGenericControl)this.FindControl("liOrderPromotions"); this.liOrderPromotions2 = (HtmlGenericControl)this.FindControl("liOrderPromotions2"); this.liProductSendGifts2 = (HtmlGenericControl)this.FindControl("liProductSendGifts2"); this.liOrderPromotions_free2 = (HtmlGenericControl)this.FindControl("liOrderPromotions_free2"); this.liOrderPromotions_free = (HtmlGenericControl)this.FindControl("liOrderPromotions_free"); this.divActivities = (HtmlGenericControl)this.FindControl("divActivities"); this.ltlOrderPromotion_free2 = (Literal)this.FindControl("ltlOrderPromotion_free2"); this.ltlOrderPromotion_free = (Literal)this.FindControl("ltlOrderPromotion_free"); this.liProductSendGifts = (HtmlGenericControl)this.FindControl("liProductSendGifts"); this.lbUserProductRefer = (UserProductReferLabel)this.FindControl("lbUserProductRefer"); this.divshiptoregion = (HtmlGenericControl)this.FindControl("divshiptoregion"); this.divwaplocateaddress = (HtmlGenericControl)this.FindControl("divwaplocateaddress"); this.promote = (ProductPromote)this.FindControl("ProductPromote"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); this.hidCombinaid = (HtmlInputHidden)this.FindControl("hidCombinaid"); this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.ulConsultations = (HtmlGenericControl)this.FindControl("ulConsultations"); this.divShortDescription = (HtmlGenericControl)this.FindControl("divShortDescription"); this.hidRegionId = (HtmlInputHidden)this.FindControl("hidRegionId"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.hidCouponCount = (HtmlInputHidden)this.FindControl("hidCouponCount"); this.hidHasStores = (HtmlInputHidden)this.FindControl("hidHasStores"); this.divPodrequest = (HtmlGenericControl)this.FindControl("divPodrequest"); this.divGuest = (HtmlGenericControl)this.FindControl("divGuest"); this.divcombina = (HtmlGenericControl)this.FindControl("divcombina"); this.hidUnOnSale = (HtmlInputHidden)this.FindControl("hidUnOnSale"); this.hidUnAudit = (HtmlInputHidden)this.FindControl("hidUnAudit"); this.divPhonePrice = (HtmlGenericControl)this.FindControl("divPhonePrice"); this.litPhonePrice = (Literal)this.FindControl("litPhonePrice"); this.spdiscount = (HtmlGenericControl)this.FindControl("spdiscount"); this.ulsupplier = (HtmlGenericControl)this.FindControl("ulsupplier"); this.divGouMai = (HtmlGenericControl)this.FindControl("divGouMai"); this.ltlBottomStatus = (Literal)this.FindControl("ltlBottomStatus"); this.hdAppId.Value = masterSettings.WeixinAppId; this.hidStoreId.Value = this.storeId.ToString(); HtmlInputHidden htmlInputHidden = this.hidRegionId; int num = HiContext.Current.DeliveryScopRegionId; htmlInputHidden.Value = num.ToString(); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); this.hidCartQuantity = (HtmlInputHidden)this.FindControl("txCartQuantity"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.lit_IsRefund = (Literal)this.FindControl("lit_IsRefund"); this.lit_IsOverRefund = (Literal)this.FindControl("lit_IsOverRefund"); this.lit_RefundTime = (Literal)this.FindControl("lit_RefundTime"); ProductBrowseInfo wAPProductBrowseInfo = ProductBrowser.GetWAPProductBrowseInfo(this.productId, null, masterSettings.OpenMultStore, 0); StoreProductQuery storeProductQuery = new StoreProductQuery { ProductId = this.productId, StoreId = this.storeId }; string cookie = WebHelper.GetCookie("UserCoordinateCookie", "NewCoordinate"); if (!string.IsNullOrEmpty(cookie)) { string[] array = cookie.Split(','); storeProductQuery.Position = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0)); storeProductQuery.Position.CityId = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0); storeProductQuery.Position.AreaId = WebHelper.GetCookie("UserCoordinateCookie", "RegionId").ToInt(0); } else { storeProductQuery.Position = new PositionInfo(0.0, 0.0); storeProductQuery.Position.CityId = 0; storeProductQuery.Position.AreaId = 0; } this.hidStoreId.Value = this.storeId.ToString(); if (this.storeId > 0) { ProductModel storeProduct = ProductBrowser.GetStoreProduct(storeProductQuery); if (storeProduct == null || storeProduct.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("ProductDelete.aspx"); return; } if (storeProduct.SaleStatus == ProductSaleStatus.OnStock) { base.GotoResourceNotFound("商品已经入库"); } if (wAPProductBrowseInfo.Product.ProductType != 1.GetHashCode()) { HttpContext.Current.Response.Redirect("ProductDetail?productId=" + this.productId); } if (storeProduct.SaleStatus == ProductSaleStatus.UnSale) { this.hidUnOnSale.Value = "1"; } this.litSalePrice.Text = ((storeProduct.MinSalePrice == storeProduct.MaxSalePrice) ? storeProduct.MinSalePrice.F2ToString("f2") : (storeProduct.MinSalePrice.F2ToString("f2") + "~" + storeProduct.MaxSalePrice.F2ToString("f2"))); this.skuStoreSubmitOrder.IsServiceProduct = true; this.skuStoreSubmitOrder.ProductInfo = storeProduct; this.skuSubmitOrder.Visible = false; } else { if (wAPProductBrowseInfo.Product == null || wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("ProductDelete.aspx"); return; } if (wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock) { base.GotoResourceNotFound("商品已经入库"); } if (wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale) { this.hidUnOnSale.Value = "1"; } this.litSalePrice.Text = ((wAPProductBrowseInfo.Product.MinSalePrice == wAPProductBrowseInfo.Product.MaxSalePrice) ? wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") : (wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~" + wAPProductBrowseInfo.Product.MaxSalePrice.F2ToString("f2"))); this.skuSubmitOrder.ProductInfo = wAPProductBrowseInfo.Product; this.skuStoreSubmitOrder.Visible = false; } if (masterSettings.OpenMultStore) { if (StoresHelper.ProductInStoreAndIsAboveSelf(this.productId)) { this.hidHasStores.Value = "1"; this.hidCanTakeOnStore.Value = "1"; } } else if (masterSettings.IsOpenPickeupInStore && wAPProductBrowseInfo.Product.SupplierId == 0) { this.hidCanTakeOnStore.Value = "1"; } if (SalesHelper.IsSupportPodrequest() && wAPProductBrowseInfo.Product.SupplierId == 0) { this.divPodrequest.Visible = true; } HtmlInputHidden htmlInputHidden2 = this.hidUnAudit; num = (int)wAPProductBrowseInfo.Product.AuditStatus; htmlInputHidden2.Value = num.ToString(); if (this.spdiscount != null && HiContext.Current.User.UserId > 0) { MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(HiContext.Current.User.GradeId); this.spdiscount.Visible = true; this.spdiscount.InnerHtml = "<strong class='vip_price'><img src='/templates/pccommon/images/vip_price.png' />" + memberGrade.Name + "价</strong>"; } this.lbUserProductRefer.product = wAPProductBrowseInfo.Product; this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(wAPProductBrowseInfo.Product.Title) ? wAPProductBrowseInfo.Product.ProductName : wAPProductBrowseInfo.Product.Title); this.hdDesc.Value = Globals.StripAllTags(string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ShortDescription) ? this.hdTitle.Value : wAPProductBrowseInfo.Product.ShortDescription); string oldValue = "/storage/master/product/images/"; string newValue = "/storage/master/product/thumbs410/410_"; if (!string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1)) { wAPProductBrowseInfo.Product.ImageUrl1 = wAPProductBrowseInfo.Product.ImageUrl1.ToLower().Replace(oldValue, newValue); } string local = string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1) ? SettingsManager.GetMasterSettings().DefaultProductImage : wAPProductBrowseInfo.Product.ImageUrl1; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(HttpContext.Current.Request.Url.ToString()); if (this.hidCartQuantity != null) { this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(this.productId); } if (this.hidden_productId != null) { this.hidden_productId.Value = this.productId.ToString(); } if (this.promote != null) { this.promote.ProductId = this.productId; } MemberInfo user = HiContext.Current.User; if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || wAPProductBrowseInfo.Product.SubMemberDeduct.HasValue)) { if (!wAPProductBrowseInfo.Product.SubMemberDeduct.HasValue) { goto IL_0ed1; } decimal?subMemberDeduct = wAPProductBrowseInfo.Product.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_0ed1; } } goto IL_0f0b; IL_0ed1: int num2; if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user.Referral != null) { num2 = (user.Referral.IsRepeled ? 1 : 0); goto IL_0f0c; } goto IL_0f0b; IL_0f0b: num2 = 1; goto IL_0f0c; IL_0f0c: if (num2 != 0) { this.divProductReferral.Visible = false; } bool flag = true; if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl2) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl3) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl4) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl5)) { wAPProductBrowseInfo.Product.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(this.productId); List <SlideImage> list = new List <SlideImage>(); int supplierId = wAPProductBrowseInfo.Product.SupplierId; if (supplierId > 0) { SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId); if (supplierById != null) { this.hidSupplier.Value = "true"; this.litSupplierName.Text = supplierById.SupplierName; } } else { this.hidSupplier.Value = "false"; flag = false; this.ulsupplier.Style.Add(HtmlTextWriterStyle.Display, "none"); } list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl1, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl2, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl3, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl4, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } this.litProdcutName.Text = wAPProductBrowseInfo.Product.ProductName; if (wAPProductBrowseInfo.Product.MarketPrice.HasValue) { this.litMarketPrice.SetWhenIsNotNull(wAPProductBrowseInfo.Product.MarketPrice.GetValueOrDefault(decimal.Zero).F2ToString("f2")); } this.litShortDescription.Text = wAPProductBrowseInfo.Product.ShortDescription; this.divShortDescription.Visible = !string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ShortDescription); if (wAPProductBrowseInfo.Product.IsRefund) { this.lit_IsRefund.Text = "<img src=\"/templates/common/images/service_gou.png\" /><span class=\"c-green\">随时退</span>"; this.lit_IsOverRefund.Text = (wAPProductBrowseInfo.Product.IsOverRefund ? "" : "<img src=\"/templates/common/images/service_cha.png\" /><span class=\"c-orange\">过期不退</span>"); } else { this.lit_IsRefund.Text = "<img src=\"/templates/common/images/service_cha.png\" /><span class=\"c-orange\">不可退</span>"; } if (!wAPProductBrowseInfo.Product.IsValid) { if (wAPProductBrowseInfo.Product.ValidStartDate.HasValue && wAPProductBrowseInfo.Product.ValidEndDate.HasValue) { Literal literal = this.lit_RefundTime; DateTime value = wAPProductBrowseInfo.Product.ValidStartDate.Value; string arg = value.ToString("yyyy/MM/dd"); value = wAPProductBrowseInfo.Product.ValidEndDate.Value; literal.Text = string.Format("{0}-{1}", arg, value.ToString("yyyy/MM/dd")); } } else { this.lit_RefundTime.Text = "长期有效"; } if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.MobbileDescription)) { text = regex.Replace(wAPProductBrowseInfo.Product.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.Description)) { text = regex.Replace(wAPProductBrowseInfo.Product.Description, ""); } text = text.Replace("src", "data-url"); text = text.Replace("vurl", "src"); this.litDescription.Text = text; } Literal control = this.litSoldCount; num = wAPProductBrowseInfo.Product.ShowSaleCounts; control.SetWhenIsNotNull(num.ToString()); if (this.expandAttr != null) { this.expandAttr.ProductId = this.productId; } Literal control2 = this.litConsultationsCount; num = wAPProductBrowseInfo.ConsultationCount; control2.SetWhenIsNotNull(num.ToString()); Literal control3 = this.litReviewsCount; num = wAPProductBrowseInfo.ReviewCount; control3.SetWhenIsNotNull(num.ToString()); MemberInfo user2 = HiContext.Current.User; bool flag2 = false; if (user2 != null) { flag2 = ProductBrowser.CheckHasCollect(user2.UserId, this.productId); } this.litHasCollected.SetWhenIsNotNull(flag2 ? "1" : "0"); this.BindCouponList(); PageTitle.AddSiteNameTitle(wAPProductBrowseInfo.Product.ProductName); this.BindCombinaBuyInfo(); this.BindPromotionInfo(); DataTable dBConsultations = wAPProductBrowseInfo.DBConsultations; for (int i = 0; i < dBConsultations.Rows.Count; i++) { dBConsultations.Rows[i]["UserName"] = DataHelper.GetHiddenUsername(dBConsultations.Rows[i]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = dBConsultations; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = dBConsultations.IsNullOrEmpty(); this.ulConsultations.Visible = !dBConsultations.IsNullOrEmpty(); string phonePriceByProductId = PromoteHelper.GetPhonePriceByProductId(this.productId); if (!string.IsNullOrEmpty(phonePriceByProductId)) { this.divPhonePrice.Visible = true; decimal num3 = phonePriceByProductId.Split(',')[0].ToDecimal(0); this.litPhonePrice.Text = num3.F2ToString("f2"); decimal num4 = wAPProductBrowseInfo.Product.MinSalePrice - num3; this.litSalePrice.Text = ((num4 > decimal.Zero) ? num4 : decimal.Zero).F2ToString("f2"); this.lbUserProductRefer.MobileExclusive = num3; } if (flag || this.liOrderPromotions.Visible || this.liOrderPromotions_free2.Visible || this.liProductSendGifts.Visible || this.rptCouponList.Visible) { this.divActivities.Visible = true; } else { this.divActivities.Visible = false; } StoresInfo storeById = StoresHelper.GetStoreById(this.storeId); if (storeById != null) { this.ProcessException(storeById); } }
protected override void AttachChildControls() { base.CheckOpenMultStore(); if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { this.ShowWapMessage("错误的商品ID", "Default.aspx"); } this.aCountDownUrl = (HyperLink)this.FindControl("aCountDownUrl"); this.divCountDownUrl = (HtmlGenericControl)this.FindControl("divCountDownUrl"); this.aCountDownUrl.Visible = false; this.HasActivitiesToJumpUrl(); MemberInfo user = HiContext.Current.User; if (user.UserId != 0 && user.IsReferral() && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"])) { string text = HttpContext.Current.Request.Url.ToString(); text = ((text.IndexOf("?") <= -1) ? (text + "?ReferralUserId=" + HiContext.Current.UserId) : (text + "&ReferralUserId=" + HiContext.Current.UserId)); this.Page.Response.Redirect(text); return; } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); this.litPdImgSlides = (Literal)this.FindControl("litPdImgSlides"); this.rptCouponList = (WapTemplatedRepeater)this.FindControl("rptCouponList"); this.rp_guest = (WapTemplatedRepeater)this.FindControl("rp_guest"); this.rp_com = (WapTemplatedRepeater)this.FindControl("rp_com"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litSalePrice = (Literal)this.FindControl("litSalePrice"); this.litMarketPrice = (Literal)this.FindControl("litMarketPrice"); this.litReferral = (Literal)this.FindControl("litReferral"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.ltlBottomStatus = (Literal)this.FindControl("ltlBottomStatus"); this.skuSubmitOrder = (Common_SKUSubmitStoreOrder)this.FindControl("skuSubmitOrder"); this.litSoldCount = (Literal)this.FindControl("litSoldCount"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litStoreId = (HtmlInputHidden)this.FindControl("litStoreId"); this.litStoreId.Value = this.storeId.ToString(); this.litHasCollected = (HtmlInputHidden)this.FindControl("litHasCollected"); this.hidLngLat = (HtmlInputHidden)this.FindControl("hidLngLat"); this.hdQQMapKey = (HtmlInputHidden)this.FindControl("hdQQMapKey"); this.hidStoreName = (HtmlInputHidden)this.FindControl("hidStoreName"); this.divShortDescription = (HtmlGenericControl)this.FindControl("divShortDescription"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.hidUnOnSale = (HtmlInputHidden)this.FindControl("hidUnOnSale"); this.hidRecommend = (HtmlInputHidden)this.FindControl("hidRecommend"); this.hidNoData = (HtmlInputHidden)this.FindControl("hidNoData"); this.divGouMai = (HtmlGenericControl)this.FindControl("divGouMai"); this.hidStoreId = (HtmlInputHidden)this.FindControl("hidStoreId"); this.ltlMessage = (Literal)this.FindControl("ltlMessage"); this.spdiscount = (HtmlGenericControl)this.FindControl("spdiscount"); this.hidRecommend.Value = (masterSettings.Store_IsRecommend ? "1" : "0"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); this.hdAppId.Value = masterSettings.WeixinAppId; StoreProductQuery storeProductQuery = new StoreProductQuery { ProductId = this.productId, StoreId = this.storeId }; string cookie = WebHelper.GetCookie("UserCoordinateCookie", "NewCoordinate"); if (!string.IsNullOrEmpty(cookie)) { string[] array = cookie.Split(','); storeProductQuery.Position = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0)); storeProductQuery.Position.CityId = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0); storeProductQuery.Position.AreaId = WebHelper.GetCookie("UserCoordinateCookie", "RegionId").ToInt(0); } else { storeProductQuery.Position = new PositionInfo(0.0, 0.0); storeProductQuery.Position.CityId = 0; storeProductQuery.Position.AreaId = 0; } this.hidStoreId.Value = this.storeId.ToString(); ProductModel storeProduct = ProductBrowser.GetStoreProduct(storeProductQuery); this.skuSubmitOrder.ProductInfo = storeProduct; if (storeProduct == null || storeProduct.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("ProductDelete.aspx"); return; } if (storeProduct.ProductType == 1.GetHashCode()) { HttpContext.Current.Response.Redirect("ServiceProductDetails?productId=" + this.productId + "&StoreID=" + this.storeId); } if (storeProduct.SaleStatus != ProductSaleStatus.OnSale) { this.hidUnOnSale.Value = "1"; } if (this.spdiscount != null && HiContext.Current.User.UserId > 0) { MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(HiContext.Current.User.GradeId); this.spdiscount.Visible = true; this.spdiscount.InnerHtml = "<strong class='vip_price'><img src='/templates/pccommon/images/vip_price.png' />" + memberGrade.Name + "价</strong>"; } MemberInfo user2 = HiContext.Current.User; if (user2 != null && user2.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || storeProduct.SubMemberDeduct.HasValue)) { if (!storeProduct.SubMemberDeduct.HasValue) { goto IL_078d; } decimal?subMemberDeduct = storeProduct.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_078d; } } goto IL_07c7; IL_078d: int num; if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user2.Referral != null) { num = (user2.Referral.IsRepeled ? 1 : 0); goto IL_07c8; } goto IL_07c7; IL_07c8: if (num != 0) { this.divProductReferral.Visible = false; } else { this.litReferral.Text = storeProduct.ProductReduce; } storeProduct.ImgUrlList.ForEach(delegate(string i) { Literal literal5 = this.litPdImgSlides; literal5.Text += $"<img src=\"{i}\" />"; }); this.litProdcutName.Text = storeProduct.ProductName; this.litSalePrice.Text = ((storeProduct.MinSalePrice == storeProduct.MaxSalePrice) ? storeProduct.MinSalePrice.F2ToString("f2") : (storeProduct.MinSalePrice.F2ToString("f2") + "~" + storeProduct.MaxSalePrice.F2ToString("f2"))); this.litMarketPrice.Text = storeProduct.MarketPrice.F2ToString("f2"); this.litShortDescription.Text = storeProduct.ShortDescription; this.divShortDescription.Visible = !string.IsNullOrEmpty(storeProduct.ShortDescription); if (!string.IsNullOrWhiteSpace(storeProduct.Description)) { Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); this.litDescription.Text = regex.Replace(storeProduct.Description, "").Replace("src", "data-url"); } Literal literal = this.litSoldCount; int num2 = storeProduct.ShowSaleCounts; literal.Text = num2.ToString(); Literal control = this.litConsultationsCount; num2 = storeProduct.ConsultationCount; control.SetWhenIsNotNull(num2.ToString()); Literal control2 = this.litReviewsCount; num2 = storeProduct.ReviewCount; control2.SetWhenIsNotNull(num2.ToString()); if (storeProduct.StoreInfo.IsInServiceArea) { this.ltlStoreName = (Literal)this.FindControl("ltlStoreName"); this.ltlStoreName.Text = storeProduct.StoreInfo.StoreName; this.ltlDistance = (Literal)this.FindControl("ltlDistance"); this.ltlDistance.Text = storeProduct.StoreInfo.Distance; this.ltlDelivery = (Literal)this.FindControl("ltlDelivery"); this.ltlDelivery.Text = storeProduct.StoreInfo.Delivery.DeliveryList.Aggregate(string.Empty, (string t, string n) => "<li>" + t + "</li><li>" + n + "</li>"); this.ltlDeliveryDetail = (Literal)this.FindControl("ltlDeliveryDetail"); if (storeProduct.StoreInfo.Delivery.IsStoreDelive) { if (storeProduct.StoreInfo.Delivery.MinOrderPrice > decimal.Zero) { Literal literal2 = this.ltlDeliveryDetail; num2 = storeProduct.StoreInfo.Delivery.MinOrderPrice.ToInt(0); literal2.Text = $"¥<em>{num2.ToString()}</em>起送"; if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero) { Literal literal3 = this.ltlDeliveryDetail; string text2 = literal3.Text; num2 = storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0); literal3.Text = text2 + $",配送费¥<em>{num2.ToString()}</em>"; } else { Literal literal4 = this.ltlDeliveryDetail; literal4.Text += string.Format(",免配送费"); } } else if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero) { this.ltlDeliveryDetail.Text = $"配送费¥<em>{storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0)}</em>"; } else { this.ltlDeliveryDetail.Text = string.Format("免配送费"); } } this.ltlStoreAddress = (Literal)this.FindControl("ltlStoreAddress"); this.ltlStoreAddress.Text = storeProduct.StoreInfo.AddressSimply; this.hidLngLat.Value = $"{storeProduct.StoreInfo.Position.Longitude},{storeProduct.StoreInfo.Position.Latitude}"; this.hidStoreName.Value = storeProduct.StoreInfo.StoreName; this.hdQQMapKey.Value = masterSettings.QQMapAPIKey; this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(storeProduct.Title) ? storeProduct.ProductName : storeProduct.Title); this.hdDesc.Value = Globals.StripAllTags(string.IsNullOrEmpty(storeProduct.ShortDescription) ? this.hdTitle.Value : storeProduct.ShortDescription); string oldValue = "/storage/master/product/images/"; string newValue = "/storage/master/product/thumbs410/410_"; string text3 = storeProduct.ImgUrlList[0]; if (!string.IsNullOrEmpty(text3)) { text3 = text3.ToLower().Replace(oldValue, newValue); } string local = string.IsNullOrEmpty(text3) ? SettingsManager.GetMasterSettings().DefaultProductImage : text3; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(HttpContext.Current.Request.Url.ToString()); } this.litHasCollected.SetWhenIsNotNull(storeProduct.IsFavorite ? "1" : "0"); PageTitle.AddSiteNameTitle(storeProduct.ProductName); this.ProcessException(storeProduct); return; IL_07c7: num = 1; goto IL_07c8; }