protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("servicepanel_config", "编辑客服面板配置")) { WindowNoPower(); } B_ServicePanel config = new B_ServicePanel(); model = ShopCache.GetBaseConfig(); string con = model.ServicePanel; sp = B_ServicePanel.GetModel(con); //=================================== //这么取数据 //string con = "[{\"x\":\"111\",\"y\":\"112\".....}]"; //Shop.Model.ServicePanel sp = B_ServicePanel.GetModel(con); //这个sp里面就有你要的数据了 //例如 sp.x //保存的话,可以把以上的sp直接转化为json格式的字符串 //如 //Model.ServicePanel sp = new Model.ServicePanel(); //sp.x = ""; //sp.y = ""; //sp.theme = ""; //string json = B_ServicePanel.ToJson(sp); //===================================== }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_servicepanel_list", "客服面板")) { WindowNoPower(); } model = B_Lebi_Supplier.GetModel(CurrentSupplier.id); if (model == null) { model = new Lebi_Supplier(); } string con = model.ServicePanel; sp = B_ServicePanel.GetModel(con); //=================================== //这么取数据 //string con = "[{\"x\":\"111\",\"y\":\"112\".....}]"; //Shop.Model.ServicePanel sp = B_ServicePanel.GetModel(con); //这个sp里面就有你要的数据了 //例如 sp.x //保存的话,可以把以上的sp直接转化为json格式的字符串 //如 //Model.ServicePanel sp = new Model.ServicePanel(); //sp.x = ""; //sp.y = ""; //sp.theme = ""; //string json = B_ServicePanel.ToJson(sp); //===================================== }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { pcode = "P_ShopIndex"; LoadTheme(themecode, siteid, languagecode, pcode); id = RequestTool.RequestInt("id", 0); //商家ID cid = RequestTool.RequestInt("cid", 0); //商品分类 list = RequestTool.RequestString("list"); //列表或网格 sort = RequestTool.RequestString("sort"); //排序 key = RequestTool.RequestSafeString("keyword"); //关键词 pageindex = RequestTool.RequestInt("page", 1); parentcid = 0; supplier = B_Lebi_Supplier.GetModel("id = " + id); if (supplier == null) { Response.Redirect(URL("P_404", "")); Response.End(); } int Supplier_id = supplier.User_id; if (cid != 0) { producttype = B_Lebi_Supplier_ProductType.GetModel(cid); if (producttype.parentid > 0) { parentcid = producttype.parentid; } else { parentcid = cid; } } path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a>"; where = ProductWhere + " and Supplier_id = " + id + ""; if (cid > 0) { if (DataBase.DBType == "sqlserver") { where += " and Charindex('," + cid + ",',','+Supplier_ProductType_ids+',')>0"; } if (DataBase.DBType == "access") { where += " and Instr(','+Supplier_ProductType_ids+',','," + cid + ",')>0"; } } if (key != "") { where += " and Name like '%" + key + "%'"; } if (sort == "") { sort = "1"; } if (sort == "1") { order = " Count_Sales_Show desc"; ordertmp = "a"; } else if (sort == "1a") { order = " Count_Sales_Show asc"; ordertmp = ""; } else if (sort == "2") { order = " Price desc"; ordertmp = "a"; } else if (sort == "2a") { order = " Price asc"; ordertmp = ""; } else if (sort == "3") { order = " Count_Comment desc"; ordertmp = "a"; } else if (sort == "3a") { order = " Count_Comment asc"; ordertmp = ""; } else if (sort == "4") { order = " Time_Add desc"; ordertmp = "a"; } else if (sort == "4a") { order = " Time_Add asc"; ordertmp = ""; } else if (sort == "5") { order = " Count_Views_Show desc"; ordertmp = "a"; } else if (sort == "5a") { order = " Count_Views_Show asc"; ordertmp = ""; } else { order = " Count_Sales_Show desc"; ordertmp = "a"; } products = B_Lebi_Product.GetList(where, order, PageSize, pageindex); recordCount = B_Lebi_Product.Counts(where); //id={0}&pid={1}&cid={2}&list={3}&sort={4}&tid={5}&page={6} string url = URL("P_ShopIndex", id + "," + cid + "," + list + "," + sort + ",{0}," + key + ""); HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage); FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage); NextPage = URL("P_ShopIndex", id + "," + cid + "," + list + "," + sort + "," + (pageindex + 1) + "," + key + ""); string supplierservicepannelcon = supplier.ServicePanel; supplierservicepannel = B_ServicePanel.GetModel(supplierservicepannelcon); headcontent = supplier.head; longbar = supplier.longbar; shortbar = supplier.shortbar; if (CurrentSite.IsMobile == 0) //只针对PC站点 lebi.kingdge 2015-12-30 { //跳转至设置的皮肤页面 Lebi_Supplier_Skin skin = B_Lebi_Supplier_Skin.GetModel(supplier.Supplier_Skin_id); if (skin != null) { string filename = HttpContext.Current.Request.Url.AbsolutePath.ToString().ToLower(); if (!filename.Contains("default" + skin.id + ".aspx")) { string tourl = Shop.Bussiness.Site.Instance.WebPath + "/" + CurrentLanguage.Path + "/shop/default" + skin.id + ".aspx?id=" + supplier.id + "&cid=" + cid + "&list=" + list + "&sort=" + sort + "&page=" + pageindex; tourl = ThemeUrl.CheckPath(tourl); Response.Redirect(tourl); //Response.Write(tourl); } } } }
/// <summary> /// 客服面板设置信息 /// </summary> public void ServicePanel_Config() { if (!Power("supplier_servicepanel_list", "客服面板")) { AjaxNoPower(); return; } Model.ServicePanel sp = new Model.ServicePanel(); sp.X = RequestTool.RequestSafeString("X"); sp.Y = RequestTool.RequestSafeString("Y"); sp.Theme = RequestTool.RequestSafeString("Theme"); sp.Status = RequestTool.RequestSafeString("Status"); sp.IsFloat = RequestTool.RequestSafeString("IsFloat"); sp.Style = RequestTool.RequestSafeString("Style"); string con = B_ServicePanel.ToJson(sp); //BaseConfig bconf = ShopCache.GetBaseConfig(); Lebi_Supplier model = B_Lebi_Supplier.GetModel(CurrentSupplier.id); if (model == null) { Response.Write("{\"msg\":\"账号不存在\"}"); return; } model.ServicePanel = con; B_Lebi_Supplier.Update(model); Log.Add("配置客服面板", "ServicePanel", CurrentSupplier.id.ToString(), CurrentSupplier, ""); string temp = ""; temp += "var ShopstartX = document.body.clientWidth-" + RequestTool.RequestSafeString("X") + ";\n"; if (RequestTool.RequestSafeString("IsFloat") == "1" && RequestTool.RequestSafeString("Style") == "1") { temp += "var ShopstartY = " + RequestTool.RequestSafeString("Y") + ";\n"; } else if (RequestTool.RequestSafeString("IsFloat") == "0" && RequestTool.RequestSafeString("Style") == "1") { temp += "var ShopstartY = " + RequestTool.RequestSafeString("Y") + ";\n"; } if (RequestTool.RequestSafeString("IsFloat") == "1" && RequestTool.RequestSafeString("Style") == "1") { temp += "var verticalpos='fromtop';\n"; } else if (RequestTool.RequestSafeString("IsFloat") == "0" && RequestTool.RequestSafeString("Style") == "1") { temp += "var verticalpos='frombottom';\n"; } temp += "var winWidth = 0;\n"; temp += "function iecompattest(){\n"; temp += " return (document.compatMode && document.compatMode!='BackCompat')? document.documentElement : document.body\n"; temp += "}\n"; temp += "function ShopServicePannelstaticbar(){\n"; temp += " if (window.innerWidth)\n"; temp += " winWidth = window.innerWidth;\n"; temp += " else if ((document.body) && (document.body.clientWidth))\n"; temp += " winWidth = document.body.clientWidth;\n"; temp += " if (document.documentElement && document.documentElement.clientWidth){winWidth = document.documentElement.clientWidth;}\n"; temp += " ShopstartX = winWidth-"+ RequestTool.RequestSafeString("X") + ";\n"; temp += " barheight=document.getElementById('divShopServicePannel').offsetHeight\n"; temp += " var ns = (navigator.appName.indexOf('Netscape') != -1) || window.opera;\n"; temp += " var d = document;\n"; temp += " function ml(id){\n"; temp += " var el=d.getElementById(id);\n"; temp += " el.style.visibility='visible'\n"; temp += " if(d.layers)el.style=el;\n"; temp += " el.sP=function(x,y){this.style.left=x+'px';this.style.top=y+'px';};\n"; temp += " el.x = ShopstartX;\n"; temp += " if (verticalpos=='fromtop')\n"; temp += " el.y = ShopstartY;\n"; temp += " else{\n"; temp += " el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;\n"; temp += " el.y -= ShopstartY;\n"; temp += " }\n"; temp += " return el;\n"; temp += " }\n"; temp += " window.ShopServicePannel=function(){\n"; temp += " if (verticalpos=='fromtop'){\n"; temp += " var pY = ns ? pageYOffset : iecompattest().scrollTop;\n"; temp += " ftlObj.y += (pY + ShopstartY - ftlObj.y)/8;\n"; temp += " }\n"; temp += " else{\n"; temp += " var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;\n"; temp += " ftlObj.y += (pY - ShopstartY - ftlObj.y)/8;\n"; temp += " }\n"; temp += " ftlObj.sP(ftlObj.x, ftlObj.y);\n"; temp += " setTimeout('stayTopLeft()', 10);\n"; temp += " }\n"; temp += " ftlObj = ml('ShopServicePannel');\n"; temp += " ShopServicePannel();\n"; temp += "}\n"; temp += "if(typeof(HTMLElement)!='undefined'){\n"; temp += " HTMLElement.prototype.contains=function (obj)\n"; temp += " {\n"; temp += " while(obj!=null&&typeof(obj.tagName)!='undefind'){\n"; temp += " if(obj==this) return true;\n"; temp += " obj=obj.parentNode;\n"; temp += " }\n"; temp += " return false;\n"; temp += " }\n"; temp += "}\n"; temp += "if (window.addEventListener)\n"; temp += "window.addEventListener('load', ShopServicePannelstaticbar, false)\n"; temp += "else if (window.attachEvent)\n"; temp += "window.attachEvent('onload', ShopServicePannelstaticbar)\n"; temp += "else if (document.getElementById)\n"; temp += "window.onload=ShopServicePannelstaticbar;\n"; temp += "window.onresize=ShopServicePannelstaticbar;\n"; temp += "function ShopServicePannelOver(){\n"; temp += " document.getElementById('ShopServicePannelMenu').style.display = 'none';\n"; temp += " document.getElementById('ShopServicePannelOnline').style.display = 'block';\n"; temp += " document.getElementById('divShopServicePannel').style.width = '170px';\n"; temp += "}\n"; temp += "function ShopServicePannelOut(){\n"; temp += " document.getElementById('ShopServicePannelMenu').style.display = 'block';\n"; temp += " document.getElementById('ShopServicePannelOnline').style.display = 'none';\n"; temp += "}\n"; temp += "if(typeof(HTMLElement)!='undefined') \n"; temp += "{\n"; temp += " HTMLElement.prototype.contains=function(obj)\n"; temp += " {\n"; temp += " while(obj!=null&&typeof(obj.tagName)!='undefind'){\n"; temp += " if(obj==this) return true;\n"; temp += " obj=obj.parentNode;\n"; temp += " }\n"; temp += " return false;\n"; temp += " };\n"; temp += "}\n"; temp += "function ShowShopServicePannel(theEvent){\n"; temp += " if (theEvent){\n"; temp += " var browser=navigator.userAgent;\n"; temp += " if (browser.indexOf('Firefox')>0){\n"; temp += " if (document.getElementById('ShopServicePannelOnline').contains(theEvent.relatedTarget)) {\n"; temp += " return;\n"; temp += " }\n"; temp += " }\n"; temp += " if (browser.indexOf('MSIE')>0 || browser.indexOf('Safari')>0){ //IE Safari\n"; temp += " if (document.getElementById('ShopServicePannelOnline').contains(event.toElement)) {\n"; temp += " return;\n"; temp += " }\n"; temp += " }\n"; temp += " }\n"; temp += " document.getElementById('ShopServicePannelMenu').style.display = 'block';\n"; temp += " document.getElementById('ShopServicePannelOnline').style.display = 'none';\n"; temp += "}"; HtmlEngine save = new HtmlEngine(); save.CreateFile("/supplier/js/user/ServicePanel" + CurrentSupplier.id + ".js", temp); Response.Write("{\"msg\":\"OK\"}"); }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { pcode = "P_ShopProductCategory"; LoadTheme(themecode, siteid, languagecode, pcode); id = Rint_Para("0"); //商家ID cid = Rint_Para("1"); //商品分类 list = Rstring_Para("2"); //列表或网格 sort = Rstring_Para("3"); //排序 key = Rstring_Para("5"); //关键词 pageindex = RequestTool.RequestInt("page", 1); parentcid = 0; supplier = B_Lebi_Supplier.GetModel("id = " + id); if (supplier == null) { Response.Redirect(URL("P_404", "")); Response.End(); } int Supplier_id = supplier.User_id; if (cid != 0) { producttype = B_Lebi_Supplier_ProductType.GetModel(cid); if (producttype.parentid > 0) { parentcid = producttype.parentid; } else { parentcid = cid; } } path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a>"; if (key != "") { path += " > " + key; } where = "Type_id_ProductStatus = 101 and Product_id=0 and Supplier_id = " + id + ""; if (cid > 0) { if (DataBase.DBType == "sqlserver") { where += " and Charindex('," + cid + ",',','+Supplier_ProductType_ids+',')>0"; } if (DataBase.DBType == "access") { where += " and Instr(','+Supplier_ProductType_ids+',','," + cid + ",')>0"; } } if (key != "") { where += " and Name like '%" + key + "%'"; } if (sort == "") { sort = "1"; } if (sort == "1") { order = " Count_Sales_Show desc"; ordertmp = "a"; } else if (sort == "1a") { order = " Count_Sales_Show asc"; ordertmp = ""; } else if (sort == "2") { order = " Price desc"; ordertmp = "a"; } else if (sort == "2a") { order = " Price asc"; ordertmp = ""; } else if (sort == "3") { order = " Count_Comment desc"; ordertmp = "a"; } else if (sort == "3a") { order = " Count_Comment asc"; ordertmp = ""; } else if (sort == "4") { order = " Time_Add desc"; ordertmp = "a"; } else if (sort == "4a") { order = " Time_Add asc"; ordertmp = ""; } else if (sort == "5") { order = " Count_Views_Show desc"; ordertmp = "a"; } else if (sort == "5a") { order = " Count_Views_Show asc"; ordertmp = ""; } else { order = " Count_Sales_Show desc"; ordertmp = "a"; } products = B_Lebi_Product.GetList(where, order, PageSize, pageindex); recordCount = B_Lebi_Product.Counts(where); //id={0}&pid={1}&cid={2}&list={3}&sort={4}&tid={5}&page={6} string url = URL("P_ShopProductCategory", id + "," + cid + "," + list + "," + sort + ",{0}," + key + ""); HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage); FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage); string supplierservicepannelcon = supplier.ServicePanel; supplierservicepannel = B_ServicePanel.GetModel(supplierservicepannelcon); headcontent = supplier.head; longbar = supplier.longbar; shortbar = supplier.shortbar; }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { pcode = "P_ShopProductCategory"; LoadTheme(themecode, siteid, languagecode, pcode); id = RequestTool.RequestInt("id", 0); //商家ID cid = RequestTool.RequestInt("cid", 0); //商品分类 list = RequestTool.RequestString("list"); //列表或网格 sort = RequestTool.RequestString("sort"); //排序 keyword = RequestTool.RequestSafeString("keyword"); //关键词 pageindex = RequestTool.RequestInt("page", 1); parentcid = 0; supplier = B_Lebi_Supplier.GetModel("id = " + id); if (supplier == null) { Response.Redirect(URL("P_404", "")); Response.End(); } int Supplier_id = supplier.User_id; if (cid != 0) { producttype = B_Lebi_Supplier_ProductType.GetModel(cid); if (producttype.parentid > 0) { parentcid = producttype.parentid; } else { parentcid = cid; } } path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a><em>»</em><a href=\"" + URL("P_ShopProductCategory", "" + id + "," + cid + "," + list + "," + sort + ",1," + keyword + "") + "\"><span>" + Tag("商品列表") + "</span></a>"; where = ProductWhere + " and Type_id_ProductType = 320 and Supplier_id = " + id + ""; if (cid > 0) { where += " and " + ShopCategoryWhere(cid); } if (keyword != "") { //增加空格划词搜索 by kingdge 2013-09-18 string wherekeyword = ""; if (keyword.IndexOf(" ") > -1) { string[] keywordsArr; keywordsArr = keyword.Split(new char[1] { ' ' }); foreach (string keywords in keywordsArr) { if (keywords != "") { if (wherekeyword == "") { wherekeyword = "Name like lbsql{'%" + keywords + "%'}"; } else { wherekeyword += " and Name like lbsql{'%" + keywords + "%'}"; } } } } else { wherekeyword = "Name like lbsql{'%" + keyword + "%'}"; } where += " and ((" + wherekeyword + ") or Number like lbsql{'%" + keyword + "%'} or Code like lbsql{'%" + keyword + "%'})"; path += "<em>»</em><a class=\"text\"><span>“" + keyword + "”</span></a>"; } if (sort == "") { sort = "1"; } if (sort == "1") { order = " Count_Sales_Show desc"; ordertmp = "a"; } else if (sort == "1a") { order = " Count_Sales_Show asc"; ordertmp = ""; } else if (sort == "2") { order = " Price desc"; ordertmp = "a"; } else if (sort == "2a") { order = " Price asc"; ordertmp = ""; } else if (sort == "3") { order = " Count_Comment desc"; ordertmp = "a"; } else if (sort == "3a") { order = " Count_Comment asc"; ordertmp = ""; } else if (sort == "4") { order = " Time_Add desc"; ordertmp = "a"; } else if (sort == "4a") { order = " Time_Add asc"; ordertmp = ""; } else if (sort == "5") { order = " Count_Views_Show desc"; ordertmp = "a"; } else if (sort == "5a") { order = " Count_Views_Show asc"; ordertmp = ""; } else { order = " Count_Sales_Show desc"; ordertmp = "a"; } products = B_Lebi_Product.GetList(where, order, PageSize, pageindex); recordCount = B_Lebi_Product.Counts(where); //id={0}&pid={1}&cid={2}&list={3}&sort={4}&tid={5}&page={6} string url = URL("P_ShopProductCategory", id + "," + cid + "," + list + "," + sort + ",{0}," + keyword + ""); HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage); FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage); NextPage = URL("P_ShopProductCategory", id + "," + cid + "," + list + "," + sort + "," + (pageindex + 1) + "," + keyword + ""); string supplierservicepannelcon = supplier.ServicePanel; supplierservicepannel = B_ServicePanel.GetModel(supplierservicepannelcon); headcontent = supplier.head; longbar = supplier.longbar; shortbar = supplier.shortbar; //跳转至设置的皮肤页面 Lebi_Supplier_Skin skin = B_Lebi_Supplier_Skin.GetModel(supplier.Supplier_Skin_id); if (skin != null) { string filename = HttpContext.Current.Request.Url.AbsolutePath.ToString().ToLower(); if (!filename.Contains("default" + skin.id + ".aspx") && filename.Contains("default.aspx")) { string tourl = Shop.Bussiness.Site.Instance.WebPath + "/" + CurrentLanguage.Path + "/shop/default" + skin.id + ".aspx?id=" + supplier.id + "&cid=" + cid + "&list=" + list + "&sort=" + sort + "&page=" + pageindex + "&keyword=" + keyword; tourl = ThemeUrl.CheckPath(tourl); Response.Redirect(tourl); //Response.Write(tourl); } } }