diff --git a/plugins/rebate/README.md b/plugins/rebate/README.md new file mode 100644 index 00000000..27a7e8ed --- /dev/null +++ b/plugins/rebate/README.md @@ -0,0 +1 @@ +## 消费返利 diff --git a/plugins/rebate/callbacks.php b/plugins/rebate/callbacks.php new file mode 100644 index 00000000..6e5f447d --- /dev/null +++ b/plugins/rebate/callbacks.php @@ -0,0 +1,14 @@ + function ($plugins) { + \Artisan::call('migrate',['--path'=>'plugins/rebate/migrations','--force'=>true]); + }, + app\common\events\PluginWasDisabled::class => function ($plugin) { + + + }, + app\common\events\PluginWasDeleted::class => function () { + \Artisan::call('migrate:rollback',['--path'=>'plugins/rebate/migrations']); + } +]; diff --git a/plugins/rebate/lang/en/locale.js b/plugins/rebate/lang/en/locale.js new file mode 100644 index 00000000..6f5de3aa --- /dev/null +++ b/plugins/rebate/lang/en/locale.js @@ -0,0 +1,8 @@ + +"use strict"; + +$.extend($.locales['en'], { + 'welfare': { + test: "JavaScript i18n test: English" + } +}); diff --git a/plugins/rebate/lang/en/test.php b/plugins/rebate/lang/en/test.php new file mode 100644 index 00000000..8999558a --- /dev/null +++ b/plugins/rebate/lang/en/test.php @@ -0,0 +1,5 @@ +'this is test title' +]; \ No newline at end of file diff --git a/plugins/rebate/lang/zh-CN/locale.js b/plugins/rebate/lang/zh-CN/locale.js new file mode 100644 index 00000000..1be84a97 --- /dev/null +++ b/plugins/rebate/lang/zh-CN/locale.js @@ -0,0 +1,6 @@ + +$.extend($.locales['zh-CN'], { + 'welfare': { + test: "JavaScript i18n test: 简体中文" + } +}); diff --git a/plugins/rebate/lang/zh-CN/test.php b/plugins/rebate/lang/zh-CN/test.php new file mode 100644 index 00000000..14fbcffc --- /dev/null +++ b/plugins/rebate/lang/zh-CN/test.php @@ -0,0 +1,5 @@ +'测试标题' +]; \ No newline at end of file diff --git a/plugins/rebate/package.json b/plugins/rebate/package.json new file mode 100644 index 00000000..4d4d4f58 --- /dev/null +++ b/plugins/rebate/package.json @@ -0,0 +1,11 @@ +{ + "name": "rebate", + "terminal": "wechat|min|wap", + "version": "1.0.1", + "title": "消费返利", + "description": "消费返利", + "author": "wuhui", + "url": "", + "namespace": "Yunshop\\Rebate", + "config": "config.tpl" +} \ No newline at end of file diff --git a/plugins/rebate/src/PluginApplication.php b/plugins/rebate/src/PluginApplication.php new file mode 100644 index 00000000..dd2a74db --- /dev/null +++ b/plugins/rebate/src/PluginApplication.php @@ -0,0 +1,80 @@ +setPluginMenu('rebate', [ + 'name' => '消费返利', + 'type' => 'marketing', + 'url' => 'plugin.rebate.admin.index.index',// url 可以填写http 也可以直接写路由 + 'url_params' => '',//如果是url填写的是路由则启用参数否则不启用 + 'permit' => 1,//如果不设置则不会做权限检测 + 'menu' => 1,//如果不设置则不显示菜单,子菜单也将不显示 + 'icon' => '',//菜单图标 + 'list_icon' => 'rebate', + 'parents' => [], + 'top_show' => 0, + 'left_first_show' => 0, + 'left_second_show' => 1, + 'child' => [ + 'plugin_rebate_index' => [ + 'name' => '返利列表', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'url' => 'plugin.rebate.admin.index.index', + 'url_params' => '', + 'item' => 'plugin_rebate_index', + 'parents' => ['rebate'], + 'child' => [ + // 权限补充 + 'plugin_rebate_index_index' => [ + 'name' => '返利列表', + 'url' => 'plugin.rebate.admin.index.index', + 'url_params' => '', + 'permit' => 1, + 'menu' => 0, + 'icon' => '', + 'item' => 'plugin_rebate_index_index', + 'parents' => ['rebate','plugin_rebate_index'] + ], + ] + ], + 'plugin_rebate_set' => [ + 'name' => '基本设置', + 'permit' => 1, + 'menu' => 1, + 'icon' => '', + 'url' => 'plugin.rebate.admin.index.set', + 'url_params' => '', + 'parents' => ['rebate'], + 'child' => [ + // 权限补充 + 'plugin_rebate_index_set' => [ + 'name' => '基本设置', + 'url' => 'plugin.rebate.admin.index.set', + 'url_params' => '', + 'permit' => 1, + 'menu' => 0, + 'icon' => '', + 'item' => 'plugin_rebate_index_set', + 'parents' => ['rebate', 'plugin_rebate_set'], + ], + ] + ], + ] + ]); + } + + + public function boot(){ + $events = app('events'); + + + } + + + +} \ No newline at end of file diff --git a/plugins/rebate/src/admin/IndexController.php b/plugins/rebate/src/admin/IndexController.php new file mode 100644 index 00000000..3fd3ecf3 --- /dev/null +++ b/plugins/rebate/src/admin/IndexController.php @@ -0,0 +1,49 @@ +input('page_size',10); + $search = request()->input('search'); + // 获取列表信息 + // $field = ['id','member_id','unique_number','created_at']; + // $result = CollectionRoomModel::getList($pageSize,$search,$field); + // $data = [ + // 'list' => $result['data'], + // 'pager' => PaginationHelper::show($result['total'],$result['current_page'],$result['per_page']), + // 'search' => $search + // ]; + + + return view('Yunshop\Rebate::index.index',$data)->render(); + } + + // 基本设置 + public function set(){ + // 获取设置信息 判断是否为设置 + $setInfo = request()->input('rebate'); + if ($setInfo) { + // 设置信息 + if (Setting::set('plugin.rebate', $setInfo)) return $this->successJson('编辑成功'); + else return $this->errorJson('设置失败'); + }else{ + // 获取信息 + $set = Setting::get('plugin.rebate'); + + return view('Yunshop\Rebate::index.set',[ + 'set' => $set, + ])->render(); + } + } + + + +} diff --git a/plugins/rebate/views/config.tpl b/plugins/rebate/views/config.tpl new file mode 100644 index 00000000..e69de29b diff --git a/plugins/rebate/views/index/index.blade.php b/plugins/rebate/views/index/index.blade.php new file mode 100644 index 00000000..8e47de19 --- /dev/null +++ b/plugins/rebate/views/index/index.blade.php @@ -0,0 +1,120 @@ + +@extends('layouts.base') + +@section('content') +
+ {{--顶部搜索--}} +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ {{--信息列表--}} +
+
+ + + + + + + + + + + + @foreach ($list as $item) + + + + + + + + @endforeach + +
ID用户信息唯一编号获得时间操作
{{ $item['id'] }} +
+
+ +
+ +
+
{{ $item['unique_number'] }}{{ $item['created_at'] }} + +
+ {!! $pager !!} +
+
+
+ +@endsection + diff --git a/plugins/rebate/views/index/set.blade.php b/plugins/rebate/views/index/set.blade.php new file mode 100644 index 00000000..945a31ec --- /dev/null +++ b/plugins/rebate/views/index/set.blade.php @@ -0,0 +1,124 @@ +@extends('layouts.base') +@section('title', '基本设置') +@section('content') + + + +
+
+ +
+
+
+
基本设置
+
+
+ + + + +
+ +
+
+ + +
点击重新上传
+
+
+ +
+ +
+
+ + +
点击重新上传
+
+
+ +
+ +
+
+ + +
点击重新上传
+
+
+ + 保存 + +
+
+
+ +
+
+ @include('public.admin.uploadImg') + +@endsection + +