1
0

case_add.html 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351
  1. {extend name="public/layout" /} {block name="title"}素材库{/block} {block name="body"}
  2. <!--<link rel="stylesheet" href="__LAYUI__/common.css" media="all">-->
  3. <style type="text/css">
  4. html,
  5. body {
  6. display: block;
  7. width: 100%;
  8. background-color: #fff;
  9. }
  10. .layui-fluid {
  11. display: block;
  12. border-radius: 5px;
  13. background-color: #ffffff;
  14. padding: 15px 30px;
  15. }
  16. .layui-icon {
  17. font-size: 18px !important;
  18. line-height: 38px;
  19. }
  20. .layui-input-inline {
  21. line-height: 38px;
  22. }
  23. .layui-input-inline input {
  24. margin-right: 10px;
  25. }
  26. .layui-form-item .layui-input-inline {}
  27. .input-indent-box-small {
  28. margin-left: 10px;
  29. }
  30. .layui-tab {
  31. padding: 15px;
  32. height: 100%;
  33. }
  34. .layui-card-body {
  35. overflow: hidden;
  36. }
  37. .layui-card-body .layui-form-item {
  38. float: left;
  39. clear: none;
  40. width: 330px;
  41. text-align: left;
  42. }
  43. .layui-table-view .layui-table th,
  44. .layui-table-view .layui-table td {
  45. text-align: center;
  46. border-color: #B6CADE;
  47. }
  48. .layui-table thead tr,
  49. .layui-table-header {
  50. background-color: #D8E6F1;
  51. }
  52. .input-indent-box {
  53. display: inline;
  54. width: 100%;
  55. }
  56. .input-indent-box-small {
  57. display: inline;
  58. width: 20%;
  59. }
  60. .adding {
  61. cursor: pointer;
  62. }
  63. .upload-img .area i {
  64. font-size: 50px;
  65. color: #009688;
  66. }
  67. .evi-block {
  68. float: left;
  69. margin-right: 10px;
  70. }
  71. /*///*/
  72. .imageDiv {
  73. display: inline-block;
  74. width: 140px;
  75. height: 125px;
  76. -webkit-box-sizing: border-box;
  77. -moz-box-sizing: border-box;
  78. box-sizing: border-box;
  79. border: 1px dashed darkgray;
  80. background: #f8f8f8;
  81. position: relative;
  82. overflow: hidden;
  83. }
  84. .addImages {
  85. display: inline-block;
  86. width: 140px;
  87. height: 125px;
  88. -webkit-box-sizing: border-box;
  89. -moz-box-sizing: border-box;
  90. box-sizing: border-box;
  91. border: 1px dashed darkgray;
  92. background: #f8f8f8;
  93. position: relative;
  94. overflow: hidden;
  95. }
  96. .text-detail {
  97. margin-top: 40px;
  98. text-align: center;
  99. }
  100. .text-detail>span {
  101. font-size: 40px;
  102. }
  103. .imageDiv div {
  104. width: 100%;
  105. height: 100%;
  106. position: absolute;
  107. top: 0px;
  108. background-color: #e6e6e600;
  109. }
  110. .imageDiv div i {
  111. display: none;
  112. font-size: 31px;
  113. position: absolute;
  114. top: 37%;
  115. left: 40%;
  116. }
  117. .imageDiv div:hover {
  118. background-color: #e6e6e680;
  119. }
  120. .imageDiv div:hover i {
  121. display: block;
  122. cursor: pointer;
  123. }
  124. .rotate180 {
  125. -webkit-transform: rotate(180deg);
  126. transform: rotate(180deg);
  127. }
  128. .layui-edge.rotate180 {
  129. margin-top: -9px;
  130. }
  131. .layui-input-inline.input-longer-inline {
  132. width: 290px;
  133. }
  134. .goback {
  135. float: right;
  136. }
  137. .goback a {
  138. color: #269efb;
  139. }
  140. .goback i {
  141. position: relative !important;
  142. }
  143. @media screen and (max-width: 450px) {
  144. .layui-form-item {
  145. position: relative;
  146. }
  147. .layui-form-item .layui-input-inline {
  148. padding-right: 40px !important;
  149. }
  150. .adding {
  151. position: absolute;
  152. right: 10px;
  153. top: 0;
  154. }
  155. }
  156. input:disabled,
  157. input[disabled] {
  158. color: black;
  159. opacity: 1;
  160. -webkit-text-fill-color: black;
  161. -webkit-opacity: 1;
  162. }
  163. .textlh1 {
  164. overflow: hidden;
  165. text-overflow: ellipsis;
  166. white-space: nowrap;
  167. }
  168. .pingmi {
  169. position: absolute;
  170. right: 9%;
  171. top: 0;
  172. }
  173. .layui-btn-primary {
  174. color: #249EFB;
  175. /* border: 1px solid #249EFB; */
  176. }
  177. .layui-btn-primary:hover {
  178. background-color: #E3F7FF;
  179. color: #249EFB;
  180. }
  181. .layui-card-body {
  182. padding: 10px 0px;
  183. }
  184. .relative {
  185. position: relative;
  186. }
  187. .noneClass {
  188. display: none !important;
  189. }
  190. .wordlist {
  191. width: 20px;
  192. position: absolute;
  193. top: 43px;
  194. right: 2px;
  195. display: flex;
  196. flex-direction: column;
  197. z-index: 99999;
  198. height: auto;
  199. justify-content: flex-start;
  200. align-items: center;
  201. box-sizing: border-box;
  202. padding: 3px 0px;
  203. overflow: hidden;
  204. max-height: 297px;
  205. -ms-overflow-style: none;
  206. /* IE 10+ */
  207. scrollbar-width: none;
  208. /* Firefox */
  209. overflow-y: scroll;
  210. background-color: #f5f5f5;
  211. }
  212. .wordlist::-webkit-scrollbar {
  213. display: none;
  214. /* Chrome Safari */
  215. }
  216. .wordlist>li {
  217. width: 20px;
  218. height: 37px;
  219. cursor: pointer;
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. margin-bottom: 0px;
  224. line-height: 37px;
  225. }
  226. .li_active {
  227. font-weight: 700;
  228. background-color: #249EFB;
  229. color: #fff;
  230. }
  231. .c_wordlist {
  232. width: 20px;
  233. position: absolute;
  234. top: 43px;
  235. right: 31px;
  236. display: flex;
  237. flex-direction: column;
  238. z-index: 99999;
  239. height: auto;
  240. justify-content: flex-start;
  241. align-items: center;
  242. box-sizing: border-box;
  243. padding: 4px 0px;
  244. overflow: hidden;
  245. max-height: 297px;
  246. -ms-overflow-style: none;
  247. /* IE 10+ */
  248. scrollbar-width: none;
  249. /* Firefox */
  250. overflow-y: scroll;
  251. background-color: #f5f5f5;
  252. }
  253. .c_wordlist::-webkit-scrollbar {
  254. display: none;
  255. /* Chrome Safari */
  256. }
  257. .c_wordlist>li {
  258. width: 20px;
  259. height: 37px;
  260. cursor: pointer;
  261. display: flex;
  262. justify-content: center;
  263. align-items: center;
  264. margin-bottom: 0px;
  265. line-height: 37px;
  266. }
  267. dd {
  268. border-bottom: 1px solid #EFEFEF;
  269. }
  270. .layui-anim-upbit {
  271. -ms-overflow-style: none;
  272. /* IE 10+ */
  273. scrollbar-width: none;
  274. /* Firefox */
  275. overflow-y: scroll;
  276. background-color: #fff;
  277. }
  278. .layui-anim-upbit::-webkit-scrollbar {
  279. display: none;
  280. /* Chrome Safari */
  281. }
  282. .layui-form-xxkbg{background:#ECECEC;overflow: hidden;padding-top: 10px;}
  283. .layui-form-xxk-ul{float:left;overflow: hidden;width:36%;}
  284. .layui-form-xxk-ul li{float:left;width:25%;height:36px;line-height: 36px;text-align: center;cursor: pointer;font-size: 14px;}
  285. .layui-zhu{color:#BF0505;line-height:23px;float:right;font-size: 14px;}
  286. .addxxkli{background: #fff;border-radius: 6px 6px 0 0;}
  287. .width94_{width:96%;}
  288. .wauto{margin:0 auto;}
  289. .layui-xxk-body-box{clear:both;}
  290. .layui-xxk-bodys{margin-top:20px;}
  291. .layui-xxk-bodys dd{display: none;border: 0;}
  292. .layui-form-select dl {
  293. width: 100% !important;
  294. }
  295. #symbshowed video{max-height:400px;max-width:100%;margin-top:15px;}
  296. .center {
  297. text-align: center;
  298. }
  299. .vrlishow{display: none;}
  300. .housetype>i{
  301. font-size: 12px !important;
  302. line-height: 38px;
  303. color: #4e8bfd;
  304. float: right;
  305. }
  306. .vrBtnSelect {
  307. max-width: 100px;
  308. white-space: nowrap;
  309. padding: 0px 10px;
  310. height: 38px;
  311. background-color: #249EFB;
  312. color: #ffffff;
  313. text-align: center;
  314. line-height: 38px;
  315. border-radius: 4px;
  316. margin-left: 5px;
  317. cursor: pointer;
  318. }
  319. .flexBox {
  320. display: flex !important;
  321. }
  322. </style>
  323. <body>
  324. <div class="layui-fluid">
  325. <div class="layui-card">
  326. <!-- <div class="layui-card-header ">
  327. <div class="layui-form-item">
  328. <div class="layui-inline wzh_ays-inline">
  329. <strong>装修案例</strong>
  330. </div>
  331. <div class="goback">
  332. <a href="{:url('material/caselisting')}"><i class="layui-icon layui-icon-return"></i>
  333. <span>返回列表</span>
  334. </a>
  335. </div>
  336. </div>
  337. </div> -->
  338. <div class="layui-card-body">
  339. <form class="layui-form" enctype="multipart/form-data" lay-filter="anli-form">
  340. <div class="layui-form-item">
  341. <label class="layui-form-label textlh1"><i style="color:red;">*</i>标题</label>
  342. <div class="layui-input-inline" style="width: 200px;">
  343. <input class="layui-input inputBox" name="title" type="text" value="" placeholder="请输入标题"
  344. autocomplete="off">
  345. </div>
  346. </div>
  347. <!-- <div class="layui-form-item">
  348. <label class="layui-form-label"><i style="color:red;">*</i>小区</label>
  349. <div class="layui-input-inline">
  350. <div class="layui-unselect layui-form-select">
  351. <div class="layui-select-title commu-ele-group select_community_input">
  352. <input type="text" id="select_community" class="layui-input layui-unselect commu-ele-group" value="" data-selectedid="" readonly="readonly" placeholder="请选择小区" autocomplete="off" />
  353. <i class="layui-edge commu-ele-group" id="commu_arrow"></i>
  354. </div>
  355. <dl class="layui-anim layui-anim-upbit commu-ele-group" id="dropdown_community">
  356. <dd class="topselectbtn commu-ele-group" data-ref="addcommu"> + 添加小区 + </dd>
  357. {volist name="communities.arr" id="vo"}
  358. <dd class="commu_option commu-ele-group" data-id="{$vo.id}"> {$vo.name}</dd>
  359. {/volist}
  360. </dl>
  361. </div>
  362. </div>
  363. <i class="layui-icon layui-icon-add-circle adding" style="font-size: 32px" id="community-adda"></i>
  364. </div> -->
  365. <div class="layui-form-item relative">
  366. <label class="layui-form-label"><i style="color:red;">*</i>小区</label>
  367. <div class="layui-input-inline" id="box212">
  368. <select name="community_id" id="label" lay-verify="required" lay-filter="type" lay-search>
  369. <option value="">请选择小区</option>
  370. {notempty name="communities"}
  371. {volist name="communities.arr" id="vo"}
  372. <option data-py="{$vo.s}" value="{$vo.id}">{$vo.name}</option>
  373. {/volist}
  374. {/notempty}
  375. </select>
  376. </div>
  377. <ul class="c_wordlist noneClass">
  378. {notempty name="communities"}
  379. {volist name="communities.sort" id="vo"}
  380. <li data-py="{$vo}">{$vo}</li>
  381. {/volist}
  382. {/notempty}
  383. </ul>
  384. <i class="layui-icon layui-icon-add-circle adding" style="font-size: 32px"
  385. id="community-add"></i>
  386. </div>
  387. <div class="layui-form-item">
  388. <label class="layui-form-label">
  389. 设计师
  390. </label>
  391. <div class="layui-input-inline">
  392. <div class="layui-unselect layui-form-select relative">
  393. <div class="layui-select-title designer-ele-group box121 select_designer_input">
  394. <input type="text" id="select_designer"
  395. class="layui-input layui-unselect designer-ele-group" readonly="readonly"
  396. value="" data-selectedid="" placeholder="请选择设计师" autocomplete="off" />
  397. <i class="layui-edge designer-ele-group" id="designer_arrow"></i>
  398. <input type="text" id="select_designer_hd" value="" name="designer_id" style="display: none;">
  399. </div>
  400. <dl class="layui-anim layui-anim-upbit designer-ele-group box121 select_type"
  401. id="dropdown_designer">
  402. {notempty name="designers.arr"}
  403. {volist name="designers.arr" id="vo"}
  404. <dd class="designer_option designer-ele-group designerlist" data-py="{$vo.s}"
  405. data-id="{$vo.id}">{$vo.name}</dd>
  406. {/volist}
  407. {else/}
  408. <dd class="center">暂无数据</dd>
  409. {/notempty}
  410. </dl>
  411. <ul class="wordlist noneClass">
  412. {notempty name="designers"}
  413. {volist name="designers.sort" id="vo"}
  414. <li data-word="{$vo}">{$vo}</li>
  415. {/volist}
  416. {/notempty}
  417. </ul>
  418. </div>
  419. </div>
  420. </div>
  421. <div class="layui-form-item">
  422. <label class="layui-form-label"><i style="color:red;">*</i>风格</label>
  423. <div class="layui-input-inline">
  424. <div class="layui-unselect layui-form-select">
  425. <div class="layui-select-title decostyle-ele-group select_decostyle_input">
  426. <input type="text" id="select_decostyle"
  427. class="layui-input layui-unselect decostyle-ele-group" value=""
  428. data-selectedid="" readonly="readonly" placeholder="请选择风格" autocomplete="off" />
  429. <i class="layui-edge decostyle-ele-group" id="decostyle_arrow"></i>
  430. <input type="text" id="select_decostyle_hd" value="" name="style_id" style="display: none;">
  431. </div>
  432. <dl class="layui-anim layui-anim-upbit decostyle-ele-group select_type" id="dropdown_decostyle">
  433. <dd class="topselectbtn decostyle-ele-group" data-ref="adddecostyle"> + 添加风格 + </dd>
  434. {volist name="decostyles" id="vo"}
  435. <dd class="decostyle_option decostyle-ele-group" data-id="{$vo.id}">{$vo.name}</dd>
  436. {/volist}
  437. </dl>
  438. </div>
  439. </div>
  440. <i class="layui-icon layui-icon-add-circle adding" style="font-size: 32px"
  441. id="decostyle-add"></i>
  442. </div>
  443. <div class="layui-form-item">
  444. <label class="layui-form-label"><i style="color:red;">*</i>户型</label>
  445. <div class="layui-input-inline">
  446. <div class="layui-unselect layui-form-select">
  447. <div class="layui-select-title housetype-ele-group select_housetype_input">
  448. <input type="text" id="select_housetype"
  449. class="layui-input layui-unselect housetype-ele-group" value=""
  450. data-selectedid="" readonly="readonly" placeholder="请选择户型" autocomplete="off" />
  451. <i class="layui-edge housetype-ele-group" id="housetype_arrow"></i>
  452. <input type="hidden" id="select_housetype_hd" value="" name="housetype_id">
  453. <input type="hidden" id="bh_type" value="1" name="bh_type">
  454. </div>
  455. <dl class="layui-anim layui-anim-upbit housetype-ele-group select_type" id="dropdown_housetype">
  456. <dd class="topselectbtn housetype-ele-group" data-ref="adddehousetype"> + 添加户型 +
  457. </dd>
  458. {volist name="housetype" id="vo"}
  459. <dd class="housetype_option housetype-ele-group" data-id="{$vo.id}">{$vo.name}</dd>
  460. {/volist}
  461. </dl>
  462. </div>
  463. </div>
  464. <i class="layui-icon layui-icon-add-circle adding" style="font-size: 32px"
  465. id="housetype-add"></i>
  466. </div>
  467. <div class="layui-form-item">
  468. <label class="layui-form-label"><i style="color:red;">*</i>面积</label>
  469. <div class="layui-input-inline" style="position: relative;width:200px;">
  470. <input type='text' onkeyup="RegularInt(this)" name="square" placeholder="请输入面积"
  471. class="layui-input input-indent-box" lay-verify="subject_add" value="">
  472. <span class="pingmi">平米</span>
  473. </div>
  474. </div>
  475. <div class="layui-form-item">
  476. <label class="layui-form-label">价格</label>
  477. <div class="layui-input-inline" style="position: relative;width:200px;">
  478. <input class="layui-input input-indent-box" onkeyup="RegularNum(this)" style="" name="money"
  479. placeholder="请输入价格" type="text" value="" />
  480. <span class="pingmi">万起</span>
  481. </div>
  482. </div>
  483. <!-- <div class="layui-form-item">
  484. <label class="layui-form-label"><i style="color:red;">*</i>户型</label>
  485. <div class="layui-input-inline" style="width:400px;">
  486. <input class="layui-input input-indent-box-small" style="margin-left: 0;" name="room" type="number" value="" placeholder="几" min="0" oninput="validity.valid||(value='');" />房
  487. <input class="layui-input input-indent-box-small" name="hall" type="number" value="" placeholder="几" min="0" oninput="validity.valid||(value='');" />厅
  488. <input class="layui-input input-indent-box-small" name="toilet" type="number" value="" placeholder="几" min="0" oninput="validity.valid||(value='');" />卫
  489. </div>
  490. </div> -->
  491. <div class="layui-form-item " style="clear:both;width: 100%;">
  492. <label class="layui-form-label"><i style="color:red;">*</i>封面图</label>
  493. <div style="margin: 20px 20px 0px;">
  494. <div class="addImages" id="anlicoverimg">
  495. <div class="text-detail">
  496. <span>+</span>
  497. <p>选择封面图</p>
  498. </div>
  499. </div>
  500. </div>
  501. </div>
  502. <div class="layui-form-item" style="width: 100%;">
  503. <label class="layui-form-label"></label>
  504. <div><i style="color: red;margin-right:5px;">*</i>建议上传封面图宽高比例5:3,图片大小不超过1M</div>
  505. </div>
  506. <div class="layui-form-item " style="clear:both;width: 100%;">
  507. <label class="layui-form-label">分享封面</label>
  508. <div style="margin: 20px 20px 0px;">
  509. <div class="addImages" id="cover">
  510. <div class="text-detail">
  511. <span>+</span>
  512. <p>选择分享封面</p>
  513. </div>
  514. </div>
  515. </div>
  516. </div>
  517. <div class="layui-form-item" style="width: 100%;">
  518. <label class="layui-form-label"></label>
  519. <div><i style="color: red;margin-right:5px;">*</i>上传分享封面图宽高比例5:4,图片大小不超过1M</div>
  520. </div>
  521. <div class="layui-xxk-body-box">
  522. <div class="layui-form-xxkbg">
  523. <div class="width94_ wauto">
  524. <ul class="layui-form-xxk-ul">
  525. <li class="addxxkli">效果案例</li>
  526. <li>实景案例</li>
  527. <li>视频案例</li>
  528. <li>VR案例</li>
  529. </ul>
  530. <p class="layui-zhu">注:四种案例形式可同时展现</p>
  531. </div>
  532. </div>
  533. <dl class="layui-xxk-bodys">
  534. <dd style="display:block;">
  535. <div class="layui-form-item" style="clear:both;width:100%;">
  536. <label class="layui-form-label">描述</label>
  537. <div class="layui-input-block">
  538. <!-- <textarea id="anli_content1" name="anli_desc" placeholder="描述" autocomplete="off" class="layui-textarea"></textarea> -->
  539. <script id="anli_content1" name="anli_desc" type="text/plain" style="height: 350px;"></script>
  540. </div>
  541. </div>
  542. </dd>
  543. <dd>
  544. <div class="layui-form-item" style="clear:both;width:100%;">
  545. <label class="layui-form-label">描述</label>
  546. <div class="layui-input-block">
  547. <!-- <textarea id="anli_content2" name="real_case" placeholder="描述" autocomplete="off" class="layui-textarea"></textarea> -->
  548. <script id="anli_content2" name="real_case" type="text/plain" style="height: 350px;"></script>
  549. </div>
  550. </div>
  551. </dd>
  552. <dd>
  553. <div class="layui-form-item layui-hide" >
  554. <div class="layui-input-inline" style="width: 290px;">
  555. <input type="radio" name="myradio" value="random_name" checked=true/> 上传文件名字是随机文件名, 后缀保留
  556. </div>
  557. </div>
  558. <div class="layui-form-item" style="clear:both;width:100%;">
  559. <label class="layui-form-label">选择视频</label>
  560. <div class="layui-input-block">
  561. <div class="layui-input-inline" style="width: 290px;display: block;" id="container">
  562. <a class="layui-btn btn layui-border-btn" id="selectfiles" href="javascript:void(0);" >选择视频</a>
  563. <a class="layui-btn btn layui-border-btn" id="postfiles" href="javascript:void(0);">开始上传</a>
  564. <div id="ossfile"></div>
  565. <div id="symbshowed"></div>
  566. <!--报错信息返回展示-->
  567. <pre id="console"></pre>
  568. <input type="hidden" value="" id="fileuri">
  569. <!--上传到OSS哪个文件下,在这里定义-->
  570. <input type="hidden" value="Video" id="category_name">
  571. </div>
  572. </div>
  573. </div>
  574. <div class="layui-form-item" style="clear:both;width:100%;">
  575. <label class="layui-form-label"><i style="color:red;">*</i> 视频格式:</label>
  576. <div class="layui-input-block lh45 mdl20" style="max-width: 300px !important;">
  577. <input type="radio" id="1" class="radio_input" lay-filter="video_type"
  578. name="video_type" value="0" title="全屏" checked>
  579. <input type="radio" id="2" class="radio_input" lay-filter="video_type"
  580. name="video_type" value="1" title="横屏">
  581. </div>
  582. </div>
  583. <div class="layui-form-item videolimit">
  584. <label class="layui-form-label"></label>
  585. <div><i style="color:red;margin-right:5px;">*</i><span id="limitVA">上传视频大小不超过280M</span></div>
  586. </div>
  587. </dd>
  588. <dd>
  589. <div class="layui-form-item" style="clear:both;width:100%;">
  590. <div class="vrlishow" style="display: block;">
  591. <label class="layui-form-label">VR链接:</label>
  592. <div class="layui-input-block flexBox">
  593. <input type="text" name="vr_link" placeholder="请输入VR链接" autocomplete="off" class="layui-input">
  594. <div class="vrBtnSelect">选择vr作品</div>
  595. </div>
  596. </div>
  597. </div>
  598. </dd>
  599. </dl>
  600. </div>
  601. <div class="layui-form-item" style="clear:both;">
  602. <label class="layui-form-label">继续添加</label>
  603. <div class="layui-input-block">
  604. <input type="checkbox" name="adding" title="" lay-skin="primary" {if
  605. condition="$adding eq 1" }checked{/if}>
  606. </div>
  607. </div>
  608. <div class="layui-form-item" style="clear:both;">
  609. <label class="layui-form-label">推荐</label>
  610. <div class="layui-input-block">
  611. <input type="checkbox" name="recommend" title="" lay-skin="primary">
  612. </div>
  613. </div>
  614. <div class="layui-form-item submit-btn" style="clear:both;">
  615. <input class="layui-btn layui-btn-primary " style="margin-left:110px;" type="button" lay-submit
  616. lay-filter="layuiadmin-anli-submit" id="layuiadmin-anli-submit" value="确认提交">
  617. </div>
  618. </form>
  619. </div>
  620. </div>
  621. </div>
  622. </body>
  623. <script type="text/javascript">
  624. function RegularNum(obj) {
  625. obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
  626. obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
  627. obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个, 清除多余的
  628. obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  629. obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入三个小数
  630. }
  631. function RegularInt(obj) {
  632. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字以外的字符
  633. obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
  634. }
  635. </script>
  636. {/block} {block name="js"}
  637. <!-- 配置文件 -->
  638. <script type="text/javascript" src="__STATIC__/ueditor/dist/utf8-php/ueditor.config.js"></script>
  639. <!-- 编辑器源码文件 -->
  640. <script type="text/javascript" src="__STATIC__/ueditor/dist/utf8-php/ueditor.all.js"></script>
  641. <!-- 实例化编辑器 -->
  642. <script type="text/javascript">
  643. var ue = UE.getEditor('anli_content1');
  644. var ues = UE.getEditor('anli_content2');
  645. </script>
  646. <script type="text/javascript" src="__STATIC__/js/plupload/js/plupload.full.min.js"></script>
  647. <script type="text/javascript" src="__STATIC__/js/plupload/ossupload.js"></script>
  648. <script>
  649. layui.config({
  650. base: '__LAYUI__/' //静态资源所在路径
  651. ,
  652. urlbase: '/sys'
  653. }).extend({
  654. index: 'lib/index' //主入口模块
  655. }).use(['index', 'form', 'table', 'layedit', 'element', 'upload'], function () {
  656. var form = layui.form,
  657. layedit = layui.layedit,
  658. element = layui.element,
  659. upload = layui.upload,
  660. $ = layui.jquery;
  661. var objdata={};
  662. var htmls2 = '';
  663. var htmls1 = '';
  664. function set_select(id,value){
  665. let obj=$("#"+id);
  666. let names='';
  667. for(var i=0;i<obj.find('option').length;i++){
  668. if(obj.find('option').eq(i).val()==value){
  669. obj.find("option").eq(i).attr("selected",true);
  670. getHousetype(value);
  671. names=obj.find('option').eq(i).html();
  672. }
  673. }
  674. setTimeout(function(){
  675. obj.parent().find(".layui-select-title").find("input").val(names);
  676. },500)
  677. }
  678. //vr作品
  679. $('.vrBtnSelect').click(function(){
  680. let vrStr = $('input[name="vr_link"]').val();
  681. let vrSid = "";
  682. if (vrStr && ((vrStr.indexOf("saastest.zhuangqixiaoguan.com") > -1)||(vrStr.indexOf("h5.zqxg.cc") > -1))) {
  683. vrSid = vrStr.split("/#/")[1];
  684. }
  685. layer.open({
  686. type: 2,
  687. title: ['选择VR作品', 'color:#333333;background-color:#D8E6F1;'],
  688. content: '{:url("building/group")}?id='+vrSid,
  689. area: ['80%', '80%'],
  690. btn: ['确定', '取消'],
  691. yes: function (index, layero) {
  692. let data = layero.find('iframe').contents().find("#hiddentext").val();
  693. if (data) {
  694. let vrObject = JSON.parse(data);
  695. $('input[name="vr_link"]').val(vrObject.show_url);
  696. }
  697. layer.close(index);
  698. //点击确认触发 iframe 内容中的按钮提交
  699. }
  700. });
  701. })
  702. if(localStorage.getItem('anlidata')){
  703. var bodyjson = JSON.parse(localStorage.getItem('anlidata'));
  704. if(bodyjson){
  705. $('input[name="title"]').val(bodyjson.title);
  706. forlist('#dropdown_community dd',parseInt(bodyjson.community_id),'#select_community');
  707. forlist('#dropdown_designer dd',parseInt(bodyjson.designer_id),'#select_designer');
  708. forlist('#dropdown_decostyle dd',parseInt(bodyjson.style_id),'#select_decostyle');
  709. forlist('#dropdown_housetype dd',parseInt(bodyjson.housetype_id),'#select_housetype');
  710. $('#select_designer_hd').val(bodyjson.designer_id);
  711. $('#select_housetype_hd').val(bodyjson.housetype_id);
  712. $('#select_decostyle_hd').val(bodyjson.style_id);
  713. $('input[name="square"]').val(bodyjson.square);
  714. $('input[name="money"]').val(bodyjson.money!='暂无报价'? bodyjson.money:'');
  715. $('input[name="vr_link"]').val(bodyjson.vr_link);
  716. if(bodyjson.cover_img){
  717. $('#anlicoverimg').html('<div class="imageDiv"><img src="' + bodyjson.cover_img + '" class="layui-upload-img" width="100%" height="100%"><div class="iconwrapper"></div></div>');
  718. }
  719. objdata['cover_img'] = bodyjson.cover_img;
  720. htmls1 = bodyjson.anli_desc;
  721. htmls2 = bodyjson.real_case;
  722. editcon(htmls1);
  723. editcons(htmls2);
  724. if(bodyjson.community_id){
  725. set_select('label',bodyjson.community_id);
  726. }
  727. if(bodyjson.video_case){
  728. $('#fileuri').val(bodyjson.video_case);
  729. $('#symbshowed').html('<video controls src="https://o.nczyzs.com/'+bodyjson.video_case+'" name="media"><source src="https://o.nczyzs.com/'+bodyjson.video_case+'" type="video/mp4"></video>');
  730. }
  731. }
  732. }
  733. function editcon(content){
  734. ue.setContent(content);
  735. }
  736. function editcons(content){
  737. ues.setContent(content);
  738. }
  739. $('.layui-form-xxk-ul li').click(function(){
  740. var n=$(this).index();
  741. $(this).addClass('addxxkli').siblings().removeClass('addxxkli');
  742. $('.layui-xxk-bodys dd').eq(n).show().siblings().hide();
  743. })
  744. function forlist(obj,ids,objname){
  745. for(var i=0;i<$(obj).length;i++){
  746. if($(obj).eq(i).attr('data-id')==ids){
  747. $(objname).val($(obj).eq(i).html());
  748. $(objname).attr('selectedid',ids);
  749. }
  750. }
  751. }
  752. $('input,textarea').off('input').on('input',function(obj){
  753. cache();
  754. })
  755. form.on('select(type)', function (data) {
  756. cache();
  757. getHousetype(data.value);
  758. })
  759. function getHousetype(community_id){
  760. $.post('{:url("building/housetype")}', {community_id}, function(res){
  761. if(res.code == 1) return;
  762. let btn = $('#dropdown_housetype').find('.topselectbtn');
  763. $('#dropdown_housetype').find('.housetype').remove();
  764. $.each(res.data, function(i,item){
  765. btn.after('<dd class="housetype_option housetype-ele-group housetype" data-id="'+item.id+'">'+item.housetype+'<i class="layui-icon layui-icon-link"></i></dd>');
  766. });
  767. })
  768. }
  769. $(document).on('click','.select_type dd',function (data) {
  770. cache();
  771. })
  772. $('#ueditor_0').contents().find('body').bind("keyup paste copy cut", function(e) {
  773. cache();
  774. });
  775. $('#ueditor_1').contents().find('body').bind("keyup paste copy cut", function(e) {
  776. cache();
  777. });
  778. $('#postfiles').click(function(){
  779. var timess=setInterval(function(){
  780. if($('#ossfile').find('.progress-bar').attr('aria-valuenow')==100){
  781. setTimeout(function(){
  782. objdata['video_case']=$('#fileuri').val();
  783. cache();
  784. },1000)
  785. clearInterval(timess);
  786. }
  787. },100)
  788. })
  789. function cache(){
  790. setTimeout(function(){
  791. var formarray=$("form").serializeArray();
  792. for(var i in formarray){
  793. objdata[formarray[i]['name']]=formarray[i]['value']
  794. }
  795. objdata['anli_desc']=ue.getContent('anli_content1');
  796. objdata['real_case']=ues.getContent('anli_content2');
  797. objdata['video_case']=$('#fileuri').val();
  798. var datas=JSON.stringify(objdata);
  799. localStorage.setItem('anlidata',datas);
  800. },500)
  801. }
  802. //自定义验证规则
  803. form.verify({
  804. subject_add: function (value) {
  805. if (value > 5000) {
  806. return '面积最大值5000';
  807. }
  808. },
  809. });
  810. //案例添加保存
  811. form.on('submit(layuiadmin-anli-submit)', function (data) {
  812. if($('.imageDiv img').attr('src')== "" || $('.imageDiv img').attr('src')== undefined || $('.imageDiv img').attr('src')== null){
  813. if (data.field.cover_img == "" || data.field.cover_img == null || data.field.cover_img == undefined) {
  814. layer.msg('请选择封面图', { anim: 0, time: 1000, icon: 5 });
  815. return false;
  816. }
  817. }
  818. var formData = new FormData(data.form);
  819. ue.ready(function () {
  820. formData.append('desc', ue.getContent('anli_content1'));
  821. });
  822. ue.ready(function () {
  823. formData.append('real_case', ues.getContent('anli_content2'));
  824. });
  825. formData.append('cover_img',objdata['cover_img']);
  826. if(objdata['cover_share_img'])
  827. formData.append('cover_share_img',objdata['cover_share_img']);
  828. //formData.append('community_id', $('#label').val());
  829. //formData.append('designer_id', $('#select_designer').data('selectedid'));
  830. //formData.append('style_id', $('#select_decostyle').data('selectedid'));
  831. //formData.append('housetype_id', $('#select_housetype').data('selectedid'));
  832. formData.append('video_case',$('#fileuri').val());
  833. formData.append('vr_case',$('input[name=vr_link]').val());
  834. // 单击之后提交按钮不可选,防止重复提交
  835. var DISABLED = 'layui-btn-disabled';
  836. var target = '#layuiadmin-anli-submit';
  837. $(target).addClass(DISABLED);
  838. $(target).attr('disabled', 'disabled');
  839. $.ajax({
  840. url: '{:url("material/apicaseadding")}',
  841. type: 'post',
  842. data: formData,
  843. dataType: 'json',
  844. processData: false,
  845. contentType: false,
  846. success: function (res) {
  847. if (res.code === 0) {
  848. objdata={};
  849. localStorage.setItem('anlidata','');
  850. layer.msg(res.msg, {
  851. anim: 0, time: 1000, icon: 6,
  852. }, function () {
  853. var adding = $("input[name='adding']").is(":checked");
  854. if (adding) {
  855. // window.location.reload();
  856. location.href = "{:url('material/case_add')}?adding=1";
  857. } else {
  858. var index = parent.layer.getFrameIndex(window.name);
  859. parent.layer.close(index);
  860. parent.layui.table.reload('anli-table');
  861. }
  862. });
  863. } else {
  864. layer.msg(res.msg, { anim: 0, time: 1000, icon: 5 });
  865. $(target).removeClass(DISABLED);
  866. $(target).removeAttr('disabled');
  867. }
  868. },
  869. error: function (e) {
  870. $(target).removeClass(DISABLED);
  871. $(target).removeAttr('disabled');
  872. }
  873. });
  874. return false;
  875. });
  876. /*---------------------------------------------------------*/
  877. $(document).click((e) => {
  878. let displayState = $('#dropdown_designer').attr('style');
  879. if (displayState === 'display: none;') {
  880. $('.wordlist').addClass('noneClass');
  881. }
  882. let c_element = $('#label').next();
  883. if (c_element[0].className.indexOf('layui-form-selected') < 0) {
  884. $('.c_wordlist').addClass('noneClass');
  885. }
  886. })
  887. $('dd').click(() => {
  888. $('.c_wordlist').addClass('noneClass');
  889. })
  890. $('.box121').click(() => {
  891. $('.wordlist').toggleClass('noneClass')
  892. })
  893. $('.wordlist').click((e) => {
  894. if (e.target.localName != 'li') {
  895. e.stopPropagation();
  896. return;
  897. }
  898. let index = 0;
  899. let curWord = e.target.dataset.word;
  900. let lilist = $('.wordlist').children();
  901. for (let i = 0; i < lilist.length; i++) {
  902. lilist[i].className = '';
  903. }
  904. let options = $('.designerlist');
  905. for (let j = 0; j < options.length; j++) {
  906. if (options[j].dataset.py.toUpperCase() == curWord) {
  907. index = j;
  908. setTimeout(() => {
  909. e.target.className = 'li_active';
  910. let num = j * 37;
  911. $('.box121').scrollTop(num);
  912. }, 50)
  913. e.stopPropagation();
  914. return;
  915. }
  916. }
  917. })
  918. $('#box212').click(() => {
  919. $('.c_wordlist').toggleClass('noneClass');
  920. })
  921. let xqElement = $('.layui-anim-upbit')[0];
  922. xqElement.classList.add('xqElement');
  923. let options = [];
  924. let xqDatalist = $('#label').children();
  925. for (let i = 0; i < xqDatalist.length; i++) {
  926. if (xqDatalist[i].dataset.py) {
  927. options.push(xqDatalist[i].dataset.py)
  928. }
  929. }
  930. $('.c_wordlist').click((e) => {
  931. if (e.target.localName != 'li') {
  932. e.stopPropagation();
  933. return;
  934. }
  935. let index = 0;
  936. let curWord = e.target.dataset.py;
  937. let lilist = $('.c_wordlist').children();
  938. for (let i = 0; i < lilist.length; i++) {
  939. lilist[i].className = '';
  940. }
  941. if (parseInt(curWord) != NaN) {
  942. let word1 = curWord.toLowerCase();
  943. index = options.indexOf(word1)
  944. } else {
  945. index = options.indexOf(curWord)
  946. }
  947. setTimeout(() => {
  948. e.target.className = 'li_active';
  949. let num = index * 37 + 37;
  950. $('.xqElement').scrollTop(num);
  951. }, 50)
  952. e.stopPropagation();
  953. })
  954. $('.layui-select-title input').on('input',function(e) {
  955. if (e.target.placeholder == '请选择小区') {
  956. let val = $(this).val();
  957. if (!val) {
  958. $('.c_wordlist').removeClass('noneClass');
  959. return;
  960. }
  961. $('.c_wordlist').addClass('noneClass');
  962. }
  963. })
  964. $('.layui-fluid').on('click', function (e) {
  965. if (!$(e.target).hasClass('commu-ele-group')) {
  966. $('#dropdown_community').hide();
  967. $('#commu_arrow').removeClass('rotate180');
  968. }
  969. if (!$(e.target).hasClass('designer-ele-group')) {
  970. $('#dropdown_designer').hide();
  971. $('#designer_arrow').removeClass('rotate180');
  972. }
  973. if (!$(e.target).hasClass('decostyle-ele-group')) {
  974. $('#dropdown_decostyle').hide();
  975. $('#decostyle_arrow').removeClass('rotate180');
  976. }
  977. if (!$(e.target).hasClass('housetype-ele-group')) {
  978. $('#dropdown_housetype').hide();
  979. $('#housetype_arrow').removeClass('rotate180');
  980. }
  981. });
  982. ///////
  983. $('.select_community_input').on('click', function () {
  984. $('#dropdown_community').toggle();
  985. $('#commu_arrow').toggleClass('rotate180');
  986. });
  987. $('.select_designer_input').on('click', function () {
  988. $('#dropdown_designer').toggle();
  989. $('#designer_arrow').toggleClass('rotate180');
  990. });
  991. $('.select_decostyle_input').on('click', function () {
  992. $('#dropdown_decostyle').toggle();
  993. $('#decostyle_arrow').toggleClass('rotate180');
  994. });
  995. $('.select_housetype_input').on('click', function () {
  996. $('#dropdown_housetype').toggle();
  997. $('#housetype_arrow').toggleClass('rotate180');
  998. });
  999. ////////
  1000. $(".commu_option").on('click', function () {
  1001. var commu_name = $(this).text();
  1002. var commu_id = $(this).data('id');
  1003. var select_community = $("#select_community");
  1004. select_community.val(commu_name);
  1005. select_community.data('selectedid', commu_id);
  1006. select_community.click();
  1007. });
  1008. $(".designer_option").on('click', function () {
  1009. var designer_name = $(this).text();
  1010. var designer_id = $(this).data('id');
  1011. var select_designer = $("#select_designer");
  1012. select_designer.val(designer_name);
  1013. select_designer.data('selectedid', designer_id);
  1014. select_designer.click();
  1015. $('#select_designer_hd').val(designer_id);
  1016. });
  1017. $(".decostyle_option").on('click', function () {
  1018. var decostyle_name = $(this).text();
  1019. var decostyle_id = $(this).data('id');
  1020. var select_decostyle = $("#select_decostyle");
  1021. select_decostyle.val(decostyle_name);
  1022. select_decostyle.data('selectedid', decostyle_id);
  1023. select_decostyle.click();
  1024. $('#select_decostyle_hd').val(decostyle_id);
  1025. });
  1026. $('#dropdown_housetype').on('click', ".housetype_option", function () {
  1027. var housetype_name = $(this).text();
  1028. var housetype_id = $(this).data('id');
  1029. var select_housetype = $("#select_housetype");
  1030. select_housetype.val(housetype_name);
  1031. select_housetype.data('selectedid', housetype_id);
  1032. select_housetype.click();
  1033. $('#select_housetype_hd').val(housetype_id);
  1034. if($(this).hasClass('housetype')){
  1035. $('#bh_type').val(2);
  1036. }
  1037. });
  1038. ///
  1039. $('.topselectbtn').on('click', function () {
  1040. var gonnado = $(this).data('ref');
  1041. if (gonnado == 'addcommu') {
  1042. addcommunity();
  1043. $('#select_community').click();
  1044. }
  1045. if (gonnado == 'adddesigner') {
  1046. adddesigner();
  1047. $('#select_designer').click();
  1048. }
  1049. if (gonnado == 'adddecostyle') {
  1050. adddecostyle();
  1051. $('#select_decostyle').click();
  1052. }
  1053. if (gonnado == 'adddehousetype') {
  1054. adddehousetype();
  1055. $('#select_housetype').click();
  1056. }
  1057. });
  1058. //小区添加
  1059. $('#community-add').on('click', function () {
  1060. addcommunity();
  1061. });
  1062. var addcommunity = function () {
  1063. layer.prompt({
  1064. title: ['小区添加', 'color:#333333;background-color:#D8E6F1;'],
  1065. }, function (value, index, elem) {
  1066. var value = $.trim(value);
  1067. if (value == '') {
  1068. layer.msg('请输入小区名称', { anim: 6 });
  1069. return false;
  1070. }
  1071. if (value.length > 20) {
  1072. layer.msg('小区名称超长', { anim: 6 });
  1073. return false;
  1074. }
  1075. $.post('{:url("material/apicommunityadding")}', {
  1076. community: value
  1077. }, function (res) {
  1078. if (res.code == 0) {
  1079. $('#label').append("<option selected value='" + res.data.id + "'>" + res.data.name + "</option>")
  1080. $("#select_community").val(res.data.id)
  1081. form.render('select');
  1082. layer.msg(res.msg, {
  1083. anim: 0
  1084. }, function () {
  1085. layer.close(index); //再执行关闭
  1086. });
  1087. } else {
  1088. layer.msg(res.msg, {
  1089. anim: 6
  1090. });
  1091. }
  1092. });
  1093. });
  1094. }
  1095. //设计师添加
  1096. $('#designer-add').on('click', function () {
  1097. adddesigner();
  1098. });
  1099. var adddesigner = function () {
  1100. layer.open({
  1101. type: 2,
  1102. title: ['设计师添加', 'color:#333333;background-color:#D8E6F1;'],
  1103. content: '{:url("material/choiceadding")}?type=' + 'designer',
  1104. resize: false,
  1105. area: ['400px', '350px'],
  1106. btn: ['确认提交', '取消'],
  1107. yes: function (index, layero) {
  1108. //点击确认触发 iframe 内容中的按钮提交
  1109. var submit = layero.find('iframe').contents().find("#layuiadmin-designer-submit");
  1110. submit.click();
  1111. }
  1112. });
  1113. }
  1114. //风格添加
  1115. $('#decostyle-add').on('click', function () {
  1116. adddecostyle();
  1117. });
  1118. var adddecostyle = function () {
  1119. layer.open({
  1120. type: 2,
  1121. title: ['风格添加', 'color:#333333;background-color:#D8E6F1;'],
  1122. content: '{:url("material/choiceadding")}?type=' + 'decostyle',
  1123. resize: false,
  1124. area: ['400px', '200px'],
  1125. btn: ['确认提交', '取消'],
  1126. yes: function (index, layero) {
  1127. //点击确认触发 iframe 内容中的按钮提交
  1128. setTimeout(function(){
  1129. $('#select_decostyle_hd').val($("#select_decostyle").attr('data-selectedid'))
  1130. },1000)
  1131. var submit = layero.find('iframe').contents().find("#layuiadmin-decostyle-submit");
  1132. submit.click();
  1133. }
  1134. });
  1135. }
  1136. //户型添加
  1137. $('#housetype-add').on('click', function () {
  1138. adddehousetype();
  1139. });
  1140. var adddehousetype = function () {
  1141. layer.open({
  1142. type: 2,
  1143. title: ['户型添加', 'color:#333333;background-color:#D8E6F1;'],
  1144. content: '{:url("material/choiceadding")}?type=' + 'housetype',
  1145. resize: false,
  1146. area: ['400px', '200px'],
  1147. btn: ['确认提交', '取消'],
  1148. yes: function (index, layero) {
  1149. setTimeout(function(){
  1150. $('#select_housetype_hd').val($("#select_housetype").attr('data-selectedid'))
  1151. },1000)
  1152. //点击确认触发 iframe 内容中的按钮提交
  1153. var submit = layero.find('iframe').contents().find("#layuiadmin-housetype-submit");
  1154. submit.click();
  1155. }
  1156. });
  1157. }
  1158. //案例封面图
  1159. upload.render({
  1160. elem: '#anlicoverimg',
  1161. accept: 'images',
  1162. url: '{:url("fileupload")}',
  1163. exts: 'jpg|png|bmp|jpeg|JPG|PNG|BMP|JPEG',
  1164. field: 'file',
  1165. size: 1 * 1024,
  1166. auto: true,
  1167. choose: function (obj) {
  1168. files = obj.pushFile();
  1169. length = $('.imageDiv').length;
  1170. obj.preview(function (index, file, result) {
  1171. length++;
  1172. if (length > 9) {
  1173. if (length == 10) layer.msg('限制九张图片以下', { time: 1000 });
  1174. delete files[index];
  1175. } else {
  1176. // $('#anlicoverimg').html('<div class="imageDiv" data-id="' + index + '"><img src="' + result + '" alt="' + file.name + '" class="layui-upload-img" width="100%" height="100%"><div><i class="layui-icon layui-icon-delete"></i></div></div>');
  1177. $('#anlicoverimg').html('<div class="imageDiv" data-id="' + index + '"><img src="' + result + '" alt="' + file.name + '" class="layui-upload-img" width="100%" height="100%"><div class="iconwrapper"></div></div>');
  1178. var idom = document.createElement('i');
  1179. idom.classList.add("layui-icon", "layui-icon-delete");
  1180. idom.addEventListener("click", function (e) {
  1181. e.stopPropagation();
  1182. var that = this;
  1183. layer.confirm('确定删除该图片么?', function (index) {
  1184. var imgDiv = $(that).closest('.imageDiv');
  1185. if (id = imgDiv.data('id')) {
  1186. delete files[id];
  1187. }
  1188. imgDiv.remove();
  1189. $('#anlicoverimg').html('<div class="text-detail"><span>+</span><p>选择替换封面图</p></div>');
  1190. layer.close(index);
  1191. });
  1192. });
  1193. $('.iconwrapper').append(idom);
  1194. }
  1195. });
  1196. },
  1197. done:function(res){
  1198. objdata['cover_img']=res.data.src;
  1199. cache();
  1200. }
  1201. });
  1202. upload.render({
  1203. elem: '#cover',
  1204. accept: 'images',
  1205. url: '{:url("fileupload")}',
  1206. exts: 'jpg|png|bmp|jpeg|JPG|PNG|BMP|JPEG',
  1207. field: 'file',
  1208. size: 1 * 1024,
  1209. auto: true,
  1210. choose: function (obj) {
  1211. files = obj.pushFile();
  1212. obj.preview(function (index, file, result) {
  1213. $('#cover').html('<div class="imageDiv" data-id="' + index + '"><img src="' + result + '" alt="' + file.name + '" class="layui-upload-img" width="100%" height="100%"><div class="iconwrapper"></div></div>');
  1214. var idom = document.createElement('i');
  1215. idom.classList.add("layui-icon", "layui-icon-delete");
  1216. idom.addEventListener("click", function (e) {
  1217. e.stopPropagation();
  1218. var that = this;
  1219. layer.confirm('确定删除该图片么?', function (index) {
  1220. var imgDiv = $(that).closest('.imageDiv');
  1221. if (id = imgDiv.data('id')) {
  1222. delete files[id];
  1223. }
  1224. imgDiv.remove();
  1225. $('#cover').html('<div class="text-detail"><span>+</span><p>选择替换封面图</p></div>');
  1226. layer.close(index);
  1227. });
  1228. });
  1229. $('.iconwrapper').append(idom);
  1230. });
  1231. },
  1232. done:function(res){
  1233. objdata['cover_share_img'] = res.data.src;
  1234. cache();
  1235. }
  1236. });
  1237. // $('.imageDiv').on('click', 'i', function() {
  1238. // var that = this;
  1239. // layer.confirm('确定删除该图片么?', function(index) {
  1240. // var imgDiv = $(that).closest('.imageDiv');
  1241. // if(id = imgDiv.data('id')) {
  1242. // delete files[id];
  1243. // }
  1244. // imgDiv.remove();
  1245. // layer.close(index);
  1246. // });
  1247. // });
  1248. });
  1249. </script>
  1250. {/block}