123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
- {volist name="$addonFieldExtList" id="vo"}
- {if !isset($vo.ifeditable) || $vo.ifeditable}
- {switch name="vo.dtype"}
- {case value="hidden"}
- <!-- 隐藏域 start -->
- <dl class="row" style="display: none;">
- <dt class="tit">
- <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </dt>
- <dd class="opt">
- <input type="hidden" class="input-txt" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </dd>
- </dl>
- <!-- 隐藏域 start -->
- {/case}
-
- {case value="region"}
- <!-- 区域选项 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- {volist name="$vo.dfvalue" id="v2"}
- <label>
- <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']}
- </label>
- {/volist}
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 区域选项 end -->
- {/case}
-
- {case value="text"}
- <!-- 单行文本框 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <input type="text" class="input-txt" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}"> {$vo.dfvalue_unit|default=''}
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 单行文本框 end -->
- {/case}
-
- {case value="multitext"}
- <!-- 多行文本框 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <textarea rows="5" cols="60" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" style="height:60px;">{$vo.dfvalue|default=''}</textarea>
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 多行文本框 end -->
- {/case}
-
- {case value="checkbox"}
- <!-- 复选框 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- {volist name="$vo.dfvalue" id="v2"}
- <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}>{$v2}</label>
- {/volist}
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 复选框 end -->
- {/case}
-
- {case value="radio"}
- <!-- 单选项 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- {volist name="$vo.dfvalue" id="v2"}
- <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>
- {/volist}
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 单选项 end -->
- {/case}
-
- {case value="switch"}
- <!-- 开关 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <div class="onoff">
- <label for="{$vo.fieldArr}_{$vo.name|default=''}1" class="cb-enable {if condition="0 != $vo['dfvalue']"}selected{/if}">是</label>
- <label for="{$vo.fieldArr}_{$vo.name|default=''}0" class="cb-disable {if condition="0 == $vo['dfvalue']"}selected{/if}">否</label>
- <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}>
- <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}>
- </div>
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 开关 end -->
- {/case}
-
- {case value="select"}
- <!-- 下拉框 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
- {volist name="$vo.dfvalue" id="v2"}
- <option value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}selected{/if}>{$v2}</option>
- {/volist}
- </select>
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 下拉框 end -->
- {/case}
-
- {case value="img"}
- <!-- 单张图 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <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}>
- <span class="show">
- <a id="img_a_{$vo.fieldArr}_{$vo.name|default=''}" class="nyroModal" rel="gal" href="{$vo[$vo['name'].'_eyou_local']|default='javascript:void(0);'}">
- <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>
- </a>
- </span>
- <span class="type-file-box">
- <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">
- <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
- <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=''}"
- title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
- </span>
- </div>
- <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}>
-
- <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>
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <script type="text/javascript">
- function {$vo.fieldArr}_{$vo.name|default=''}_call_back(fileurl_tmp)
- {
- $("#{$vo.fieldArr}_{$vo.name|default=''}_eyou_local").val(fileurl_tmp);
- $("#img_a_{$vo.fieldArr}_{$vo.name|default=''}").attr('href', fileurl_tmp);
- $("#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']});");
- }
- </script>
- <!-- 单张图 end -->
- {/case}
-
- {case value="imgs"}
- <!-- 多张图 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <div class="tab-pane" id="tab_{$vo.fieldArr}_{$vo.name|default=''}">
- <table class="table table-bordered">
- <tbody>
- <tr>
- <td class="sort-list-{$vo.fieldArr}_{$vo.name|default=''}">
- {volist name="$vo[$vo['name'].'_eyou_imgupload_list']" id="v2" key="k2"}
- <div class="fieldext_upload" style="display:inline-block;">
- <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}">
- <a href="{$v2}" onclick="" class="upimg" >
- <img src="{$v2}" width="100" height="100">
- </a>
- <br>
- <a href="javascript:void(0)" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'{$v2}')">删除</a>
- </div>
- {/volist}
- <div class="fieldext_upload" style="display:inline-block;">
- <a href="javascript:void(0);" onClick="GetUploadify(100,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back');" class="upimg">
- <i class="fa fa-upload"></i>
- 上传
- </a>
- <br/>
- <a href="javascript:void(0)"> </a>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- 上传图片显示的样板 start -->
- <div class="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl none">
- <div class="fieldext_upload" style="display:inline-block;">
- <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="" />
- <a href="javascript:void(0);" onClick="" class="upimg">
- <img src="__STATIC__/admin/images/add-button.jpg" width="100" height="100" />
- </a>
- <br/>
- <a href="javascript:void(0)"> </a>
- </div>
- </div>
- <!-- 上传图片显示的样板 end -->
- </div>
- </div>
- <script type="text/javascript">
- // 上传多图回调函数
- function {$vo.fieldArr}_{$vo.name|default=''}_call_back(paths){
-
- var last_div = $(".{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl").html();
- for (var i=0;i<paths.length ;i++ )
- {
- $("#dl_{$vo.fieldArr}_{$vo.name|default=''}").find(".fieldext_upload:eq(0)").before(last_div); // 插入一个 新图片
- $("#dl_{$vo.fieldArr}_{$vo.name|default=''}").find(".fieldext_upload:eq(0)").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
- $("#dl_{$vo.fieldArr}_{$vo.name|default=''}").find(".fieldext_upload:eq(0)").find('img').attr('src',paths[i]);// 修改他的图片路径
- $("#dl_{$vo.fieldArr}_{$vo.name|default=''}").find(".fieldext_upload:eq(0)").find('a:eq(1)').attr('onclick',"{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'"+paths[i]+"')").text('删除');
- $("#dl_{$vo.fieldArr}_{$vo.name|default=''}").find(".fieldext_upload:eq(0)").find('input').val(paths[i]); // 设置隐藏域 要提交的值
- }
- }
- /*
- * 上传之后删除组图input
- * @access public
- * @val string 删除的图片input
- */
- function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(obj,path)
- {
- // 删除数据库记录
- $.ajax({
- type:'GET',
- url:"{:url('Field/del_channelimgs')}",
- data:{filename:path,channel:"{$channeltype|default='0'}",fieldname:"{$vo.name}",aid:"{$aid|default='0'}"},
- success:function(){
- $(obj).parent().remove(); // 删除完服务器的, 再删除 html上的图片
- $.ajax({
- type:'GET',
- url:"{:url('Uploadify/delupload')}",
- data:{action:"del", filename:path},
- success:function(){}
- });
- }
- });
- }
-
- /** 以下 产品相册的拖动排序相关 js*/
-
- $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).sortable({
- start: function( event, ui) {
-
- }
- ,stop: function( event, ui ) {
-
- }
- });
- $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).disableSelection();
- </script>
- <!-- 多张图 end -->
- {/case}
-
- {case value="int"}
- <!-- 整数类型 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <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,''));"> {$vo.dfvalue_unit|default=''}
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 整数类型 end -->
- {/case}
-
- {case value="float"}
- <!-- 小数类型 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <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,''));"> {$vo.dfvalue_unit|default=''}
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 小数类型 end -->
- {/case}
-
- {case value="decimal"}
- <!-- 金额类型 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <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,''));"> {$vo.dfvalue_unit|default=''}
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 金额类型 end -->
- {/case}
-
- {case value="datetime"}
- <!-- 日期和时间 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <input type="text" class="input-txt" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" value="{$vo['dfvalue']}">
- <span class="add-on input-group-addon">
- <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
- </span>
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#{$vo.fieldArr}_{$vo.name|default=''}').layDate();
- });
- </script>
- <!-- 日期和时间 end -->
- {/case}
-
- {case value="htmltext"}
- <!-- HTML文本 start -->
- <div class="row">
- <div class="col-xs-2">
- <label for="title">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </div>
- <div class="col-xs-9">
- <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>
- <span class="err"></span>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <script type="text/javascript">
- UE.getEditor('{$vo.fieldArr}_{$vo.name|default=''}',{
- serverUrl :"{:url('Uploadify/index',array('savepath'=>'allimg'))}",
- zIndex: 999,
- initialFrameWidth: "100%", //初化宽度
- initialFrameHeight: 450, //初化高度
- focus: false, //初始化时,是否让编辑器获得焦点true或false
- maximumWords: 999999,
- removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
- pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
- autoHeightEnabled: false,
- toolbars: [["forecolor", "backcolor", "removeformat", "|", "simpleupload", "insertimage"]],
- });
-
- //必须在提交前渲染编辑器;
- function {$vo.fieldArr}_{$vo.name|default=''}() {
- //判断编辑模式状态:0表示【源代码】HTML视图;1是【设计】视图,即可见即所得;-1表示不可用
- if(UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").queryCommandState('source') != 0) {
- UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").execCommand('source'); //切换到【设计】视图
- }
- }
- </script>
- <!-- HTML文本 end -->
- {/case}
-
- {case value="files"}
- <!-- 多文件 start -->
- <!-- <dl class="row">
- <dt class="tit">
- <label>{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<em>*</em>{/if}{$vo.title|default=''}</label>
- </dt>
- <dd class="opt">
- <div id="uploader" class="wu-example">
- 用来存放文件信息
- <div id="thelist" class="uploader-list"></div>
- <div class="btns left">
- <div id="picker">选择文件</div>
- <input type="button" id="ctlBtn" class="btn btn-default" value="开始上传" />
- </div>
- </div>
- <span class="err"></span>
- <p class="notic">只允许上传文件的类型:{$global.file_type|default=''}</p>
- </dd>
- </dl>
- <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/webuploader/webuploader.css">
- <script type="text/javascript" src="__PUBLIC__/plugins/webuploader/webuploader.min.js"></script>
- <script type="text/javascript">
- var uploader_swf = '__PUBLIC__/plugins/webuploader/Uploader.swf';
- var server_url="{:url('Ueditor/downFileUp',array('savepath'=>'soft'))}";
- </script>
- <script src="__SKIN__/js/getting-started.js"></script> -->
- <!-- 多文件 end -->
- {/case}
- {/switch}
- {/if}
- {/volist}
|