Browse Source

Merge branch 'coupon_remove' into phoenix

# Conflicts:
#	app/Admin/Controllers/CouponTieController.php
#	app/Admin/bootstrap.php
#	dcat_admin_ide_helper.php
master
liangyuyan 5 years ago
parent
commit
7f3bebbd3c
  1. 264
      app/Admin/Controllers/CouponController.php
  2. 8
      app/Admin/Controllers/CouponTieController.php
  3. 60
      app/Admin/Repositories/Coupon.php
  4. 21
      app/Admin/bootstrap.php
  5. 2
      app/Admin/routes.php
  6. 146
      app/Models/Coupon.php
  7. 18
      app/Models/CouponReceiveType.php
  8. 7
      app/Models/CouponSetting.php
  9. 14
      app/Models/CouponUse.php
  10. 14
      app/Models/StoreType.php
  11. 55
      config/coupon.php
  12. 13
      dcat_admin_ide_helper.php
  13. 2
      public/vendors/dcat-admin/dcat/extra/select-table.js
  14. 1
      public/vendors/dcat-admin/dcat/extra/select-table.js.map
  15. 399
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css
  16. 1
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css.map
  17. 10
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css
  18. 1
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css.map
  19. 6252
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js
  20. 1
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js.map
  21. 10
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js
  22. 1
      public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js.map
  23. BIN
      public/vendors/dcat-admin/images/pages/login/bg.jpg
  24. BIN
      public/vendors/dcat-admin/images/waves.png
  25. 47
      resources/lang/zh-CN/coupon.php

264
app/Admin/Controllers/CouponController.php

@ -0,0 +1,264 @@
<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\Coupon;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Controllers\AdminController;
use App\Models\CouponReceiveType as ReceiveTypeModel;
use App\Models\CouponSetting as SettingModel;
use App\Models\Coupon as CouponModel;
use App\Models\ImsCjdcMarket as marketModel;
use App\Models\StoreType as storeTypeModel;
use Dcat\Admin\Form\NestedForm;
use function GuzzleHttp\json_decode;
class CouponController extends AdminController
{
protected $receive_type = 0;
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
// DB::select();
// $model = new CouponModel();
// $list = $model->setAppends([])->select('id','title')->get();
// dd($list->toArray());
return Grid::make(new Coupon(), function (Grid $grid) {
$grid->id->sortable();
$grid->title;
$grid->start_time_text;
$grid->end_time_text;
$grid->full_amount;
$grid->discounts;
$grid->discount_type_text;
$grid->inventory;
$grid->inventory_use;
$grid->use_number;
$grid->active_type_text;
$grid->status
->using(
config('coupon.status')
)
->label(
config('coupon.status_label')
);
$grid->filter(function (Grid\Filter $filter) {
$filter->like('title','标题');
$filter->equal('discount_type')->select(config('coupon.discount_type'));
$filter->equal('active_type')->select(config('coupon.active_type'));
$status = config('coupon.status');
unset($status[-1]);/* 去掉删除状态 */
$filter->in('status')->multipleSelect($status);
});
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new Coupon(), function (Show $show) use($id){
// $show->id;
$show->title;
$show->introduce;
$show->full_amount;
$show->discounts;
$show->discount_type_text;
$show->inventory;
$show->inventory_use;
$show->start_time_text;
$show->end_time_text;
$show->usable_start_time_text;
$show->usable_end_time_text;
$show->active_type_text;
$show->receive_type_text;
$show->type_text;
$show->category_text;
$show->market_id->as(function($marketId){
$text = '全部市场';
if($marketId > 0){
$market = marketModel::select('name')->find($marketId)->toArray();
$text = $market ? $market['name'] : $text ;
}
return $text;
});
$show->storetype_id->as(function($storeTypeId){
$text = '全部店铺类型';
if($storeTypeId > 0){
$storeType = storeTypeModel::select('type_name')->find($storeTypeId)->toArray();
$text = $storeType ? $storeType['type_name'] : $text ;
}
return $text;
});
$show->is_new_user_text;
$show->usable_number;
$show->weigh;
$show->remark;
$show->status_text;
$show->created_at_text;
$show->updated_at_text;
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
$builder = CouponModel::with('receiveType');
return Form::make($builder, function (Form $form) {
$startTime = null;
$endTime = null;
$usableStartTime = null;
$usableEndTime = null;
if($form->isEditing()){
// $id = $form->getKey();
// 查询已选择的领取方式
// $receiveType = ReceiveTypeModel::where('system_coupon_user_id',$id)->first('receive_type');
// $receiveTypeId = $receiveType ? $receiveType->receive_type : $this->receive_type ;
$startTime = date('Y-m-d H:i:s',$form->model()->start_time);
$endTime = date('Y-m-d H:i:s',$form->model()->end_time);
$usableStartTime = date('Y-m-d H:i:s',$form->model()->usable_start_time);
$usableEndTime = date('YmdHis',$form->model()->usable_end_time);
// dd($usableEndTime);
}
$form->column(6,function(Form $form){
$form->text('title')->required()->maxLength(255,'最多只能输入500个字');
$form->textarea('introduce')->required();
$form->text('full_amount')->required()->floatTwo();
$form->text('discounts')->required()->floatTwo();
$form->radio('discount_type')->options(config('coupon.discount_type'))->default(1)->required();
$form->text('inventory')->required()->type('number')->attribute('min', 1)->default(1);
$form->text('weigh')->type('number')->attribute('min', 0)->default(0);
});
$form->column(6,function(Form $form){
$form->select('active_type')->options(config('coupon.active_type'))->default(1);
/* 领取方式 */
$form->hasMany('receive_type',function(NestedForm $form){
$receives = SettingModel::getReceiveTypeArray([]);
$form->select()->options();
});
// $receive = SettingModel::select('id','name')->where('category',1)->get()->keyBy('id')->toArray();
// $receive = $this->keyToValue($receive,'id','name');
// $form->select('receive_type')->options($receive)->value($receiveTypeId > 0? $receiveTypeId : 2);
$form->datetimeRange('start_time','end_time','活动时间')->required();
$form->datetimeRange('usable_start_time','usable_end_time','可用时间')->required()->rules('after:start_time',[
'after' => '可用时间必须比活动开始时间晚'
]);
// $form->datetime('start_time')->required()->value('2020-08-24T03:18:57.000000Z');
// $form->datetime('end_time')->required()->value($endTime);
// $form->datetime('usable_start_time')->required()->value($usableStartTime);
// $form->datetime('usable_end_time')->required()
// ->value(20200810121222)
// ->value('2020-08-10 10:10:00')
// ->value($usableEndTime)
// ->format('YYYY-MM-DD HH:mm:ss');
$form->select('type')->options(config('coupon.type'))->default(1)->disable();
$form->select('category')->options(config('coupon.category'))->default(1)->disable();
/* 目前默认全平台的市场 2020-08-20*/
$form->multipleSelect('market_ids')->options(['所有市场'])->disable();
/* 目前默认全平台的店铺分类 2020-08-20*/
$form->select('storetype_id')->options(['所有店铺类型'])->disable();
$form->radio('is_new_user')->options(config('coupon.is_new_user'))->default(2)->disable();
$form->text('remark')->maxLength(500,'最多只能输入500个字');
});
$form->column(12,function(Form $form){
});
/* 页面按钮 */
$form->disableResetButton();
/* 不显示字段 */
$form->hidden('id');
// $form->text('usable_number')->width(2)->default(1)->disable();
$form->saving(function (Form $form){
// var_dump($form->discount_type);
// dd($form->discounts);
if( $form->discount_type == 2 && ($form->discounts <= 0 || $form->discounts >= 10)){
return $form->error('优惠金额请输入1~10之间的数字');
}
// $this->receive_type = $form->receive_type;
// $form->deleteInput('receive_type');
});
$form->saved(function (Form $form, $result){
$id = $form->getKey();
// 判断是否是新增操作
if ($form->isCreating()) {
$id = $result;
if (! $result) {
return $form->error('数据保存失败');
}
}
if($form->isEditing()){
// 删除领取方式
$receiveTypeModel = ReceiveTypeModel::where('system_coupon_user_id',$id)->delete();
}
// 添加领取方式
$receiveModel = new ReceiveTypeModel();
$receiveModel->system_coupon_user_id = $id;
$receiveModel->receive_type = $this->receive_type;
// 获取一次可领取数量
$receiveNumber = SettingModel::select('value')->find($this->receive_type);
$receiveModel->one_receive_number = $receiveNumber ? $receiveNumber['value'] :1;
$receiveModel->save();
});
$form->deleting(function (Form $form) {
// 获取待删除行数据,这里获取的是一个二维数组
$data = $form->model()->toArray();
$model = couponModel::find($data[0]['id']);
// 修改优惠券状态
$model->status = -1;
$model->save();
});
});
}
/**
* 组装新数组
*/
public function keyToValue($array, $key, $value){
if(empty($array)){
return $array;
}
$newArray = [];
foreach($array as $v){
$newArray[$v[$key]] = $v[$value];
}
return $newArray;
}
}

8
app/Admin/Controllers/CouponTieController.php

@ -83,12 +83,4 @@ class CouponTieController extends AdminController
->body(new Card(new CouponTieForm()));
}
// /**
// * 服务商信息
// * @return \Illuminate\Http\JsonResponse
// */
// protected function getMpInfo()
// {
// }
}

60
app/Admin/Repositories/Coupon.php

@ -0,0 +1,60 @@
<?php
namespace App\Admin\Repositories;
use App\Models\Coupon as Model;
use Dcat\Admin\Grid\Model as GridModel;
use Dcat\Admin\Repositories\EloquentRepository;
use App\Models\CouponUse as CouponUseModel;
use Illuminate\Support\Facades\DB;
class Coupon extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = Model::class;
/**
* 查询Grid表格数据.
*
* @param Grid\Model $model
*
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator|Collection|array
*/
public function get(GridModel $model)
{
$this->setSort($model);
$this->setPaginate($model);
$query = $this->newQuery();
if ($this->relations) {
$query->with($this->relations);
}
$model->getQueries()->unique()->each(function ($value) use (&$query) {
if ($value['method'] == 'paginate') {
$value['arguments'][1] = $this->getGridColumns();
} elseif ($value['method'] == 'get') {
$value['arguments'] = [$this->getGridColumns()];
}
$query = call_user_func_array([$query, $value['method']], $value['arguments'] ?? []);
});
// dd(CouponUseModel::where('system_coupon_id',16)->sum('number'));
// $u = DB::table('ims_system_coupon_user_use')->where('system_coupon_id',16)->count('number');
// dd($u);
// $list = $query->toArray();
// foreach($list as &$value){
// // 查询使用数量
// $value['use_total'] = CouponUseModel::where('system_coupon_id',16)->count('number');
// dd( $value['use_total'] );
// }
return $query;
}
}

21
app/Admin/bootstrap.php

@ -73,3 +73,24 @@ JS
'data-floatTwo-error' => "只能输入数字(最多包含两位小数)"
]);
});
/* 验证-选择不同优惠类型时的优惠金额验证 */
Field\Text::macro('discount', function ( ?string $error = null) {
// 前端验证逻辑扩展
Admin::script(
<<<'JS'
Dcat.validator.extend('discount', function ($el) {
$discount_type = $('');
return !(/^(([1-9]{1}\d*)|(0{1}))(\.\d{0,2})?$/.test($el.val()));
});
JS
);
// 同时添加后端验证逻辑,这个可以看需要
// $this->rules('size:'.$length);
return $this->attribute([
'data-discount' => '1',
'data-discount-error' => "只能输入数字"
]);
});

2
app/Admin/routes.php

@ -35,7 +35,7 @@ Route::group([
$router->get('/coupon/TieForm', 'CouponTieController@CouponTieForm');
$router->get('/couponTie', 'CouponTieController@CouponTieList');
$router->resource('/couponSetting', 'couponSettingController');
$router->resource('/coupon', 'couponController');
//获取所有市场
$router->any('/api/getAllMarket', 'LanzuServiceSpeakerController@getAllMarkets');

146
app/Models/Coupon.php

@ -0,0 +1,146 @@
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
use App\Models\CouponSetting as SettingModel;
use App\Models\CouponReceiveType as ReceiveTypeModel;
class Coupon extends Model
{
use HasDateTimeFormatter;
use SoftDeletes;
protected $dateFormat = 'U';
// protected $timestamp = true;
protected $table = 'ims_system_coupon_user';
/* 查询记录数 limit */
protected $perPage = 10;
/* 添加转换字段 */
protected $appends = [
'status_text',
'type_text',
'category_text',
'is_new_user_text',
'discount_type_text',
'active_type_text',
'start_time_text',
'end_time_text',
'usable_start_time_text',
'usable_end_time_text',
// 'receive_type_text',
'created_at_text',
'updated_at_text'
];
public function getStatusTextAttribute()
{
$value = $this->status;
return isset(config('coupon.status')[$value])?config('coupon.status')[$value]:'';
}
public function getTypeTextAttribute()
{
$value = $this->type;
return isset(config('coupon.type')[$value])?config('coupon.type')[$value]:'';
}
public function getCategoryTextAttribute()
{
$value = $this->category;
return isset(config('coupon.category')[$value])?config('coupon.category')[$value]:'';
}
public function getIsNewUserTextAttribute()
{
$value = $this->is_new_user;
return isset(config('coupon.is_new_user')[$value])?config('coupon.is_new_user')[$value]:'';
}
public function getDiscountTypeTextAttribute()
{
$value = $this->discount_type;
return isset(config('coupon.discount_type')[$value])?config('coupon.discount_type')[$value]:'';
}
public function getActiveTypeTextAttribute()
{
$value = $this->active_type;
return isset(config('coupon.active_type')[$value])?config('coupon.active_type')[$value]:'';
}
public function getStartTimeTextAttribute()
{
$value = $this->start_time;
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getEndTimeTextAttribute()
{
$value = $this->usable_start_time;
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getUsableStartTimeTextAttribute()
{
$value = $this->start_time;
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getUsableEndTimeTextAttribute()
{
$value = $this->usable_end_time;
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getCreatedAtTextAttribute()
{
$value = $this->created_at;
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getUpdatedAtTextAttribute()
{
$value = $this->updated_at;
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getReceiveTypeTextAttribute()
{
$id = $this->getKey();
$receive = SettingModel::where('receive_type.system_coupon_user_id',$id)
->join('ims_system_coupon_user_receivetype as receive_type','receive_type.receive_type','ims_system_coupon_setting.id','inner')
->first('name');
return $receive ? $receive['name'] : '';
}
//关联领取方式表
public function receiveType()
{
return $this->hasOne(ReceiveTypeModel::class,'coupon_id','id');
}
// 设置
protected function setStartTimeAttribute($value)
{
$this->attributes['start_time'] = strtotime($value);
}
protected function setEndTimeAttribute($value)
{
$this->attributes['end_time'] = strtotime($value);
}
protected function setUsableStarttimeAttribute($value)
{
$this->attributes['usable_start_time'] = strtotime($value);
}
protected function setUsableEndTimeAttribute($value)
{
$this->attributes['usable_end_time'] = strtotime($value);
}
protected function setAddtimeAttribute($value)
{
$this->attributes['addtime'] = time();
}
protected function setUpdatetimeAttribute($value)
{
$this->attributes['updatetime'] = time();
}
}

18
app/Models/CouponReceiveType.php

@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use App\Models\CouponSetting as SettingModel;
use Illuminate\Database\Eloquent\Model;
class CouponReceiveType extends Model
{
use HasDateTimeFormatter;
protected $table = 'ims_system_coupon_user_receivetype';
protected $dateFormat = 'U';
public function setting(){
return $this->belongsTo(SettingModel::class,'receive_type','id','inner');
}
}

7
app/Models/CouponSetting.php

@ -3,14 +3,15 @@
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
class CouponSetting extends Model
{
use HasDateTimeFormatter;
// use SoftDeletes;
protected $table = 'ims_system_coupon_setting';
public function getReceiveTypeArray($where,$options = [])
{
}
}

14
app/Models/CouponUse.php

@ -0,0 +1,14 @@
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class CouponUse extends Model
{
use HasDateTimeFormatter;
protected $table = 'ims_system_coupon_user_use';
}

14
app/Models/StoreType.php

@ -0,0 +1,14 @@
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class StoreType extends Model
{
use HasDateTimeFormatter;
protected $table = 'ims_cjdc_storetype';
}

55
config/coupon.php

@ -0,0 +1,55 @@
<?php
return [
//优惠卷(用户)状态
'status'=>[
-1=> '已删除',
0=>'草稿',
1=>'正常',
2=>'已领完',
3=>'禁用',
],
'status_label'=>[
'default' => 'primary',
0 => 'info',
1 => 'success',
2 => 'warning',
3 => 'danger',
-1=> 'danger'
],
//优惠卷 - 类型 type
'type'=>[
1=>'全平台',
2=>'线上',
3=>'线下',
],
//优惠卷 - 分类 category
'category'=>[
1=>'订单'
],
//优惠卷 - 是否新用户
'is_new_user'=>[
1=>'是',
2=>'否',
],
//优惠卷 - 发布优惠卷时,间隔最少时间
'interval_time_min'=>3600,
//优惠卷 - 设置
'setting_category'=>[
1=>[
'name' => '领取类型',
'active' => true
],
],
//优惠卷 - 折扣类型
'discount_type'=>[
1=>'金额',
2=>'打折(%)',
],
//优惠卷 - 活动类型 active_type
'active_type'=>[
1=>'领取活动',
2=>'转发活动',
3=>'返券专用'
]
];

13
dcat_admin_ide_helper.php

@ -1155,6 +1155,9 @@ namespace Dcat\Admin {
* @property Grid\Column|Collection brand_name
* @property Grid\Column|Collection success
* @property Grid\Column|Collection error
* @property Grid\Column|Collection qrcode_path
* @property Grid\Column|Collection admin_user_id
* @property Grid\Column|Collection cs_id
* @property Grid\Column|Collection market_ids
* @property Grid\Column|Collection sub_title
* @property Grid\Column|Collection cover
@ -1282,6 +1285,7 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection repay(string $label = null)
* @method Grid\Column|Collection category(string $label = null)
* @method Grid\Column|Collection value(string $label = null)
* @method Grid\Column|Collection desc(string $label = null)
* @method Grid\Column|Collection store_id(string $label = null)
* @method Grid\Column|Collection store_name(string $label = null)
* @method Grid\Column|Collection new_user_total(string $label = null)
@ -2370,6 +2374,9 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection brand_name(string $label = null)
* @method Grid\Column|Collection success(string $label = null)
* @method Grid\Column|Collection error(string $label = null)
* @method Grid\Column|Collection qrcode_path(string $label = null)
* @method Grid\Column|Collection admin_user_id(string $label = null)
* @method Grid\Column|Collection cs_id(string $label = null)
* @method Grid\Column|Collection market_ids(string $label = null)
* @method Grid\Column|Collection sub_title(string $label = null)
* @method Grid\Column|Collection cover(string $label = null)
@ -3590,6 +3597,9 @@ namespace Dcat\Admin {
* @property Show\Field|Collection brand_name
* @property Show\Field|Collection success
* @property Show\Field|Collection error
* @property Show\Field|Collection qrcode_path
* @property Show\Field|Collection admin_user_id
* @property Show\Field|Collection cs_id
* @property Show\Field|Collection market_ids
* @property Show\Field|Collection sub_title
* @property Show\Field|Collection cover
@ -4805,6 +4815,9 @@ namespace Dcat\Admin {
* @method Show\Field|Collection brand_name(string $label = null)
* @method Show\Field|Collection success(string $label = null)
* @method Show\Field|Collection error(string $label = null)
* @method Show\Field|Collection qrcode_path(string $label = null)
* @method Show\Field|Collection admin_user_id(string $label = null)
* @method Show\Field|Collection cs_id(string $label = null)
* @method Show\Field|Collection market_ids(string $label = null)
* @method Show\Field|Collection sub_title(string $label = null)
* @method Show\Field|Collection cover(string $label = null)

2
public/vendors/dcat-admin/dcat/extra/select-table.js

@ -0,0 +1,2 @@
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var l=t[i]={i:i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(i,l,function(t){return e[t]}.bind(null,l));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=12)}({12:function(e,t,n){e.exports=n(13)},13:function(e,t){!function(e){function t(e){e=$.extend({dialog:null,container:null,input:null,button:".submit-btn",cancel:".cancel-btn",table:".async-table",multiple:!1,max:0,values:[],lang:{exceed_max_item:Dcat.lang.exceed_max_item||"已超出最大可选择的数量"}},e);this.options=e,this.$input=$(e.input),this.init()}t.prototype={init:function(){var e=this,t=e.options,n=t.values;for(var i in e.labels={},n)e.labels[n[i].id]=n[i].label;e.resetSelected(),$(document).on("dialog:shown",t.dialog,(function(){e.$dialog=$(t.dialog),e.$button=e.$dialog.find(t.button),e.$cancel=e.$dialog.find(t.cancel),e.$button.on("click",(function(){var t=e.getSelectedRows();e.setKeys(t[1]),e.render(t[0]),e.$dialog.trigger("dialog:close")})),e.$cancel.on("click",(function(){e.$dialog.trigger("dialog:close")})),e.bind()})),e.render(n)},bind:function(){var e=this,t=e.options;e.$dialog.find(t.table).on("table:loaded",(function(){var n=e.getCheckbox();t.multiple||$(this).find(".checkbox-grid-header").remove(),e.resetSelected(),n.on("change",(function(){var i=$(this).data("id"),l=$(this).data("label");if(this.checked){if(t.multiple||(e.selected={}),e.selected[i]={id:i,label:l},t.max&&e.getSelectedRows()[0].length>t.max)return $(this).prop("checked",!1),delete e.selected[i],Dcat.warning(e.options.lang.exceed_max_item)}else delete e.selected[i];t.multiple||this.checked&&n.each((function(){$(this).data("id")!=i&&($(this).prop("checked",!1),$(this).parents("tr").css("background-color",""))}))})),n.each((function(){var t=$(this),n=t.data("id");for(var i in e.labels[n]=t.data("label"),e.selected)n!=i||t.prop("checked",!0).trigger("change");t.trigger("change")}))}))},resetSelected:function(){var e=this.getKeys();for(var t in this.selected=[],e)this.selected[e[t]]={id:e[t],label:this.labels[e[t]]}},getCheckbox:function(){return this.$dialog.find('.checkbox-grid-column input[type="checkbox"]')},getSelectedRows:function(){var e=[],t=[];for(var n in this.selected)this.selected[n]&&(t.push(n),e.push(this.selected[n]));return[e,t]},render:function(e){var t=this.options,n=$(t.container),i=n.find(".default-text"),l=n.find(".option");return e&&e.length?(i.addClass("d-none"),l.removeClass("d-none"),t.multiple?function(e,t,n){var i=[],l=$(n.container),o=l.find(".default-text"),a=l.find(".option");l.hasClass("select2")||l.addClass("select2 select2-container select2-container--default select2-container--below");for(var c in l.removeClass("form-control"),e)i.push('<li class="select2-selection__choice" >\n '.concat(e[c].label,' <span data-id="').concat(e[c].id,'" class="select2-selection__choice__remove remove " role="presentation"> ×</span>\n</li>'));i.unshift('<span class="select2-selection__clear remove-all">×</span>'),i='<span class="select2-selection select2-selection--multiple">\n <ul class="select2-selection__rendered">'.concat(i.join(""),"</ul>\n </span>");var s=$(i);function r(){a.html(""),o.removeClass("d-none"),a.addClass("d-none"),l.addClass("form-control"),t.setKeys([])}a.html(s),s.find(".remove").on("click",(function(){var e=$(this);t.deleteKey(e.data("id")),e.parent().remove(),t.getKeys().length||r()})),s.find(".remove-all").on("click",r)}(e,this,t):function(e,t,n){var i=$(n.container),l=i.find(".default-text"),o=i.find(".option"),a=$("<div class='pull-right ' style='font-weight:bold;cursor:pointer'>×</div>");o.text(e[0].label),o.append(a),a.on("click",(function(){t.setKeys([]),l.removeClass("d-none"),o.addClass("d-none")}))}(e,this,t)):(i.removeClass("d-none"),l.addClass("d-none"),void(t.multiple&&n.addClass("form-control")))},setKeys:function(e){this.$input.val(e.length?e.join(","):"")},deleteKey:function(e){var t=this.getKeys(),n=[];for(var i in t)t[i]!=e&&n.push(t[i]);this.setKeys(n)},getKeys:function(){var e=this.$input.val();return e?String(e).split(","):[]}},Dcat.grid.SelectTable=function(e){return new t(e)}}(window)}});
//# sourceMappingURL=select-table.js.map

1
public/vendors/dcat-admin/dcat/extra/select-table.js.map
File diff suppressed because it is too large
View File

399
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css

@ -0,0 +1,399 @@
/*!
* Bootstrap Colorpicker - Bootstrap Colorpicker is a modular color picker plugin for Bootstrap 4.
* @package bootstrap-colorpicker
* @version v3.2.0
* @license MIT
* @link https://itsjavi.com/bootstrap-colorpicker/
* @link https://github.com/itsjavi/bootstrap-colorpicker.git
*/
.colorpicker {
position: relative;
display: none;
font-size: inherit;
color: inherit;
text-align: left;
list-style: none;
background-color: #ffffff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, 0.2);
padding: .75rem .75rem;
width: 148px;
border-radius: 4px;
-webkit-box-sizing: content-box;
box-sizing: content-box; }
.colorpicker.colorpicker-disabled,
.colorpicker.colorpicker-disabled * {
cursor: default !important; }
.colorpicker div {
position: relative; }
.colorpicker-popup {
position: absolute;
top: 100%;
left: 0;
float: left;
margin-top: 1px;
z-index: 1060; }
.colorpicker-popup.colorpicker-bs-popover-content {
position: relative;
top: auto;
left: auto;
float: none;
margin: 0;
z-index: initial;
border: none;
padding: 0.25rem 0;
border-radius: 0;
background: none;
-webkit-box-shadow: none;
box-shadow: none; }
.colorpicker:before,
.colorpicker:after {
content: "";
display: table;
clear: both;
line-height: 0; }
.colorpicker-clear {
clear: both;
display: block; }
.colorpicker:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: -7px;
left: auto;
right: 6px; }
.colorpicker:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
position: absolute;
top: -6px;
left: auto;
right: 7px; }
.colorpicker.colorpicker-with-alpha {
width: 170px; }
.colorpicker.colorpicker-with-alpha .colorpicker-alpha {
display: block; }
.colorpicker-saturation {
position: relative;
width: 126px;
height: 126px;
/* FF3.6+ */
/* Chrome,Safari4+ */
/* Chrome10+,Safari5.1+ */
/* Opera 11.10+ */
/* IE10+ */
background: -webkit-gradient(linear, left top, left bottom, from(transparent), to(black)), -webkit-gradient(linear, left top, right top, from(white), to(rgba(255, 255, 255, 0)));
background: linear-gradient(to bottom, transparent 0%, black 100%), linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%);
/* W3C */
cursor: crosshair;
float: left;
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
margin-bottom: 6px; }
.colorpicker-saturation .colorpicker-guide {
display: block;
height: 6px;
width: 6px;
border-radius: 6px;
border: 1px solid #000;
-webkit-box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
position: absolute;
top: 0;
left: 0;
margin: -3px 0 0 -3px; }
.colorpicker-hue,
.colorpicker-alpha {
position: relative;
width: 16px;
height: 126px;
float: left;
cursor: row-resize;
margin-left: 6px;
margin-bottom: 6px; }
.colorpicker-alpha-color {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%; }
.colorpicker-hue,
.colorpicker-alpha-color {
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
.colorpicker-hue .colorpicker-guide,
.colorpicker-alpha .colorpicker-guide {
display: block;
height: 4px;
background: rgba(255, 255, 255, 0.8);
border: 1px solid rgba(0, 0, 0, 0.4);
position: absolute;
top: 0;
left: 0;
margin-left: -2px;
margin-top: -2px;
right: -2px;
z-index: 1; }
.colorpicker-hue {
/* FF3.6+ */
/* Chrome,Safari4+ */
/* Chrome10+,Safari5.1+ */
/* Opera 11.10+ */
/* IE10+ */
background: -webkit-gradient(linear, left bottom, left top, from(red), color-stop(8%, #ff8000), color-stop(17%, yellow), color-stop(25%, #80ff00), color-stop(33%, lime), color-stop(42%, #00ff80), color-stop(50%, cyan), color-stop(58%, #0080ff), color-stop(67%, blue), color-stop(75%, #8000ff), color-stop(83%, magenta), color-stop(92%, #ff0080), to(red));
background: linear-gradient(to top, red 0%, #ff8000 8%, yellow 17%, #80ff00 25%, lime 33%, #00ff80 42%, cyan 50%, #0080ff 58%, blue 67%, #8000ff 75%, magenta 83%, #ff0080 92%, red 100%);
/* W3C */ }
.colorpicker-alpha {
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
background-size: 10px 10px;
background-position: 0 0, 5px 5px;
display: none; }
.colorpicker-bar {
min-height: 16px;
margin: 6px 0 0 0;
clear: both;
text-align: center;
font-size: 10px;
line-height: normal;
max-width: 100%;
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
.colorpicker-bar:before {
content: "";
display: table;
clear: both; }
.colorpicker-bar.colorpicker-bar-horizontal {
height: 126px;
width: 16px;
margin: 0 0 6px 0;
float: left; }
.colorpicker-input-addon {
position: relative; }
.colorpicker-input-addon i {
display: inline-block;
cursor: pointer;
vertical-align: text-top;
height: 16px;
width: 16px;
position: relative; }
.colorpicker-input-addon:before {
content: "";
position: absolute;
width: 16px;
height: 16px;
display: inline-block;
vertical-align: text-top;
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
background-size: 10px 10px;
background-position: 0 0, 5px 5px; }
.colorpicker.colorpicker-inline {
position: relative;
display: inline-block;
float: none;
z-index: auto;
vertical-align: text-bottom; }
.colorpicker.colorpicker-horizontal {
width: 126px;
height: auto; }
.colorpicker.colorpicker-horizontal .colorpicker-bar {
width: 126px; }
.colorpicker.colorpicker-horizontal .colorpicker-saturation {
float: none;
margin-bottom: 0; }
.colorpicker.colorpicker-horizontal .colorpicker-hue,
.colorpicker.colorpicker-horizontal .colorpicker-alpha {
float: none;
width: 126px;
height: 16px;
cursor: col-resize;
margin-left: 0;
margin-top: 6px;
margin-bottom: 0; }
.colorpicker.colorpicker-horizontal .colorpicker-hue .colorpicker-guide,
.colorpicker.colorpicker-horizontal .colorpicker-alpha .colorpicker-guide {
position: absolute;
display: block;
bottom: -2px;
left: 0;
right: auto;
height: auto;
width: 4px; }
.colorpicker.colorpicker-horizontal .colorpicker-hue {
/* FF3.6+ */
/* Chrome,Safari4+ */
/* Chrome10+,Safari5.1+ */
/* Opera 11.10+ */
/* IE10+ */
background: -webkit-gradient(linear, right top, left top, from(red), color-stop(8%, #ff8000), color-stop(17%, yellow), color-stop(25%, #80ff00), color-stop(33%, lime), color-stop(42%, #00ff80), color-stop(50%, cyan), color-stop(58%, #0080ff), color-stop(67%, blue), color-stop(75%, #8000ff), color-stop(83%, magenta), color-stop(92%, #ff0080), to(red));
background: linear-gradient(to left, red 0%, #ff8000 8%, yellow 17%, #80ff00 25%, lime 33%, #00ff80 42%, cyan 50%, #0080ff 58%, blue 67%, #8000ff 75%, magenta 83%, #ff0080 92%, red 100%);
/* W3C */ }
.colorpicker.colorpicker-horizontal .colorpicker-alpha {
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
background-size: 10px 10px;
background-position: 0 0, 5px 5px; }
.colorpicker-inline:before,
.colorpicker-no-arrow:before,
.colorpicker-popup.colorpicker-bs-popover-content:before {
content: none;
display: none; }
.colorpicker-inline:after,
.colorpicker-no-arrow:after,
.colorpicker-popup.colorpicker-bs-popover-content:after {
content: none;
display: none; }
.colorpicker-alpha,
.colorpicker-saturation,
.colorpicker-hue {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.colorpicker.colorpicker-visible,
.colorpicker-alpha.colorpicker-visible,
.colorpicker-saturation.colorpicker-visible,
.colorpicker-hue.colorpicker-visible,
.colorpicker-bar.colorpicker-visible {
display: block; }
.colorpicker.colorpicker-hidden,
.colorpicker-alpha.colorpicker-hidden,
.colorpicker-saturation.colorpicker-hidden,
.colorpicker-hue.colorpicker-hidden,
.colorpicker-bar.colorpicker-hidden {
display: none; }
.colorpicker-inline.colorpicker-visible {
display: inline-block; }
.colorpicker.colorpicker-disabled:after {
border: none;
content: '';
display: block;
width: 100%;
height: 100%;
background: rgba(233, 236, 239, 0.33);
top: 0;
left: 0;
right: auto;
z-index: 2;
position: absolute; }
.colorpicker.colorpicker-disabled .colorpicker-guide {
display: none; }
/** EXTENSIONS **/
.colorpicker-preview {
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
background-size: 10px 10px;
background-position: 0 0, 5px 5px; }
.colorpicker-preview > div {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%; }
.colorpicker-bar.colorpicker-swatches {
-webkit-box-shadow: none;
box-shadow: none;
height: auto; }
.colorpicker-swatches--inner {
clear: both;
margin-top: -6px; }
.colorpicker-swatch {
position: relative;
cursor: pointer;
float: left;
height: 16px;
width: 16px;
margin-right: 6px;
margin-top: 6px;
margin-left: 0;
display: block;
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
background-size: 10px 10px;
background-position: 0 0, 5px 5px; }
.colorpicker-swatch--inner {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%; }
.colorpicker-swatch:nth-of-type(7n+0) {
margin-right: 0; }
.colorpicker-with-alpha .colorpicker-swatch:nth-of-type(7n+0) {
margin-right: 6px; }
.colorpicker-with-alpha .colorpicker-swatch:nth-of-type(8n+0) {
margin-right: 0; }
.colorpicker-horizontal .colorpicker-swatch:nth-of-type(6n+0) {
margin-right: 0; }
.colorpicker-horizontal .colorpicker-swatch:nth-of-type(7n+0) {
margin-right: 6px; }
.colorpicker-horizontal .colorpicker-swatch:nth-of-type(8n+0) {
margin-right: 6px; }
.colorpicker-swatch:last-of-type:after {
content: "";
display: table;
clear: both; }
*[dir='rtl'] .colorpicker-element input,
.colorpicker-element[dir='rtl'] input,
.colorpicker-element input[dir='rtl'] {
direction: ltr;
text-align: right; }
/*# sourceMappingURL=bootstrap-colorpicker.css.map */

1
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css.map
File diff suppressed because it is too large
View File

10
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css
File diff suppressed because it is too large
View File

1
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css.map
File diff suppressed because it is too large
View File

6252
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js
File diff suppressed because it is too large
View File

1
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js.map
File diff suppressed because it is too large
View File

10
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js
File diff suppressed because it is too large
View File

1
public/vendors/dcat-admin/dcat/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js.map
File diff suppressed because it is too large
View File

BIN
public/vendors/dcat-admin/images/pages/login/bg.jpg

After

Width: 1681  |  Height: 945  |  Size: 111 KiB

BIN
public/vendors/dcat-admin/images/waves.png

After

Width: 300  |  Height: 70  |  Size: 12 KiB

47
resources/lang/zh-CN/coupon.php

@ -0,0 +1,47 @@
<?php
return [
'labels' => [
'Coupon' => '优惠券管理',
'coupon' => '优惠券管理',
],
'fields' => [
'title' => '标题',
'introduce' => '介绍',
'start_time' => '活动开始时间',
'end_time' => '活动结束时间',
'start_time_text' => '活动开始时间',
'end_time_text' => '活动结束时间',
'full_amount' => '满金额',
'discounts' => '优惠金额',
'is_new_user' => '是否新用户',
'is_new_user_text' => '是否新用户',
'inventory' => '发放数量',
'inventory_use' => '已领取数量',
'type' => '类型',
'type_text' => '类型',
'market_id' => '市场',
'storetype_id' => '店铺类型',
'category' => '分类',
'category_text' => '分类',
'active_type' => '活动类型',
'active_type_text' => '活动类型',
'status' => '状态',
'status_text' => '状态',
'remark' => '备注',
'weigh' => '排序',
'usable_number' => '用户一次可使用数量',
'usable_start_time' => '可用开始时间',
'usable_end_time' => '可用结束时间',
'discount_type' => '优惠类型',
'usable_start_time_text' => '可用开始时间',
'usable_end_time_text' => '可用结束时间',
'discount_type_text' => '优惠类型',
'receive_type' => '领取方式',
'receive_type_text' => '领取方式',
'created_at_text' => '创建时间',
'updated_at_text' => '更新时间',
'use_number' => '已使用数量'
],
'options' => [
],
];
Loading…
Cancel
Save