1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- @include('UEditor::head')
- <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
- <script>
- $('#base-form').ajaxForm({
- success: function (result) {
- $("input[name='id']").val(result.data);
- if (result.status) {
- swal({
- title: "保存成功!",
- text: "",
- type: "success"
- }, function () {
- location = '{{route('admin.course.course.index')}}';
- });
- } else {
- swal({
- title: result.message,
- text: "",
- type: "error"
- })
- }
- }
- });
- let str = "{{$course->vip_level}}";
- var arr = str.split(',');
- arr.map(item => {
- $("input:checkbox[value='" + item + "']").attr('checked', 'true');
- });
- $(function () {
- $.ajax({
- type: "GET",
- url: '{{route('admin.course.course.getsimilartags')}}',
- success: function (data) {
- if (data) {
- $('#inputDiscountTags').tagator({
- autocomplete: data
- });
- }
- }
- });
- });
- $(function () {
- var uploader = WebUploader.create({
- // 选完文件后,是否自动上传。
- auto: true,
- swf: '{{url(env("APP_URL").'/assets/backend/libs/webuploader-0.1.5/Uploader.swf')}}',
- server: '{{route('ibrand.file.upload',['_token'=>csrf_token()])}}',
- pick: '#AuthorAvatarPicker',
- fileVal: 'upload_file',
- accept: {
- title: 'Images',
- extensions: 'gif,jpg,jpeg,bmp,png',
- mimeTypes: 'image/*'
- }
- });
- // 文件上传成功,给item添加成功class, 用样式标记上传成功。
- uploader.on('uploadSuccess', function (file, response) {
- $('.banner-image').attr('src', response.data.url).show();
- $("input[name='banner_pic']").val(response.data.file);
- $("input[name='cover']").val(response.data.path);
- });
- });
- var ue = UE.getEditor('container', {
- initialFrameHeight: 500
- });
- ue.ready(function () {
- ue.execCommand('serverparam', '_token', '{{ csrf_token() }}');//此处为支持laravel5 csrf ,根据实际情况修改,目的就是设置 _token 值.
- });
- </script>
|