index.html 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024
  1. {extend name="public/layout"/} {block name="title"}{/block} {block name="body"}
  2. <link rel="stylesheet" href="//at.alicdn.com/t/c/font_3820309_6r1qmg91u8u.css">
  3. <style type="text/css">
  4. html,
  5. body {
  6. width: 100%;
  7. height: 100%;
  8. min-width: 1000px;
  9. }
  10. .layui-card {
  11. width: 100%;
  12. height: 100%;
  13. overflow: auto;
  14. background-color: #EEEEEE;
  15. }
  16. .layui-form {
  17. width: 100%;
  18. height: 100%;
  19. }
  20. .flex {
  21. display: flex;
  22. }
  23. .leftBox {
  24. flex: 3;
  25. margin: 10px 5px 10px 10px;
  26. background-color: #fff;
  27. box-sizing: border-box;
  28. padding: 15px;
  29. border-radius: 4px;
  30. overflow-y: auto;
  31. }
  32. .rightBox {
  33. flex: 2;
  34. margin: 10px 10px 10px 5px;
  35. background-color: #fff;
  36. border-radius: 4px;
  37. box-sizing: border-box;
  38. padding: 15px;
  39. }
  40. .labeltips {
  41. border-left: 4px solid #249EFB;
  42. box-sizing: border-box;
  43. padding-left: 5px;
  44. display: flex;
  45. align-items: center;
  46. font-weight: 600;
  47. }
  48. .switchBox {
  49. display: flex;
  50. align-items: center;
  51. padding: 10px;
  52. }
  53. .switchBox>span {
  54. margin-right: 10px;
  55. }
  56. .layui-form-switch {
  57. margin-top: 0px;
  58. }
  59. .smartScreen {
  60. width: 100%;
  61. max-width: 600px;
  62. height: auto;
  63. overflow: hidden;
  64. margin: 15px auto 0px;
  65. }
  66. .smartScreenTop {
  67. width: 100%;
  68. height: 160px;
  69. display: flex;
  70. margin-bottom: 30px !important;
  71. }
  72. .smartScreenItem1 {
  73. width: 160px;
  74. height: 180px;
  75. border-radius: 4px;
  76. overflow: hidden;
  77. display: flex;
  78. flex-direction: column;
  79. align-items: center;
  80. justify-content: center;
  81. }
  82. .smartScreenItem1:hover .smartBottomMsg {
  83. display: flex;
  84. }
  85. .smartScreenItem2:hover .smartBottomMsg {
  86. display: flex;
  87. }
  88. .smartScreenItem3:hover .smartBottomMsg {
  89. display: flex;
  90. }
  91. .smartScreenItem4:hover .smartBottomMsg {
  92. display: flex;
  93. }
  94. .smartScreenItem5:hover .smartBottomMsg {
  95. display: flex;
  96. }
  97. .smartScreenItem6:hover .smartBottomMsg {
  98. display: flex;
  99. }
  100. .smartScreenItem7:hover .smartBottomMsg {
  101. display: flex;
  102. }
  103. .smartScreenItem8:hover .smartBottomMsg {
  104. display: flex;
  105. }
  106. .smartScreenItem9:hover .smartBottomMsg {
  107. display: flex;
  108. }
  109. .smartScreenItem1>img {
  110. position: absolute;
  111. width: 100%;
  112. height: 100%;
  113. top: 0px;
  114. left: 0px;
  115. z-index: 0;
  116. }
  117. .smartScreenItem2>img {
  118. position: absolute;
  119. width: 100%;
  120. height: 100%;
  121. top: 0px;
  122. left: 0px;
  123. z-index: 0;
  124. }
  125. .smartScreenItem3>img {
  126. position: absolute;
  127. width: 100%;
  128. height: 100%;
  129. top: 0px;
  130. left: 0px;
  131. z-index: 0;
  132. }
  133. .smartScreenItem4>img {
  134. position: absolute;
  135. width: 100%;
  136. height: 100%;
  137. top: 0px;
  138. left: 0px;
  139. z-index: 0;
  140. }
  141. .smartScreenItem4 {
  142. width: 160px;
  143. height: 180px;
  144. background-color: green;
  145. border-radius: 4px;
  146. overflow: hidden;
  147. display: flex;
  148. flex-direction: column;
  149. align-items: center;
  150. justify-content: center;
  151. }
  152. .smartScreenBox {
  153. flex: 1;
  154. margin: 0px 10px;
  155. }
  156. .smartScreenItem2 {
  157. width: 100%;
  158. height: 85px;
  159. background-color: slateblue;
  160. margin-bottom: 10px;
  161. border-radius: 4px;
  162. overflow: hidden;
  163. display: flex;
  164. align-items: center;
  165. box-sizing: border-box;
  166. padding: 0px 20px;
  167. }
  168. .smartScreenItem3 {
  169. width: 100%;
  170. height: 85px;
  171. background-color: palevioletred;
  172. border-radius: 4px;
  173. overflow: hidden;
  174. display: flex;
  175. align-items: center;
  176. box-sizing: border-box;
  177. padding: 0px 20px;
  178. }
  179. .smartScreenBottom {
  180. width: 100%;
  181. height: auto;
  182. display: flex;
  183. align-items: flex-end;
  184. }
  185. .smartScreenItem5 {
  186. width: 75px;
  187. height: 80px;
  188. background-color: orange;
  189. margin-right: 10px;
  190. border-radius: 4px;
  191. overflow: hidden;
  192. display: flex;
  193. flex-direction: column;
  194. align-items: center;
  195. justify-content: center;
  196. }
  197. .smartScreenItem6 {
  198. width: 75px;
  199. height: 80px;
  200. background-color: orange;
  201. border-radius: 4px;
  202. overflow: hidden;
  203. display: flex;
  204. flex-direction: column;
  205. align-items: center;
  206. justify-content: center;
  207. }
  208. .smartScreenBox1 {
  209. flex: 1;
  210. display: flex;
  211. margin: 0px 10px;
  212. }
  213. .smartScreenItem7 {
  214. flex: 1;
  215. height: 80px;
  216. background-color: orange;
  217. margin-right: 5px;
  218. border-radius: 4px;
  219. overflow: hidden;
  220. display: flex;
  221. flex-direction: column;
  222. align-items: center;
  223. justify-content: center;
  224. }
  225. .smartScreenItem8 {
  226. flex: 1;
  227. height: 80px;
  228. background-color: orange;
  229. margin-left: 5px;
  230. border-radius: 4px;
  231. overflow: hidden;
  232. display: flex;
  233. flex-direction: column;
  234. align-items: center;
  235. justify-content: center;
  236. }
  237. .smartScreenItem9 {
  238. width: 160px;
  239. height: 80px;
  240. background-color: powderblue;
  241. border-radius: 4px;
  242. overflow: hidden;
  243. display: flex;
  244. flex-direction: column;
  245. align-items: center;
  246. justify-content: center;
  247. }
  248. .relative {
  249. position: relative;
  250. }
  251. .smartBottomMsg {
  252. position: absolute;
  253. width: 100%;
  254. height: 25px;
  255. background-color: rgba(0, 0, 0, 0.5);
  256. color: #fff;
  257. font-size: 10px;
  258. display: none;
  259. align-items: center;
  260. justify-content: space-between;
  261. box-sizing: border-box;
  262. padding: 0px 5px;
  263. bottom: 0px;
  264. left: 0px;
  265. z-index: 9;
  266. }
  267. .circle {
  268. width: 50px;
  269. height: 50px;
  270. border-radius: 50%;
  271. border: 2px solid #fff;
  272. display: flex;
  273. align-items: center;
  274. justify-content: center;
  275. position: relative;
  276. z-index: 9;
  277. }
  278. .textmsg {
  279. font-size: 14px;
  280. color: #fff;
  281. margin-top: 8px;
  282. font-weight: 600;
  283. position: relative;
  284. z-index: 9;
  285. }
  286. .textmsg1 {
  287. font-size: 14px;
  288. color: #fff;
  289. font-weight: 600;
  290. margin-left: 10px;
  291. position: relative;
  292. z-index: 9;
  293. }
  294. .spanWidth5 {
  295. display: inline-block;
  296. max-width: 50px;
  297. white-space: nowrap;
  298. text-overflow: ellipsis;
  299. overflow: hidden;
  300. }
  301. .spanWidth6 {
  302. display: inline-block;
  303. max-width: 90px;
  304. white-space: nowrap;
  305. text-overflow: ellipsis;
  306. overflow: hidden;
  307. }
  308. .layui-icon-set-fill {
  309. cursor: pointer;
  310. }
  311. .rightHeader {
  312. width: 100%;
  313. height: 20px;
  314. display: flex;
  315. align-items: center;
  316. font-size: 14px;
  317. }
  318. .rightName {
  319. margin: 0px 5px;
  320. color: #249EFB;
  321. }
  322. .hraderline {
  323. width: 4px;
  324. height: 20px;
  325. border-radius: 2px;
  326. background-color: #249EFB;
  327. }
  328. .nameInput {
  329. padding: 10px;
  330. }
  331. .nameInput>input {
  332. border: 1px solid #CCCCCC;
  333. height: 30px;
  334. box-sizing: border-box;
  335. padding: 0px 5px;
  336. margin-top: 10px;
  337. border-radius: 2px;
  338. }
  339. .uploadbgBox {
  340. width: 100px;
  341. height: 100px;
  342. border: 1px dotted #999999;
  343. margin-top: 10px;
  344. display: flex;
  345. align-items: center;
  346. justify-content: center;
  347. }
  348. .uploadbgBox>span {
  349. font-size: 14px;
  350. color: #999;
  351. }
  352. .tootips {
  353. color: #999;
  354. margin-top: 8px;
  355. font-size: 12px;
  356. }
  357. .fixedBtn {
  358. position: absolute;
  359. bottom: 0px;
  360. left: 0px;
  361. width: 100%;
  362. height: 54px;
  363. display: flex;
  364. justify-content: flex-end;
  365. box-sizing: border-box;
  366. padding: 0px 20px;
  367. align-items: center;
  368. border-top: 1px solid #CCCCCC;
  369. }
  370. .bgimage {
  371. position: absolute;
  372. width: 100%;
  373. height: 100%;
  374. top: 0px;
  375. left: 0px;
  376. z-index: 0;
  377. }
  378. i {
  379. position: relative;
  380. z-index: 9;
  381. }
  382. .zindex9 {
  383. position: relative;
  384. z-index: 9;
  385. }
  386. .mtbauto {
  387. margin: 40px 0px 20px;
  388. }
  389. .listBoxElement {
  390. width: 100%;
  391. height: auto;
  392. overflow: hidden;
  393. }
  394. .listItemBox {
  395. width: 100%;
  396. height: 40px;
  397. display: flex;
  398. align-items: center;
  399. justify-content: space-between;
  400. box-sizing: border-box;
  401. padding: 0px 10px;
  402. border-bottom: 1px solid #f2f2f2;
  403. }
  404. .moveElement {
  405. cursor: move;
  406. }
  407. .sortRight {
  408. cursor: pointer;
  409. }
  410. .listItemBox>div {
  411. display: flex;
  412. align-items: center;
  413. }
  414. .listItemBox>div>span {
  415. margin-left: 5px;
  416. }
  417. .sortlistbtn {
  418. width: 100%;
  419. height: 60px;
  420. display: flex;
  421. align-items: center;
  422. justify-content: flex-end;
  423. box-sizing: border-box;
  424. padding: 0px 20px;
  425. margin: 30px 0px;
  426. }
  427. .tipsspan {
  428. font-size: 12px;
  429. color: #999999;
  430. margin-left: 5px;
  431. }
  432. .saveBtnTime {
  433. background-color: #249DFA;
  434. padding: 6px 15px;
  435. border-radius: 4px;
  436. font-size: 12px;
  437. color: #fff;
  438. cursor: pointer;
  439. }
  440. .timeInput {
  441. border: 1px solid #CCCCCC;
  442. height: 28px;
  443. }
  444. </style>
  445. <div class="layui-card flex">
  446. <form class="layui-form flex" id="admin" enctype="multipart/form-data">
  447. <div class="leftBox">
  448. <div class="labeltips">智慧屏链接</div>
  449. <div class="switchBox">{$url}</div>
  450. <div class="labeltips">智慧屏录音</div>
  451. <div class="switchBox">
  452. <span>开启/关闭</span>
  453. <input type="checkbox" lay-skin="switch" lay-filter="switchElement" {if condition="$data.switch eq 1" }
  454. checked {/if} lay-text="开启|关闭">
  455. </div>
  456. <div class="labeltips">谈单有效时长</div>
  457. <div class="switchBox">
  458. <input class="timeInput" id="longTimeElement" type="number" min="0" style="width: 100px;" value="{$data['smartScreenValidMinutes']}" />
  459. <span style="margin-left: 5px;">分钟</span>
  460. <span class="saveBtnTime">保存</span>
  461. </div>
  462. <div class="labeltips">电脑端示例</div>
  463. <div class="smartScreen">
  464. <div class="smartScreenTop">
  465. <!-- 公司简介 -->
  466. <div class="smartScreenItem1 relative">
  467. {if condition='$data.row.introduce.background_img'}
  468. <img src="{$data.row.introduce.background_img}" alt="">
  469. {else/}
  470. <img src="/static/img/wisdom/introduce.png" alt="">
  471. {/if}
  472. <div class="circle">
  473. {if condition='$data.row.introduce.lcon_img'}
  474. <img src="{$data.row.introduce.lcon_img}" width="25px" alt="">
  475. {else/}
  476. <i class="iconfont icon-gongsi" style="font-size: 25px;color: #fff;"></i>
  477. {/if}
  478. </div>
  479. <span class="textmsg">{$data.row.introduce.title}</span>
  480. <div class="smartBottomMsg">
  481. <span>{$data.row.introduce.title}</span>
  482. <i data-type="introduce" data-title="{$data.row.introduce.title}"
  483. class="layui-icon layui-icon-set-fill"></i>
  484. </div>
  485. </div>
  486. <div class="smartScreenBox">
  487. <!-- 模式优势 -->
  488. <div class="smartScreenItem2 relative">
  489. {if condition='$data.row.pattern.background_img'}
  490. <img src="{$data.row.pattern.background_img}" alt="">
  491. {else/}
  492. <img src="/static/img/wisdom/pattern.png" alt="">
  493. {/if}
  494. <div class="circle">
  495. {if condition='$data.row.pattern.lcon_img'}
  496. <img src="{$data.row.pattern.lcon_img}" width="25px" alt="">
  497. {else/}
  498. <i class="iconfont icon-a-jiangbeipaihangbang-m"
  499. style="font-size: 25px;color: #fff;"></i>
  500. {/if}
  501. </div>
  502. <span class="textmsg1">{$data.row.pattern.title}</span>
  503. <div class="smartBottomMsg">
  504. <span>{$data.row.pattern.title}</span>
  505. <i data-type="pattern" data-title="{$data.row.pattern.title}"
  506. class="layui-icon layui-icon-set-fill"></i>
  507. </div>
  508. </div>
  509. <!-- 精品设计 -->
  510. <div class="smartScreenItem3 relative">
  511. {if condition='$data.row.boutique.background_img'}
  512. <img src="{$data.row.boutique.background_img}" alt="">
  513. {else/}
  514. <img src="/static/img/wisdom/boutique.png" alt="">
  515. {/if}
  516. <div class="circle">
  517. {if condition='$data.row.boutique.lcon_img'}
  518. <img src="{$data.row.boutique.lcon_img}" width="25px" alt="">
  519. {else/}
  520. <i class="iconfont icon-sheji" style="font-size: 25px;color: #fff;"></i>
  521. {/if}
  522. </div>
  523. <span class="textmsg1">{$data.row.boutique.title}</span>
  524. <div class="smartBottomMsg">
  525. <span>{$data.row.boutique.title}</span>
  526. <i data-type="boutique" data-title="{$data.row.boutique.title}"
  527. class="layui-icon layui-icon-set-fill"></i>
  528. </div>
  529. </div>
  530. </div>
  531. <!-- 材料 -->
  532. <div class="smartScreenItem4 relative">
  533. {if condition='$data.row.science.background_img'}
  534. <img src="{$data.row.science.background_img}" alt="">
  535. {else/}
  536. <img src="/static/img/wisdom/science.png" alt="">
  537. {/if}
  538. <div class="circle">
  539. {if condition='$data.row.science.lcon_img'}
  540. <img src="{$data.row.science.lcon_img}" width="25px" alt="">
  541. {else/}
  542. <i class="iconfont icon-cailiaogongcheng" style="font-size: 25px;color: #fff;"></i>
  543. {/if}
  544. </div>
  545. <span class="textmsg">{$data.row.science.title}</span>
  546. <div class="smartBottomMsg">
  547. <span>{$data.row.science.title}</span>
  548. <i data-type="science" data-title="{$data.row.science.title}"
  549. class="layui-icon layui-icon-set-fill"></i>
  550. </div>
  551. </div>
  552. </div>
  553. <div class="smartScreenBottom">
  554. <!-- 铂金工程 -->
  555. <div class="smartScreenItem5 relative">
  556. {if condition='$data.row.platinum.background_img'}
  557. <img class="bgimage" src="{$data.row.platinum.background_img}" alt="">
  558. {else/}
  559. <img class="bgimage" src="/static/img/wisdom/platinum.png" alt="">
  560. {/if}
  561. {if condition='$data.row.platinum.lcon_img'}
  562. <img class="zindex9" src="{$data.row.platinum.lcon_img}" width="25px" alt="">
  563. {else/}
  564. <i class="iconfont icon-shigongdian" style="font-size: 25px;color: #fff;"></i>
  565. {/if}
  566. <span class="textmsg">{$data.row.platinum.title}</span>
  567. <div class="smartBottomMsg">
  568. <span class="spanWidth5">{$data.row.platinum.title}</span>
  569. <i data-type="platinum" data-title="{$data.row.platinum.title}"
  570. class="layui-icon layui-icon-set-fill"></i>
  571. </div>
  572. </div>
  573. <!-- 定制家具 -->
  574. <div class="smartScreenItem6 relative">
  575. {if condition='$data.row.customized.background_img'}
  576. <img class="bgimage" src="{$data.row.customized.background_img}" alt="">
  577. {else/}
  578. <img class="bgimage" src="/static/img/wisdom/customized.png" alt="">
  579. {/if}
  580. {if condition='$data.row.customized.lcon_img'}
  581. <img class="zindex9" src="{$data.row.customized.lcon_img}" width="25px" alt="">
  582. {else/}
  583. <i class="iconfont icon-fenzu" style="font-size: 25px;color: #fff;"></i>
  584. {/if}
  585. <span class="textmsg">{$data.row.customized.title}</span>
  586. <div class="smartBottomMsg">
  587. <span class="spanWidth5">{$data.row.customized.title}</span>
  588. <i data-type="customized" data-title="{$data.row.customized.title}"
  589. class="layui-icon layui-icon-set-fill"></i>
  590. </div>
  591. </div>
  592. <div class="smartScreenBox1">
  593. <!-- 大牌软装 -->
  594. <div class="smartScreenItem7 relative">
  595. {if condition='$data.row.major.background_img'}
  596. <img class="bgimage" src="{$data.row.major.background_img}" alt="">
  597. {else/}
  598. <img class="bgimage" src="/static/img/wisdom/major.png" alt="">
  599. {/if}
  600. {if condition='$data.row.major.lcon_img'}
  601. <img class="zindex9" src="{$data.row.major.lcon_img}" width="25px" alt="">
  602. {else/}
  603. <i class="iconfont icon-taideng" style="font-size: 25px;color: #fff;"></i>
  604. {/if}
  605. <span class="textmsg">{$data.row.major.title}</span>
  606. <div class="smartBottomMsg">
  607. <span class="spanWidth6">{$data.row.major.title}</span>
  608. <i data-type="major" data-title="{$data.row.major.title}"
  609. class="layui-icon layui-icon-set-fill"></i>
  610. </div>
  611. </div>
  612. <!-- 口碑及服务 -->
  613. <div class="smartScreenItem8 relative">
  614. {if condition='$data.row.praise.background_img'}
  615. <img class="bgimage" src="{$data.row.praise.background_img}" alt="">
  616. {else/}
  617. <img class="bgimage" src="/static/img/wisdom/praise.png" alt="">
  618. {/if}
  619. {if condition='$data.row.praise.lcon_img'}
  620. <img class="zindex9" src="{$data.row.praise.lcon_img}" width="25px" alt="">
  621. {else/}
  622. <i class="iconfont icon-koubei" style="font-size: 25px;color: #fff;"></i>
  623. {/if}
  624. <span class="textmsg">{$data.row.praise.title}</span>
  625. <div class="smartBottomMsg">
  626. <span class="spanWidth6">{$data.row.praise.title}</span>
  627. <i data-type="praise" data-title="{$data.row.praise.title}"
  628. class="layui-icon layui-icon-set-fill"></i>
  629. </div>
  630. </div>
  631. </div>
  632. <!-- 实景样板房 -->
  633. <div class="smartScreenItem9 relative">
  634. {if condition='$data.row.realistic.background_img'}
  635. <img class="bgimage" src="{$data.row.realistic.background_img}" alt="">
  636. {else/}
  637. <img class="bgimage" src="/static/img/wisdom/realistic.png" alt="">
  638. {/if}
  639. {if condition='$data.row.realistic.lcon_img'}
  640. <img class="zindex9" src="{$data.row.realistic.lcon_img}" width="25px" alt="">
  641. {else/}
  642. <i class="iconfont icon-zhuliuyangbanjian-" style="font-size: 25px;color: #fff;"></i>
  643. {/if}
  644. <span class="textmsg">{$data.row.realistic.title}</span>
  645. <div class="smartBottomMsg">
  646. <span>{$data.row.realistic.title}</span>
  647. <i data-type="realistic" data-title="{$data.row.realistic.title}"
  648. class="layui-icon layui-icon-set-fill"></i>
  649. </div>
  650. </div>
  651. </div>
  652. </div>
  653. <div class="labeltips mtbauto">智慧屏列表排序<span class="tipsspan">(拖动图标排列顺序)</span></div>
  654. <div class="listBoxElement" id="listBoxElement">
  655. {volist name='menus' id='v'}
  656. <div data-id="{$v.id}" class="listItemBox">
  657. <div>
  658. <img src="/static/img/move.png" class="moveElement" width="16px" alt="">
  659. <span>{$v.name}</span>
  660. </div>
  661. <img src="/static/img/sTop.png" class="sortRight" width="20px" alt="">
  662. </div>
  663. {/volist}
  664. </div>
  665. <div class="sortlistbtn">
  666. <div class="cancelSort layui-btn layui-btn-primary">取消</div>
  667. <div class="saveSort layui-btn layui-btn-normal">保存排序</div>
  668. </div>
  669. </div>
  670. <div class="rightBox relative">
  671. <div class="rightHeader">
  672. <div class="hraderline"></div>
  673. <span class="rightName">公司简介</span>
  674. <span>设置</span>
  675. </div>
  676. <div class="nameInput">
  677. <div>板块名称</div>
  678. <input type="text" name="title" id="moduleNameEl">
  679. </div>
  680. <div class="nameInput">
  681. <div>背景设置</div>
  682. <div class="uploadbgBox" id="upload-drag0">
  683. <span>上传背景</span>
  684. </div>
  685. </div>
  686. <div class="nameInput">
  687. <div>图标上传</div>
  688. <div class="uploadbgBox" id="upload-drag1">
  689. <span>上传图标</span>
  690. </div>
  691. <div class="tootips">注意:上传的图标比例1:1,大小尺寸64 X 64</div>
  692. </div>
  693. <div class="fixedBtn">
  694. <div class="layui-btn layui-btn-primary" id="activity-submits">恢复默认</div>
  695. <div class="layui-btn layui-btn-primary">取消</div>
  696. <input type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="activity-submit"
  697. id="activity-submit" value="保存" />
  698. </div>
  699. </div>
  700. </form>
  701. </div>
  702. {/block} {block name="js"}
  703. <script type="text/javascript" src="__STATIC__/js/Sortable.js"></script>
  704. <script>
  705. layui.config({
  706. base: '__LAYUI__/',
  707. urlbase: '/sys'
  708. }).extend({
  709. index: 'lib/index'
  710. }).use(['index', 'table', 'upload', 'element'], function () {
  711. var $ = layui.$,
  712. element = layui.element,
  713. upload = layui.upload,
  714. form = layui.form,
  715. rType = "introduce",
  716. bgFile = null,
  717. iconFile = null,
  718. iconurl = null,
  719. bgurl = null;
  720. var field = {};
  721. form.render();
  722. new Sortable($('.listBoxElement')[0], {
  723. handle: '.moveElement', // handle's class
  724. animation: 150
  725. });
  726. $('.sortRight').click(function () {
  727. var ops1 = {
  728. draggable: ".listItemBox",
  729. onChoose: function (evt) {
  730. var index = evt.oldIndex;
  731. $("#listBoxElement .listItemBox").eq(index).insertBefore($("#listBoxElement .listItemBox").eq(0));
  732. }
  733. };
  734. var sortable1 = Sortable.create($('#listBoxElement')[0], ops1);
  735. })
  736. $('.cancelSort').click(function() {
  737. location.reload();
  738. })
  739. $('.saveSort').click(function() {
  740. let arr = [];
  741. $('.listItemBox').each(function() {
  742. let props = $(this).prop('dataset');
  743. arr.push(props.id);
  744. })
  745. $.ajax({
  746. url: '{:url("smartScreen/saveOrder")}',
  747. type: 'post',
  748. data: {ids: arr.join(',')},
  749. dataType: 'json',
  750. success: function (res) {
  751. if (res.code === 0) {
  752. layer.msg(res.msg, {
  753. anim: 0
  754. , time: 1500
  755. });
  756. setTimeout(() => {
  757. location.reload();
  758. // window.parent.parent.reloadInternet();
  759. },1500)
  760. } else {
  761. layer.msg(res.msg, {
  762. anim: 6
  763. , time: 1500
  764. });
  765. }
  766. }
  767. });
  768. return false;
  769. })
  770. /* 监听提交 */
  771. form.on('submit(activity-submit)', function (obj) {
  772. let formData = new FormData();
  773. let title = $('#moduleNameEl').val();
  774. formData.append('title', title);
  775. formData.append('type', rType);
  776. if (bgFile) {
  777. formData.set('background_img', bgFile)
  778. } else {
  779. if (bgurl) {
  780. formData.set('background_img', bgurl)
  781. }
  782. }
  783. if (iconFile) {
  784. formData.set('lcon_img', iconFile)
  785. } else {
  786. if (iconurl) {
  787. formData.set('lcon_img', iconurl)
  788. }
  789. }
  790. $.ajax({
  791. url: '{:url("smartScreen/saveModularRead")}',
  792. type: 'post',
  793. data: formData,
  794. dataType: 'json',
  795. processData: false,
  796. contentType: false,
  797. success: function (res) {
  798. if (res.code === 0) {
  799. layer.msg(res.msg, {
  800. anim: 0
  801. , time: 2000
  802. });
  803. location.reload();
  804. } else {
  805. layer.msg(res.msg, {
  806. anim: 6
  807. , time: 2000
  808. });
  809. }
  810. }
  811. });
  812. return false;
  813. });
  814. $(".saveBtnTime").click(function () {
  815. let minutes = $("#longTimeElement").val();
  816. if (!minutes||minutes <= 0) {
  817. layer.msg('请输入有效时长', {
  818. anim: 0
  819. , time: 2000
  820. });
  821. return false;
  822. }
  823. $.ajax({
  824. url: '{:url("smartScreen/setValidMinutes")}',
  825. type: 'post',
  826. data: {minutes: minutes},
  827. dataType: 'json',
  828. success: function (res) {
  829. if (res.code === 0) {
  830. layer.msg(res.msg, {
  831. anim: 0
  832. , time: 2000
  833. },function () {
  834. location.reload();
  835. });
  836. } else {
  837. layer.msg(res.msg, {
  838. anim: 6
  839. , time: 2000
  840. });
  841. }
  842. }
  843. });
  844. return false;
  845. })
  846. $('.layui-icon-set-fill').click(function (e) {
  847. rType = $(this).prop('dataset').type;
  848. let title = $(this).prop('dataset').title;
  849. $('.rightName').text(title)
  850. getCurData();
  851. })
  852. getCurData();
  853. function getCurData() {
  854. $.ajax({
  855. url: '{:url("smartScreen/getModularRead")}',
  856. type: 'post',
  857. data: {
  858. type: rType
  859. },
  860. dataType: 'json',
  861. success: function (res) {
  862. if (res.code === 0) {
  863. $('#moduleNameEl').val(res.data.title);
  864. if (res.data.background_img) {
  865. bgurl = res.data.background_img
  866. $('#upload-drag0').html('<img src="' + res.data.background_img + '" style="width:100%;height:auto;">')
  867. } else {
  868. bgurl = null;
  869. $('#upload-drag0').html('<span>上传背景</span>')
  870. }
  871. if (res.data.lcon_img) {
  872. iconurl = res.data.lcon_img
  873. $('#upload-drag1').html('<img src="' + res.data.lcon_img + '" style="width:100%;height:auto;">')
  874. } else {
  875. iconurl = null;
  876. $('#upload-drag1').html('<span>上传图标</span>')
  877. }
  878. } else {
  879. layer.msg(res.msg, {
  880. anim: 6
  881. , time: 2000
  882. });
  883. }
  884. }
  885. });
  886. }
  887. form.on('switch(switchElement)', function (data) {
  888. $.ajax({
  889. url: '{:url("smartScreen/recordingSwitch")}',
  890. type: 'post',
  891. data: {},
  892. dataType: 'json',
  893. success: function (res) {
  894. if (res.code === 0) {
  895. layer.msg(res.msg, {
  896. anim: 0
  897. , time: 2000
  898. });
  899. } else {
  900. layer.msg(res.msg, {
  901. anim: 6
  902. , time: 2000
  903. });
  904. }
  905. }
  906. });
  907. })
  908. //拖拽上传
  909. upload.render({
  910. elem: '#upload-drag0',
  911. accept: 'image',
  912. exts: 'jpg|png|bmp|jpeg|JPG|PNG|BMP|JPEG',
  913. auto: false,
  914. field: 'background_img',
  915. size: 1 * 1024,
  916. choose: function (obj) {
  917. obj.preview(function (index, file, result) {
  918. bgFile = file;
  919. $('#upload-drag0').html('<img src="' + result + '" style="width:100%;height:auto;">');
  920. });
  921. }
  922. });
  923. //拖拽上传
  924. upload.render({
  925. elem: '#upload-drag1',
  926. accept: 'image',
  927. exts: 'jpg|png|bmp|jpeg|JPG|PNG|BMP|JPEG',
  928. auto: false,
  929. field: 'lcon_img',
  930. size: 1 * 1024,
  931. choose: function (obj) {
  932. obj.preview(function (index, file, result) {
  933. iconFile = file
  934. $('#upload-drag1').html('<img src="' + result + '" style="width:100%;height:auto;">');
  935. });
  936. }
  937. });
  938. //恢复默认
  939. $('#activity-submits').click(function(){
  940. let title = $('#moduleNameEl').val();
  941. $.get("{:url('smartScreen/recovery')}?type="+rType, function (res) {
  942. if (res.code == 0) {
  943. layer.msg(res.msg, { anim: 0, time: 1000 }, function () {
  944. location.reload();
  945. });
  946. } else {
  947. layer.msg(res.msg, { anim: 6, time: 1000 });
  948. }
  949. });
  950. });
  951. });
  952. </script>
  953. {/block}