List.cshtml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @model ProductListModel
  2. @section style{
  3. <link rel="stylesheet" href="@ConfigHelper.GetCDNPrefix()/assets/plugins/page/paging.css">
  4. <link rel="stylesheet" href="@ConfigHelper.GetCDNPrefix()/assets/css/product.css">
  5. <style>
  6. @@media(min-width:768px) {
  7. .m-header {
  8. height: 84px;
  9. display: block !important;
  10. }
  11. }
  12. </style>
  13. }
  14. <div class="repository">
  15. <div class="container">
  16. <div class="row">
  17. <div class="col-sm-9 list">
  18. <div class="product-list">
  19. <a class="back-nav" href="@Url.Action("Index","Product")">
  20. <i></i> 返回产品中心
  21. </a>
  22. <p>
  23. <span class="visible-xs-inline-block open-mask">
  24. @Model.ParentTypeName
  25. <i></i>
  26. </span>
  27. </p>
  28. <h2 class="list-title"> @Model.ParentTypeName</h2>
  29. @if (Model.ProductList.Count > 0)
  30. {
  31. <ul>
  32. @foreach (var item in Model.ProductList)
  33. {
  34. <li>
  35. <a href="@Url.Action("Detail", "Product", new { id = item.Id })" target="_blank">
  36. <div class="img">
  37. <img src="@item.Image" alt="">
  38. </div>
  39. <div class="txt">
  40. <h2>@item.Title</h2>
  41. <p>
  42. @item.Summary
  43. </p>
  44. </div>
  45. </a>
  46. </li>
  47. }
  48. </ul>
  49. <div class="pageDiv"></div>
  50. }
  51. else
  52. {
  53. <p style="padding:40px 0;">当前栏目下暂无数据~</p>
  54. }
  55. </div>
  56. </div>
  57. <div class="col-sm-3 category">
  58. <h2 class="close-mask visible-xs-inline-block">
  59. <em>
  60. <img src="/assets/image/arrow-color-left.png" alt="">
  61. </em>@Model.ParentTypeName
  62. </h2>
  63. <div class="total">
  64. <p>@Model.ParentTypeName</p>
  65. </div>
  66. <ul>
  67. @foreach (var item in Model.TypeList)
  68. {
  69. <li>
  70. <a class="@(item.Id== Model.TypeId?"cur":"")" href="@Url.Action("List","Product",new { ParentId= Model.ParentId,TypeId=item.Id})">@item.Name</a>
  71. </li>
  72. }
  73. </ul>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. @section script{
  79. <script src="/assets/plugins/page/jquery.page.js"></script>
  80. <script>
  81. window.dataMark = "0$15231983314041342$$15231983621571526$";
  82. if (@Model.TypeId == 95) {
  83. window.dataMark1 = "0$15231983314041342$$15231983621571526$$15248294492510939$";
  84. } else {
  85. window.dataMark1 = "0$15231983314041342$$15231983621571526$$15231984565940625$";
  86. }
  87. $(function () {
  88. $(".open-mask").click(function () {
  89. $(".category").addClass("showIn")
  90. })
  91. $(".close-mask").click(function () {
  92. $(".category").removeClass("showIn")
  93. })
  94. //分页
  95. var pageSize = 10;
  96. var rowsCount = @(Model.RowsCount);
  97. var pageIndex = @(Model.PageIndex);
  98. $(".pageDiv").createPage({
  99. pageCount: Math.ceil(rowsCount / pageSize), //总页数
  100. current: pageIndex, //当前页
  101. turndown: 'false',
  102. backFn: function (p) {
  103. pageIndex = p;
  104. location.href = "@Url.Action("List", "Product", new { Model.ParentId })&pageIndex=" + pageIndex + "&pageSize=" + pageSize;
  105. }
  106. });
  107. })
  108. </script>
  109. }