protected override void AttachChildControls()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            if (!int.TryParse(this.Page.Request.QueryString["PreSaleId"], out this.presaleId))
            {
                this.ShowWapMessage("错误的活动ID", "Default.aspx");
                return;
            }
            ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.presaleId);

            if (productPreSaleInfo == null)
            {
                this.ShowWapMessage("错误的活动ID", "Default.aspx");
                return;
            }
            if (productPreSaleInfo.PreSaleEndDate < DateTime.Now)
            {
                this.Page.Response.Redirect("ProductDetails.aspx?ProductId = " + productPreSaleInfo.ProductId);
                return;
            }
            this.productId               = productPreSaleInfo.ProductId;
            this.hidSupplier             = (HtmlInputHidden)this.FindControl("hidSupplier");
            this.litSupplierName         = (Literal)this.FindControl("litSupplierName");
            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.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.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.ltlProductSendGifts     = (Literal)this.FindControl("ltlProductSendGifts");
            this.ltlProductSendGifts2    = (Literal)this.FindControl("ltlProductSendGifts2");
            this.liOrderPromotions       = (HtmlGenericControl)this.FindControl("liOrderPromotions");
            this.liOrderPromotions2      = (HtmlGenericControl)this.FindControl("liOrderPromotions2");
            this.liProductSendGifts      = (HtmlGenericControl)this.FindControl("liProductSendGifts");
            this.liProductSendGifts2     = (HtmlGenericControl)this.FindControl("liProductSendGifts2");
            this.liOrderPromotions_free2 = (HtmlGenericControl)this.FindControl("liOrderPromotions_free2");
            this.liOrderPromotions_free  = (HtmlGenericControl)this.FindControl("liOrderPromotions_free");
            this.ltlOrderPromotion_free2 = (Literal)this.FindControl("ltlOrderPromotion_free2");
            this.ltlOrderPromotion_free  = (Literal)this.FindControl("ltlOrderPromotion_free");
            this.lbUserProductRefer      = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.divshiptoregion         = (HtmlGenericControl)this.FindControl("divshiptoregion");
            this.divwaplocateaddress     = (HtmlGenericControl)this.FindControl("divwaplocateaddress");
            this.productFreight          = (ProductFreightLiteral)this.FindControl("productFreight");
            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.divPhonePrice           = (HtmlGenericControl)this.FindControl("divPhonePrice");
            this.litPhonePrice           = (Literal)this.FindControl("litPhonePrice");
            this.litpresaleprice         = (Literal)this.FindControl("litpresaleprice");
            this.litsaleprice            = (Literal)this.FindControl("litsaleprice");
            this.litRetainage            = (Literal)this.FindControl("litRetainage");
            this.litDeliverGood          = (Literal)this.FindControl("litDeliverGood");
            this.hidEndDate              = (HtmlInputHidden)this.FindControl("hidEndDate");
            this.hidNowDate              = (HtmlInputHidden)this.FindControl("hidNowDate");
            this.hdAppId.Value           = masterSettings.WeixinAppId;
            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");
            ProductBrowseInfo productPreSaleBrowseInfo = ProductBrowser.GetProductPreSaleBrowseInfo(this.productId, true);

            if (productPreSaleBrowseInfo.Product == null || productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
            {
                this.Page.Response.Redirect("ProductDelete.aspx");
                return;
            }
            if (productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
            {
                this.hidUnOnSale.Value = "1";
            }
            this.litpresaleprice.Text = ((productPreSaleInfo.DepositPercent == 0) ? productPreSaleInfo.Deposit.F2ToString("f2") : ((decimal)productPreSaleInfo.DepositPercent * productPreSaleBrowseInfo.Product.MinSalePrice / 100m).F2ToString("f2"));
            if (productPreSaleBrowseInfo.Product.MinSalePrice < productPreSaleBrowseInfo.Product.MaxSalePrice)
            {
                this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~ ¥" + productPreSaleBrowseInfo.Product.MaxSalePrice.F2ToString("f2");
            }
            else
            {
                this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2");
            }
            Literal  literal  = this.litRetainage;
            DateTime dateTime = productPreSaleInfo.PaymentStartDate;
            string   str      = dateTime.ToString("yyyy/MM/dd");

            dateTime     = productPreSaleInfo.PaymentEndDate;
            literal.Text = str + "~" + dateTime.ToString("yyyy/MM/dd");
            Literal literal2 = this.litDeliverGood;
            object  text;

            if (!productPreSaleInfo.DeliveryDate.HasValue)
            {
                text = $"尾款支付后{productPreSaleInfo.DeliveryDays}天内发货";
            }
            else
            {
                dateTime = productPreSaleInfo.DeliveryDate.Value;
                text     = dateTime.ToString("yyyy年MM月dd日") + "发货";
            }
            literal2.Text = (string)text;
            HtmlInputHidden htmlInputHidden2 = this.hidNowDate;

            dateTime = DateTime.Now;
            htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            HtmlInputHidden htmlInputHidden3 = this.hidEndDate;

            dateTime = productPreSaleInfo.PreSaleEndDate;
            htmlInputHidden3.Value                 = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            this.skuSubmitOrder.ProductInfo        = productPreSaleBrowseInfo.Product;
            this.skuSubmitOrder.OrderBusiness      = 4;
            this.skuSubmitOrder.PreSaleId          = this.presaleId;
            this.skuSubmitOrder.productPreSaleInfo = productPreSaleInfo;
            this.lbUserProductRefer.product        = productPreSaleBrowseInfo.Product;
            this.productFreight.ShippingTemplateId = productPreSaleBrowseInfo.Product.ShippingTemplateId;
            this.productFreight.Volume             = productPreSaleBrowseInfo.Product.Weight;
            this.productFreight.Weight             = productPreSaleBrowseInfo.Product.Weight;
            this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.Title) ? productPreSaleBrowseInfo.Product.ProductName : productPreSaleBrowseInfo.Product.Title);
            this.hdDesc.Value  = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription) ? this.hdTitle.Value : productPreSaleBrowseInfo.Product.ShortDescription);
            string local = string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) ? SettingsManager.GetMasterSettings().DefaultProductImage : productPreSaleBrowseInfo.Product.ImageUrl1;

            this.hdImgUrl.Value = Globals.FullPath(local);
            this.hdLink.Value   = Globals.FullPath(HttpContext.Current.Request.Url.ToString());
            IEnumerable enumerable = from item in productPreSaleBrowseInfo.Product.Skus
                                     select item.Value;

            if (this.hidCartQuantity != null)
            {
                this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(this.productId);
            }
            IEnumerable value = from item in productPreSaleBrowseInfo.Product.Skus
                                select item.Value;

            if (JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs) != null)
            {
                this.hidden_skuItem.Value = JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs);
            }
            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }
            if (this.hidden_productId != null)
            {
                this.hidden_productId.Value = this.productId.ToString();
            }
            if (this.promote != null)
            {
                this.promote.ProductId = this.productId;
            }
            int supplierId = productPreSaleBrowseInfo.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";
            }
            MemberInfo user = HiContext.Current.User;

            if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue))
            {
                if (!productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue)
                {
                    goto IL_0c63;
                }
                decimal?subMemberDeduct = productPreSaleBrowseInfo.Product.SubMemberDeduct;
                if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue)
                {
                    goto IL_0c63;
                }
            }
            goto IL_0c89;
IL_0c89:
            int num2 = 1;

            goto IL_0c8a;
IL_0c8a:
            if (num2 != 0)
            {
                this.divProductReferral.Visible = false;
            }
            if (this.rptProductImages != null)
            {
                string locationUrl = "javascript:;";
                if (string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl2) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl3) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl4) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl5))
                {
                    productPreSaleBrowseInfo.Product.ImageUrl1 = masterSettings.DefaultProductImage;
                }
                List <SlideImage> list = new List <SlideImage>();
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl1, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl2, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl3, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl4, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl5, locationUrl));
                this.rptProductImages.DataSource = from item in list
                                                   where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                   select item;
                this.rptProductImages.DataBind();
            }
            this.litProdcutName.Text         = productPreSaleBrowseInfo.Product.ProductName;
            this.litShortDescription.Text    = productPreSaleBrowseInfo.Product.ShortDescription;
            this.divShortDescription.Visible = !string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription);
            if (this.litDescription != null)
            {
                string text2 = "";
                Regex  regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
                if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.MobbileDescription))
                {
                    text2 = regex.Replace(productPreSaleBrowseInfo.Product.MobbileDescription, "");
                }
                else if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.Description))
                {
                    text2 = regex.Replace(productPreSaleBrowseInfo.Product.Description, "");
                }
                text2 = text2.Replace("src", "data-url");
                this.litDescription.Text = text2;
            }
            Literal control = this.litSoldCount;

            num = productPreSaleBrowseInfo.Product.ShowSaleCounts;
            control.SetWhenIsNotNull(num.ToString());
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            Literal control2 = this.litConsultationsCount;

            num = productPreSaleBrowseInfo.ConsultationCount;
            control2.SetWhenIsNotNull(num.ToString());
            Literal control3 = this.litReviewsCount;

            num = productPreSaleBrowseInfo.ReviewCount;
            control3.SetWhenIsNotNull(num.ToString());
            MemberInfo user2 = HiContext.Current.User;
            bool       flag  = false;

            if (user2 != null)
            {
                flag = ProductBrowser.CheckHasCollect(user2.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
            this.BindCouponList();
            PageTitle.AddSiteNameTitle(productPreSaleBrowseInfo.Product.ProductName);
            this.BindPromotionInfo();
            this.BindGuestProducts();
            DataTable dBConsultations = productPreSaleBrowseInfo.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();
            return;

IL_0c63:
            if (HiContext.Current.SiteSettings.OpenReferral == 1)
            {
                num2 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0);
                goto IL_0c8a;
            }
            goto IL_0c89;
        }
		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.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.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.productFreight = (ProductFreightLiteral)this.FindControl("productFreight");
			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.hdAppId.Value = masterSettings.WeixinAppId;
			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");
			ProductBrowseInfo wAPProductBrowseInfo = ProductBrowser.GetWAPProductBrowseInfo(this.productId, null, masterSettings.OpenMultStore, 0);
			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.ProductType == 1.GetHashCode())
			{
				HttpContext.Current.Response.Redirect("ServiceProductDetails?productId=" + this.productId);
			}
			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;
			}
			if (wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
			{
				this.hidUnOnSale.Value = "1";
			}
			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.skuSubmitOrder.ProductInfo = wAPProductBrowseInfo.Product;
			this.lbUserProductRefer.product = wAPProductBrowseInfo.Product;
			this.productFreight.ShippingTemplateId = wAPProductBrowseInfo.Product.ShippingTemplateId;
			this.productFreight.Volume = wAPProductBrowseInfo.Product.Weight;
			this.productFreight.Weight = wAPProductBrowseInfo.Product.Weight;
			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_";
			string text = wAPProductBrowseInfo.Product.ImageUrl1;
			if (!string.IsNullOrEmpty(text))
			{
				text = text.ToLower().Replace(oldValue, newValue);
			}
			string local = string.IsNullOrEmpty(text) ? SettingsManager.GetMasterSettings().DefaultProductImage : text;
			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_0b8c;
				}
				decimal? subMemberDeduct = wAPProductBrowseInfo.Product.SubMemberDeduct;
				if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue)
				{
					goto IL_0b8c;
				}
			}
			goto IL_0bc6;
			IL_0bc6:
			int num2 = 1;
			goto IL_0bc7;
			IL_0bc7:
			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 = "<a href=\"SupplierAbout?SupplierId=" + supplierById.SupplierId + "\">" + supplierById.SupplierName + "</a>";
					}
				}
				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;
			this.litSalePrice.Text = ((wAPProductBrowseInfo.Product.MinSalePrice == wAPProductBrowseInfo.Product.MaxSalePrice) ? wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") : (wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~" + wAPProductBrowseInfo.Product.MaxSalePrice.F2ToString("f2")));
			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 (this.litDescription != null)
			{
				string text2 = "";
				Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
				if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.MobbileDescription))
				{
					text2 = regex.Replace(wAPProductBrowseInfo.Product.MobbileDescription, "");
				}
				else if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.Description))
				{
					text2 = regex.Replace(wAPProductBrowseInfo.Product.Description, "");
				}
				text2 = text2.Replace("src", "data-url");
				text2 = text2.Replace("vurl", "src");
				this.litDescription.Text = text2;
			}
			Literal control = this.litSoldCount;
			num = wAPProductBrowseInfo.Product.ShowSaleCounts;
			control.SetWhenIsNotNull(num.ToString() + wAPProductBrowseInfo.Product.Unit);
			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();
			this.BindGuestProducts();
			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;
			}
			return;
			IL_0b8c:
			if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user.Referral != null)
			{
				num2 = (user.Referral.IsRepeled ? 1 : 0);
				goto IL_0bc7;
			}
			goto IL_0bc6;
		}