123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- {eyou:volist name="$users_para" id="vo"}
- {eyou:switch name="vo.dtype"}
- {eyou:case value="hidden"}
- <!-- 隐藏域 start -->
- <div class="item-from-row" style="display: none;">
- <dt class="tit">{$vo.title}:</dt>
- <dd class="opt">
- <input type="hidden" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
- </dd>
- </div>
- <!-- 隐藏域 end -->
- {/eyou:case}
-
- {eyou:case value="mobile"}
- <!-- 手机文本框 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- {$vo.dfvalue|default=''}
- {eyou:eq name='$users.is_mobile' value='1'}
- <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code('更改手机');">( 更改手机 )</a></span>
- {eyou:else/}
- <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code('绑定手机');">( 绑定手机 )</a></span>
- {/eyou:eq}
- <script type="text/javascript">
- function get_{$vo.fieldArr}{$vo.name|default=''}_mobile_code(title) {
- var url = '{$RootDir}/index.php?m=user&c=Users&a=bind_mobile';
- if (url.indexOf('?') > -1) {
- url += '&';
- } else {
- url += '?';
- }
- url += 'title=' + title;
- //iframe窗
- layer.open({
- type: 2,
- title: title,
- shadeClose: false,
- maxmin: false, //开启最大化最小化按钮
- area: ['400px', '330px'],
- content: url
- });
- }
- </script>
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <!-- 手机文本框 end -->
- {/eyou:case}
-
- {eyou:case value="email"}
- <!-- 邮箱文本框 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- {$vo.dfvalue|default=''}
- {eyou:eq name='$users.is_email' value='1'}
- <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_email_code('更改邮箱');">( 更改邮箱 )</a></span>
- {eyou:else/}
- <span class="err"><a href="JavaScript:void(0);" onclick="get_{$vo.fieldArr}{$vo.name|default=''}_email_code('绑定邮箱');">( 绑定邮箱 )</a></span>
- {/eyou:eq}
- <p class="notic">{$vo.remark|default=''}</p>
- </div>
- </div>
- <script type="text/javascript">
- function get_{$vo.fieldArr}{$vo.name|default=''}_email_code(title)
- {
- var url = "{eyou:url link='user/Users/bind_email'/}";
- if (url.indexOf('?') > -1) {
- url += '&';
- } else {
- url += '?';
- }
- url += 'title='+title;
- //iframe窗
- layer.open({
- type: 2,
- title: title,
- shadeClose: false,
- maxmin: false, //开启最大化最小化按钮
- area: ['400px', '270px'],
- content: url
- });
- }
- </script>
- <!-- 邮箱文本框 end -->
- {/eyou:case}
-
- {eyou:case value="text"}
- <!-- 单行文本框 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- <input type="text" class="el-input__inner w310" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" autocomplete="off">{$vo.dfvalue_unit|default=''}
- </div>
- </div>
- <!-- 单行文本框 end -->
- {/eyou:case}
-
- {eyou:case value="multitext"}
- <!-- 多行文本框 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- <textarea id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" class="w310" autocomplete="off">{$vo.dfvalue|default=''}</textarea>
- </div>
- </div>
- <!-- 多行文本框 end -->
- {/eyou:case}
-
- {eyou:case value="checkbox"}
- <!-- 复选框 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- {eyou:volist name="$vo.dfvalue" id="v2"}
- <label class="checkbox-label">
- <span>{$v2}</span>
- <input type="checkbox" class="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} checked="checked" {/if}>
- <span class="check-mark"></span>
- </label>
- {/eyou:volist}
- <!-- {eyou:if condition="1 == $vo.is_required"}(必选){/eyou:if} -->
- </div>
- </div>
- <!-- 复选框 end -->
- {/eyou:case}
-
- {eyou:case value="radio"}
- <!-- 单选项 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- {eyou:volist name="$vo.dfvalue" id="v2"}
- <label class="radio-label">
- <span>{$v2}</span>
- <input type="radio" class="radio" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} checked="checked" {/eyou:if}>
- <span class="check-mark"></span>
- </label>
- {/eyou:volist}
- <!-- {eyou:if condition="1 == $vo.is_required"}(必选){/eyou:if} -->
- </div>
- </div>
- <!-- 单选项 end -->
- {/eyou:case}
-
- {eyou:case value="select"}
- <!-- 下拉框 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- <div class="w310 select">
- <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
- <option value="">请选择</option>
- {eyou:volist name="$vo.dfvalue" id="v2"}
- <option value="{$v2}" {eyou:if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"} selected {/eyou:if}>{$v2}</option>
- {/eyou:volist}
- </select>
- </div>
- </div>
- </div>
- <!-- 下拉框 end -->
- {/eyou:case}
-
- {eyou:case value="img"}
- <!-- 单张图 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- <a href="javascript:void(0);" onclick="$('#singlePicFile_{$vo.fieldArr}_{$vo.name|default=''}').trigger('click');" class="img-upload">
- <div class="y-line" id="singlePicYline_{$vo.para_id|default=0}" {notempty name='$vo.info'} style="display: none;" {/notempty}></div>
- <div class="x-line" id="singlePicXline_{$vo.para_id|default=0}" {notempty name='$vo.info'} style="display: none;" {/notempty}></div>
- <img src="{$vo.info|default=''}" id="singlePicImgSrc_{$vo.para_id|default=0}" >
- </a>
- </div>
- <input type="file" id="singlePicFile_{$vo.fieldArr}_{$vo.name|default=''}" data-id="{$vo.para_id|default=0}" onchange="uploadSinglePicFile(this);" style="display: none;">
- <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="singlePicHidden_{$vo.para_id|default=0}" value="{$vo.info|default=''}">
- </div>
- <!-- 单张图 end -->
- {/eyou:case}
-
- {case value="imgs"}
- <script type="text/javascript" src="__STATIC__/admin/js/jquery-ui/jquery-ui.min.js"></script>
- <!-- 多张图 start -->
- <div class="item-from-row" id="dl_{$vo.fieldArr}_{$vo.name|default=''}">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- <div class="images_upload_main" id="tab_{$vo.fieldArr}_{$vo.name|default=''}">
- <div class="sort-list-{$vo.fieldArr}_{$vo.name|default=''}">
- {volist name="$vo[$vo['name'].'_eyou_imgupload_list']" id="v2" key="k2"}
- <div class="fieldext_upload fieldext_upload_html" >
- <div class="images_upload_item">
- <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2|default=''}">
- <a href="{$v2|default=''}" onclick="" class="pic">
- <img src="{$v2|default=''}">
- </a>
- <a class="delete" title="删除" href="javascript:void(0)" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'{$v2|default=''}')"></a>
- </div>
- </div>
- {/volist}
- <div class="fieldext_upload" style="display:none;"></div>
- </div>
- <a href="javascript:void(0);" onClick="GetUploadify(100,'','allimg','{$vo.fieldArr}_{$vo.name|default=''}_call_back', '', '{$vo.title}');" class="img-upload" title="上传图片">
- <div class="y-line"></div>
- <div class="x-line"></div>
- </a>
- </div>
- <!-- 上传图片显示的样板 start -->
- <div class="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl" style="display: none;">
- <div class="fieldext_upload fieldext_upload_html">
- <div class="images_upload_item">
- <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="" />
- <a href="javascript:void(0);" onClick="" >
- <img src="__STATIC__/admin/images/add-button.jpg"/>
- </a>
- <a class="delete" href="javascript:void(0)" title="删除"> </a>
- </div>
- </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++) {
- if ($(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html").length > 0) {
- $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").after(last_div); // 插入一个 新图片
- } else {
- $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload:last").before(last_div); // 插入一个 新图片
- }
- $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
- $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('img').attr('src',paths[i]);// 修改他的图片路径
- $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('a:eq(1)').attr('onclick',"{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(this,'"+paths[i]+"')").text('');
- $(".sort-list-{$vo.fieldArr}_{$vo.name|default=''} .fieldext_upload_html:last").find('input').val(paths[i]); // 设置隐藏域 要提交的值
- }
- }
-
- // 上传之后删除组图input
- function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr2(obj,path) {
- $(obj).parent().remove();
- }
-
- /** 以下 产品相册的拖动排序相关 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="file"}
- {eyou:static file="/public/plugins/layui/css/layui.css" /}
- {eyou:static file="/public/plugins/layui/layui.js" /}
- <!-- 单个文件 start -->
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r" >
- <a id="download_file_{$vo.fieldArr}_{$vo.name|default=''}" style="margin-right: 30px;text-decoration: underline;{eyou:notempty name='$vo.info' /}display: '';{eyou:else /}display: none;{/eyou:notempty}"
- {eyou:notempty name='$vo.info' /} href="{$vo.info|default=''}" download="{$vo.info|get_filename=###}" {/eyou:notempty}>
- <img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height: 16px;">下载附件</a>
- <input type="text" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.info|default=''}" style="display: none;">
- <button type="button" class="el-button el-button--primary is-plain el-button--small" id="upload_{$vo.fieldArr}_{$vo.name|default=''}" style="height: 40px;">上传文件</button>
- </div>
- </div>
- <script type="text/javascript">
- $(function(){
- layui.use('upload', function(){
- // 执行实例
- var upload = layui.upload;
- var uploadInst = upload.render({
- elem: "#upload_{$vo.fieldArr}_{$vo.name|default=''}",
- url: "{:url('user/Uploadify/DownloadUploadFileAjax')}",
- accept: 'file',
- exts: '{$vo.ext}',
- size: {$vo.filesize},
- done: function(res) {
- if (res.state == "SUCCESS") {
- layer.msg('上传成功!')
- $("#{$vo.fieldArr}_{$vo.name|default=''}").val(res.url);
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('href',res.url);
- var arr = res.url.split("/");
- var download = arr[arr.length-1];
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").attr('download',download);
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','#000');
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").html('<img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height: 16px;">下载附件');
- } else {
- showErrorAlert(res.state);
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('display','');
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").css('color','red');
- $("#download_file_{$vo.fieldArr}_{$vo.name|default=''}").text(res.state);
- }
- }
- });
- });
- })
- </script>
- <!-- 单个文件 end -->
- {/case}
-
- {eyou:case value="datetime"}
- <!-- 日期和时间 start -->
- {eyou:static file="/public/plugins/laydate/laydate.js"/}
- <div class="item-from-row">
- <div class="from-row-l">
- {eyou:if condition="1 == $vo.is_required"}
- <span class="red">*</span>
- {eyou:else/}
- <span class="red"></span>
- {/eyou:if}
- {$vo.title}:
- </div>
- <div class="from-row-r">
- <input type="text" class="el-input__inner w310" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}" autocomplete="off">{$vo.dfvalue_unit|default=''}
- </div>
- </div>
- <script type="text/javascript">
- $(function () {
- $('#{$vo.fieldArr}_{$vo.name|default=''}').layDate();
- });
- </script>
- <!-- 日期和时间 end -->
- {/eyou:case}
- {/eyou:switch}
- {/eyou:volist}
-
- <script type="text/javascript">
- // 单图上传
- function uploadSinglePicFile(obj) {
- var file = $(obj)[0].files[0];
- if (!file) return false;
- var formData = new FormData();
- formData.append('_ajax', 1);
- formData.append('file', file);
- formData.append('compress', '1000-1000');
- layer_loading('正在处理');
- $.ajax({
- type: 'post',
- url : eyou_basefile + "?m=user&c=Uploadify&a=imageUp",
- data: formData,
- contentType: false,
- processData: false,
- dataType: 'json',
- success: function (res) {
- layer.closeAll();
- if (res.state == 'SUCCESS') {
- var id = $(obj).data('id');
- $("#singlePicHidden_" + id).val(res.url);
- $("#singlePicImgSrc_" + id).show().attr('src', res.url);
- $('#singlePicYline_'+id+', #singlePicXline_' + id).hide();
- } else {
- showErrorAlert(res.state);
- }
- },
- error: function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- })
- }
- </script>
|