123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- @extends('admin/layout')
- @section('content')
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <form method="get" class="form-horizontal" id="form">
- <div class="form-group">
- <div class="col-sm-2" style="text-align: right;height: 100%;padding-top: 20px">
- <label for="profile">头像:</label>
- </div>
- <div class="col-sm-8">
- <span>
- <img alt="image" class="img-circle"
- src="{{$data->profile_img}}"
- style="width: 64px;@if(empty($data->profile_img))display:none;@endif"
- id="profile_img">
- </span>
- <br>
- <br>
- <button type="button" class="btn btn-primary" onclick="units.translate()">随机一个头像
- </button>
- <button type="button" class="btn btn-primary" onclick="units.fileUpload(this)">
- 上传头像
- </button>
- <input type="file" style="display: none" onchange="units.uploadFile(this)">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="nickname">昵称:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="nickname" name="nickname"
- value="{{$data->nickname ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="username">用户名:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="username" name="username"
- value="{{$data->username ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="password">密码:</label>
- <div class="col-sm-8">
- <input type="password" class="form-control" id="password" name="password">
- <span class="help-block m-b-none">如果不需要修改密码请设为空</span>
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="entry_time">入职时间:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control deadline" id="entry_time" name="entry_time"
- autocomplete="off"
- value="{{str_limit($data->entry_time??'',10,'')}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="phone">手机号:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="phone" name="phone"
- value="{{$data->phone ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="phone">qq号:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="qq" name="qq"
- value="{{$data->qq ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="phone">座机:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="telephone" name="telephone"
- value="{{$data->telephone ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="email">邮箱:</label>
- <div class="col-sm-8">
- <input type="email" class="form-control" id="email" name="email"
- value="{{$data->email??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="intro">介绍:</label>
- <div class="col-sm-8">
- <textarea rows="3" class="form-control" id="intro" placeholder="这个人很懒,什么都没留下~"
- name="intro">{{$data->intro??''}}</textarea>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- <button class="btn btn-primary" type="button" onclick="units.save()">
- 保存
- </button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
- <script>
- //时间插件
- lay('.deadline').each(function () {
- laydate.render({
- elem: this
- , trigger: 'click'
- });
- });
- var units = {
- save: function () {
- var data = tips.getFormValues('#form');
- data.profile_img = $("#profile_img").attr('src');
- var config = {
- type: 'PUT',
- url: '/admin/index/profile?id=' + "{{$data->id??0}}",
- data: data
- };
- tips.ajax(config);
- },
- fileUpload: function (_this) {
- $(_this).next().trigger('click')
- },
- uploadFile: function (_this) {
- var config = {
- url: '/admin/tool/upload'
- };
- config.success = function (result) {
- layer.msg(result.message, {icon: 6, time: 1500});
- var img = $("#profile_img");
- img.attr('src', result.data.file_url);
- img.css('display', '');
- };
- tips.fileUpload(_this, config);
- },
- translate: function () {
- //x上限,y下限
- var x = 224;
- var y = 1;
- var rand = parseInt(Math.random() * (x - y + 1) + y);
- var img = $("#profile_img");
- img.attr('src', '{{asset('img/avatar')}}/战网头像%20(' + rand + ').png');
- }
- };
- </script>
- @endsection
|