index.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
  8. <meta name="renderer" content="webkit">
  9. <meta name="keywords" content="{$site.keywords}" />
  10. <meta name="description" content="{$site.description}" />
  11. <title>{:__lang('Home')} - {$site.site_name}</title>
  12. <link rel="shortcut icon" href="{$site.logo|cdnurl}">
  13. <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/material/css/reset.css">
  14. <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/material/css/style.css">
  15. <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/material/css/swiper.min.css">
  16. <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/material/css/animate.min.css">
  17. <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/material/css/media.css">
  18. <script type="text/javascript" src="__CDN__/assets/addons/material/js/jquery.min.js"></script>
  19. <script type="text/javascript" src="__CDN__/assets/addons/material/js/swiper.min.js"></script>
  20. <script type="text/javascript" src="__CDN__/assets/addons/material/js/swiper.animate1.0.3.min.js"></script>
  21. <script type="text/javascript" src="__CDN__/assets/addons/material/js/wow.js"></script>
  22. <script type="text/javascript" src="__CDN__/assets/addons/material/js/jquery.counterup.min.js"></script>
  23. <script type="text/javascript" src="__CDN__/assets/addons/material/js/jquery.waypoints.min.js"></script>
  24. <script type="text/javascript" src="__CDN__/assets/addons/material/js/javascript.js"></script>
  25. <style>
  26. .banner {
  27. width: 100%;
  28. height: 560px;
  29. position: relative;
  30. overflow: hidden;
  31. }
  32. .banner-bg {
  33. width: 100%;
  34. height: 100%;
  35. object-fit: cover;
  36. display: block;
  37. filter: brightness(0.7);
  38. }
  39. .swiper-slide {
  40. position: relative;
  41. width: 100%;
  42. height: 100%;
  43. }
  44. .banner-content {
  45. position: absolute;
  46. left: 50%;
  47. top: 50%;
  48. transform: translate(-50%, -50%);
  49. color: #fff;
  50. text-align: center;
  51. z-index: 10;
  52. width: 100%;
  53. max-width: 900px;
  54. padding: 0 20px;
  55. }
  56. .banner-content h2 {
  57. font-size: 64px;
  58. font-weight: bold;
  59. color: #FFFFFF;
  60. letter-spacing: 2px;
  61. text-align: center;
  62. font-style: normal;
  63. margin-bottom: 30px;
  64. }
  65. .banner-content p {
  66. font-weight: 500;
  67. font-size: 30px;
  68. color: #FFFFFF;
  69. line-height: 44px;
  70. letter-spacing: 1px;
  71. margin-bottom: 10px;
  72. }
  73. .banner-content span {
  74. font-weight: 400;
  75. font-size: 16px;
  76. color: #FFFFFF;
  77. opacity: 0.85;
  78. }
  79. .banner .swiper-pagination {
  80. position: absolute;
  81. left: 50%;
  82. bottom: 20px;
  83. transform: translateX(-50%);
  84. z-index: 20;
  85. width: auto;
  86. display: flex;
  87. gap: 12px;
  88. align-items: center;
  89. justify-content: center;
  90. pointer-events: auto;
  91. }
  92. .banner .swiper-pagination-bullet {
  93. width: 20px;
  94. height: 4px;
  95. background: #FFFFFF;
  96. border-radius: 5px;
  97. opacity: 0.5;
  98. margin: 0 4px;
  99. transition: opacity 0.3s, background 0.3s;
  100. }
  101. .banner .swiper-pagination-bullet-active {
  102. opacity: 1;
  103. background: #fff;
  104. }
  105. /* 公司简介样式 */
  106. .company-profile {
  107. max-width: 1200px;
  108. margin: 80px auto 0;
  109. }
  110. .profile-header {
  111. margin-bottom: 40px;
  112. }
  113. .en-title {
  114. font-weight: 400;
  115. font-size: 30px;
  116. color: #737980;
  117. line-height: 44px;
  118. letter-spacing: 1px;
  119. margin-bottom: 5px;
  120. }
  121. .cn-title {
  122. font-size: 32px;
  123. color: #333;
  124. font-weight: 500;
  125. margin-top: 0;
  126. }
  127. .profile-content {
  128. position: relative;
  129. /* 添加这一行 */
  130. display: flex;
  131. align-items: stretch;
  132. margin-bottom: 80px;
  133. }
  134. .profile-left {
  135. flex: 1;
  136. display: flex;
  137. flex-direction: column;
  138. justify-content: flex-start;
  139. }
  140. .profile-text {
  141. flex: 1;
  142. padding-right: 40px;
  143. }
  144. .profile-text p {
  145. font-size: 16px;
  146. line-height: 1.8;
  147. color: #333;
  148. margin-bottom: 20px;
  149. text-align: justify;
  150. }
  151. .profile-more-btn {
  152. display: inline-block;
  153. width: 138px;
  154. height: 44px;
  155. background: #d32f0f;
  156. font-weight: 500;
  157. font-size: 14px;
  158. color: #FFFFFF;
  159. line-height: 20px;
  160. /* text-align: justified; */
  161. text-align: center;
  162. /* 竖直居中 */
  163. /* vertical-align: middle; */
  164. padding: 12px 40px;
  165. border-radius: 4px;
  166. margin-top: 30px;
  167. font-weight: 500;
  168. transition: background 0.2s;
  169. box-sizing: border-box;
  170. cursor: pointer;
  171. }
  172. .profile-more-btn:hover {
  173. background: #b71c1c;
  174. }
  175. .profile-image {
  176. width: 540px;
  177. flex-shrink: 0;
  178. overflow: hidden;
  179. display: flex;
  180. align-items: stretch;
  181. }
  182. .profile-image img {
  183. width: 100%;
  184. height: 100%;
  185. object-fit: cover;
  186. display: block;
  187. }
  188. /* 公司数据样式 */
  189. .company-data {
  190. width: 890px;
  191. height: 110px;
  192. background-color: #fff;
  193. box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  194. position: absolute;
  195. bottom: 40px;
  196. }
  197. .data-box {
  198. display: flex;
  199. justify-content: space-between;
  200. align-items: stretch;
  201. height: 100%;
  202. }
  203. .data-item {
  204. flex: 1 1 0;
  205. display: flex;
  206. flex-direction: column;
  207. align-items: center;
  208. justify-content: center;
  209. position: relative;
  210. height: 110px;
  211. }
  212. .data-item:not(:last-child)::after {
  213. content: '';
  214. position: absolute;
  215. right: 0;
  216. top: 25%;
  217. height: 50%;
  218. width: 1px;
  219. background-color: #cfd2d6;
  220. }
  221. .data-number-unit {
  222. display: flex;
  223. align-items: flex-end;
  224. justify-content: center;
  225. }
  226. .data-item h3 {
  227. font-weight: 500;
  228. font-size: 40px;
  229. color: #DF0100;
  230. margin: 0;
  231. line-height: 1;
  232. }
  233. .data-unit {
  234. font-weight: 400;
  235. font-size: 12px;
  236. color: #8A9199;
  237. margin-left: 4px;
  238. margin-bottom: 2px;
  239. }
  240. .data-title {
  241. font-weight: 400;
  242. font-size: 12px;
  243. color: #737980;
  244. /* margin-top: 8px; */
  245. }
  246. /* 新闻中心样式 */
  247. .news-center-section {
  248. width: 100%;
  249. height: 932px;
  250. background: url('images/index/background.jpg') center center no-repeat;
  251. background-size: cover;
  252. position: relative;
  253. padding: 0;
  254. box-sizing: border-box;
  255. }
  256. .news-center-inner {
  257. max-width: 1200px;
  258. margin: 0 auto;
  259. /* 可选:让内容垂直居中 */
  260. /* height: 100%; display: flex; flex-direction: column; justify-content: center; */
  261. }
  262. .news-header {
  263. display: flex;
  264. justify-content: space-between;
  265. align-items: flex-end;
  266. padding: 80px 0 80px 0;
  267. /* 左右padding去掉,交给外层容器控制 */
  268. }
  269. .news-more {
  270. font-weight: 400;
  271. font-size: 14px;
  272. color: #737980;
  273. line-height: 20px;
  274. transition: color 0.2s;
  275. }
  276. .news-more:hover {
  277. color: #ff3366;
  278. }
  279. .news-list {
  280. display: grid;
  281. grid-template-columns: repeat(3, 1fr);
  282. gap: 15px 30px;
  283. max-width: 1200px;
  284. margin: 0 auto;
  285. }
  286. .news-item {
  287. width: 100%;
  288. min-width: 0;
  289. background: #fff;
  290. border-radius: 8px;
  291. overflow: hidden;
  292. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  293. display: flex;
  294. flex-direction: column;
  295. transition: box-shadow 0.2s;
  296. }
  297. .news-item:hover {
  298. box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  299. }
  300. .news-item img {
  301. width: 380px;
  302. height: 240px;
  303. object-fit: cover;
  304. display: block;
  305. margin: 0 auto;
  306. }
  307. /* 新闻信息区域样式 */
  308. .news-info {
  309. padding: 15px;
  310. display: flex;
  311. align-items: center;
  312. /* 确保元素垂直居中 */
  313. }
  314. /* 日期样式 */
  315. .news-date {
  316. display: flex;
  317. flex-direction: column;
  318. /* 垂直排列 */
  319. align-items: center;
  320. /* 水平居中 */
  321. padding-right: 20px;
  322. /* 右侧间距20px */
  323. position: relative;
  324. /* 为伪元素定位 */
  325. min-width: 70px;
  326. /* 设置最小宽度 */
  327. flex-shrink: 0;
  328. /* 防止日期区域被压缩 */
  329. text-align: center;
  330. /* 文本居中 */
  331. }
  332. /* 添加竖线 */
  333. .news-date::after {
  334. content: '';
  335. position: absolute;
  336. right: 0;
  337. top: 50%;
  338. transform: translateY(-50%);
  339. width: 1px;
  340. height: 70%;
  341. /* 竖线高度为容器高度的70% */
  342. background-color: #e5e5e5;
  343. }
  344. /* 日期数字 */
  345. .date-day {
  346. font-size: 16px;
  347. font-weight: bold;
  348. color: #333;
  349. line-height: 1.2;
  350. display: block;
  351. /* 确保是块级元素 */
  352. margin-bottom: 5px;
  353. /* 添加底部间距 */
  354. }
  355. /* 年份 */
  356. .date-year {
  357. font-size: 14px;
  358. color: #999;
  359. line-height: 1.2;
  360. display: block;
  361. /* 确保是块级元素 */
  362. }
  363. /* 标题样式 */
  364. .news-title {
  365. margin: 0;
  366. padding-left: 20px;
  367. /* 左侧间距20px */
  368. font-size: 16px;
  369. line-height: 1.5;
  370. color: #333;
  371. overflow: hidden;
  372. text-overflow: ellipsis;
  373. display: -webkit-box;
  374. flex: 1;
  375. /* 让标题占据剩余空间 */
  376. }
  377. .message-section {
  378. max-width: 1200px;
  379. margin: 80px auto 0;
  380. padding-bottom: 80px;
  381. }
  382. .message-header {
  383. text-align: center;
  384. margin-bottom: 40px;
  385. }
  386. .message-header .en-title {
  387. font-size: 32px;
  388. color: #888;
  389. letter-spacing: 2px;
  390. margin-bottom: 8px;
  391. }
  392. .message-header .cn-title {
  393. font-size: 32px;
  394. font-weight: bold;
  395. color: #222;
  396. }
  397. .message-form {
  398. width: 100%;
  399. }
  400. .form-row {
  401. display: flex;
  402. justify-content: space-between;
  403. margin-bottom: 32px;
  404. }
  405. .form-group {
  406. flex: 1;
  407. display: flex;
  408. flex-direction: column;
  409. margin-right: 32px;
  410. }
  411. .form-group:last-child {
  412. margin-right: 0;
  413. }
  414. .form-group label {
  415. font-size: 16px;
  416. color: #222;
  417. margin-bottom: 10px;
  418. font-weight: 500;
  419. }
  420. .required {
  421. color: #d32f0f;
  422. margin-right: 2px;
  423. }
  424. .form-group input,
  425. .form-group textarea {
  426. background: #f6f8f7;
  427. border: none;
  428. border-radius: 2px;
  429. font-size: 16px;
  430. padding: 16px 18px;
  431. color: #333;
  432. outline: none;
  433. resize: none;
  434. transition: border 0.2s;
  435. }
  436. .form-group input:focus,
  437. .form-group textarea:focus {
  438. border: 1px solid #d32f0f;
  439. background: #fff;
  440. }
  441. .form-group input {
  442. height: 48px;
  443. }
  444. .form-group textarea {
  445. min-height: 100px;
  446. max-height: 200px;
  447. }
  448. .form-group-full {
  449. flex: 1 1 100%;
  450. margin-right: 0;
  451. }
  452. .form-row-btn {
  453. justify-content: center;
  454. }
  455. .submit-btn {
  456. width: 160px;
  457. height: 48px;
  458. background: #d32f0f;
  459. color: #fff;
  460. font-size: 18px;
  461. border: none;
  462. border-radius: 4px;
  463. cursor: pointer;
  464. font-weight: 500;
  465. transition: background 0.2s;
  466. }
  467. .submit-btn:hover {
  468. background: #b71c1c;
  469. }
  470. </style>
  471. </head>
  472. <body>
  473. <!-- 头部 -->
  474. {include file="header" /}
  475. <!-- Banner区域 -->
  476. <section class="banner">
  477. <div class="banner swiper">
  478. <div class="swiper-wrapper">
  479. {volist name="banner" id="v" key="k"}
  480. <div class="swiper-slide">
  481. <img src="{$v.pc_image|cdnurl}" class="banner-bg" alt="banner1">
  482. <div class="banner-content">
  483. <h2 swiper-animate-effect="fadeInLeft" swiper-animate-duration="1s" swiper-animate-delay="0.3s">
  484. {$v.bigfont}</h2>
  485. <p swiper-animate-effect="fadeInLeft" swiper-animate-duration="1s" swiper-animate-delay="0.6s">
  486. {$v.font}</p>
  487. <span>{$v.tip}</span>
  488. </div>
  489. </div>
  490. {/volist}
  491. <!-- 可继续添加更多slide -->
  492. </div>
  493. <!-- 分页器和导航按钮 -->
  494. <div class="swiper-pagination"></div>
  495. <!-- <div class="swiper-button-prev"></div>
  496. <div class="swiper-button-next"></div> -->
  497. </div>
  498. </section>
  499. {if $product_show == '1'}
  500. {/if}
  501. {if $about_show == '1'}
  502. <!-- 公司简介 -->
  503. <div class="company-profile">
  504. <div class="profile-content">
  505. <div class="profile-left">
  506. <div class="profile-header wow fadeInUp" data-wow-delay="0.3s">
  507. <h2 class="en-title">COMPANY PROFILE</h2>
  508. <h2 class="cn-title">公司简介</h2>
  509. </div>
  510. <div class="profile-text wow fadeInUp" data-wow-delay="0.5s">
  511. {$home.introduction}
  512. </div>
  513. <a href="{:addon_url('wwh/column/index', [':diyname'=>'about'])}" class="profile-more-btn">了解更多</a>
  514. </div>
  515. <div class="profile-image">
  516. <img src={$home.image|cdnurl} alt="公司大楼">
  517. </div>
  518. </div>
  519. </div>
  520. {/if}
  521. {if $cases_show == '1'}
  522. {/if}
  523. {if $partner_show == '1'}
  524. {/if}
  525. {if $news_show == '1'}
  526. <div class="news-center-section">
  527. <div class="news-center-inner">
  528. <div class="news-header wow fadeInUp" data-wow-delay="0.3s">
  529. <div>
  530. <div class="en-title">PRODUCT CLASSIFICATION</div>
  531. <div class="cn-title">新闻中心</div>
  532. </div>
  533. <a href="{:addon_url('wwh/column/index',[':diyname'=>'news'])}" target="_blank">MORE &gt;</a>
  534. </div>
  535. <div class="news-list">
  536. <!-- 新闻卡片,循环输出 -->
  537. {volist name="news" id="v"}
  538. <a class="wow fadeInUp" data-wow-delay="0.5s"
  539. href="{:addon_url('wwh/archives/index', [':diyname'=>$navId[$v.column_id]['diyname'], ':id'=>$v.id])}">
  540. <div class="news-item">
  541. <img src="{$v.rec_image|cdnurl}" alt="新闻图片">
  542. <div class="news-info">
  543. <div class="news-date">
  544. <span class="date-day">{$v.time|date='m-d',###}</span>
  545. <span class="date-year">{$v.time|date='Y',###}</span>
  546. </div>
  547. <div class="news-title">
  548. <h3>{$v.title}</h3>
  549. </div>
  550. </div>
  551. </div>
  552. </a>
  553. {/volist}
  554. <!-- 继续添加新闻项... -->
  555. </div>
  556. </div>
  557. </div>
  558. {/if}
  559. <!-- 在线留言 -->
  560. <div class="message-section wow fadeInUp" data-wow-delay="0.3s">
  561. <div class="message-header">
  562. <div class="en-title">ONLINE MESSAGE</div>
  563. <div class="cn-title">给我们留言</div>
  564. </div>
  565. <form class="message-form" id="message">
  566. <div class="form-row">
  567. <div class="form-group">
  568. <label><span class="required">*</span>联系人:</label>
  569. <input type="text" id="realname" name="realname" placeholder="请输入您的姓名">
  570. </div>
  571. <div class="form-group">
  572. <label><span class="required">*</span>电话:</label>
  573. <input type="text" id="tel" name="tel" placeholder="请输入您的电话">
  574. </div>
  575. <div class="form-group">
  576. <label><span class="required">*</span>邮箱:</label>
  577. <input type="email" id="email" name="email" placeholder="请输入您的邮箱">
  578. </div>
  579. </div>
  580. <div class="form-row">
  581. <div class="form-group form-group-full">
  582. <label><span class="required">*</span>留言板:</label>
  583. <textarea id="content" name="content" placeholder="请输入您的留言"></textarea>
  584. </div>
  585. </div>
  586. {:token()}
  587. <div class="form-row form-row-btn">
  588. <button type="submit" class="submit-btn">确定提交</button>
  589. </div>
  590. </form>
  591. </div>
  592. <!-- 底部 -->
  593. {include file="footer" /}
  594. <script src="__CDN__/assets/addons/material/js/layer/layer.js"></script>
  595. <script type="text/javascript">
  596. $(function () {
  597. var mySwiper = new Swiper('.banner', {
  598. loop: true,
  599. autoplay: {
  600. delay: 4000,
  601. disableOnInteraction: false,
  602. },
  603. pagination: {
  604. el: '.swiper-pagination',
  605. clickable: true,
  606. },
  607. navigation: {
  608. nextEl: '.swiper-button-next',
  609. prevEl: '.swiper-button-prev',
  610. },
  611. effect: 'fade',
  612. fadeEffect: {
  613. crossFade: true,
  614. },
  615. on:{
  616. init: function(){
  617. swiperAnimateCache(this); //隐藏动画元素
  618. swiperAnimate(this); //初始化完成开始动画
  619. },
  620. slideChangeTransitionEnd: function(){
  621. swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
  622. }
  623. }
  624. });
  625. // var full_height=$(window).height();
  626. // $('.index-banner-swiper').height(full_height);
  627. // $('.index-banner-swiper .swiper-slide .img .pic .img-block').height(full_height);
  628. // $('.index-banner-swiper .swiper-slide .img .mpic .img-block').height(full_height);
  629. // var swiper1 = new Swiper('.index-banner-swiper',{
  630. // slidesPerView: 1,
  631. // spaceBetween: 0,
  632. // effect: 'fade',
  633. // autoplay: {delay: 8000,stopOnLastSlide: false,disableOnInteraction: true,},
  634. // pagination: {
  635. // el: '.banner-pagination',
  636. // type: 'fraction',
  637. // renderFraction: function (currentClass, totalClass) { return '<span class="' + currentClass + '"></span>' + '<span class="' + totalClass + '"></span>';},
  638. // formatFractionCurrent: function (number) {switch(number){case 1:myNum='01';break;case 2:myNum='02';break;case 3:myNum='03';break;case 4:myNum='04';break;case 5:myNum='05';case 6:myNum='06';case 7:myNum='07';break;case 8:myNum='08';break;case 9:myNum='09';break;default:myNum= number}return myNum; },
  639. // formatFractionTotal: function (number) {switch(number){case 1:myNum='01';break;case 2:myNum='02';break;case 3:myNum='03';break;case 4:myNum='04';break;case 5:myNum='05';case 6:myNum='06';case 7:myNum='07';break;case 8:myNum='08';break;case 9:myNum='09';break;default:myNum= number}return myNum; },
  640. // },
  641. // navigation: {
  642. // nextEl: '.swiper-index-next',
  643. // prevEl: '.swiper-index-prev',
  644. // },
  645. // on:{
  646. // init: function(){
  647. // swiperAnimateCache(this); //隐藏动画元素
  648. // swiperAnimate(this); //初始化完成开始动画
  649. // },
  650. // slideChangeTransitionEnd: function(){
  651. // swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
  652. // }
  653. // }
  654. // });
  655. });
  656. // 提交留言
  657. $(".message-form").on("submit", function (e) {
  658. e.preventDefault(); // 阻止表单默认提交
  659. var realname = $.trim($("#realname").val());
  660. var tel = $.trim($("#tel").val());
  661. var email = $.trim($("#email").val());
  662. var content = $.trim($("#content").val());
  663. // var verify = $.trim($("#verify").val()); // 如果有验证码
  664. // 校验
  665. if (!realname) { showError('请输入您的姓名'); return false; }
  666. if (!tel) { showError('请输入您的电话'); return false; }
  667. if (!/^1[3-9]\d{9}$/.test(tel)) { showError('请输入正确的手机号'); return false; }
  668. if (!email) { showError('请输入您的邮箱'); return false; }
  669. if (!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(email)) { showError('请输入正确的邮箱'); return false; }
  670. if (!content) { showError('请输入您的留言'); return false; }
  671. // if(!verify){showError('请输入验证码');return false;}
  672. var form = document.getElementById("message");
  673. var formdata = new FormData(form);
  674. $(".submit-btn").prop('disabled', true);
  675. $.ajax({
  676. url: "{:addon_url('wwh/index/message')}",
  677. type: "POST",
  678. data: formdata,
  679. cache: false,
  680. contentType: false,
  681. processData: false,
  682. dataType: "json",
  683. complete: function () {
  684. $(".submit-btn").prop('disabled', false);
  685. },
  686. success: function (response) {
  687. if (response.code === 1) {
  688. layer.alert(response.msg, {
  689. icon: 1,
  690. end: function () {
  691. window.location.reload();
  692. }
  693. });
  694. } else {
  695. showError(response.msg);
  696. // fleshVerify(); // 如果有验证码
  697. }
  698. },
  699. error: function () {
  700. showError('网络错误,请重试');
  701. // fleshVerify(); // 如果有验证码
  702. }
  703. });
  704. function showError(msg) {
  705. layer.alert(msg, {
  706. skin: 'layui-layer-lan',
  707. closeBtn: 0,
  708. title: "提示:",
  709. icon: 2,
  710. anim: 2,
  711. end: function () {
  712. window.location.reload();
  713. }
  714. });
  715. }
  716. return false;
  717. });
  718. </script>
  719. </body>
  720. </html>