dyjh 6 年之前
父節點
當前提交
42381a4776

+ 138 - 0
app/Http/Controllers/Admin/Medical/Sms/ConfController.php

xqd
@@ -0,0 +1,138 @@
+<?php
+/**
+ *  短信配置
+ *  @author  system
+ *  @version    1.0
+ *  @date 2018-09-06 07:31:40
+ *
+ */
+namespace App\Http\Controllers\Admin\Medical\Sms;
+use App\Http\Controllers\Admin\Controller;
+use Illuminate\Http\Request;
+use App\Repositories\Base\Criteria\OrderBy;
+use App\Repositories\Medical\Sms\Criteria\MultiWhere;
+use App\Repositories\Medical\Sms\ConfRepository;
+
+class ConfController extends Controller
+{
+    private $repository;
+
+    public function __construct(ConfRepository $repository) {
+        if(!$this->repository) $this->repository = $repository;
+    }
+
+    function index(Request $request) {
+        $search['keyword'] = $request->input('keyword');
+        $query = $this->repository->pushCriteria(new MultiWhere($search));
+
+        if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
+        $query = $query->pushCriteria(new OrderBy($request['sort_field'],$request['sort_field_by']));
+        }else{
+            $query = $query->pushCriteria(new OrderBy('id','DESC'));
+        }
+        $list = $query->paginate();
+        return view('admin.medical.sms.conf.index',compact('list'));
+    }
+
+
+    function check(Request $request) {
+        $request = $request->all();
+        $search['keyword'] = $request->input('keyword');
+        $orderby = array();
+        if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
+            $orderby[$request['sort_field']] = $request['sort_field_by'];
+        }
+        $list = $this->repository->search($search,$orderby);
+        return view('admin.medical.sms.conf.check',compact('list'));
+    }
+
+
+    /**
+     * 添加
+     * 
+     */
+    public function create(Request $request)
+    {
+        if($request->method() == 'POST') {
+            return $this->_createSave();
+        }
+        return view('admin.medical.sms.conf.edit');
+    }
+
+    /**
+     * 保存修改
+     */
+    private function _createSave(){
+        $data = (array) request('data');
+        $id = $this->repository->create($data);
+        if($id) {
+            $url[] = array('url'=>U( 'Medical/Sms/Conf/index'),'title'=>'返回列表');
+            $url[] = array('url'=>U( 'Medical/Sms/Conf/create'),'title'=>'继续添加');
+            $this->showMessage('添加成功',$url);
+        }else{
+            $url[] = array('url'=>U( 'Medical/Sms/Conf/index'),'title'=>'返回列表');
+            return $this->showWarning('添加失败',$url);
+        }
+    }
+    
+    /**
+     * 
+     * 修改
+     * 
+     * 
+     */
+    public function update(Request $request) {
+        if($request->method() == 'POST') {
+            return $this->_updateSave();
+        }
+        $data = $this->repository->find($request->get('id'));
+        return view('admin.medical.sms.conf.edit',compact('data'));
+    }
+
+    /**
+     * 保存修改
+     */
+    private function _updateSave() {
+        $data = (array) request('data');
+        $ok = $this->repository->update(request('id'),$data);
+        if($ok) {
+            $url[] = array('url'=>U( 'Medical/Sms/Conf/index'),'title'=>'返回列表');
+            return $this->showMessage('操作成功',urldecode(request('_referer')));
+        }else{
+            $url[] = array('url'=>U( 'Medical/Sms/Conf/index'),'title'=>'返回列表');
+            return $this->showWarning('操作失败',$url);
+        }
+    }
+
+    public function view(Request $request) {
+        $data = $this->repository->find(request('id'));
+        return view('admin.medical.sms.conf.view',compact('data'));
+    }
+
+
+    /**
+     *
+     * 状态改变
+     *
+     */
+    public function status(Request $request) {
+        $ok = $this->repository->updateStatus(request('id'),request('status'));
+        if($ok) {
+            return $this->showMessage('操作成功');
+        }else{
+            return $this->showWarning('操作失败');
+        }
+    }
+    
+    /**
+     * 删除
+     */
+    public function destroy(Request $request) {
+        $bool = $this->repository->destroy($request->get('id'));
+        if($bool) {
+            return  $this->showMessage('操作成功');
+        }else{
+            return  $this->showWarning("操作失败");
+        }
+    }
+}

+ 5 - 1
app/Http/Controllers/Web/Controller.php

xqd
@@ -6,9 +6,13 @@ use Illuminate\Routing\Controller as BaseController;
 use Illuminate\Foundation\Bus\DispatchesJobs;
 use Illuminate\Foundation\Validation\ValidatesRequests;
 use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-
+use Illuminate\Support\Facades\Response;
 class Controller extends BaseController
 {
     use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+    public function api($data)
+    {
+        return Response::json($data);
+    }
 
 }

+ 60 - 14
app/Http/Controllers/Web/OrderController.php

xqd xqd xqd
@@ -9,7 +9,8 @@
 namespace App\Http\Controllers\Web;
 
 
-
+use Illuminate\Support\Facades\Cache;
+use App\Models\MedicalSmsConfModel;
 use Illuminate\Http\Request;
 
 class OrderController extends Controller
@@ -17,6 +18,7 @@ class OrderController extends Controller
     public function index(Request $request){
         if($request->method() == 'POST') {
             $data = $request->input();
+            $code = Cache::get($data['mobile'].'post');
         }
         return view('web.order.index');
     }
@@ -28,36 +30,80 @@ class OrderController extends Controller
      ***聚合数据
      ***DATE:2015-05-25
      */
-    public function smsJuHe()
+    public function smsJuHe(Request $request)
     {
-        
+        $data = $request->input();
+        $conf = MedicalSmsConfModel::find(1);
         header('content-type:text/html;charset=utf-8');
 
         $sendUrl = 'http://v.juhe.cn/sms/send'; //短信接口的URL
-
+        $num = rand(1000,9999);
+        Cache::put($data['mobile'].'post',$num,10000);
         $smsConf = array(
-            'key'   => '*****************', //您申请的APPKEY
-            'mobile'    => '1891351****', //接受短信的用户手机号码
-            'tpl_id'    => '111', //您申请的短信模板ID,根据实际情况修改
-            'tpl_value' =>'#code#=1234&#company#=聚合数据' //您设置的模板变量,根据实际情况修改
+            'key'   => $conf->apikey, //您申请的APPKEY
+            'mobile'    => $data['mobile'], //接受短信的用户手机号码
+            'tpl_id'    => $conf->temp_id, //您申请的短信模板ID,根据实际情况修改
+            'tpl_value' =>'#code#=1234&#company#='.$conf->sign //您设置的模板变量,根据实际情况修改
         );
 
-        $content = juhecurl($sendUrl,$smsConf,1); //请求发送短信
-
+        $content = $this->juhecurl($sendUrl,$smsConf,1); //请求发送短信
+        //$content=false;
         if($content){
             $result = json_decode($content,true);
             $error_code = $result['error_code'];
             if($error_code == 0){
                 //状态为0,说明短信发送成功
-                echo "短信发送成功,短信ID:".$result['result']['sid'];
+                $res['state'] = 1;
             }else{
                 //状态非0,说明失败
                 $msg = $result['reason'];
-                echo "短信发送失败(".$error_code."):".$msg;
+                $res['err'] = "短信发送失败(".$error_code."):".$msg;
+                $res['state'] = 0;
             }
         }else{
-            //返回内容异常,以下可根据业务逻辑自行修改
-            echo "请求发送短信失败";
+            $res['state'] = 0;
+            $res['err'] = '发送失败';
+        }
+        return $this->api($res);
+    }
+
+    /**
+     * 请求接口返回内容
+     * @param  string $url [请求的URL地址]
+     * @param  string $params [请求的参数]
+     * @param  int $ipost [是否采用POST形式]
+     * @return  string
+     */
+    function juhecurl($url,$params=false,$ispost=0){
+        $httpInfo = array();
+        $ch = curl_init();
+        curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 );
+        curl_setopt( $ch, CURLOPT_USERAGENT , 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22' );
+        curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 30 );
+        curl_setopt( $ch, CURLOPT_TIMEOUT , 30);
+        curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );
+        if( $ispost )
+        {
+            curl_setopt( $ch , CURLOPT_POST , true );
+            curl_setopt( $ch , CURLOPT_POSTFIELDS , $params );
+            curl_setopt( $ch , CURLOPT_URL , $url );
+        }
+        else
+        {
+            if($params){
+                curl_setopt( $ch , CURLOPT_URL , $url.'?'.$params );
+            }else{
+                curl_setopt( $ch , CURLOPT_URL , $url);
+            }
+        }
+        $response = curl_exec( $ch );
+        if ($response === FALSE) {
+            //echo "cURL Error: " . curl_error($ch);
+            return false;
         }
+        $httpCode = curl_getinfo( $ch , CURLINFO_HTTP_CODE );
+        $httpInfo = array_merge( $httpInfo , curl_getinfo( $ch ) );
+        curl_close( $ch );
+        return $response;
     }
 }

+ 39 - 0
app/Models/MedicalSmsConfModel.php

xqd
@@ -0,0 +1,39 @@
+<?php
+namespace App\Models;
+use App\Models\BaseModel;
+/**
+ *  @description 短信配置
+ *  @author  system;
+ *  @version    1.0
+ *  @date 2018-09-06 07:31:40
+ *
+ */
+class MedicalSmsConfModel extends BaseModel
+{
+    /**
+     * 数据表名
+     *
+     * @var string
+     *
+     */
+    protected $table = 'medical_sms_conf';
+    /**
+    主键
+     */
+    protected $primaryKey = 'id';
+
+    //分页
+    protected $perPage = PAGE_NUMS;
+
+    /**
+     * 可以被集体附值的表的字段
+     *
+     * @var string
+     */
+    protected $fillable = [
+                           'apikey',
+                           'sign',
+                           'temp_id'
+                          ];
+
+}

+ 21 - 0
app/Repositories/Medical/Sms/ConfRepository.php

xqd
@@ -0,0 +1,21 @@
+<?php
+/**
+ *   短信配置
+ *  @author  system
+ *  @version    1.0
+ *  @date 2018-09-06 07:31:40
+ *
+ */
+namespace App\Repositories\Medical\Sms;
+
+use App\Repositories\Base\Repository;
+
+
+class ConfRepository extends Repository {
+
+    public function model() {
+        return \App\Models\MedicalSmsConfModel::class;
+    }
+
+    
+}

+ 45 - 0
app/Repositories/Medical/Sms/Criteria/MultiWhere.php

xqd
@@ -0,0 +1,45 @@
+<?php
+/**
+ * User: Mike
+ * Email: m@9026.com
+ * Date: 2017/1/12
+ * Time: 17:52
+ */
+
+namespace App\Repositories\Medical\Sms\Criteria;
+
+
+
+
+use App\Repositories\Base\Criteria;
+use App\Repositories\Contracts\RepositoryInterface as Repository;
+
+class MultiWhere extends Criteria {
+
+    private $search = [];
+
+    /**
+     * MultiWhere constructor.
+     * @param array $search
+     *
+     */
+    public function __construct(array $search)
+    {
+        $this->search = $search;
+    }
+
+    /**
+    * @param $model
+    * @param RepositoryInterface $repository
+    * @return mixed
+    */
+    public function apply($model, Repository $repository)
+    {
+          if(isset($this->search['updated_at']) && $this->search['updated_at']) {
+                                    $model = $model->where('updated_at',$this->search['updated_at']);
+                                 }
+
+         return $model;
+    }
+
+}

+ 34 - 0
database/migrations/2018_09_06_072724_create_table_medical_sms_conf.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTableMedicalSmsConf extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('medical_sms_conf', function (Blueprint $table) {
+            $table->increments('id');
+            $table->string('apikey')->comment('聚合apikey');
+            $table->string('sign')->comment('短信签名');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('medical_sms_conf');
+    }
+}

+ 33 - 0
database/migrations/2018_09_06_074628_edite_table_medical_sms_conf.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class EditeTableMedicalSmsConf extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('medical_sms_conf', function (Blueprint $table) {
+            //
+            $table->unsignedInteger('temp_id')->comment('模板id');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('medical_sms_conf', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 86 - 0
resources/views/admin/medical/sms/conf/check.blade.php

xqd
@@ -0,0 +1,86 @@
+@extends('admin.layout')
+
+@section('content')
+		<div class="row">
+			<div class="col-sm-12">
+				<div class="ibox float-e-margins">
+					<div class="ibox-title">
+						<h5>短信配置</h5>
+						<div class="ibox-tools">
+							<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+							</a>
+						</div>
+					</div>
+					<div class="ibox-content">
+						<div class="row">
+							<form method="GET" action="" accept-charset="UTF-8">
+
+								<div class="col-sm-4">
+									<div class="input-group">
+										<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control">
+								<span class="input-group-btn">
+									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
+								</span>
+									</div>
+								</div>
+							</form>
+							@if(role('Medical/Sms/Conf/create'))
+								<div class="col-sm-3 pull-right">
+									<a href="{{ U('Medical/Sms/Conf/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
+								</div>
+							@endif
+						</div>
+
+						<table class="table table-striped table-bordered table-hover dataTables-example dataTable dataCheckTable">
+							<thead>
+							<tr>
+								<th><input class="btSelectAll" name="btSelectAll" type="checkbox"></th>
+								
+            <th class="sorting" data-sort="id"> ID </th>
+            <th class="sorting" data-sort="apikey"> 聚合apikey </th>
+            <th class="sorting" data-sort="sign"> 短信签名 </th>
+            <th class="sorting" data-sort="created_at"> 创建时间 </th>
+            <th class="sorting" data-sort="updated_at"> 更新时间 </th>
+								<th width="22%">相关操作</th>
+							</tr>
+							</thead>
+							<tbody>
+							@if(isset($list))
+								@foreach($list as $key => $item)
+									<tr>
+									<td><input data-json='{!! json_encode($item) !!}'  name="btSelectItem" class="data_key" type="checkbox" value="{{ $item->id or 0 }}" /></td>
+									
+            <td>{{ $item->id }}</td>
+            <td>{{ $item->apikey }}</td>
+            <td>{{ $item->sign }}</td>
+            <td>{{ $item->created_at }}</td>
+            <td>{{ $item->updated_at }}</td>
+									<td>
+										@if(role('Medical/Sms/Conf/view'))
+											<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Medical/Sms/Conf/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
+										@endif
+									</td>
+								</tr>
+								@endforeach
+							@endif
+
+							</tbody>
+						</table>
+						<div class="row">
+							<div class="col-sm-6">
+								<div class="dataTables_info" id="DataTables_Table_0_info"
+									 role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
+							</div>
+							<div class="col-sm-6">
+								<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+									{!! $list->setPath('')->appends(Request::all())->render() !!}
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	@include('admin.tools.check_script');
+
+@endsection

+ 77 - 0
resources/views/admin/medical/sms/conf/edit.blade.php

xqd
@@ -0,0 +1,77 @@
+@extends('admin.layout')
+
+@section('content')
+
+<?php
+    if(!isset($data)) $data = array();
+    if(!$data && session("data")){
+        $data = session("data");
+    }
+    if(!$data && session('_old_input')){
+        $data = session("_old_input");
+    }
+?>
+	<div class="row">
+		<div class="col-sm-12">
+			<div class="ibox float-e-margins">
+				<div class="ibox-title">
+					<h5>短信配置</h5>
+					<div class="ibox-tools">
+						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+						</a>
+					</div>
+				</div>
+				<div class="ibox-content">
+                    @if(role('Medical/Sms/Conf/index'))
+				    <div class="row">
+    					<div class="col-sm-3 pull-right">
+    					   <a href="{{ U('Medical/Sms/Conf/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
+    					</div>
+					</div>
+                    @endif
+
+		            <div class="row">
+                        <div class="col-lg-10">
+                            <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
+
+                                    
+                <div class="form-group">
+                                    
+                 <label class="control-label col-sm-3">聚合apikey</label>
+                                    
+                   <div class="col-sm-9">
+                     <input id="data_apikey" name="data[apikey]" class="form-control" value="{{ $data['apikey'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                    </div>
+                                
+                </div>    
+                <div class="form-group">
+                                    
+                 <label class="control-label col-sm-3">短信签名</label>
+                                    
+                   <div class="col-sm-9">
+                     <input id="data_sign" name="data[sign]" class="form-control" value="{{ $data['sign'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                    </div>
+                                
+                </div>
+                                
+                                <div class="form-group">
+                                    <label class="control-label col-sm-3">&nbsp;</label>
+                                    <div class="col-sm-9">
+                                        <input type="hidden" name="_referer" value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
+                                        <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
+                                        <input type="submit" class="btn btn-success" style="margin-right:20px;">
+                                        <input type="reset" class="btn btn-default" >
+                                    </div>
+                                </div>
+        
+                            </form>
+                        </div>
+                        <!-- /.col-lg-10 -->
+                    </div>
+                    <!-- /.row -->
+				</div>
+			</div>
+		</div>
+	</div>
+
+@endsection

+ 101 - 0
resources/views/admin/medical/sms/conf/index.blade.php

xqd
@@ -0,0 +1,101 @@
+@extends('admin.layout') 
+
+@section('content')
+	<div class="row">
+		<div class="col-sm-12">
+			<div class="ibox float-e-margins">
+				<div class="ibox-title">
+					<h5>短信配置</h5>
+					<div class="ibox-tools">
+						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+						</a>
+					</div>
+				</div>
+				<div class="ibox-content">
+				    <div class="row">
+				        <form method="GET" action="" accept-charset="UTF-8">
+
+				        <div class="col-sm-4">
+				            <div class="input-group">
+								<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control"> 
+								<span class="input-group-btn">
+									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
+								</span>
+    						</div>
+				        </div>
+				        </form>
+						@if(role('Medical/Sms/Conf/create'))
+    					<div class="col-sm-3 pull-right">
+    					   <a href="{{ U('Medical/Sms/Conf/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
+    					</div>
+						@endif
+					</div>
+					
+					<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+						<thead>
+    						<tr>
+								
+            <th class="sorting" data-sort="id"> ID </th>
+            <th class="sorting" data-sort="apikey"> 聚合apikey </th>
+            <th class="sorting" data-sort="sign"> 短信签名 </th>
+            <th class="sorting" data-sort="created_at"> 创建时间 </th>
+            <th class="sorting" data-sort="updated_at"> 更新时间 </th>
+        						<th width="22%">相关操作</th>
+        					</tr>
+						</thead>
+						<tbody>
+						@if(isset($list))
+							@foreach($list as $key => $item)							<tr>
+								
+            <td>{{ $item->id }}</td>
+            <td>{{ $item->apikey }}</td>
+            <td>{{ $item->sign }}</td>
+            <td>{{ $item->created_at }}</td>
+            <td>{{ $item->updated_at }}</td>
+								<td>
+									<div class="btn-group">
+										<button data-toggle="dropdown"
+											class="btn btn-warning btn-sm dropdown-toggle"
+											aria-expanded="false">
+											操作 <span class="caret"></span>
+										</button>
+										<ul class="dropdown-menu">
+
+
+											@if(role('Medical/Sms/Conf/update'))
+											<li><a href="{{ U('Medical/Sms/Conf/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>
+											@endif
+
+											@if(role('Medical/Sms/Conf/destroy'))
+											<li class="divider"></li>
+											<li><a href="{{ U('Medical/Sms/Conf/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
+											@endif
+
+										</ul>
+									</div>
+								@if(role('Medical/Sms/Conf/view'))
+										<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Medical/Sms/Conf/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
+									@endif
+								</td>
+							</tr>
+							@endforeach
+							@endif
+
+						</tbody>
+					</table>
+					<div class="row">
+						<div class="col-sm-6">
+							<div class="dataTables_info" id="DataTables_Table_0_info"
+								role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
+						</div>
+						<div class="col-sm-6">
+						<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+						{!! $list->setPath('')->appends(Request::all())->render() !!}
+						</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+@endsection

+ 53 - 0
resources/views/admin/medical/sms/conf/view.blade.php

xqd
@@ -0,0 +1,53 @@
+@extends('admin.layout')
+
+@section('content')
+<div class="row">
+    <div class="ibox-content">
+        <div class="list-group">
+                                 
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">ID</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['id'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">聚合apikey</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['apikey'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">短信签名</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['sign'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading"></h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['deleted_at'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">创建时间</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['created_at'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">更新时间</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['updated_at'] or ''}}</p>
+                                                 
+               </div>
+        </div>
+    </div>
+</div>
+@endsection

+ 59 - 31
resources/views/web/order/index.blade.php

xqd xqd xqd xqd xqd xqd
@@ -32,7 +32,6 @@
             width: 50px;
             height: 50px;
             margin-top: 3px;
-            margin-left: 10px; 
         }
         h3{
             text-align: center;
@@ -41,10 +40,6 @@
             flex-wrap: wrap;
             display: flex;
         }
-        .all .input{
-            /*width: 40%;*/
-            margin:4px 6%;
-        }
         .all .input-group{
             margin:4px 6%;
         }
@@ -52,6 +47,15 @@
             width: 66.66%;
             margin: 4px 16.66%;
         }
+        #tanchuang{
+            position: fixed;
+            z-index: 999;
+            width: 100%;
+            height: 100%;
+            top: 0;
+            left: 0;
+            background: rgba(0,0,0,0.5);
+        }
     </style>
 </head>
 <body>
@@ -78,38 +82,52 @@
         }, 1000)
     }
     function tijiao(){
-        var yanz=document.getElementById("yanz")
-        yanz.style="display:none;"
-    }
+            var tanc=document.getElementById("tanchuang")
+                tanc.style="display:auto;";
+        }
     function closeyan(){
         var yanz=document.getElementById("yanz")
-        yanz.style="display:none;"
+        yanz.style="display:none;";
     }
     function yanzhengma(){
 
-        sending = true;
         var mobile = $('#mobile').val();
-        var data = {
-            'mobile':mobile
-        };
-        $.ajax({
-            type:'post',
-            data:data,
-            url:'index',
-            success:function (msg) {
-                
-            }
-        });
-        var obj = $("#fasong");
-        settime(obj);
+        if(mobile == ''){
+            alert('请输入手机号');
+        }else{
+            var yanzheng = document.getElementById("yzma");
+            yanzheng.style="display:auto;";
+            sending = true;
+            var obj = $("#fasong");
+            settime(obj);
+            $.ajax({
+                headers: {
+                    'X-CSRF-TOKEN': "{{ csrf_token() }}"
+                },
+                type:'post',
+                data:{
+                    mobile:mobile
+                },
+                url:"{{ url('/web/Index/smsJuHe') }}",
+                success:function (msg) {
+                    if(msg.state ==1){
+                        alert('发送成功');
+                    }else{
+                        alert(msg.err);
+                    }
+                }
+            });
+        }
+
     }
 </script>
 <div class="all">
         <div class="col-xs-0 col-lg-2"></div>
         <div class="col-xs-12 col-lg-8 main" style="margin: 0 auto;margin-top: 10px;">
-            <div class="imgbox" style="width:90%;margin: 4px 5%;margin-bottom:20px;display: flex;height: auto;">
-                <img src="{{cdn_asset('/assets/img/logo.jpg')}}">
-                <h3 style="width: 70%;">健康体检服务知情同意书</h3>
+            <div class="col-xs-12 col-lg-12 imgbox" style="width:100%;margin-bottom:20px;display: flex;height: auto;">
+                <div  class="col-xs-0 col-lg-2"></div>
+                <img  class="col-xs-3 col-lg-1" src="{{cdn_asset('/assets/img/logo.jpg')}}">
+                <h3  class="col-lg-8">健康体检服务知情同意书</h3>
             </div>
             
             <form class="bs-example bs-example-form main" role="form">
@@ -141,10 +159,18 @@
                     <span class="input-group-addon">住址:</span>
                     <input type="text" class="form-control" name="address" placeholder="请输入住址" required>
                 </div>
-                <div class="col-xs-12 col-lg-6 input-group" style="display: flex;">
-                    <span style="width: 20%;line-height: 20px;font-size: 10px;" class="input-group-addon">手机号</span>
-                    <input style="width: 44%;" type="text" name="mobile" id="mobile" class="form-control" placeholder="请输入手机号" required>
-                    <input style="width:36%;font-size: 10px;" class="btn btn-default" id="fasong" name="verify" value="获取验证码" onclick="yanzhengma()"/>
+
+
+                <div class="col-xs-12 col-lg-12 input-group" style="display: flex;flex-wrap: wrap;">
+                    <div class="col-xs-12 col-lg-6 input-group" style="display: flex;margin:4px 0;">
+                        <span style="width: 20%;line-height: 20px;font-size: 10px;" class="input-group-addon">手机号</span>
+                        <input style="width: 44%;" type="text" name="mobile" id="mobile" class="form-control" placeholder="请输入手机号" required>
+                        <input style="width:36%;font-size: 10px;" class="btn btn-default" id="fasong" value="获取验证码" onclick="yanzhengma()"/>
+                    </div>
+                    <div id="yzma" class="col-xs-12 col-lg-4 input-group" style="margin:4px 0;display: none;">
+                        <input style="width: 100%;" type="text" name="verify" class="form-control" placeholder="请输入验证码" required>
+                    </div>
+
                 </div>
                 <div class="danxuan">
                     <label for="name">性别:</label>
@@ -166,9 +192,11 @@
                     <div class="checkbox">
                         <label><input type="radio" value="l3" name="sample_type">宫颈刷</label>
                     </div>
-                    <button style="margin-left: 45%;margin-bottom: 20px;" type="submit" class="btn btn-default">提交</button>
+                    <button style="margin-left: 45%;margin-bottom: 20px;" type="button" onclick="tijiao()" class="btn btn-default">提交</button>
                     </div>
                 </div>
+                <div id="tanchuang" style="display: none;">
+                </div>
             </form>
         </div>
     </div>