feat: 后台完善
parent
56eb126cfb
commit
23976b7c3b
|
@ -70,20 +70,4 @@ class BusinessTeam extends AdminBase
|
|||
}
|
||||
return JsonServer::error(BusinessTeamLogic::getError());
|
||||
}
|
||||
|
||||
// public function set()
|
||||
// {
|
||||
// if($this->request->isAjax()) {
|
||||
// $post = $this->request->post();
|
||||
// ConfigServer::set('user_level', 'intro', $post['intro']);
|
||||
// return JsonServer::success('设置成功');
|
||||
// }
|
||||
// $intro = ConfigServer::get('user_level', 'intro');
|
||||
// $intro_default = config('default.user_level.intro');
|
||||
//
|
||||
// return view('', [
|
||||
// 'intro' => $intro,
|
||||
// 'intro_default' => $intro_default
|
||||
// ]);
|
||||
// }
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
namespace app\admin\controller\user;
|
||||
|
||||
use app\admin\logic\user\BusinessTeamLogic;
|
||||
use app\admin\logic\user\TagLogic;
|
||||
use app\api\logic\LoginLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\user\LevelLogic;
|
||||
use app\admin\logic\user\UserLogic;
|
||||
|
@ -10,6 +12,7 @@ use app\common\server\JsonServer;
|
|||
use app\common\enum\ClientEnum;
|
||||
use app\admin\validate\user\UserValidate;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Validate;
|
||||
|
||||
class User extends AdminBase
|
||||
{
|
||||
|
@ -22,10 +25,56 @@ class User extends AdminBase
|
|||
return view('', [
|
||||
'level_list' => LevelLogic::getLevelList(),
|
||||
'tag_list' => TagLogic::getTagList(),
|
||||
'client_list' => ClientEnum::getClient(true)
|
||||
'client_list' => ClientEnum::getClient(true),
|
||||
'team_list' => BusinessTeamLogic::getBusinessTeamList()
|
||||
]);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
try{
|
||||
$input = input('post.');
|
||||
|
||||
$rule = [
|
||||
'password|密码' => 'require|min:2|max:50',
|
||||
'password_confirm|确认密码' => 'require|min:2|max:50',
|
||||
'phone|手机' => 'require|mobile',
|
||||
];
|
||||
|
||||
$validate = Validate::rule($rule);
|
||||
if (!$validate->check($input)) {
|
||||
return JsonServer::error($validate->getError());
|
||||
}
|
||||
|
||||
if ($input['password'] != $input['password_confirm']) {
|
||||
return JsonServer::error('两次密码不一致');
|
||||
}
|
||||
|
||||
if (\app\common\model\user\User::where('mobile', $input['phone'])->where('del', 0)->count()>0) {
|
||||
return JsonServer::error('此手机号已被使用');
|
||||
}
|
||||
$post = [
|
||||
'mobile' => $input['phone'],
|
||||
'password' => $input['password'],
|
||||
'client' => ClientEnum::backend,
|
||||
];
|
||||
LoginLogic::register($post);
|
||||
if (!empty(LoginLogic::getError())) {
|
||||
return JsonServer::error(LoginLogic::getError());
|
||||
}
|
||||
return JsonServer::success('添加成功');
|
||||
}catch(ValidateException $e) {
|
||||
return JsonServer::error($e->getError());
|
||||
}catch(\Exception $e) {
|
||||
return JsonServer::error($e->getMessage());
|
||||
}
|
||||
|
||||
return JsonServer::error('添加失败');
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
public function setTag(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
|
@ -65,7 +114,8 @@ class User extends AdminBase
|
|||
|
||||
return view('', [
|
||||
'info' => $detail,
|
||||
'tag_list' => json_encode(TagLogic::getTagList())
|
||||
'tag_list' => json_encode(TagLogic::getTagList()),
|
||||
'team_list' => json_encode(BusinessTeamLogic::getBusinessTeamList([$id]))
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,12 +70,17 @@ class BusinessTeamLogic extends Logic
|
|||
}
|
||||
}
|
||||
|
||||
public static function getBusinessTeamList()
|
||||
public static function getBusinessTeamList($selected = [])
|
||||
{
|
||||
$levelArr = BusinessTeam::field('id,name,phone')
|
||||
->order('id desc')
|
||||
->select()
|
||||
->toArray();
|
||||
$levelArr[0] = ['id'=>0, 'name'=>'暂无团队', 'phone' => ''];
|
||||
foreach ($levelArr as &$item) {
|
||||
if (in_array($item['id'], $selected)) {
|
||||
$item['selected'] = true;
|
||||
}
|
||||
}
|
||||
return $levelArr;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ class UserLogic extends Logic
|
|||
{
|
||||
$field = [
|
||||
'id', 'sn','nickname','avatar','mobile','sex','birthday','tag_ids',
|
||||
'remark','user_money','user_growth','user_integral','earnings', 'disable'
|
||||
'remark','user_money','user_growth','user_integral','earnings', 'disable', 'team_id'
|
||||
];
|
||||
$user = User::field($field)->where(['del' => 0, 'id' => $id])->findOrEmpty();
|
||||
|
||||
|
@ -161,6 +161,8 @@ class UserLogic extends Logic
|
|||
}
|
||||
// 会员标签
|
||||
$user['tag_ids'] = json_encode(explode(',', $user['tag_ids']));
|
||||
// 业务团队
|
||||
$user['team_ids'] = json_encode(explode(',', $user['team_id']));
|
||||
|
||||
return $user->toArray();
|
||||
}
|
||||
|
@ -175,6 +177,7 @@ class UserLogic extends Logic
|
|||
'mobile' => $post['mobile'],
|
||||
'birthday' => strtotime($post['birthday']),
|
||||
'tag_ids' => $post['select'],
|
||||
'team_id' => $post['team_id'] ?? 0,
|
||||
'remark' => $post['remark'],
|
||||
'disable' => $post['disable'],
|
||||
'update_time' => time()
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label {
|
||||
color: #6a6f6c;
|
||||
width: 100px;
|
||||
}
|
||||
.layui-input-block {
|
||||
margin-left: 130px;
|
||||
}
|
||||
.tips{
|
||||
color: red;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-user_level" id="layuiadmin-form-user_level" style="padding: 20px 30px 0 0;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="tips">*</span>名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="padding-bottom: 20px;">
|
||||
<label class="layui-form-label"><span class="tips">*</span>手机:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="phone" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="add-user_level-submit" id="add-user_level-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
|
@ -1,171 +0,0 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label{
|
||||
width: 90px;
|
||||
}
|
||||
.reqRed::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="adjust" id="layuiadmin-form-user" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" value="{$info.id}" name="id">
|
||||
<input type="hidden" value="money" name="type" id="type">
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-tab layui-tab-card" lay-filter="adjust">
|
||||
<ul class="layui-tab-title">
|
||||
<li data-type="money" class="layui-this">不可提现金额调整</li>
|
||||
<li data-type="growth" >成长值调整</li>
|
||||
<li data-type="integral" >积分调整</li>
|
||||
<li data-type="earnings" >佣金调整</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" >
|
||||
<!--不可提现金额调整-->
|
||||
<div class="layui-tab-item layui-show " >
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前余额:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$info.user_money}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">余额增减:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="money_handle" value="1" title="增加余额">
|
||||
<input type="radio" name="money_handle" value="0" title="扣减余额">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">调整余额:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" min="0" name="money" value="" lay-verify="" lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
|
||||
<label class="layui-form-mid layui-word-aux">请输入调整的余额金额</label>
|
||||
</div>
|
||||
<label class="layui-form-mid">元</label>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">备注:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea type="text" name="money_remark" autocomplete="off" class="layui-textarea" style="width: 30%;"></textarea>
|
||||
<label class="layui-form-mid layui-word-aux" style="margin-left: 10px;">不超过100字</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--成长值调整-->
|
||||
<div class="layui-tab-item">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前成长值:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$info.user_growth}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">成长值增减:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="growth_handle" value="1" title="增加成长值">
|
||||
<input type="radio" name="growth_handle" value="0" title="扣减成长值">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">调整成长值:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" min="0" name="growth" value="" lay-verify="" lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
|
||||
<label class="layui-form-mid layui-word-aux">请输入调整的成长值</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">备注:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea type="text" name="growth_remark" autocomplete="off" class="layui-textarea" style="width: 30%;"></textarea>
|
||||
<label class="layui-form-mid layui-word-aux" style="margin-left: 10px;">不超过100字</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--积分调整-->
|
||||
<div class="layui-tab-item">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前积分:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$info.user_integral}</label>
|
||||
<input type="hidden" value="{$info.user_integral}" name="now_integral">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">积分增减:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="integral_handle" value="1" title="增加积分">
|
||||
<input type="radio" name="integral_handle" value="0" title="扣减积分">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">调整积分:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="integral" value="" lay-verify="" lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
|
||||
<label class="layui-form-mid layui-word-aux">请输入调整的积分数量</label>
|
||||
</div>
|
||||
<label class="layui-form-mid">分</label>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">备注:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea type="text" name="integral_remark" autocomplete="off" class="layui-textarea" style="width: 30%;"></textarea>
|
||||
<label class="layui-form-mid layui-word-aux" style="margin-left: 10px;">不超过100字</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--佣金调整-->
|
||||
<div class="layui-tab-item " >
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前佣金:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$info.earnings}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">佣金增减:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="earnings_handle" value="1" title="增加佣金">
|
||||
<input type="radio" name="earnings_handle" value="0" title="扣减佣金">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">调整佣金:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="earnings" value="" lay-verify="" lay-vertype="tips" placeholder="" autocomplete="off" class="layui-input">
|
||||
<label class="layui-form-mid layui-word-aux">请输入调整的金额</label>
|
||||
</div>
|
||||
<label class="layui-form-mid">元</label>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">备注:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea type="text" name="earnings_remark" autocomplete="off" class="layui-textarea" style="width: 30%;"></textarea>
|
||||
<label class="layui-form-mid layui-word-aux" style="margin-left: 10px;">不超过100字</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="adjust_user-submit" id="adjust_user-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).use(['form', 'element'], function(){
|
||||
var $ = layui.$,form = layui.form ;
|
||||
var element = layui.element;
|
||||
|
||||
element.on('tab(adjust)', function(){
|
||||
$('#type').val($(this).attr('data-type'));
|
||||
});
|
||||
})
|
||||
</script>
|
|
@ -1,87 +0,0 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label{
|
||||
width: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
.reqRed::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-form" style="padding: 20px 30px 0 0;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户编号:</label>
|
||||
<div class="layui-input-block">
|
||||
<label class="layui-form-label">{$user.sn}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户昵称:</label>
|
||||
<div class="layui-input-block">
|
||||
<label class="layui-form-label">{$user.nickname}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前推荐人:</label>
|
||||
<div class="layui-input-block">
|
||||
{if is_array($first_leader)}
|
||||
<label class="layui-form-label">{$first_leader.nickname}({$first_leader.sn})</label>
|
||||
{else}
|
||||
<label class="layui-form-label">{$first_leader}</label>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">调整方式:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="type" value="assign" title="指定推荐人" checked>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="type" value="system" title="设置推荐人为系统">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">选择推荐人:</label>
|
||||
<div class="layui-inline">
|
||||
<span id="user_selected"></span>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm layui-bg-blue" id="show-user">选择用户</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" value="{$user_id}" name="id">
|
||||
<input type="hidden" name="first_id" id="first_id">
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="formSubmit" id="formSubmit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).use(['form', 'element'], function(){
|
||||
var $ = layui.$,form = layui.form ;
|
||||
var element = layui.element;
|
||||
|
||||
$('#show-user').click(function() {
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: "选择用户"
|
||||
,content: "{:url('user.user/userLists')}"
|
||||
,area: ["90%", "90%"]
|
||||
,btn: ["确定", "取消"]
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window["layui-layer-iframe" + index];
|
||||
let user_selected = iframeWindow.user_selected();
|
||||
$('#user_selected').html(user_selected.nickname + '(' + user_selected.sn + ')');
|
||||
$('#first_id').val(user_selected.id);
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
})
|
||||
</script>
|
|
@ -1,52 +0,0 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label{
|
||||
width: 90px;
|
||||
text-align: left;
|
||||
}
|
||||
.reqRed::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-form" style="padding: 20px 30px 0 0;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前等级:</label>
|
||||
<div class="layui-input-block">
|
||||
<label class="layui-form-label">{$user_level_name}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">调整等级:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="level">
|
||||
{foreach $levels as $item}
|
||||
<option value="{$item.id}">{$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">备注:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea type="text" name="remark" autocomplete="off" class="layui-textarea" style="width: 30%;"></textarea>
|
||||
<label class="layui-form-mid layui-word-aux" style="margin-left: 10px;">不超过100字</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" value="{$user_id}" name="id">
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="formSubmit" id="formSubmit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).use(['form', 'element'], function(){
|
||||
var $ = layui.$,form = layui.form ;
|
||||
var element = layui.element;
|
||||
|
||||
})
|
||||
</script>
|
|
@ -1,130 +1,36 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.reqRed::before {
|
||||
content: '*';
|
||||
.layui-form-label {
|
||||
color: #6a6f6c;
|
||||
width: 100px;
|
||||
}
|
||||
.layui-input-block {
|
||||
margin-left: 130px;
|
||||
}
|
||||
.tips{
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-user" id="layuiadmin-form-user" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" name="id" value="{$info.id}">
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-user_level" id="layuiadmin-form-user_level" style="padding: 20px 30px 0 0;">
|
||||
<input type="hidden" name="id" value="{$detail.id}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户编号:</label>
|
||||
<div class="layui-input-inline" style="margin-top:10px">
|
||||
{$info.sn}
|
||||
<label class="layui-form-label"><span class="tips">*</span>名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" value="{$detail.name}" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">用户昵称:</label>
|
||||
<div class="layui-input-inline" style="width: 380px;">
|
||||
<input class="layui-input" value="{$info.nickname}" name="nickname" type="text" placeholder="请输入会员昵称" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label reqRed">用户头像:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="like-upload-image">
|
||||
{if $info.avatar}
|
||||
<div class="upload-image-div">
|
||||
<img src="{$info.avatar}" alt="img">
|
||||
<input type="hidden" name="avatar" value="{$info.avatar}">
|
||||
<div class="del-upload-btn">x</div>
|
||||
</div>
|
||||
<div class="upload-image-elem" style="display:none;"><a class="add-upload-image" id="avatar"> + 添加图片</a></div>
|
||||
{else}
|
||||
<div class="upload-image-elem"><a class="add-upload-image" id="avatar"> + 添加图片</a></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片</span>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">手机号码:</label>
|
||||
<div class="layui-input-inline" style="width: 380px;">
|
||||
<input class="layui-input" value="{$info.mobile}" name="mobile" type="text" placeholder="请输入手机号码" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">性别:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="sex" value="0" title="未知" {if $info.sex == 0}checked{/if} >
|
||||
<input type="radio" name="sex" value="1" title="男" {if $info.sex == 1}checked{/if} >
|
||||
<input type="radio" name="sex" value="2" title="女" {if $info.sex == 2}checked{/if} >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">禁用状态:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="disable" value="0" title="启用" {if $info.disable == 0}checked{/if} >
|
||||
<input type="radio" name="disable" value="1" title="禁用" {if $info.disable == 1}checked{/if} >
|
||||
</div>
|
||||
<div class=" layui-form-mid layui-word-aux">禁用后用户将无法正常登录</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">生日:</label>
|
||||
<div class="layui-input-inline" style="width: 380px;">
|
||||
<input class="layui-input" value="{$info.birthday}" autocomplete="off" name="birthday" id="birthday" type="text" placeholder="请输入生日" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">会员标签</label>
|
||||
<div class="layui-input-block" style="width: 380px;">
|
||||
<div id="tagList"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">备注</label>
|
||||
<div class="layui-input-block" style="width: 380px">
|
||||
<textarea name="remark" class="layui-textarea"></textarea>
|
||||
<div class="layui-form-item" style="padding-bottom: 20px;">
|
||||
<label class="layui-form-label"><span class="tips">*</span>手机:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="phone" value="{$detail.phone}" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="edit-submit" id="edit-submit" value="确认">
|
||||
<input type="button" lay-submit lay-filter="edit-user_level-submit" id="edit-user_level-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).extend({
|
||||
xmSelect: 'xmSelect/xm-select'
|
||||
}).use(['form','laydate', 'xmSelect'], function(){
|
||||
var $ = layui.$,form = layui.form,laydate = layui.laydate;
|
||||
var xmSelect = layui.xmSelect;
|
||||
var tag_list = '{$tag_list|raw}';
|
||||
var initValue = '{$info.tag_ids | raw}';
|
||||
|
||||
laydate.render({
|
||||
elem: '#birthday'
|
||||
,format: 'yyyy-MM-dd'
|
||||
,value: "{$info['birthday']}"
|
||||
,trigger: 'click'
|
||||
});
|
||||
|
||||
var xmIns = xmSelect.render({
|
||||
el: '#tagList',
|
||||
language: 'zn',
|
||||
data: JSON.parse(tag_list),
|
||||
prop: {
|
||||
value: 'id'
|
||||
},
|
||||
initValue: JSON.parse(initValue)
|
||||
})
|
||||
|
||||
// 图片上传
|
||||
like.delUpload();
|
||||
$(document).on("click", "#avatar", function () {
|
||||
like.imageUpload({
|
||||
limit: 1,
|
||||
field: "avatar",
|
||||
that: $(this)
|
||||
});
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
.layui-form-label {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
|
@ -1,158 +0,0 @@
|
|||
{layout name="layout1" /}
|
||||
<style>
|
||||
.search {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.search .layui-form-label {
|
||||
width: 80px;
|
||||
text-align: left;
|
||||
}
|
||||
.btns {
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-tab" lay-filter="fansTab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this" type="one">下一级</li>
|
||||
<li type="two">下二级</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--搜索区域-->
|
||||
<div class="search layui-form">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-form-label">用户信息</div>
|
||||
<div class="layui-inline">
|
||||
<select name="field" id="field" placeholder="请选择" >
|
||||
<option value="sn">用户编号</option>
|
||||
<option value="nickname">用户昵称</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keyword" name="keyword" class="layui-input" />
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-primary layui-bg-blue" lay-submit lay-filter="search">搜索</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-submit lay-filter="reset">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--数据表格-->
|
||||
<table id="lists" lay-filter="lists"></table>
|
||||
<!--自定义模板-->
|
||||
<script type="text/html" id="user-info">
|
||||
<img src="{{d.avatar}}" style="height:60px;width: 60px" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align: left;">
|
||||
<p>用户编号:{{d.sn}}</p>
|
||||
<p style="width: 300px;text-overflow:ellipsis;overflow: hidden">用户昵称:{{d.nickname}}</p>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="first-info">
|
||||
{{# if(d.first_leader_info != '系统'){}}
|
||||
<img src="{{d.first_leader_info.avatar}}" style="height:80px;width: 80px;margin-right: 10px;" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align:left;width: 240px">
|
||||
<p>用户编号:{{d.first_leader_info.sn}}</p>
|
||||
<p style="width: 180px;text-overflow:ellipsis;overflow: hidden">用户昵称:{{d.first_leader_info.nickname}}</p>
|
||||
</div>
|
||||
{{# }else{ }}
|
||||
{{d.first_leader_info}}
|
||||
{{# } }}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/'
|
||||
}).use(['table', 'form'], function () {
|
||||
let $ = layui.$
|
||||
, form = layui.form
|
||||
, element = layui.element
|
||||
, table = layui.table;
|
||||
|
||||
let type = 'one';
|
||||
|
||||
//监听Tab切换
|
||||
element.on('tab(fansTab)', function(data){
|
||||
type = $(this).attr('type');
|
||||
// 重载表格
|
||||
table.reload('lists', {
|
||||
where: {
|
||||
"type": type,
|
||||
id: "{$id}"
|
||||
},
|
||||
page: {curr: 1}
|
||||
});
|
||||
});
|
||||
|
||||
//监听搜索
|
||||
form.on('submit(search)', function(data){
|
||||
var field = data.field;
|
||||
field.type = type;
|
||||
field.id = "{$id}";
|
||||
//执行重载
|
||||
table.reload('lists', {
|
||||
where: field,
|
||||
page: {curr: 1}
|
||||
});
|
||||
});
|
||||
|
||||
//清空查询
|
||||
form.on('submit(reset)', function(){
|
||||
$('#keyword').val('');
|
||||
$('#field').val('sn');
|
||||
form.render('select');
|
||||
//刷新列表
|
||||
table.reload('lists', {
|
||||
where: {
|
||||
"type": type,
|
||||
id: "{$id}"
|
||||
}, page: {curr: 1}
|
||||
});
|
||||
});
|
||||
|
||||
// 数据表格渲染
|
||||
table.render({
|
||||
elem: '#lists'
|
||||
,url: '{:url("user.user/fans")}' //数据接口
|
||||
,where: {
|
||||
type: type,
|
||||
id: "{$id}"
|
||||
}
|
||||
,method: 'post'
|
||||
,page: true //开启分页
|
||||
,cols: [[ //表头
|
||||
{title: '用户信息', width:380, templet: '#user-info'}
|
||||
,{title: '上级推荐人', width:380, templet: '#first-info'}
|
||||
,{field: 'fans', title: '推荐下级人数'}
|
||||
]]
|
||||
, text: {none: '暂无数据!'}
|
||||
, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
|
||||
return {
|
||||
"code": res.code,
|
||||
"msg": res.msg,
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.lists, //解析数据列表
|
||||
};
|
||||
},
|
||||
response: {
|
||||
statusCode: 1
|
||||
}
|
||||
,done: function(res, curr, count){
|
||||
// 解决操作栏因为内容过多换行问题
|
||||
$(".layui-table-main tr").each(function (index, val) {
|
||||
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
|
@ -1,181 +0,0 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label{
|
||||
width: 120px;
|
||||
}
|
||||
.layui-card .layui-tab{
|
||||
margin-left: 7px;
|
||||
}
|
||||
.layui-form-label{
|
||||
margin-left: 20px;
|
||||
width: 98px;
|
||||
}
|
||||
.layui-input-inline{
|
||||
width:160px;
|
||||
}
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-user_group" id="layuiadmin-form-user_group" style="padding: 20px 30px 0 0;">
|
||||
<div class="layui-form-item div-flex">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>基础信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户编号:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.sn}</label>
|
||||
</div>
|
||||
<label class="layui-form-label">用户昵称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.nickname}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">会员头像:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">
|
||||
<img class="image-show" src="{$detail.avatar}" width="80px" height="80px">
|
||||
</label>
|
||||
</div>
|
||||
<label class="layui-form-label">手机号码:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.mobile}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户标签:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.tag_str}</label>
|
||||
</div>
|
||||
<label class="layui-form-label">成长值:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.user_growth}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">性别:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.sex}</label>
|
||||
</div>
|
||||
<label class="layui-form-label">生日:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.birthday}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-item">
|
||||
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">注册来源:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.client_desc}</label>
|
||||
</div>
|
||||
<label class="layui-form-label">注册时间:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.create_time}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">最后登录:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.login_time}</label>
|
||||
</div>
|
||||
<label class="layui-form-label">用户状态:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.disable ? '禁用' : '正常'}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item div-flex">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>钱包信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">总资产:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">¥ {$detail.assets}</label>
|
||||
</div>
|
||||
<label class="layui-form-label">不可提现余额:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">¥ {$detail.user_money}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">可提现余额:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">¥ {$detail.earnings}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item div-flex">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>消费能力</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">成交订单笔数:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.order_num}</label>
|
||||
</div>
|
||||
<label class="layui-form-label">消费金额:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">¥ {$detail.total_amount}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">客单价:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">¥ {$detail.avg_amount}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item div-flex">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>推荐信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">上级推荐人:</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
{if $detail.first_leader_info != '系统'}
|
||||
<label class="layui-form-mid" style="width:300px">{$detail.first_leader_info.nickname}({$detail.first_leader_info.sn})</label>
|
||||
{else}
|
||||
<label class="layui-form-mid">{$detail.first_leader_info}</label>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">推荐下级人数:</label>
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-mid">{$detail.fans}人</label>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<button class="layui-btn layui-btn-sm layui-bg-blue" id="showFans" data-id="{$detail.id}">查看推荐下级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).use(['jquery', 'layer'], function(){
|
||||
let $ = layui.jquery;
|
||||
let layer = layui.layer;
|
||||
|
||||
// 查看推荐下级
|
||||
$('#showFans').click(function() {
|
||||
let id = $(this).data('id');
|
||||
// 弹窗显示添加页
|
||||
layer.open({
|
||||
type: 2
|
||||
,title: "查看下级推荐"
|
||||
,content: "{:url('user.user/fans')}?id=" + id
|
||||
,area: ["90%", "90%"]
|
||||
,btn: ["返回"]
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,134 +1,103 @@
|
|||
{layout name="layout1" /}
|
||||
<div class="wrapper">
|
||||
<div class="layui-card">
|
||||
<!-- <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="height:auto !important;">-->
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<div class="layui-tab layui-tab-card" lay-filter="tab-all">
|
||||
<div class="layui-card">
|
||||
|
||||
<!-- <div class="layui-inline">-->
|
||||
<!-- <button class="layui-btn layui-btn-sm layuiadmin-btn-user {$view_theme_color}" lay-submit lay-filter="user-search">查询</button>-->
|
||||
<!-- <button class="layui-btn layui-btn-sm layuiadmin-btn-user layui-btn-primary " lay-submit lay-filter="user-clear-search">重置</button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="layui-card-body">
|
||||
<div style="padding-bottom: 10px;" class="add">
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-user_level {$view_theme_color}" data-type="add">新增</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<!-- <div style="padding-bottom: 10px;"></div>-->
|
||||
<table id="user_level-lists" lay-filter="user_level-lists"></table>
|
||||
<script type="text/html" id="user_level-operation">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
|
||||
</script>
|
||||
|
||||
<table id="user-lists" lay-filter="user-lists"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="user-operation">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
|
||||
</script>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.layui-table-cell {
|
||||
/*height: auto;*/
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).use(['table','laydate'], function(){
|
||||
}).use(['table','form'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,table = layui.table
|
||||
, laydate = layui.laydate;
|
||||
,element = layui.element;
|
||||
$('.layui-btn.layuiadmin-btn-user_level').on('click', function(){
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
layui.define(['table', 'form'], function(exports){
|
||||
var $ = layui.$
|
||||
,table = layui.table
|
||||
,form = layui.form;
|
||||
|
||||
//监听搜索
|
||||
form.on('submit(user-search)', function(data){
|
||||
var field = data.field;
|
||||
//执行重载
|
||||
table.reload('user-lists', {
|
||||
where: field,
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
table.render({
|
||||
id:'user_level-lists'
|
||||
,elem: '#user_level-lists'
|
||||
,url: '{:url("user.businessTeam/lists")}' //模拟接口
|
||||
,cols: [[
|
||||
{field: 'name', title: '业务团队名称'}
|
||||
,{field: 'phone',title:'手机'}
|
||||
,{fixed: 'right', title: '操作',align: 'center', toolbar: '#user_level-operation'}
|
||||
]]
|
||||
,page:true
|
||||
,text: {none: '暂无数据!'}
|
||||
,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
|
||||
return {
|
||||
"code":res.code,
|
||||
"msg":res.msg,
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.lists, //解析数据列表
|
||||
};
|
||||
}
|
||||
,response: {
|
||||
statusCode: 1
|
||||
}
|
||||
,done: function(res, curr, count){
|
||||
// 解决操作栏因为内容过多换行问题
|
||||
$(".layui-table-main tr").each(function (index, val) {
|
||||
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//清空查询
|
||||
form.on('submit(user-clear-search)', function(){
|
||||
$('#keyword').val(''); //清空输入框
|
||||
form.render('select');
|
||||
//刷新列表
|
||||
table.reload('user-lists', {
|
||||
where: [],
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
layui.define(['table', 'form'], function(exports){
|
||||
var $ = layui.$
|
||||
,table = layui.table
|
||||
,form = layui.form;
|
||||
|
||||
table.render({
|
||||
id:'user-lists'
|
||||
,elem: '#user-lists'
|
||||
,url: '{:url("user.businessTeam/lists")}' //模拟接口
|
||||
,cols: [[
|
||||
{type: 'checkbox'}
|
||||
,{field: 'name', title: '名称',width: 120,align: 'center'}
|
||||
,{field: 'phone', title: '手机',width: 120,align: 'center'}
|
||||
,{fixed: 'right', title: '操作', width: 420,toolbar: '#user-operation',align: 'center'}
|
||||
]]
|
||||
,page:true
|
||||
,text: {none: '暂无数据!'}
|
||||
,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
|
||||
return {
|
||||
"code":res.code,
|
||||
"msg":res.msg,
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.lists, //解析数据列表
|
||||
};
|
||||
},
|
||||
response: {
|
||||
statusCode: 1
|
||||
}
|
||||
, done: function fix() {
|
||||
$(".layui-table-main tr").each(function (index, val) {
|
||||
$(".layui-table-fixed").each(function () {
|
||||
$($(this).find(".layui-table-body tbody tr")[index]).height($(val).height());
|
||||
});
|
||||
});
|
||||
$(".layui-table-header tr").each(function (index, val) {
|
||||
$(".layui-table-fixed").each(function () {
|
||||
$($(this).find(".layui-table-header thead tr")[index]).height($(val).height());
|
||||
});
|
||||
});
|
||||
window.onresize = function () {
|
||||
fix()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var moreShow = 0;
|
||||
//监听工具条
|
||||
table.on('tool(user-lists)', function(obj){
|
||||
if(obj.event === 'edit'){
|
||||
var id = obj.data.id;
|
||||
layer.open({
|
||||
//事件
|
||||
var active = {
|
||||
add: function(){
|
||||
var index = layer.open({
|
||||
type: 2
|
||||
,title: '编辑'
|
||||
,content: '{:url("user.businessTeam/edit")}?id='+id
|
||||
,title: '新增'
|
||||
,content: '{:url("user.businessTeam/add")}'
|
||||
,area: ['90%', '90%']
|
||||
,btn: ['确定', '取消']
|
||||
,btn: ['保存', '取消']
|
||||
,maxmin: true
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submit = layero.find('iframe').contents().find('#edit-submit');
|
||||
,submitID = 'add-user_level-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit(edit-submit)', function(data){
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field;
|
||||
$.ajax({
|
||||
url:'{:url("user.businessTeam/edit")}',
|
||||
like.ajax({
|
||||
url:'{:url("user.businessTeam/add")}',
|
||||
data:field,
|
||||
type:"post",
|
||||
success:function(res)
|
||||
|
@ -141,22 +110,82 @@
|
|||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('user-lists'); //数据刷新
|
||||
}else{
|
||||
layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 2
|
||||
, time: 1000
|
||||
});
|
||||
table.reload('user_level-lists'); //数据刷新
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
table.on('tool(user_level-lists)', function(obj) {
|
||||
var id = obj.data.id;
|
||||
if (obj.event === 'edit') {
|
||||
var index = layer.open({
|
||||
type: 2
|
||||
, title: '编辑'
|
||||
, content: '{:url("user.businessTeam/edit")}?id=' + id
|
||||
, area: ['90%', '90%']
|
||||
, btn: ['保存', '取消']
|
||||
, maxmin: true
|
||||
, yes: function (index, layero) {
|
||||
var iframeWindow = window['layui-layer-iframe' + index]
|
||||
, submitID = 'edit-user_level-submit'
|
||||
, submit = layero.find('iframe').contents().find('#' + submitID);
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
||||
var field = data.field;
|
||||
like.ajax({
|
||||
url: '{:url("user.businessTeam/edit")}',
|
||||
data: field,
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('user_level-lists'); //数据刷新
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (obj.event === 'del') {
|
||||
var name = obj.data.name;
|
||||
layer.confirm('确定删除业务团队:<span style="color: red">' + name + '</span>', function (index) {
|
||||
like.ajax({
|
||||
url: '{:url("user.businessTeam/del")}',
|
||||
data: {id: id},
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.code == 1) {
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('user_level-lists'); //数据刷新
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
|
@ -1,34 +0,0 @@
|
|||
{layout name="layout2" /}
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-user" id="layuiadmin-form-user" style="padding: 20px 30px 0 0;">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: 180px">选择会员标签:</label>
|
||||
<div class="layui-input-inline" style="width: 420px">
|
||||
<div id="tagList"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="set_tag-submit" id="set_tag-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/' //静态资源所在路径
|
||||
}).extend({
|
||||
xmSelect: 'xmSelect/xm-select'
|
||||
}).use(['xmSelect', 'form'], function(){
|
||||
var $ = layui.$,form = layui.form ;
|
||||
var xmSelect = layui.xmSelect;
|
||||
var tag_list = '{$tag_list|raw}';
|
||||
|
||||
var xmIns = xmSelect.render({
|
||||
el: '#tagList',
|
||||
language: 'zn',
|
||||
data: JSON.parse(tag_list),
|
||||
prop: {
|
||||
value: 'id'
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
|
@ -1,121 +0,0 @@
|
|||
{layout name="layout1" /}
|
||||
<style>
|
||||
.search {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.search .layui-form-label {
|
||||
width: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
.btns {
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<!--搜索区域-->
|
||||
<div class="search layui-form">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-form-label">用户信息</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="keyword" name="keyword" class="layui-input" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-primary layui-bg-blue" lay-submit lay-filter="search">搜索</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-submit lay-filter="reset">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--数据表格-->
|
||||
<table id="lists" lay-filter="lists"></table>
|
||||
<!--自定义模板-->
|
||||
<script type="text/html" id="user-info">
|
||||
<img src="{{d.avatar}}" style="height:60px;width: 60px" class="image-show">
|
||||
<div class="layui-input-inline" style="text-align: left;">
|
||||
<p>用户编号:{{d.user_sn}}</p>
|
||||
<p style="width: 300px;text-overflow:ellipsis;overflow: hidden">用户昵称:{{d.nickname}}</p>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="level-info">
|
||||
{{d.level_name}}({{d.weights}})级
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/lib/'
|
||||
}).use(['table', 'form'], function () {
|
||||
let $ = layui.$
|
||||
, form = layui.form
|
||||
, table = layui.table;
|
||||
|
||||
//监听搜索
|
||||
form.on('submit(search)', function(data){
|
||||
var field = data.field;
|
||||
//执行重载
|
||||
table.reload('lists', {
|
||||
where: field,
|
||||
page: {curr: 1}
|
||||
});
|
||||
});
|
||||
|
||||
// 获取选中的用户信息
|
||||
window.user_selected = function user_selected()
|
||||
{
|
||||
var checkStatus = table.checkStatus('lists');
|
||||
return checkStatus.data[0]; //获取选中行的数据
|
||||
}
|
||||
|
||||
//清空查询
|
||||
form.on('submit(reset)', function(){
|
||||
$('#keyword').val('');
|
||||
$('#is_distribution').val('all');
|
||||
form.render('select');
|
||||
//刷新列表
|
||||
table.reload('lists', {
|
||||
where: [], page: {curr: 1}
|
||||
});
|
||||
});
|
||||
|
||||
// 数据表格渲染
|
||||
table.render({
|
||||
elem: '#lists'
|
||||
,url: '{:url("distribution.distribution_member/userLists")}' //数据接口
|
||||
,method: 'post'
|
||||
,page: true //开启分页
|
||||
,cols: [[ //表头
|
||||
{type: 'radio'}
|
||||
,{field: 'sn', title: '用户编号', width:380}
|
||||
,{field: 'nickname', title: '用户昵称', width:180}
|
||||
]]
|
||||
, text: {none: '暂无数据!'}
|
||||
, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
|
||||
return {
|
||||
"code": res.code,
|
||||
"msg": res.msg,
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.lists, //解析数据列表
|
||||
};
|
||||
},
|
||||
response: {
|
||||
statusCode: 1
|
||||
}
|
||||
,done: function(res, curr, count){
|
||||
// 解决操作栏因为内容过多换行问题
|
||||
$(".layui-table-main tr").each(function (index, val) {
|
||||
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,39 @@
|
|||
{layout name="layout2" /}
|
||||
<style>
|
||||
.layui-form-label {
|
||||
color: #6a6f6c;
|
||||
width: 100px;
|
||||
}
|
||||
.layui-input-block {
|
||||
margin-left: 130px;
|
||||
}
|
||||
.tips{
|
||||
color: red;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<div class="layui-form" lay-filter="layuiadmin-form-user_level" id="layuiadmin-form-user_level" style="padding: 20px 30px 0 0;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="tips">*</span>手机号:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="phone" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="tips">*</span>密码:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="password" name="password" min="0" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" style="padding-bottom: 20px;">
|
||||
<label class="layui-form-label"><span class="tips">*</span>确认密码:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="password" name="password_confirm" min="0" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-hide">
|
||||
<input type="button" lay-submit lay-filter="add-user_level-submit" id="add-user_level-submit" value="确认">
|
||||
</div>
|
||||
</div>
|
|
@ -75,6 +75,12 @@
|
|||
<div id="tagList"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">业务团队</label>
|
||||
<div class="layui-input-block" style="width: 380px;">
|
||||
<div id="teamList"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">备注</label>
|
||||
<div class="layui-input-block" style="width: 380px">
|
||||
|
@ -97,7 +103,9 @@
|
|||
var $ = layui.$,form = layui.form,laydate = layui.laydate;
|
||||
var xmSelect = layui.xmSelect;
|
||||
var tag_list = '{$tag_list|raw}';
|
||||
var team_list = '{$team_list|raw}';
|
||||
var initValue = '{$info.tag_ids | raw}';
|
||||
var teamValue = '{$info.team_ids | raw}';
|
||||
|
||||
laydate.render({
|
||||
elem: '#birthday'
|
||||
|
@ -116,6 +124,23 @@
|
|||
initValue: JSON.parse(initValue)
|
||||
})
|
||||
|
||||
var xmIns = xmSelect.render({
|
||||
el: '#teamList',
|
||||
language: 'zn',
|
||||
data: JSON.parse(team_list),
|
||||
name: 'team_id',
|
||||
radio: true,
|
||||
prop: {
|
||||
value: 'id'
|
||||
},
|
||||
initValue: JSON.parse(teamValue)
|
||||
})
|
||||
|
||||
// $('#teamList').on('change', function(e) {
|
||||
// var selectedValue = e.target.value;
|
||||
// $('#team-value').val(selectedValue);
|
||||
// });
|
||||
|
||||
// 图片上传
|
||||
like.delUpload();
|
||||
$(document).on("click", "#avatar", function () {
|
||||
|
|
|
@ -68,6 +68,17 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">业务团队:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="team_id" name="team_id" style="height:80px;width: 80px" >
|
||||
<option value="">全部</option>
|
||||
{foreach $team_list as $item }
|
||||
<option value="{$item.id}">{$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
|
@ -105,6 +116,7 @@
|
|||
<div class="layui-card-body">
|
||||
<div style="padding-bottom: 10px;">
|
||||
<!-- <button class="layui-btn layui-btn-sm layuiadmin-btn-user {$view_theme_color}" data-type="send_coupon">发放优惠券</button>-->
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-user {$view_theme_color}" data-type="add">添加会员</button>
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-user {$view_theme_color}" data-type="set_tag">设置会员标签</button>
|
||||
</div>
|
||||
|
||||
|
@ -122,6 +134,7 @@
|
|||
正常
|
||||
{{# } }}
|
||||
</p>
|
||||
<p>业务团队:{{d.team_name}}</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
@ -219,6 +232,7 @@
|
|||
$('#tag').val(''); //清空输入框
|
||||
$('#client').val(''); //清空输入框
|
||||
$('#disable').val(''); //清空禁用状态
|
||||
$('#team_id').val(''); //业务团队
|
||||
$('#total_amount_start').val(''); //清空输入框
|
||||
$('#total_amount_end').val(''); //清空输入框
|
||||
$('#start_time').val(''); //清空输入框
|
||||
|
@ -343,7 +357,46 @@
|
|||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
add: function(){
|
||||
var index = layer.open({
|
||||
type: 2
|
||||
,title: '新增会员'
|
||||
,content: '{:url("user.user/add")}'
|
||||
,area: ['90%', '90%']
|
||||
,btn: ['保存', '取消']
|
||||
,maxmin: true
|
||||
,yes: function(index, layero){
|
||||
var iframeWindow = window['layui-layer-iframe'+ index]
|
||||
,submitID = 'add-user_level-submit'
|
||||
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
||||
var field = data.field;
|
||||
like.ajax({
|
||||
url:'{:url("user.user/add")}',
|
||||
data:field,
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 1000
|
||||
});
|
||||
layer.close(index); //关闭弹层
|
||||
table.reload('user-lists'); //数据刷新
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
submit.trigger('click');
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
$('.layui-btn.layuiadmin-btn-user').on('click', function(){
|
||||
var type = $(this).data('type');
|
||||
|
|
|
@ -923,6 +923,8 @@ class OrderLogic extends Logic
|
|||
$order_data['coupon_list_id'] = $coupon_list_id;
|
||||
$order_data['create_time'] = time();
|
||||
|
||||
$order_data['team_id'] = $user['team_id'];//订单所属团队
|
||||
|
||||
// 前置订单
|
||||
$order_data['is_frontend'] = 0;
|
||||
if (!empty($post['is_frontend'])) {
|
||||
|
@ -1673,9 +1675,9 @@ class OrderLogic extends Logic
|
|||
->field('o.id,order_status,total_num,og.image,o.consignee,o.mobile,o.province,o.city,o.district,o.address,pay_time,confirm_take_time,o.shipping_status,shipping_time')
|
||||
->append(['delivery_address'])
|
||||
->find();
|
||||
if (!self::checkDelivery($order['delivery_id'])) {
|
||||
return false;
|
||||
}
|
||||
// if (!self::checkDelivery($order['delivery_id'])) {
|
||||
// return false;
|
||||
// }
|
||||
//初始化数据
|
||||
$order_tips = '已下单';
|
||||
$order_traces = [];
|
||||
|
|
|
@ -29,6 +29,7 @@ class ClientEnum
|
|||
const android = 4;
|
||||
const pc = 5;
|
||||
const h5 = 6;//h5(非微信环境h5)
|
||||
const backend = 7;//PC后台
|
||||
|
||||
function getName($value)
|
||||
{
|
||||
|
@ -50,6 +51,8 @@ class ClientEnum
|
|||
break;
|
||||
case self::oa:
|
||||
$name = '公众号';
|
||||
case self::backend:
|
||||
$name = '后台';
|
||||
break;
|
||||
}
|
||||
return $name;
|
||||
|
@ -65,6 +68,7 @@ class ClientEnum
|
|||
self::mnp => '小程序商城',
|
||||
self::ios => '苹果APP商城',
|
||||
self::android => '安卓APP商城',
|
||||
self::backend => '后台',
|
||||
];
|
||||
if ($type === true) {
|
||||
return $desc;
|
||||
|
|
Loading…
Reference in New Issue