private void SetWXShare(FightGroupInfo fightGroup, ProductInfo product) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); string jsApiTicket = base.GetJsApiTicket(true); string text = WAPTemplatedWebControl.GenerateNonceStr(); string text2 = WAPTemplatedWebControl.GenerateTimeStamp(); string absoluteUri = this.Page.Request.Url.AbsoluteUri; this.hdAppId.Value = base.site.WeixinAppId; this.hdTimestamp.Value = text2; this.hdNonceStr.Value = text; this.hdSignature.Value = base.GetSignature(jsApiTicket, text, text2, absoluteUri); FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); if (fightGroupActivitieInfo == null) { base.GotoResourceNotFound("活动已结束或者已删除"); } else { string icon = fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(string.IsNullOrEmpty(icon) ? masterSettings.DefaultProductThumbnail8 : icon); if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle)) { this.hdTitle.Value = (string.IsNullOrEmpty(product.Title) ? product.ProductName : product.Title); } else { this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle.Trim(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent.Trim())) { this.hdDesc.Value = product.Meta_Description; } else { this.hdDesc.Value = fightGroupActivitieInfo.ShareContent.Trim(); } if (HiContext.Current.User.IsReferral()) { this.hdLink.Value = Globals.FullPath(string.Format("/vshop/FightGroupDetails.aspx?fightGroupId={0}&ReferralUserId=" + HiContext.Current.User.UserId, fightGroup.FightGroupId)); } else { this.hdLink.Value = Globals.FullPath($"/vshop/FightGroupDetails.aspx?fightGroupId={fightGroup.FightGroupId}"); } } }
private void SetWXShare(FightGroupInfo fightGroup, ProductInfo product) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); string absoluteUri = this.Page.Request.Url.AbsoluteUri; FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); if (fightGroupActivitieInfo != null) { string jsApiTicket = base.GetJsApiTicket(true); string text = WAPTemplatedWebControl.GenerateNonceStr(); string text2 = WAPTemplatedWebControl.GenerateTimeStamp(); this.hdAppId.Value = base.site.WeixinAppId; this.hdTimestamp.Value = text2; this.hdNonceStr.Value = text; this.hdSignature.Value = base.GetSignature(jsApiTicket, text, text2, absoluteUri); string icon = fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(string.IsNullOrEmpty(icon) ? masterSettings.DefaultProductThumbnail8 : icon); this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle; HtmlInputHidden htmlInputHidden = this.hdDesc; HtmlInputHidden htmlInputHidden2 = this.hdLink; string text5 = htmlInputHidden.Value = (htmlInputHidden2.Value = Globals.FullPath($"/vshop/FightGroupDetails.aspx?fightGroupId={fightGroup.FightGroupId}")); } }
private void toFightGroupSuccess() { int num = 1; int num2 = 0; SiteSettings masterSettings = SettingsManager.GetMasterSettings(); FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.Order.FightGroupId); if (fightGroup != null) { IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(this.Order.FightGroupId); num = (this.Order.IsFightGroupHead ? 1 : ((fightGroupUsers == null || fightGroupUsers.Count >= fightGroup.JoinNumber) ? 3 : 2)); if (num != 3) { num2 = fightGroup.JoinNumber - fightGroupUsers.Count; } FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); if (fightGroupActivitieInfo != null) { ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(fightGroupActivitieInfo.ProductId); if (productSimpleInfo != null) { string arg = (masterSettings.SiteUrl.ToNullString().ToLower().StartsWith("http://") ? masterSettings.SiteUrl : ("http://" + masterSettings.SiteUrl)).TrimEnd('/'); string str = "{Result\":{"; str += string.Format("\"ShareImage\":\"{0}\",", fightGroupActivitieInfo.Icon.Contains("http://") ? fightGroupActivitieInfo.Icon : $"{arg}/{fightGroupActivitieInfo.Icon}"); str += $"\"ShareTitle\":\"{(string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle) ? productSimpleInfo.Title : fightGroupActivitieInfo.ShareTitle)}\","; str += $"\"ShareContent\":\"{(string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent) ? productSimpleInfo.ProductName : fightGroupActivitieInfo.ShareContent)}\","; str += $"\"ShareLink\":\"{$"{arg}/vshop/FightGroupDetails.aspx?fightGroupId={fightGroup.FightGroupId}"}\""; str += "}}"; base.Response.Write("<script type=\"text/javascript\" src=\"/Templates/appshop/script/jquery-1.11.0.min.js\"></script>"); base.Response.Write("<script type=\"text/javascript\" src=\"/Utility/globals.js\"></script>"); base.Response.Write("<script type=\"text/javascript\" src=\"/Templates/appshop/script/main.js\"></script>"); base.Response.Write("<script type=\"text/javascript\">$(function () {goFightGroupSuccess(" + num + "," + num2 + "," + str + ");});</script>"); base.Response.End(); } } } }
protected override void OnInit(EventArgs e) { if (this.SkinName == null) { this.SkinName = "Skin-ServiceProductSubmitOrder.html"; } base.OnInit(e); string urlToEncode = ""; this.from = this.Page.Request.QueryString["from"].ToNullString().ToLower(); this.productSku = Globals.UrlDecode(this.Page.Request.QueryString["productSku"].ToNullString()); this.buyAmount = this.Page.Request.QueryString["buyAmount"].ToInt(0); this.storeId = this.Page.Request.QueryString["StoreId"].ToInt(0); this.chooseStoreId = this.Page.Request.QueryString["ChooseStoreId"].ToInt(0); if (this.from == "groupbuy") { this.isGroupBuy = true; } else if (this.from == "countdown") { this.isCountDown = true; } else if (this.from == "fightgroup") { this.isFightGroup = true; } else { if (this.from == "presale") { this.PresaleId = this.Page.Request.QueryString["PresaleId"].ToInt(0); this.productSku = DataHelper.CleanSearchString(this.productSku); if (this.CheckPresaleInfo()) { this.isPreSale = true; goto IL_01cd; } return; } this.from = "serviceproduct"; } goto IL_01cd; IL_01cd: if (this.storeId == 0 && !HiContext.Current.SiteSettings.OpenMultStore) { this.cart = ShoppingCartProcessor.GetShoppingCart(this.from, this.productSku, this.buyAmount, 0, true, -1, this.Page.Request["fightGroupActivityId"].ToInt(0)); } else { this.cart = ShoppingCartProcessor.GetShoppingCart(this.from, this.productSku, this.buyAmount, 0, true, this.storeId, this.Page.Request["fightGroupActivityId"].ToInt(0)); } if (this.cart == null) { string msg = "购物车无任何商品!"; this.hasError = true; this.ShowWapMessage(msg, "default.aspx"); } else { if (this.isGroupBuy) { this.groupbuyInfo = TradeHelper.GetProductGroupBuyInfo(this.cart.LineItems[0].ProductId, this.buyAmount, out urlToEncode); if (this.groupbuyInfo == null) { this.hasError = true; this.ShowWapMessage(Globals.UrlEncode(urlToEncode), "default.aspx"); return; } } if (this.isCountDown) { this.countdownInfo = TradeHelper.ProductExistsCountDown(this.cart.LineItems[0].ProductId, "", this.storeId); if (this.countdownInfo == null) { this.hasError = true; this.ShowWapMessage("该商品未进行抢购活动,或者活动已结束", "Default.aspx"); return; } if (!StoreActivityHelper.JoinActivity(this.countdownInfo.CountDownId, 2, this.storeId, this.countdownInfo.StoreType)) { this.hasError = true; this.ShowWapMessage("该门店未参与此抢购活动", "Default.aspx"); return; } this.countdownInfo = TradeHelper.CheckUserCountDown(this.cart.LineItems[0].ProductId, this.countdownInfo.CountDownId, this.cart.LineItems[0].SkuId, HiContext.Current.UserId, this.buyAmount, "", out urlToEncode, this.storeId); if (this.countdownInfo == null) { this.ShowWapMessage(Globals.UrlEncode(urlToEncode), "Default.aspx"); return; } } if (this.isFightGroup) { this.fightGroupActivitiyInfo = TradeHelper.GetFightGroupActivitieInfo(this.Page.Request["fightGroupActivityId"].ToInt(0)); if (this.fightGroupActivitiyInfo == null) { this.hasError = true; this.ShowWapMessage("拼团活动不存在", "Default.aspx"); } else { int num = this.Page.Request["fightGroupId"].ToInt(0); this.fightGroupInfo = VShopHelper.GetFightGroup(num); if (this.fightGroupInfo == null && num != 0) { this.hasError = true; this.ShowWapMessage("拼团活动不存在", "Default.aspx"); } } } } }
protected override void AttachChildControls() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.divFightGroupsHead = (HtmlControl)this.FindControl("divFightGroupsHead"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.fightGroupActivityId = this.Page.Request["fightGroupActivityId"].ToInt(0); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litStartDate = (Literal)this.FindControl("litStartDate"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.imgEnd = (Image)this.FindControl("imgEnd"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.rptFightGroups = (WapTemplatedRepeater)this.FindControl("rptFightGroups"); this.litProductPrice = (Literal)this.FindControl("litProductPrice"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.divGetBySelf = (HtmlControl)this.FindControl("divGetBySelf"); FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(this.fightGroupActivityId); if (fightGroupActivitieInfo != null) { if (fightGroupActivitieInfo.StartDate <= DateTime.Now) { HiContext.Current.Context.Response.Redirect("FightGroupActivityDetails?fightGroupActivityId=" + fightGroupActivitieInfo.FightGroupActivityId); } this.fightGroupRule.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroupActivitieInfo.ProductId)) { this.divGetBySelf.Visible = true; } IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(this.fightGroupActivityId); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroupActivitieInfo.ProductId}"; this.imgEnd.Visible = (fightGroupActivitieInfo.EndDate < DateTime.Now); Literal literal = this.litJoinNumber; int num = fightGroupActivitieInfo.JoinNumber; literal.Text = num.ToString(); this.litStartDate.Text = fightGroupActivitieInfo.StartDate.ToString("yyyy-MM-dd HH:mm:ss"); this.litProductName.Text = fightGroupActivitieInfo.ProductName; decimal num2 = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice); this.litFGAPrice.Text = num2.F2ToString("f2"); if (fightGroupSkus.Count() > 1) { decimal num3 = fightGroupSkus.Max((FightGroupSkuInfo c) => c.SalePrice); if (num3 > num2) { this.litFGAPrice.Text = num2.F2ToString("f2") + "~" + num3.F2ToString("f2"); } } IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroupActivitieInfo.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.litProductPrice.Text = this.litPPrice.Text; this.skuSubmitOrder.ProductInfo = productDetails; } this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; Literal literal2 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroupActivitieInfo.ProductId }).TotalRecords; literal2.Text = num.ToString(); DataTable fightGroups = VShopHelper.GetFightGroups(this.fightGroupActivityId); for (int i = 0; i < fightGroups.Rows.Count; i++) { fightGroups.Rows[i]["Name"] = DataHelper.GetHiddenUsername(fightGroups.Rows[i]["Name"].ToString()); } this.divFightGroupsHead.Visible = (fightGroups.Rows.Count > 0); this.rptFightGroups.DataSource = fightGroups; this.rptFightGroups.DataBind(); if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list2 = new List <SlideImage>(); foreach (DataRow row in skus.Rows) { List <SlideImage> list3 = (from s in list2 where s.ImageUrl == row["ThumbnailUrl410"].ToString() select s).ToList(); if (list3.Count <= 0) { list2.Add(new SlideImage(row["ThumbnailUrl410"].ToString(), locationUrl)); } } list2.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list2 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, true); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } } DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId" }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } else { base.GotoResourceNotFound("活动不存在"); } }
protected override void AttachChildControls() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); int fightGroupId = this.Page.Request["fightGroupId"].ToInt(0); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.hfStartTime = (HtmlInputHidden)this.FindControl("hfStartTime"); this.hiddenJoinedUser = (HtmlInputText)this.FindControl("hiddenJoinedUser"); this.hfEndTime = (HtmlInputHidden)this.FindControl("hfEndTime"); this.hfNowTime = (HtmlInputHidden)this.FindControl("hfNowTime"); this.rptFightGroupDetails = (WapTemplatedRepeater)this.FindControl("rptFightGroupDetails"); this.rptFightGroupDetailsNeed = (WapTemplatedRepeater)this.FindControl("rptFightGroupDetailsNeed"); this.litNeedPerson = (Literal)this.FindControl("litNeedPerson"); this.divIn = (HtmlControl)this.FindControl("divIn"); this.divOver = (HtmlControl)this.FindControl("divOver"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litLimitedHour = (Literal)this.FindControl("litLimitedHour"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.imgStatus = (Image)this.FindControl("imgStatus"); this.litRemainTimeHtml = (HtmlGenericControl)this.FindControl("litRemainTimeHtml"); this.spanTime = (HtmlGenericControl)this.FindControl("spanTime"); this.hiddenProductId = (HtmlInputText)this.FindControl("hiddenProductId"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.hidFightGroupActivityStatus = (HtmlInputHidden)this.FindControl("hidFightGroupActivityStatus"); this.divGetBySelf = (HtmlControl)this.FindControl("divGetBySelf"); 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 = base.site.WeixinAppId; FightGroupInfo fightGroup = VShopHelper.GetFightGroup(fightGroupId); if (fightGroup != null) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroup.ProductId)) { this.divGetBySelf.Visible = true; } if (fightGroup.EndTime <= DateTime.Now && fightGroup.Status == FightGroupStatus.FightGroupIn) { VShopHelper.DealFightGroupFail(fightGroupId); fightGroup.Status = FightGroupStatus.FightGroupFail; } this.fightGroupRule.FightGroupActivityId = fightGroup.FightGroupActivityId; FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); HtmlInputText htmlInputText = this.hiddenProductId; int num = fightGroup.ProductId; htmlInputText.Value = num.ToString(); this.hidFightGroupActivityStatus.Value = ((fightGroupActivitieInfo.EndDate > DateTime.Now) ? "1" : "0"); HtmlInputHidden htmlInputHidden = this.hfNowTime; DateTime dateTime = DateTime.Now; htmlInputHidden.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden2 = this.hfEndTime; dateTime = fightGroup.EndTime; htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden3 = this.hfStartTime; dateTime = fightGroup.StartTime; htmlInputHidden3.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroup.ProductId}"; IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(fightGroup.FightGroupActivityId); Literal literal = this.litJoinNumber; num = fightGroup.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litProductName.Text = fightGroup.ProductName; this.litFGAPrice.Text = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.skuSubmitOrder.ProductInfo = productDetails; this.skuSubmitOrder.OrderBusiness = 1; this.skuSubmitOrder.FightGroupActivityId = fightGroup.FightGroupActivityId; this.skuSubmitOrder.FightGroupId = fightGroup.FightGroupId; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroupActivitieInfo.ProductId }).TotalRecords; literal3.Text = num.ToString(); FightGroupStatus status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupFail)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_fail.png"; this.imgStatus.Attributes.Add("class", "fg_fail"); this.spanTime.Style.Add("text-align", "center"); this.litRemainTimeHtml.Style.Add("display", "none"); } else { status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupSuccess)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_ok.png"; this.imgStatus.Attributes.Add("class", "fg_ok"); } } Image image = this.imgStatus; status = fightGroup.Status; image.Visible = !status.Equals(FightGroupStatus.FightGroupIn); int fightGroupActiveNumber = VShopHelper.GetFightGroupActiveNumber(fightGroup.FightGroupId); int num2 = fightGroup.JoinNumber - fightGroupActiveNumber; num2 = ((num2 >= 0) ? num2 : 0); this.litNeedPerson.Text = num2.ToString(); HtmlControl htmlControl = this.divIn; status = fightGroup.Status; htmlControl.Visible = status.Equals(FightGroupStatus.FightGroupIn); HtmlControl htmlControl2 = this.divOver; status = fightGroup.Status; htmlControl2.Visible = !status.Equals(FightGroupStatus.FightGroupIn); IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(fightGroup.FightGroupId); foreach (FightGroupUserModel item in fightGroupUsers) { item.Name = DataHelper.GetHiddenUsername(item.Name); if (HiContext.Current.UserId == item.UserId) { this.hiddenJoinedUser.Value = "true"; } } this.rptFightGroupDetails.DataSource = fightGroupUsers; this.rptFightGroupDetails.DataBind(); List <int> list2 = new List <int>(); for (int i = 0; i < num2; i++) { list2.Add(i); } this.rptFightGroupDetailsNeed.DataSource = list2; this.rptFightGroupDetailsNeed.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, true); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list3 = new List <SlideImage>(); foreach (DataRow row in skus.Rows) { List <SlideImage> list4 = (from s in list3 where s.ImageUrl == row["ThumbnailUrl410"].ToString() select s).ToList(); if (list4.Count <= 0) { list3.Add(new SlideImage(row["ThumbnailUrl410"].ToString(), locationUrl)); } } list3.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list3 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle)) { this.hdTitle.Value = (string.IsNullOrEmpty(productDetails.Title) ? productDetails.ProductName : productDetails.Title); } else { this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle.Trim(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent.Trim())) { this.hdDesc.Value = productDetails.Meta_Description; } else { this.hdDesc.Value = fightGroupActivitieInfo.ShareContent.Trim(); } string icon = fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(string.IsNullOrEmpty(icon) ? base.site.DefaultProductThumbnail8 : icon); this.hdLink.Value = Globals.FullPath(this.Page.Request.Url.ToString()); DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId" }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } else { base.GotoResourceNotFound("活动不存在"); } }
protected override void AttachChildControls() { this.hidSupplier = (HtmlInputHidden)this.FindControl("hidSupplier"); this.litSupplierName = (Literal)this.FindControl("litSupplierName"); this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.divFightGroupsHead = (HtmlControl)this.FindControl("divFightGroupsHead"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.fightGroupActivityId = this.Page.Request["fightGroupActivityId"].ToInt(0); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litLimitedHour = (Literal)this.FindControl("litLimitedHour"); this.litEndDate = (Literal)this.FindControl("litEndDate"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.imgEnd = (Image)this.FindControl("imgEnd"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.rptFightGroups = (WapTemplatedRepeater)this.FindControl("rptFightGroups"); this.litMinPrice = (Literal)this.FindControl("litMinPrice"); this.litProductPrice = (Literal)this.FindControl("litProductPrice"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.divGetBySelf = (HtmlControl)this.FindControl("divGetBySelf"); this.hiddenProductId = (HtmlInputText)this.FindControl("hiddenProductId"); 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"); FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(this.fightGroupActivityId); if (fightGroupActivitieInfo != null) { HtmlInputText htmlInputText = this.hiddenProductId; int num = fightGroupActivitieInfo.ProductId; htmlInputText.Value = num.ToString(); this.fightGroupRule.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; if (fightGroupActivitieInfo.StartDate > DateTime.Now) { this.Page.Response.Redirect("FightGroupActivityDetailsSoon.aspx?fightGroupActivityId=" + this.fightGroupActivityId); } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroupActivitieInfo.ProductId)) { this.divGetBySelf.Visible = true; } this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(this.fightGroupActivityId); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroupActivitieInfo.ProductId}"; this.imgEnd.Visible = (fightGroupActivitieInfo.EndDate < DateTime.Now); Literal literal = this.litJoinNumber; num = fightGroupActivitieInfo.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litEndDate.Text = fightGroupActivitieInfo.EndDate.ToString("yy.MM.dd"); this.litProductName.Text = fightGroupActivitieInfo.ProductName; decimal num2 = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice); this.litFGAPrice.Text = num2.F2ToString("f2"); if (fightGroupSkus.Count() > 1) { decimal num3 = fightGroupSkus.Max((FightGroupSkuInfo c) => c.SalePrice); if (num3 > num2) { this.litFGAPrice.Text = num2.F2ToString("f2") + "~" + num3.F2ToString("f2"); } } this.litMinPrice.Text = num2.F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroupActivitieInfo.ProductId, out dictionary, out list); if (productDetails != null) { this.skuSubmitOrder.ProductInfo = productDetails; this.litPPrice.Text = MemberProcessor.GetMemberPrice(productDetails).F2ToString("f2"); this.litProductPrice.Text = this.litPPrice.Text; } int supplierId = productDetails.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"; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroupActivitieInfo.ProductId }).TotalRecords; literal3.Text = num.ToString(); DataTable fightGroups = VShopHelper.GetFightGroups(this.fightGroupActivityId); for (int i = 0; i < fightGroups.Rows.Count; i++) { fightGroups.Rows[i]["Name"] = DataHelper.GetHiddenUsername(fightGroups.Rows[i]["Name"].ToString()); } this.divFightGroupsHead.Visible = (fightGroups.Rows.Count > 0); this.rptFightGroups.DataSource = fightGroups; this.rptFightGroups.DataBind(); this.hdAppId.Value = base.site.WeixinAppId; if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle)) { this.hdTitle.Value = (string.IsNullOrEmpty(productDetails.Title) ? productDetails.ProductName : productDetails.Title); } else { this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle.Trim(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent.Trim())) { this.hdDesc.Value = productDetails.Meta_Description; } else { this.hdDesc.Value = fightGroupActivitieInfo.ShareContent.Trim(); } string local = string.IsNullOrEmpty(fightGroupActivitieInfo.Icon) ? SettingsManager.GetMasterSettings().DefaultProductImage : fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(this.Page.Request.Url.ToString()); if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list2 = new List <SlideImage>(); list2.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list2 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId", HasReplied = true }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } } else { base.GotoResourceNotFound("活动不存在"); } }
protected override void AttachChildControls() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.fightGroupId = this.Page.Request["fightGroupId"].ToInt(0); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litLimitedHour = (Literal)this.FindControl("litLimitedHour"); this.litEndDate = (Literal)this.FindControl("litEndDate"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.imgStatus = (Image)this.FindControl("imgStatus"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.rptMemberGroupDetailsStatus = (WapTemplatedRepeater)this.FindControl("rptMemberGroupDetailsStatus"); FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.fightGroupId); if (fightGroup != null) { if (fightGroup.EndTime <= DateTime.Now && fightGroup.Status == FightGroupStatus.FightGroupIn) { VShopHelper.DealFightGroupFail(fightGroup.FightGroupId); fightGroup.Status = FightGroupStatus.FightGroupFail; } FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); this.fightGroupRule.FightGroupActivityId = fightGroup.FightGroupActivityId; FightGroupStatus status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupFail)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_fail.png"; this.imgStatus.Attributes.Add("class", "fg_fail"); } else { status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupSuccess)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_ok.png"; this.imgStatus.Attributes.Add("class", "fg_ok"); } } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(fightGroup.FightGroupActivityId); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroup.ProductId}"; Literal literal = this.litJoinNumber; int num = fightGroup.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litEndDate.Text = fightGroup.EndTime.ToString("yy.MM.dd"); this.litProductName.Text = fightGroup.ProductName; this.litFGAPrice.Text = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.skuSubmitOrder.ProductInfo = productDetails; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroup.ProductId }).TotalRecords; literal3.Text = num.ToString(); IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(fightGroup.FightGroupId); int num2 = fightGroupUsers.Count(); if (fightGroupUsers.Count < fightGroup.JoinNumber) { for (int i = 0; i < fightGroup.JoinNumber - num2; i++) { FightGroupUserModel item2 = new FightGroupUserModel(); fightGroupUsers.Add(item2); } } this.rptMemberGroupDetailsStatus.DataSource = fightGroupUsers; this.rptMemberGroupDetailsStatus.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { this.litDescription.Text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { this.litDescription.Text = regex.Replace(productDetails.Description, ""); } } this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list2 = new List <SlideImage>(); foreach (DataRow row in skus.Rows) { List <SlideImage> list3 = (from s in list2 where s.ImageUrl == row["ThumbnailUrl410"].ToString() select s).ToList(); if (list3.Count <= 0) { list2.Add(new SlideImage(row["ThumbnailUrl410"].ToString(), locationUrl)); } } list2.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list2 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); Literal control2 = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control2.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex2 = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex2.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex2.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } } DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId", Type = ConsultationReplyType.Replyed }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } }