recomkjh.cshtml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @using Models
  2. @model List<LotteryData>
  3. @{ string[] items = null;}
  4. @if (Model != null && Model.Count > 0)
  5. {
  6. foreach (LotteryData item in Model)
  7. {
  8. <div class="ads-recomkjh">
  9. <span class="ads-name">@item.LotteryName</span>
  10. <div class="ads-kjh">
  11. <a href="/@(ViewBag.type)/@(item.LotteryText).html" target="_blank">
  12. @if (ViewBag.type == "kjh")
  13. {
  14. items = item.KaiJiHao.Split(',');
  15. }
  16. else
  17. {
  18. items = item.ShiJiHao.Split(',');
  19. }
  20. @if (items != null && items.Length > 0)
  21. {
  22. string ball = "";
  23. if (item.LotteryText == "ssq")
  24. {
  25. for (int i = 0; i < items.Length; i++)
  26. {
  27. ball = items[i];
  28. if (i == items.Length - 1)
  29. {
  30. <span class="ball-list blue" style="width:20px;height:20px;line-height:20px;font-size:1.2rem;margin: 0;">@ball</span>
  31. }
  32. else
  33. {
  34. <span class="ball-list red" style="width:20px;height:20px;line-height:20px;font-size:1.2rem;margin: 0;">@ball</span>
  35. }
  36. }
  37. }
  38. if (item.LotteryText == "dlt")
  39. {
  40. for (int i = 0; i < items.Length; i++)
  41. {
  42. ball = items[i];
  43. if (i == items.Length - 1 || i == items.Length - 2)
  44. {
  45. <span class="ball-list blue" style="width:20px;height:20px;line-height:20px;font-size:1.2rem;margin: 0;">@ball</span>
  46. }
  47. else
  48. {
  49. <span class="ball-list red" style="width:20px;height:20px;line-height:20px;font-size:1.2rem;margin: 0;">@ball</span>
  50. }
  51. }
  52. }
  53. if (item.LotteryText == "fc3d" || item.LotteryText == "pl3")
  54. {
  55. for (int i = 0; i < items.Length; i++)
  56. {
  57. ball = items[i];
  58. <span class="ball-list red" style="width:20px;height:20px;line-height:20px;font-size:1.2rem;margin: 0;">@ball</span>
  59. }
  60. }
  61. }
  62. </a>
  63. </div>
  64. <a href="/kjxq/qgc-@(item.LotteryText).html" target="_blank" class="ads-kjh-more"><i class="iconfont icon-right"></i></a>
  65. </div>
  66. }
  67. }