Нема описа
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.

addonitem.htm 38KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. {volist name="$addonFieldExtList" id="vo"}
  2. {if !isset($vo.ifeditable) || $vo.ifeditable}
  3. {switch name="vo.dtype"}
  4. {case value="hidden"}
  5. <!-- 隐藏域 start -->
  6. <dl class="row" style="display: none;">
  7. <dt class="tit">
  8. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  9. </dt>
  10. <dd class="opt">
  11. <input type="hidden" class="input-txt" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
  12. </dd>
  13. </dl>
  14. <!-- 隐藏域 start -->
  15. {/case}
  16. {case value="region"}
  17. <!-- 区域选项 start -->
  18. <dl class="row">
  19. <dt class="tit">
  20. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  21. </dt>
  22. <dd class="opt">
  23. {volist name="$vo.dfvalue" id="v2"}
  24. <label>
  25. <input type="radio" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$v2['id']}" {if condition="isset($vo['trueValue']) AND in_array($v2['id'], $vo['trueValue'])"}checked="checked"{/if}>{$v2['name']}
  26. </label>&nbsp;
  27. {/volist}
  28. <span class="err"></span>
  29. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  30. </dd>
  31. </dl>
  32. <!-- 区域选项 end -->
  33. {/case}
  34. {case value="text"}
  35. <!-- 单行文本框 start -->
  36. <dl class="row">
  37. <dt class="tit">
  38. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  39. </dt>
  40. <dd class="opt">
  41. <input type="text" class="input-txt" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">&nbsp;{$vo.dfvalue_unit|default=''}
  42. <span class="err"></span>
  43. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  44. </dd>
  45. </dl>
  46. <!-- 单行文本框 end -->
  47. {/case}
  48. {case value="multitext"}
  49. <!-- 多行文本框 start -->
  50. <dl class="row">
  51. <dt class="tit">
  52. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  53. </dt>
  54. <dd class="opt">
  55. <textarea rows="5" cols="60" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" style="height:60px;">{$vo.dfvalue|default=''}</textarea>
  56. <span class="err"></span>
  57. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  58. </dd>
  59. </dl>
  60. <!-- 多行文本框 end -->
  61. {/case}
  62. {case value="checkbox"}
  63. <!-- 复选框 start -->
  64. <dl class="row">
  65. <dt class="tit">
  66. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  67. </dt>
  68. <dd class="opt">
  69. {volist name="$vo.dfvalue" id="v2"}
  70. <label><input type="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if} onclick="func_{$vo.name}_eyempty();">{$v2}</label>&nbsp;
  71. {/volist}
  72. <input type="hidden" name="{$vo.fieldArr}[{$vo.name}_eyempty]" value="{if condition="!empty($vo['trueValue'])"}1{else /}0{/if}">
  73. <span class="err"></span>
  74. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  75. </dd>
  76. </dl>
  77. <script type="text/javascript">
  78. function func_{$vo.name}_eyempty()
  79. {
  80. var len = $("input[name='{$vo.fieldArr}[{$vo.name}][]']:checked").length;
  81. $("input[name='{$vo.fieldArr}[{$vo.name}_eyempty]']").val(len);
  82. }
  83. </script>
  84. <!-- 复选框 end -->
  85. {/case}
  86. {case value="radio"}
  87. <!-- 单选项 start -->
  88. <dl class="row">
  89. <dt class="tit">
  90. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  91. </dt>
  92. <dd class="opt">
  93. {volist name="$vo.dfvalue" id="v2"}
  94. <label><input type="radio" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if}>{$v2}</label>&nbsp;
  95. {/volist}
  96. <span class="err"></span>
  97. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  98. </dd>
  99. </dl>
  100. <!-- 单选项 end -->
  101. {/case}
  102. {case value="switch"}
  103. <!-- 开关 start -->
  104. <dl class="row">
  105. <dt class="tit">
  106. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  107. </dt>
  108. <dd class="opt">
  109. <div class="onoff">
  110. <label for="{$vo.fieldArr}_{$vo.name|default=''}1" class="cb-enable {if condition="0 != $vo['dfvalue']"}selected{/if}">是</label>
  111. <label for="{$vo.fieldArr}_{$vo.name|default=''}0" class="cb-disable {if condition="0 == $vo['dfvalue']"}selected{/if}">否</label>
  112. <input id="{$vo.fieldArr}_{$vo.name|default=''}1" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="1" type="radio" {if condition="0 != $vo['dfvalue']"}checked="checked"{/if}>
  113. <input id="{$vo.fieldArr}_{$vo.name|default=''}0" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="0" type="radio" {if condition="0 == $vo['dfvalue']"}checked="checked"{/if}>
  114. </div>
  115. <span class="err"></span>
  116. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  117. </dd>
  118. </dl>
  119. <script type="text/javascript">
  120. $(function(){
  121. //自定义radio样式
  122. $(".cb-enable").on('click', function(){
  123. var parent = $(this).parents('.onoff');
  124. $('.cb-disable',parent).removeClass('selected');
  125. $(this).addClass('selected');
  126. $('.checkbox',parent).attr('checked', true);
  127. });
  128. $(".cb-disable").on('click', function(){
  129. var parent = $(this).parents('.onoff');
  130. $('.cb-enable',parent).removeClass('selected');
  131. $(this).addClass('selected');
  132. $('.checkbox',parent).attr('checked', false);
  133. });
  134. });
  135. </script>
  136. <!-- 开关 end -->
  137. {/case}
  138. {case value="select"}
  139. <!-- 下拉框 start -->
  140. <dl class="row">
  141. <dt class="tit">
  142. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  143. </dt>
  144. <dd class="opt">
  145. <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
  146. {volist name="$vo.dfvalue" id="v2"}
  147. <option value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}selected{/if}>{$v2}</option>
  148. {/volist}
  149. </select>
  150. <span class="err"></span>
  151. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  152. </dd>
  153. </dl>
  154. <!-- 下拉框 end -->
  155. {/case}
  156. {case value="img"}
  157. <!-- 单张图 start -->
  158. <dl class="row">
  159. <dt class="tit">
  160. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  161. </dt>
  162. <dd class="opt">
  163. <div class="input-file-show div_{$vo.fieldArr}_{$vo.name|default=''}_eyou_local" {neq name="$vo[$vo['name'].'_eyou_is_remote']" value="0"}style="display: none;"{/neq}>
  164. <span class="show">
  165. <a id="img_a_{$vo.fieldArr}_{$vo.name|default=''}" target="_blank" class="nyroModal" rel="gal" href="{$vo[$vo['name'].'_eyou_local']|default='javascript:void(0);'}">
  166. <i id="img_i_{$vo.fieldArr}_{$vo.name|default=''}" class="fa fa-picture-o" {notempty name="$vo[$vo['name'].'_eyou_local']"}onmouseover="layer_tips=layer.tips('<img src={$vo[$vo['name'].'_eyou_local']} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  167. </a>
  168. </span>
  169. <span class="type-file-box">
  170. <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}_eyou_local" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_local]" value="{$vo[$vo['name'].'_eyou_local']|default=''}" class="type-file-text" autocomplete="off">
  171. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  172. <input class="type-file-file" onClick="GetUploadify(1,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back')" size="30" hidefocus="true" nc_type="change_site_{$vo.fieldArr}_{$vo.name|default=''}"
  173. title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  174. </span>
  175. </div>
  176. <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}_eyou_remote" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_remote]" value="{$vo[$vo['name'].'_eyou_remote']|default=''}" placeholder="http://" class="input-txt" {neq name="$vo[$vo['name'].'_eyou_is_remote']" value="1"}style="display: none;"{/neq}>
  177. &nbsp;
  178. <label><input type="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_is_remote]" id="{$vo.fieldArr}_{$vo.name|default=''}_eyou_is_remote" value="1" {eq name="$vo[$vo['name'].'_eyou_is_remote']" value="1"}checked="checked"{/eq} onClick="clickRemote(this, '{$vo.fieldArr}_{$vo.name|default=''}_eyou');">远程图片</label>
  179. <span class="err"></span>
  180. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  181. </dd>
  182. </dl>
  183. <script type="text/javascript">
  184. function {$vo.fieldArr}_{$vo.name|default=''}_call_back(fileurl_tmp)
  185. {
  186. $("#{$vo.fieldArr}_{$vo.name|default=''}_eyou_local").val(fileurl_tmp);
  187. $("#img_a_{$vo.fieldArr}_{$vo.name|default=''}").attr('href', fileurl_tmp);
  188. $("#img_i_{$vo.fieldArr}_{$vo.name|default=''}").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  189. }
  190. </script>
  191. <!-- 单张图 end -->
  192. {/case}
  193. {case value="file"}
  194. <!-- 单个文件 start -->
  195. <dl class="row">
  196. <dt class="tit">
  197. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  198. </dt>
  199. <dd class="opt">
  200. <div class="input-file-show div_{$vo.fieldArr}_{$vo.name|default=''}_eyou_local" {neq name="$vo[$vo['name'].'_eyou_is_remote']" value="0"}style="display: none;"{/neq}>
  201. <span class="type-file-box">
  202. <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}_eyou_local" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_local]" value="{$vo[$vo['name'].'_eyou_local']|default=''}" class="type-file-text" autocomplete="off">
  203. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  204. <input class="type-file-file" type="file" onchange="upload_file_1585641738(this)" size="30" hidefocus="true" nc_type="change_site_{$vo.fieldArr}_{$vo.name|default=''}">
  205. </span>
  206. </div>
  207. <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}_eyou_remote" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_remote]" value="{$vo[$vo['name'].'_eyou_remote']|default=''}" placeholder="http://" class="input-txt" {neq name="$vo[$vo['name'].'_eyou_is_remote']" value="1"}style="display: none;"{/neq}>
  208. &nbsp;
  209. <label><input type="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_is_remote]" id="{$vo.fieldArr}_{$vo.name|default=''}_eyou_is_remote" value="1" {eq name="$vo[$vo['name'].'_eyou_is_remote']" value="1"}checked="checked"{/eq} onClick="clickRemote(this, '{$vo.fieldArr}_{$vo.name|default=''}_eyou');">远程文件</label>
  210. <span class="err"></span>
  211. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  212. </dd>
  213. </dl>
  214. <script type="text/javascript">
  215. function upload_file_1585641738(e){
  216. var file = $(e)[0].files[0]
  217. var formData = new FormData();
  218. formData.append('file',file);
  219. $.ajax({
  220. type: 'post',
  221. url: "{:url('Ueditor/DownloadUploadFileAjax')}",
  222. data: formData,
  223. contentType: false,
  224. processData: false,
  225. dataType: 'json',
  226. success: function (res) {
  227. if (res.code==0){
  228. layer.msg(res.msg)
  229. }else {
  230. $("#{$vo.fieldArr}_{$vo.name|default=''}_eyou_local").val(res.file_url);
  231. }
  232. }
  233. })
  234. }
  235. </script>
  236. <!-- 单个文件 end -->
  237. {/case}
  238. {case value="imgs"}
  239. <!-- 多张图 start -->
  240. <dl class="row" id="dl_{$vo.fieldArr}_{$vo.name|default=''}">
  241. <dt class="tit">
  242. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  243. </dt>
  244. <dd class="opt">
  245. <div class="tab-pane pics" id="tab_{$vo.fieldArr}_{$vo.name|default=''}">
  246. <!-- <a href="javascript:void(0);" onClick="GetUploadify(100,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back');" class="imgupload">
  247. <i class="fa fa-photo"></i>上传图片
  248. </a> -->
  249. <table class="table table-bordered">
  250. <tbody>
  251. <tr>
  252. <td >
  253. <div class="sort-list-{$vo.fieldArr}_{$vo.name|default=''}">
  254. {volist name="$vo[$vo['name'].'_eyou_imgupload_list']" id="v2" key="k2"}
  255. <div class="images_upload images_upload_html" style="display:inline-block;">
  256. <div class="images_upload_box">
  257. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2['image_url']}">
  258. <a href="{$v2['image_url']}" onclick="" class="upimg" target="_blank" title="拖动修改排序">
  259. <img data-original="{$v2['image_url']}">
  260. </a>
  261. <a href="javascript:void(0)" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'{$v2['image_url']}')" class="delect" title="删除"></a>
  262. </div>
  263. <textarea rows="5" cols="60" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_intro][]" placeholder="图片注释">{$v2.intro}</textarea>
  264. </div>
  265. {/volist}
  266. <div class="images_upload"></div>
  267. </div>
  268. <a href="javascript:void(0);" onClick="GetUploadify(100,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back');" class="img-upload mb15" title="点击上传">
  269. <div class="y-line"></div>
  270. <div class="x-line"></div>
  271. </a>
  272. </td>
  273. </tr>
  274. </tbody>
  275. </table>
  276. </div>
  277. <!-- 上传图片显示的样板 start -->
  278. <div class="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl none">
  279. <div class="images_upload images_upload_html" style="display:inline-block;">
  280. <div class="images_upload_box">
  281. <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="" />
  282. <a href="javascript:void(0);" onClick="" class="upimg" title="拖动修改排序">
  283. <img src="__STATIC__/admin/images/add-button.jpg" />
  284. </a>
  285. <a href="javascript:void(0)" class="delect" title="删除">&nbsp;&nbsp;</a>
  286. </div>
  287. <textarea rows="5" cols="60" name="{$vo.fieldArr}[{$vo.name|default=''}_eyou_intro][]" placeholder="图片注释"></textarea>
  288. </div>
  289. </div>
  290. <!-- 上传图片显示的样板 end -->
  291. </dd>
  292. </dl>
  293. <script type="text/javascript">
  294. // 上传多图回调函数
  295. function {$vo.fieldArr}_{$vo.name|default=''}_call_back(paths){
  296. var last_div = $(".{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl").html();
  297. for (var i=0;i<paths.length ;i++ )
  298. {
  299. if ($(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .images_upload_html").length > 0) {
  300. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .images_upload_html:last").after(last_div); // 插入一个 新图片
  301. } else {
  302. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .images_upload:last").before(last_div); // 插入一个 新图片
  303. }
  304. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .images_upload_html:last").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
  305. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .images_upload_html:last").find('img').attr('src',paths[i]);// 修改他的图片路径
  306. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .images_upload_html:last").find('a:eq(1)').attr('onclick',"{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'"+paths[i]+"')").text('');
  307. $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .images_upload_html:last").find('input').val(paths[i]); // 设置隐藏域 要提交的值
  308. }
  309. }
  310. /*
  311. * 上传之后删除组图input
  312. * @access public
  313. * @val string 删除的图片input
  314. */
  315. function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(obj,path)
  316. {
  317. // 删除数据库记录
  318. $.ajax({
  319. type:'GET',
  320. url:"{:url('Field/del_arctypeimgs', ['_ajax'=>1])}",
  321. data:{filename:path,fieldid:"{$vo.id}",typeid:"{$aid|default='0'}"},
  322. success:function(){
  323. $(obj).parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
  324. $.ajax({
  325. type:'GET',
  326. url:"{:url('Uploadimgnew/delupload', ['_ajax'=>1])}",
  327. data:{action:"del", filename:path},
  328. success:function(){}
  329. });
  330. }
  331. });
  332. }
  333. /** 以下 产品相册的拖动排序相关 js*/
  334. $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).sortable({
  335. start: function( event, ui) {
  336. }
  337. ,stop: function( event, ui ) {
  338. }
  339. });
  340. //因为他们要拖动,所以尽量设置他们的文字不能选择。
  341. // $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).disableSelection();
  342. </script>
  343. <!-- 多张图 end -->
  344. {/case}
  345. {case value="int"}
  346. <!-- 整数类型 start -->
  347. <dl class="row">
  348. <dt class="tit">
  349. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  350. </dt>
  351. <dd class="opt">
  352. <input type="text" value="{$vo.dfvalue|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" placeholder="只允许纯数字" class="input-txt" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9]/g,''));">&nbsp;{$vo.dfvalue_unit|default=''}
  353. <span class="err"></span>
  354. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  355. </dd>
  356. </dl>
  357. <!-- 整数类型 end -->
  358. {/case}
  359. {case value="float"}
  360. <!-- 小数类型 start -->
  361. <dl class="row">
  362. <dt class="tit">
  363. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  364. </dt>
  365. <dd class="opt">
  366. <input type="text" value="{$vo.dfvalue|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" placeholder="允许带有小数点的数值" class="input-txt" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9\.]/g,''));">&nbsp;{$vo.dfvalue_unit|default=''}
  367. <span class="err"></span>
  368. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  369. </dd>
  370. </dl>
  371. <!-- 小数类型 end -->
  372. {/case}
  373. {case value="decimal"}
  374. <!-- 金额类型 start -->
  375. <dl class="row">
  376. <dt class="tit">
  377. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  378. </dt>
  379. <dd class="opt">
  380. <input type="text" value="{$vo.dfvalue|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" placeholder="允许带有小数点的金额" class="input-txt" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9\.]/g,''));">&nbsp;{$vo.dfvalue_unit|default=''}
  381. <span class="err"></span>
  382. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  383. </dd>
  384. </dl>
  385. <!-- 金额类型 end -->
  386. {/case}
  387. {case value="datetime"}
  388. <!-- 日期和时间 start -->
  389. <dl class="row">
  390. <dt class="tit">
  391. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  392. </dt>
  393. <dd class="opt">
  394. <input type="text" class="input-txt" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" value="{$vo['dfvalue']}" autocomplete="off">
  395. <span class="add-on input-group-addon">
  396. <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
  397. </span>
  398. <span class="err"></span>
  399. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  400. </dd>
  401. </dl>
  402. <script type="text/javascript">
  403. layui.use('laydate', function() {
  404. var laydate = layui.laydate;
  405. //常规用法
  406. laydate.render({
  407. elem: "#{$vo.fieldArr}_{$vo.name|default=''}"
  408. ,type: 'datetime'
  409. });
  410. })
  411. </script>
  412. <!-- 日期和时间 end -->
  413. {/case}
  414. {case value="htmltext"}
  415. <!-- HTML文本 start -->
  416. {eq name="$editor.editor_select" value="1"}
  417. <dl class="row">
  418. <dt class="tit">
  419. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  420. </dt>
  421. <dd class="opt">
  422. {if condition="isset($vo['first']) AND 1 == $vo['first']"}
  423. <label class="curpoin"><input type="checkbox" name="editor_remote_img_local" id="editor_remote_img_local" data-val="{$vo.editor.editor_remote_img_local}" value="1" {eq name="$vo.editor.editor_remote_img_local" value="1"} checked {/eq}>远程图片本地化</label>&nbsp;<!-- <a href="javascript:void(0);" onclick="editor_handle_210607(1);">[手动]</a>&nbsp; -->
  424. <label class="curpoin"><input type="checkbox" name="editor_img_clear_link" id="editor_img_clear_link" data-val="{$vo.editor.editor_img_clear_link}" value="1" {eq name="$vo.editor.editor_img_clear_link" value="1"} checked {/eq}>清除非本站链接</label>&nbsp;<!-- <a href="javascript:void(0);" onclick="editor_handle_210607(2);">[手动]</a>&nbsp; -->
  425. {/if}
  426. <textarea class="span12 ckeditor" id="{$vo.fieldArr}_{$vo.name|default=''}" data-func="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" title="">{$vo.dfvalue|default=''}</textarea>
  427. <span class="err"></span>
  428. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  429. </dd>
  430. </dl>
  431. {if condition="isset($vo['first']) AND 1 == $vo['first']"}
  432. <script type="text/javascript">
  433. // 打开多图选择及上传界面
  434. function OpenImagesList(e, obj) {
  435. var func = '';
  436. if (e.path && e.path[10] && e.path[10].id && undefined != e.path[10].id) {
  437. func = e.path[10].id;
  438. } else {
  439. func = $(obj).parent().parent().parent().parent().parent().parent().parent().parent().parent().attr('id');
  440. }
  441. if (func.indexOf('addonField_') == -1) {
  442. func = 'addonField_content';
  443. }
  444. var OpenUrl = "{:url('Uploadimgnew/upload', ['num'=>30, 'path'=>'allimg', 'is_water'=>1])}";
  445. OpenUrl += "&func=images_call_" + func;
  446. top.layer.open({
  447. type: 2,
  448. title: '图片上传',
  449. shade: layer_shade,
  450. maxmin: false,
  451. shadeClose: false,
  452. area: ['1000px', '625px'],
  453. content: OpenUrl
  454. });
  455. }
  456. </script>
  457. {/if}
  458. <script type="text/javascript">
  459. var ue_{$vo.fieldArr}_{$vo.name|default=''} = UE.getEditor('{$vo.fieldArr}_{$vo.name|default=''}',{
  460. serverUrl :"{:url('Ueditor/index',array('savepath'=>'allimg'))}",
  461. zIndex: 999,
  462. initialFrameWidth: "100%", //初化宽度
  463. initialFrameHeight: 450, //初化高度
  464. focus: false, //初始化时,是否让编辑器获得焦点true或false
  465. maximumWords: 99999,
  466. removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
  467. pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
  468. autoHeightEnabled: false,
  469. toolbars: ueditor_toolbars
  470. });
  471. //必须在提交前渲染编辑器;
  472. function {$vo.fieldArr}_{$vo.name|default=''}() {
  473. //判断编辑模式状态:0表示【源代码】HTML视图;1是【设计】视图,即可见即所得;-1表示不可用
  474. if(UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").queryCommandState('source') != 0) {
  475. UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").execCommand('source'); //切换到【设计】视图
  476. }
  477. }
  478. // 加载图片到编辑器指定位置
  479. function images_call_{$vo.fieldArr}_{$vo.name|default=''}(fileurl_tmp) {
  480. var addBody = '';
  481. $.each(fileurl_tmp, function(index, items) {
  482. addBody += '<p><img src="'+items+'"></p>';
  483. });
  484. UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").execCommand('inserthtml', addBody);
  485. }
  486. // 自动远程图片本地化/自动清除非本站链接
  487. function ajax_auto_editor_{$vo.fieldArr}_{$vo.name|default=''}(local,link) {
  488. var body = UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").getContent();
  489. $.ajax({
  490. type: 'POST',
  491. url: "{:url('Archives/ajax_auto_editor')}",
  492. data: {local:local,link:link,body:body,_ajax:1},
  493. dataType: "JSON",
  494. async:false,
  495. success: function(res){
  496. if (res.code == 1) {
  497. UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").setContent(res.data.body);
  498. }
  499. }
  500. });
  501. }
  502. </script>
  503. {else/}
  504. <dl class="row">
  505. <dt class="tit">
  506. <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
  507. </dt>
  508. <dd class="opt">
  509. {if condition="isset($vo['first']) AND 1 == $vo['first']"}
  510. <label class="curpoin"><input type="checkbox" name="editor_remote_img_local" id="editor_remote_img_local" data-val="{$vo.editor.editor_remote_img_local}" value="1" {eq name="$vo.editor.editor_remote_img_local" value="1"} checked {/eq} >远程图片本地化</label>&nbsp;<!-- <a href="javascript:void(0);" onclick="editor_handle_210607(1);">[手动]</a>&nbsp; -->
  511. <label class="curpoin"><input type="checkbox" name="editor_img_clear_link" id="editor_img_clear_link" data-val="{$vo.editor.editor_img_clear_link}" value="1" {eq name="$vo.editor.editor_img_clear_link" value="1"} checked {/eq} >清除非本站链接</label>&nbsp;<!-- <a href="javascript:void(0);" onclick="editor_handle_210607(2);">[手动]</a>&nbsp; -->
  512. {/if}
  513. <textarea id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]">{$vo.dfvalue|default=''}</textarea>
  514. <span class="err"></span>
  515. <!-- <p class="notic">{$vo.remark|default=''}</p> -->
  516. </dd>
  517. </dl>
  518. <script type="text/javascript">
  519. // 加载编辑器,若存在编辑器则先进行销毁
  520. try {
  521. var elemtid = "{$vo.fieldArr}_{$vo.name|default=''}";
  522. var editor = CKEDITOR.instances[elemtid];
  523. if (editor) editor.destroy(true);
  524. } catch(e) {}
  525. CKEDITOR.replace(elemtid, {
  526. filebrowserBrowseUrl: "{:url('Ueditor/index', ['savepath'=>'allimg', 'action'=>'uploadimage'])}",
  527. filebrowserImageBrowseUrl: "{:url('Ueditor/index', ['savepath'=>'allimg', 'action'=>'uploadimage'])}",
  528. filebrowserUploadUrl: "{:url('Ueditor/index', ['savepath'=>'allimg', 'action'=>'uploadimage'])}",
  529. filebrowserImageUploadUrl: "{:url('Ueditor/index', ['savepath'=>'allimg', 'action'=>'uploadimage'])}",
  530. });
  531. // 自动远程图片本地化/自动清除非本站链接
  532. function ajax_auto_editor_{$vo.fieldArr}_{$vo.name|default=''}(local,link) {
  533. var body = CKEDITOR.instances.{$vo.fieldArr}_{$vo.name|default=''}.getData();
  534. $.ajax({
  535. type: 'POST',
  536. url: "{:url('Archives/ajax_auto_editor')}",
  537. data: {local:local,link:link,body:body,_ajax:1},
  538. dataType: "JSON",
  539. async:false,
  540. success: function(res){
  541. if (res.code == 1) {
  542. CKEDITOR.instances.{$vo.fieldArr}_{$vo.name|default=''}.setData(res.data.body);
  543. }
  544. }
  545. });
  546. }
  547. </script>
  548. {/eq}
  549. <!-- HTML文本 end -->
  550. {/case}
  551. {/switch}
  552. {/if}
  553. {/volist}
  554. <script type="text/javascript">
  555. $(function(){
  556. try {
  557. $("img").lazyload({
  558. effect: "fadeIn",
  559. placeholder : "__PUBLIC__/static/common/images/loading.gif",
  560. threshold: 200
  561. });
  562. }catch(e){}
  563. auto_notic_tips();
  564. /**
  565. * 自动小提示
  566. */
  567. function auto_notic_tips()
  568. {
  569. var html = '<a class="ui_tips" href="javascript:void(0);" onmouseover="layer_tips = layer.tips($(this).parent().find(\'p.notic\').html(), this, {time:100000});" onmouseout="layer.close(layer_tips);">提示</a>';
  570. $.each($('dd.opt > p.notic'), function(index, item){
  571. var a_length = $(item).prev("a.ui_tips").length;
  572. if ($(item).html() != '' && 0 == a_length) {
  573. $(item).before(html);
  574. }
  575. });
  576. }
  577. // 第一个自定义字段显示感汉号提示
  578. var ganhaohtml = '<a class="ui_tips-ganhan" href="javascript:void(0);" onmouseover="layer_tips = layer.tips($(this).parent().find(\'p.notic-ganhan-ico\').html(), this, {time:100000});" onmouseout="layer.close(layer_tips);"></a><p class="notic-ganhan-ico none">属于自定义字段。在“更多功能>栏目字段”里管理</p>';
  579. $($('#FieldAddonextitem').find('dl > dd').find('p.notic').get(0)).parent().append(ganhaohtml);
  580. });
  581. </script>