123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- @extends('admin/layout')
- @section('header')
- <link href="{{asset('css/plugins/chosen/chosen.css?v=1')}}" rel="stylesheet">
- <link href="{{asset('css/plugins/switchery/switchery.css?v=1')}}" rel="stylesheet">
- <link href="{{asset('js/plugins/bootstrap-select-1.13.5/css/bootstrap-select.min.css')}}" rel="stylesheet">
- @endsection
- @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">
- <label class="col-sm-2 control-label" for="type">外链类型:</label>
- <div class="col-sm-8 ">
- <select class=" form-control"
- id="type" name="type" data-live-search="true"
- title="请选择外链类型" autocomplete="off">
- @foreach ($typeList as $key=>$item)
- <option value="{{$key}}"
- @if(($data->type??null)==$key) selected @endif>{{$item}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="tag">标签:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="tag" name="tag"
- value="{{$data->tag??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="url">平台链接:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="url" name="url"
- value="{{$data->url??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="cost">费用:</label>
- <div class="col-sm-8">
- <select class="selectpicker form-control"
- id="cost" name="cost" data-live-search="true" multiple
- title="费用" autocomplete="off">
- <option value="1"
- @if(isset($data->cost) && in_array(1,explode(',',$data->cost))) selected @endif>
- 免费
- </option>
- <option value="2"
- @if(isset($data->cost) && in_array(2,explode(',',$data->cost))) selected @endif>
- 付费
- </option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="business_ids">行业:</label>
- <div class="col-sm-8">
- <select class="selectpicker form-control"
- id="business_ids" name="business_ids" data-live-search="true" multiple
- title="请选择行业" autocomplete="off">
- @foreach ($businesses as $business)
- <option value="{{$business->id}}"
- @if(isset($data->business_ids) && in_array($business->id,explode(',',$data->business_ids))) selected @endif>{{$business->title}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="country">国家:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="country" name="country"
- value="{{$data->country??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="big_ball">锚文本:</label>
- <div class="col-sm-8 ">
- <select class=" form-control"
- id="big_ball" name="big_ball" data-live-search="true"
- title="请选择锚文本" autocomplete="off">
- <option value="0" @if(($data->big_ball??null)==0) selected @endif>否</option>
- <option value="1" @if(($data->big_ball??null)==1) selected @endif>是</option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="quantitative_restrictions">数量限制:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="quantitative_restrictions"
- name="quantitative_restrictions"
- value="{{$data->quantitative_restrictions??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="phone_verification">手机验证:</label>
- <div class="col-sm-8 ">
- <select class=" form-control"
- id="phone_verification" name="phone_verification" data-live-search="true"
- title="手机验证" autocomplete="off">
- <option value="0" @if(($data->phone_verification??null)==0) selected @endif>否
- </option>
- <option value="1" @if(($data->phone_verification??null)==1) selected @endif>是
- </option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="timed_release">定时发布:</label>
- <div class="col-sm-8 ">
- <select class=" form-control"
- id="timed_release" name="timed_release" data-live-search="true"
- title="定时发布" autocomplete="off">
- <option value="0" @if(($data->timed_release??null)==0) selected @endif>否
- </option>
- <option value="1" @if(($data->timed_release??null)==1) selected @endif>是
- </option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="authority_score">Authority Score:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="authority_score" name="authority_score"
- value="{{$data->authority_score??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="spam_score">Spam Score:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="spam_score" name="spam_score"
- value="{{$data->spam_score??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="home_page">个人主页加网址:</label>
- <div class="col-sm-8 ">
- <select class=" form-control"
- id="home_page" name="home_page" data-live-search="true"
- title="个人主页加网址" autocomplete="off">
- <option value="0" @if(($data->home_page??null)==0) selected @endif>否
- </option>
- <option value="1" @if(($data->home_page??null)==1) selected @endif>是
- </option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="remark">备注:</label>
- <div class="col-sm-8">
- <textarea class="form-control" id="remark"
- name="remark">{{$data->remark??''}}</textarea>
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- <button class="btn btn-primary" type="button"
- onclick="units.save({{$data->id??0}})">
- 保存
- </button>
- <button class="btn btn-white closeLayer" type="button">取消</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script src="{{asset('js/plugins/switchery/switchery.js?v=1')}}"></script>
- <script src="{{asset('js/plugins/bootstrap-select-1.13.9/dist/js/bootstrap-select.min.js')}}"></script>
- <script>
- var units = {
- save: function (id) {
- var url = '/admin/link/' + id + '/save';
- var data = tips.getFormValues('#form');
- if ($("#business_ids").val()) {
- data.business_ids = $("#business_ids").val().toLocaleString();
- }
- if ($("#cost").val()) {
- data.cost = $("#cost").val().toLocaleString();
- }
- var ajaxConfig = {
- url: url,
- type: 'put',
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- tips.closeParentLayer();
- window.parent.tips.tableRefresh('#table');
- });
- }
- };
- tips.ajax(ajaxConfig);
- }
- };
- </script>
- @endsection
|