public async Task <ApiResult> Detail(GoodsDetailModel model) { string parm = await settingService.GetParmByNameAsync("网站域名"); GoodsDTO dto = await goodsService.GetModelAsync(model.Id); GoodsImgSearchResult result = await goodsImgService.GetModelListAsync(dto.Id, null, null, null, 1, 100); GoodsDetailApiModel apiModel = new GoodsDetailApiModel(); apiModel.goodsImgs = result.GoodsImgs.Select(g => new GoodsImg { id = g.Id, imgUrl = parm + g.ImgUrl }).ToList(); if (dto != null) { apiModel.id = dto.Id; apiModel.description = dto.Description.Replace("/upload/", parm + "/upload/"); apiModel.inventory = dto.Inventory; apiModel.name = dto.Name; apiModel.price = dto.Price; apiModel.realityPrice = dto.RealityPrice; apiModel.saleNum = dto.SaleNum; } return(new ApiResult { status = 1, data = apiModel }); }
/// <summary> /// 得到产品图片 /// </summary> public virtual ActionResult GoodsDetail(long goodsId, long productId) { var model = new GoodsDetailModel { GoodsDetail = GetGoodsDetail(goodsId, productId), GoodsProperties = GetGoodsProperties(goodsId, productId) }; return(View("~/Views/Home/_GoodsDetail.cshtml", model)); }