TaoLer/app/admin/view/user/useredit.html

82 lines
3.1 KiB
HTML
Raw Normal View History

2020-01-01 13:17:19 +08:00
{extend name="public/base" /}
{block name="body"}
<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
<div class="layui-form-item layui-hide">
<input type="text" name="id" class="layui-input" value="{$user.id}">
</div>
<div class="layui-form-item">
<label class="layui-form-label">用户名</label>
<div class="layui-input-inline">
<input type="text" name="username" disabled lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input layui-disabled" value="{$user.name}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">手机号码</label>
<div class="layui-input-inline">
<input type="text" name="phone" lay-verify="phone" placeholder="请输入号码" autocomplete="off" class="layui-input" value="{$user.phone}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">邮箱</label>
<div class="layui-input-inline">
<input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input" value="{$user.email}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">头像</label>
<div class="layui-input-inline">
<input type="text" name="avatar" lay-verify="required" placeholder="请上传图片" autocomplete="off" class="layui-input" value="{$user.user_img}">
</div>
<button style="float: left;" type="button" class="layui-btn" dataid="{$user.id}" id="layuiadmin-upload-useradmin">上传图片</button>
</div>
<div class="layui-form-item" lay-filter="sex">
<label class="layui-form-label">选择性别</label>
<div class="layui-input-block">
2020-02-13 13:18:17 +08:00
<input type="radio" name="sex" value="0" title="男" {if condition="$user['sex'] eq 0"} checked {/if}>
<input type="radio" name="sex" value="1" title="女" {if condition="$user['sex'] eq 1"} checked {/if}>
2020-01-01 13:17:19 +08:00
</div>
</div>
<div class="layui-form-item layui-hide">
<input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
</div>
</div>
{/block}
{block name="js"}
<script>
layui.config({
base: '/static/admin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
2022-08-02 21:13:36 +08:00
}).use(['index', 'upload'], function(){
2020-01-01 13:17:19 +08:00
var $ = layui.$
,upload = layui.upload ;
2020-01-14 15:47:11 +08:00
//上传头像
2020-01-01 13:17:19 +08:00
upload.render({
elem: '#layuiadmin-upload-useradmin'
2023-03-16 22:33:28 +08:00
,url: "{:url('user/uploadImg')}"
,data: {type:'image'}
2020-01-01 13:17:19 +08:00
,accept: 'images'
,method: 'get'
,acceptMime: 'image/*'
,done: function(res){
$(this.item).prev("div").children("input").val(res.src);
2022-08-02 21:13:36 +08:00
if(res.code == 0){
layer.msg(res.msg,{
icon:6,
tiye:2000
});
} else {
layer.open({
title:"上传失败",
content:res.msg,
icon:5,
anim:6
});
}
2020-01-01 13:17:19 +08:00
}
});
})
</script>
{/block}