79 lines
1.8 KiB
HTML
79 lines
1.8 KiB
HTML
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>用户中心</title>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||
<meta name="keywords" content="fly,layui,前端社区">
|
||
<meta name="description" content="TaoLer社区是模块化前端UI框架Layui的开发产品,致力于为web开发提供强劲动力">
|
||
<link rel="stylesheet" href="/static/res/layui/css/layui.css">
|
||
<link rel="stylesheet" href="/static/res/css/global.css">
|
||
</head>
|
||
<body>
|
||
{include file="public/header" /}
|
||
<div class="layui-container fly-marginTop fly-user-main">
|
||
{include file="public/nav" /}
|
||
<div class="fly-panel fly-panel-user" pad20>
|
||
{__CONTENT__}
|
||
</div>
|
||
</div>
|
||
{include file="public/footer" /}
|
||
{include file="public/js" /}
|
||
|
||
<script Content-Type: text/html>
|
||
layui.use('upload', function(){
|
||
var $ = layui.jquery
|
||
var upload = layui.upload;
|
||
|
||
var uploadInst = upload.render({
|
||
elem: '#test1'
|
||
,url: '{:url('index/user/upload1')}'
|
||
,field: 'file'
|
||
,accept: 'images'
|
||
,acceptMime: 'image/*'
|
||
,exts: 'jpg|png|gif|bmp|jpeg'
|
||
,auto:true
|
||
,before: function(obj) {
|
||
|
||
obj.preview(function(index, file, result){
|
||
$('#demo1').attr('src', result); //图片链接(base64)
|
||
});
|
||
layer.msg("图片上传中...",{
|
||
time: 3000,
|
||
});
|
||
}
|
||
,done: function(res){
|
||
//如果上传失败
|
||
if(res.code > 0){
|
||
return layer.msg(res['msg']);
|
||
}
|
||
//上传成功
|
||
return layer.msg(res['msg']);
|
||
}
|
||
,error: function(){
|
||
//演示失败状态,并实现重传
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
|
||
<script>
|
||
layui.cache.page = 'user';
|
||
layui.cache.user = {
|
||
username: '游客'
|
||
,uid: -1
|
||
,avatar: '/static/res/images/avatar/00.jpg'
|
||
,experience: 83
|
||
,sex: '男'
|
||
};
|
||
layui.config({
|
||
version: "3.0.0"
|
||
,base: '/static/res/mods/'
|
||
}).extend({
|
||
fly: 'index'
|
||
}).use('fly');
|
||
</script>
|
||
|
||
</body>
|
||
</html> |