Showing
6 changed files
with
235 additions
and
20 deletions
... | @@ -58,11 +58,45 @@ class PickPoetryVerseController extends AdminController | ... | @@ -58,11 +58,45 @@ class PickPoetryVerseController extends AdminController |
58 | { | 58 | { |
59 | return Form::make(new PickPoetryVerse(), function (Form $form) { | 59 | return Form::make(new PickPoetryVerse(), function (Form $form) { |
60 | $form->display('id'); | 60 | $form->display('id'); |
61 | - $form->text('pick_id'); | 61 | + |
62 | - $form->text('verse_id'); | 62 | + $form->block(8, function (Form\BlockForm $form) { |
63 | + // 设置标题 | ||
64 | + $form->title('基本设置'); | ||
65 | + // 显示底部提交按钮 | ||
66 | + $form->showFooter(); | ||
67 | + // 设置字段宽度 | ||
68 | + $form->width(8, 3); | ||
69 | + | ||
70 | + | ||
71 | + $form->radio('plant')->addElementClass('plant') | ||
72 | + ->options([1 => 'Android', 2 => 'IOS'])->default(2); | ||
73 | + | ||
74 | + $form->text('title'); | ||
75 | + $form->textarea('content'); | ||
76 | + | ||
77 | + $form->radio('push_type', '发送时间')->options([1 => '立即', 2 => '定时'])->default(1) | ||
78 | + ->when(2, function (Form\BlockForm $form) { | ||
79 | + $form->datetime('push_time'); | ||
80 | + }); | ||
81 | + $form->select('action_type')->options(['打开应用', '临境', '会员介绍页', '众妙页']); | ||
82 | + | ||
83 | + $form->radio('user_type', '目标人群')->options([1 => '所有人', 2 => '指定用户'])->default(1) | ||
84 | + ->when(2, function (Form\BlockForm $form) { | ||
85 | + $form->text('user_id'); | ||
86 | + }); | ||
87 | + }); | ||
88 | + | ||
89 | + $form->block(4, function (Form\BlockForm $form) { | ||
90 | + $form->html(view('admin.form.push')); | ||
91 | + }); | ||
63 | 92 | ||
64 | $form->display('created_at'); | 93 | $form->display('created_at'); |
65 | $form->display('updated_at'); | 94 | $form->display('updated_at'); |
66 | }); | 95 | }); |
67 | } | 96 | } |
97 | + | ||
98 | + public function store() | ||
99 | + { | ||
100 | + dd(request()->all()); | ||
101 | + } | ||
68 | } | 102 | } | ... | ... |
... | @@ -7,6 +7,7 @@ use Dcat\Admin\Form; | ... | @@ -7,6 +7,7 @@ use Dcat\Admin\Form; |
7 | use Dcat\Admin\Grid; | 7 | use Dcat\Admin\Grid; |
8 | use Dcat\Admin\Show; | 8 | use Dcat\Admin\Show; |
9 | use Dcat\Admin\Http\Controllers\AdminController; | 9 | use Dcat\Admin\Http\Controllers\AdminController; |
10 | +use Illuminate\Http\Request; | ||
10 | 11 | ||
11 | class VideoTempController extends AdminController | 12 | class VideoTempController extends AdminController |
12 | { | 13 | { |
... | @@ -20,23 +21,21 @@ class VideoTempController extends AdminController | ... | @@ -20,23 +21,21 @@ class VideoTempController extends AdminController |
20 | { | 21 | { |
21 | return Grid::make(new VideoTemp(), function (Grid $grid) { | 22 | return Grid::make(new VideoTemp(), function (Grid $grid) { |
22 | // 设置自定义视图 | 23 | // 设置自定义视图 |
23 | - $grid->view('admin.grid.custom'); | ||
24 | - | ||
25 | $grid->setActionClass(Grid\Displayers\Actions::class); | 24 | $grid->setActionClass(Grid\Displayers\Actions::class); |
26 | 25 | ||
27 | -// $grid->column('id',__('ID'))->sortable(); | 26 | + $grid->column('id',__('ID'))->sortable(); |
28 | -// $grid->column('title'); | 27 | + $grid->column('title'); |
29 | -// $grid->column('type'); | 28 | + $grid->column('type'); |
30 | -// $grid->column('bg_type'); | 29 | + $grid->column('bg_type'); |
31 | -// $grid->column('bg_url'); | 30 | + $grid->column('bg_url')->image('/storage/'); |
32 | -// $grid->column('bg_music'); | 31 | + $grid->column('bg_music'); |
33 | -// $grid->column('state'); | 32 | + $grid->column('state'); |
34 | -// $grid->column('sn'); | 33 | + $grid->column('sn'); |
35 | -// $grid->column('top'); | 34 | + $grid->column('top'); |
36 | -// $grid->column('left'); | 35 | + $grid->column('left'); |
37 | -// $grid->column('font_size'); | 36 | + $grid->column('font_size'); |
38 | -// $grid->column('created_at'); | 37 | + $grid->column('created_at'); |
39 | -// $grid->column('updated_at')->sortable(); | 38 | + $grid->column('updated_at')->sortable(); |
40 | // | 39 | // |
41 | // $grid->filter(function (Grid\Filter $filter) { | 40 | // $grid->filter(function (Grid\Filter $filter) { |
42 | // $filter->equal('id'); | 41 | // $filter->equal('id'); |
... | @@ -120,7 +119,8 @@ class VideoTempController extends AdminController | ... | @@ -120,7 +119,8 @@ class VideoTempController extends AdminController |
120 | $form->number('top'); | 119 | $form->number('top'); |
121 | $form->number('left'); | 120 | $form->number('left'); |
122 | $form->number('font_size'); | 121 | $form->number('font_size'); |
123 | - $form->color('text_color')->addElementClass('text_color'); | 122 | + $form->color('text_color')->default('#f5f5f5') |
123 | + ->addElementClass('text_color'); | ||
124 | $form->color('text_bg_color')->addElementClass('text_bg_color'); | 124 | $form->color('text_bg_color')->addElementClass('text_bg_color'); |
125 | $form->number('opacity')->min(0)->max(100) | 125 | $form->number('opacity')->min(0)->max(100) |
126 | ->addElementClass('opacity')->default(90) | 126 | ->addElementClass('opacity')->default(90) | ... | ... |
... | @@ -27,13 +27,19 @@ Route::group([ | ... | @@ -27,13 +27,19 @@ Route::group([ |
27 | /** 视频模板*/ | 27 | /** 视频模板*/ |
28 | $router->resource('/template', 'VideoTempController'); | 28 | $router->resource('/template', 'VideoTempController'); |
29 | 29 | ||
30 | + /** 订单*/ | ||
31 | + $router->resource('/order', 'OrderController'); | ||
30 | 32 | ||
31 | $router->group(['prefix'=>'/tool'],function (Router $router){ | 33 | $router->group(['prefix'=>'/tool'],function (Router $router){ |
32 | /** 每日一言*/ | 34 | /** 每日一言*/ |
33 | - $router->resource('/tool/every-poem', 'EverydayPoemController'); | 35 | + $router->resource('/every-poem', 'EverydayPoemController'); |
34 | 36 | ||
35 | /** 推荐*/ | 37 | /** 推荐*/ |
36 | // $router->resource('/tool/recommend',''); | 38 | // $router->resource('/tool/recommend',''); |
39 | + | ||
40 | + /** 推送服务*/ | ||
41 | + $router->resource('/push', 'PickPoetryVerseController'); | ||
42 | +// $router->resource('/push', 'PushController'); | ||
37 | }); | 43 | }); |
38 | 44 | ||
39 | }); | 45 | }); | ... | ... |
... | @@ -11,6 +11,7 @@ | ... | @@ -11,6 +11,7 @@ |
11 | "guzzlehttp/guzzle": "^7.0.1", | 11 | "guzzlehttp/guzzle": "^7.0.1", |
12 | "jiannei/laravel-enum": "^3.0", | 12 | "jiannei/laravel-enum": "^3.0", |
13 | "jiannei/laravel-response": "^4.0", | 13 | "jiannei/laravel-response": "^4.0", |
14 | + "jpush/jpush": "^3.6", | ||
14 | "laravel/framework": "^8.75", | 15 | "laravel/framework": "^8.75", |
15 | "laravel/sanctum": "^2.11", | 16 | "laravel/sanctum": "^2.11", |
16 | "laravel/socialite": "^5.2", | 17 | "laravel/socialite": "^5.2", | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", |
5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
6 | ], | 6 | ], |
7 | - "content-hash": "298c2071717850e70431d14a67202770", | 7 | + "content-hash": "4a78406ea73ce29697f2238eadcbec83", |
8 | "packages": [ | 8 | "packages": [ |
9 | { | 9 | { |
10 | "name": "asm89/stack-cors", | 10 | "name": "asm89/stack-cors", |
... | @@ -1722,6 +1722,59 @@ | ... | @@ -1722,6 +1722,59 @@ |
1722 | "time": "2021-12-24T08:17:43+00:00" | 1722 | "time": "2021-12-24T08:17:43+00:00" |
1723 | }, | 1723 | }, |
1724 | { | 1724 | { |
1725 | + "name": "jpush/jpush", | ||
1726 | + "version": "v3.6.8", | ||
1727 | + "source": { | ||
1728 | + "type": "git", | ||
1729 | + "url": "https://github.com/jpush/jpush-api-php-client.git", | ||
1730 | + "reference": "ebb191e8854a35c3fb7a6626028b3a23132cbe2c" | ||
1731 | + }, | ||
1732 | + "dist": { | ||
1733 | + "type": "zip", | ||
1734 | + "url": "https://api.github.com/repos/jpush/jpush-api-php-client/zipball/ebb191e8854a35c3fb7a6626028b3a23132cbe2c", | ||
1735 | + "reference": "ebb191e8854a35c3fb7a6626028b3a23132cbe2c", | ||
1736 | + "shasum": "", | ||
1737 | + "mirrors": [ | ||
1738 | + { | ||
1739 | + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", | ||
1740 | + "preferred": true | ||
1741 | + } | ||
1742 | + ] | ||
1743 | + }, | ||
1744 | + "require": { | ||
1745 | + "ext-curl": "*", | ||
1746 | + "php": ">=5.3.3" | ||
1747 | + }, | ||
1748 | + "require-dev": { | ||
1749 | + "phpunit/phpunit": "*" | ||
1750 | + }, | ||
1751 | + "type": "library", | ||
1752 | + "autoload": { | ||
1753 | + "psr-4": { | ||
1754 | + "JPush\\": "src/JPush/" | ||
1755 | + } | ||
1756 | + }, | ||
1757 | + "notification-url": "https://packagist.org/downloads/", | ||
1758 | + "license": [ | ||
1759 | + "MIT" | ||
1760 | + ], | ||
1761 | + "authors": [ | ||
1762 | + { | ||
1763 | + "name": "JPush", | ||
1764 | + "email": "support@jpush.cn", | ||
1765 | + "homepage": "https://www.jpush.cn/", | ||
1766 | + "role": "Developer" | ||
1767 | + } | ||
1768 | + ], | ||
1769 | + "description": "JPush API PHP Client", | ||
1770 | + "homepage": "https://github.com/jpush/jpush-api-php-client", | ||
1771 | + "support": { | ||
1772 | + "issues": "https://github.com/jpush/jpush-api-php-client/issues", | ||
1773 | + "source": "https://github.com/jpush/jpush-api-php-client/tree/v3.6.8" | ||
1774 | + }, | ||
1775 | + "time": "2021-08-12T07:43:39+00:00" | ||
1776 | + }, | ||
1777 | + { | ||
1725 | "name": "laravel/framework", | 1778 | "name": "laravel/framework", |
1726 | "version": "v8.77.1", | 1779 | "version": "v8.77.1", |
1727 | "source": { | 1780 | "source": { | ... | ... |
resources/views/admin/form/push.blade.php
0 → 100644
1 | +<style> | ||
2 | + .box-card { | ||
3 | + width: 380px; | ||
4 | + border: 1px solid rgb(220, 223, 230); | ||
5 | + border-radius: 40px; | ||
6 | + margin-right: 24px; | ||
7 | + padding: 37px 20px; | ||
8 | + min-height: 679px; | ||
9 | + } | ||
10 | + | ||
11 | + .phone-content { | ||
12 | + border: 1px solid rgb(220, 223, 230); | ||
13 | + height: 625px; | ||
14 | + overflow: hidden; | ||
15 | + position: relative; | ||
16 | + background: rgb(245, 245, 245); | ||
17 | + } | ||
18 | + | ||
19 | + .notification-app-name, | ||
20 | + .notification-title, | ||
21 | + .notification-detail{ | ||
22 | + position: absolute; | ||
23 | + overflow: hidden; | ||
24 | + color: #181919; | ||
25 | + } | ||
26 | + | ||
27 | + .notification-app-name{ | ||
28 | + width: 160px; | ||
29 | + font-size: 12px; | ||
30 | + top: 222px; | ||
31 | + left: 90px; | ||
32 | + } | ||
33 | + .notification-title{ | ||
34 | + width: 210px; | ||
35 | + font-size: 14px; | ||
36 | + top: 242px; | ||
37 | + left: 65px; | ||
38 | + } | ||
39 | + .notification-detail{ | ||
40 | + width: 210px; | ||
41 | + font-size: 13px; | ||
42 | + top: 265px; | ||
43 | + left: 65px; | ||
44 | + word-break: break-all; | ||
45 | + white-space: nowrap; | ||
46 | + text-overflow: ellipsis; | ||
47 | + } | ||
48 | +</style> | ||
49 | +<button type="button" class="btn btn-primary sync"><i class="feather icon-repeat"></i> 预览看效果</button> | ||
50 | +<hr> | ||
51 | +<div class="box-card"> | ||
52 | + <div class="phone-content"> | ||
53 | + <img src="{{asset('storage/image/ios1-2.png')}}" alt="" width="338" height="625" id="bg_img"> | ||
54 | + <div class="notification-app-name"> 一言-临境 </div> | ||
55 | + <div class="notification-title"> demo 标题 </div> | ||
56 | + <div class="notification-detail"> 开发者249d42a097c1944e进行了广播推送,这是一条广播 </div> | ||
57 | + </div> | ||
58 | +</div> | ||
59 | + | ||
60 | +<script> | ||
61 | + Dcat.ready(function () { | ||
62 | + var asset = "{{asset('/storage/')}}"; | ||
63 | + | ||
64 | + $(document).off('click', '.sync').on('click', '.sync', function () { | ||
65 | + let plant = parseInt($('.plant:checked').val()); | ||
66 | + if (plant === 1) { | ||
67 | + $('#bg_img').attr('src', asset + '/image/android-2.png'); | ||
68 | + $('.notification-app-name').css('top','244px').css('left','80px'); | ||
69 | + $('.notification-title').css('top','264px').css('left','55px'); | ||
70 | + $('.notification-detail').css('top','287px').css('left','55px'); | ||
71 | + }else{ | ||
72 | + $('#bg_img').attr('src', asset + '/image/ios1-2.png'); | ||
73 | + $('.notification-app-name').css('top','222px').css('left','90px'); | ||
74 | + $('.notification-title').css('top','242px').css('left','65px'); | ||
75 | + $('.notification-detail').css('top','265px').css('left','65px'); | ||
76 | + } | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + // let ori_top = 80; | ||
83 | + // let top = parseInt($('.field_top').val()) + ori_top; | ||
84 | + // let left = $('.field_left').val(); | ||
85 | + // let font = $('.field_font_size').val(); | ||
86 | + // let content_size = 12 + parseInt(font); | ||
87 | + // let title_size = 14 + parseInt(font); | ||
88 | + // let text_color = $('.text_color').val() || 'whitesmoke'; | ||
89 | + // let text_bg_color = $('.text_bg_color').val() || '#5c6bc6'; | ||
90 | + // let opacity = parseInt($('.opacity').val()) / 100; | ||
91 | + // | ||
92 | + // $('.poem-block').css('top', top + 'px').css('left', left + 'px') | ||
93 | + // .css('background-color', text_bg_color).css('opacity', opacity); | ||
94 | + // $('.poem-title').css('font-size', title_size + 'px').css('color', text_color); | ||
95 | + // $('.poem-content').css('font-size', content_size + 'px').css('color', text_color); | ||
96 | + // | ||
97 | + // | ||
98 | + // let bg_img_url = $('.bg_img_url').find("input[type='hidden'][name='bg_url']").val(); | ||
99 | + // if (bg_img_url !== '') { | ||
100 | + // $('.bg_img').attr('src', asset + '/' + bg_img_url).css('display', 'block'); | ||
101 | + // } | ||
102 | + // | ||
103 | + // let bg_video_url = $('.bg_video_url').find("input[type='hidden'][name='bg_url']").val(); | ||
104 | + // if (bg_video_url !== ''){ | ||
105 | + // $('#bg_video').attr('src', asset + '/' + bg_video_url).css('display', 'block'); | ||
106 | + // let bg_video = document.getElementById('bg_video'); | ||
107 | + // bg_video.autoplay = true; | ||
108 | + // bg_video.loop = true; | ||
109 | + // } | ||
110 | + // | ||
111 | + // let bgm_url = $('.bgm_url').find("input[type='hidden'][name='bgm_url']").val(); | ||
112 | + // if (bgm_url !== ''){ | ||
113 | + // $('#bg_audio').attr('src', asset + '/' + bgm_url); | ||
114 | + // let bg_audio = document.getElementById('bg_audio'); | ||
115 | + // bg_audio.autoplay = true; | ||
116 | + // bg_audio.loop = true; | ||
117 | + // } | ||
118 | + }) | ||
119 | + | ||
120 | + }) | ||
121 | +</script> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment