作者 sgj

注册页

... ... @@ -9,8 +9,10 @@
namespace app\admin\controller;
use app\admin\model\HospitalModel;
use cmf\controller\AdminBaseController;
use think\db;
use think\Request;
/**
* Class HosptialController
... ... @@ -27,11 +29,19 @@ use think\db;
*/
class HospitalController extends AdminBaseController
{
protected $HospitalModel;
public function __construct(HospitalModel $HospitalModel)
{
parent::__construct();
$this->HospitalModel = $HospitalModel;
}
/**
*医院管理
*平台列表
* @adminMenu(
* 'name' => '医院设置',
* 'name' => '平台列表',
* 'parent' => 'default',
* 'display'=> true,
* 'hasView'=> true,
... ... @@ -42,10 +52,35 @@ class HospitalController extends AdminBaseController
* )
*/
public function index(){
$platment=$this->HospitalModel->getPlatment()->toArray();
dump($platment);
$this->assign('platment',$platment);
return $this->fetch();
}
/**
*平台列表
* @adminMenu(
* 'name' => '医院列表',
* 'parent' => 'default',
* 'display'=> false,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '',
* 'param' => ''
* )
*/
public function hospital(){
$platment_id=input('id');
if (empty($platment_id)){
return $this->error();
}
$hospital=$this->HospitalModel->getHospital($platment_id)->toArray();
$this->assign('hospital',$hospital);
return $this->fetch();
}
... ...
<?php
/**
* Created by PhpStorm.
* auther: sgj
* Date: 2018/11/25
* Time: 17:04
*/
namespace app\admin\model;
use think\Model;
class HospitalModel extends Model
{
/**
* 返回平台信息
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getPlatment(){
$map['parent_id']='0';
$map['delete_time']='0';
$platment=db('portal_category')->where($map)->select();
return $platment;
}
public function getHospital(){
$map['platment_id']='0';
$map['deleteTime']='0';
$hospital=db('hospital')->where($map)->select();
return $hospital;
}
}
\ No newline at end of file
... ...
... ... @@ -31,5 +31,10 @@ class IndexController extends WeChatBaseController
return $this->fetch();
}
public function platform(){
$this->success('');
}
}
... ...
<include file="public@header"/>
</head>
<body>
<div class="wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('AdminTag/index')}">标签管理</a></li>
<li><a href="{:url('AdminTag/add')}">添加标签</a></li>
</ul>
<form method="post" class="js-ajax-form margin-top-20">
<div class="table-actions">
<!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
</div>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="50">ID</th>
<th>标签名称</th>
<th>状态</th>
<th width="160">操作</th>
</tr>
</thead>
<tbody>
<foreach name="platment" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.name}</td>
<td><a href="{:url('hospital',['id'=>$vo.id])}">查看医院</a></td>
</tr>
</foreach>
</tbody>
<tfoot>
<tr>
<th width="50">ID</th>
<th>标签名称</th>
<th>状态</th>
<th width="160">操作</th>
</tr>
</tfoot>
</table>
<div class="table-actions">
<!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
</div>
</form>
<ul class="pagination">{$page|default=''}</ul>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -119,5 +119,155 @@
background-size: cover;
}
</style>
<script type="application/javascript">
$(document).ready(function () {
$('.mask_box').hide()
$('.form_popup_box').hide()
$(function () {
//获取短信验证码
var validCode = true;
$(".getCode").click(function () {
var time = 60;
var $code = $(this);
if (validCode) {
validCode = false;
var t = setInterval(function () {
time--;
$code.html(time + "秒");
if (time == 0) {
clearInterval(t);
$code.html("重新获取");
validCode = true;
}
}, 1000)
}
})
})
$('.platform_item').click(function () {
weui.picker([
{label: '平台1', value: 0},
{label: '平台2', value: 1},
{label: '平台3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#platform').val(res[0].label)
}
}
)
})
$('.hospital_item').click(function () {
weui.picker([
{label: '医院1', value: 0},
{label: '医院2', value: 1},
{label: '医院3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#hospital').val(res[0].label)
}
}
)
})
$('.department_item').click(function () {
weui.picker([
{label: '科室1', value: 0},
{label: '科室2', value: 1},
{label: '科室3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#department').val(res[0].label)
}
}
)
})
$('.position_item').click(function () {
weui.picker([
{label: '职务1', value: 0},
{label: '职务2', value: 1},
{label: '职务3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#position').val(res[0].label)
}
}
)
})
$('.register_btn').click(function () {
var user_name = $('#user_name').val()
var phone_num = $('#phone_num').val()
var verify_code = $('#verify_code').val()
var platform = $('#platform').val()
var hospital = $('#hospital').val()
var department = $('#department').val()
var position = $('#position').val()
var province = $('#province').val()
var city = $('#city').val()
var town = $('#town').val()
if (user_name == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('用户名不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (phone_num == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('手机号不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (verify_code == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('密码不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (platform == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('平台不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (hospital == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('医院不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (department == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('科室不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (position == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('职务不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (province == '请选择') {
$('.form_popup_box').show()
$('.form_popup_box').text('省份不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (city == '请选择') {
$('.form_popup_box').show()
$('.form_popup_box').text('城市不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (town == '请选择') {
$('.form_popup_box').show()
$('.form_popup_box').text('区县不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else {
$('.success').show().delay(2000).hide(2)
// $('.first').show().delay(2000).hide(2)
// setTimeout(function () {
// $('.success').show().delay(2000).hide(2)
// },2000);
}
}
)
})
</script>
</body>
</html>
\ No newline at end of file
... ...
$(document).ready(function () {
$('.mask_box').hide()
$('.form_popup_box').hide()
$(function () {
//获取短信验证码
var validCode = true;
$(".getCode").click(function () {
var time = 60;
var $code = $(this);
if (validCode) {
validCode = false;
var t = setInterval(function () {
time--;
$code.html(time + "秒");
if (time == 0) {
clearInterval(t);
$code.html("重新获取");
validCode = true;
}
}, 1000)
}
})
})
$('.platform_item').click(function () {
weui.picker([
{label: '平台1', value: 0},
{label: '平台2', value: 1},
{label: '平台3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#platform').val(res[0].label)
}
}
)
})
$('.hospital_item').click(function () {
weui.picker([
{label: '医院1', value: 0},
{label: '医院2', value: 1},
{label: '医院3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#hospital').val(res[0].label)
}
}
)
})
$('.department_item').click(function () {
weui.picker([
{label: '科室1', value: 0},
{label: '科室2', value: 1},
{label: '科室3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#department').val(res[0].label)
}
}
)
})
$('.position_item').click(function () {
weui.picker([
{label: '职务1', value: 0},
{label: '职务2', value: 1},
{label: '职务3', value: 2},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('#position').val(res[0].label)
}
}
)
})
$('.register_btn').click(function () {
var user_name = $('#user_name').val()
var phone_num = $('#phone_num').val()
var verify_code = $('#verify_code').val()
var platform = $('#platform').val()
var hospital = $('#hospital').val()
var department = $('#department').val()
var position = $('#position').val()
var province = $('#province').val()
var city = $('#city').val()
var town = $('#town').val()
if (user_name == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('用户名不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (phone_num == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('手机号不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (verify_code == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('密码不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (platform == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('平台不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (hospital == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('医院不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (department == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('科室不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (position == '') {
$('.form_popup_box').show()
$('.form_popup_box').text('职务不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (province == '请选择') {
$('.form_popup_box').show()
$('.form_popup_box').text('省份不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (city == '请选择') {
$('.form_popup_box').show()
$('.form_popup_box').text('城市不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else if (town == '请选择') {
$('.form_popup_box').show()
$('.form_popup_box').text('区县不能为空')
$('.form_popup_box').delay(1000).hide(0);
} else {
$('.success').show().delay(2000).hide(2)
// $('.first').show().delay(2000).hide(2)
// setTimeout(function () {
// $('.success').show().delay(2000).hide(2)
// },2000);
}
}
)
})
\ No newline at end of file