添加:消费返利插件
This commit is contained in:
parent
762e93bd33
commit
72118a360f
|
|
@ -0,0 +1 @@
|
|||
## 消费返利
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
app\common\events\PluginWasEnabled::class => 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']);
|
||||
}
|
||||
];
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
$.extend($.locales['en'], {
|
||||
'welfare': {
|
||||
test: "JavaScript i18n test: English"
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'title'=>'this is test title'
|
||||
];
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
$.extend($.locales['zh-CN'], {
|
||||
'welfare': {
|
||||
test: "JavaScript i18n test: 简体中文"
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'title'=>'测试标题'
|
||||
];
|
||||
|
|
@ -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"
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
namespace Yunshop\Rebate;
|
||||
|
||||
class PluginApplication extends \app\common\services\PluginApplication{
|
||||
|
||||
protected function setMenuConfig(){
|
||||
|
||||
\app\backend\modules\menu\Menu::current()->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');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
namespace Yunshop\Rebate\admin;
|
||||
|
||||
|
||||
use app\common\components\BaseController;
|
||||
use app\common\facades\Setting;
|
||||
use app\common\helpers\PaginationHelper;
|
||||
use Yunshop\CollectionRoom\models\CollectionRoomModel;
|
||||
|
||||
class IndexController extends BaseController{
|
||||
// 进入列表
|
||||
public function index(){
|
||||
//参数获取
|
||||
$pageSize = request()->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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<script src="{!!resource_absolute('static/js/xlsx.full.min.js')!!}"></script>
|
||||
@extends('layouts.base')
|
||||
<style>
|
||||
.user{
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
overflow: hidden;
|
||||
height: 80px;
|
||||
}
|
||||
.user .user-avatar{
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
margin-right: 5px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.user .user-avatar .avatar-image{
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.user .user-info{
|
||||
height: 50px;
|
||||
text-align: left;
|
||||
}
|
||||
.user .user-info .user-nickname{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user .user-info .user-status{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
@section('content')
|
||||
<div class="w1200 m0a" id="storeManagerIndex">
|
||||
{{--顶部搜索--}}
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-body">
|
||||
<form action="" method="post" class="form-horizontal" role="form" id="form1">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-11 col-xs-12">
|
||||
<div class="row row-fix tpl-category-container" >
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[member_id]" id="" type="text" value="{{ $search['member_id'] }}" placeholder="用户ID">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[nickname]" id="" type="text" value="{{ $search['nickname'] }}" placeholder="用户昵称|真实姓名">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[unique_number]" id="" type="text" value="{{ $search['unique_number'] }}" placeholder="唯一编号">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-6">
|
||||
<button class="btn btn-success" id="search"><i class="fa fa-search"></i> 搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{--信息列表--}}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body" style="padding-top: 0;margin-bottom: 30px;overflow: auto;padding-right: 30px;">
|
||||
<table class="table" style="min-width:1500px;overflow: auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;width: 80px;">ID</th>
|
||||
<th style="text-align:center;">用户信息</th>
|
||||
<th style="text-align:center;">唯一编号</th>
|
||||
<th style="text-align:center;">获得时间</th>
|
||||
<th style="text-align:center;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($list as $item)
|
||||
<tr style="height: 50px;">
|
||||
<td style="text-align:center;">{{ $item['id'] }}</td>
|
||||
<td style="text-align:center;" >
|
||||
<div class="user">
|
||||
<div class="user-avatar">
|
||||
<img class="avatar-image" src="{{$item['member']['avatar_image']}}" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="user-nickname">{{ $item['member']['username'] ? : $item['member']['nickname'] }}</div>
|
||||
<div class="user-status">ID:{{ $item['member']['uid'] }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td style="text-align:center;">{{ $item['unique_number'] }}</td>
|
||||
<td style="text-align:center;">{{ $item['created_at'] }}</td>
|
||||
<td style="text-align:center;">
|
||||
<button onclick="updateNumber({{$item['id']}})" type="button" class="btn btn-info btn-sm">修改编号</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{!! $pager !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// 修改编号
|
||||
function updateNumber(id){
|
||||
let link = "{{yzWebUrl('plugin.collection-room.admin.index.update-number')}}" + `&id=${id}`;
|
||||
let popup = util.ajaxshow(link,'修改唯一编号',{
|
||||
width: $(window).width() * 0.8 > 1200 ? $(window).width() * 0.8 : 1200,
|
||||
height: $(window).height() * 0.8 > 1200 ? $(window).height() * 0.8 : 1200,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
@extends('layouts.base')
|
||||
@section('title', '基本设置')
|
||||
@section('content')
|
||||
<link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
|
||||
<link rel="stylesheet" href="{{static_url('css/public-number.css')}}">
|
||||
<style></style>
|
||||
<div class="all">
|
||||
<div id="app">
|
||||
<el-form :model="set" label-width="15%">
|
||||
<div class="vue-head">
|
||||
<div class="vue-main-title">
|
||||
<div class="vue-main-title-left"></div>
|
||||
<div class="vue-main-title-content">基本设置</div>
|
||||
</div>
|
||||
<div class="vue-main-form">
|
||||
<el-form-item label="字画名称">
|
||||
<el-input placeholder="请输入字画名称" v-model="set.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="典藏室顶部图片" prop="top_thumb">
|
||||
<div class="upload-box" @click="openUpload('top_thumb')" v-if="!set.top_thumb">
|
||||
<i class="el-icon-plus" style="font-size:32px"></i>
|
||||
</div>
|
||||
<div @click="openUpload('top_thumb')" class="upload-boxed" v-if="set.top_thumb">
|
||||
<img :src="set.top_thumb" alt="" style="width:150px;height:150px;border-radius: 5px;cursor: pointer;">
|
||||
<i class="el-icon-close" @click.stop="clearImg('top_thumb')" title="点击清除图片"></i>
|
||||
<div class="upload-boxed-text">点击重新上传</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="高仿画图片" prop="imitation">
|
||||
<div class="upload-box" @click="openUpload('imitation')" v-if="!set.imitation">
|
||||
<i class="el-icon-plus" style="font-size:32px"></i>
|
||||
</div>
|
||||
<div @click="openUpload('imitation')" class="upload-boxed" v-if="set.imitation">
|
||||
<img :src="set.imitation" alt="" style="width:150px;height:150px;border-radius: 5px;cursor: pointer;">
|
||||
<i class="el-icon-close" @click.stop="clearImg('imitation')" title="点击清除图片"></i>
|
||||
<div class="upload-boxed-text">点击重新上传</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="数藏画图片" prop="collection">
|
||||
<div class="upload-box" @click="openUpload('collection')" v-if="!set.collection">
|
||||
<i class="el-icon-plus" style="font-size:32px"></i>
|
||||
</div>
|
||||
<div @click="openUpload('collection')" class="upload-boxed" v-if="set.collection">
|
||||
<img :src="set.collection" alt="" style="width:150px;height:150px;border-radius: 5px;cursor: pointer;">
|
||||
<i class="el-icon-close" @click.stop="clearImg('collection')" title="点击清除图片"></i>
|
||||
<div class="upload-boxed-text">点击重新上传</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<upload-img :upload-show="uploadShow" :name="chooseImgName" @replace="changeProp" @sure="sureImg"></upload-img>
|
||||
</div>
|
||||
</div>
|
||||
@include('public.admin.uploadImg')
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el:"#app",
|
||||
delimiters: ['[[', ']]'],
|
||||
name: 'test',
|
||||
data() {
|
||||
return{
|
||||
// 图片上传
|
||||
uploadShow:false,
|
||||
chooseImgName:'',
|
||||
chooseIndex:-1,
|
||||
type:0,
|
||||
// 设置信息
|
||||
set:{
|
||||
title: "{{ $set['title'] ?? '' }}",
|
||||
top_thumb: "{{ $set['top_thumb'] ?? '' }}",
|
||||
imitation: "{{ $set['imitation'] ?? '' }}",
|
||||
collection: "{{ $set['collection'] ?? '' }}",
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 点击选择图片
|
||||
openUpload(str,index,type) {
|
||||
this.chooseImgName = str;
|
||||
this.uploadShow = true;
|
||||
this.chooseIndex = index;
|
||||
this.type = '2';
|
||||
},
|
||||
// 图片弹框显示隐藏改变
|
||||
changeProp(val) {
|
||||
if(val == true) this.uploadShow = false;
|
||||
else this.uploadShow = true;
|
||||
},
|
||||
// 图片选中
|
||||
sureImg(name,image,img_url) {
|
||||
this.set[name] = img_url;
|
||||
},
|
||||
// 删除图片
|
||||
clearImg(name) {
|
||||
this.set[name] = '';
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 提交
|
||||
onSubmit() {
|
||||
let _this = this;
|
||||
_this.$http.post('{!! yzWebFullUrl('plugin.collection-room.admin.index.set') !!}', {
|
||||
collection_room: _this.set
|
||||
}).then(function (response) {
|
||||
let res = response.body;
|
||||
_this.$message({
|
||||
message: res.msg,
|
||||
type: res.result == 1 ? 'success' : 'error'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
||||
Loading…
Reference in New Issue