Index.cshtml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. @model IndexModel
  2. @section style{
  3. <link rel="stylesheet" href="@ConfigHelper.GetCDNPrefix()/assets/plugins/swiper/idangerous.swiper.css">
  4. <link rel="stylesheet" href="@ConfigHelper.GetCDNPrefix()/assets/css/index.css">
  5. <style>
  6. .l-fix {
  7. position: fixed;
  8. left: 0;
  9. z-index: 1000;
  10. top: 50%;
  11. box-shadow: 0 6px 100px -10px rgba(0,0,0,.35);
  12. transform: translate(0,-50%);
  13. margin-top: 75px;
  14. }
  15. .l-fix2 {
  16. margin-top: -75px;
  17. }
  18. .l-fix a {
  19. display: block;
  20. width: 140px;
  21. height: 140px;
  22. background-color: #f15558;
  23. color: #fff;
  24. display: flex;
  25. text-align: center;
  26. align-content: center;
  27. flex-wrap: wrap;
  28. font-size: 16px;
  29. line-height: 1.8;
  30. cursor: pointer;
  31. border: 1px solid transparent;
  32. transition: all 0.3s;
  33. }
  34. /*.l-fix a:hover {
  35. background-color: #fff;
  36. color: #f15558;
  37. border: 1px solid #f15558;
  38. }*/
  39. .l-fix p {
  40. width: 100%;
  41. }
  42. @@media (max-width: 768px) {
  43. .l-fix a {
  44. width: 60px;
  45. align-items: center;
  46. flex-direction: row-reverse;
  47. }
  48. .l-fix p {
  49. width: 50%;
  50. line-height: 18px;
  51. }
  52. }
  53. </style>
  54. }
  55. <div class="banner">
  56. <div class="swiper-container" id="banner">
  57. <div class="swiper-wrapper">
  58. @foreach (var item in Model.GalleryList)
  59. {
  60. <div class="swiper-slide" style="background-image:url('@item.Image')">
  61. <div class="txt">
  62. <h2>
  63. @Html.Raw(item.Title)
  64. </h2>
  65. @if (!string.IsNullOrWhiteSpace(item.Url))
  66. {
  67. <a href="@(!string.IsNullOrWhiteSpace(item.Url)?item.Url:"javascript:void(0);")">查看详情</a>
  68. }
  69. </div>
  70. </div>
  71. }
  72. </div>
  73. <ul class="swiper-pagination">
  74. @for (int i = 0; i < Model.GalleryList.Count; i++)
  75. {
  76. var item = Model.GalleryList[i];
  77. <li class="@(i == 0?"cur":"")">
  78. <h2>@item.ProductName</h2>
  79. <p>@item.ProductDesc</p>
  80. </li>
  81. }
  82. </ul>
  83. </div>
  84. </div>
  85. <!-- fast track -->
  86. <div class="fast-track container">
  87. <h2 class="index-tit wow fadeInUp">
  88. 快速通道
  89. </h2>
  90. <div class="wow fadeInUp">
  91. <div class="swiper-container" id="fast">
  92. <div class="swiper-wrapper">
  93. @if (Model.FastIConList.Count > 0)
  94. {
  95. foreach (var item in Model.FastIConList)
  96. {
  97. <div class="swiper-slide">
  98. <a @(!string.IsNullOrWhiteSpace(item.Url) ? "target=_blank" : "") href="@(!string.IsNullOrWhiteSpace(item.Url)?item.Url:"javascript:void(0);")" class="@(string.IsNullOrWhiteSpace(item.Url)?"no-link":"")">
  99. <img src="@item.Image" alt="">
  100. <p>@item.Title</p>
  101. </a>
  102. </div>
  103. }
  104. }
  105. </div>
  106. <div class="swiper-pagination visible-xs-block"></div>
  107. <span class="arrow-left arrow disabled hidden-xs"></span>
  108. <span class="arrow-right arrow hidden-xs"></span>
  109. </div>
  110. </div>
  111. </div>
  112. <!-- product -->
  113. <!-- product -->
  114. <div class="product container">
  115. <h2 class="index-tit wow fadeInUp">
  116. 人生中的每时每刻<br />国宝人寿期待与您相伴
  117. </h2>
  118. <div class="row">
  119. @foreach (var item in Model.ProductList)
  120. {
  121. <div class="col-sm-3 col-xs-6 wow fadeInUp">
  122. <a href="@(string.IsNullOrWhiteSpace(item.Url)?"javascript:void(0);":item.Url)" @(!string.IsNullOrWhiteSpace(item.Url) ? "target=_blank" : "")>
  123. <div class="img">
  124. <img src="@item.Image" alt="">
  125. </div>
  126. <div class="txt">
  127. <p>@Html.Raw(item.Title)</p>
  128. </div>
  129. <div class="con">
  130. <h2>@Html.Raw(item.Title)</h2>
  131. <p>@Html.Raw(item.Summary)</p>
  132. </div>
  133. </a>
  134. </div>
  135. }
  136. </div>
  137. @*<a class="more" href="">查看更多</a>*@
  138. </div>
  139. @*<div style="height:30px;"></div>*@
  140. <!-- service -->
  141. <div class="service container">
  142. <h2 class="index-tit wow fadeInUp">
  143. 国宝人寿全新一站式服务<br />只为您更好的体验
  144. </h2>
  145. <div class="row">
  146. <div class="col-sm-3 left wow fadeInUp">
  147. <div class="img">
  148. <picture>
  149. <source srcset="@(!string.IsNullOrWhiteSpace(Model.LeftServicegallery.MobileImage)?Model.LeftServicegallery.MobileImage:Model.LeftServicegallery.Image)" media="(max-width: 767px)">
  150. <img src="@Model.LeftServicegallery.Image" alt="">
  151. </picture>
  152. </div>
  153. <div class="txt">
  154. <h2>@Model.LeftServicegallery.Title</h2>
  155. <p>
  156. @Html.Raw(Model.LeftServicegallery.Summary)
  157. </p>
  158. @if (string.IsNullOrWhiteSpace(Model.LeftServicegallery.Url))
  159. {
  160. <a href="javascript:void(0);" style="background:#999;color:#fff;pointer-events:none;">敬请期待</a>
  161. }
  162. else
  163. {
  164. <a target="_blank" href="@Model.LeftServicegallery.Url">查看详情</a>
  165. }
  166. </div>
  167. </div>
  168. <div class="col-sm-9 right">
  169. <div class="row">
  170. @foreach (var item in Model.ServiceList)
  171. {
  172. <div class="col-sm-4 col-xs-6 wow fadeInUp">
  173. <div class="img">
  174. <a href="@(!string.IsNullOrWhiteSpace(item.Url)?item.Url:"javascript:void(0);")" @(!string.IsNullOrWhiteSpace(item.Url) ? "target=_blank" : "")>
  175. <img src="@item.Image" alt="">
  176. </a>
  177. </div>
  178. <div class="txt">
  179. <h2>
  180. <a href="@(!string.IsNullOrWhiteSpace(item.Url)?item.Url:"javascript:void(0);")" @(!string.IsNullOrWhiteSpace(item.Url) ? "target=_blank" : "")>@item.Title</a>
  181. </h2>
  182. <p>@item.Summary</p>
  183. </div>
  184. </div>
  185. }
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. <!-- ad-1 -->
  191. <div class="ad-ent" style="background-image:@(Model.BackGalleryList.Count>0?Model.BackGalleryList[0].Image:"")">
  192. <div class="txt">
  193. <h2 class="wow fadeInUp">为什么选择国宝</h2>
  194. @*<p class="wow fadeInUp">实力雄厚 · 行业领军 · 管理专业 · 服务贴心</p>*@
  195. </div>
  196. </div>
  197. <!-- ad-num -->
  198. <div class="ad-num hidden-xs">
  199. <div class="container">
  200. <p class="wow fadeInUp" style="text-align:center;font-size:26px;">实力雄厚 · 行业领军 · 管理专业 · 服务贴心</p>
  201. </div>
  202. </div>
  203. <!-- news -->
  204. <div class="container info-box">
  205. <div class="row">
  206. <div class="col-sm-8 news wow fadeInUp">
  207. <div class="tabs">
  208. @for (int i = 0; i < Model.TypeList.Count; i++)
  209. {
  210. var item = Model.TypeList[i];
  211. <span class="@(i == 0?"cur":"")">@item.Name</span>
  212. }
  213. </div>
  214. <div class="tab-con swiper-container">
  215. <div class="swiper-wrapper">
  216. @for (int i = 0; i < Model.TypeList.Count; i++)
  217. {
  218. var item = Model.TypeList[i];
  219. var child = Model.ChildrenList.FirstOrDefault(x => x.ParentId == item.Id);
  220. <div class="item swiper-slide">
  221. @if (item.Id == 88)
  222. {
  223. <a class="img" href="@Url.Action("Dynamic","Article")" target="_blank">
  224. <img src="@item.Thumbnail" alt="">
  225. </a>
  226. }
  227. else
  228. {
  229. <a href="@Url.Action("Industry","Article",new { typeId=child.Id})" class="img" target="_blank">
  230. <img src="@item.Thumbnail" alt="">
  231. </a>
  232. }
  233. <div class="txt">
  234. <div class="left">
  235. <h2>@item.Name</h2>
  236. <p>@item.Description</p>
  237. </div>
  238. <div class="right">
  239. @if (item.Id == 88)
  240. {
  241. <a href="@Url.Action("Dynamic","Article")" target="_blank">更多新闻</a>
  242. }
  243. else
  244. {
  245. <a href="@Url.Action("Industry","Article",new { typeId=child.Id})" target="_blank">查看更多</a>
  246. }
  247. </div>
  248. </div>
  249. </div>
  250. }
  251. </div>
  252. </div>
  253. </div>
  254. <div class="col-sm-4 media-all">
  255. <h2 class="wow fadeInUp">
  256. 国宝全媒体
  257. <br>
  258. <span>MEDIA</span>
  259. </h2>
  260. <ul class="icons">
  261. <li class="wow fadeInUp wx-box">
  262. <a @(string.IsNullOrWhiteSpace(Model.Wechat) ? "" : "target=_blank") href="javascript:void(0);" class="@(!string.IsNullOrWhiteSpace(Model.Wechat)?"":"no-link")">
  263. <div class="img">
  264. <img src="/assets/image/icon/icon7.png" alt="">
  265. </div>
  266. @if (!string.IsNullOrWhiteSpace(Model.Wechat))
  267. {
  268. <div class="wxQrcode">
  269. <img src="@Model.Wechat" alt="">
  270. </div>
  271. }
  272. <p>官方微信</p>
  273. </a>
  274. </li>
  275. <li class="wow fadeInUp">
  276. <a @(string.IsNullOrWhiteSpace(Model.Weibo) ? "" : "target=_blank") href="@(!string.IsNullOrWhiteSpace(Model.Weibo)?Model.Weibo:"javascript:void(0);")" class="@(!string.IsNullOrWhiteSpace(Model.Weibo)?"":"no-link")">
  277. <div class="img">
  278. <img src="/assets/image/icon/icon8.png" alt="">
  279. </div>
  280. <p>官方微博</p>
  281. </a>
  282. </li>
  283. </ul>
  284. </div>
  285. </div>
  286. </div>
  287. <!-- map -->
  288. <div class="map-box" style="background-image:@(Model.BackGalleryList.Count>1?Model.BackGalleryList[1].Image:"")">
  289. <div class="container">
  290. <h2 class="title wow fadeInUp">诚信 · 专业 · 忠厚 · 创新</h2>
  291. </div>
  292. </div>
  293. @section script{
  294. <script src="/assets/plugins/swiper/idangerous.swiper.min.js"></script>
  295. <script src="/assets/plugins/wow/wow.min.js"></script>
  296. <script>
  297. window.dataMark = "0$15231983314041342$$15231983492438575$";
  298. $(function () {
  299. //ie9及一下
  300. if (window.lessThenIE8) {
  301. alert("ie");
  302. }
  303. //banner carousel
  304. var bannerSwiper = new Swiper('#banner', {
  305. pagination: '#banner .swiper-pagination',
  306. createPagination: false,
  307. paginationClickable: true,
  308. speed: 800,
  309. autoplay: 5000,
  310. loop: true,
  311. onSlideChangeStart: function (swiper) {
  312. bannerPage(swiper.activeLoopIndex);
  313. }
  314. })
  315. $("#banner .swiper-pagination li").on("mouseenter", function () {
  316. var index = $(this).index();
  317. bannerPage(index);
  318. bannerSwiper.swipeTo(index);
  319. bannerSwiper.stopAutoplay();
  320. })
  321. $("#banner .swiper-pagination li").on("mouseleave", function () {
  322. bannerSwiper.startAutoplay();
  323. })
  324. function bannerPage(index) {
  325. $("#banner .swiper-pagination li").eq(index).addClass("cur").siblings().removeClass("cur");
  326. }
  327. //fast track
  328. var fastrSwiper = new Swiper('#fast', {
  329. pagination: '#fast .swiper-pagination',
  330. slidesPerView: 3,
  331. speed: 800,
  332. onSlideChangeStart: function (swiper) {
  333. //isFirstFast();
  334. //isLastFast();
  335. }
  336. })
  337. $('.arrow-left').on('click', function (e) {
  338. e.preventDefault();
  339. fastrSwiper.swipePrev();
  340. isFirstFast();
  341. $('.arrow-right').removeClass("disabled");
  342. })
  343. $('.arrow-right').on('click', function (e) {
  344. e.preventDefault();
  345. fastrSwiper.swipeNext();
  346. isLastFast();
  347. $('.arrow-left').removeClass("disabled")
  348. })
  349. function isFirstFast() {
  350. if (fastrSwiper.activeIndex == 0) {
  351. $('.arrow-left').addClass("disabled");
  352. } else {
  353. $('.arrow-left').removeClass("disabled");
  354. }
  355. }
  356. function isLastFast() {
  357. if (fastrSwiper.activeIndex == fastrSwiper.slides.length - 6) {
  358. $('.arrow-right').addClass("disabled");
  359. } else {
  360. $('.arrow-right').removeClass("disabled");
  361. }
  362. }
  363. fastRWD();
  364. $(window).on("resize", function () {
  365. fastRWD();
  366. })
  367. //fast track style response
  368. function fastRWD() {
  369. if (innerWidth < 768) {
  370. fastrSwiper.params.slidesPerView = 3;
  371. fastrSwiper.reInit();
  372. }
  373. if (innerWidth >= 768 && innerWidth < 1200) {
  374. fastrSwiper.params.slidesPerView = 5;
  375. fastrSwiper.reInit();
  376. }
  377. if (innerWidth >= 1200) {
  378. fastrSwiper.params.slidesPerView = 6;
  379. fastrSwiper.reInit();
  380. }
  381. }
  382. //news
  383. var tabsSwiper = new Swiper('.tab-con', {
  384. speed: 800,
  385. onSlideChangeStart: function () {
  386. $(".tabs .cur").removeClass('cur')
  387. $(".tabs span").eq(tabsSwiper.activeIndex).addClass('cur')
  388. }
  389. })
  390. $(".tabs span").on('mouseenter', function (e) {
  391. e.preventDefault()
  392. $(".tabs .cur").removeClass('cur')
  393. $(this).addClass('cur')
  394. tabsSwiper.swipeTo($(this).index())
  395. })
  396. $(".tabs span").click(function (e) {
  397. e.preventDefault();
  398. })
  399. });
  400. </script>
  401. <script src="~/assets/js/grayscale.js"></script>
  402. <script>
  403. grayscale($(".no-link img"));
  404. </script>
  405. }