Hidistro.UI.Web/API/Hi_Ajax_GoodsList.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Hidistro.UI.Web.API
{
    using Hidistro.ControlPanel.Commodities;
    using Hidistro.Core;
    using Hidistro.Entities.Commodities;
    using HiTemplate.Model;
    using Newtonsoft.Json;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;

    public class Hi_Ajax_GoodsList : IHttpHandler
    {
        public IList<ProductInfo> GetGoods(HttpContext context, string ids)
        {
            return ProductHelper.GetProducts((from s in ids.Split(new char[] { ',' }) select int.Parse(s)).ToList<int>());
        }

        public string GoodGroupJson(HttpContext context)
        {
            Hi_Json_GoodGourpContent content = new Hi_Json_GoodGourpContent {
                showPrice = (context.Request.Form["ShowPrice"] != null) ? Convert.ToBoolean(context.Request.Form["ShowPrice"]) : true,
                layout = (context.Request.Form["Layout"] != null) ? Convert.ToInt32(context.Request.Form["Layout"]) : 1,
                showName = (context.Request.Form["showName"] != null) ? Convert.ToBoolean(Convert.ToInt32(context.Request.Form["showName"])) : true,
                showIco = (context.Request.Form["ShowIco"] != null) ? Convert.ToBoolean(context.Request.Form["ShowIco"]) : true
            };
            string str = (context.Request.Form["IDs"] != null) ? context.Request.Form["IDs"] : "";
            List<HiShop_Model_Good> list = new List<HiShop_Model_Good>();
            if (!string.IsNullOrEmpty(str))
            {
                foreach (ProductInfo info in this.GetGoods(context, str))
                {
                    HiShop_Model_Good item = new HiShop_Model_Good {
                        item_id = info.ProductId.ToString(),
                        title = info.ProductName.ToString(),
                        price = Convert.ToDouble(info.MinShowPrice).ToString("f2"),
                        original_price = Convert.ToDouble(info.MarketPrice).ToString("f2"),
                        link = string.Concat(new object[] { "http://", Globals.DomainName, ":", HttpContext.Current.Request.Url.Port, "/ProductDetails.aspx?productId=", info.ProductId.ToString() }),
                        pic = info.ThumbnailUrl310.ToString()
                    };
                    list.Add(item);
                }
            }
            content.goodslist = list;
            return JsonConvert.SerializeObject(content);
        }

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write(this.GoodGroupJson(context));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
后面还有 4 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。