暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

edit.htm 60KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358
  1. {include file="public/layout" /}
  2. <body class="ad_postion bodystyle" style="overflow-y: scroll;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page min-hg-c-10">
  7. <form class="form-horizontal" id="post_form" action="{:url('ZcwdPosition/edit')}" method="post">
  8. <div class="ncap-form-default">
  9. <dl class="row">
  10. <dt class="tit">
  11. <label for="type">申报专业</label>
  12. </dt>
  13. <dd class="opt">
  14. <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
  15. -->
  16. <?php
  17. /*
  18. * <select name="type" class="select" style="margin:0px 5px;height:30px;">
  19. <option value="">--选择地区--</option>
  20. {eyou:foreach name='$pro_list' item='field1'}
  21. <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
  22. {/eyou:foreach}
  23. </select>
  24. */
  25. ?>
  26. <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
  27. <option value="">--选择申报专业--</option>
  28. {eyou:foreach name='$pos_list' item='field1'}
  29. <option value="{$field1.id}" {eq name="$field.type" value="$field1.id"}selected{/eq}>{$field1.title}</option>
  30. {/eyou:foreach}
  31. </select>
  32. <span style="margin-left: 14px;">服务地区范围: <font id="map_desc">{$tn}</font></span>
  33. <script>
  34. $(function(){
  35. $("#selectTest").change(function(e){
  36. console.log($(this).val());
  37. //发送ajax 请求地区数据
  38. $.ajax({
  39. type:'POST',
  40. url:"{:url('ZcwdPosition/getMap', ['_ajax'=>1])}",
  41. data:{
  42. id: $(this).val()
  43. ,_ajax:1
  44. },
  45. success:function(res){
  46. $('#map_desc').html(res.data);
  47. //重置前置条件
  48. $('#selectTest666').val('0');
  49. $('#citychoose').hide();
  50. $('#selectTest777').val('0');
  51. $('#citychoose2').hide();
  52. }
  53. });
  54. //请求等级数据
  55. $.ajax({
  56. type:'POST',
  57. url:"{:url('ZcwdPosition/getLess', ['_ajax'=>1])}",
  58. data:{
  59. id: $(this).val()
  60. ,_ajax:1
  61. },
  62. success:function(res){
  63. $('#selectTest222').html(res.data);
  64. }
  65. });
  66. });
  67. });
  68. </script>
  69. <!-- <span class="err">
  70. </span>
  71. <p class="notic">
  72. </p>-->
  73. <p class="notic2 red" id="title_tips" style="margin-top:10px;">
  74. 提示: 申报专业需要先设定地区范围,且名称不允许重复,前端可根据区域筛选出相关的申报专业;
  75. </p>
  76. </dd>
  77. </dl>
  78. <dl class="row">
  79. <dt class="tit"> <label for="title"><em>*</em>精确区域</label> </dt>
  80. <dd class="opt">
  81. <select name="sf" class="select" id="selectTest000_1" style="margin:0px 5px;height:30px;width:120px;">
  82. <option value="0">全国</option>
  83. {eyou:foreach name='$pro_list' item='field1'}
  84. <option value="{$field1.id}" {eq name="$field.sf" value="$field1.id"}selected{/eq}>{$field1.name}</option>
  85. {/eyou:foreach}
  86. </select>
  87. <select name="cs" class="select" id="selectTest000_2" style="margin:0px 5px;height:30px;width:120px;">
  88. <option value="0">选择市</option>
  89. {eyou:foreach name='$pro_list2' item='field1'}
  90. <option value="{$field1.id}" {eq name="$curr_id2" value="$field1.id"}selected{/eq}>{$field1.name}</option>
  91. {/eyou:foreach}
  92. {eyou:if condition='($field.cs > 0)'}
  93. <!--<option value="{$field.cs}" selected>{$csn}</option>-->
  94. {eyou:else /}
  95. {/eyou:if}
  96. </select>
  97. <p class="notic2 red" id="title_tips" style="margin-top:10px;">
  98. 提示: 每个申报专业根据精确区域可对应多条规则(即当前设定针对某个区域);
  99. </p>
  100. <script>
  101. $(function(){
  102. $("#selectTest000_1").change(function(e){
  103. console.log($(this).val());
  104. if($("#selectTest000_1").val() == 0){
  105. $('#selectTest000_2').hide();
  106. }else{
  107. //发送ajax 请求地区数据
  108. $.ajax({
  109. type:'POST',
  110. url:"{:url('ZcwdPosition/getCity', ['_ajax'=>1])}",
  111. data:{
  112. id: $("#selectTest000_1").val()
  113. ,_ajax:1
  114. },
  115. success:function(res){
  116. $('#selectTest000_2').html(res.data);
  117. //重置前置条件
  118. $('#selectTest000_2').show();
  119. }
  120. });
  121. }
  122. });
  123. });
  124. </script>
  125. </dd>
  126. </dl>
  127. <dl class="row">
  128. <dt class="tit"> <label for="title"><em>*</em>申报等级</label> </dt>
  129. <dd class="opt">
  130. <select name="sbdj" class="select" id="selectTest222" style="margin:0px 5px;height:30px;">
  131. {eyou:foreach name='$dj_group_list' item='field1'}
  132. <option value="{$field1.id}" {eq name="$field.sbdj" value="$field1.id"}selected{/eq}>{$field1.title}</option>
  133. {/eyou:foreach}
  134. <!--
  135. <option value="0" {eq name="$field.sbdj" value="0"}selected{/eq}>初级助理工程师</option>
  136. <option value="1" {eq name="$field.sbdj" value="1"}selected{/eq}>初级技术员</option>
  137. <option value="2" {eq name="$field.sbdj" value="2"}selected{/eq}>中级</option>
  138. <option value="3" {eq name="$field.sbdj" value="3"}selected{/eq}>品牌中级</option>
  139. <option value="4" {eq name="$field.sbdj" value="4"}selected{/eq}>副高级</option>
  140. -->
  141. </select>
  142. <p class="notic2 red" id="title_tips" style="margin-top:10px;">
  143. 提示: 每个申报专业每个区域(省市)每个等级对应一条规则;
  144. </p>
  145. </dd>
  146. </dl>
  147. <div style="display:none;">
  148. <?php
  149. /*
  150. * 字段模板
  151. * <dl class="row">
  152. <dt class="tit"> <label for="title"><em>*</em>年龄区间:</label> </dt>
  153. <dd class="opt">
  154. <input type="text" name="title" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off" value="">
  155. <span style="">助理工程师,技术员</span>
  156. <span class="err"></span>
  157. <p class="notic2 red" id="title_tips">
  158. </p>
  159. </dd>
  160. </dl>
  161. */
  162. ?>
  163. <hr/>
  164. <b>基本要求设置:</b>
  165. <dl class="row">
  166. <dt class="tit"> <label for="title"><em>*</em>年龄区间:</label> </dt>
  167. <dd class="opt">
  168. <span style="" id="ega-b">
  169. <label class="curpoin">
  170. <input type="radio" name="is_ega" {eq name="$field.is_ega" value="0"}checked{/eq} value="0">年龄不限制</label>
  171. &nbsp;&nbsp;
  172. <label class="curpoin">
  173. <input type="radio" name="is_ega" {eq name="$field.is_ega" value="1"}checked{/eq} value="1">年龄限制</label>
  174. </span>
  175. <span id="ega_input" style="{eyou:if condition='($field.is_ega > 0)'}{eyou:else /}display: none;{/eyou:if} margin-left: 15px !important;text-align: center;">
  176. <input style="width:50px !important;" type="number" name="ega[]" id="ega333" class="input-txt" autocomplete="off" value="{$field.ega_0}">
  177. &nbsp;&nbsp;-&nbsp;&nbsp;
  178. <input style="width:50px !important;" type="number" name="ega[]" id="ega333" class="input-txt" autocomplete="off" value="{$field.ega_1}">&nbsp;
  179. </span>
  180. <script>
  181. $(function(){
  182. $('#ega-b input[name="is_ega"]').change(function (){
  183. console.log("fdfd");
  184. if($(this).val() == 1){
  185. $('#ega_input').show();
  186. }else{
  187. $('#ega_input').hide();
  188. }
  189. });
  190. });
  191. </script>
  192. <span class="err"></span>
  193. <p class="notic2 red" id="title_tips">
  194. </p>
  195. </dd>
  196. </dl>
  197. <dl class="row">
  198. <dt class="tit">
  199. <label for="type">毕业专业</label>
  200. </dt>
  201. <dd class="opt">
  202. <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
  203. -->
  204. <?php
  205. /*
  206. * {eyou:foreach name='$pro_list' item='field1'}
  207. <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
  208. {/eyou:foreach}
  209. */
  210. ?>
  211. <select name="byzy" class="select" id="selectTest777" style="margin:0px 5px;height:30px;width:130px;">
  212. <option value="0" {eq name="$field.byzy" value="0"}selected{/eq}>不要求</option>
  213. <option value="1" {eq name="$field.byzy" value="1"}selected{/eq}>指定相关要求</option>
  214. </select>
  215. <script>
  216. $(function(){
  217. $("#selectTest777").change(function(e){
  218. var item = $("#selectTest").val();
  219. if(item == '' || item == 0){
  220. layer.msg('请先选择申报专业!', {icon: 2,time: 1000});
  221. $("#selectTest777").val('0');
  222. return false;
  223. }
  224. console.log(item);
  225. //发送ajax 请求地区数据
  226. $.ajax({
  227. type:'POST',
  228. url:"{:url('ZcwdPosition/getZs2', ['_ajax'=>1])}",
  229. data:{
  230. id: item //获取当前专业
  231. ,_ajax:1
  232. },
  233. success:function(res){
  234. $('#zhengshu2').html(res.data);
  235. }
  236. });
  237. console.log($(this).val());
  238. var v = $(this).val();
  239. if(v == 1){
  240. $('#citychoose2').show();
  241. }else{
  242. $('#citychoose2').hide();
  243. }
  244. });
  245. });
  246. </script>
  247. <span class="err"></span>
  248. <p class="notic"></p>
  249. </dd>
  250. </dl>
  251. <dl class="row" id="citychoose2" style="{eyou:if condition='($field.byzy > 0)'}{eyou:else /}display: none;{/eyou:if}">
  252. <dt class="tit"> <label for="title"><em>*</em>专业选择</label> </dt>
  253. <dd class="opt">
  254. <!---checked-->
  255. <div id="zhengshu2">
  256. {$byzy_html}
  257. </div>
  258. <span class="err"></span>
  259. <p class="notic2 red" id="title_tips"></p>
  260. </dd>
  261. </dl>
  262. <dl class="row">
  263. <dt class="tit"> <label for="title"><em>*</em>学历要求</label> </dt>
  264. <dd class="opt">
  265. <select name="xlyq" class="select" id="selectTest333" style="margin:0px 5px;height:30px;width:130px;">
  266. <option value="0" {eq name="$field.xlyq" value="0"}selected{/eq}>不限制</option>
  267. <option value="1" {eq name="$field.xlyq" value="1"}selected{/eq}>中专</option>
  268. <option value="2" {eq name="$field.xlyq" value="2"}selected{/eq}>高技</option>
  269. <option value="3" {eq name="$field.xlyq" value="3"}selected{/eq}>大专</option>
  270. <option value="4" {eq name="$field.xlyq" value="4"}selected{/eq}>本科</option>
  271. <option value="5" {eq name="$field.xlyq" value="5"}selected{/eq}>硕士</option>
  272. <option value="6" {eq name="$field.xlyq" value="6"}selected{/eq}>博士</option>
  273. </select>
  274. 以上
  275. </dd>
  276. </dl>
  277. <dl class="row">
  278. <dt class="tit"> <label for="title"><em>*</em>学校类型</label> </dt>
  279. <dd class="opt">
  280. <label class="curpoin">
  281. <input type="radio" name="xxlx" value="0" {eq name="$field.xxlx" value="0"}checked{/eq}>不限制</label>
  282. &nbsp;&nbsp;
  283. <label class="curpoin">
  284. <input type="radio" name="xxlx" value="1" {eq name="$field.xxlx" value="1"}checked{/eq}>全日制</label>
  285. &nbsp;&nbsp;
  286. <label class="curpoin">
  287. <input type="radio" name="xxlx" value="2" {eq name="$field.xxlx" value="2"}checked{/eq}>非全日制</label>
  288. </dd>
  289. </dl>
  290. <dl class="row">
  291. <dt class="tit"> <label for="title"><em>*</em>毕业时间:</label> </dt>
  292. <dd class="opt">
  293. <span style="" id="bysj-b">
  294. <label class="curpoin">
  295. <input type="radio" name="bysj" value="0" {eq name="$field.bysj" value="0"}checked{/eq}>不限制</label>
  296. &nbsp;&nbsp;
  297. <label class="curpoin">
  298. <input type="radio" name="bysj" value="1" {eq name="$field.bysj" value="1"}checked{/eq}>限制</label>
  299. </span>
  300. <span id="bysj_input" style="{eyou:if condition='($field.bysj > 0)'}{eyou:else /}display: none;{/eyou:if} margin-left: 15px !important;text-align: center;">
  301. >=
  302. <input style="width:50px !important;" type="number" name="bysj_time" id="bysj333" class="input-txt" autocomplete="off" value="{$field.bysj_time}">
  303. &nbsp;年
  304. </span>
  305. <script>
  306. $(function(){
  307. $('#bysj-b input[name="bysj"]').change(function (){
  308. console.log("fdfd");
  309. if($(this).val() == 1){
  310. $('#bysj_input').show();
  311. }else{
  312. $('#bysj_input').hide();
  313. }
  314. });
  315. });
  316. </script>
  317. <span class="err"></span>
  318. <p class="notic2 red" id="title_tips">
  319. </p>
  320. </dd>
  321. </dl>
  322. <hr/>
  323. <b>设置前置条件:</b>
  324. <dl class="row">
  325. <dt class="tit">
  326. <label for="type">是否需要证书</label>
  327. </dt>
  328. <dd class="opt">
  329. <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
  330. -->
  331. <?php
  332. /*
  333. * {eyou:foreach name='$pro_list' item='field1'}
  334. <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
  335. {/eyou:foreach}
  336. */
  337. ?>
  338. <select name="is_zs" class="select" id="selectTest666" style="margin:0px 5px;height:30px;width:130px;">
  339. <option value="0" {eq name="$field.is_zs" value="0"}selected{/eq}>不需要</option>
  340. <option value="1" {eq name="$field.is_zs" value="1"}selected{/eq}>需要</option>
  341. </select>
  342. <script>
  343. $(function(){
  344. $("#selectTest666").change(function(e){
  345. var item = $("#selectTest").val();
  346. if(item == '' || item == 0){
  347. layer.msg('请先选择申报专业!', {icon: 2,time: 1000});
  348. $("#selectTest666").val('0');
  349. return false;
  350. }
  351. console.log(item);
  352. //发送ajax 请求地区数据
  353. $.ajax({
  354. type:'POST',
  355. url:"{:url('ZcwdPosition/getZs', ['_ajax'=>1])}",
  356. data:{
  357. id: item //获取当前专业
  358. ,_ajax:1
  359. },
  360. success:function(res){
  361. $('#zhengshu').html(res.data);
  362. }
  363. });
  364. console.log($(this).val());
  365. var v = $(this).val();
  366. if(v == 1){
  367. $('#citychoose').show();
  368. }else{
  369. $('#citychoose').hide();
  370. }
  371. });
  372. });
  373. </script>
  374. <span class="err"></span>
  375. <p class="notic"></p>
  376. </dd>
  377. </dl>
  378. <dl class="row" id="citychoose" style="{eyou:if condition='($field.is_zs > 0)'}{eyou:else /}display: none;{/eyou:if}">
  379. <dt class="tit"> <label for="title"><em>*</em>证书选择</label> </dt>
  380. <dd class="opt">
  381. <!---checked-->
  382. <div id="zhengshu">
  383. {$zs_html}
  384. </div>
  385. <span class="err"></span>
  386. <p class="notic2 red" id="title_tips"></p>
  387. </dd>
  388. </dl>
  389. <dl class="row">
  390. <dt class="tit"> <label for="title"><em>*</em>工作时间年限</label> </dt>
  391. <dd class="opt">
  392. <select name="sjnx" class="select" id="selectTest888" style="margin:0px 5px;height:30px;width:130px;">
  393. <option value="0" {eq name="$field.sjnx" value="0"}selected{/eq}>不限制</option>
  394. <option value="1" {eq name="$field.sjnx" value="1"}selected{/eq}>1年</option>
  395. <option value="2" {eq name="$field.sjnx" value="2"}selected{/eq}>2年</option>
  396. <option value="3" {eq name="$field.sjnx" value="3"}selected{/eq}>3年</option>
  397. <option value="4" {eq name="$field.sjnx" value="4"}selected{/eq}>4年</option>
  398. <option value="5" {eq name="$field.sjnx" value="5"}selected{/eq}>5年</option>
  399. <option value="6" {eq name="$field.sjnx" value="6"}selected{/eq}>6年</option>
  400. <option value="7" {eq name="$field.sjnx" value="7"}selected{/eq}>7年</option>
  401. <option value="8" {eq name="$field.sjnx" value="8"}selected{/eq}>8年</option>
  402. </select>
  403. 以上(包括)
  404. </dd>
  405. </dl>
  406. <dl class="row">
  407. <dt class="tit"> <label for="title"><em>*</em>工作要求:</label> </dt>
  408. <dd class="opt">
  409. {eyou:for start='0' end='9'}
  410. {$i+1}.&nbsp;<input type="text" name="gzyq[]" value="{$gzyq[$i]}" id="title" class="input-txt" autocomplete="off" style="margin-top: 5px;width: 800px !important;"><br/>
  411. {/eyou:for}
  412. </dd>
  413. </dl>
  414. <hr/>
  415. <b>其他:</b>
  416. <?php
  417. /*
  418. *
  419. * <!--暂时找不到控制显示隐藏的地方-->
  420. <dl class="row 1615775137_dl" style="display: block;" id="1615775137_1" style="z-index: 2">
  421. <dt class="tit"> <label>主题背景</label> </dt>
  422. <dd class="opt">
  423. <div class="tab-pane" id="tab_imgupload">
  424. <table class="table table-bordered">
  425. <tbody>
  426. <tr>
  427. <td>
  428. <div class="sort-list">
  429. {volist name="ad_data" id="vo" key="k"}
  430. {eq name="$vo.media_type" value="1"}
  431. <div class="images_upload">
  432. <div class="ic">
  433. <div class='upimg' title="拖动修改排序" onmouseover="upimgMouseover(this);" onmouseout="upimgMouseout(this);">
  434. <div class='icaction' style="display: none" >
  435. <span class="load_images" onclick="Images('{$vo['litpic']}', 900, 600);">
  436. <a href="javascript:void(0);" style="color:white">
  437. <i class='fa fa-search-plus'></i>大图
  438. </a>
  439. </span>
  440. <span class="load_images" onclick="LoadImagesId('{$vo['id']}');">
  441. <i class='fa fa-photo'></i>更换
  442. </span>
  443. <span class="load_images" onclick="ShowInput('{$vo['id']}');">
  444. <i class='fa fa-file-text-o'></i>信息
  445. </span>
  446. </div>
  447. <div class='cover-bg' style="display: none" ></div>
  448. <img id="{$vo['id']}_Id" src="{$vo['litpic']}"/>
  449. {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
  450. <a class="delect" href="javascript:void(0);" onclick="ClearPicArr(this,'{$vo['litpic']}','{$vo['id']}');" title="删除">
  451. </a>
  452. {/if}
  453. </div>
  454. <div class="load_input" id="{$vo['id']}_ShowInput" data-showOrHide="hide">
  455. <input type="hidden" name="img_id[]" value="{$vo['id']}"/>
  456. <span class="span_input">
  457. <input type="hidden" id="{$vo['id']}_Litpic" name="img_litpic[]" value="{$vo['litpic']}"/>
  458. </span>
  459. <textarea name="img_title[]" placeholder="请输入标题..." style="height: 28px;">{$vo.title}</textarea>
  460. <textarea name="img_links[]" placeholder="请输入链接网址..." style="height: 28px;">{$vo.links}</textarea>
  461. <textarea name="img_intro[]" placeholder="广告注释:支持HTML代码" style="height: 64px;">{$vo.intro}</textarea>
  462. <div class="operation">
  463. <a href="javascript:void(0);">
  464. <label>
  465. <input type="checkbox" {eq name="$vo['target']" value="1"} checked="checked" {/eq} title="在新窗口打开" onclick="CheckedTarget(this)"/>新窗口
  466. <input type="hidden" name="img_target[]" value="{$vo['target']}">
  467. </label>
  468. </a>
  469. <a href="javascript:void(0);" onclick="copyToClipBoard({$vo['id']});">
  470. <i class="fa fa-file-code-o"></i>标签调用
  471. </a>
  472. <a onclick="HideInput('{$vo['id']}');" style="width: 32%;" href="javascript:void(0);" title="收回"><i style="font-size:16px;" class="fa fa-angle-double-up"></i></a>
  473. </div>
  474. </div>
  475. </div>
  476. </div>
  477. {/eq}
  478. {/volist}
  479. <div class="images_upload"></div>
  480. </div>
  481. {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
  482. <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="img-upload b-img-upload mb15" title="点击上传">
  483. <div class="y-line"></div>
  484. <div class="x-line"></div>
  485. </a>
  486. {/if}
  487. <input type="hidden" id="ImagesId">
  488. </td>
  489. </tr>
  490. </tbody>
  491. </table>
  492. </div>
  493. <!-- 上传图片显示的样板 start -->
  494. <div class="images_upload_tpl none">
  495. <div class="images_upload ic">
  496. <div class="ic">
  497. <div class='upimg' title="拖动修改排序" onmouseover="upimgMouseover(this);" onmouseout="upimgMouseout(this);">
  498. <div class='icaction' style="display: none">
  499. <span class="load_images" onclick="">
  500. <a href="javascript:void(0);" style="color: white">
  501. <i class='fa fa-search-plus'></i>大图
  502. </a>
  503. </span>
  504. <span class="load_images" onclick="">
  505. <i class='fa fa-file-text-o'></i>信息
  506. </span>
  507. </div>
  508. <div class='cover-bg' style="display: none"></div>
  509. <img src="__STATIC__/admin/images/add-button.jpg"/>
  510. <a class="delect" href="javascript:void(0);" title="删除"></a>
  511. </div>
  512. <div class="load_input" data-showOrHide="hide">
  513. <input type="hidden"/>
  514. <span class="span_input"> <input type="hidden"/> </span>
  515. <textarea placeholder="请输入标题..." style="height: 28px;"></textarea>
  516. <textarea placeholder="请输入链接网址..." style="height: 28px;"></textarea>
  517. <textarea placeholder="广告注释:支持HTML代码" style="height: 64px;"></textarea>
  518. <div class="operation">
  519. <a href="javascript:void(0);">&nbsp;&nbsp;</a>
  520. <a href="javascript:void(0);">&nbsp;&nbsp;</a>
  521. <a style="width: 32%;" href="javascript:void(0);">&nbsp;&nbsp;</a>
  522. </div>
  523. </div>
  524. </div>
  525. </div>
  526. </div>
  527. <!-- 上传图片显示的样板 end -->
  528. </dd>
  529. </dl>
  530. */
  531. ?>
  532. <dl class="row 1615775137_dl" style="display: none;" id="1615775137_2" style="z-index: 2">
  533. <dt class="tit"> <label for="type">广告内容</label> </dt>
  534. <dd class="opt">
  535. <input type="hidden" name="video_id" {eq name="$ad_data.0.media_type" value="2"} value="{$ad_data.0.id}" {/eq} class="input-txt">
  536. <input type="text" name="video_litpic" id="video_litpic" {eq name="$ad_data.0.media_type" value="2"} value="{$ad_data.0.litpic}" {/eq} class="input-txt">
  537. <input type="file" id="courseware_file" data-type='local' onchange="upload_video_litpic_1615775137(this)" style="display: none;">
  538. {eq name="$WeappOpen.qny_open" value="1"}
  539. &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_qiniu" onclick="$('#courseware_file').attr('data-type', 'qiniu').trigger('click');">七牛云上传</a>
  540. {/eq}
  541. {eq name="$WeappOpen.oss_open" value="1"}
  542. &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_oss" onclick="$('#courseware_file').attr('data-type', 'oss').trigger('click');">oss上传</a>
  543. {/eq}
  544. {eq name="$WeappOpen.cos_open" value="1"}
  545. &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_cos" onclick="$('#courseware_file').attr('data-type', 'cos').trigger('click');">cos上传</a>
  546. {/eq}
  547. &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green " id="upload_video_litpic_local" onclick="$('#courseware_file').attr('data-type', 'local').trigger('click');">本地上传</a>
  548. <input type="hidden" id="OpenPreviewVideoUrl" value="{:url('ZcwdPosition/open_preview_video')}">
  549. &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="PreviewVideo" onclick="OpenPreviewVideo();">预览</a>
  550. </dd>
  551. </dl>
  552. <dl class="row 1615775137_dl" style="display: none;" id="1615775137_3" style="z-index: 2">
  553. <dt class="tit"> <label for="type">广告内容</label> </dt>
  554. <dd class="opt">
  555. <input type="hidden" name="html_id" {eq name="$ad_data.0.media_type" value="3"} value="{$ad_data.0.id}" {/eq} class="input-txt">
  556. <textarea rows="5" cols="60" id="html_intro" name="html_intro" style="height: 200px;">{eq name="$ad_data.0.media_type" value="3"}{$ad_data.0.intro}{/eq}</textarea>
  557. <span class="err"></span>
  558. <p class="notic"></p>
  559. </dd>
  560. </dl>
  561. <dl class="row">
  562. <dt class="tit">
  563. <label>其他条件</label>
  564. </dt>
  565. <dd class="opt">
  566. <textarea rows="5" cols="60" id="intro" name="qttj" style="height:60px;">{$field.qttj}</textarea>
  567. <span class="err"></span>
  568. <p class="notic"></p>
  569. </dd>
  570. </dl>
  571. <dl class="row">
  572. <dt class="tit">
  573. <label>输出结果</label>
  574. </dt>
  575. <dd class="opt">
  576. 匹配算法: 前端根据选择的申报专业和所选资料,按所设定的规则(多条)进行对比,结果可能符合多个区域(符合省市),生成多个报告;
  577. <span class="err"></span>
  578. <p class="notic"></p>
  579. </dd>
  580. </dl>
  581. </div>
  582. <div class="bot">
  583. <input type="hidden" name="id" id="1615775137_id" value="{$field.id}">
  584. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  585. </div>
  586. </div>
  587. </form>
  588. </div>
  589. <script type="text/javascript">
  590. var SelectedType = '{$field.type}';
  591. $(function() {
  592. // 新增时,广告类型默认选中图片类型
  593. // $('#type'+SelectedType).prop('checked', 'checked');
  594. // 新增时,默认显示图片上传
  595. $('#1615775137_'+SelectedType).show();
  596. // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
  597. VideoLitpicValue('#video_litpic');
  598. });
  599. // 切换广告类型
  600. function TypeSwitch(typeValue) {
  601. // 隐藏全部类型内容
  602. $('.1615775137_dl').hide();
  603. // 显示指定类型内容
  604. $('#1615775137_'+typeValue).show();
  605. // 切换类型后设置为当前切换的类型
  606. SelectedType = typeValue;
  607. // var ad_type = '{$field.type}';
  608. // if (typeValue != ad_type) {
  609. // // 切换至不同类型则显示
  610. // $('.notic2').show();
  611. // } else {
  612. // // 切换至相同类型则隐藏
  613. // $('.notic2').hide();
  614. // }
  615. }
  616. // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
  617. function VideoLitpicValue(obj) {
  618. // 获取广告内容(多媒体为播放链接)
  619. // var video_litpic = $(obj).val();
  620. // 判断隐藏显示预览按钮if (2 == SelectedType && video_litpic)
  621. if (2 == SelectedType) {
  622. $('#PreviewVideo').show();
  623. } else {
  624. $('#PreviewVideo').hide();
  625. }
  626. }
  627. // 打开预览视频
  628. function OpenPreviewVideo() {
  629. // 获取视频链接
  630. var video_litpic = $('#video_litpic').val();
  631. if (video_litpic == '') {
  632. $('#video_litpic').focus();
  633. showErrorMsg('请先上传视频');
  634. return false;
  635. }
  636. /* 视频链接后缀验证处理 */
  637. var fileExt = video_litpic.substr(video_litpic.lastIndexOf('.')).toLowerCase();
  638. var fileExt = judgeExt(fileExt);
  639. if (fileExt == -1) {
  640. $('#video_litpic').focus();
  641. showErrorMsg('不支持的视频格式,可在附件设置中修改');
  642. return false;
  643. }
  644. /* END */
  645. /* 视频链接是否存在斜杠处理 */
  646. var fileInfo = video_litpic.lastIndexOf('/');
  647. if (fileInfo == -1) {
  648. $('#video_litpic').focus();
  649. showErrorMsg('视频链接不完整,无法正常预览');
  650. return false;
  651. }
  652. /* END */
  653. // 打开视频播放
  654. $.ajax({
  655. type : 'post',
  656. url : $('#OpenPreviewVideoUrl').val(),
  657. data : {video_litpic: video_litpic},
  658. dataType : 'json',
  659. success : function(res) {
  660. if (1 == res.code) {
  661. var PreviewVideo = "<video style='width:100%; height:100%;' src='"+res.url+"' controls preload='auto' oncontextmenu='return fase' autoplay></video>";
  662. layer.open({
  663. type: 1,
  664. title: false,
  665. fixed: true, //不固定
  666. shadeClose: false,
  667. shade: layer_shade,
  668. area: ['80%', '80%'],
  669. content: PreviewVideo
  670. });
  671. } else {
  672. showErrorMsg(res.msg);
  673. }
  674. },
  675. error: function(e) {
  676. showErrorAlert(e.responseText);
  677. }
  678. });
  679. }
  680. // 上传媒体文件
  681. function upload_video_litpic_1615775137(e) {
  682. var data_type = $(e).attr('data-type');
  683. if ('qiniu' == data_type) {
  684. // 七牛云上传
  685. upload_video_litpic_qiniu(e);
  686. } else if ('oss' == data_type) {
  687. // OSS上传
  688. upload_video_litpic_oss(e);
  689. } else if ('cos' == data_type) {
  690. // COS上传
  691. upload_video_litpic_cos(e);
  692. } else {
  693. // 本地上传
  694. upload_video_litpic_local(e);
  695. }
  696. }
  697. // 七牛云上传
  698. function upload_video_litpic_qiniu(e) {
  699. // 获取文件路径名
  700. var file = $(e)[0].files[0];
  701. // 验证上传格式
  702. var fileName = file.name;
  703. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  704. var ext = judgeExt(fileExt);
  705. if (ext == -1) {
  706. showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
  707. return false;
  708. }
  709. // 验证上传大小
  710. var size = "{$upload_max_filesize}";
  711. if (file.size > size) {
  712. showErrorMsg('视频大小超过限制,可在附件设置中修改');
  713. return false;
  714. }
  715. // 执行上传
  716. layer_loading('上传七牛云');
  717. $.ajax({
  718. type: 'POST',
  719. url: '__ROOT_DIR__/index.php?m=plugins&c=Qiniuyun&a=qiniu_upload',
  720. data: {_ajax: 1},
  721. dataType: "JSON",
  722. success: function(res1) {
  723. if (1 == res1.code) {
  724. var token = res1.data.token;
  725. var formData = new FormData();
  726. formData.append('file', file);
  727. formData.append('token', token);
  728. fileName = res1.data.filePath + fileExt;
  729. formData.append('key', fileName);
  730. $.ajax({
  731. url: res1.data.uphost,
  732. type: 'POST',
  733. dataType: 'JSON',
  734. data: formData,
  735. timeout: 1200000,
  736. cache: false,
  737. processData: false,
  738. contentType: false,
  739. xhr: function () {
  740. myXhr = $.ajaxSettings.xhr();
  741. if (myXhr.upload) {
  742. myXhr.upload.addEventListener('progress', function(e){
  743. var curr = e.loaded;
  744. var total = e.total;
  745. process = parseInt(curr / total * 100);
  746. $("#upload_video_litpic_qiniu").text('上传中...'+process+"%");
  747. });
  748. }
  749. return myXhr;
  750. },
  751. success: function(res2) {
  752. layer.closeAll();
  753. $("#upload_video_litpic_qiniu").text('上传成功');
  754. setTimeout(function() {
  755. $('#upload_video_litpic_qiniu').text('七牛云上传');
  756. }, 2000);
  757. var video_url = res1.data.domain + "/" + res2.key;
  758. $("#video_litpic").empty().val(video_url);
  759. },
  760. error: function(e) {
  761. layer.closeAll();
  762. showErrorMsg(e.responseText);
  763. return false;
  764. }
  765. });
  766. } else {
  767. layer.closeAll();
  768. showErrorMsg(res1.msg);
  769. }
  770. },
  771. error: function(e) {
  772. layer.closeAll();
  773. showErrorMsg(e.responseText);
  774. }
  775. });
  776. }
  777. // 阿里云OSS上传
  778. function upload_video_litpic_oss(e) {
  779. // 获取文件路径名
  780. var file = $(e)[0].files[0];
  781. // 验证上传格式
  782. var fileName = file.name;
  783. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  784. var ext = judgeExt(fileExt);
  785. if (ext == -1) {
  786. showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
  787. return false;
  788. }
  789. // 验证上传大小
  790. var size = "{$upload_max_filesize}";
  791. if (file.size > size) {
  792. showErrorMsg('视频大小超过限制,可在附件设置中修改');
  793. return false;
  794. }
  795. // 执行上传
  796. layer_loading('上传阿里云OSS');
  797. $.ajax({
  798. type: 'POST',
  799. url: '__ROOT_DIR__/index.php?m=plugins&c=AliyunOss&a=oss_upload',
  800. data: {_ajax: 1},
  801. dataType: "JSON",
  802. success: function(res1){
  803. if (1 == res1.code){
  804. fileName = res1.data.filePath + fileExt;
  805. //组装发送数据
  806. var request = new FormData();
  807. request.append("OSSAccessKeyId",res1.data.accessid);
  808. request.append("policy",res1.data.policy);
  809. request.append("Signature",res1.data.signature);
  810. request.append("key",fileName);
  811. request.append("success_action_status",201);
  812. request.append('file', file);
  813. $.ajax({
  814. url : res1.data.host,
  815. data : request,
  816. processData: false,
  817. cache: false,
  818. contentType: false,
  819. dataType: 'xml',
  820. type : 'post',
  821. xhr: function () {
  822. myXhr = $.ajaxSettings.xhr();
  823. if (myXhr.upload) {
  824. myXhr.upload.addEventListener('progress', function(e){
  825. var curr = e.loaded;
  826. var total = e.total;
  827. var process = parseInt(curr / total * 100);
  828. $("#upload_video_litpic_oss").text('上传中...'+process+"%");
  829. });
  830. }
  831. return myXhr;
  832. },
  833. success : function(data) {
  834. layer.closeAll();
  835. var res = $(data).find('PostResponse');
  836. if (res) {
  837. var key = res.find('Key').text();
  838. $("#upload_video_litpic_oss").text('上传成功');
  839. setTimeout(function() {
  840. $('#upload_video_litpic_oss').text('oss上传');
  841. }, 2000);
  842. var video_url = res1.data.domain + "/" + key;
  843. $("#video_litpic").val(video_url);
  844. } else {
  845. $("#upload_video_litpic_oss").text('上传失败');
  846. setTimeout(function() {
  847. $('#upload_video_litpic_oss').text('oss上传');
  848. }, 2000);
  849. }
  850. },
  851. error : function(e) {
  852. layer.closeAll();
  853. console.log(e.responseText);
  854. }
  855. });
  856. } else {
  857. layer.closeAll();
  858. showErrorMsg(res1.msg);
  859. }
  860. },
  861. error: function(e) {
  862. layer.closeAll();
  863. showErrorMsg(e.responseText);
  864. }
  865. });
  866. }
  867. // 腾讯云COS上传
  868. function upload_video_litpic_cos(e) {
  869. // 获取文件路径名
  870. var file = $(e)[0].files[0];
  871. // 验证上传格式
  872. var fileName = file.name;
  873. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  874. var ext = judgeExt(fileExt);
  875. if (ext == -1) {
  876. showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
  877. return false;
  878. }
  879. // 验证上传大小
  880. var size = "{$upload_max_filesize}";
  881. if (file.size > size) {
  882. showErrorMsg('视频大小超过限制,可在附件设置中修改');
  883. return false;
  884. }
  885. // 上传参数
  886. var formData = new FormData();
  887. formData.append('file', file);
  888. formData.append('file_ext', fileExt);
  889. // 执行上传
  890. $.ajax({
  891. type: 'post',
  892. url: '__ROOT_DIR__/index.php?m=plugins&c=Cos&a=cos_upload&_ajax=1',
  893. data: formData,
  894. contentType: false,
  895. processData: false,
  896. dataType: 'json',
  897. xhr: function () {
  898. myXhr = $.ajaxSettings.xhr();
  899. if (myXhr.upload) {
  900. myXhr.upload.addEventListener('progress', function(e){
  901. var curr = e.loaded;
  902. var total = e.total;
  903. process = parseInt(curr / total * 100);
  904. if (100 == process) {
  905. process = 99;
  906. layer_loading('上传腾讯云COS');
  907. }
  908. $("#upload_video_litpic_cos").text('上传中...'+process+"%");
  909. });
  910. }
  911. return myXhr;
  912. },
  913. success: function(res) {
  914. layer.closeAll();
  915. if (1 == res.code) {
  916. $("#video_litpic").val(res.data.url);
  917. $("#upload_video_litpic_cos").text('上传成功');
  918. } else {
  919. $("#upload_video_litpic_cos").text('上传失败');
  920. }
  921. setTimeout(function() {
  922. $('#upload_video_litpic_cos').text('cos上传');
  923. }, 2000);
  924. },
  925. error: function(e) {
  926. layer.closeAll();
  927. showErrorMsg(e.responseText);
  928. }
  929. });
  930. }
  931. // 本地上传
  932. function upload_video_litpic_local(e) {
  933. // 获取文件路径名
  934. var file = $(e)[0].files[0];
  935. // 验证上传格式
  936. var fileName = file.name;
  937. var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
  938. var ext = judgeExt(fileExt);
  939. if (ext == -1) {
  940. showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
  941. return false;
  942. }
  943. // 验证上传大小
  944. var size = "{$upload_max_filesize}";
  945. if (file.size > size) {
  946. showErrorMsg('视频大小超过限制,可在附件设置中修改');
  947. return false;
  948. }
  949. // 定义上传数据
  950. var formData = new FormData();
  951. formData.append('file', file);
  952. // 执行上传
  953. layer_loading('上传本地');
  954. $.ajax({
  955. type: 'post',
  956. url : "{:url('Ueditor/upVideo', ['savepath'=>'media'])}",
  957. data: formData,
  958. contentType: false,
  959. processData: false,
  960. dataType: 'json',
  961. xhr: function () {
  962. myXhr = $.ajaxSettings.xhr();
  963. if (myXhr.upload) {
  964. myXhr.upload.addEventListener('progress', function(e){
  965. var curr = e.loaded;
  966. var total = e.total;
  967. process = parseInt(curr / total * 100);
  968. $("#upload_video_litpic_local").html('上传中...'+process+"%");
  969. });
  970. }
  971. return myXhr;
  972. },
  973. success: function (res) {
  974. layer.closeAll();
  975. $("#upload_video_litpic_local").html('上传成功');
  976. setTimeout(function() {
  977. $('#upload_video_litpic_local').html('本地上传');
  978. }, 2000);
  979. if ("SUCCESS" == res.state) {
  980. $("#video_litpic").val(res.url);
  981. } else {
  982. showErrorMsg(res.msg);
  983. }
  984. }
  985. });
  986. }
  987. // 验证格式
  988. function judgeExt(ext) {
  989. var type = "{$media_type}";
  990. var extArr = [];
  991. extArr = type.split("|");
  992. var ext = ext.replace(".","");
  993. return extArr.indexOf(ext);
  994. }
  995. </script>
  996. <script type="text/javascript">
  997. // 勾选新窗口打开链接
  998. function CheckedTarget(t){
  999. if ($(t).is(':checked')) {
  1000. $(t).parent().find('input[name="img_target[]"]').val(1);
  1001. }else{
  1002. $(t).parent().find('input[name="img_target[]"]').val(0);
  1003. }
  1004. }
  1005. // 鼠标事件,加载查看大图和更新图片
  1006. function upimgMouseover(obj)
  1007. {
  1008. $(obj).find('div.icaction').show();
  1009. $(obj).find('div.cover-bg').show();
  1010. }
  1011. function upimgMouseout(obj)
  1012. {
  1013. $(obj).find('div.icaction').hide();
  1014. $(obj).find('div.cover-bg').hide();
  1015. }
  1016. // 检测广告名称是否存在重复
  1017. function DetectionTitleRepeat(obj) {
  1018. // 当前广告ID
  1019. var id = $('#1615775137_id').val();
  1020. // 传入的广告名称
  1021. var title = $(obj).val();
  1022. // 执行检测
  1023. $.ajax({
  1024. type: 'post',
  1025. url : "{:url('ZcwdPosition/detection_title_repeat', ['_ajax'=>1])}",
  1026. data: {id: id, title: title},
  1027. dataType: 'json',
  1028. success: function(res) {
  1029. if (0 == res.code) {
  1030. $('#title_tips').show().html(res.msg);
  1031. } else {
  1032. $('#title_tips').hide().html('');
  1033. }
  1034. },
  1035. error: function(e){
  1036. layer.closeAll();
  1037. showErrorAlert(e.responseText);
  1038. }
  1039. });
  1040. }
  1041. // 判断输入框是否为空
  1042. function checkForm(){
  1043. /* if($('input[name=title]').val() == ''){
  1044. layer.msg('广告位名称不能为空!', {icon: 2,time: 1000});
  1045. return false;
  1046. }*/
  1047. if($("#selectTest").val() == ''){
  1048. layer.msg('请选择申报专业!', {icon: 2,time: 1000});
  1049. return false;
  1050. }
  1051. if($("#selectTest222").val() == '' || $("#selectTest222").val() == 0){
  1052. layer.msg('请选择申报等级!', {icon: 2,time: 1000});
  1053. return false;
  1054. }
  1055. //'zyid': $("#selectTest").val(),
  1056. //'sf': $('#selectTest000_1').val(),
  1057. //'cs': $('#selectTest000_2').val(),
  1058. //'sbdj': $('#selectTest000_2').val(),
  1059. layer_loading('正在处理');
  1060. $.ajax({
  1061. type : 'post',
  1062. url : "{:url('ZcwdPosition/edit', ['_ajax'=>1])}",
  1063. data : $('#post_form').serialize(),
  1064. dataType : 'json',
  1065. success : function(res){
  1066. layer.closeAll();
  1067. if (res.code == 1) {
  1068. layer.msg(res.msg, {icon: 1, shade: layer_shade, time: 1000}, function(){
  1069. window.location.reload();
  1070. });
  1071. } else {
  1072. showErrorMsg(res.msg);
  1073. }
  1074. },
  1075. error: function(e){
  1076. layer.closeAll();
  1077. showErrorAlert(e.responseText);
  1078. }
  1079. });
  1080. }
  1081. // 获取点击更新图片的ID并加载隐藏域
  1082. function LoadImagesId(id){
  1083. // 加载ID到隐藏域
  1084. $('#ImagesId').val(id);
  1085. // 调用图片上传JS
  1086. GetUploadify(1,'','allimg','UpdataImages');
  1087. }
  1088. // 更新图片
  1089. function UpdataImages(path){
  1090. // 获取点击的ID
  1091. var id = $('#ImagesId').val();
  1092. // 加载图片到显示层
  1093. $("#"+id+"_Id").attr('src', path);
  1094. // 加载图片到提交的隐藏域
  1095. $("#"+id+"_Litpic").val(path);
  1096. }
  1097. // 显示信息输入框
  1098. function ShowInput(id) {
  1099. var obj = $("#"+id+"_ShowInput");
  1100. var showOrHide = obj.attr('data-showOrHide');
  1101. if ('hide' == showOrHide) {
  1102. obj.show().attr('data-showOrHide', 'show');
  1103. } else {
  1104. obj.hide().attr('data-showOrHide', 'hide');
  1105. }
  1106. }
  1107. // 隐藏信息输入
  1108. function HideInput(id) {
  1109. $("#"+id+"_ShowInput").hide().attr('data-showOrHide', 'hide');
  1110. }
  1111. // 上传图集相册回调函数
  1112. function imgupload_call_back(paths){
  1113. var last_div = $(".images_upload_tpl").html();
  1114. var inputs = $('.span_input input');
  1115. var timestamp = 0;
  1116. // 图片数据处理
  1117. for (var i=0; i<paths.length; i++) {
  1118. // 生成新的时间戳
  1119. timestamp = (new Date()).getTime();
  1120. // 插入一个 新图片
  1121. $(".images_upload:eq(0)").before(last_div);
  1122. // 处理他的链接地址
  1123. $(".images_upload:eq(0)").find('span:eq(0)').attr('onclick', "Images('"+paths[i]+"', 900, 600);");
  1124. // 处理信息显示隐藏按钮
  1125. $(".images_upload:eq(0)").find('span:eq(1)').attr('onclick', "ShowInput('"+timestamp+"');");
  1126. // 处理他的图片路径
  1127. $(".images_upload:eq(0)").find('img').attr('src', paths[i]);
  1128. // 处理删除按钮
  1129. $(".images_upload:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr(this, '"+paths[i]+"', 0);");
  1130. // 处理图片信息框ID
  1131. $(".images_upload:eq(0)").find('.load_input:eq(0)').attr('id', timestamp+'_ShowInput');
  1132. // 处理图片路径及隐藏域
  1133. if (inputs.length > 0) {
  1134. // 修改隐藏域
  1135. $(".images_upload:eq(0)").find('input:eq(0)').attr('name', 'img_id[]').attr('value', '');
  1136. $(".span_input:eq(0)").find('input:eq(0)').attr('name', 'img_litpic[]').attr('value', paths[i]);
  1137. // 处理标题
  1138. $(".images_upload:eq(0)").find('textarea:eq(0)').attr('name', 'img_title[]');
  1139. // 处理跳转链接
  1140. $(".images_upload:eq(0)").find('textarea:eq(1)').attr('name', 'img_links[]');
  1141. // 处理内容描述
  1142. $(".images_upload:eq(0)").find('textarea:eq(2)').attr('name', 'img_intro[]');
  1143. // 处理新窗口选项
  1144. $(".images_upload:eq(0)").find('div.operation a:eq(0)').html("<label><input type='checkbox' title='在新窗口打开' onclick='CheckedTarget(this);'/>新窗口<input type='hidden' name='img_target[]' value='0'></label>");
  1145. // 处理收回按钮
  1146. $(".images_upload:eq(0)").find('div.operation a:eq(2)').attr('onclick', "HideInput('"+timestamp+"');").attr('title', "收回").html('<i style="font-size:16px;" class="fa fa-angle-double-up"></i>');
  1147. }
  1148. }
  1149. }
  1150. // 上传之后删除组图input
  1151. function ClearPicArr(obj, path, id) {
  1152. // 删除数据库记录
  1153. $.ajax({
  1154. type:'POST',
  1155. url:"{:url('ZcwdPosition/del_imgupload')}",
  1156. data:{del_id:id,_ajax:1},
  1157. success:function(){
  1158. $(obj).parent().parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
  1159. $.ajax({
  1160. type:'POST',
  1161. url:"{:url('Uploadimgnew/delupload')}",
  1162. data:{action:"del", filename:path,_ajax:1},
  1163. success:function(){}
  1164. });
  1165. }
  1166. });
  1167. }
  1168. // 代码调用js
  1169. function copyToClipBoard(id) {
  1170. var adstr = "{eyou:ad aid='" + id + "'}\r\n <a href='{$"+"field.links}' {$"+"field.target}><img src='{$"+"field.litpic}' alt='{$"+"field.title}' /></a>\r\n 广告注释:{$"+"field.intro}\r\n{/eyou:ad";
  1171. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 ad 调用:</dd>';
  1172. contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:100px;">' + adstr + '}</textarea>';
  1173. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将对应标签代码复制并粘贴到对应模板文件中!</dd></dl></div>';
  1174. layer.open({
  1175. title: '代码调用',
  1176. type: 1,
  1177. shade: layer_shade,
  1178. skin: 'layui-layer-demo',
  1179. area: ['480px', '260px'], //宽高
  1180. content: contentdiv
  1181. });
  1182. }
  1183. // 图集相册的拖动排序相关 js
  1184. $( ".sort-list" ).sortable({
  1185. start: function( event, ui) {
  1186. }
  1187. ,stop: function( event, ui ) {
  1188. }
  1189. });
  1190. //因为他们要拖动,所以尽量设置他们的文字不能选择。
  1191. // $( ".sort-list" ).disableSelection();
  1192. </script>
  1193. {include file="public/footer" /}