# Conflicts:
#	.htaccess
#	public/.htaccess
This commit is contained in:
sugar1569 2019-01-02 10:14:06 +08:00
commit fcb22be687
347 changed files with 10416 additions and 11408 deletions

View File

@ -1,8 +0,0 @@
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>

View File

@ -10,50 +10,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// 应用公共文件 // 应用公共文件
/**
* 获取用户名称
* @param $uid
* @return mixed
*/
function getUserNickname($uid){
return \app\admin\model\user\User::where('uid',$uid)->value('nickname');
}
/**
* 获取产品名称
* @param $id
* @return mixed
*/
function getProductName($id){
return \app\admin\model\store\StoreProduct::where('id',$id)->value('store_name');
}
/**
* 获取拼团名称
* @param $id
* @return mixed
*/
function getCombinationTitle($id){
return \app\admin\model\store\StoreCombination::where('id',$id)->value('title');
}
/**
* 获取订单编号
* @param $id
*/
function getOrderId($id){
return \app\admin\model\order\StoreOrder::where('id',$id)->value('order_id');
}
/**
* 根据用户uid获取订单数
* @param $uid
* @return int|string
*/
function getOrderCount($uid){
return \app\admin\model\order\StoreOrder::where('uid',$uid)->where('paid',1)->where('refund_status',0)->where('status',2)->count();
}
/** /**
* 格式化属性 * 格式化属性
* @param $arr * @param $arr
@ -98,6 +55,12 @@ function attrFormat($arr){
return [$data,$res]; return [$data,$res];
} }
/**
* 格式化月份
* @param string $time
* @param int $ceil
* @return array
*/
function getMonth($time='',$ceil=0){ function getMonth($time='',$ceil=0){
if(empty($time)){ if(empty($time)){
$firstday = date("Y-m-01",time()); $firstday = date("Y-m-01",time());
@ -118,3 +81,24 @@ function getMonth($time='',$ceil=0){
} }
return array($firstday,$lastday); return array($firstday,$lastday);
} }
/**删除目录下所有文件
* @param $path 目录或者文件路径
* @param string $ext
* @return bool
*/
function clearfile($path,$ext = '*.log')
{
$files = (array) glob($path.DS.'*');
foreach ($files as $path) {
if (is_dir($path)) {
$matches = glob($path . '/'.$ext);
if (is_array($matches)) {
array_map('unlink', $matches);
}
rmdir($path);
} else {
unlink($path);
}
}
return true;
}

View File

@ -19,5 +19,19 @@ return [
// 是否自动开启 SESSION // 是否自动开启 SESSION
'auto_start' => true, 'auto_start' => true,
], ],
'system_wechat_tag' => '_system_wechat' 'app_debug' => false,
// 应用Trace
'app_trace' => false,
'exception_handle' =>\basic\AdminException::class,
'empty_controller' =>'Index',
// 视图输出字符串内容替换
'view_replace_str' => [
'{__ADMIN_PATH}' => PUBILC_PATH.'system/',//后台
'{__FRAME_PATH}' => PUBILC_PATH.'system/frame/',//H+框架
'{__PLUG_PATH}' => PUBILC_PATH.'static/plug/',//前后台通用
'{__MODULE_PATH}' => PUBILC_PATH.'system/module/',//后台功能模块
'{__STATIC_PATH}' => PUBILC_PATH.'static/',//全站通用
'{__PUBLIC_PATH}' => PUBILC_PATH,//静态资源路径
]
]; ];

View File

@ -160,7 +160,7 @@ class Index extends AuthController
->group("FROM_UNIXTIME(add_time, '%Y%m%e')") ->group("FROM_UNIXTIME(add_time, '%Y%m%e')")
->order('add_time asc') ->order('add_time asc')
->select()->toArray(); ->select()->toArray();
if(empty($order_list)) return false; if(empty($order_list)) return Json::fail('无数据');
foreach ($order_list as $k=>&$v){ foreach ($order_list as $k=>&$v){
$order_list[$v['day']] = $v; $order_list[$v['day']] = $v;
} }

View File

@ -36,7 +36,7 @@ class Login extends SystemBasic
//检验验证码 //检验验证码
if(!captcha_check($verify)) return $this->failed('验证码错误,请重新输入'); if(!captcha_check($verify)) return $this->failed('验证码错误,请重新输入');
$error = Session::get('login_error')?:['num'=>0,'time'=>time()]; $error = Session::get('login_error')?:['num'=>0,'time'=>time()];
if($error['num'] >=5 && $error['time'] < strtotime('+ 5 minutes')) if($error['num'] >=5 && $error['time'] > strtotime('- 5 minutes'))
return $this->failed('错误次数过多,请稍候再试!'); return $this->failed('错误次数过多,请稍候再试!');
//检验帐号密码 //检验帐号密码
$res = SystemAdmin::login($account,$pwd); $res = SystemAdmin::login($account,$pwd);

View File

@ -3,6 +3,7 @@
namespace app\admin\controller\agent; namespace app\admin\controller\agent;
use app\admin\controller\AuthController; use app\admin\controller\AuthController;
use app\admin\model\order\StoreOrder;
use app\admin\model\user\User; use app\admin\model\user\User;
use app\admin\model\wechat\WechatUser as UserModel; use app\admin\model\wechat\WechatUser as UserModel;
use app\admin\library\FormBuilder; use app\admin\library\FormBuilder;
@ -74,6 +75,7 @@ class AgentManage extends AuthController
->order('u.add_time DESC') ->order('u.add_time DESC')
->select() ->select()
->toArray(); ->toArray();
foreach ($list as $key=>$value) $list[$key]['orderCount'] = StoreOrder::getOrderCount($value['uid']);
$this->assign('list',$list); $this->assign('list',$list);
return $this->fetch(); return $this->fetch();
} }

View File

@ -4,6 +4,7 @@ namespace app\admin\controller\article;
use app\admin\controller\AuthController; use app\admin\controller\AuthController;
use service\UtilService as Util; use service\UtilService as Util;
use service\PHPTreeService as Phptree;
use service\JsonService as Json; use service\JsonService as Json;
use service\UploadService as Upload; use service\UploadService as Upload;
use think\Request; use think\Request;
@ -22,18 +23,30 @@ class Article extends AuthController
* 显示后台管理员添加的图文 * 显示后台管理员添加的图文
* @return mixed * @return mixed
*/ */
public function index($cid = 0) public function index($pid = 0)
{ {
$where = Util::getMore([ $where = Util::getMore([
['title',''] ['title',''],
['cid','']
],$this->request); ],$this->request);
if($cid) $pid = $this->request->param('pid');
$where['cid'] = $cid;
else
$where['cid'] = '';
$this->assign('where',$where); $this->assign('where',$where);
$where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1 $where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
$this->assign('cid',$cid); $catlist = ArticleCategoryModel::where('is_del',0)->select()->toArray();
//获取分类列表
if($catlist){
$tree = Phptree::makeTreeForHtml($catlist);
$this->assign(compact('tree'));
if($pid){
$pids = Util::getChildrenPid($tree,$pid);
$where['cid'] = ltrim($pid.$pids);
}
}else{
$tree = [];
$this->assign(compact('tree'));
}
$this->assign('cate',ArticleCategoryModel::getTierList()); $this->assign('cate',ArticleCategoryModel::getTierList());
$this->assign(ArticleModel::getAll($where)); $this->assign(ArticleModel::getAll($where));
return $this->fetch(); return $this->fetch();
@ -121,11 +134,11 @@ class Article extends AuthController
'synopsis', 'synopsis',
'share_title', 'share_title',
'share_synopsis', 'share_synopsis',
'is_banner',
'is_hot',
['visit',0], ['visit',0],
['sort',0], ['sort',0],
'url', 'url',
['is_banner',0],
['is_hot',0],
['status',1],],$request); ['status',1],],$request);
$data['cid'] = implode(',',$data['cid']); $data['cid'] = implode(',',$data['cid']);
$content = $data['content']; $content = $data['content'];

View File

@ -83,6 +83,10 @@ class UserExtract extends AuthController
{ {
if(!UserExtractModel::be(['id'=>$id,'status'=>0])) return JsonService::fail('操作记录不存在或状态错误!'); if(!UserExtractModel::be(['id'=>$id,'status'=>0])) return JsonService::fail('操作记录不存在或状态错误!');
$fail_msg =$request->post(); $fail_msg =$request->post();
$extract=UserExtractModel::get($id);
if(!$extract) return JsonService::fail('操作记录不存在!');
if($extract->status==1) return JsonService::fail('已经提现,错误操作');
if($extract->status==-1) return JsonService::fail('您的提现申请已被拒绝,请勿重复操作!');
$res = UserExtractModel::changeFail($id,$fail_msg['message']); $res = UserExtractModel::changeFail($id,$fail_msg['message']);
if($res){ if($res){
return JsonService::successful('操作成功!'); return JsonService::successful('操作成功!');
@ -95,6 +99,10 @@ class UserExtract extends AuthController
if(!UserExtractModel::be(['id'=>$id,'status'=>0])) if(!UserExtractModel::be(['id'=>$id,'status'=>0]))
return JsonService::fail('操作记录不存在或状态错误!'); return JsonService::fail('操作记录不存在或状态错误!');
UserExtractModel::beginTrans(); UserExtractModel::beginTrans();
$extract=UserExtractModel::get($id);
if(!$extract) return JsonService::fail('操作记录不存!');
if($extract->status==1) return JsonService::fail('您已提现,请勿重复提现!');
if($extract->status==-1) return JsonService::fail('您的提现申请已被拒绝!');
$res = UserExtractModel::changeSuccess($id); $res = UserExtractModel::changeSuccess($id);
if($res){ if($res){
return JsonService::successful('操作成功!'); return JsonService::successful('操作成功!');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php namespace app\admin\controller\setting; use think\Url; use service\FormBuilder as Form; use think\Request; use service\UtilService as Util; use service\JsonService as Json; use app\admin\controller\AuthController; use app\admin\model\system\SystemConfigTab as ConfigTabModel; use app\admin\model\system\SystemConfig as ConfigModel; /** * 配置分类控制器 * Class SystemConfigTab * @package app\admin\controller\system */ class SystemConfigTab extends AuthController { /** * 子子段 * @return mixed|\think\response\Json */ public function sonconfigtab(){ $tab_id = input('tab_id'); if(!$tab_id) return Json::fail('参数错误'); $this->assign('tab_id',$tab_id); $list = ConfigModel::getAll($tab_id); foreach ($list as $k=>$v){ $list[$k]['value'] = json_decode($v['value'],true); if($v['type'] == 'radio' || $v['type'] == 'checkbox'){ $list[$k]['value'] = ConfigTabModel::getRadioOrCheckboxValueInfo($v['menu_name'],$v['value']); } if($v['type'] == 'upload' && !empty($v['value'])){ if($v['upload_type'] == 1 || $v['upload_type'] == 3) $list[$k]['value'] = explode(',',$v['value']); } } $this->assign('list',$list); return $this->fetch(); } /** * 基础配置 * @return mixed */ public function index(){ $where = Util::getMore([ ['status',''], ['title',''], ],$this->request); $this->assign('where',$where); $this->assign(ConfigTabModel::getSystemConfigTabPage($where)); return $this->fetch(); } /** * 添加配置分类 * @return mixed */ public function create(){ $form = Form::create(Url::build('save'),[ Form::input('title','分类昵称'), Form::input('eng_title','分类字段'), Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')))->icon('ionic'), Form::radio('type','类型',0)->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]), Form::radio('status','状态',1)->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']]) ]); $form->setMethod('post')->setTitle('添加分类配置'); $this->assign(compact('form')); return $this->fetch('public/form-builder'); } /** * 保存分类名称 * @param Request $request * @return \think\response\Json */ public function save(Request $request){ $data = Util::postMore([ 'eng_title', 'status', 'title', 'icon', 'type'],$request); if(!$data['title']) return Json::fail('请输入按钮名称'); ConfigTabModel::set($data); return Json::successful('添加菜单成功!'); } /** * 修改分类 * @param $id * @return mixed */ public function edit($id){ $menu = ConfigTabModel::get($id)->getData(); if(!$menu) return Json::fail('数据不存在!'); $form = Form::create(Url::build('update',array('id'=>$id)),[ Form::input('title','分类昵称',$menu['title']), Form::input('eng_title','分类字段',$menu['eng_title']), Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')),$menu['icon'])->icon('ionic'), Form::radio('type','类型',$menu['type'])->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]), Form::radio('status','状态',$menu['status'])->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']]) ]); $form->setMethod('post')->setTitle('添加分类配置'); $this->assign(compact('form')); return $this->fetch('public/form-builder'); } /** * @param Request $request * @param $id * @return \think\response\Json */ public function update(Request $request, $id) { $data = Util::postMore(['title','status','eng_title','icon','type'],$request); if(!$data['title']) return Json::fail('请输入分类昵称'); if(!$data['eng_title']) return Json::fail('请输入分类字段'); if(!ConfigTabModel::get($id)) return Json::fail('编辑的记录不存在!'); ConfigTabModel::edit($data,$id); return Json::successful('修改成功!'); } /** * @param $id * @return \think\response\Json */ public function delete($id){ if(!ConfigTabModel::del($id)) return Json::fail(ConfigTabModel::getErrorInfo('删除失败,请稍候再试!')); else return Json::successful('删除成功!'); } } <?php namespace app\admin\controller\setting; use think\Url; use service\FormBuilder as Form; use think\Request; use service\UtilService as Util; use service\JsonService as Json; use app\admin\controller\AuthController; use app\admin\model\system\SystemConfigTab as ConfigTabModel; use app\admin\model\system\SystemConfig as ConfigModel; /** * 配置分类控制器 * Class SystemConfigTab * @package app\admin\controller\system */ class SystemConfigTab extends AuthController { /** * 子子段 * @return mixed|\think\response\Json */ public function sonconfigtab(){ $tab_id = input('tab_id'); if(!$tab_id) return Json::fail('参数错误'); $this->assign('tab_id',$tab_id); $list = ConfigModel::getAll($tab_id); foreach ($list as $k=>$v){ $list[$k]['value'] = json_decode($v['value'],true)?:''; if($v['type'] == 'radio' || $v['type'] == 'checkbox'){ $list[$k]['value'] = ConfigTabModel::getRadioOrCheckboxValueInfo($v['menu_name'],$v['value']); } if($v['type'] == 'upload' && !empty($v['value'])){ // if($v['upload_type'] == 1 || $v['upload_type'] == 3) $list[$k]['value'] = explode(',',$v['value']); } } $this->assign('list',$list); return $this->fetch(); } /** * 基础配置 * @return mixed */ public function index(){ $where = Util::getMore([ ['status',''], ['title',''], ],$this->request); $this->assign('where',$where); $this->assign(ConfigTabModel::getSystemConfigTabPage($where)); return $this->fetch(); } /** * 添加配置分类 * @return mixed */ public function create(){ $form = Form::create(Url::build('save'),[ Form::input('title','分类昵称'), Form::input('eng_title','分类字段'), Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')))->icon('ionic'), Form::radio('type','类型',0)->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]), Form::radio('status','状态',1)->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']]) ]); $form->setMethod('post')->setTitle('添加分类配置'); $this->assign(compact('form')); return $this->fetch('public/form-builder'); } /** * 保存分类名称 * @param Request $request * @return \think\response\Json */ public function save(Request $request){ $data = Util::postMore([ 'eng_title', 'status', 'title', 'icon', 'type'],$request); if(!$data['title']) return Json::fail('请输入按钮名称'); ConfigTabModel::set($data); return Json::successful('添加菜单成功!'); } /** * 修改分类 * @param $id * @return mixed */ public function edit($id){ $menu = ConfigTabModel::get($id)->getData(); if(!$menu) return Json::fail('数据不存在!'); $form = Form::create(Url::build('update',array('id'=>$id)),[ Form::input('title','分类昵称',$menu['title']), Form::input('eng_title','分类字段',$menu['eng_title']), Form::frameInputOne('icon','图标',Url::build('admin/widget.widgets/icon',array('fodder'=>'icon')),$menu['icon'])->icon('ionic'), Form::radio('type','类型',$menu['type'])->options([['value'=>0,'label'=>'系统'],['value'=>1,'label'=>'公众号'],['value'=>2,'label'=>'小程序'],['value'=>3,'label'=>'其它']]), Form::radio('status','状态',$menu['status'])->options([['value'=>1,'label'=>'显示'],['value'=>2,'label'=>'隐藏']]) ]); $form->setMethod('post')->setTitle('添加分类配置'); $this->assign(compact('form')); return $this->fetch('public/form-builder'); } /** * @param Request $request * @param $id * @return \think\response\Json */ public function update(Request $request, $id) { $data = Util::postMore(['title','status','eng_title','icon','type'],$request); if(!$data['title']) return Json::fail('请输入分类昵称'); if(!$data['eng_title']) return Json::fail('请输入分类字段'); if(!ConfigTabModel::get($id)) return Json::fail('编辑的记录不存在!'); ConfigTabModel::edit($data,$id); return Json::successful('修改成功!'); } /** * @param $id * @return \think\response\Json */ public function delete($id){ if(!ConfigTabModel::del($id)) return Json::fail(ConfigTabModel::getErrorInfo('删除失败,请稍候再试!')); else return Json::successful('删除成功!'); } }

View File

@ -52,7 +52,7 @@ class SystemGroupData extends AuthController
$params = explode("\n",$value["param"]); $params = explode("\n",$value["param"]);
if(is_array($params) && !empty($params)){ if(is_array($params) && !empty($params)){
foreach ($params as $index => $v) { foreach ($params as $index => $v) {
$vl = explode('=',$v); $vl = explode('=>',$v);
if(!empty($vl[0]) && !empty($vl[1])){ if(!empty($vl[0]) && !empty($vl[1])){
$info[$index]["value"] = $vl[0]; $info[$index]["value"] = $vl[0];
$info[$index]["label"] = $vl[1]; $info[$index]["label"] = $vl[1];
@ -109,7 +109,8 @@ class SystemGroupData extends AuthController
foreach ($params as $key => $param) { foreach ($params as $key => $param) {
foreach ($Fields['fields'] as $index => $field) { foreach ($Fields['fields'] as $index => $field) {
if($key == $field["title"]){ if($key == $field["title"]){
if($param == "" || count($param) == 0) // if($param == "" || count($param) == 0)
if($param == "")
return Json::fail($field["name"]."不能为空!"); return Json::fail($field["name"]."不能为空!");
else{ else{
$value[$key]["type"] = $field["type"]; $value[$key]["type"] = $field["type"];
@ -154,7 +155,7 @@ class SystemGroupData extends AuthController
$params = explode("\n",$value["param"]); $params = explode("\n",$value["param"]);
if(is_array($params) && !empty($params)){ if(is_array($params) && !empty($params)){
foreach ($params as $index => $v) { foreach ($params as $index => $v) {
$vl = explode('=',$v); $vl = explode('=>',$v);
if(!empty($vl[0]) && !empty($vl[1])){ if(!empty($vl[0]) && !empty($vl[1])){
$info[$index]["value"] = $vl[0]; $info[$index]["value"] = $vl[0];
$info[$index]["label"] = $vl[1]; $info[$index]["label"] = $vl[1];
@ -162,37 +163,38 @@ class SystemGroupData extends AuthController
} }
} }
} }
$fvalue = isset($GroupDataValue[$value['title']]['value'])?$GroupDataValue[$value['title']]['value']:'';
switch ($value['type']){ switch ($value['type']){
case 'input': case 'input':
$f[] = Form::input($value['title'],$value['name'],$GroupDataValue[$value['title']]['value']); $f[] = Form::input($value['title'],$value['name'],$fvalue);
break; break;
case 'textarea': case 'textarea':
$f[] = Form::input($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->type('textarea'); $f[] = Form::input($value['title'],$value['name'],$fvalue)->type('textarea');
break; break;
case 'radio': case 'radio':
$f[] = Form::radio($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->options($info); $f[] = Form::radio($value['title'],$value['name'],$fvalue)->options($info);
break; break;
case 'checkbox': case 'checkbox':
$f[] = Form::checkbox($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->options($info); $f[] = Form::checkbox($value['title'],$value['name'],$fvalue)->options($info);
break; break;
case 'upload': case 'upload':
if(!empty($GroupDataValue[$value['title']]['value'])){ if(!empty($fvalue)){
$image = is_string($GroupDataValue[$value['title']]['value']) ? $GroupDataValue[$value['title']]['value'] : $GroupDataValue[$value['title']]['value'][0]; $image = is_string($fvalue) ? $fvalue : $fvalue[0];
}else{ }else{
$image = ''; $image = '';
} }
$f[] = Form::frameImageOne($value['title'],$value['name'],Url::build('admin/widget.images/index',array('fodder'=>$value['title'],'big'=>1)),$image)->icon('image'); $f[] = Form::frameImageOne($value['title'],$value['name'],Url::build('admin/widget.images/index',array('fodder'=>$value['title'],'big'=>1)),$image)->icon('image');
break; break;
case 'uploads': case 'uploads':
$images = !empty($GroupDataValue[$value['title']]['value']) ? $GroupDataValue[$value['title']]['value']:[]; $images = !empty($fvalue) ? $fvalue:[];
$f[] = Form::frameImages($value['title'],$value['name'],Url::build('admin/widget.images/index', array('fodder' => $value['title'],'big'=>1)),$images)->maxLength(5)->icon('images')->width('100%')->height('550px')->spin(0); $f[] = Form::frameImages($value['title'],$value['name'],Url::build('admin/widget.images/index', array('fodder' => $value['title'],'big'=>1)),$images)->maxLength(5)->icon('images')->width('100%')->height('550px')->spin(0);
break; break;
case 'select': case 'select':
$f[] = Form::select($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->setOptions($info); $f[] = Form::select($value['title'],$value['name'],$fvalue)->setOptions($info);
break; break;
default: default:
$f[] = Form::input($value['title'],$value['name'],$GroupDataValue[$value['title']]['value']); $f[] = Form::input($value['title'],$value['name'],$fvalue);
break; break;
} }

View File

@ -1,9 +1,9 @@
<?php <?php
namespace app\admin\controller\store; namespace app\admin\controller\store;
use app\admin\controller\AuthController; use app\admin\controller\AuthController;
use service\FormBuilder as Form; use service\FormBuilder as Form;
use service\JsonService;
use service\UtilService as Util; use service\UtilService as Util;
use service\JsonService as Json; use service\JsonService as Json;
use service\UploadService as Upload; use service\UploadService as Upload;
@ -27,18 +27,51 @@ class StoreCategory extends AuthController
*/ */
public function index() public function index()
{ {
$pid = $this->request->param('pid')?$this->request->param('pid'):0; $this->assign('pid',$this->request->get('pid',0));
$where = Util::getMore([
['is_show',''],
['pid',$pid],
['cate_name',''],
],$this->request);
$this->assign('where',$where);
$this->assign('cate',CategoryModel::getTierList()); $this->assign('cate',CategoryModel::getTierList());
$this->assign(CategoryModel::systemPage($where));
return $this->fetch(); return $this->fetch();
} }
/*
* 异步获取分类列表
* @return json
*/
public function category_list(){
$where = Util::getMore([
['is_show',''],
['pid',$this->request->param('pid','')],
['cate_name',''],
['page',1],
['limit',20],
['order','']
]);
return JsonService::successlayui(CategoryModel::CategoryList($where));
}
/**
* 设置单个产品上架|下架
*
* @return json
*/
public function set_show($is_show='',$id=''){
($is_show=='' || $id=='') && JsonService::fail('缺少参数');
$res=CategoryModel::where(['id'=>$id])->update(['is_show'=>(int)$is_show]);
if($res){
return JsonService::successful($is_show==1 ? '显示成功':'隐藏成功');
}else{
return JsonService::fail($is_show==1 ? '显示失败':'隐藏失败');
}
}
/**
* 快速编辑
*
* @return json
*/
public function set_category($field='',$id='',$value=''){
$field=='' || $id=='' || $value=='' && JsonService::fail('缺少参数');
if(CategoryModel::where(['id'=>$id])->update([$field=>$value]))
return JsonService::successful('保存成功');
else
return JsonService::fail('保存失败');
}
/** /**
* 显示创建资源表单页. * 显示创建资源表单页.
* *
@ -60,7 +93,7 @@ class StoreCategory extends AuthController
Form::number('sort','排序'), Form::number('sort','排序'),
Form::radio('is_show','状态',1)->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]]) Form::radio('is_show','状态',1)->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]])
]; ];
$form = Form::make_post_form('添加产品',$field,Url::build('save')); $form = Form::make_post_form('添加分类',$field,Url::build('save'),2);
$this->assign(compact('form')); $this->assign(compact('form'));
return $this->fetch('public/form-builder'); return $this->fetch('public/form-builder');
} }
@ -119,7 +152,7 @@ class StoreCategory extends AuthController
{ {
$c = CategoryModel::get($id); $c = CategoryModel::get($id);
if(!$c) return Json::fail('数据不存在!'); if(!$c) return Json::fail('数据不存在!');
$form = Form::create(Url::build('update',array('id'=>$id)),[ $field = [
Form::select('pid','父级',(string)$c->getData('pid'))->setOptions(function() use($id){ Form::select('pid','父级',(string)$c->getData('pid'))->setOptions(function() use($id){
$list = CategoryModel::getTierList(CategoryModel::where('id','<>',$id)); $list = CategoryModel::getTierList(CategoryModel::where('id','<>',$id));
// $list = (Util::sortListTier(CategoryModel::where('id','<>',$id)->select()->toArray(),'顶级','pid','cate_name')); // $list = (Util::sortListTier(CategoryModel::where('id','<>',$id)->select()->toArray(),'顶级','pid','cate_name'));
@ -133,8 +166,9 @@ class StoreCategory extends AuthController
Form::frameImageOne('pic','分类图标',Url::build('admin/widget.images/index',array('fodder'=>'pic')),$c->getData('pic'))->icon('image'), Form::frameImageOne('pic','分类图标',Url::build('admin/widget.images/index',array('fodder'=>'pic')),$c->getData('pic'))->icon('image'),
Form::number('sort','排序',$c->getData('sort')), Form::number('sort','排序',$c->getData('sort')),
Form::radio('is_show','状态',$c->getData('is_show'))->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]]) Form::radio('is_show','状态',$c->getData('is_show'))->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]])
]); ];
$form->setMethod('post')->setTitle('添加分类'); $form = Form::make_post_form('编辑分类',$field,Url::build('update',array('id'=>$id)),2);
$this->assign(compact('form')); $this->assign(compact('form'));
return $this->fetch('public/form-builder'); return $this->fetch('public/form-builder');
} }

View File

@ -17,9 +17,7 @@ use think\Request;
use app\admin\model\store\StoreCategory as CategoryModel; use app\admin\model\store\StoreCategory as CategoryModel;
use app\admin\model\store\StoreProduct as ProductModel; use app\admin\model\store\StoreProduct as ProductModel;
use think\Url; use think\Url;
use app\admin\model\ump\StoreSeckill as StoreSeckillModel;
use app\admin\model\order\StoreOrder as StoreOrderModel;
use app\admin\model\ump\StoreBargain as StoreBargainModel;
use app\admin\model\system\SystemAttachment; use app\admin\model\system\SystemAttachment;
@ -140,22 +138,27 @@ class StoreProduct extends AuthController
$menus[] = ['value'=>$menu['id'],'label'=>$menu['html'].$menu['cate_name'],'disabled'=>$menu['pid']== 0];//,'disabled'=>$menu['pid']== 0]; $menus[] = ['value'=>$menu['id'],'label'=>$menu['html'].$menu['cate_name'],'disabled'=>$menu['pid']== 0];//,'disabled'=>$menu['pid']== 0];
} }
return $menus; return $menus;
})->filterable(1)->multiple(1), })->filterable(1)->multiple(1)->required(),
Form::input('store_name','产品名称')->col(Form::col(24)), Form::input('store_name','产品名称')->col(Form::col(24))->validateFn(function($validate){
$validate->min(5)->max(32);
})->required(),
Form::input('store_info','产品简介')->type('textarea'), Form::input('store_info','产品简介')->type('textarea'),
Form::input('keyword','产品关键字')->placeholder('多个用英文状态下的逗号隔开'), Form::input('keyword','产品关键字')->placeholder('多个用英文状态下的逗号隔开'),
Form::input('unit_name','产品单位','件'), Form::input('unit_name','产品单位','件')->required(),
Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')))->icon('image')->width('100%')->height('550px'), Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')))->icon('image')->width('100%')->height('500px')->required(),
Form::frameImages('slider_image','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'slider_image','big'=>1)))->maxLength(5)->icon('images')->width('100%')->height('550px')->spin(0), Form::frameImages('slider_image','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'slider_image')))->maxLength(5)->icon('images')->width('100%')->height('500px')->spin(0)
Form::number('price','产品售价')->min(0)->col(8), ->required()->validateFn(function($validate){
$validate->min(1)->max(5);
}),
Form::number('price','产品售价')->min(0)->col(8)->required(),
Form::number('ot_price','产品市场价')->min(0)->col(8), Form::number('ot_price','产品市场价')->min(0)->col(8),
Form::number('give_integral','赠送积分')->min(0)->precision(0)->col(8), Form::number('give_integral','赠送积分')->min(0)->precision(0)->col(8),
Form::number('postage','邮费')->min(0)->col(Form::col(8)), Form::number('postage','邮费')->min(0)->col(Form::col(8))->required(),
Form::number('sales','销量')->min(0)->precision(0)->col(8), Form::number('sales','销量',0)->min(0)->precision(0)->col(8)->readonly(1),
Form::number('ficti','虚拟销量')->min(0)->precision(0)->col(8), Form::number('ficti','虚拟销量')->min(0)->precision(0)->col(8),
Form::number('stock','库存')->min(0)->precision(0)->col(8), Form::number('stock','库存')->min(0)->precision(0)->col(8)->required(),
Form::number('cost','产品成本价')->min(0)->col(8), Form::number('cost','产品成本价')->min(0)->col(8),
Form::number('sort','排序')->col(8), Form::number('sort','排序',0)->col(8)->required(),
Form::radio('is_show','产品状态',0)->options([['label'=>'上架','value'=>1],['label'=>'下架','value'=>0]])->col(8), Form::radio('is_show','产品状态',0)->options([['label'=>'上架','value'=>1],['label'=>'下架','value'=>0]])->col(8),
Form::radio('is_hot','热卖单品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8), Form::radio('is_hot','热卖单品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
Form::radio('is_benefit','促销单品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8), Form::radio('is_benefit','促销单品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
@ -163,8 +166,7 @@ class StoreProduct extends AuthController
Form::radio('is_new','首发新品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8), Form::radio('is_new','首发新品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
Form::radio('is_postage','是否包邮',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8) Form::radio('is_postage','是否包邮',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8)
]; ];
$form = Form::create(Url::build('save')); $form = Form::make_post_form('添加产品',$field,Url::build('save'),2);
$form->setMethod('post')->setTitle('添加产品')->components($field)->setSuccessScript('parent.$(".J_iframe:visible")[0].contentWindow.location.reload();');
$this->assign(compact('form')); $this->assign(compact('form'));
return $this->fetch('public/form-builder'); return $this->fetch('public/form-builder');
} }
@ -265,7 +267,7 @@ class StoreProduct extends AuthController
if(!$id) return $this->failed('数据不存在'); if(!$id) return $this->failed('数据不存在');
$product = ProductModel::get($id); $product = ProductModel::get($id);
if(!$product) return Json::fail('数据不存在!'); if(!$product) return Json::fail('数据不存在!');
$form = Form::create(Url::build('update',array('id'=>$id)),[ $field = [
Form::select('cate_id','产品分类',explode(',',$product->getData('cate_id')))->setOptions(function(){ Form::select('cate_id','产品分类',explode(',',$product->getData('cate_id')))->setOptions(function(){
$list = CategoryModel::getTierList(); $list = CategoryModel::getTierList();
$menus=[]; $menus=[];
@ -278,13 +280,13 @@ class StoreProduct extends AuthController
Form::input('store_info','产品简介',$product->getData('store_info'))->type('textarea'), Form::input('store_info','产品简介',$product->getData('store_info'))->type('textarea'),
Form::input('keyword','产品关键字',$product->getData('keyword'))->placeholder('多个用英文状态下的逗号隔开'), Form::input('keyword','产品关键字',$product->getData('keyword'))->placeholder('多个用英文状态下的逗号隔开'),
Form::input('unit_name','产品单位',$product->getData('unit_name')), Form::input('unit_name','产品单位',$product->getData('unit_name')),
Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')),$product->getData('image'))->icon('image')->width('100%')->height('550px'), Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')),$product->getData('image'))->icon('image')->width('100%')->height('500px'),
Form::frameImages('slider_image','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'slider_image')),json_decode($product->getData('slider_image'),1))->maxLength(5)->icon('images'), Form::frameImages('slider_image','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'slider_image')),json_decode($product->getData('slider_image'),1))->maxLength(5)->icon('images')->width('100%')->height('500px'),
Form::number('price','产品售价',$product->getData('price'))->min(0)->precision(2)->col(8), Form::number('price','产品售价',$product->getData('price'))->min(0)->precision(2)->col(8),
Form::number('ot_price','产品市场价',$product->getData('ot_price'))->min(0)->col(8), Form::number('ot_price','产品市场价',$product->getData('ot_price'))->min(0)->col(8),
Form::number('give_integral','赠送积分',$product->getData('give_integral'))->min(0)->precision(0)->col(8), Form::number('give_integral','赠送积分',$product->getData('give_integral'))->min(0)->precision(0)->col(8),
Form::number('postage','邮费',$product->getData('postage'))->min(0)->col(8), Form::number('postage','邮费',$product->getData('postage'))->min(0)->col(8),
Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(8), Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(8)->readonly(1),
Form::number('ficti','虚拟销量',$product->getData('ficti'))->min(0)->precision(0)->col(8), Form::number('ficti','虚拟销量',$product->getData('ficti'))->min(0)->precision(0)->col(8),
Form::number('stock','库存',ProductModel::getStock($id)>0?ProductModel::getStock($id):$product->getData('stock'))->min(0)->precision(0)->col(8), Form::number('stock','库存',ProductModel::getStock($id)>0?ProductModel::getStock($id):$product->getData('stock'))->min(0)->precision(0)->col(8),
Form::number('cost','产品成本价',$product->getData('cost'))->min(0)->col(8), Form::number('cost','产品成本价',$product->getData('cost'))->min(0)->col(8),
@ -295,8 +297,8 @@ class StoreProduct extends AuthController
Form::radio('is_best','精品推荐',$product->getData('is_best'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8), Form::radio('is_best','精品推荐',$product->getData('is_best'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
Form::radio('is_new','首发新品',$product->getData('is_new'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8), Form::radio('is_new','首发新品',$product->getData('is_new'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
Form::radio('is_postage','是否包邮',$product->getData('is_postage'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8) Form::radio('is_postage','是否包邮',$product->getData('is_postage'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8)
]); ];
$form->setMethod('post')->setTitle('编辑产品')->setSuccessScript('parent.$(".J_iframe:visible")[0].contentWindow.location.reload();'); $form = Form::make_post_form('编辑产品',$field,Url::build('update',array('id'=>$id)),2);
$this->assign(compact('form')); $this->assign(compact('form'));
return $this->fetch('public/form-builder'); return $this->fetch('public/form-builder');
} }
@ -325,7 +327,7 @@ class StoreProduct extends AuthController
'price', 'price',
'sort', 'sort',
'stock', 'stock',
'sales', // 'sales',
'ficti', 'ficti',
['give_integral',0], ['give_integral',0],
['is_show',0], ['is_show',0],
@ -350,7 +352,7 @@ class StoreProduct extends AuthController
if($data['postage'] == '' || $data['postage'] < 0) return Json::fail('请输入邮费'); if($data['postage'] == '' || $data['postage'] < 0) return Json::fail('请输入邮费');
if($data['cost'] == '' || $data['cost'] < 0) return Json::fail('请输入产品成本价'); if($data['cost'] == '' || $data['cost'] < 0) return Json::fail('请输入产品成本价');
if($data['stock'] == '' || $data['stock'] < 0) return Json::fail('请输入库存'); if($data['stock'] == '' || $data['stock'] < 0) return Json::fail('请输入库存');
if($data['sales'] == '' || $data['sales'] < 0) return Json::fail('请输入销量'); // if($data['sales'] == '' || $data['sales'] < 0) return Json::fail('请输入销量');
if($data['give_integral'] < 0) return Json::fail('请输入赠送积分'); if($data['give_integral'] < 0) return Json::fail('请输入赠送积分');
$data['image'] = $data['image'][0]; $data['image'] = $data['image'][0];
$data['slider_image'] = json_encode($data['slider_image']); $data['slider_image'] = json_encode($data['slider_image']);
@ -442,11 +444,17 @@ class StoreProduct extends AuthController
public function delete($id) public function delete($id)
{ {
if(!$id) return $this->failed('数据不存在'); if(!$id) return $this->failed('数据不存在');
$data['is_del'] = 1; if(!ProductModel::be(['id'=>$id])) return $this->failed('产品数据不存在');
if(!ProductModel::edit($data,$id)) if(ProductModel::be(['id'=>$id,'is_del'=>1])){
return Json::fail(ProductModel::getErrorInfo('删除失败,请稍候再试!')); return Json::fail(ProductModel::getErrorInfo('暂不支持回收站删除产品!'));
else }else{
return Json::successful('删除成功!'); $data['is_del'] = 1;
if(!ProductModel::edit($data,$id))
return Json::fail(ProductModel::getErrorInfo('删除失败,请稍候再试!'));
else
return Json::successful('成功移到回收站!');
}
} }

View File

@ -85,28 +85,11 @@ class SystemCleardata extends AuthController
SystemCleardata::ClearData('store_service_log',1); SystemCleardata::ClearData('store_service_log',1);
return Json::successful('清除数据成功!'); return Json::successful('清除数据成功!');
} }
//修改用户默认密码
public function userdate(){
SystemCleardata::ClearData('user',1);
$headimgurl= WechatUser::Where('uid',1)->value('headimgurl');
$data['account']='crmeb';
$data['pwd']=md5(123456);
$data['avatar']=$headimgurl;
$data['add_time']=time();
$data['status']=1;
$data['level']=0;
$data['user_type']="wechat";
$data['is_promoter']=1;
User::create($data);
return Json::successful('清除数据成功!');
}
//清除微信管理数据 //清除微信管理数据
public function wechatdata(){ public function wechatdata(){
SystemCleardata::ClearData('wechat_media',1); SystemCleardata::ClearData('wechat_media',1);
SystemCleardata::ClearData('wechat_reply',1); SystemCleardata::ClearData('wechat_reply',1);
SystemCleardata::ClearData('wechat_news_content',1);
SystemCleardata::ClearData('wechat_news',1);
SystemCleardata::ClearData('wechat_news_category',1);
$this->delDirAndFile('./public/uploads/wechat'); $this->delDirAndFile('./public/uploads/wechat');
return Json::successful('清除数据成功!'); return Json::successful('清除数据成功!');
} }
@ -117,15 +100,15 @@ class SystemCleardata extends AuthController
} }
//清除微信用户 //清除微信用户
public function wechatuserdata(){ public function wechatuserdata(){
$data= WechatUser::get(1)->toArray();
SystemCleardata::ClearData('wechat_user',1); SystemCleardata::ClearData('wechat_user',1);
unset($data['uid']); SystemCleardata::ClearData('user',1);
WechatUser::set($data);
return Json::successful('清除数据成功!'); return Json::successful('清除数据成功!');
} }
//清除内容分类 //清除内容分类
public function articledata(){ public function articledata(){
SystemCleardata::ClearData('article_category',1); SystemCleardata::ClearData('article_category',1);
SystemCleardata::ClearData('article',1);
SystemCleardata::ClearData('article_content',1);
$this->delDirAndFile('./public/uploads/article/'); $this->delDirAndFile('./public/uploads/article/');
return Json::successful('清除数据成功!'); return Json::successful('清除数据成功!');
} }
@ -133,15 +116,15 @@ class SystemCleardata extends AuthController
public function ClearData($table_name,$status){ public function ClearData($table_name,$status){
$table_name = Config::get('database')['prefix'].$table_name; $table_name = Config::get('database')['prefix'].$table_name;
if($status){ if($status){
db::query('TRUNCATE TABLE '.$table_name); @db::query('TRUNCATE TABLE '.$table_name);
}else{ }else{
db::query('DELETE FROM'.$table_name); @db::query('DELETE FROM'.$table_name);
} }
} }
//递归删除文件 //递归删除文件
function delDirAndFile($dirName,$subdir=true){ function delDirAndFile($dirName,$subdir=true){
if ($handle = opendir("$dirName")){ if ($handle = @opendir("$dirName")){
while(false !== ($item = readdir($handle))){ while(false !== ($item = readdir($handle))){
if($item != "." && $item != ".."){ if($item != "." && $item != ".."){
if(is_dir("$dirName/$item")) if(is_dir("$dirName/$item"))

View File

@ -20,11 +20,11 @@ class SystemFile extends AuthController
public function opendir($filedir=''){ public function opendir($filedir=''){
$fileAll = array('dir'=>[],'file'=>[]); $fileAll = array('dir'=>[],'file'=>[]);
if(Request::instance()->param('superior') && !empty(Request::instance()->param('dir'))){ if(Request::instance()->param('superior') && !empty(Request::instance()->param('dir'))){
$path = '.'.DS.Request::instance()->param('dir'); $path = './'.Request::instance()->param('dir');
$path = dirname($path); $path = dirname($path);
}else{ }else{
$path = !empty(Request::instance()->param('dir'))?Request::instance()->param('dir'):'.'; $path = !empty(Request::instance()->param('dir'))?Request::instance()->param('dir'):'.';
$path = $path.DS.Request::instance()->param('filedir'); $path = $path.'/'.Request::instance()->param('filedir');
} }
$list = scandir($path); $list = scandir($path);
foreach($list as $key=>$v) { foreach($list as $key=>$v) {
@ -38,6 +38,9 @@ class SystemFile extends AuthController
} }
} }
// var_dump($fileAll['file']); // var_dump($fileAll['file']);
//兼容windows
$uname=php_uname('s');
if(strstr($uname,'Windows')!==false) $path = ltrim($path,'\\');
$dir = ltrim($path,'./'); $dir = ltrim($path,'./');
$this->assign(compact('fileAll','dir')); $this->assign(compact('fileAll','dir'));
return $this->fetch(); return $this->fetch();
@ -65,6 +68,10 @@ class SystemFile extends AuthController
$comment = $this->request->post('comment'); $comment = $this->request->post('comment');
$filepath = $this->request->post('filepath'); $filepath = $this->request->post('filepath');
if(!empty($comment) && !empty($filepath)){ if(!empty($comment) && !empty($filepath)){
//兼容windows
$uname=php_uname('s');
if(strstr($uname,'Windows')!==false)
$filepath = ltrim(str_replace('/', DS, $filepath),'.');
$res = FileClass::write_file($filepath,$comment); $res = FileClass::write_file($filepath,$comment);
if($res){ if($res){
return Json::successful('保存成功!'); return Json::successful('保存成功!');

View File

@ -42,7 +42,7 @@ class StoreCoupon extends AuthController
public function create() public function create()
{ {
$f = array(); $f = array();
$f[] = Form::input('title','优惠券名称'); $f[] = Form::input('title','优惠券名称')->required();
$f[] = Form::number('coupon_price','优惠券面值',0)->min(0); $f[] = Form::number('coupon_price','优惠券面值',0)->min(0);
$f[] = Form::number('use_min_price','优惠券最低消费')->min(0); $f[] = Form::number('use_min_price','优惠券最低消费')->min(0);
$f[] = Form::number('coupon_time','优惠券有效期限')->min(0); $f[] = Form::number('coupon_time','优惠券有效期限')->min(0);

View File

@ -60,11 +60,14 @@ class StoreSeckill extends AuthController
if(is_object($seckillList['list'])) $seckillList['list'] = $seckillList['list']->toArray(); if(is_object($seckillList['list'])) $seckillList['list'] = $seckillList['list']->toArray();
$data = $seckillList['list']['data']; $data = $seckillList['list']['data'];
foreach ($data as $k=>$v){ foreach ($data as $k=>$v){
$data[$k]['_stop_time'] = date('Y/m/d H:i:s',$v['stop_time']); $data[$k]['_stop_time'] =$v['stop_time'] ? date('Y/m/d H:i:s',$v['stop_time']) : '';
} }
return Json::successlayui(['count'=>$seckillList['list']['total'],'data'=>$data]); return Json::successlayui(['count'=>$seckillList['list']['total'],'data'=>$data]);
} }
public function get_seckill_id(){
return Json::successlayui(StoreSeckillModel::getSeckillIdAll());
}
/** /**
* 添加秒杀产品 * 添加秒杀产品
* @return form-builder * @return form-builder
@ -103,6 +106,7 @@ class StoreSeckill extends AuthController
{ {
$data = Util::postMore([ $data = Util::postMore([
'title', 'title',
'product_id',
'info', 'info',
'unit_name', 'unit_name',
['image',''], ['image',''],
@ -124,6 +128,7 @@ class StoreSeckill extends AuthController
],$request); ],$request);
if(!$data['title']) return Json::fail('请输入产品标题'); if(!$data['title']) return Json::fail('请输入产品标题');
if(!$data['unit_name']) return Json::fail('请输入产品单位'); if(!$data['unit_name']) return Json::fail('请输入产品单位');
if(!$data['product_id']) return Json::fail('产品ID不能为空');
// var_dump($this->request->post()); // var_dump($this->request->post());
if(count($data['section_time'])<1) return Json::fail('请选择活动时间'); if(count($data['section_time'])<1) return Json::fail('请选择活动时间');
$data['start_time'] = strtotime($data['section_time'][0]); $data['start_time'] = strtotime($data['section_time'][0]);
@ -159,6 +164,7 @@ class StoreSeckill extends AuthController
if(!$product) return Json::fail('数据不存在!'); if(!$product) return Json::fail('数据不存在!');
$f = array(); $f = array();
$f[] = Form::input('title','产品标题',$product->getData('store_name')); $f[] = Form::input('title','产品标题',$product->getData('store_name'));
$f[] = Form::hidden('product_id',$id);
$f[] = Form::input('info','秒杀活动简介',$product->getData('store_info'))->type('textarea'); $f[] = Form::input('info','秒杀活动简介',$product->getData('store_info'))->type('textarea');
$f[] = Form::input('unit_name','单位',$product->getData('unit_name'))->placeholder('个、位'); $f[] = Form::input('unit_name','单位',$product->getData('unit_name'))->placeholder('个、位');
$f[] = Form::dateTimeRange('section_time','活动时间'); $f[] = Form::dateTimeRange('section_time','活动时间');
@ -170,7 +176,7 @@ class StoreSeckill extends AuthController
$f[] = Form::number('stock','库存',$product->getData('stock'))->min(0)->precision(0)->col(12); $f[] = Form::number('stock','库存',$product->getData('stock'))->min(0)->precision(0)->col(12);
$f[] = Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(12); $f[] = Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(12);
$f[] = Form::number('sort','排序',$product->getData('sort'))->col(12); $f[] = Form::number('sort','排序',$product->getData('sort'))->col(12);
$f[] = Form::number('num','单次购买产品个数')->precision(0)->col(12); $f[] = Form::number('num','单次购买产品个数',1)->precision(0)->col(12);
$f[] = Form::number('give_integral','赠送积分',$product->getData('give_integral'))->min(0)->precision(0)->col(12); $f[] = Form::number('give_integral','赠送积分',$product->getData('give_integral'))->min(0)->precision(0)->col(12);
$f[] = Form::number('postage','邮费',$product->getData('postage'))->min(0)->col(12); $f[] = Form::number('postage','邮费',$product->getData('postage'))->min(0)->col(12);
$f[] = Form::radio('is_postage','是否包邮',$product->getData('is_postage'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(12); $f[] = Form::radio('is_postage','是否包邮',$product->getData('is_postage'))->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(12);
@ -212,6 +218,7 @@ class StoreSeckill extends AuthController
$product = StoreSeckillModel::get($id); $product = StoreSeckillModel::get($id);
if(!$product) return Json::fail('数据不存在!'); if(!$product) return Json::fail('数据不存在!');
$f = array(); $f = array();
$f[] = Form::hidden('product_id',$product->getData('product_id'));
$f[] = Form::input('title','产品标题',$product->getData('title')); $f[] = Form::input('title','产品标题',$product->getData('title'));
$f[] = Form::input('info','秒杀活动简介',$product->getData('info'))->type('textarea'); $f[] = Form::input('info','秒杀活动简介',$product->getData('info'))->type('textarea');
$f[] = Form::input('unit_name','单位',$product->getData('unit_name'))->placeholder('个、位'); $f[] = Form::input('unit_name','单位',$product->getData('unit_name'))->placeholder('个、位');
@ -219,7 +226,7 @@ class StoreSeckill extends AuthController
$f[] = Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')),$product->getData('image'))->icon('image'); $f[] = Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')),$product->getData('image'))->icon('image');
$f[] = Form::frameImages('images','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'images')),json_decode($product->getData('images')))->maxLength(5)->icon('images'); $f[] = Form::frameImages('images','产品轮播图(640*640px)',Url::build('admin/widget.images/index',array('fodder'=>'images')),json_decode($product->getData('images')))->maxLength(5)->icon('images');
$f[] = Form::number('price','秒杀价',$product->getData('price'))->min(0)->col(12); $f[] = Form::number('price','秒杀价',$product->getData('price'))->min(0)->col(12);
$f[] = Form::number('ot_price','原价',$product->getData('price'))->min(0)->col(12); $f[] = Form::number('ot_price','原价',$product->getData('ot_price'))->min(0)->col(12);
$f[] = Form::number('cost','成本价',$product->getData('cost'))->min(0)->col(12); $f[] = Form::number('cost','成本价',$product->getData('cost'))->min(0)->col(12);
$f[] = Form::number('stock','库存',$product->getData('stock'))->min(0)->precision(0)->col(12); $f[] = Form::number('stock','库存',$product->getData('stock'))->min(0)->precision(0)->col(12);
$f[] = Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(12); $f[] = Form::number('sales','销量',$product->getData('sales'))->min(0)->precision(0)->col(12);

File diff suppressed because one or more lines are too long

View File

@ -25,8 +25,15 @@ class UserNotice extends AuthController
*/ */
public function index() public function index()
{ {
$this->assign(UserNoticeModel::getList()); if($this->request->isAjax()){
return $this->fetch(); $where=Util::getMore([
['page',1],
['limit',20]
]);
return Json::successlayui(UserNoticeModel::getList($where));
}else{
return $this->fetch();
}
} }
/** /**
@ -289,8 +296,9 @@ class UserNotice extends AuthController
public function send_user($id = 0,$uid = '') public function send_user($id = 0,$uid = '')
{ {
if(!$id || $uid == '') return JsonService::fail('参数错误'); if(!$id || $uid == '') return JsonService::fail('参数错误');
$uid = ",".$uid.","; $uids = UserNoticeModel::where(['id'=>$id])->value('uid');
UserNoticeModel::edit(array("is_send"=>1,"send_time"=>time(),'uid'=>$uid),$id); $uid = rtrim($uids,',').",".$uid.",";
UserNoticeModel::edit(array("send_time"=>time(),'uid'=>$uid),$id);
return Json::successful('发送成功!'); return Json::successful('发送成功!');
} }
} }

View File

@ -16,16 +16,17 @@ use think\Request;
*/ */
class Reply extends AuthController class Reply extends AuthController
{ {
/**关注回复
* @return mixed|void
*/
public function index() public function index()
{ {
if(empty(input('key'))) return $this->failed('请输入参数key'); if(empty(input('key'))) return $this->failed('请输入参数key');
if(empty(input('title'))) return $this->failed('请输入参数title'); if(empty(input('title'))) return $this->failed('请输入参数title');
$replay = WechatReply::where('key',input('key'))->find(); $replay = WechatReply::getDataByKey(input('key'));
$replay_arr =!empty($replay) ? $replay->toArray() : []; $this->assign('replay_arr',json_encode($replay));
$replay_arr['data'] = json_decode(isset($replay_arr['data']) ? $replay_arr['data'] : '',true);
$this->assign('replay_arr',json_encode($replay_arr));
$this->assign('key',input('key')); $this->assign('key',input('key'));
$this->assign('title',input('title')); $this->assign('title',urldecode(input('title')));
return $this->fetch(); return $this->fetch();
} }
@ -36,10 +37,8 @@ class Reply extends AuthController
],$this->request); ],$this->request);
// dump($where); // dump($where);
// exit(); // exit();
if(!empty($where['key'])) $replay = WechatReply::where('key',$where['key'])->find(); if(!empty($where['key'])) $replay_arr = WechatReply::getDataByKey($where['key']);
$replay_arr = $replay->toArray();
$replay_arr['code'] = 200; $replay_arr['code'] = 200;
$replay_arr['data'] = json_decode($replay_arr['data'],true);
if(empty($replay_arr)) { if(empty($replay_arr)) {
$replay_arr['code'] = 0; $replay_arr['code'] = 0;
} }
@ -117,10 +116,8 @@ class Reply extends AuthController
public function info_keyword(){ public function info_keyword(){
$key = input('key'); $key = input('key');
if(empty($key)) return $this->failed('参数错误,请重新修改'); if(empty($key)) return $this->failed('参数错误,请重新修改');
$replay = WechatReply::where('key',$key)->find(); $replay = WechatReply::getDataByKey($key);
$replay_arr = $replay->toArray(); $this->assign('replay_arr',json_encode($replay));
$replay_arr['data'] = json_decode($replay_arr['data'],true);
$this->assign('replay_arr',json_encode($replay_arr));
$this->assign('key',$key); $this->assign('key',$key);
$this->assign('dis',2); $this->assign('dis',2);
return $this->fetch('add_keyword'); return $this->fetch('add_keyword');

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
<?php <?php
namespace app\admin\controller\widget; namespace app\admin\controller\widget;
use function Sodium\add;
use think\Request; use think\Request;
use think\Url; use think\Url;
use app\admin\model\system\SystemAttachment as SystemAttachmentModel; use app\admin\model\system\SystemAttachment as SystemAttachmentModel;
@ -20,22 +19,15 @@ use service\FormBuilder as Form;
*/ */
class Images extends AuthController class Images extends AuthController
{ {
const dir = [
0=>['tid'=>0,'name'=>'编辑器','path'=>'editor']
,1=>['tid'=>1,'name'=>'产品图片','path'=>'store/product']
,2=>['tid'=>2,'name'=>'拼团图片','path'=>'store/combination']
,3=>['tid'=>3,'name'=>'砍价图片','path'=>'store/bargain']
,4=>['tid'=>4,'name'=>'秒杀图片','path'=>'store/seckill']
,5=>['tid'=>5,'name'=>'文章图片','path'=>'wechat/image']
,6=>['tid'=>6,'name'=>'组合数据图','path'=>'common']
];
/** /**
* 附件列表 * 附件列表
* @return \think\response\Json * @return \think\response\Json
*/ */
public function index() public function index()
{ {
$pid = input('pid')!=''?input('pid'):0; $pid = input('pid') != NULL ?input('pid'):session('pid');
if($pid != NULL)session('pid',$pid);
if(!empty(session('pid')))$pid = session('pid');
$this->assign('pid',$pid); $this->assign('pid',$pid);
//分类标题 //分类标题
$typearray = Category::getAll(); $typearray = Category::getAll();
@ -46,17 +38,20 @@ class Images extends AuthController
return $this->fetch('widget/images'); return $this->fetch('widget/images');
} }
/** /**
* 编辑器上传图片 * 图片管理上传图片
* @return \think\response\Json * @return \think\response\Json
*/ */
public function upload() public function upload()
{ {
$pid = input('pid')!=''?input('pid'):0; $pid = input('pid')!= NULL ?input('pid'):session('pid');
$res = Upload::image('file','attach'.DS.date('Y').DS.date('m').DS.date('d'));
$res = Upload::image('file',$pid.'/'.date('Ymd'));
$thumbPath = Upload::thumb($res->dir); $thumbPath = Upload::thumb($res->dir);
//产品图片上传记录 //产品图片上传记录
$fileInfo = $res->fileInfo->getinfo(); $fileInfo = $res->fileInfo->getinfo();
//入口是public需要替换图片路径
if(strpos(PUBILC_PATH,'public') == false){
$res->dir = str_replace('public/','',$res->dir);
}
SystemAttachmentModel::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,$thumbPath,$pid); SystemAttachmentModel::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,$thumbPath,$pid);
$info = array( $info = array(
// "originalName" => $fileInfo['name'], // "originalName" => $fileInfo['name'],
@ -66,7 +61,7 @@ class Images extends AuthController
// "type" => $fileInfo['type'], // "type" => $fileInfo['type'],
// "state" => "SUCCESS" // "state" => "SUCCESS"
'code' =>200, 'code' =>200,
'msg' =>'SUCCESS', 'msg' =>'上传成功',
'src' =>$res->dir 'src' =>$res->dir
); );
echo json_encode($info); echo json_encode($info);
@ -92,19 +87,13 @@ class Images extends AuthController
public function deleteimganddata($att_id){ public function deleteimganddata($att_id){
$attinfo = SystemAttachmentModel::get($att_id)->toArray(); $attinfo = SystemAttachmentModel::get($att_id)->toArray();
if($attinfo){ if($attinfo){
if(strpos($attinfo['att_dir'],'public') !== false){ @unlink(ROOT_PATH.ltrim($attinfo['att_dir'],'.'));
@unlink(ROOT_PATH.ltrim($attinfo['att_dir'],'/')); @unlink(ROOT_PATH.ltrim($attinfo['satt_dir'],'.'));
@unlink(ROOT_PATH.ltrim($attinfo['satt_dir'],'/'));
}else{
@unlink(ROOT_PATH.ltrim('public'.$attinfo['att_dir'],'/'));
@unlink(ROOT_PATH.ltrim('public'.$attinfo['satt_dir'],'/'));
}
SystemAttachmentModel::where(['att_id'=>$att_id])->delete(); SystemAttachmentModel::where(['att_id'=>$att_id])->delete();
} }
} }
/** /**
* 移动图片分类 * 移动图片分类显示
*/ */
public function moveimg($imgaes){ public function moveimg($imgaes){
@ -123,7 +112,7 @@ class Images extends AuthController
return $this->fetch('public/form-builder'); return $this->fetch('public/form-builder');
} }
/**移动图片 /**移动图片分类操作
* @param Request $request * @param Request $request
* @param $id * @param $id
*/ */

View File

@ -227,8 +227,8 @@ class FinanceModel extends ModelBasic
{ {
$trans = self::alias('a') $trans = self::alias('a')
->join('user b', 'a.uid=b.uid') ->join('user b', 'a.uid=b.uid')
->join('store_order_cart_info c', 'a.id=c.oid') ->join('__STORE_ORDER_CART_INFO__ c', 'a.id=c.oid')
->join('store_product d', 'c.product_id=d.id') ->join('__STORE_PRODUCT__ d', 'c.product_id=d.id')
->field('b.nickname,a.pay_price,d.store_name') ->field('b.nickname,a.pay_price,d.store_name')
->order('a.add_time DESC') ->order('a.add_time DESC')
->limit('6') ->limit('6')

View File

@ -10,11 +10,15 @@ namespace app\admin\model\order;
use app\admin\model\wechat\WechatUser; use app\admin\model\wechat\WechatUser;
use app\admin\model\ump\StorePink; use app\admin\model\ump\StorePink;
use app\admin\model\order\StoreOrderCartInfo;
use app\admin\model\store\StoreProduct; use app\admin\model\store\StoreProduct;
use app\admin\model\routine\RoutineFormId;
use app\admin\model\routine\RoutineTemplate;
use service\PHPExcelService; use service\PHPExcelService;
use traits\ModelTrait; use traits\ModelTrait;
use basic\ModelBasic; use basic\ModelBasic;
use service\WechatTemplateService; use service\WechatTemplateService;
use service\RoutineTemplateService;
use think\Url; use think\Url;
use think\Db; use think\Db;
/** /**
@ -26,11 +30,174 @@ class StoreOrder extends ModelBasic
{ {
use ModelTrait; use ModelTrait;
public static function orderCount(){
$data['wz']=self::statusByWhere(0,new self())->count();
$data['wf']=self::statusByWhere(1,new self())->count();
$data['ds']=self::statusByWhere(2,new self())->count();
$data['dp']=self::statusByWhere(3,new self())->count();
$data['jy']=self::statusByWhere(4,new self())->count();
$data['tk']=self::statusByWhere(-1,new self())->count();
$data['yt']=self::statusByWhere(-2,new self())->count();
$data['general']=self::where(['pink_id'=>0,'combination_id'=>0,'seckill_id'=>0])->count();
$data['pink']=self::where('pink_id|combination_id','neq',0)->count();
$data['seckill']=self::where('seckill_id','neq',0)->count();
return $data;
}
public static function OrderList($where){
$model = self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->field('a.*,r.nickname');
if($where['order']!=''){
$model = $model->order(self::setOrder($where['order']));
}else{
$model = $model->order('a.id desc');
}
if(isset($where['excel']) && $where['excel']==1){
$data=($data=$model->select()) && count($data) ? $data->toArray() : [];
}else{
$data=($data=$model->page((int)$where['page'],(int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
}
// $data=($data=$model->page((int)$where['page'],(int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
foreach ($data as &$item){
$_info = Db::name('store_order_cart_info')->where('oid',$item['id'])->field('cart_info')->select();
foreach ($_info as $k=>$v){
$_info[$k]['cart_info'] = json_decode($v['cart_info'],true);
}
$item['_info'] = $_info;
$item['add_time'] = date('Y-m-d H:i:s',$item['add_time']);
if($item['pink_id'] && $item['combination_id']){
$pinkStatus = StorePink::where('order_id_key',$item['id'])->value('status');
switch ($pinkStatus){
case 1:
$item['pink_name'] = '[拼团订单]正在进行中';
$item['color'] = '#f00';
break;
case 2:
$item['pink_name'] = '[拼团订单]已完成';
$item['color'] = '#00f';
break;
case 3:
$item['pink_name'] = '[拼团订单]未完成';
$item['color'] = '#f0f';
break;
default:
$item['pink_name'] = '[拼团订单]历史订单';
$item['color'] = '#457856';
break;
}
}else{
if($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9';
}else{
$item['pink_name'] = '[普通订单]';
$item['color'] = '#895612';
}
}
if($item['paid']==1){
switch ($item['pay_type']){
case 'weixin':
$item['pay_type_name']='微信支付';
break;
case 'yue':
$item['pay_type_name']='余额支付';
break;
case 'offline':
$item['pay_type_name']='线下支付';
break;
default:
$item['pay_type_name']='其他支付';
break;
}
}else{
switch ($item['pay_type']){
default:
$item['pay_type_name']='未支付';
break;
case 'offline':
$item['pay_type_name']='线下支付';
$item['pay_type_info']=1;
break;
}
}
if($item['paid']==0 && $item['status']==0){
$item['status_name']='未支付';
}else if($item['paid']==1 && $item['status']==0 && $item['refund_status']==0){
$item['status_name']='未发货';
}else if($item['paid']==1 && $item['status']==1 && $item['refund_status']==0){
$item['status_name']='待收货';
}else if($item['paid']==1 && $item['status']==2 && $item['refund_status']==0){
$item['status_name']='待评价';
}else if($item['paid']==1 && $item['status']==3 && $item['refund_status']==0){
$item['status_name']='已完成';
}else if($item['paid']==1 && $item['refund_status']==1){
$item['status_name']=<<<HTML
<b style="color:#f124c7">申请退款</b><br/>
<span>退款原因:{$item['refund_reason_wap']}</span>
HTML;
}else if($item['paid']==1 && $item['refund_status']==2){
$item['status_name']='已退款';
}
if($item['paid']==0 && $item['status']==0 && $item['refund_status']==0){
$item['_status']=1;
}else if($item['paid']==1 && $item['status']==0 && $item['refund_status']==0){
$item['_status']=2;
}else if($item['paid']==1 && $item['refund_status']==1){
$item['_status']=3;
}else if($item['paid']==1 && $item['status']==1 && $item['refund_status']==0){
$item['_status']=4;
}else if($item['paid']==1 && $item['status']==2 && $item['refund_status']==0){
$item['_status']=5;
}else if($item['paid']==1 && $item['status']==3 && $item['refund_status']==0){
$item['_status']=6;
}else if($item['paid']==1 && $item['refund_status']==2){
$item['_status']=7;
}
}
if(isset($where['excel']) && $where['excel']==1){
self::SaveExcel($data);
}
$count=self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->count();
return compact('count','data');
}
/*
* 保存并下载excel
* $list array
* return
*/
public static function SaveExcel($list){
$export = [];
foreach ($list as $index=>$item){
$_info = Db::name('store_order_cart_info')->where('oid',$item['id'])->column('cart_info');
$goodsName = [];
foreach ($_info as $k=>$v){
$v = json_decode($v,true);
$goodsName[] = implode(
[$v['productInfo']['store_name'],
isset($v['productInfo']['attrInfo']) ? '('.$v['productInfo']['attrInfo']['suk'].')' : '',
"[{$v['cart_num']} * {$v['truePrice']}]"
],' ');
}
$item['cartInfo'] = $_info;
$export[] = [
$item['order_id'],$item['pay_type_name'],
$item['total_num'],$item['total_price'],$item['total_postage'],$item['pay_price'],$item['refund_price'],
$item['mark'],$item['remark'],
[$item['real_name'],$item['user_phone'],$item['user_address']],
$goodsName,
[$item['paid'] == 1? '已支付':'未支付','支付时间: '.($item['pay_time'] > 0 ? date('Y/md H:i',$item['pay_time']) : '暂无')]
];
}
PHPExcelService::setExcelHeader(['订单号','支付方式','商品总数','商品总价','邮费','支付金额','退款金额','用户备注','管理员备注','收货人信息','商品信息','支付状态'])
->setExcelTile('订单导出','订单信息'.time(),' 生成时间:'.date('Y-m-d H:i:s',time()))
->setExcelContent($export)
->ExcelSave();
}
/** /**
* @param $where * @param $where
* @return array * @return array
*/ */
public static function systemPage($where,$userid){ public static function systemPage($where,$userid=false){
$model = self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->field('a.*,r.nickname'); $model = self::getOrderWhere($where,self::alias('a')->join('user r','r.uid=a.uid','LEFT'),'a.','r')->field('a.*,r.nickname');
if($where['order']){ if($where['order']){
$model = $model->order('a.'.$where['order']); $model = $model->order('a.'.$where['order']);
@ -52,7 +219,7 @@ class StoreOrder extends ModelBasic
$payType = '其他支付'; $payType = '其他支付';
} }
$_info = db('store_order_cart_info')->where('oid',$item['id'])->column('cart_info'); $_info = Db::name('store_order_cart_info')->where('oid',$item['id'])->column('cart_info');
$goodsName = []; $goodsName = [];
foreach ($_info as $k=>$v){ foreach ($_info as $k=>$v){
$v = json_decode($v,true); $v = json_decode($v,true);
@ -80,37 +247,39 @@ class StoreOrder extends ModelBasic
->ExcelSave(); ->ExcelSave();
} }
return self::page($model,function ($item){ return self::page($model,function ($item){
$item['nickname'] = WechatUser::where('uid',$item['uid'])->value('nickname'); $_info = Db::name('store_order_cart_info')->where('oid',$item['id'])->field('cart_info')->select();
$_info = db('store_order_cart_info')->where('oid',$item['id'])->field('cart_info')->select();
foreach ($_info as $k=>$v){ foreach ($_info as $k=>$v){
$_info[$k]['cart_info'] = json_decode($v['cart_info'],true); $_info[$k]['cart_info'] = json_decode($v['cart_info'],true);
} }
$item['_info'] = $_info; $item['_info'] = $_info;
if($item['pink_id'] && $item['combination_id']){ if($item['pink_id'] && $item['combination_id']){
$pinkStatus = StorePink::where('order_id_key',$item['id'])->value('status'); $pinkStatus = StorePink::where('order_id_key',$item['id'])->value('status');
if($pinkStatus == 1){ switch ($pinkStatus){
$item['pink_name'] = '[拼团订单]正在进行中'; case 1:
$item['color'] = '#f00'; $item['pink_name'] = '[拼团订单]正在进行中';
}else if($pinkStatus == 2){ $item['color'] = '#f00';
$item['pink_name'] = '[拼团订单]已完成'; break;
$item['color'] = '#00f'; case 2:
}else if($pinkStatus == 3){ $item['pink_name'] = '[拼团订单]已完成';
$item['pink_name'] = '[拼团订单]未完成'; $item['color'] = '#00f';
$item['color'] = '#f0f'; break;
}else{ case 3:
$item['pink_name'] = '[拼团订单]历史订单'; $item['pink_name'] = '[拼团订单]未完成';
$item['color'] = '#457856'; $item['color'] = '#f0f';
break;
default:
$item['pink_name'] = '[拼团订单]历史订单';
$item['color'] = '#457856';
break;
} }
}else{ }else{
if($item['seckill_id']){ if($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]'; $item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9'; $item['color'] = '#32c5e9';
}else{ }else{
$item['pink_name'] = '[普通订单]'; $item['pink_name'] = '[普通订单]';
$item['color'] = '#895612'; $item['color'] = '#895612';
} }
} }
},$where); },$where);
} }
@ -193,33 +362,114 @@ class StoreOrder extends ModelBasic
// $model = $model->where('combination_id',0); // $model = $model->where('combination_id',0);
if($where['status'] != '') $model = self::statusByWhere($where['status'],$model,$aler); if($where['status'] != '') $model = self::statusByWhere($where['status'],$model,$aler);
if($where['is_del'] != '' && $where['is_del'] != -1) $model = $model->where($aler.'is_del',$where['is_del']); if($where['is_del'] != '' && $where['is_del'] != -1) $model = $model->where($aler.'is_del',$where['is_del']);
if($where['combination_id'] =='普通订单'){ if(isset($where['combination_id'])){
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0); if($where['combination_id'] =='普通订单'){
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0);
}
if($where['combination_id'] =='拼团订单'){
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
}
if($where['combination_id'] =='秒杀订单'){
$model = $model->where($aler.'seckill_id',">",0);
}
} }
if($where['combination_id'] =='拼团订单'){ if(isset($where['type'])){
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0); switch ($where['type']){
} case 1:
if($where['combination_id'] =='秒杀订单'){ $model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0);
$model = $model->where($aler.'seckill_id',">",0); break;
case 2:
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
break;
case 3:
$model = $model->where($aler.'seckill_id',">",0);
break;
}
} }
if($where['real_name'] != ''){ if($where['real_name'] != ''){
$model = $model->where($aler.'order_id|'.$aler.'real_name|'.$aler.'user_phone'.($join ? '|'.$join.'.nickname|'.$join.'.uid':''),'LIKE',"%$where[real_name]%"); $model = $model->where($aler.'order_id|'.$aler.'real_name|'.$aler.'user_phone'.($join ? '|'.$join.'.nickname|'.$join.'.uid':''),'LIKE',"%$where[real_name]%");
} }
if($where['data'] !== ''){ if($where['data'] !== ''){
list($startTime,$endTime) = explode(' - ',$where['data']); $model = self::getModelTime($where,$model,$aler.'add_time');
$model = $model->where($aler.'add_time','>',strtotime($startTime));
$model = $model->where($aler.'add_time','<',strtotime($endTime));
} }
return $model; return $model;
} }
public static function getBadge($where){
$price=self::getOrderPrice($where);
return [
[
'name'=>'订单数量',
'field'=>'件',
'count'=>$price['total_num'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'售出商品',
'field'=>'件',
'count'=>$price['total_num'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'订单金额',
'field'=>'元',
'count'=>$price['pay_price'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'退款金额',
'field'=>'元',
'count'=>$price['refund_price'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'微信支付金额',
'field'=>'元',
'count'=>$price['pay_price_wx'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'余额支付金额',
'field'=>'元',
'count'=>$price['pay_price_yue'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'线下支付金额',
'field'=>'元',
'count'=>$price['pay_price_offline'],
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'积分抵扣',
'field'=>'分',
'count'=>$price['use_integral'].'(抵扣金额:¥'.$price['deduction_price'].')',
'background_color'=>'layui-bg-blue',
'col'=>2
],
[
'name'=>'退回积分',
'field'=>'元',
'count'=>$price['back_integral'],
'background_color'=>'layui-bg-blue',
'col'=>2
]
];
}
/** /**
* 处理订单金额 * 处理订单金额
* @param $where * @param $where
* @return array * @return array
*/ */
public static function getOrderPrice($where){ public static function getOrderPrice($where){
$where['is_del'] = 0;//删除订单不统计
$model = new self; $model = new self;
$price = array(); $price = array();
$price['pay_price'] = 0;//支付金额 $price['pay_price'] = 0;//支付金额
@ -233,7 +483,7 @@ class StoreOrder extends ModelBasic
$price['deduction_price'] = 0;//抵扣金额 $price['deduction_price'] = 0;//抵扣金额
$price['total_num'] = 0; //商品总数 $price['total_num'] = 0; //商品总数
$model = self::getOrderWhere($where,$model); $model = self::getOrderWhere($where,$model);
$list = $model->select()->toArray(); $list = $model->where('is_del',0)->select()->toArray();
foreach ($list as $v){ foreach ($list as $v){
$price['total_num'] = bcadd($price['total_num'],$v['total_num'],0); $price['total_num'] = bcadd($price['total_num'],$v['total_num'],0);
$price['pay_price'] = bcadd($price['pay_price'],$v['pay_price'],2); $price['pay_price'] = bcadd($price['pay_price'],$v['pay_price'],2);
@ -274,7 +524,7 @@ class StoreOrder extends ModelBasic
$payType = '其他支付'; $payType = '其他支付';
} }
$_info = db('store_order_cart_info')->where('oid',$item['id'])->column('cart_info'); $_info = Db::name('store_order_cart_info')->where('oid',$item['id'])->column('cart_info');
$goodsName = []; $goodsName = [];
foreach ($_info as $k=>$v){ foreach ($_info as $k=>$v){
$v = json_decode($v,true); $v = json_decode($v,true);
@ -301,7 +551,7 @@ class StoreOrder extends ModelBasic
return self::page($model,function ($item){ return self::page($model,function ($item){
$item['nickname'] = WechatUser::where('uid',$item['uid'])->value('nickname'); $item['nickname'] = WechatUser::where('uid',$item['uid'])->value('nickname');
$_info = db('store_order_cart_info')->where('oid',$item['id'])->field('cart_info')->select(); $_info = Db::name('store_order_cart_info')->where('oid',$item['id'])->field('cart_info')->select();
foreach ($_info as $k=>$v){ foreach ($_info as $k=>$v){
$_info[$k]['cart_info'] = json_decode($v['cart_info'],true); $_info[$k]['cart_info'] = json_decode($v['cart_info'],true);
} }
@ -631,28 +881,109 @@ class StoreOrder extends ModelBasic
] ]
]; ];
} }
/*
* 退款列表 /**微信 订单发货
* $where array * @param $oid
* return array * @param array $postageData
*/ */
// public static function getRefundList($where){ public static function orderPostageAfter($oid,$postageData = [])
// $refundlist=self::setEchatWhere($where)->field([ {
// 'order_id','total_price','coupon_price','deduction_price', $order = self::where('id',$oid)->find();
// 'use_integral','FROM_UNIXTIME(add_time,"%Y-%m-%d") as add_time','FROM_UNIXTIME(pay_time,"%Y-%m-%d") as pay_time','combination_id', $openid = WechatUser::uidToOpenid($order['uid']);
// 'seckill_id','bargain_id','cost','status','cart_id','pay_price','refund_status' $url = Url::build('wap/My/order',['uni'=>$order['order_id']],true,true);
// ])->page((int)$where['page'],(int)$where['limit'])->select(); $group = [
// count($refundlist) && $refundlist=$refundlist->toArray(); 'first'=>'亲,您的订单已发货,请注意查收',
// foreach($refundlist as &$item){ 'remark'=>'点击查看订单详情'
// $item['product']=StoreProduct::where('id','in',function ($quers) use($item){ ];
// $quers->name('store_cart')->where('id','in',json_decode($item['cart_id'],true))->field('product_id'); if($postageData['delivery_type'] == 'send'){//送货
// })->field(['store_name','cost','price','image'])->select()->toArray(); $goodsName = StoreOrderCartInfo::getProductNameList($order['id']);
// if($item['refund_status']==1) { $group = array_merge($group,[
// $item['_refund'] = '申请退款中'; 'keyword1'=>$goodsName,
// }elseif ($item['refund_status']==2){ 'keyword2'=>$order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i',$order['pay_time']),
// $item['_refund'] = '退款成功'; 'keyword3'=>$order['user_address'],
// } 'keyword4'=>$postageData['delivery_name'],
// } 'keyword5'=>$postageData['delivery_id']
// return $refundlist; ]);
// } WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_DELIVER_SUCCESS,$group,$url);
}else if($postageData['delivery_type'] == 'express'){//发货
$group = array_merge($group,[
'keyword1'=>$order['order_id'],
'keyword2'=>$postageData['delivery_name'],
'keyword3'=>$postageData['delivery_id']
]);
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_POSTAGE_SUCCESS,$group,$url);
}
}
/**
* 小程序 订单发货提醒
* @param int $oid
* @param array $postageData
* @return bool
*/
public static function sendOrderGoods($oid = 0,$postageData=array()){
if(!$oid || !$postageData) return true;
$order = self::where('id',$oid)->find();
$routine_openid = WechatUser::uidToRoutineOpenid($order['uid']);
if(!$routine_openid) return true;
if($postageData['delivery_type'] == 'send'){//送货
$data['keyword1']['value'] = $order['order_id'];
$data['keyword2']['value'] = $order['delivery_name'];
$data['keyword3']['value'] = $order['delivery_id'];
$data['keyword4']['value'] = date('Y-m-d H:i:s',time());
$data['keyword5']['value'] = '您的商品已经发货请注意查收';
$formId = RoutineFormId::getFormIdOne($order['uid']);
if($formId){
RoutineFormId::delFormIdOne($formId);
RoutineTemplateService::sendTemplate($routine_openid,
RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_DELIVER_SUCCESS),
'',
$data,
$formId);
}
}else if($postageData['delivery_type'] == 'express'){//发货
$data['keyword1']['value'] = $order['order_id'];
$data['keyword2']['value'] = $order['delivery_name'];
$data['keyword3']['value'] = $order['delivery_id'];
$data['keyword4']['value'] = date('Y-m-d H:i:s',time());
$data['keyword5']['value'] = '您的商品已经发货请注意查收';
$formId = RoutineFormId::getFormIdOne($order['uid']);
if($formId){
RoutineFormId::delFormIdOne($formId);
RoutineTemplateService::sendTemplate($routine_openid,
RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_POSTAGE_SUCCESS),
'',
$data,
$formId);
}
}
}
/**
* 获取订单总数
* @param int $uid
* @return int|string
*/
public static function getOrderCount($uid = 0){
if(!$uid) return 0;
return self::where('uid',$uid)->where('paid',1)->where('refund_status',0)->where('status',2)->count();
}
/**
* 获取已支付的订单
* @param int $is_promoter
* @return int|string
*/
public static function getOrderPayCount($is_promoter = 0){
return self::where('o.paid',1)->alias('o')->join('User u','u.uid=o.uid')->where('u.is_promoter',$is_promoter)->count();
}
/**
* 获取最后一个月已支付的订单
* @param int $is_promoter
* @return int|string
*/
public static function getOrderPayMonthCount($is_promoter = 0){
return self::where('o.paid',1)->alias('o')->whereTime('o.pay_time','last month')->join('User u','u.uid=o.uid')->where('u.is_promoter',$is_promoter)->count();
}
} }

View File

@ -0,0 +1,33 @@
<?php
/**
*
* @author: xaboy<365615158@qq.com>
* @day: 2017/12/26
*/
namespace app\admin\model\order;
use basic\ModelBasic;
use traits\ModelTrait;
class StoreOrderCartInfo extends ModelBasic
{
use ModelTrait;
/** 获取订单产品列表
* @param $oid
* @return array
*/
public static function getProductNameList($oid)
{
$cartInfo = self::where('oid',$oid)->select();
$goodsName = [];
foreach ($cartInfo as $cart){
$suk = isset($cart['cart_info']['productInfo']['attrInfo']) ? '('.$cart['cart_info']['productInfo']['attrInfo']['suk'].')' : '';
$goodsName[] = $cart['cart_info']['productInfo']['store_name'].$suk;
}
return $goodsName;
}
}

View File

@ -173,8 +173,8 @@ class StoreStatistics extends ModelBasic
{ {
$trans = self::alias('a') $trans = self::alias('a')
->join('user b', 'a.uid=b.uid') ->join('user b', 'a.uid=b.uid')
->join('store_order_cart_info c', 'a.id=c.oid') ->join('__STORE_ORDER_CART_INFO__ c', 'a.id=c.oid')
->join('store_product d', 'c.product_id=d.id') ->join('__STORE_PRODUCT__ d', 'c.product_id=d.id')
->field('b.nickname,a.pay_price,d.store_name') ->field('b.nickname,a.pay_price,d.store_name')
->order('a.add_time DESC') ->order('a.add_time DESC')
->limit('6') ->limit('6')
@ -200,6 +200,8 @@ class StoreStatistics extends ModelBasic
$cost=$info['cost'];//成本 $cost=$info['cost'];//成本
$export[] = [$time,$price,$zhichu,$cost,$coupon,$deduction,$profit]; $export[] = [$time,$price,$zhichu,$cost,$coupon,$deduction,$profit];
} }
// ExportService::exportCsv($export,'统计'.time(),['时间','营业额(元)','支出(元)','成本','优惠','积分抵扣','盈利(元)']);
dump($export);
PHPExcelService::setExcelHeader(['时间','营业额(元)','支出(元)','成本','优惠','积分抵扣','盈利(元)'])->setExcelTile('财务统计', '财务统计',date('Y-m-d H:i:s',time()))->setExcelContent($export)->ExcelSave(); PHPExcelService::setExcelHeader(['时间','营业额(元)','支出(元)','成本','优惠','积分抵扣','盈利(元)'])->setExcelTile('财务统计', '财务统计',date('Y-m-d H:i:s',time()))->setExcelContent($export)->ExcelSave();
} }
} }

View File

@ -0,0 +1,43 @@
<?php
namespace app\admin\model\routine;
use basic\ModelBasic;
use traits\ModelTrait;
/**
* 表单ID表
* Class RoutineFormId
* @package app\routine\model\routine
*/
class RoutineFormId extends ModelBasic {
use ModelTrait;
/**
* 删除已失效的formID
* @return int
*/
public static function delStatusInvalid(){
return self::where('status',2)->where('stop_time','LT',time())->delete();
}
/**
* 获取一个可以使用的formId
* @return bool|mixed
*/
public static function getFormIdOne($uid = 0){
$formId = self::where('status',1)->where('stop_time','GT',time())->where('uid',$uid)->order('id asc')->find();
if($formId) return $formId['form_id'];
else return false;
}
/**
* 修改一个FormID为已使用
* @param string $formId
* @return $this|bool
*/
public static function delFormIdOne($formId = ''){
if($formId == '') return true;
return self::where('form_id',$formId)->update(['status'=>2]);
}
}

View File

@ -7,7 +7,6 @@
namespace app\admin\model\store; namespace app\admin\model\store;
use traits\ModelTrait; use traits\ModelTrait;
use basic\ModelBasic; use basic\ModelBasic;
use service\UtilService; use service\UtilService;
@ -20,16 +19,39 @@ class StoreCategory extends ModelBasic
{ {
use ModelTrait; use ModelTrait;
/*
* 异步获取分类列表
* @param $where
* @return array
*/
public static function CategoryList($where){
$data=($data=self::systemPage($where,true)->page((int)$where['page'],(int)$where['limit'])->select()) && count($data) ? $data->toArray() :[];
foreach ($data as &$item){
if($item['pid']){
$item['pid_name'] = self::where('id',$item['pid'])->value('cate_name');
}else{
$item['pid_name'] = '顶级';
}
}
$count=self::systemPage($where,true)->count();
return compact('count','data');
}
/** /**
* @param $where * @param $where
* @return array * @return array
*/ */
public static function systemPage($where){ public static function systemPage($where,$isAjax=false){
$model = new self; $model = new self;
if($where['pid'] != '') $model = $model->where('pid',$where['pid']); if($where['pid'] != '') $model = $model->where('pid',$where['pid']);
else if($where['pid']=='' && $where['cate_name']=='') $model = $model->where('pid',0); else if($where['pid']=='' && $where['cate_name']=='') $model = $model->where('pid',0);
if($where['is_show'] != '') $model = $model->where('is_show',$where['is_show']); if($where['is_show'] != '') $model = $model->where('is_show',$where['is_show']);
if($where['cate_name'] != '') $model = $model->where('cate_name','LIKE',"%$where[cate_name]%"); if($where['cate_name'] != '') $model = $model->where('cate_name','LIKE',"%$where[cate_name]%");
if($isAjax===true){
if(isset($where['order']) && $where['order']!=''){
$model=$model->order(self::setOrder($where['order']));
}
return $model;
}
return self::page($model,function ($item){ return self::page($model,function ($item){
if($item['pid']){ if($item['pid']){
$item['pid_name'] = self::where('id',$item['pid'])->value('cate_name'); $item['pid_name'] = self::where('id',$item['pid'])->value('cate_name');

View File

@ -4,6 +4,7 @@ namespace app\admin\model\store;
use basic\ModelBasic; use basic\ModelBasic;
use traits\ModelTrait; use traits\ModelTrait;
use think\Db;
class StoreCouponUser extends ModelBasic class StoreCouponUser extends ModelBasic
{ {
@ -38,7 +39,7 @@ class StoreCouponUser extends ModelBasic
$coupon['_msg'] = '可使用'; $coupon['_msg'] = '可使用';
} }
} }
$coupon['integral']=db('store_coupon')->where(['id'=>$coupon['cid']])->value('integral'); $coupon['integral']= Db::name('store_coupon')->where(['id'=>$coupon['cid']])->value('integral');
} }
return $couponList; return $couponList;
} }
@ -53,7 +54,7 @@ class StoreCouponUser extends ModelBasic
[ [
'name'=>'总发放优惠券', 'name'=>'总发放优惠券',
'field'=>'张', 'field'=>'张',
'count'=>self::getModelTime($where,db('store_coupon_issue'))->where('status',1)->sum('total_count'), 'count'=>self::getModelTime($where, Db::name('store_coupon_issue'))->where('status',1)->sum('total_count'),
'background_color'=>'layui-bg-blue', 'background_color'=>'layui-bg-blue',
'col'=>6, 'col'=>6,
], ],
@ -69,7 +70,7 @@ class StoreCouponUser extends ModelBasic
//获取优惠劵图表 //获取优惠劵图表
public static function getConponCurve($where,$limit=20){ public static function getConponCurve($where,$limit=20){
//优惠劵发放记录 //优惠劵发放记录
$list=self::getModelTime($where,db('store_coupon_issue') $list=self::getModelTime($where, Db::name('store_coupon_issue')
->where('status',1) ->where('status',1)
->field(['FROM_UNIXTIME(add_time,"%Y-%m-%d") as _add_time','sum(total_count) as total_count'])->group('_add_time')->order('_add_time asc'))->select(); ->field(['FROM_UNIXTIME(add_time,"%Y-%m-%d") as _add_time','sum(total_count) as total_count'])->group('_add_time')->order('_add_time asc'))->select();
$date=[]; $date=[];

View File

@ -15,6 +15,9 @@ use traits\ModelTrait;
use basic\ModelBasic; use basic\ModelBasic;
use app\admin\model\store\StoreCategory as CategoryModel; use app\admin\model\store\StoreCategory as CategoryModel;
use app\admin\model\order\StoreOrder; use app\admin\model\order\StoreOrder;
use app\admin\model\ump\StoreSeckill as StoreSeckillModel;
use app\admin\model\ump\StoreCombination as StoreCombinationModel;
use app\admin\model\ump\StoreBargain as StoreBargainModel;
use app\admin\model\system\SystemConfig; use app\admin\model\system\SystemConfig;
/** /**
@ -26,6 +29,27 @@ class StoreProduct extends ModelBasic
{ {
use ModelTrait; use ModelTrait;
/**删除产品
* @param $id
*/
public static function proDelete($id){
//删除产品
//删除属性
//删除秒杀
//删除拼团
//删除砍价
//删除拼团
$model=new self();
self::beginTrans();
$res0 = $model::del($id);
$res1 = StoreSeckillModel::where(['product_id'=>$id])->delete();
$res2 = StoreCombinationModel::where(['product_id'=>$id])->delete();
$res3 = StoreBargainModel::where(['product_id'=>$id])->delete();
//。。。。
$res = $res0 && $res1 && $res2 && $res3;
self::checkTrans($res);
return $res;
}
/** /**
* 获取连表查询条件 * 获取连表查询条件
* @param $type * @param $type
@ -71,13 +95,7 @@ class StoreProduct extends ModelBasic
$model = $model->where('p.store_name|p.keyword|p.id','LIKE',"%$where[store_name]%"); $model = $model->where('p.store_name|p.keyword|p.id','LIKE',"%$where[store_name]%");
} }
if(isset($where['cate_id']) && trim($where['cate_id'])!=''){ if(isset($where['cate_id']) && trim($where['cate_id'])!=''){
$cate=CategoryModel::where('id',$where['cate_id'])->find(); $model = $model->where('p.cate_id','LIKE',"%$where[cate_id]%");
if($cate['pid']==0){
$arr=CategoryModel::where('pid',$cate['id'])->column('id');
$model = $model->where('p.cate_id','in',$arr);
}else{
$model = $model->where('p.cate_id','LIKE',"%$where[cate_id]%");
}
} }
if(isset($where['order']) && $where['order']!=''){ if(isset($where['order']) && $where['order']!=''){
$model = $model->order(self::setOrder($where['order'])); $model = $model->order(self::setOrder($where['order']));
@ -249,7 +267,7 @@ class StoreProduct extends ModelBasic
*/ */
public static function getMaxList($where){ public static function getMaxList($where){
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan']; $classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
$model=StoreOrder::alias('a')->join('StoreOrderCartInfo c','a.id=c.oid')->join('store_product b','b.id=c.product_id'); $model=StoreOrder::alias('a')->join('StoreOrderCartInfo c','a.id=c.oid')->join('__STORE_PRODUCT__ b','b.id=c.product_id');
$list=self::getModelTime($where,$model,'a.add_time')->group('c.product_id')->order('p_count desc')->limit(10) $list=self::getModelTime($where,$model,'a.add_time')->group('c.product_id')->order('p_count desc')->limit(10)
->field(['count(c.product_id) as p_count','b.store_name','sum(b.price) as sum_price'])->select(); ->field(['count(c.product_id) as p_count','b.store_name','sum(b.price) as sum_price'])->select();
if(count($list)) $list=$list->toArray(); if(count($list)) $list=$list->toArray();
@ -274,7 +292,7 @@ class StoreProduct extends ModelBasic
//获取利润 //获取利润
public static function ProfityTop10($where){ public static function ProfityTop10($where){
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan']; $classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
$model=StoreOrder::alias('a')->join('StoreOrderCartInfo c','a.id=c.oid')->join('store_product b','b.id=c.product_id'); $model=StoreOrder::alias('a')->join('StoreOrderCartInfo c','a.id=c.oid')->join('__STORE_PRODUCT__ b','b.id=c.product_id');
$list=self::getModelTime($where,$model,'a.add_time')->group('c.product_id')->order('profity desc')->limit(10) $list=self::getModelTime($where,$model,'a.add_time')->group('c.product_id')->order('profity desc')->limit(10)
->field(['count(c.product_id) as p_count','b.store_name','sum(b.price) as sum_price','(b.price-b.cost) as profity']) ->field(['count(c.product_id) as p_count','b.store_name','sum(b.price) as sum_price','(b.price-b.cost) as profity'])
->select(); ->select();
@ -366,7 +384,7 @@ class StoreProduct extends ModelBasic
}else{ }else{
$time['data']=isset($where['data'])? $where['data']:''; $time['data']=isset($where['data'])? $where['data']:'';
} }
$model=self::getModelTime($time,db('store_cart')->alias('a')->join('store_product b','a.product_id=b.id'),'a.add_time'); $model=self::getModelTime($time, Db::name('store_cart')->alias('a')->join('__STORE_PRODUCT__ b','a.product_id=b.id'),'a.add_time');
if(isset($where['title']) && $where['title']!=''){ if(isset($where['title']) && $where['title']!=''){
$model=$model->where('b.store_name|b.id','like',"%$where[title]%"); $model=$model->where('b.store_name|b.id','like',"%$where[title]%");
} }
@ -386,7 +404,7 @@ class StoreProduct extends ModelBasic
->select(); ->select();
$count=self::setWhere($where)->where('a.is_pay',1)->group('a.product_id')->count(); $count=self::setWhere($where)->where('a.is_pay',1)->group('a.product_id')->count();
foreach ($data as &$item){ foreach ($data as &$item){
$item['sum_price']=bcdiv($item['num_product'],$item['price'],2); $item['sum_price']=bcmul($item['num_product'],$item['price'],2);
} }
return compact('data','count'); return compact('data','count');
} }
@ -477,7 +495,7 @@ class StoreProduct extends ModelBasic
[ [
'name'=>'点赞次数', 'name'=>'点赞次数',
'field'=>'个', 'field'=>'个',
'count'=>db('store_product_relation')->where('product_id',$id)->where('type','like')->count(), 'count'=>Db::name('store_product_relation')->where('product_id',$id)->where('type','like')->count(),
'background_color'=>'layui-bg-blue', 'background_color'=>'layui-bg-blue',
], ],
[ [

View File

@ -77,7 +77,7 @@ class StoreProductAttr extends ModelBasic
]; ];
} }
foreach ($valueList as $k=>$value){ foreach ($valueList as $k=>$value){
ksort($value['detail'],SORT_STRING); sort($value['detail'],SORT_STRING);
$suk = implode(',',$value['detail']); $suk = implode(',',$value['detail']);
$valueGroup[$suk] = [ $valueGroup[$suk] = [
'product_id'=>$productId, 'product_id'=>$productId,

View File

@ -38,7 +38,7 @@ class SystemAttachment extends ModelBasic
$model = new self; $model = new self;
$where['pid'] = $id; $where['pid'] = $id;
$model->where($where)->order('att_id desc'); $model->where($where)->order('att_id desc');
return $model->page($model,$where,'',30); return $model->page($model,$where,'',24);
} }
/** /**
* 获取单条信息 * 获取单条信息

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php /** * * @author: xaboy<365615158@qq.com> * @day: 2017/11/02 */ namespace app\admin\model\system; use traits\ModelTrait; use basic\ModelBasic; use think\Db; /** * 配置分类model * * Class SystemConfigTab * @package app\admin\model\system */ class SystemConfigTab extends ModelBasic { use ModelTrait; /** * 获取单选按钮或者多选按钮的显示值 * */ public static function getRadioOrCheckboxValueInfo($menu_name,$value){ $parameter = array(); $option = array(); $config_one = \app\admin\model\system\SystemConfig::getOneConfig('menu_name',$menu_name); // dump($config_one); // exit(); // if(empty($menu) || !($config_one = self::get(['menu_name'=>$menu]))) return false; $parameter = explode("\n",$config_one['parameter']); foreach ($parameter as $k=>$v){ if(isset($v) && !empty($v)){ $option[$k] = explode('=',$v); } } // $value = json_decode($value,true); if(!is_array($value)){ $value = explode("\n",$value); } // dump($value); // dump($option); $value_arr = array();//选项的值 foreach ($option as $k=>$v){ foreach ($v as $kk=>$vv){ if(is_array($value)) { if (in_array($v[0], $value)) { $value_arr[$k] = $v[1]; } } break; } } if(empty($value_arr)){ return '空'; } return $value_arr; // exit(); // if(is_array($value)){ // foreach ($value as $k=>$value_v){ // if(in_array($value_v,$value_arr)){ // $i[$k] = 1; // } // } // if(count($value) != $i) return self::setErrorInfo('输入的值不属于选项中的参数'); // }else{ // if(in_array($value,$value_arr)){ // $i++; // } // if(!$i) return self::setErrorInfo('输入的值不属于选项中的参数'); // } // if($config_one['type'] == 'radio' && is_array($value)) return self::setErrorInfo('单选按钮的值是字符串不是数组'); } /** * 插入数据到数据库 * */ public static function set($data) { return self::create($data); } /** * 获取全部 * */ public static function getAll($type = 0){ $where['status'] = 1; if($type>-1)$where['type'] = $type; return Db::name('SystemConfigTab')->where($where)->select(); } /** * 获取配置分类 * */ public static function getSystemConfigTabPage($where = array()) { $model = new self; if($where['title'] != '') $model = $model->where('title','LIKE',"%$where[title]%"); if($where['status'] != '') $model = $model->where('status',$where['status']); return self::page($model,$where); } public static function edit($data,$id,$field='id') { return self::update($data,[$field=>$id]); } /** * 更新数据 * @access public * @param array $data 数据数组 * @param array $where 更新条件 * @param array|true $field 允许字段 * @return $this */ public static function update($data = [], $where = [], $field = null) { $model = new static(); if (!empty($field)) { $model->allowField($field); } $result = $model->isUpdate(true)->save($data, $where); return $model; } } <?php /** * * @author: xaboy<365615158@qq.com> * @day: 2017/11/02 */ namespace app\admin\model\system; use traits\ModelTrait; use basic\ModelBasic; use think\Db; /** * 配置分类model * * Class SystemConfigTab * @package app\admin\model\system */ class SystemConfigTab extends ModelBasic { use ModelTrait; /** * 获取单选按钮或者多选按钮的显示值 * */ public static function getRadioOrCheckboxValueInfo($menu_name,$value){ $parameter = array(); $option = array(); $config_one = SystemConfig::getOneConfig('menu_name',$menu_name); $parameter = explode("\n",$config_one['parameter']); foreach ($parameter as $k=>$v){ if(isset($v) && strlen($v)>0){ $data = explode('=>',$v); $option[$data[0]] = $data[1]; } } $str = ''; if(is_array($value)){ foreach ($value as $v){ $str .= $option[$v].','; } }else{ $str .= !empty($value)?$option[$value]:$option[0]; } return $str; } /** * 插入数据到数据库 * */ public static function set($data) { return self::create($data); } /** * 获取全部 * */ public static function getAll($type = 0){ $where['status'] = 1; if($type>-1)$where['type'] = $type; return Db::name('SystemConfigTab')->where($where)->select(); } /** * 获取配置分类 * */ public static function getSystemConfigTabPage($where = array()) { $model = new self; if($where['title'] != '') $model = $model->where('title','LIKE',"%$where[title]%"); if($where['status'] != '') $model = $model->where('status',$where['status']); return self::page($model,$where); } public static function edit($data,$id,$field='id') { return self::update($data,[$field=>$id]); } /** * 更新数据 * @access public * @param array $data 数据数组 * @param array $where 更新条件 * @param array|true $field 允许字段 * @return $this */ public static function update($data = [], $where = [], $field = null) { $model = new static(); if (!empty($field)) { $model->allowField($field); } $result = $model->isUpdate(true)->save($data, $where); return $model; } }

View File

@ -28,6 +28,7 @@ class SystemGroupData extends ModelBasic
$model = new self; $model = new self;
if($params['gid'] !== '') $model = $model->where('gid',$params['gid']); if($params['gid'] !== '') $model = $model->where('gid',$params['gid']);
if($params['status'] !== '') $model = $model->where('status',$params['status']); if($params['status'] !== '') $model = $model->where('status',$params['status']);
$model = $model->order('sort desc,id ASC');
return self::page($model,function($item,$key){ return self::page($model,function($item,$key){
$info = json_decode($item->value,true); $info = json_decode($item->value,true);
foreach ($info as $index => $value) { foreach ($info as $index => $value) {

View File

@ -161,7 +161,7 @@ class StoreSeckill extends ModelBasic
*/ */
public static function getMaxList($where){ public static function getMaxList($where){
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan']; $classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
$model=StoreOrder::alias('a')->join('store_seckill b','b.id=a.seckill_id')->where('a.paid',1); $model=StoreOrder::alias('a')->join('__STORE_SECKILL__ b','b.id=a.seckill_id')->where('a.paid',1);
$list=self::getModelTime($where,$model,'a.add_time')->group('a.seckill_id')->order('p_count desc')->limit(10) $list=self::getModelTime($where,$model,'a.add_time')->group('a.seckill_id')->order('p_count desc')->limit(10)
->field(['count(a.seckill_id) as p_count','b.title as store_name','sum(b.price) as sum_price'])->select(); ->field(['count(a.seckill_id) as p_count','b.title as store_name','sum(b.price) as sum_price'])->select();
if(count($list)) $list=$list->toArray(); if(count($list)) $list=$list->toArray();
@ -191,7 +191,7 @@ class StoreSeckill extends ModelBasic
*/ */
public static function ProfityTop10($where){ public static function ProfityTop10($where){
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan']; $classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
$model = StoreOrder::alias('a')->join('store_seckill b','b.id = a.seckill_id')->where('a.paid',1); $model = StoreOrder::alias('a')->join('__STORE_SECKILL__ b','b.id = a.seckill_id')->where('a.paid',1);
$list=self::getModelTime($where,$model,'a.add_time')->group('a.seckill_id')->order('profity desc')->limit(10) $list=self::getModelTime($where,$model,'a.add_time')->group('a.seckill_id')->order('profity desc')->limit(10)
->field(['count(a.seckill_id) as p_count','b.title as store_name','sum(b.price) as sum_price','(b.price-b.cost) as profity']) ->field(['count(a.seckill_id) as p_count','b.title as store_name','sum(b.price) as sum_price','(b.price-b.cost) as profity'])
->select(); ->select();
@ -244,7 +244,7 @@ class StoreSeckill extends ModelBasic
* @return mixed * @return mixed
*/ */
public static function getBargainRefundList($where = array()){ public static function getBargainRefundList($where = array()){
$model = StoreOrder::alias('a')->join('store_seckill b','b.id=a.seckill_id'); $model = StoreOrder::alias('a')->join('__STORE_SECKILL__ b','b.id=a.seckill_id');
$list = self::getModelTime($where,$model,'a.add_time')->where('a.refund_status','NEQ',0)->group('a.seckill_id')->order('count desc')->page((int)$where['page'],(int)$where['limit']) $list = self::getModelTime($where,$model,'a.add_time')->where('a.refund_status','NEQ',0)->group('a.seckill_id')->order('count desc')->page((int)$where['page'],(int)$where['limit'])
->field(['count(a.seckill_id) as count','b.title as store_name','sum(b.price) as sum_price'])->select(); ->field(['count(a.seckill_id) as count','b.title as store_name','sum(b.price) as sum_price'])->select();
if(count($list)) $list=$list->toArray(); if(count($list)) $list=$list->toArray();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,51 @@
<?php
/**
*
* @author: xaboy<365615158@qq.com>
* @day: 2017/12/25
*/
namespace app\admin\model\user;
use basic\ModelBasic;
use traits\ModelTrait;
class UserAddress extends ModelBasic
{
use ModelTrait;
protected $insert = ['add_time'];
protected function setAddTimeAttr()
{
return time();
}
public static function setDefaultAddress($id,$uid)
{
self::beginTrans();
$res1 = self::where('uid',$uid)->update(['is_default'=>0]);
$res2 = self::where('id',$id)->where('uid',$uid)->update(['is_default'=>1]);
$res =$res1 !== false && $res2 !== false;
self::checkTrans($res);
return $res;
}
public static function userValidAddressWhere($model=null,$prefix = '')
{
if($prefix) $prefix .='.';
$model = self::getSelfModel($model);
return $model->where("{$prefix}is_del",0);
}
public static function getUserValidAddressList($uid,$field = '*')
{
return self::userValidAddressWhere()->where('uid',$uid)->order('add_time DESC')->field($field)->select()->toArray()?:[];
}
public static function getUserDefaultAddress($uid,$field = '*')
{
return self::userValidAddressWhere()->where('uid',$uid)->where('is_default',1)->field($field)->find();
}
}

View File

@ -5,7 +5,7 @@ namespace app\admin\model\user;
use traits\ModelTrait; use traits\ModelTrait;
use basic\ModelBasic; use basic\ModelBasic;
use app\admin\model\wechat\WechatUser; use app\admin\model\wechat\WechatUser;
use think\Db;
/** /**
* 用户消费新增金额明细 model * 用户消费新增金额明细 model
* Class User * Class User
@ -16,11 +16,17 @@ class UserBill extends ModelBasic
{ {
use ModelTrait; use ModelTrait;
protected $insert = ['add_time'];
protected function setAddTimeAttr()
{
return time();
}
public static function income($title,$uid,$category,$type,$number,$link_id = 0,$balance = 0,$mark = '',$status = 1){ public static function income($title,$uid,$category,$type,$number,$link_id = 0,$balance = 0,$mark = '',$status = 1){
$pm = 1; $pm = 1;
return self::set(compact('title','uid','link_id','category','type','number','balance','mark','status','pm')); return self::set(compact('title','uid','link_id','category','type','number','balance','mark','status','pm'));
} }
//获取柱状图和饼状图数据 //获取柱状图和饼状图数据
public static function getUserBillChart($where,$category='now_money',$type='brokerage',$pm=1,$zoom=15){ public static function getUserBillChart($where,$category='now_money',$type='brokerage',$pm=1,$zoom=15){
$model=self::getModelTime($where,new self()); $model=self::getModelTime($where,new self());
@ -95,7 +101,7 @@ class UserBill extends ModelBasic
$list=self::alias('a')->join('user r','a.uid=r.uid') $list=self::alias('a')->join('user r','a.uid=r.uid')
->where($datawhere) ->where($datawhere)
->order('a.number desc') ->order('a.number desc')
->join('store_order o','o.id=a.link_id') ->join('__STORE_ORDER__ o','o.id=a.link_id')
->field(['o.order_id','FROM_UNIXTIME(a.add_time,"%Y-%c-%d") as add_time','a.uid','o.uid as down_uid','r.nickname','r.avatar','r.spread_uid','r.level','a.number']) ->field(['o.order_id','FROM_UNIXTIME(a.add_time,"%Y-%c-%d") as add_time','a.uid','o.uid as down_uid','r.nickname','r.avatar','r.spread_uid','r.level','a.number'])
->page((int)$where['page'],(int)$where['limit']) ->page((int)$where['page'],(int)$where['limit'])
->select(); ->select();
@ -105,7 +111,7 @@ class UserBill extends ModelBasic
//获取返佣用户总人数 //获取返佣用户总人数
public static function getFanCount(){ public static function getFanCount(){
$datawhere=['a.category'=>'now_money','a.type'=>'brokerage','a.pm'=>1]; $datawhere=['a.category'=>'now_money','a.type'=>'brokerage','a.pm'=>1];
return self::alias('a')->join('user r','a.uid=r.uid')->join('store_order o','o.id=a.link_id')->where($datawhere)->count(); return self::alias('a')->join('user r','a.uid=r.uid')->join('__STORE_ORDER__ o','o.id=a.link_id')->where($datawhere)->count();
} }
//获取用户充值数据 //获取用户充值数据
public static function getEchartsRecharge($where,$limit=15){ public static function getEchartsRecharge($where,$limit=15){
@ -139,7 +145,7 @@ class UserBill extends ModelBasic
count($list) && $list=$list->toArray(); count($list) && $list=$list->toArray();
$count=self::setOneWhere($where,$uid)->count(); $count=self::setOneWhere($where,$uid)->count();
foreach ($list as &$value){ foreach ($list as &$value){
$value['order_id']=db('store_order')->where(['order_id'=>$value['link_id']])->value('order_id'); $value['order_id']=Db::name('store_order')->where(['order_id'=>$value['link_id']])->value('order_id');
} }
return ['data'=>$list,'count'=>$count]; return ['data'=>$list,'count'=>$count];
} }

View File

@ -24,9 +24,23 @@ class UserNotice extends ModelBasic
/** /**
* @return array * @return array
*/ */
public static function getList(){ public static function getList($where=[]){
$model = new self; $model = new self;
$model->order('id desc'); $model->order('id desc');
if(!empty($where)){
$data=($data=$model->page((int)$where['page'],(int)$where['limit'])->select()) && count($data) ? $data->toArray() : [];
foreach ($data as &$item){
if($item["uid"] != ''){
$uids = explode(",",$item["uid"]);
array_splice($uids,0,1);
array_splice($uids,count($uids)-1,1);
$item["uid"] = $uids;
}
$item['send_time']=date('Y-m-d H:i:s',$item['send_time']);
}
$count=self::count();
return compact('data','count');
}
return self::page($model,function($item,$key){ return self::page($model,function($item,$key){
if($item["uid"] != ''){ if($item["uid"] != ''){
$uids = explode(",",$item["uid"]); $uids = explode(",",$item["uid"]);
@ -46,7 +60,7 @@ class UserNotice extends ModelBasic
$model = new self; $model = new self;
if(isset($where['title']) && $where['title'] != '') $model = $model->where('title','LIKE',"%".$where['title']."%"); if(isset($where['title']) && $where['title'] != '') $model = $model->where('title','LIKE',"%".$where['title']."%");
$model = $model->where('type',2); $model = $model->where('type',2);
$model = $model->where('is_send',0); // $model = $model->where('is_send',0);
$model = $model->order('id desc'); $model = $model->order('id desc');
return self::page($model,$where); return self::page($model,$where);
} }

View File

@ -33,9 +33,11 @@ class WechatMessage extends ModelBasic
'event_subscribe'=>'关注微信号', 'event_subscribe'=>'关注微信号',
'event_unsubscribe'=>'取消关注微信号', 'event_unsubscribe'=>'取消关注微信号',
'event_scan'=>'扫码', 'event_scan'=>'扫码',
'event_templatesendjobfinish'=>'进入小程序',
'event_location'=>'获取位置', 'event_location'=>'获取位置',
'event_click'=>'点击微信菜单关键字', 'event_click'=>'点击微信菜单关键字',
'event_view'=>'点击微信菜单链接', 'event_view'=>'点击微信菜单链接',
'event_view_miniprogram'=>'点击微信菜单进入小程序',
'text'=>'收到文本消息', 'text'=>'收到文本消息',
'image'=>'收到图片消息', 'image'=>'收到图片消息',
'video'=>'收到视频消息', 'video'=>'收到视频消息',

View File

@ -26,6 +26,15 @@ class WechatReply extends ModelBasic
public static $reply_type = ['text','image','news','voice']; public static $reply_type = ['text','image','news','voice'];
/**根据关键字查询一条
* @param $key
*/
public static function getDataByKey($key){
$resdata = [];
$resdata = self::where('key',$key)->find();
$resdata['data'] = json_decode($resdata['data'],true);
return $resdata;
}
public function getUrlAttr($value,$data) public function getUrlAttr($value,$data)
{ {
return $value == '' ? \think\Url::build('index/index/news',['id'=>$data['id']]) : $value; return $value == '' ? \think\Url::build('index/index/news',['id'=>$data['id']]) : $value;
@ -194,4 +203,5 @@ class WechatReply extends ModelBasic
} }
} }

View File

@ -33,7 +33,7 @@ use service\SystemConfigService;
protected $insert = ['add_time']; protected $insert = ['add_time'];
/** /**
* 用uid获得openid * 用uid获得 微信openid
* @param $uid * @param $uid
* @return mixed * @return mixed
*/ */
@ -47,6 +47,21 @@ use service\SystemConfigService;
Cache::set($cacheName,$openid,0); Cache::set($cacheName,$openid,0);
return $openid; return $openid;
} }
/**
* 用uid获得 小程序 openid
* @param $uid
* @return mixed
*/
public static function uidToRoutineOpenid($uid,$update = false)
{
$cacheName = 'routine_openid'.$uid;
$openid = Cache::get($cacheName);
if($openid && !$update) return $openid;
$openid = self::where('uid',$uid)->value('routine_openid');
if(!$openid) exception('对应的routine_openid不存在!');
Cache::set($cacheName,$openid,0);
return $openid;
}
public static function setAddTimeAttr($value) public static function setAddTimeAttr($value)
{ {
@ -145,7 +160,7 @@ use service\SystemConfigService;
* @return array * @return array
*/ */
public static function agentSystemPage($where = array(),$isall=false){ public static function agentSystemPage($where = array(),$isall=false){
self::setWechatUserOrder();//设置 一级推荐人 二级推荐人 一级推荐人订单 二级推荐人订单 佣金 // self::setWechatUserOrder();//设置 一级推荐人 二级推荐人 一级推荐人订单 二级推荐人订单 佣金
$model = new self; $model = new self;
if($isall==false) { if($isall==false) {
$status = (int)SystemConfigService::get('store_brokerage_statu'); $status = (int)SystemConfigService::get('store_brokerage_statu');
@ -155,7 +170,7 @@ use service\SystemConfigService;
} }
} }
} }
$model = $model->where('openid','NOT NULL'); // $model = $model->where('openid','NOT NULL');
if($where['nickname'] !== '') $model = $model->where('nickname','LIKE',"%$where[nickname]%"); if($where['nickname'] !== '') $model = $model->where('nickname','LIKE',"%$where[nickname]%");
if($where['data'] !== ''){ if($where['data'] !== ''){
list($startTime,$endTime) = explode(' - ',$where['data']); list($startTime,$endTime) = explode(' - ',$where['data']);
@ -203,7 +218,6 @@ use service\SystemConfigService;
$item['qr_code'] = QrcodeService::getForeverQrcode('spread',$item['uid']); $item['qr_code'] = QrcodeService::getForeverQrcode('spread',$item['uid']);
$item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid']);//累计提现 $item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid']);//累计提现
$item['extract_count_num'] = UserExtract::getUserCountNum($item['uid']);//提现次数 $item['extract_count_num'] = UserExtract::getUserCountNum($item['uid']);//提现次数
// $item['qr_code'] = '';
},$where); },$where);
} }

View File

@ -28,7 +28,7 @@
{$vo.add_time|date="Y-m-d H:i:s",###} {$vo.add_time|date="Y-m-d H:i:s",###}
</td> </td>
<td class="text-center"> <td class="text-center">
{$vo.uid|getOrderCount} {$vo.orderCount}
</td> </td>
<td class="text-center"> <td class="text-center">
{$vo.now_money} {$vo.now_money}

File diff suppressed because one or more lines are too long

View File

@ -1,26 +1,33 @@
{extend name="public/container"} {extend name="public/container"}
{block name="head_top"} {block name="head_top"}
<link href="{__ADMIN_PATH}module/wechat/news/css/index.css" type="text/css" rel="stylesheet"> <link href="/public/system/module/wechat/news/css/index.css" type="text/css" rel="stylesheet">
{/block} {/block}
{block name="content"} {block name="content"}
<style> <style>
tr td img{height: 80px;} tr td img{height: 50px;}
</style> </style>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-3">
<div class="ibox">
<div class="ibox-title">分类</div>
<div class="ibox-content">
<ul class="folder-list m-b-md">
{volist name="tree" id="vo"}
<li class="p-xxs"><a href="{:Url('article.article/index',array('pid'=>$vo.id))}">{$vo.level|str_repeat='.....',###}{$vo.title}</a></li>
{/volist}
</ul>
</div>
</div>
</div>
<div class="col-sm-9 m-l-n-md">
<div class="ibox"> <div class="ibox">
<div class="ibox-title"> <div class="ibox-title">
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create',array('cid'=>$cid))}',{w:1000,h:760})">添加文章</button> <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create',array('cid'=>$where.cid))}',{w:1100,h:760})">添加文章</button>
<div style="margin-top: 2rem"></div> <div style="margin-top: 2rem"></div>
<div class="row"> <div class="row">
<div class="m-b m-l"> <div class="m-b m-l">
<form action="" class="form-inline"> <form action="" class="form-inline">
<select name="cid" aria-controls="editable" class="form-control input-sm">
<option value="">所有分类</option>
{volist name="cate" id="vo"}
<option value="{$vo.id}" {eq name="where.cid" value="$vo.id"}selected="selected"{/eq}>{$vo.html}{$vo.title}</option>
{/volist}
</select>
<div class="input-group"> <div class="input-group">
<input type="text" name="title" value="{$where.title}" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn"><button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span> <input type="text" name="title" value="{$where.title}" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn"><button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
</div> </div>
@ -33,28 +40,26 @@
<thead> <thead>
<tr> <tr>
<th class="text-center" width="5%">id</th> <th class="text-center" width="5%">id</th>
<th class="text-center" width="8%">分类</th>
<th class="text-center" width="10%">图片</th> <th class="text-center" width="10%">图片</th>
<th class="text-center" width="10%">标题</th> <th class="text-left" >[分类]标题</th>
<th class="text-center" width="30%">简介</th> <th class="text-center" width="8%">浏览量</th>
<th class="text-center" width="10%">操作</th> <th class="text-center" width="15%">添加时间</th>
<th class="text-center" width="15%">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{volist name="list" id="vo"} {volist name="list" id="vo"}
<tr> <tr>
<td class="text-center">{$vo.id}</td> <td>{$vo.id}</td>
<td class="text-center">{$vo.catename}</td> <td>
<td class="text-center">
<img src="{$vo.image_input}"/> <img src="{$vo.image_input}"/>
</td> </td>
<td>{$vo.title}</td> <td>[{$vo.catename}]{$vo.title}</td>
<td class="text-center"> <td>{$vo.visit}</td>
{$vo.synopsis} <td>{$vo.add_time|date="Y-m-d H:i:s",###}</td>
</td>
<td class="text-center"> <td class="text-center">
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('create',array('id'=>$vo['id'],'cid'=>$cid))}',{w:1000,h:760})"><i class="fa fa-paste"></i> 编辑</button> <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('create',array('id'=>$vo['id'],'cid'=>$where.cid))}',{w:1100,h:760})"><i class="fa fa-paste"></i> 编辑</button>
<button class="btn btn-warning btn-xs del_news_one" data-id="{$vo.id}" type="button" data-url="{:Url('delete',array('id'=>$vo['id']))}" ><i class="fa fa-warning"></i> 删除 <button class="btn btn-warning btn-xs del_news_one" data-id="{$vo.id}" type="button" data-url="{:Url('delete',array('id'=>$vo['id']))}" ><i class="fa fa-warning"></i> 删除
@ -65,11 +70,13 @@
</table> </table>
</div> </div>
</div> </div>
<div style="margin-left: 10px">
{include file="public/inner_page"}
</div>
</div> </div>
</div> </div>
<div style="margin-left: 10px">
{include file="public/inner_page"}
</div>
{/block} {/block}
{block name="script"} {block name="script"}
<script> <script>

View File

@ -169,115 +169,66 @@
</div> </div>
</div> </div>
</div> </div>
{/block} {/block}
{block name="script"} {block name="script"}
<script> <script>
(function(){ (function(){
$('.j-fail').on('click',function(){ $('.j-fail').on('click',function(){
var url = $(this).data('url'); var url = $(this).data('url');
$eb.$alert('textarea',{ $eb.$alert('textarea',{
title:'请输入未通过愿意', title:'请输入未通过愿意',
value:'输入信息不完整或有误!', value:'输入信息不完整或有误!',
},function(value){ },function(value){
$eb.axios.post(url,{message:value}).then(function(res){ $eb.axios.post(url,{message:value}).then(function(res){
if(res.data.code == 200) {
if(res.data.code == 200) $eb.$swal('success', res.data.msg);
setTimeout(function () {
$eb.$swal('success',res.data.msg); window.location.reload();
},1000);
else
$eb.$swal('error',res.data.msg||'操作失败!');
});
});
});
$('.j-success').on('click',function(){
var url = $(this).data('url');
$eb.$swal('delete',function(){
$eb.axios.post(url).then(function(res){
if(res.data.code == 200)
$eb.$swal('success',res.data.msg);
else
$eb.$swal('error',res.data.msg||'操作失败!');
});
},{
title:'确定审核通过?',
text:'通过后无法撤销,请谨慎操作!',
confirm:'审核通过'
});
});
$('.btn-warning').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else }else
$eb.$swal('error',res.data.msg||'操作失败!');
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
}); });
});
}) });
$('.j-success').on('click',function(){
var url = $(this).data('url');
$eb.$swal('delete',function(){
$eb.axios.post(url).then(function(res){
if(res.data.code == 200) {
setTimeout(function () {
window.location.reload();
},1000);
$eb.$swal('success', res.data.msg);
}else
$eb.$swal('error',res.data.msg||'操作失败!');
});
},{
title:'确定审核通过?',
text:'通过后无法撤销,请谨慎操作!',
confirm:'审核通过'
});
});
$('.btn-warning').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
}); });
$(".open_image").on('click',function (e) { $(".open_image").on('click',function (e) {
var image = $(this).data('image'); var image = $(this).data('image');
$eb.openImage(image); $eb.openImage(image);
}) })
}()); }());
</script> </script>
{/block} {/block}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> 404 页面</title>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description" content="H+是一个完全响应式基于Bootstrap3最新版本开发的扁平化主题她采用了主流的左右两栏式布局使用了Html5+CSS3等现代技术">
<link rel="shortcut icon" href="favicon.ico">
<link href="{__FRAME_PATH}css/bootstrap.min.css" rel="stylesheet">
<link href="{__FRAME_PATH}css/font-awesome.css?v=4.4.0" rel="stylesheet">
<link href="{__FRAME_PATH}css/style.min.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="middle-box text-center animated fadeInDown">
<h1>404</h1>
<h3 class="font-bold">页面未找到!</h3>
<div class="error-desc">
抱歉,页面好像去火星了~
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> {$title}</title>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description" content="H+是一个完全响应式基于Bootstrap3最新版本开发的扁平化主题她采用了主流的左右两栏式布局使用了Html5+CSS3等现代技术">
<link rel="shortcut icon" href="favicon.ico">
<link href="{__FRAME_PATH}css/bootstrap.min.css" rel="stylesheet">
<link href="{__FRAME_PATH}css/font-awesome.css?v=4.4.0" rel="stylesheet">
<link href="{__FRAME_PATH}css/style.min.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="middle-box text-center animated fadeInDown">
<h1>500</h1>
<h3 class="font-bold">服务器内部错误</h3>
<div class="error-desc">
服务器好像出错了...
<p>{$msg}</p>
</div>
</div>
</body>
</html>

View File

@ -26,7 +26,7 @@
<a class="refresh" href="javascript:location.reload();">刷新试试</a> <a class="refresh" href="javascript:location.reload();">刷新试试</a>
<a class="back" href="javascript:void(0);">返回上一页</a> <a class="back" href="javascript:void(0);">返回上一页</a>
</p> </p>
<p class="tips">crmeb提示您:您可能输入了错误的网址,或者该网页已删除或移动,<span class="nmb">3</span>秒钟后自动跳转</p> <p class="tips">CRMEB提示您:您可能输入了错误的网址,或者该网页已删除或移动,<span class="nmb">3</span>秒钟后自动跳转</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,11 +3,17 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title><?=$form->getTitle()?></title> <title><?=$form->getTitle()?></title>
<?=implode("\r\n",$form->getScript())?> <script src="https://cdn.bootcss.com/vue/2.5.13/vue.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/iview@2.14.3/dist/styles/iview.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/iview@2.14.3/dist/iview.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/form-create/district/province_city.js"></script>
<script src="https://cdn.jsdelivr.net/npm/form-create@1.5.1/dist/form-create.min.js"></script>
<style> <style>
/*弹框样式修改*/ /*弹框样式修改*/
.ivu-modal-body{padding: 5;} .ivu-modal-body{padding: 5;}
.ivu-modal-confirm-footer{display: none;} .ivu-modal-confirm-footer{display: none;}
.ivu-date-picker {display: inline-block;line-height: normal;width: 280px;}
</style> </style>
</head> </head>
<body> <body>
@ -19,10 +25,89 @@
//关闭当前窗口 //关闭当前窗口
// var index = parent.layer.getFrameIndex(window.name); // var index = parent.layer.getFrameIndex(window.name);
// parent.layer.close(index); // parent.layer.close(index);
//提交成功后按钮恢复
$r.btn.finish();
}; };
(function () {
var create = <?=$form->formScript()?> (function () {
create(); var create = (function () {
var getRule = function () {
var rule = <?=json_encode($form->getRules())?>;
rule.forEach(function (c) {
if ((c.type == 'cascader' || c.type == 'tree') && Object.prototype.toString.call(c.props.data) == '[object String]') {
if (c.props.data.indexOf('js.') === 0) {
c.props.data = window[c.props.data.replace('js.', '')];
}
}
});
return rule;
}, vm = new Vue,name = 'formBuilderExec<?= !$form->getId() ? '' : '_'.$form->getId() ?>';
var _b = false;
window[name] = function create(el, callback) {
if(_b) return ;
_b = true;
if (!el) el = document.body;
var $f = formCreate.create(getRule(), {
el: el,
form:<?=json_encode($form->getConfig('form'))?>,
row:<?=json_encode($form->getConfig('row'))?>,
submitBtn:<?=$form->isSubmitBtn() ? '{}' : 'false'?>,
resetBtn:<?=$form->isResetBtn() ? 'true' : '{}'?>,
iframeHelper:true,
upload: {
onExceededSize: function (file) {
vm.$Message.error(file.name + '超出指定大小限制');
},
onFormatError: function () {
vm.$Message.error(file.name + '格式验证失败');
},
onError: function (error) {
vm.$Message.error(file.name + '上传失败,(' + error + ')');
},
onSuccess: function (res) {
if (res.code == 200) {
return res.data.filePath;
} else {
vm.$Message.error(res.msg);
}
}
},
//表单提交事件
onSubmit: function (formData) {
$f.submitStatus({loading: true});
$.ajax({
url: '<?=$form->getAction()?>',
type: '<?=$form->getMethod()?>',
dataType: 'json',
data: formData,
success: function (res) {
if (res.code == 200) {
vm.$Message.success(res.msg);
$f.submitStatus({loading: false});
formCreate.formSuccess && formCreate.formSuccess(res, $f, formData);
callback && callback(0, res, $f, formData);
//TODO 表单提交成功!
} else {
vm.$Message.error(res.msg || '表单提交失败');
$f.btn.finish();
callback && callback(1, res, $f, formData);
//TODO 表单提交失败
}
},
error: function () {
vm.$Message.error('表单提交失败');
$f.btn.finish();
}
});
}
});
return $f;
};
return window[name];
}());
window.$f = create();
// create();
})(); })();
</script> </script>
</body> </body>

View File

@ -26,7 +26,7 @@
<div class="text"> <div class="text">
<p class="status">{$msg}</p> <p class="status">{$msg}</p>
<p class="countdown"><span class="nmb">3</span>秒钟后自动跳转,<a class="back" href="javascript:void(0);">点此手动跳转</a></p> <p class="countdown"><span class="nmb">3</span>秒钟后自动跳转,<a class="back" href="javascript:void(0);">点此手动跳转</a></p>
<p class="tips">crmeb提示您:您访问的页面正在跳转中,请耐心等待…</p> <p class="tips">CRMEB提示您:您访问的页面正在跳转中,请耐心等待…</p>
</div> </div>
</div> </div>
</div> </div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,236 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<link href="{__FRAME_PATH}css/plugins/footable/footable.core.css" rel="stylesheet">
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
<script src="{__FRAME_PATH}js/plugins/footable/footable.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline" id="form">
<div class="search-item" data-name="data">
<span>创建时间:</span>
<button style="height: 26px;line-height: 12px;font-size: 12px;" type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.today}">今天</button>
<button style="height: 26px;line-height: 12px;font-size: 12px;" type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.week}">本周</button>
<button style="height: 26px;line-height: 12px;font-size: 12px;" type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.month}">本月</button>
<button style="height: 26px;line-height: 12px;font-size: 12px;" type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.quarter}">本季度</button>
<button style="height: 26px;line-height: 12px;font-size: 12px;" type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.year}">本年</button>
<div class="datepicker" style="display: inline-block;">
<button style="height: 26px;line-height: 12px;font-size: 12px;" type="button" class="btn btn-outline btn-link" data-value="{$where.data?:'no'}">自定义</button>
</div>
<input class="search-item-value" type="hidden" name="data" value="{$where.data}" />
</div>
<div class="search-item" data-name="status">
<span>砍价状态:</span>
<button type="button" class="btn btn-outline btn-link" data-value="">全部</button>
<button type="button" class="btn btn-outline btn-link" data-value="1">开启</button>
<button type="button" class="btn btn-outline btn-link" data-value="0">关闭</button>
<input class="search-item-value" type="hidden" name="status" value="{$where.status}" />
</div>
<div class="input-group" style="float: right;">
<span class="input-group-btn">
<input type="hidden" name="export" value="0">
<input type="text" name="store_name" value="{$where.store_name}" placeholder="请输入产品名称,关键字,编号" class="input-sm form-control" size="38">
<button type="submit" id="no_export" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button>
<button type="submit" id="export" class="btn btn-sm btn-info btn-outline"> <i class="fa fa-exchange" ></i> Excel导出</button></span>
<script>
$('#export').on('click',function(){
$('input[name=export]').val(1);
});
$('#no_export').on('click',function(){
$('input[name=export]').val(0);
});
</script>
</div>
</form>
</div>
</div>
<div class="table-responsive" style="margin-top: 20px;">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">砍价活动名称</th>
<th class="text-center">砍价产品名称</th>
<th class="text-center">砍价图片</th>
<th class="text-center">砍价价格</th>
<th class="text-center">砍价状态</th>
<th class="text-center">活动状态</th>
<th class="text-center">库存</th>
<th class="text-center">排序</th>
<th class="text-center">内容</th>
<th class="text-center" width="5%">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.store_name}
</td>
<td class="text-center">
<img src="{$vo.image}" alt="{$vo.store_name}" class="open_image" data-image="{$vo.image}" style="width: 50px;height: 50px;cursor: pointer;">
</td>
<td class="text-center">
{$vo.price}
</td>
<td class="text-center">
<i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
{$vo.start_name}
</td>
<td class="text-center">
{$vo.stock}
</td>
<td class="text-center">
{$vo.sort}
</td>
<td class="text-center">
<button type="button" class="btn btn-xs btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit_content',array('id'=>$vo['id']))}')"><i class="fa fa-pencil"></i> 编辑内容</button>
</td>
<td class="text-center">
<div class="input-group-btn js-group-btn" style="min-width: 106px;">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{$vo.store_name}-编辑','{:Url('edit',array('id'=>$vo['id']))}')">
<i class="fa fa-paste"></i> 编辑
</a>
</li>
<li>
<a href="javascript:void(0);" id="delstor" data-url="{:Url('delete',array('id'=>$vo['id']))}">
<i class="fa fa-warning"></i> 删除
</a>
</li>
</ul>
</div>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.search-item>li').on('click', function () {
var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = $('#form');
form.find('input[name="' + name + '"]').val(value);
$('input[name=export]').val(0);
form.submit();
});
$('.search-item>.btn').on('click',function(){
var that = $(this),value = that.data('value'),p = that.parent(),name = p.data('name'),form = p.parents();
form.find('input[name="'+name+'"]').val(value);
$('input[name=export]').val(0);
form.submit();
});
$('.search-item-value').each(function(){
var that = $(this),name = that.attr('name'), value = that.val(),dom = $('.search-item[data-name="'+name+'"] .btn[data-value="'+value+'"]');
dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary btn-sm')
.siblings().addClass('btn-outline btn-link').removeClass('btn-primary btn-sm')
});
$('.search-is>.btn').on('click',function(){
var that = $(this),value = that.data('value'),p = that.parent(),name = p.data('name'),form = p.parents();
var valueAdmin = form.find('input[name="'+name+'"]').val();
if(valueAdmin) value = '';
else value = 1;
form.find('input[name="'+name+'"]').val(value);
$('input[name=export]').val(0);
form.submit();
});
$('.js-group-btn').on('click',function(){
$('.js-group-btn').css({zIndex:1});
$(this).css({zIndex:2});
});
$('.search-is-value').each(function(){
var that = $(this),name = that.attr('name'), value = that.val(),dom = $('.search-is[data-name="'+name+'"] .btn[data-value="'+value+'"]');
dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary btn-sm')
.siblings().addClass('btn-outline btn-link').removeClass('btn-primary btn-sm')
});
$('#delstor').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
});
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '取消',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
//$("input[name=limit_time]").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("input[name=data]").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
$('input[name=export]').val(0);
$('form').submit();
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -1,133 +1,172 @@
{extend name="public/container"} {extend name="public/container"}
{block name="content"} {block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-title">
<a type="button" class="btn btn-w-m btn-primary" href="{:Url('index')}">分类首页</a>
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加分类</button>
<div class="ibox-tools">
<div class="layui-fluid">
<div class="layui-row layui-col-space15" id="app">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">搜索条件</div>
<div class="layui-card-body">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">所有分类</label>
<div class="layui-input-block">
<select name="is_show">
<option value="">是否显示</option>
<option value="1">显示</option>
<option value="0">不显示</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">所有分类</label>
<div class="layui-input-block">
<select name="pid">
<option value="">所有菜单</option>
{volist name="cate" id="vo"}
<option value="{$vo.id}">{$vo.html}{$vo.cate_name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">产品名称</label>
<div class="layui-input-block">
<input type="text" name="cate_name" class="layui-input" placeholder="请输入分类名称">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
<i class="layui-icon layui-icon-search"></i>搜索</button>
</div>
</div>
</div>
</form>
</div> </div>
</div> </div>
<div class="ibox-content"> </div>
<div class="row"> <!--产品列表-->
<div class="m-b m-l"> <div class="layui-col-md12">
<form action="" class="form-inline"> <div class="layui-card">
<select name="is_show" aria-controls="editable" class="form-control input-sm"> <div class="layui-card-header">分类列表</div>
<option value="">是否显示</option> <div class="layui-card-body">
<option value="1" {eq name="where.is_show" value="1"}selected="selected"{/eq}>显示</option> <div class="alert alert-info" role="alert">
<option value="0" {eq name="where.is_show" value="0"}selected="selected"{/eq}>不显示</option> :点击父级名称可查看子集分类,点击分页首页可返回顶级分类;分类名称和排序可进行快速编辑;
</select> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<select name="pid" aria-controls="editable" class="form-control input-sm">
<option value="">所有菜单</option>
{volist name="cate" id="vo"}
<option value="{$vo.id}" {eq name="where.pid" value="$vo.id"}selected="selected"{/eq}>{$vo.html}{$vo.cate_name}</option>
{/volist}
</select>
<div class="input-group">
<input type="text" name="cate_name" value="{$where.cate_name}" placeholder="请输入分类名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search" ></i> 搜索</button> </span>
</div>
</form>
</div> </div>
<div class="layui-btn-container">
<a class="layui-btn layui-btn-sm" href="{:Url('index')}">分类首页</a>
<button type="button" class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加分类</button>
</div>
<table class="layui-hide" id="List" lay-filter="List"></table>
<script type="text/html" id="pic">
<img style="cursor: pointer" lay-event='open_image' src="{{d.pic}}">
</script>
<script type="text/html" id="is_show">
<input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='显|隐' {{ d.is_show == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="pid">
<a href="{:Url('index')}?pid={{d.id}}">查看</a>
</script>
<script type="text/html" id="act">
<button class="layui-btn layui-btn-xs" onclick="$eb.createModalFrame('编辑','{:Url('edit')}?id={{d.id}}')">
<i class="fa fa-paste"></i> 编辑
</button>
<button class="layui-btn layui-btn-xs" lay-event='delstor'>
<i class="fa fa-warning"></i> 删除
</button>
</script>
</div> </div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center" style="width: 40px;">编号</th>
<th class="text-center">父级</th>
<th class="text-center">分类名称</th>
<th class="text-center">分类图标</th>
<th class="text-center">排序</th>
<th class="text-center">是否显示</th>
<th class="text-center" width="5%">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.pid_name}
</td>
<td class="text-center">
<a href="{:Url('index',array('pid'=>$vo['id']))}"> {$vo.cate_name}</a>
</td>
<td class="text-center">
<img src="{$vo.pic}" alt="{$vo.cate_name}" class="open_image" data-image="{$vo.pic}" style="width: 50px;height: 50px;cursor: pointer;">
</td>
<td class="text-center">
{$vo.sort}
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_show' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
<div class="input-group-btn js-group-btn" style="min-width: 106px;">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0);"onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')">
<i class="fa fa-paste"></i> 编辑
</a>
</li>
<li>
<a href="javascript:void(0);" class="delstor" data-url="{:Url('delete',array('id'=>$vo['id']))}">
<i class="fa fa-warning"></i> 删除
</a>
</li>
</ul>
</div>
</div>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
{/block} {/block}
{block name="script"} {block name="script"}
<script> <script>
$('.js-group-btn').on('click',function(){ setTimeout(function () {
$('.js-group-btn').css({zIndex:1}); $('.alert-info').hide();
$(this).css({zIndex:2}); },3000);
//实例化form
layList.form.render();
//加载列表
layList.tableList('List',"{:Url('category_list',['pid'=>$pid])}",function (){
return [
{field: 'id', title: 'ID', sort: true,event:'id',width:'6%'},
{field: 'pid_name', title: '父级'},
{field: 'cate_name', title: '分类名称',edit:'cate_name'},
{field: 'pid', title: '查看子分类',templet:'#pid'},
{field: 'pic', title: '分类图标',templet:'#pic'},
{field: 'sort', title: '排序',sort: true,event:'sort',edit:'sort',width:'8%'},
{field: 'is_show', title: '状态',templet:'#is_show',width:'6%'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
];
}); });
$('.delstor').on('click',function(){ //自定义方法
window.t = $(this); var action= {
var _this = $(this),url =_this.data('url'); set_category: function (field, id, value) {
$eb.$swal('delete',function(){ layList.baseGet(layList.Url({
$eb.axios.get(url).then(function(res){ c: 'store.store_category',
console.log(res); a: 'set_category',
if(res.status == 200 && res.data.code == 200) { q: {field: field, id: id, value: value}
$eb.$swal('success',res.data.msg); }), function (res) {
_this.parents('tr').remove(); layList.msg(res.msg);
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
}); });
}) },
}
//查询
layList.search('search',function(where){
layList.reload(where);
}); });
$(".open_image").on('click',function (e) { layList.switch('is_show',function (odj,value) {
var image = $(this).data('image'); if(odj.elem.checked==true){
$eb.openImage(image); layList.baseGet(layList.Url({c:'store.store_category',a:'set_show',p:{is_show:1,id:value}}),function (res) {
layList.msg(res.msg);
});
}else{
layList.baseGet(layList.Url({c:'store.store_category',a:'set_show',p:{is_show:0,id:value}}),function (res) {
layList.msg(res.msg);
});
}
});
//快速编辑
layList.edit(function (obj) {
var id=obj.data.id,value=obj.value;
switch (obj.field) {
case 'cate_name':
action.set_category('cate_name',id,value);
break;
case 'sort':
action.set_category('sort',id,value);
break;
}
});
//监听并执行排序
layList.sort(['id','sort'],true);
//点击事件绑定
layList.tool(function (event,data,obj) {
switch (event) {
case 'delstor':
var url=layList.U({c:'store.store_category',a:'delete',q:{id:data.id}});
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
obj.del();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
break;
case 'open_image':
$eb.openImage(data.pic);
break;
}
}) })
</script> </script>
{/block} {/block}

View File

@ -1,371 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
{include file="public/head"}
<title>{$title|default=''}</title>
<style>
.demo-upload{
display: block;
height: 33px;
text-align: center;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0,0,0,.2);
margin-right: 4px;
}
.demo-upload img{
width: 100%;
height: 100%;
display: block;
}
.demo-upload-cover{
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.6);
}
.demo-upload:hover .demo-upload-cover{
display: block;
}
.demo-upload-cover i{
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
.check{color: #f00}
</style>
</head>
<body>
<div id="store-attr" class="mp-form" v-cloak="">
<i-Form :label-width="80" style="width: 100%" v-show="hidden == false">
<Form-Item>
<Row>
<i-Col span="5">
<i-Button type="dashed" long @click="hiddenBool" icon="plus-round">添加新规则</i-Button>
</i-Col>
</Row>
</Form-Item>
</i-Form>
<i-Form :label-width="80" style="width: 100%" v-show="hidden == true">
<Form-Item
:label="'规则名称:'">
<Row>
<i-Col style="position: relative;margin-right: 6px" span="5"
v-for="(item, index) in items"
:key="index">
<i-Input type="text" v-model="item.value" placeholder="设置名称"></i-Input>
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="handleRemove(index)" v-show="item.attrHidden == true"><Icon type="close-round" /></i-Button>
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="attrHiddenBool(item)" v-show="item.attrHidden == false"><Icon type="checkmark-round"></Icon></i-Button>
</i-Col>
<i-Col span="5">
<i-Button type="dashed" long @click="handleAdd" icon="plus-round">添加新规则</i-Button>
</i-Col>
</Row>
</Form-Item>
<Form-Item v-show="item.attrHidden == true"
v-for="(item, index) in items"
:key="index"
:label="''+item.value+':'" >
<Row>
<i-Col span="3"
v-for="(attr,k) in item.detail"
:key="attr"
:name="attr">
<Tag type="border" closable color="blue" @on-close="attrRemove(item,k)">{{ attr }}</Tag>
</i-Col>
<i-Col span="5">
<i-Input type="text" v-model="item.detailValue" placeholder="设置属性"></i-Input>
</i-Col>
<i-Col span="5">
<i-Button type="primary" style="margin-left: 6px" @click="attrAdd(item)">添加</i-Button>
</i-Col>
</Row>
</Form-Item>
<Form-Item v-show="hidden == true" style="width: 100%;">
<Row style="margin: 0 88px 0 20px">
<i-Col span="24">
<i-Button type="primary" long @click="addGoods(true)">生成</i-Button>
</i-Col>
</Row>
</Form-Item>
<template v-if="items[0].value!='' && items[0].detail.length>0 && attrs.length">
<template v-for="(attr,index) in attrs">
<Form-Item>
<Row>
<template v-for="(item,index) in attr.detail">
<i-Col span="3" style="margin-right: 3px">
{{index}}:{{item}}
</i-Col>
</template>
<i-Col span="5" style="margin-right: 3px">
<span :class="attr.check ? 'check':''">金额:</span><i-Input placeholder="请输入金额" v-model="attr.price" style="width: 68%"
:number="true"></i-Input>
</i-Col>
<i-Col span="5" style="margin-right: 3px">
<span :class="attr.check ? 'check':''">库存:</span><i-Input placeholder="请输入库存" v-model="attr.sales" style="width: 68%"
:number="true"></i-Input>
</i-Col>
<i-Col span="2" offset="1" style="margin-right: 3px">
<div class="demo-upload">
<img :src="attr.pic">
<div class="demo-upload-cover">
<Icon type="ios-eye-outline" @click.native="openPic(attr.pic)" ></Icon>
<Upload
:show-upload-list="false"
:on-success="uploadSuccess(attr)"
:on-error="uploadError"
:format="['jpg','jpeg','png']"
:max-size="2048"
accept="image/*"
:on-format-error="uploadFormatError"
action="{:Url('upload')}"
style="display: inline-block"
:goods="attr"
>
<Icon type="ios-cloud-upload-outline"></Icon>
</Upload>
</div>
</div>
</i-Col>
<i-Col span="2" style="margin-right: 3px">
<i-Button type="ghost" @click="removeGoods(index)">删除</i-Button>
</i-Col>
</Row>
</Form-Item>
</template>
<Form-Item>
<Row>
<!-- <i-Col span="10">-->
<!-- <i-Button type="dashed" long @click="addGoods" icon="plus-round">添加新商品</i-Button>-->
<!-- </i-Col>-->
<i-Col span="2" offset="2">
<i-Button type="primary" @click="submit">提交</i-Button>
</i-Col>
<i-Col span="2" offset="1">
<i-Button type="error" @click="clear">清空所有属性</i-Button>
</i-Col>
</Row>
</Form-Item>
</template>
</i-Form>
<Spin fix v-show="submiting == true">保存中...</Spin>
</div>
<script>
var _vm ;
mpFrame.start(function(Vue){
new Vue({
data () {
return {
hidden:false,
submiting :false,
items: <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?> || [
{
value: '',
detailValue:'',
attrHidden:false,
detail:[]
}
],
attrs:<?php echo $result && isset($result['value']) && !empty($result['value']) ? json_encode($result['value']) : '[]'; ?>
}
},
watch:{
items:{
handler:function(){
// this.attrs = [];
},
deep:true
}
},
methods: {
attrHiddenBool(item){
if(item.value == ''){
$eb.message('error','请填写规则名称');
}else{
item.attrHidden = true;
}
},
hiddenBool(){
this.hidden = true;
},
handleAdd () {
if(!this.checkAttr())return ;
this.items.push({
value: '',
detailValue:'',
attrHidden:false,
detail:[]
});
},
checkAttr(){
var bool = true;
this.items.map(function(item){
if(!bool) return;
if(!item.value){
$eb.message('error','请填写规则名称');
bool = false;
}else if(!item.detail.length){
$eb.message('error','请设置规则属性');
bool = false;
}
});
return bool;
},
attrAdd (item) {
if(!item.detailValue) return false;
item.detail.push(item.detailValue);
item.detailValue = '';
},
handleRemove (index) {
if(this.items.length > 1)
this.items.splice(index,1);
else
$eb.message('error','请设置至少一个规则');
},
attrRemove(item,k){
if(1==item.detail.length){
$eb.message('error','请设置至少一个属性');
return false;
}
item.detail.splice(k,1);
},
removeGoods(index){
this.attrs.splice(index,1);
},
checkGoods(){
var bool = true;
this.attrs.map(function(attr){
if(!bool) return ;
if(!Object.keys(attr.detail).length){
$eb.message('error','请选择至少一个属性');
bool = false;
}else if(attr.price != parseFloat(attr.price) || attr.price < 0){
$eb.message('error','请输入正确的商品价格');
bool = false;
}else if(attr.sales != parseInt(attr.sales) || attr.sales < 0){
$eb.message('error','请输入正确的商品库存');
bool = false;
}
});
return bool;
},
addGoods(type){
var that = this;
if(this.attrs.length){
if(!this.checkGoods())return ;
}
$eb.axios.post("{:Url('is_format_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
if(res.data.code == 200){
that.attrs = res.data.data
}else{
$eb.message('error',res.data.msg);
}
}).catch(function(err){
if(res.data.code == 200){
that.attrs = res.data.data
}else{
$eb.message('error',res.data.msg);
}
})
// if(type === true){
// this.attrs = [{
// detail:{},
// price:'',
// sales:'',
// pic:'{$image}'
// }];
// }else{
// this.attrs.push({
// detail:{},
// price:'',
// sales:'',
// pic:'{$image}'
// });
// }
},
openPic(src){
$eb.openImage(src);
},
uploadSuccess(data){
return function(response, file, fileList){
if(response.code == 200){
data.pic = response.data.url;
}else{
$eb.message('error',response.data.msg || '图片上传失败!');
}
}
},
uploadError(error, file, fileList){
$eb.message('error',error);
},
uploadFormatError(file, fileList){
$eb.message('error','图片格式错误');
},
submit(){
var that = this;
that.submiting = true;
if(!this.checkAttr() || !this.checkGoods()) return ;
for(let attr in that.attrs){
that.attrs[attr].check = false;
}
$eb.axios.post("{:Url('set_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
that.submiting = false;
if(res.status == 200 && res.data.code == 200){
$eb.message('success',res.data.msg || '编辑成功!');
$eb.closeModalFrame(window.name);
}else{
$eb.message('error',res.data.msg || '请求失败!');
}
}).catch(function(err){
$eb.message('error',err);
})
},
clear(){
var that = this;
requirejs(['sweetalert'], function (swel) {
swel({
title: "您确定要清空产品属性吗",
text: "删除后将无法恢复,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "是的,我要清空!",
cancelButtonText: "让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function () {
$eb.axios.post("{:Url('clear_attr',array('id'=>$id))}", {
items: that.items,
attrs: that.attrs
}).then(function (res) {
if (res.status == 200 && res.data.code == 200) {
$eb.message('success', res.data.msg || '清空成功!');
window.location.reload();
} else {
$eb.message('error', res.data.msg || '清空失败!');
}
}).catch(function (err) {
$eb.message('error', err);
})
}).catch(console.log);
});
}
},
mounted (){
_vm = this;
var resultAdmin = <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?>;
if(resultAdmin) this.hidden = true;
}
}).$mount(document.getElementById('store-attr'));
});
</script>
</body>

View File

@ -1,159 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-title">
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加拼团</button>
</div>
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<select name="is_show" aria-controls="editable" class="form-control input-sm">
<option value="">产品状态</option>
<option value="1" {eq name="where.is_show" value="1"}selected="selected"{/eq}>上架</option>
<option value="0" {eq name="where.is_show" value="0"}selected="selected"{/eq}>下架</option>
</select>
<select name="is_host" aria-controls="editable" class="form-control input-sm">
<option value="">推荐状态</option>
<option value="1" {eq name="where.is_host" value="1"}selected="selected"{/eq}></option>
<option value="0" {eq name="where.is_host" value="0"}selected="selected"{/eq}></option>
</select>
<div class="input-group">
<input type="text" name="store_name" value="{$where.store_name}" placeholder="请输入产品名称,编号" class="input-sm form-control" size="38"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">拼团名称</th>
<th class="text-center">产品名称</th>
<th class="text-center">拼团图片</th>
<th class="text-center">开始时间</th>
<th class="text-center">结束时间</th>
<th class="text-center">拼团人数</th>
<th class="text-center">价格</th>
<th class="text-center">产品状态</th>
<th class="text-center">推荐状态</th>
<th class="text-center">库存</th>
<th class="text-center">排序</th>
<th class="text-center">内容</th>
<th class="text-center" width="10%">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.store_name}/{$vo.product_id}
</td>
<td class="text-center">
<img src="{$vo.image}" alt="{$vo.store_name}" class="open_image" data-image="{$vo.image}" style="width: 50px;height: 50px;cursor: pointer;">
</td>
<td class="text-center">
{$vo.start_time|date="Y-m-d H:i:s",###}
</td>
<td class="text-center">
{$vo.stop_time|date="Y-m-d H:i:s",###}
</td>
<td class="text-center">
{$vo.people}
</td>
<td class="text-center">
{$vo.price}
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_show' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_host' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
{$vo.stock}
</td>
<td class="text-center">
{$vo.sort}
</td>
<td class="text-center">
<button type="button" class="btn btn-xs btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit_content',array('id'=>$vo['id']))}')"><i class="fa fa-pencil"></i> 编辑内容</button>
</td>
<td class="text-center">
<div class="input-group-btn js-group-btn">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{$vo.store_name}-属性','{:Url('attr',array('id'=>$vo['id']))}')">
<i class="fa fa-shekel"></i> 属性
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')">
<i class="fa fa-paste"></i> 编辑
</a>
</li>
<li>
<a href="javascript:void(0);" id="delstor" data-url="{:Url('delete',array('id'=>$vo['id']))}">
<i class="fa fa-warning"></i> 删除
</a>
</li>
</ul>
</div>
</div>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.js-group-btn').on('click',function(){
$('.js-group-btn').css({zIndex:1});
$(this).css({zIndex:2});
});
$('#delstor').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -1,90 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__FRAME_PATH}js/content.min.js"></script>
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="col-sm-8 m-b-xs">
<form action="" class="form-inline">
<i class="fa fa-search" style="margin-right: 10px;"></i>
<div class="input-group" style="width: 80%">
<input type="text" name="title" value="{$where.title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">优惠券名称</th>
<th class="text-center">优惠券面值</th>
<th class="text-center">优惠券最低消费</th>
<th class="text-center">优惠券有效期限</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.coupon_price}
</td>
<td class="text-center">
{$vo.use_min_price}
</td>
<td class="text-center">
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant',array('id'=>$vo['id'],'uid'=>$uid))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.grant').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
swal({
title: "您确定要发放优惠券给‘{$nickname}’吗?",
text:"发放后将无法撤回,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText:"是的,我要发放!",
cancelButtonText:"让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
swal(res.data.msg);
}else
return Promise.reject(res.data.msg || '发放失败')
}).catch(function(err){
swal(err);
});
}).catch(console.log);
});
</script>
{/block}

View File

@ -1,90 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__FRAME_PATH}js/content.min.js"></script>
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="col-sm-8 m-b-xs">
<form action="" class="form-inline">
<i class="fa fa-search" style="margin-right: 10px;"></i>
<div class="input-group" style="width: 80%">
<input type="text" name="title" value="{$where.title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">优惠券名称</th>
<th class="text-center">优惠券面值</th>
<th class="text-center">优惠券最低消费</th>
<th class="text-center">优惠券有效期限</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.coupon_price}
</td>
<td class="text-center">
{$vo.use_min_price}
</td>
<td class="text-center">
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_all',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.grant').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
swal({
title: "您确定要发放优惠券吗?",
text:"发放后将无法撤回,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText:"是的,我要发放!",
cancelButtonText:"让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
swal(res.data.msg);
}else
return Promise.reject(res.data.msg || '发放失败')
}).catch(function(err){
swal(err);
});
}).catch(console.log);
});
</script>
{/block}

View File

@ -1,115 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__FRAME_PATH}js/content.min.js"></script>
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="col-sm-8 m-b-xs">
<form action="" class="form-inline">
<i class="fa fa-search" style="margin-right: 10px;"></i>
<div class="input-group" style="width: 80%">
<input type="text" name="title" value="{$where.title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">优惠券名称</th>
<th class="text-center">优惠券面值</th>
<th class="text-center">优惠券最低消费</th>
<th class="text-center">优惠券有效期限</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.coupon_price}
</td>
<td class="text-center">
{$vo.use_min_price}
</td>
<td class="text-center">
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-id="{$vo['id']}" data-url="{:Url('store.storeCouponUser/grant_group',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
var group = {$group};
$('.grant').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
var option = {};
$.each(group,function (item,index) {
option[index.id] = index.name;
})
var inputOptions = new Promise(function(resolve) {
resolve(option);
});
swal({
title: '请选择要给哪个组发放',
input: 'radio',
inputOptions: inputOptions,
inputValidator: function(result) {
return new Promise(function(resolve, reject) {
if (result) {
resolve();
} else {
reject('请选择要给哪个组发放优惠卷');
}
});
}
}).then(function(result) {
if (result) {
swal({
title: "您确定要发放优惠券吗?",
text:"发放后将无法撤回,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText:"是的,我要发放!",
cancelButtonText:"让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function(){
$eb.axios.post(url,{group:result}).then(function(res){
if(res.status == 200 && res.data.code == 200) {
swal(res.data.msg);
}else
return Promise.reject(res.data.msg || '发放失败')
}).catch(function(err){
swal(err);
});
}).catch(console.log);
}
})
});
</script>
{/block}

View File

@ -1,90 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__FRAME_PATH}js/content.min.js"></script>
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="col-sm-8 m-b-xs">
<form action="" class="form-inline">
<i class="fa fa-search" style="margin-right: 10px;"></i>
<div class="input-group" style="width: 80%">
<input type="text" name="title" value="{$where.title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">优惠券名称</th>
<th class="text-center">优惠券面值</th>
<th class="text-center">优惠券最低消费</th>
<th class="text-center">优惠券有效期限</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.coupon_price}
</td>
<td class="text-center">
{$vo.use_min_price}
</td>
<td class="text-center">
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_subscribe',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.grant').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
swal({
title: "您确定要发放优惠券吗?",
text:"发放后将无法撤回,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText:"是的,我要发放!",
cancelButtonText:"让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
swal(res.data.msg);
}else
return Promise.reject(res.data.msg || '发放失败')
}).catch(function(err){
swal(err);
});
}).catch(console.log);
});
</script>
{/block}

View File

@ -1,115 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__FRAME_PATH}js/content.min.js"></script>
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="col-sm-8 m-b-xs">
<form action="" class="form-inline">
<i class="fa fa-search" style="margin-right: 10px;"></i>
<div class="input-group" style="width: 80%">
<input type="text" name="title" value="{$where.title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">优惠券名称</th>
<th class="text-center">优惠券面值</th>
<th class="text-center">优惠券最低消费</th>
<th class="text-center">优惠券有效期限</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.coupon_price}
</td>
<td class="text-center">
{$vo.use_min_price}
</td>
<td class="text-center">
{$vo.coupon_time}
</td>
<td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_tag',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
var tag = {$tag};
$('.grant').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
var option = {};
$.each(tag,function (item,index) {
option[index.id] = index.name;
})
var inputOptions = new Promise(function(resolve) {
resolve(option);
});
swal({
title: '请选择要给哪个标签发放',
input: 'radio',
inputOptions: inputOptions,
inputValidator: function(result) {
return new Promise(function(resolve, reject) {
if (result) {
resolve();
} else {
reject('请选择要给哪个标签发放优惠卷');
}
});
}
}).then(function(result) {
if (result) {
swal({
title: "您确定要发放优惠券吗?",
text:"发放后将无法撤回,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText:"是的,我要发放!",
cancelButtonText:"让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function(){
$eb.axios.post(url,{tag:result}).then(function(res){
if(res.status == 200 && res.data.code == 200) {
swal(res.data.msg);
}else
return Promise.reject(res.data.msg || '发放失败')
}).catch(function(err){
swal(err);
});
}).catch(console.log);
}
})
});
</script>
{/block}

View File

@ -1,157 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-title">
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加优惠券</button>
<div class="ibox-tools">
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<select name="status" aria-controls="editable" class="form-control input-sm">
<option value="">是否有效</option>
<option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>开启</option>
<option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>关闭</option>
</select>
<div class="input-group">
<input type="text" name="title" value="{$where.title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">优惠券名称</th>
<th class="text-center">优惠券面值</th>
<th class="text-center">优惠券最低消费</th>
<th class="text-center">优惠券有效期限</th>
<th class="text-center">排序</th>
<th class="text-center">是否有效</th>
<th class="text-center">添加时间</th>
<th class="text-center" width="10%">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.coupon_price}
</td>
<td class="text-center">
{$vo.use_min_price}
</td>
<td class="text-center">
{$vo.coupon_time}
</td>
<td class="text-center">
{$vo.sort}
</td>
<td class="text-center">
<i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
<div class="input-group-btn js-group-btn">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{if condition="$vo['status']"}
<li>
<a href="javascript:void(0);" id="del" data-url="{:Url('status',array('id'=>$vo['id']))}">
<i class="fa fa-yelp"></i> 立即失效
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame(this.innerText+' [{$vo.title}] 优惠劵','{:Url('issue',['id'=>$vo['id']])}')">
<i class="fa fa-male"></i> 发布
</a>
</li>
{/if}
<li>
<a href="javascript:void(0);" id="delstor" data-url="{:Url('delete',array('id'=>$vo['id']))}">
<i class="fa fa-warning"></i> 删除
</a>
</li>
</ul>
</div>
</div>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.js-group-btn').on('click',function(){
$('.js-group-btn').css({zIndex:1});
$(this).css({zIndex:100});
});
$('#del').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
// _this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '修改失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改优惠券的状态吗?','text':'修改后将无法恢复并且已发出的优惠券将失效,请谨慎操作!','confirm':'是的,我要修改'})
});
$('#delstor').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要删除优惠券吗?','text':'删除后将无法恢复,请谨慎操作!','confirm':'是的,我要删除'})
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -1,107 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<select name="status" aria-controls="editable" class="form-control input-sm">
<option value="">状态</option>
<option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>正常</option>
<option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>未开启</option>
<option value="2" {eq name="where.status" value="2"}selected="selected"{/eq}>已过期</option>
<option value="2" {eq name="where.status" value="2"}selected="selected"{/eq}>已失效</option>
</select>
<div class="input-group">
<input type="text" name="coupon_title" value="{$where.coupon_title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">优惠券名称</th>
<th class="text-center">领取日期</th>
<th class="text-center">发布数量</th>
<th class="text-center">状态</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{empty name="$vo.start_time"}
不限时
{else/}
{$vo.start_time|date="Y/m/d H:i",###} - {$vo.end_time|date="Y/m/d H:i",###}
{/empty}
</td>
<td class="text-center">
{empty name="$vo.total_count"}
不限量
{else/}
<b style="color: #0a6aa1">发布:{$vo.total_count}</b>
<br/>
<b style="color:#ff0000;">剩余:{$vo.remain_count}</b>
{/empty}
</td>
<td class="text-center">
<?php if(!$vo['status']){ ?>
<span class="label label-warning">未开启</span>
<?php }elseif(-1 == $vo['status']){ ?>
<span class="label label-danger">已失效</span>
<?php }elseif(1 == $vo['status']){ ?>
<span class="label label-primary">正常</span>
<?php } ?>
</td>
<td class="text-center">
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('修改状态','{:Url('issue_log',array('id'=>$vo['id']))}')"><i class="fa fa-commenting-o"></i> 领取记录</button>
{neq name="vo.status" value="-1"}
<button class="btn btn-primary btn-xs" type="button" onclick="$eb.createModalFrame('修改状态','{:Url('edit',array('id'=>$vo['id']))}',{w:300,h:170})"><i class="fa fa-paste"></i> 修改状态</button>
{/neq}
<button class="btn btn-danger btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-warning"></i> 删除
</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
<script>
$('.btn-danger').on('click',function(){
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要删除发布的优惠券吗?','text':'删除后将无法恢复,请谨慎操作!','confirm':'是的,我要删除'})
});
</script>
{/block}

View File

@ -1,40 +0,0 @@
{include file="public/frame_head"}
<style type="text/css" media="screen">
td img{width: 35px; height: 35px;}
</style>
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">用户名</th>
<th class="text-center">用户头像</th>
<th class="text-center">领取时间</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">{$vo.nickname}</td>
<td class="text-center"><img src="{$vo.avatar}" class="head_image" data-image="{$vo.avatar}" width="35" height="35"></td>
<td class="text-center">{$vo.add_time}</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
<script>
$('td img').on('click',function (e) {
var image = $(this).attr("src");
$eb.openImage(image);
})
</script>
</div>
{include file="public/inner_footer"}

View File

@ -1,104 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<select name="is_fail" aria-controls="editable" class="form-control input-sm">
<option value="">是否有效</option>
<option value="1" {eq name="where.is_fail" value="1"}selected="selected"{/eq}></option>
<option value="0" {eq name="where.is_fail" value="0"}selected="selected"{/eq}></option>
</select>
<select name="status" aria-controls="editable" class="form-control input-sm">
<option value="">状态</option>
<option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>已使用</option>
<option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>未使用</option>
<option value="2" {eq name="where.status" value="2"}selected="selected"{/eq}>已过期</option>
</select>
<div class="input-group">
<input type="text" name="nickname" value="{$where.nickname}" placeholder="请输入发放人姓名" class="input-sm form-control"> <span class="input-group-btn">
</div>
<div class="input-group">
<input type="text" name="coupon_title" value="{$where.coupon_title}" placeholder="请输入优惠券名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">优惠券名称</th>
<th class="text-center">发放人</th>
<th class="text-center">优惠券面值</th>
<th class="text-center">优惠券最低消费</th>
<th class="text-center">优惠券开始使用时间</th>
<th class="text-center">优惠券结束使用时间</th>
<th class="text-center">获取放方式</th>
<th class="text-center">是否可用</th>
<th class="text-center">状态</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.coupon_title}
</td>
<td class="text-center">
{$vo.nickname}
</td>
<td class="text-center">
{$vo.coupon_price}
</td>
<td class="text-center">
{$vo.use_min_price}
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{$vo.end_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{$vo.type == 'send' ? '后台发放' : '手动领取'}
</td>
<td class="text-center">
{if condition="$vo['status'] eq 0" && $vo['is_fail'] eq 0}
<i class="fa fa-check text-navy"></i>
{else/}
<i class="fa fa-close text-danger"></i>
{/if}
</td>
<td class="text-center">
{if condition="$vo['status'] eq 2"}
已过期
{elseif condition="$vo['status'] eq 1"/}
已使用
{else/}
未使用
{/if}
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}

View File

@ -1,57 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
<meta name="browsermode" content="application"/>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 禁止百度转码 -->
<meta http-equiv="Cache-Control" content="no-siteapp">
<!-- uc强制竖屏 -->
<meta name="screen-orientation" content="portrait">
<!-- QQ强制竖屏 -->
<meta name="x5-orientation" content="portrait">
<title>物流信息</title>
<link rel="stylesheet" type="text/css" href="/public/static/css/reset.css"/>
<link rel="stylesheet" type="text/css" href="{__WAP_PATH}crmeb/font/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="{__WAP_PATH}crmeb/css/style.css?2"/>
<script type="text/javascript" src="/public/static/js/media.js"></script>
<script type="text/javascript" src="/public/static/plug/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="{__WAP_PATH}crmeb/js/common.js"></script>
</head>
<body>
<div class="user-order-logistics" style="overflow: hidden;">
<section>
<div class="product-info flex">
<div class="picture"><img src="{__WAP_PATH}crmeb/images/express_icon.jpg"/></div>
<div class="logistics-tip flex">
<div class="company">物流公司:{$order.delivery_name}</div>
<div class="number">物流单号:{$order.delivery_id}</div>
</div>
</div>
<div class="logistics-info" style="background-color: inherit;">
<?php if(!$express || $express['status'] != 0){ ?>
<div class="empty">
<img src="{__WAP_PATH}crmeb/images/empty_address.png">
<p>暂无查询记录</p>
</div>
<?php }else{ ?>
<ul class="flex">
{volist name="express.result.list" id="vo"}
<li class="clearfix">
<div class="right-wrapper fl">
<p>{$vo.status}</p>
<span>{$vo.time}</span>
</div>
</li>
{/volist}
</ul>
<?php } ?>
</div>
</section>
</div>
</body>
</html>

View File

@ -1,609 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<link href="{__FRAME_PATH}css/plugins/footable/footable.core.css" rel="stylesheet">
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
<script src="{__FRAME_PATH}js/plugins/footable/footable.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline search-form">
<div class="search-item" data-name="status">
<span class="btn-outline btn-link btn-sm">订单状态:</span>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="">全部</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="0">未支付</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="1">未发货</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="2">待收货</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="3">待评价</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="4">交易完成</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="-1">退款中</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="-2">已退款</button>
<input class="search-item-value" type="hidden" name="status" value="{$where.status}" />
</div>
<div class="search-item" data-name="combination_id">
<span class="btn-outline btn-link btn-sm">订单类型:</span>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="">全部</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="普通订单">普通订单</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="拼团订单">拼团订单</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="秒杀订单">秒杀订单</button>
<input class="search-item-value" type="hidden" name="combination_id" value="{$where.combination_id}" />
</div>
<div class="search-item" data-name="data">
<span class="btn-outline btn-link btn-sm">创建时间:</span>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="{$limitTimeList.yesterday}">昨天</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="{$limitTimeList.today}">今天</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="{$limitTimeList.week}">本周</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="{$limitTimeList.month}">本月</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="{$limitTimeList.quarter}">本季度</button>
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="{$limitTimeList.year}">本年</button>
<div class="datepicker" style="display: inline-block;">
<button type="button" class="btn btn-sm btn-info btn-outline btn-link" data-value="{$where.data?:'no'}">自定义</button>
</div>
<input class="search-item-value" type="hidden" name="data" value="{$where.data}" />
</div>
<div class="col-sm-4 text-right col-sm-offset-8" style="padding-bottom: 10px;">
<div class="input-group">
<input size="26" type="text" name="real_name" value="{$where.real_name}" placeholder="请输入姓名、电话、订单编号" class="input-sm form-control">
<input type="hidden" name="export" value="0">
<input type="hidden" name="order" id="order">
<span class="input-group-btn">
<button type="submit" id="no_export" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button>
<button type="submit" id="export" class="btn btn-sm btn-info btn-outline"> <i class="fa fa-exchange" ></i> Excel导出</button>
<script>
$('#export').on('click',function(){
$('input[name=export]').val(1);
});
$('#no_export').on('click',function(){
$('input[name=export]').val(0);
});
</script>
</span>
</div>
</div>
</form>
</div>
</div>
<div class="table-responsive ibox-content" style="padding-right: 0;padding-left: 0;overflow:visible">
<div class="row">
<?php $list_num = $list->toArray(); ?>
<div class="col-sm-12 m-b-sm">
<span class="m-xs">售出商品:<strong class="text-danger">{$price.total_num}</strong></span>
<span class="m-xs">订单数量:<strong class="text-danger">{$list_num.total}</strong></span>
<span class="m-xs">订单金额:<strong class="text-danger">{$price.pay_price}</strong></span>
<span class="m-xs">退款金额:<strong class="text-danger m-sm">{$price.refund_price}</strong></span>
{if condition="$price['pay_price_wx'] GT 0"}
<span class="m-xs">微信支付金额:<strong class="text-danger">{$price.pay_price_wx}</strong></span>
{/if}
{if condition="$price['pay_price_yue'] GT 0"}
<span class="m-xs">余额支付金额:<strong class="text-danger">{$price.pay_price_yue}</strong></span>
{/if}
{if condition="$price['pay_price_offline'] GT 0"}
<span class="m-xs">线下支付金额:<strong class="text-danger">{$price.pay_price_offline}</strong></span>
{/if}
{if condition="$price['pay_price_other'] GT 0"}
<span class="m-xs">线下支付金额:<strong class="text-danger">{$price.pay_price_other}</strong></span>
{/if}
{if condition="$price['use_integral'] GT 0"}
<span class="m-xs">积分抵扣:<strong class="text-success">{$price.use_integral} (抵扣金额:{$price.deduction_price})</strong></span>
{/if}
{if condition="$price['back_integral'] GT 0"}
<span class="m-xs">退回积分:<strong class="text-success">{$price.back_integral}</strong></span>
{/if}
</div>
<!--<div class="col-sm-8 text-left m-b-sm">
</div>-->
</div>
<table class="footable table table-striped table-bordered " data-page-size="20">
<thead>
<tr>
<th class="text-center" width="13%">订单号</th>
<th class="text-center" width="10%">用户信息</th>
<th class="text-center" width="42%">商品信息</th>
<th class="text-center" width="8%">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-white btn-xs dropdown-toggle" style="font-weight: bold;background-color: #f5f5f6;border: solid 0;" aria-expanded="false">
实际支付
<span class="second caret"></span>
</button>
<!-- <span class="caret" data-toggle="dropdown" class="dropdown-toggle" aria-expanded="false"></span>-->
<ul class="dropdown-menu">
<li>
<a class="ordersoft" data-value="">
<i class="fa fa-arrows-v"></i> 默认排序
</a>
</li>
<li>
<a class="ordersoft" data-value="pay_price asc">
<i class="fa fa-sort-numeric-asc"></i> 升序
</a>
</li>
<li>
<a class="ordersoft" data-value="pay_price desc">
<i class="fa fa-sort-numeric-desc"></i> 降序
</a>
</li>
</ul>
</div>
<th class="text-center" width="5%">支付状态</th>
<th class="text-center" width="8%">订单状态</th>
<th class="text-center" width="5%">详情</th>
<th class="text-center" width="10%">操作</th>
</tr>
</thead>
<tbody>
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.order_id} <br/> 
<span style="color: {$vo.color};">{$vo.pink_name}</span>  
</td>
<td class="text-center">
<p><span>{$vo.nickname} / {$vo.uid}</span></p>
</td>
<td>
<?php $info_order = $vo['_info'];?>
{volist name="info_order" id="info"}
{if condition="isset($info['cart_info']['productInfo']['attrInfo']) && !empty($info['cart_info']['productInfo']['attrInfo'])"}
<p>
<span><img class="open_image" data-image="{$info.cart_info.productInfo.image}" style="width: 30px;height: 30px;cursor: pointer;" src="{$info.cart_info.productInfo.attrInfo.image}" alt="{$info.cart_info.productInfo.store_name}" title="{$info.cart_info.productInfo.store_name}"></span>
<span>{$info.cart_info.productInfo.store_name}&nbsp;{$info.cart_info.productInfo.attrInfo.suk}</span><span> | {$info.cart_info.truePrice}×{$info.cart_info.cart_num}</span>
</p>
{else/}
<p>
<span><img class="open_image" data-image="{$info.cart_info.productInfo.image}" style="width: 30px;height: 30px;cursor: pointer;" src="{$info.cart_info.productInfo.image}" alt="{$info.cart_info.productInfo.store_name}" title="{$info.cart_info.productInfo.store_name}"></span>
<span>{$info.cart_info.productInfo.store_name}</span><span> | {$info.cart_info.truePrice}×{$info.cart_info.cart_num}</span>
</p>
{/if}
{/volist}
</td>
<td class="text-center">
{$vo.pay_price}
</td>
<td class="text-center">
{if condition="$vo['paid'] eq 1"}
<p><span>
{if condition="$vo['pay_type'] eq 'weixin'"}
微信支付
{elseif condition="$vo['pay_type'] eq 'yue'"}
余额支付
{elseif condition="$vo['pay_type'] eq 'offline'"}
线下支付
{else/}
其他支付
{/if}
</span></p>
{else/}
{if condition="$vo['pay_type'] eq 'offline'"}
<p><span>线下支付</span></p>
<p><button data-pay="{$vo.pay_price}" data-url="{:Url('offline',array('id'=>$vo['id']))}" type="button" class="offline_btn btn btn-w-m btn-white">立即支付</button></p>
{else/}
<p><span>未支付</span></p>
{/if}
{/if}
</td>
<td class="text-center">
{if condition="$vo['paid'] eq 0 && $vo['status'] eq 0"}
未支付
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 0 && $vo['refund_status'] eq 0"/}
未发货
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 1 && $vo['refund_status'] eq 0"/}
待收货
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 2 && $vo['refund_status'] eq 0"/}
待评价
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 3 && $vo['refund_status'] eq 0"/}
交易完成
{elseif condition="$vo['paid'] eq 1 && $vo['refund_status'] eq 1"/}
<b style="color:#f124c7">申请退款</b><br/>
<span>退款原因:{$vo.refund_reason_wap}</span>
{elseif condition="$vo['paid'] eq 1 && $vo['refund_status'] eq 2"/}
已退款
{/if}
</td>
<td class="text-center">
<a class="btn btn-white btn-bitbucket btn-xs" onclick="$eb.createModalFrame('{$vo.nickname}-订单详情','{:Url('order_info',array('oid'=>$vo['id']))}')">
<i class="fa fa-file-text"></i> 订单详情
</a>
</td>
<td class="text-right">
<span class="input-group-btn js-group-btn" style="min-width: 106px;">
{if condition="$vo['paid'] eq 0 && $vo['status'] eq 0 && $vo['refund_status'] eq 0"}<!--未支付-->
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('修改订单','{:Url('edit',array('id'=>$vo['id']))}')">
<i class="fa fa-file-text"></i> 修改订单
</a>
</li>
<li>
<a class="save_mark" href="javascript:void(0);" data-id="{$vo['id']}" data-make="{$vo.remark}" data-url="{:Url('remark')}">
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('订单记录','{:Url('order_status',array('oid'=>$vo['id']))}')">
<i class="fa fa-newspaper-o"></i> 订单记录
</a>
</li>
</ul>
</div>
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 0 && $vo['refund_status'] eq 0"/}<!--已支付-->
<button class="btn btn-primary btn-xs" type="button" onclick="$eb.createModalFrame('去发货','{:Url('deliver_goods',array('id'=>$vo['id']))}',{w:400,h:300})"><i class="fa fa-cart-plus"></i> 去发货</button>
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('去送货','{:Url('delivery',array('id'=>$vo['id']))}',{w:400,h:300})">
<i class="fa fa-motorcycle"></i> 去送货
</a>
</li>
<li>
<a class="save_mark" href="javascript:void(0);" data-id="{$vo['id']}" data-make="{$vo.remark}" data-url="{:Url('remark')}">
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
{if condition="$vo['pay_price'] neq $vo['refund_price']"}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y',array('id'=>$vo['id']))}',{w:400,h:300})">
<i class="fa fa-history"></i> 立即退款
</a>
</li>
{/if}
{if condition="$vo['use_integral'] GT 0 && $vo['use_integral'] EGT $vo['back_integral']"}<!-- 退积分 -->
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 退积分
</a>
</li>
{/if}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('订单记录','{:Url('order_status',array('oid'=>$vo['id']))}')">
<i class="fa fa-newspaper-o"></i> 订单记录
</a>
</li>
</ul>
</div>
{elseif condition="$vo['paid'] eq 1 && $vo['refund_status'] eq 1"/}<!--已支付 退款中-->
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{if condition="$vo['use_integral'] GT 0 && $vo['use_integral'] EGT $vo['back_integral']"}<!-- 退积分 -->
<li>
<a class="save_mark" href="javascript:void(0);" data-id="{$vo['id']}" data-make="{$vo.remark}" data-url="{:Url('remark')}">
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back',array('id'=>$vo['id']))}',{w:400,h:300})">
<i class="fa fa-history"></i> 退积分
</a>
</li>
{/if}
{if condition="$vo['pay_price'] neq $vo['refund_price']"}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y',array('id'=>$vo['id']))}',{w:400,h:300})">
<i class="fa fa-history"></i>立即退款
</a>
</li>
{/if}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('不退款','{:Url('refund_n',array('id'=>$vo['id']))}',{w:400,h:300})">
<i class="fa fa-openid"></i> 不退款
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('订单记录','{:Url('order_status',array('oid'=>$vo['id']))}')">
<i class="fa fa-newspaper-o"></i> 订单记录
</a>
</li>
</ul>
</div>
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 1 && $vo['refund_status'] eq 0"/}<!--已支付 已发货 待收货-->
<button class="btn btn-default btn-xs" type="button" onclick="$eb.createModalFrame('配送信息','{:Url('distribution',array('id'=>$vo['id']))}')"><i class="fa fa-cart-arrow-down"></i> 配送信息</button>
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="save_mark" href="javascript:void(0);" data-id="{$vo['id']}" data-make="{$vo.remark}" data-url="{:Url('remark')}">
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
<li>
<a class="danger-btn" href="javascript:void(0);" data-url="{:Url('take_delivery',array('id'=>$vo['id']))}">
<i class="fa fa-cart-arrow-down"></i> 已收货
</a>
</li>
{if condition="$vo['pay_price'] neq $vo['refund_price']"}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 立即退款
</a>
</li>
{/if}
{if condition="$vo['use_integral'] GT 0 && $vo['use_integral'] EGT $vo['back_integral']"}<!-- 退积分 -->
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 退积分
</a>
</li>
{/if}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('订单记录','{:Url('order_status',array('oid'=>$vo['id']))}')">
<i class="fa fa-newspaper-o"></i> 订单记录
</a>
</li>
</ul>
</div>
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 2 && $vo['refund_status'] eq 0"/}<!--已支付 已收货 待评价-->
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="save_mark" href="javascript:void(0);" data-id="{$vo['id']}" data-make="{$vo.remark}" data-url="{:Url('remark')}">
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
{if condition="$vo['pay_price'] neq $vo['refund_price']"}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 立即退款
</a>
</li>
{/if}
{if condition="$vo['use_integral'] GT 0 && $vo['use_integral'] EGT $vo['back_integral']"}<!-- 退积分 -->
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 退积分
</a>
</li>
{/if}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('订单记录','{:Url('order_status',array('oid'=>$vo['id']))}')">
<i class="fa fa-newspaper-o"></i> 订单记录
</a>
</li>
</ul>
</div>
{elseif condition="$vo['paid'] eq 1 && $vo['status'] eq 3 && $vo['refund_status'] eq 0"/} <!--订单完成 -->
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="save_mark" href="javascript:void(0);" data-id="{$vo['id']}" data-make="{$vo.remark}" data-url="{:Url('remark')}">
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
{if condition="$vo['pay_price'] neq $vo['refund_price']"}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 立即退款
</a>
</li>
{/if}
{if condition="$vo['use_integral'] GT 0 && $vo['use_integral'] EGT $vo['back_integral']"}<!-- 退积分 -->
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 退积分
</a>
</li>
{/if}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('订单记录','{:Url('order_status',array('oid'=>$vo['id']))}')">
<i class="fa fa-newspaper-o"></i> 订单记录
</a>
</li>
</ul>
</div>
{elseif condition="$vo['paid'] eq 1 && $vo['refund_status'] eq 2"/}<!-- 已支付 已退款-->
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="save_mark" href="javascript:void(0);" data-id="{$vo['id']}" data-make="{$vo.remark}" data-url="{:Url('remark')}">
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
{if condition="$vo['use_integral'] GT 0 && $vo['use_integral'] EGT $vo['back_integral']"}<!-- 退积分 -->
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back',array('id'=>$vo['id']))}')">
<i class="fa fa-history"></i> 退积分
</a>
</li>
{/if}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('订单记录','{:Url('order_status',array('oid'=>$vo['id']))}')">
<i class="fa fa-newspaper-o"></i> 订单记录
</a>
</li>
</ul>
</div>
{/if}
</span>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
{/block}
{block name="script"}
<script>
$(function init(){
$('.search-item>.btn').on('click',function(){
var that = $(this),value = that.data('value'),p = that.parent(),name = p.data('name'),form = p.parents();
form.find('input[name="'+name+'"]').val(value);
$('input[name=export]').val(0);
form.submit();
});
$('.search-item-value').each(function(){
var that = $(this),name = that.attr('name'), value = that.val(),dom = $('.search-item[data-name="'+name+'"] .btn[data-value="'+value+'"]');
dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary').siblings().addClass('btn-outline btn-link btn-sm').removeClass('btn-primary')
});
});
$('.ordersoft').on('click',function(){
var that = $(this),value = that.data('value');
$('input[name=order]').val(value);
$('input[name=export]').val(0);
$('form').submit();
});
$('.js-group-btn').on('click',function(){
$('.js-group-btn').css({zIndex:1});
$(this).css({zIndex:2});
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
});
$('.danger-btn,.btn-danger').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.offline_btn').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.add_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id');
$eb.$alert('textarea',{},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
$('.save_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
$eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '取消',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
//$("input[name=limit_time]").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("input[name=data]").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
$('input[name=export]').val(0);
$('form').submit();
});
</script>
{/block}

View File

@ -1,138 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="ibox-content order-info">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
收货信息
</div>
<div class="panel-body">
<div class="row show-grid">
<div class="col-xs-6" >用户昵称: {$userInfo.nickname}</div>
<div class="col-xs-6">收货人: {$orderInfo.real_name}</div>
<div class="col-xs-6">联系电话: {$orderInfo.user_phone}</div>
<div class="col-xs-6">收货地址: {$orderInfo.user_address}</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
订单信息
</div>
<div class="panel-body">
<div class="row show-grid">
<div class="col-xs-6" >订单编号: {$orderInfo.order_id}</div>
<div class="col-xs-6" style="color: #8BC34A;">订单状态:
{if condition="$orderInfo['paid'] eq 0 && $orderInfo['status'] eq 0"}
未支付
{elseif condition="$orderInfo['paid'] eq 1 && $orderInfo['status'] eq 0 && $orderInfo['refund_status'] eq 0"/}
未发货
{elseif condition="$orderInfo['paid'] eq 1 && $orderInfo['status'] eq 1 && $orderInfo['refund_status'] eq 0"/}
待收货
{elseif condition="$orderInfo['paid'] eq 1 && $orderInfo['status'] eq 2 && $orderInfo['refund_status'] eq 0"/}
待评价
{elseif condition="$orderInfo['paid'] eq 1 && $orderInfo['status'] eq 3 && $orderInfo['refund_status'] eq 0"/}
交易完成
{elseif condition="$orderInfo['paid'] eq 1 && $orderInfo['refund_status'] eq 1"/}
申请退款<b style="color:#f124c7">{$orderInfo.refund_reason_wap}</b>
{elseif condition="$orderInfo['paid'] eq 1 && $orderInfo['refund_status'] eq 2"/}
已退款
{/if}
</div>
<div class="col-xs-6">商品总数: {$orderInfo.total_num}</div>
<div class="col-xs-6">商品总价: {$orderInfo.total_price}</div>
<div class="col-xs-6">支付邮费: {$orderInfo.total_postage}</div>
<div class="col-xs-6">实际支付: {$orderInfo.pay_price}</div>
{if condition="$orderInfo['refund_price'] GT 0"}
<div class="col-xs-6" style="color: #f1a417">退款金额: {$orderInfo.refund_price}</div>
{/if}
{if condition="$orderInfo['deduction_price'] GT 0"}
<div class="col-xs-6" style="color: #f1a417">使用积分: {$orderInfo.use_integral}积分(抵扣了¥{$orderInfo.deduction_price})</div>
{/if}
{if condition="$orderInfo['back_integral'] GT 0"}
<div class="col-xs-6" style="color: #f1a417">退回积分: {$orderInfo.back_integral}</div>
{/if}
<div class="col-xs-6">创建时间: {$orderInfo.add_time|date="Y/m/d H:i",###}</div>
<div class="col-xs-6">支付方式:
{if condition="$orderInfo['paid'] eq 1"}
{if condition="$orderInfo['pay_type'] eq 'weixin'"}
微信支付
{elseif condition="$orderInfo['pay_type'] eq 'yue'"}
余额支付
{elseif condition="$orderInfo['pay_type'] eq 'offline'"}
线下支付
{else/}
其他支付
{/if}
{else/}
{if condition="$orderInfo['pay_type'] eq 'offline'"}
线下支付
{else/}
未支付
{/if}
{/if}
</div>
{notempty name="orderInfo.pay_time"}
<div class="col-xs-6">支付时间: {$orderInfo.pay_time|date="Y/m/d H:i",###}</div>
{/notempty}
<div class="col-xs-6" style="color: #ff0005">用户备注: {$orderInfo.mark?:'无'}</div>
<div class="col-xs-6" style="color: #733b5c">商家备注: {$orderInfo.remark?:'无'}</div>
<div class="col-xs-6" style="color: #733AF9">推广人: {if $spread}{$spread}{else}{/if}</div>
</div>
</div>
</div>
</div>
{if condition="$orderInfo['delivery_type'] eq 'express'"}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
物流信息
</div>
<div class="panel-body">
<div class="row show-grid">
<div class="col-xs-6" >快递公司: {$orderInfo.delivery_name}</div>
<div class="col-xs-6">快递单号: {$orderInfo.delivery_id} | <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('物流查询','{:Url('express',array('oid'=>$orderInfo['id']))}',{w:322,h:568})">物流查询</button></div>
</div>
</div>
</div>
</div>
{elseif condition="$orderInfo['delivery_type'] eq 'send'"}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
配送信息
</div>
<div class="panel-body">
<div class="row show-grid">
<div class="col-xs-6" >送货人姓名: {$orderInfo.delivery_name}</div>
<div class="col-xs-6">送货人电话: {$orderInfo.delivery_id}</div>
</div>
</div>
</div>
</div>
{/if}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
备注信息
</div>
<div class="panel-body">
<div class="row show-grid">
<div class="col-xs-6" >{if $orderInfo.mark}{$orderInfo.mark}{else}暂无备注信息{/if}</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
{/block}
{block name="script"}
{/block}

View File

@ -1,79 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">订单编号</th>
<th class="text-center">操作记录</th>
<th class="text-center">操作时间</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.oid}
</td>
<td class="text-center">
{$vo.change_message}
</td>
<td class="text-center">
{$vo.change_time|date='Y-m-d H:i:s',###}
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.btn-warning').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
// _this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '修改失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改优惠券的状态吗?','text':'修改后将无法恢复并且已发出的优惠券将失效,请谨慎操作!','confirm':'是的,我要修改'})
});
$('.btn-danger').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要删除优惠券吗?','text':'删除后将无法恢复,请谨慎操作!','confirm':'是的,我要删除'})
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -1,278 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<link href="{__FRAME_PATH}css/plugins/footable/footable.core.css" rel="stylesheet">
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
<script src="{__FRAME_PATH}js/plugins/footable/footable.all.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline search-form">
<div class="search-item" data-name="status">
<span>订单状态:</span>
<button type="button" class="btn btn-outline btn-link" data-value="">全部</button>
<button type="button" class="btn btn-outline btn-link" data-value="0">未支付</button>
<button type="button" class="btn btn-outline btn-link" data-value="1">未发货</button>
<button type="button" class="btn btn-outline btn-link" data-value="2">待收货</button>
<button type="button" class="btn btn-outline btn-link" data-value="3">待评价</button>
<button type="button" class="btn btn-outline btn-link" data-value="4">交易完成</button>
<button type="button" class="btn btn-outline btn-link" data-value="-1">退款中</button>
<button type="button" class="btn btn-outline btn-link" data-value="-2">已退款</button>
<input class="search-item-value" type="hidden" name="status" value="{$where.status}" />
</div>
<div class="search-item" data-name="combination_id">
<span>订单类型:</span>
<button type="button" class="btn btn-outline btn-link" data-value="">全部</button>
<button type="button" class="btn btn-outline btn-link" data-value="普通订单">普通订单</button>
<button type="button" class="btn btn-outline btn-link" data-value="拼团订单">拼团订单</button>
<button type="button" class="btn btn-outline btn-link" data-value="秒杀订单">秒杀订单</button>
<input class="search-item-value" type="hidden" name="combination_id" value="{$where.combination_id}" />
</div>
<div class="search-item" data-name="data">
<span>创建时间:</span>
<!-- <button type="button" class="btn btn-outline btn-link" data-value="">全部</button>-->
<button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.today}">今天</button>
<button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.week}">本周</button>
<button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.month}">本月</button>
<button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.quarter}">本季度</button>
<button type="button" class="btn btn-outline btn-link" data-value="{$limitTimeList.year}">本年</button>
<div class="datepicker" style="display: inline-block;">
<button type="button" class="btn btn-outline btn-link" data-value="{$where.data?:'no'}">自定义</button>
</div>
<input class="search-item-value" type="hidden" name="data" value="{$where.data}" />
</div>
<hr>
<?php $list_num = $list->toArray(); ?>
<div class="col-sm-12" style="padding-bottom: 20px;">
<div class="count-price">
<span>售出商品:<strong class="h3 text-warning">{$price.total_num}</strong></span>
</div>
<div class="count-price">
<span>订单数量:<strong class="h3 text-warning">{$list_num.total}</strong></span>
</div>
<div class="count-price">
<span>订单金额:<strong class="h3 text-warning">{$price.pay_price}</strong></span>
</div>
<div class="count-price">
<span>退款金额:<strong class="h3 text-warning">{$price.refund_price}</strong></span>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>主要数据统计</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="col-sm-8">
<div class="ibox-content" id="ec-goods-count" style="height:390px;">
</div>
</div>
<div class="col-sm-4">
<div class="ibox-content" id="ec-order-count" style="height:390px;">
</div>
</div>
</div>
</div>
<script>
(function(){
var option = {
title: {
text: '订单统计'
},
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'horizontal',
left: 'left',
top: 25,
data: <?=urldecode(json_encode(array_keys($orderCount)))?>,
selected:<?php
$data = [];
$selected = [];
foreach ($orderCount as $k=>$count){
$data[] = ['value'=>$count,'name'=>$k];
$selected[$k] = $count>0;
}
echo urldecode(json_encode($selected));
?>
},
series : [
{
name: '订单数量',
type: 'pie',
radius : '55%',
center: ['50%', '60%'],
data:<?=urldecode(json_encode($data))?>,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
var myChart = echarts.init(document.getElementById('ec-order-count'),'light');
myChart.setOption(option);
})();
(function(){
var option = {
title: {
text: '数据统计'
},
tooltip: {
trigger: 'axis'
},
xAxis: {
data: <?=json_encode($orderDays)?>
},
yAxis: {
splitLine: {
show: false
}
},
legend: {
orient: 'horizontal',
left: 'center',
top: 25,
data: ['商品数','订单数','订单金额','退款金额']
},
toolbox: {
left: 'right',
feature: {
restore: {},
saveAsImage: {}
}
},
dataZoom: [{
startValue: '<?php
$index = count($orderDays) > 30 ? count($orderDays)-30 : 0;
if(isset($orderDays[$index]))
echo $orderDays[$index];
?>'
}, {
type: 'inside'
}],
visualMap: {
top: 10,
right: 10,
pieces: [{
gt: 0,
lte: 50,
color: '#096'
}, {
gt: 50,
lte: 100,
color: '#ffde33'
}, {
gt: 100,
lte: 150,
color: '#ff9933'
}, {
gt: 150,
lte: 200,
color: '#cc0033'
}, {
gt: 200,
lte: 300,
color: '#660099'
}, {
gt: 300,
color: '#7e0023'
}],
outOfRange: {
color: '#999'
}
},
series: <?= json_encode($orderCategory)?>
};
var myChart = echarts.init(document.getElementById('ec-goods-count'),'light');
myChart.setOption(option);
})();
</script>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$(function init(){
$('.search-item>.btn').on('click',function(){
var that = $(this),value = that.data('value'),p = that.parent(),name = p.data('name'),form = p.parents();
form.find('input[name="'+name+'"]').val(value);
$('input[name=export]').val(0);
form.submit();
});
$('.search-item-value').each(function(){
var that = $(this),name = that.attr('name'), value = that.val(),dom = $('.search-item[data-name="'+name+'"] .btn[data-value="'+value+'"]');
dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary btn-sm')
.siblings().addClass('btn-outline btn-link').removeClass('btn-primary btn-sm')
});
});
$('.btn-order').on('click',function(){
var that = $(this),value = that.data('value');
$('input[name=order]').val(value);
$('input[name=export]').val(0);
$('form').submit();
});
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '取消',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
//$("input[name=limit_time]").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("input[name=data]").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
$('input[name=export]').val(0);
$('form').submit();
});
</script>
{/block}

View File

@ -1,212 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<div class="input-group datepicker">
<input style="width: 188px;" type="text" id="data" class="input-sm form-control" name="data" value="{$where.data}" placeholder="请选择日期" >
</div>
<select name="status" aria-controls="editable" class="form-control input-sm">
<option value="">全部</option>
<option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>进行中</option>
<option value="2" {eq name="where.status" value="2"}selected="selected"{/eq}>已完成</option>
<option value="3" {eq name="where.status" value="3"}selected="selected"{/eq}>未完成</option>
</select>
<div class="input-group">
<span class="input-group-btn">
<button type="submit" id="no_export" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button>
</span>
</div>
<script>
$('#export').on('click',function(){
$('input[name=export]').val(1);
});
$('#no_export').on('click',function(){
$('input[name=export]').val(0);
});
</script>
</form>
</div>
</div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">开团团长</th>
<th class="text-center">开团时间</th>
<th class="text-center">拼团产品</th>
<th class="text-center">几人团</th>
<th class="text-center">几人参加</th>
<th class="text-center">结束时间</th>
<th class="text-center">状态</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.uid|getUserNickname}/{$vo.uid}
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{$vo.title}/{$vo.cid}
</td>
<td class="text-center">
{$vo.people}
</td>
<td class="text-center">
{$vo.count_people}
</td>
<td class="text-center">
{$vo.stop_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{if condition="$vo['status'] eq 1"}
<span style="color: #00a0e9">进行中</span>
{elseif condition="$vo['status'] eq 2"}
<span style="color: #e933ce">已完成</span>
{elseif condition="$vo['status'] eq 3"}
<span style="color: #2725e9">未完成</span>
{/if}
</td>
<td class="text-center">
<p><button class="btn btn-default btn-xs btn-outline" type="button" onclick="$eb.createModalFrame('查看详情','{:Url('order_pink',array('id'=>$vo['id']))}')"><i class="fa fa-newspaper-o"></i>查看详情</button></p>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
$('.btn-danger').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.offline_btn').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.add_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id');
$eb.$alert('textarea',{},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
$('.save_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
$eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '清空',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
$("#data").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
});
</script>
{/block}

View File

@ -1,173 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
</div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">用户名称</th>
<th class="text-center">用户头像</th>
<th class="text-center">订单编号</th>
<th class="text-center">金额</th>
<th class="text-center">订单状态</th>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.nickname}/{$vo.uid}
</td>
<td class="text-center">
<img class="open_image" style="max-width: 80px;" data-image="{$vo.avatar}" src="{$vo.avatar}" alt="{$vo.nickname}">
</td>
<td class="text-center">
<a href="{:Url('store.storeOrder/index')}?real_name={$vo.order_id_key|getOrderId}">{$vo.order_id}</a>
</td>
<td class="text-center">
{$vo.price}
</td>
<td class="text-center">
{if condition="$vo['is_refund']"}
已退款
{else/}
未退款
{/if}
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
$('.btn-danger').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.offline_btn').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.add_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id');
$eb.$alert('textarea',{},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
$('.save_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
$eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '清空',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
$("#data").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
});
</script>
{/block}

View File

@ -1,79 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">订单编号</th>
<th class="text-center">操作记录</th>
<th class="text-center">操作时间</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.oid}
</td>
<td class="text-center">
{$vo.change_message}
</td>
<td class="text-center">
{$vo.change_time|date='Y-m-d H:i:s',###}
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.btn-warning').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
// _this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '修改失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改优惠券的状态吗?','text':'修改后将无法恢复并且已发出的优惠券将失效,请谨慎操作!','confirm':'是的,我要修改'})
});
$('.btn-danger').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要删除优惠券吗?','text':'删除后将无法恢复,请谨慎操作!','confirm':'是的,我要删除'})
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -71,7 +71,7 @@
<div class="layui-btn-container"> <div class="layui-btn-container">
{switch name='type'} {switch name='type'}
{case value="1"} {case value="1"}
<button class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{h:760,w:900})">添加产品</button> <button class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{h:700,w:1100})">添加产品</button>
{/case} {/case}
{case value="2"} {case value="2"}
<button class="layui-btn layui-btn-sm" data-type="show">批量上架</button> <button class="layui-btn layui-btn-sm" data-type="show">批量上架</button>
@ -98,7 +98,7 @@
<!--产品名称--> <!--产品名称-->
<script type="text/html" id="store_name"> <script type="text/html" id="store_name">
<h4>{{d.store_name}}</h4> <h4>{{d.store_name}}</h4>
<p>价格:{{d.price}}</p> <p>价格:<font color="red">{{d.price}}</font> </p>
{{# if(d.cate_name!=''){ }} {{# if(d.cate_name!=''){ }}
<p>分类:{{d.cate_name}}</p> <p>分类:{{d.cate_name}}</p>
{{# } }} {{# } }}
@ -110,14 +110,14 @@
<button type="button" class="layui-btn layui-btn-xs btn-success" onclick="$eb.createModalFrame('{{d.store_name}}-属性','{:Url('attr')}?id={{d.id}}',{h:700,w:800})"> <button type="button" class="layui-btn layui-btn-xs btn-success" onclick="$eb.createModalFrame('{{d.store_name}}-属性','{:Url('attr')}?id={{d.id}}',{h:700,w:800})">
属性 属性
</button> </button>
<button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('{{d.store_name}}-编辑','{:Url('edit')}?id={{d.id}}')"> <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('{{d.store_name}}-编辑','{:Url('edit')}?id={{d.id}}',{h:700,w:1100})">
编辑 编辑
</button> </button>
<button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span class="caret"></span></button> <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span class="caret"></span></button>
<ul class="layui-nav-child layui-anim layui-anim-upbit"> <ul class="layui-nav-child layui-anim layui-anim-upbit">
<li> <li>
<a href="javascript:void(0);" class="" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit_content')}?id={{d.id}}')"> <a href="javascript:void(0);" class="" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit_content')}?id={{d.id}}')">
<i class="fa fa-pencil"></i> 编辑内容</a> <i class="fa fa-pencil"></i> 产品详情</a>
</li> </li>
<li> <li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame(this.innerText,'{:Url('ump.store_seckill/seckill')}?id={{d.id}}')""> <a href="javascript:void(0);" onclick="$eb.createModalFrame(this.innerText,'{:Url('ump.store_seckill/seckill')}?id={{d.id}}')"">
@ -159,33 +159,32 @@
switch (parseInt(type)){ switch (parseInt(type)){
case 1:case 3:case 4:case 5: case 1:case 3:case 4:case 5:
join=[ join=[
{field: 'id', title: 'ID', sort: true,event:'id',width:'4%'}, {field: 'id', title: 'ID', sort: true,event:'id',width:'6%'},
{field: 'image', title: '产品图片',templet:'#image'}, {field: 'image', title: '产品图片',templet:'#image',width:'10%'},
{field: 'store_name', title: '产品名称',templet:'#store_name'}, {field: 'store_name', title: '产品名称',templet:'#store_name'},
{field: 'price', title: '产品价格',edit:'price'}, {field: 'ficti', title: '虚拟销量',edit:'ficti',width:'8%'},
{field: 'ficti', title: '虚拟销量',edit:'ficti'}, {field: 'stock', title: '库存',edit:'stock',width:'8%'},
{field: 'stock', title: '库存',edit:'stock'}, {field: 'sort', title: '排序',edit:'sort',width:'6%'},
{field: 'sort', title: '排序',edit:'sort'}, {field: 'sales', title: '销量',sort: true,event:'sales',width:'8%'},
{field: 'sales', title: '销量',sort: true,event:'sales'}, {field: 'collect', title: '点赞',templet:'#like',width:'6%'},
{field: 'collect', title: '点赞',templet:'#like'}, {field: 'like', title: '收藏',templet:'#collect',width:'6%'},
{field: 'like', title: '收藏',templet:'#collect'}, {field: 'status', title: '状态',templet:"#checkboxstatus",width:'8%'},
{field: 'status', title: '状态',templet:"#checkboxstatus"}, {field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'},
]; ];
break; break;
case 2: case 2:
join=[ join=[
{type:'checkbox'}, {type:'checkbox'},
{field: 'id', title: 'ID', sort: true,event:'id',width:'4%'}, {field: 'id', title: 'ID', sort: true,event:'id',width:'6%'},
{field: 'image', title: '产品图片',templet:'#image'}, {field: 'image', title: '产品图片',templet:'#image',width:'10%'},
{field: 'store_name', title: '产品名称',templet:'#store_name'}, {field: 'store_name', title: '产品名称',templet:'#store_name'},
{field: 'price', title: '产品价格',edit:'price'}, {field: 'price', title: '价格',edit:'price',width:'8%'},
{field: 'ficti', title: '虚拟销量',edit:'ficti'}, {field: 'ficti', title: '虚拟销量',edit:'ficti',width:'8%'},
{field: 'stock', title: '库存',edit:'stock'}, {field: 'stock', title: '库存',edit:'stock',width:'6%'},
{field: 'sort', title: '排序',edit:'sort'}, {field: 'sort', title: '排序',edit:'sort',width:'6%'},
{field: 'sales', title: '销量',sort: true,event:'sales'}, {field: 'sales', title: '销量',sort: true,event:'sales',width:'6%'},
{field: 'status', title: '状态',templet:"#checkboxstatus"}, {field: 'status', title: '状态',templet:"#checkboxstatus",width:'8%'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'}, {field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
]; ];
break; break;
case 6: case 6:
@ -198,8 +197,8 @@
{field: 'stock', title: '库存',edit:'stock'}, {field: 'stock', title: '库存',edit:'stock'},
{field: 'sort', title: '排序',edit:'sort'}, {field: 'sort', title: '排序',edit:'sort'},
{field: 'sales', title: '销量',sort: true,event:'sales'}, {field: 'sales', title: '销量',sort: true,event:'sales'},
{field: 'status', title: '状态',templet:"#checkboxstatus"}, // {field: 'status', title: '状态',templet:"#checkboxstatus"},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'10%'}, {field: 'right', title: '操作',align:'center',toolbar:'#act',width:'14%'},
]; ];
break; break;
} }

View File

@ -1,371 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
{include file="public/head"}
<title>{$title|default=''}</title>
<style>
.demo-upload{
display: block;
height: 33px;
text-align: center;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0,0,0,.2);
margin-right: 4px;
}
.demo-upload img{
width: 100%;
height: 100%;
display: block;
}
.demo-upload-cover{
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.6);
}
.demo-upload:hover .demo-upload-cover{
display: block;
}
.demo-upload-cover i{
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
.check{color: #f00}
</style>
</head>
<body>
<div id="store-attr" class="mp-form" v-cloak="">
<i-Form :label-width="80" style="width: 100%" v-show="hidden == false">
<Form-Item>
<Row>
<i-Col span="5">
<i-Button type="dashed" long @click="hiddenBool" icon="plus-round">添加新规则</i-Button>
</i-Col>
</Row>
</Form-Item>
</i-Form>
<i-Form :label-width="80" style="width: 100%" v-show="hidden == true">
<Form-Item
:label="'规则名称:'">
<Row>
<i-Col style="position: relative;margin-right: 6px" span="5"
v-for="(item, index) in items"
:key="index">
<i-Input type="text" v-model="item.value" placeholder="设置名称"></i-Input>
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="handleRemove(index)" v-show="item.attrHidden == true"><Icon type="close-round" /></i-Button>
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="attrHiddenBool(item)" v-show="item.attrHidden == false"><Icon type="checkmark-round"></Icon></i-Button>
</i-Col>
<i-Col span="5">
<i-Button type="dashed" long @click="handleAdd" icon="plus-round">添加新规则</i-Button>
</i-Col>
</Row>
</Form-Item>
<Form-Item v-show="item.attrHidden == true"
v-for="(item, index) in items"
:key="index"
:label="''+item.value+':'" >
<Row>
<i-Col span="3"
v-for="(attr,k) in item.detail"
:key="attr"
:name="attr">
<Tag type="border" closable color="blue" @on-close="attrRemove(item,k)">{{ attr }}</Tag>
</i-Col>
<i-Col span="5">
<i-Input type="text" v-model="item.detailValue" placeholder="设置属性"></i-Input>
</i-Col>
<i-Col span="5">
<i-Button type="primary" style="margin-left: 6px" @click="attrAdd(item)">添加</i-Button>
</i-Col>
</Row>
</Form-Item>
<Form-Item v-show="hidden == true" style="width: 100%;">
<Row style="margin: 0 88px 0 20px">
<i-Col span="24">
<i-Button type="primary" long @click="addGoods(true)">生成</i-Button>
</i-Col>
</Row>
</Form-Item>
<template v-if="items[0].value!='' && items[0].detail.length>0 && attrs.length">
<template v-for="(attr,index) in attrs">
<Form-Item>
<Row>
<template v-for="(item,index) in attr.detail">
<i-Col span="3" style="margin-right: 3px">
{{index}}:{{item}}
</i-Col>
</template>
<i-Col span="5" style="margin-right: 3px">
<span :class="attr.check ? 'check':''">金额:</span><i-Input placeholder="请输入金额" v-model="attr.price" style="width: 68%"
:number="true"></i-Input>
</i-Col>
<i-Col span="5" style="margin-right: 3px">
<span :class="attr.check ? 'check':''">库存:</span><i-Input placeholder="请输入库存" v-model="attr.sales" style="width: 68%"
:number="true"></i-Input>
</i-Col>
<i-Col span="2" offset="1" style="margin-right: 3px">
<div class="demo-upload">
<img :src="attr.pic">
<div class="demo-upload-cover">
<Icon type="ios-eye-outline" @click.native="openPic(attr.pic)" ></Icon>
<Upload
:show-upload-list="false"
:on-success="uploadSuccess(attr)"
:on-error="uploadError"
:format="['jpg','jpeg','png']"
:max-size="2048"
accept="image/*"
:on-format-error="uploadFormatError"
action="{:Url('upload')}"
style="display: inline-block"
:goods="attr"
>
<Icon type="ios-cloud-upload-outline"></Icon>
</Upload>
</div>
</div>
</i-Col>
<i-Col span="2" style="margin-right: 3px">
<i-Button type="ghost" @click="removeGoods(index)">删除</i-Button>
</i-Col>
</Row>
</Form-Item>
</template>
<Form-Item>
<Row>
<!-- <i-Col span="10">-->
<!-- <i-Button type="dashed" long @click="addGoods" icon="plus-round">添加新商品</i-Button>-->
<!-- </i-Col>-->
<i-Col span="2" offset="2">
<i-Button type="primary" @click="submit">提交</i-Button>
</i-Col>
<i-Col span="2" offset="1">
<i-Button type="error" @click="clear">清空所有属性</i-Button>
</i-Col>
</Row>
</Form-Item>
</template>
</i-Form>
<Spin fix v-show="submiting == true">保存中...</Spin>
</div>
<script>
var _vm ;
mpFrame.start(function(Vue){
new Vue({
data () {
return {
hidden:false,
submiting :false,
items: <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?> || [
{
value: '',
detailValue:'',
attrHidden:false,
detail:[]
}
],
attrs:<?php echo $result && isset($result['value']) && !empty($result['value']) ? json_encode($result['value']) : '[]'; ?>
}
},
watch:{
items:{
handler:function(){
// this.attrs = [];
},
deep:true
}
},
methods: {
attrHiddenBool(item){
if(item.value == ''){
$eb.message('error','请填写规则名称');
}else{
item.attrHidden = true;
}
},
hiddenBool(){
this.hidden = true;
},
handleAdd () {
if(!this.checkAttr())return ;
this.items.push({
value: '',
detailValue:'',
attrHidden:false,
detail:[]
});
},
checkAttr(){
var bool = true;
this.items.map(function(item){
if(!bool) return;
if(!item.value){
$eb.message('error','请填写规则名称');
bool = false;
}else if(!item.detail.length){
$eb.message('error','请设置规则属性');
bool = false;
}
});
return bool;
},
attrAdd (item) {
if(!item.detailValue) return false;
item.detail.push(item.detailValue);
item.detailValue = '';
},
handleRemove (index) {
if(this.items.length > 1)
this.items.splice(index,1);
else
$eb.message('error','请设置至少一个规则');
},
attrRemove(item,k){
if(1==item.detail.length){
$eb.message('error','请设置至少一个属性');
return false;
}
item.detail.splice(k,1);
},
removeGoods(index){
this.attrs.splice(index,1);
},
checkGoods(){
var bool = true;
this.attrs.map(function(attr){
if(!bool) return ;
if(!Object.keys(attr.detail).length){
$eb.message('error','请选择至少一个属性');
bool = false;
}else if(attr.price != parseFloat(attr.price) || attr.price < 0){
$eb.message('error','请输入正确的商品价格');
bool = false;
}else if(attr.sales != parseInt(attr.sales) || attr.sales < 0){
$eb.message('error','请输入正确的商品库存');
bool = false;
}
});
return bool;
},
addGoods(type){
var that = this;
if(this.attrs.length){
if(!this.checkGoods())return ;
}
$eb.axios.post("{:Url('is_format_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
if(res.data.code == 200){
that.attrs = res.data.data
}else{
$eb.message('error',res.data.msg);
}
}).catch(function(err){
if(res.data.code == 200){
that.attrs = res.data.data
}else{
$eb.message('error',res.data.msg);
}
})
// if(type === true){
// this.attrs = [{
// detail:{},
// price:'',
// sales:'',
// pic:'{$image}'
// }];
// }else{
// this.attrs.push({
// detail:{},
// price:'',
// sales:'',
// pic:'{$image}'
// });
// }
},
openPic(src){
$eb.openImage(src);
},
uploadSuccess(data){
return function(response, file, fileList){
if(response.code == 200){
data.pic = response.data.url;
}else{
$eb.message('error',response.data.msg || '图片上传失败!');
}
}
},
uploadError(error, file, fileList){
$eb.message('error',error);
},
uploadFormatError(file, fileList){
$eb.message('error','图片格式错误');
},
submit(){
var that = this;
that.submiting = true;
if(!this.checkAttr() || !this.checkGoods()) return ;
for(let attr in that.attrs){
that.attrs[attr].check = false;
}
$eb.axios.post("{:Url('set_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
that.submiting = false;
if(res.status == 200 && res.data.code == 200){
$eb.message('success',res.data.msg || '编辑成功!');
$eb.closeModalFrame(window.name);
}else{
$eb.message('error',res.data.msg || '请求失败!');
}
}).catch(function(err){
$eb.message('error',err);
})
},
clear(){
var that = this;
requirejs(['sweetalert'], function (swel) {
swel({
title: "您确定要清空产品属性吗",
text: "删除后将无法恢复,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "是的,我要清空!",
cancelButtonText: "让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function () {
$eb.axios.post("{:Url('clear_attr',array('id'=>$id))}", {
items: that.items,
attrs: that.attrs
}).then(function (res) {
if (res.status == 200 && res.data.code == 200) {
$eb.message('success', res.data.msg || '清空成功!');
window.location.reload();
} else {
$eb.message('error', res.data.msg || '清空失败!');
}
}).catch(function (err) {
$eb.message('error', err);
})
}).catch(console.log);
});
}
},
mounted (){
_vm = this;
var resultAdmin = <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?>;
if(resultAdmin) this.hidden = true;
}
}).$mount(document.getElementById('store-attr'));
});
</script>
</body>

View File

@ -1,148 +0,0 @@
{extend name="public/container"}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<select name="status" aria-controls="editable" class="form-control input-sm">
<option value="">产品状态</option>
<option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>上架</option>
<option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>下架</option>
</select>
<div class="input-group">
<input type="text" name="store_name" value="{$where.store_name}" placeholder="请输入活动标题" class="input-sm form-control" size="38"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">产品图片</th>
<th class="text-center">活动标题</th>
<th class="text-center" width="55%">活动简介</th>
<th class="text-center">价格</th>
<th class="text-center">库存</th>
<th class="text-center">开始时间</th>
<th class="text-center">结束时间</th>
<th class="text-center">添加时间</th>
<th class="text-center" width="8%">产品状态</th>
<th class="text-center">内容</th>
<th class="text-center" width="5%">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
<img src="{$vo.image}" alt="{$vo.store_name}" class="open_image" data-image="{$vo.image}" style="width: 50px;height: 50px;cursor: pointer;">
</td>
<td class="text-center">
{$vo.title}
</td>
<td class="text-center">
{$vo.info}
</td>
<td class="text-center">
{$vo.price}
</td>
<td class="text-center">
{$vo.stock}
</td>
<td class="text-center">
{$vo.start_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{$vo.stop_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{if condition="$vo['status']"}
{$vo.start_name}
{else/}
<i class="fa fa-close text-danger"></i>
{/if}
</td>
<td class="text-center">
<button type="button" class="btn btn-xs btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit_content',array('id'=>$vo['id']))}')"><i class="fa fa-pencil"></i> 编辑内容</button>
</td>
<td class="text-center">
<div class="input-group-btn js-group-btn">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
aria-expanded="false">操作
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{$vo.store_name}-属性','{:Url('attr',array('id'=>$vo['id']))}')">
<i class="fa fa-shekel"></i> 属性
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')">
<i class="fa fa-paste"></i> 编辑
</a>
</li>
<li>
<a href="javascript:void(0);" id="delstor" data-url="{:Url('delete',array('id'=>$vo['id']))}">
<i class="fa fa-warning"></i> 删除
</a>
</li>
</ul>
</div>
</div>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.js-group-btn').on('click',function(){
$('.js-group-btn').css({zIndex:1});
$(this).css({zIndex:2});
});
$('#delstor').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -1,46 +0,0 @@
{include file="public/frame_head"}
<style type="text/css" media="screen">
td img{width: 35px; height: 35px;}
</style>
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">用户名称</th>
<th class="text-center">用户头像</th>
<th class="text-center">发送消息</th>
<th class="text-center">发送时间</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
<strong class="{$vo.uid == $to_uid ? 'text-danger' : 'text-success'}">
{$vo.nickname}
</strong>
</td>
<td class="text-center"><img src="{$vo.avatar}" class="head_image" data-image="{$vo.avatar}" width="35" height="35"></td>
<td class="text-center">{$vo.msn}</td>
<td class="text-center">{$vo.add_time|date='Y-m-d H:i:s',###}</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
<script>
$('td img').on('click',function (e) {
var image = $(this).attr("src");
$eb.openImage(image);
})
</script>
</div>
{include file="public/inner_footer"}

View File

@ -1,32 +0,0 @@
{include file="public/frame_head"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">用户名称</th>
<th class="text-center">用户头像</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">{$vo.nickname}</td>
<td class="text-center"><img src="{$vo.headimgurl}" class="head_image" data-image="{$vo.headimgurl}" width="35" height="35"></td>
<td class="text-center">
<button class="btn btn-info btn-xs" type="button" onclick="window.location.href='{:Url('chat_list',array('uid'=>$now_service['uid'],'to_uid'=>$vo['uid']))}'"><i class="fa fa-commenting-o"></i> 查看对话</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{include file="public/inner_footer"}

View File

@ -1,157 +0,0 @@
{include file="public/frame_head"}
<link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
<script src="{__PLUG_PATH}moment.js"></script>
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
<script src="{__ADMIN_PATH}frame/js/plugins/iCheck/icheck.min.js"></script>
<style type="text/css">
.form-inline .input-group{display: inline-table;vertical-align: middle;}
.form-inline .input-group .input-group-btn{width: auto;}
.form-add{position: fixed;left: 0;bottom: 0;width:100%;}
.form-add .sub-btn{border-radius: 0;width: 100%;padding: 6px 0;font-size: 14px;outline: none;border: none;color: #fff;background-color: #2d8cf0;}
</style>
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form class="form-inline search" id="form" method="get">
<div class="input-group datepicker">
<input style="width: 200px;" type="text" id="data" class="input-sm form-control" name="data" value="{$where.data}" placeholder="请选择日期" >
</div>
<div class="input-group">
<input style="width: 200px;" type="text" name="nickname" value="{$where.nickname}" placeholder="请输入微信用户名称" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search"></i>搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center"></th>
<th class="text-center">编号</th>
<th class="text-center">微信用户名称</th>
<th class="text-center">头像</th>
<th class="text-center">性别</th>
<th class="text-center">地区</th>
<th class="text-center">是否关注公众号</th>
<th class="text-center">首次关注时间</th>
</tr>
</thead>
<tbody class="">
<form method="post" class="sub-save">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
<label class="checkbox-inline i-checks">
<input type="checkbox" name="ids[]" value="{$vo.uid}">
</label>
</td>
<td class="text-center">
{$vo.uid}
</td>
<td class="text-center">
{$vo.nickname}
</td>
<td class="text-center">
<img src="{$vo.headimgurl}" alt="{$vo.nickname}" title="{$vo.nickname}" style="width:50px;height: 50px;cursor: pointer;" class="head_image" data-image="{$vo.headimgurl}">
</td>
<td class="text-center">
{if condition="$vo['sex'] eq 1"}
{elseif condition="$vo['sex'] eq 2"/}
{else/}
保密
{/if}
</td>
<td class="text-center">
{$vo.country}{$vo.province}{$vo.city}
</td>
<td class="text-center">
{if condition="$vo['subscribe']"}
关注
{else/}
取消
{/if}
</td>
<td class="text-center">
{$vo.add_time|date="Y-m-d H:i:s",###}
</td>
</tr>
{/volist}
</form>
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
<div class="form-add">
<button type="submit" class="sub-btn">提交</button>
</div>
<script>
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
});
$('.head_image').on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '清空',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
$("#data").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
});
$(".sub-btn").on("click",function(){
var formData = {checked_menus:[]};
$("input[name='ids[]']:checked").each(function(){
formData.checked_menus.push($(this).val());
});
$eb.axios.post("{$save}",formData).then((res)=>{
if(res.status && res.data.code == 200)
return Promise.resolve(res.data);
else
return Promise.reject(res.data.msg || '添加失败,请稍候再试!');
}).then((res)=>{
$eb.message('success',res.msg || '操作成功!');
$eb.closeModalFrame(window.name);
}).catch((err)=>{
this.loading=false;
$eb.message('error',err);
});
})
</script>
{include file="public/inner_footer"}

View File

@ -1,28 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
{include file="public/head"}
<title>{$title}</title>
</head>
<body>
<div id="form-add" class="mp-form" v-cloak="">
<form-builder></form-builder>
</div>
<script>
var _vm ;
_mpApi = parent._mpApi;
mpFrame.start(function(Vue){
require(['axios','system/util/mpFormBuilder'],function(axios,mpFormBuilder){
Vue.use(mpFormBuilder,_mpApi,<?php echo $groups; ?>,{
action:'{$save}'
});
new Vue({
el:"#form-add",
mounted:function(){
}
});
});
});
</script>
</body>

View File

@ -1,161 +0,0 @@
{include file="public/frame_head"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-title">
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加产品</button>
</div>
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<select name="is_show" aria-controls="editable" class="form-control input-sm">
<option value="">产品状态</option>
<option value="1" {eq name="where.is_show" value="1"}selected="selected"{/eq}>上架</option>
<option value="0" {eq name="where.is_show" value="0"}selected="selected"{/eq}>下架</option>
</select>
<select name="is_hot" aria-controls="editable" class="form-control input-sm">
<option value="">热卖单品</option>
<option value="1" {eq name="where.is_hot" value="1"}selected="selected"{/eq}></option>
<option value="0" {eq name="where.is_hot" value="0"}selected="selected"{/eq}></option>
</select>
<select name="is_benefit" aria-controls="editable" class="form-control input-sm">
<option value="">促销单品</option>
<option value="1" {eq name="where.is_benefit" value="1"}selected="selected"{/eq}></option>
<option value="0" {eq name="where.is_benefit" value="0"}selected="selected"{/eq}></option>
</select>
<select name="is_best" aria-controls="editable" class="form-control input-sm">
<option value="">精品推荐</option>
<option value="1" {eq name="where.is_best" value="1"}selected="selected"{/eq}></option>
<option value="0" {eq name="where.is_best" value="0"}selected="selected"{/eq}></option>
</select>
<select name="is_new" aria-controls="editable" class="form-control input-sm">
<option value="">首发新品</option>
<option value="1" {eq name="where.is_new" value="1"}selected="selected"{/eq}></option>
<option value="0" {eq name="where.is_new" value="0"}selected="selected"{/eq}></option>
</select>
<div class="input-group">
<input type="text" name="store_name" value="{$where.store_name}" placeholder="请输入产品名称或者关键字" class="input-sm form-control" size="38"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">产品图片</th>
<th class="text-center">产品名称</th>
<th class="text-center">产品分类</th>
<th class="text-center">价格</th>
<th class="text-center">产品状态</th>
<th class="text-center">热卖单品</th>
<th class="text-center">促销单品</th>
<th class="text-center">精品推荐</th>
<th class="text-center">首发新品</th>
<th class="text-center">库存</th>
<th class="text-center">点赞</th>
<th class="text-center">收藏</th>
<th class="text-center">内容</th>
<th class="text-center">秒杀</th>
<th class="text-center">操作</th>
<th class="text-center">评论</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
<img src="{$vo.image}" alt="{$vo.store_name}" class="open_image" data-image="{$vo.image}" style="width: 50px;height: 50px;cursor: pointer;">
</td>
<td class="text-center">
{$vo.store_name}
</td>
<td class="text-center">
{$vo.cate_name}
</td>
<td class="text-center">
{$vo.price}
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_show' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_hot' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_benefit' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_best' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
<i class="fa {eq name='vo.is_new' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">
{$vo.stock}
</td>
<td class="text-center">
<span class="btn btn-xs btn-white" {if condition="$vo['collect'] gt 0"}onclick="$eb.createModalFrame('点赞','{:Url('collect',array('id'=>$vo['id']))}')"{/if} style="cursor: pointer">
<i class="fa fa-thumbs-up"></i>&nbsp;&nbsp;{$vo.collect}
</span>
</td>
<td class="text-center">
<span class="btn btn-xs btn-white" {if condition="$vo['like'] gt 0"}onclick="$eb.createModalFrame('收藏','{:Url('like',array('id'=>$vo['id']))}')"{/if} style="cursor: pointer">
<i class="fa fa-heart"></i>&nbsp;&nbsp;{$vo.like}
</span>
</td>
<td class="text-center">
<button type="button" class="btn btn-xs btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit_content',array('id'=>$vo['id']))}')"><i class="fa fa-pencil"></i> 编辑内容</button>
</td>
<td class="text-center">
<button class="btn btn-success btn-xs" type="button" onclick="$eb.createModalFrame('开启秒杀','{:Url('seckill',array('id'=>$vo['id']))}')"><i class="fa fa-forumbee"></i> 开启秒杀</button></td>
<td class="text-center">
<button class="btn btn-default btn-xs" type="button" onclick="$eb.createModalFrame('属性','{:Url('attr',array('id'=>$vo['id']))}')"><i class="fa fa-shekel"></i> 属性</button>
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-paste"></i> 编辑</button>
<button class="btn btn-warning btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-warning"></i> 删除
</button>
</td>
<td class="text-center">
<a href="{:Url('store.storeProductReply/index',array('product_id'=>$vo['id']))}">查看</a>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
<script>
$('.btn-warning').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
});
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
</div>
{include file="public/inner_footer"}

View File

@ -1,74 +0,0 @@
{extend name="public/container"}
{block name="head_top"}{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-title">
<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加客服</button>
</div>
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">微信用户名称</th>
<th class="text-center">客服头像</th>
<th class="text-center">客服名称</th>
<th class="text-center">是否显示</th>
<th class="text-center">添加时间</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">{$vo.id}</td>
<td class="text-center">{$vo.wx_name}</td>
<td class="text-center"><img src="{$vo.avatar}" class="head_image" data-image="{$vo.avatar}" width="35" height="35"></td>
<td class="text-center">{$vo.nickname}</td>
<td class="text-center">
<i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
</td>
<td class="text-center">{$vo.add_time|date='Y-m-d H:i:s',###}</td>
<td class="text-center">
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('聊天记录','{:Url('chat_user',array('id'=>$vo['id']))}')"><i class="fa fa-commenting-o"></i> 聊天记录</button>
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-paste"></i> 编辑</button>
<button class="btn btn-warning btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-warning"></i> 删除</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.btn-warning').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
});
$('.head_image').on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
</div>
{/block}

View File

@ -1,443 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<link href="{__FRAME_PATH}css/plugins/footable/footable.core.css" rel="stylesheet">
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="m-b m-l">
<div action="" class="form-inline">
<div class="search-item" data-name="status">
<span>创建时间:</span>
<a class="btn {if !$where.data && $where.date==''}btn-primary btn-sm {else}btn-outline btn-link{/if}" href="{:Url('index',['date'=>''])}">全部</a>
<a class="btn {if !$where.data && $where.date=='today'}btn-primary btn-sm {else}btn-outline btn-link{/if}" href="{:Url('index',['date'=>'today'])}">今天</a>
<a class="btn {if !$where.data && $where.date=='week'}btn-primary btn-sm{else}btn-outline btn-link{/if}" href="{:Url('index',['date'=>'week'])}">本周</a>
<a class="btn {if !$where.data && $where.date=='month'}btn-primary btn-sm{else}btn-outline btn-link{/if}" href="{:Url('index',['date'=>'month'])}">本月</a>
<a class="btn {if !$where.data && $where.date=='quarter'}btn-primary btn-sm{else}btn-outline btn-link{/if}" href="{:Url('index',['date'=>'quarter'])}">本季度</a>
<a class="btn {if !$where.data && $where.date=='year'}btn-primary btn-sm{else}btn-outline btn-link{/if}" href="{:Url('index',['date'=>'year'])}">本年</a>
<div class="datepicker" style="display: inline-block;">
<a class="btn btn-link {if $where.data}btn-primary{else}btn-outline{/if}" href="javascript:(0)" data-value="{$where.data?:'no'}">自定义</a>
</div>
<form action="">
<input class="search-item-value" type="hidden" name="data" value="{$where.data}" />
</form>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
{volist name='header' id='val'}
<div class="col-sm-3">
<div class="widget style1 {$val.color}-bg" style="height: 120px;">
<div class="row" style="margin-top: 16px;padding: 0 20px;">
<div class="col-xs-4">
<i class="fa {$val.class} fa-5x"></i>
</div>
<div class="col-xs-8 text-right">
<span> {$val.name} </span>
<h2 class="font-bold">{$val.value}</h2>
</div>
</div>
</div>
</div>
{/volist}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--------------------------->
<div class="row">
<div class="col-sm-12">
<div class="col-sm-8">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>主要数据统计</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<!-- <a class="close-link">-->
<!-- <i class="fa fa-times"></i>-->
<!-- </a>-->
</div>
</div>
<div class="ibox-content">
<div id="ec-goods-count" style="height:390px;"></div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>支付方式</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<!-- <a class="close-link">-->
<!-- <i class="fa fa-times"></i>-->
<!-- </a>-->
</div>
</div>
<div class="ibox-content">
<div id="ec-order-count" style="height:390px;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>支出详情</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<!-- <a class="close-link">-->
<!-- <i class="fa fa-times"></i>-->
<!-- </a>-->
</div>
</div>
<div class="ibox-content">
<div id="ec-zhichu-count" style="height:300px;"></div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>营收详情</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<!-- <a class="close-link">-->
<!-- <i class="fa fa-times"></i>-->
<!-- </a>-->
</div>
</div>
<div class="ibox-content">
<div id="ec-revenue-count" style="height:300px;"></div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>最近交易记录</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<!-- <a class="close-link">-->
<!-- <i class="fa fa-times"></i>-->
<!-- </a>-->
</div>
</div>
<div class="ibox-content" >
<div id="ec-new-count" style="height:300px;">
{volist name="trans" id="vo"}
<div class="col-sm-3 col-xs-3"><h4 class="text-overflow">{$vo.nickname}</h4></div>
<div class="col-sm-6 col-xs-6"><h4 class="text-overflow">购买{$vo.store_name}</h4></div>
<div class="col-sm-3 col-xs-3"><h4 class="text-overflow">{$vo.pay_price}</h4></div>
{/volist}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox-content">
<div class="text-left">
{if condition="$price['pay_price_wx'] GT 0"}
<div class="count-price">
<span>微信支付金额:<strong class="text-danger">{$price.pay_price_wx}</strong></span>
</div>
{/if}
{if condition="$price['pay_price_yue'] GT 0"}
<div class="count-price">
<span>余额支付金额:<strong class="text-danger">{$price.pay_price_yue}</strong></span>
</div>
{/if}
{if condition="$price['pay_price_offline'] GT 0"}
<div class="count-price">
<span>线下支付金额:<strong class="text-danger">{$price.pay_price_offline}</strong></span>
</div>
{/if}
</div>
<div class="m-t-n-lg text-right">
<div class="input-group">
<span class="input-group-btn">
<a class="btn btn-sm btn-info btn-outline" href="{:Url('index',['export'=>'1'])}">Excel导出</a>
</span>
</div>
</div>
</div>
</div>
</div>
<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
<script>
(function(){
var option = {
title: {
text: '数据统计'
},
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
boundaryGap: false,
splitLine: {show: false},
data: <?=json_encode($orderDays)?>
},
yAxis: {
splitLine: {
show: false
},
type: 'value'
},
legend: {
orient: 'horizontal',
left: 'center',
top: 25,
data: ['营业额','支出','盈利']
},
toolbox: {
left: 'right',
feature: {
restore: {},
saveAsImage: {}
}
},
//dataZoom: [{
// startValue: '<?php
// $index = count($orderDays) > 30 ? count($orderDays)-30 : 0;
// if(isset($orderDays[$index]))
// echo $orderDays[$index];
// ?>//'
//}, {
// type: 'inside'
//}],
visualMap: {
top: 10,
right: 10,
pieces: [{
gt: 0,
lte: 50,
color: '#096'
}, {
gt: 50,
lte: 100,
color: '#ffde33'
}, {
gt: 100,
lte: 150,
color: '#ff9933'
}, {
gt: 150,
lte: 200,
color: '#cc0033'
}, {
gt: 200,
lte: 300,
color: '#660099'
}, {
gt: 300,
color: '#7e0023'
}],
outOfRange: {
color: '#999'
}
},
series: <?= json_encode($Statistic)?>
};
var myChart = echarts.init(document.getElementById('ec-goods-count'),'light');
myChart.setOption(option);
})();
(function(){
var option = {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
legend: {
orient: 'vertical',
x: 'left',
data:['商品成本','优惠券抵扣','积分抵扣','推广人佣金','会员充值赠送']
},
series: [
{
name:'支出',
type:'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '15',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data:<?= json_encode($data)?>
}
]
};
var myChart = echarts.init(document.getElementById('ec-zhichu-count'),'light');
myChart.setOption(option);
})();
(function(){
var option = {
color: ['#3398DB'],
tooltip : {
trigger: 'axis',
axisPointer : {
type : 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
top: '4%',
containLabel: true
},
yAxis : [
{
inverse:true,
axisLine: {show: false},
type : 'category',
data : ['1、普通商品', '2、拼团商品', '3、会员充值','4、秒杀商品'],
axisTick: {
alignWithLabel: true
}
}
],
xAxis : [
{
show:false,
type : 'value'
}
],
series : [
{
name:'金额',
type:'bar',
barWidth: '60%',
data:<?= json_encode([$ordinary,$pink,$recharge,$seckill])?>
}
]
};
var myChart = echarts.init(document.getElementById('ec-revenue-count'),'light');
myChart.setOption(option);
})();
(function(){
var option = {
title: {
text: '支付统计'
},
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'horizontal',
left: 'left',
top: 25,
data: <?=urldecode(json_encode(array_keys($orderCount)))?>,
selected:<?php
$data = [];
$selected = [];
foreach ($orderCount as $k=>$count){
$data[] = ['value'=>$count,'name'=>$k];
$selected[$k] = $count>0;
}
echo urldecode(json_encode($selected));
?>
},
series : [
{
name: '订单数量',
type: 'pie',
radius : '55%',
center: ['50%', '60%'],
data:<?=urldecode(json_encode($data))?>,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
var myChart = echarts.init(document.getElementById('ec-order-count'),'light');
myChart.setOption(option);
})();
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '取消',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("input[name=data]").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
$('form').submit();
});
</script>
{/block}

View File

@ -21,7 +21,7 @@
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/wechatuserdata')}">清除微信用户</button><br> <button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/wechatuserdata')}">清除微信用户</button><br>
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/articledata')}">清除内容分类</button><br> <button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/articledata')}">清除内容分类</button><br>
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/uploaddata')}">清除所有附件</button><br> <button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/uploaddata')}">清除所有附件</button><br>
<button type="button" class="btn btn-w-m btn-danger btn-primary creatuser" data-url="{:Url('system.SystemCleardata/userdate')}">创建前台用户用户名crmeb 密码123456</button> <!--<button type="button" class="btn btn-w-m btn-danger btn-primary creatuser" data-url="{:Url('system.SystemCleardata/userdate')}">创建前台用户用户名crmeb 密码123456</button>-->
</div> </div>
<script> <script>
$('.cleardata').on('click',function(){ $('.cleardata').on('click',function(){

View File

@ -10,7 +10,7 @@
<div class="table-responsive"> <div class="table-responsive">
<table class="layui-hide" id="fileList" lay-filter="fileList"></table> <table class="layui-hide" id="fileList" lay-filter="fileList"></table>
<script type="text/html" id="fileListtool"> <script type="text/html" id="fileListtool">
<button type="button" class="layui-btn layui-btn-xs" lay-event="import"><i class="layui-icon layui-icon-edit"></i></button> <button type="button" class="layui-btn layui-btn-xs" lay-event="import"><i class="layui-icon layui-icon-edit"></i></button>
<button type="button" class="layui-btn layui-btn-xs" lay-event="delFile"><i class="layui-icon layui-icon-edit"></i>删除</button> <button type="button" class="layui-btn layui-btn-xs" lay-event="delFile"><i class="layui-icon layui-icon-edit"></i>删除</button>
<button type="button" class="layui-btn layui-btn-xs" lay-event="downloadFile"><i class="layui-icon layui-icon-edit"></i>下载</button> <button type="button" class="layui-btn layui-btn-xs" lay-event="downloadFile"><i class="layui-icon layui-icon-edit"></i>下载</button>
@ -84,12 +84,12 @@
elem: '#fileList' elem: '#fileList'
,url:"{:Url('fileList')}" ,url:"{:Url('fileList')}"
,cols: [[ ,cols: [[
{field: 'filename', title: '备份名称', sort: true}, {field: 'filename', title: '备份名称', sort: true,width:'25%'},
{field: 'part', title: 'part'}, {field: 'part', title: 'part',width:'10%'},
{field: 'size', title: '大小'}, {field: 'size', title: '大小',width:'10%'},
{field: 'compress', title: 'compress'}, {field: 'compress', title: 'compress',width:'10%'},
{field: 'backtime', title: '时间'}, {field: 'backtime', title: '时间',width:'20%'},
{fixed: 'right', title: '操作', width: '20%', align: 'center', toolbar: '#fileListtool'} {fixed: 'right', title: '操作', width: '25%', align: 'center', toolbar: '#fileListtool'}
]] ]]
,page: false ,page: false
}); });
@ -128,11 +128,11 @@
,toolbar: '#toolbarDemo' ,toolbar: '#toolbarDemo'
,cols: [[ ,cols: [[
{type:'checkbox'}, {type:'checkbox'},
{field: 'name', title: '表名称', sort: true}, {field: 'name', title: '表名称', sort: true,width:'20%'},
{field: 'comment', title: '备注' }, {field: 'comment', title: '备注',width:'20%'},
{field: 'engine', title: '类型', sort: true}, {field: 'engine', title: '类型', sort: true,width:'10%'},
{field: 'data_length', title: '大小', sort: true,totalRow: true}, {field: 'data_length', title: '大小',width:'10%', sort: true,totalRow: true},
{field: 'update_time', title: '更新时间', sort: true}, {field: 'update_time', title: '更新时间',width:'20%', sort: true},
{field: 'rows', title: '行数'}, {field: 'rows', title: '行数'},
{fixed: 'right', title: '操作', width: '10%', align: 'center', toolbar: '#barDemo'} {fixed: 'right', title: '操作', width: '10%', align: 'center', toolbar: '#barDemo'}
]] ]]

View File

@ -1,229 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script type="text/javascript" src="{__PLUG_PATH}jquery.downCount.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>砍价产品搜索</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
</div>
</div>
<div class="ibox-content">
<div class="alert alert-success alert-dismissable">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
目前拥有{$countBargain}个砍价产品
</div>
<form class="layui-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">搜  索:</label>
<div class="layui-input-inline">
<input type="text" name="store_name" lay-verify="store_name" style="width: 100%" autocomplete="off" placeholder="请输入产品名称,编号" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">砍价状态:</label>
<div class="layui-input-inline">
<select name="status" lay-verify="status">
<option value="">全部</option>
<option value="1">开启</option>
<option value="0">关闭</option>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">
<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="search" style="font-size:14px;line-height: 9px;">
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索</button>
<button lay-submit="export" lay-filter="export" class="layui-btn layui-btn-primary layui-btn-sm">
<i class="layui-icon layui-icon-delete layuiadmin-button-btn" ></i> Excel导出</button>
</label>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="table-responsive" style="margin-top: 20px;">
<!-- <div class="layui-btn-group conrelTable">-->
<!-- <button class="layui-btn layui-btn-sm layui-btn-danger" type="button" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')"><i class="fa fa-check-circle-o"></i>添加砍价</button>-->
<!-- </div>-->
<table class="layui-hide" id="bargainList" lay-filter="bargainList"></table>
<script type="text/html" id="status">
<input type='checkbox' name='status' lay-skin='switch' value="{{d.id}}" lay-filter='status' lay-text='开启|关闭' {{ d.status == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="statusCn">
{{ d.status == 1 ? d.start_name : '关闭' }}
</script>
<script type="text/html" id="stopTime">
<div class="count-time-{{d.id}}" data-time="{{d._stop_time}}">
<span class="days">00</span>
:
<span class="hours">00</span>
:
<span class="minutes">00</span>
:
<span class="seconds">00</span>
</div>
</script>
<script type="text/html" id="barDemo">
<button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)"><i class="layui-icon layui-icon-util"></i>操作</button>
<ul class="layui-nav-child layui-anim layui-anim-upbit">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑','{:Url('edit')}?id={{d.id}}')"><i class="layui-icon layui-icon-edit"></i> 编辑</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑内容','{:Url('edit_content')}?id={{d.id}}')"><i class="fa fa-pencil"></i> 编辑内容</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑规则','{:Url('edit_rule')}?id={{d.id}}')"><i class="layui-icon layui-icon-edit"></i>编辑规则</a>
</li>
<li>
<a href="javascript:void(0);" class="delstor" lay-event='delstor'><i class="layui-icon layui-icon-delete"></i> 删除</a>
</li>
</ul>
</script>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
<script>
layList.form.render();
window.$bargainId = <?php echo json_encode($bargainId);?>;
$(document).on('click','#time',function () {
var arr = $('#time').text().split(' - ');
var reg = new RegExp("-","g");//g,表示全部替换。
var newArr = [];
if(arr.length >1){
$.each(arr,function (index,item) {
newArr.push(item.replace(reg,"/"));
})
$('#time').data('value',newArr.join(' - '));
}
});
layList.tableList('bargainList',"{:Url('get_bargain_list')}",function () {
return [
{field: 'id', title: '编号', sort: true,width:'5%',event:'id',unresize:true},
{field: 'image', title: '砍价图片',event:'open_image',unresize:true, width: '8%',templet: '<p><img src="{{d.image}}" alt="{{d.title}}"></p>'},
{field: 'title', title: '砍价名称',width:'15%',unresize:true},
{field: 'price', title: '砍价价格',width:'6%',unresize:true},
{field: 'bargain_min_price', title: '砍价区间',unresize:true,width:'8%',templet: '<span>{{d.bargain_min_price}}~{{d.bargain_max_price}}</span>'},
{field: 'min_price', title: '最低价',width:'5%',unresize:true},
{field: 'status', title: '砍价状态',width:'8%',unresize:true,templet:"#status"},
{field: 'right', title: '活动状态',width:'8%',unresize:true,templet:"#statusCn"},
{field: 'count_people_all', title: '参与人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_all}}】人</span>'},
{field: 'count_people_help', title: '帮忙砍价人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_help}}】人</span>'},
{field: 'count_people_success', title: '砍价成功人数',unresize:true,width:'6%',templet: '<span>【{{d.count_people_success}}】人</span>'},
{field: 'look', title: '浏览量',width:'6%',unresize:true},
{field: 'stock', title: '库存',width:'4%',unresize:true},
{fixed: 'right', title: '结束时间', width: '10%',toolbar: '#stopTime',unresize:true},
{fixed: 'right', title: '操作', width: '5%', align: 'center', toolbar: '#barDemo'}
]
});
// layList.date('time');
layList.laydate.render({
elem:'#time',
trigger:'click',
eventElem:'#zdy_time',
range:true,
});
setTime();
function setTime(){
setTimeout(function () {
$.each($bargainId,function (index,item) {
console.log($('.count-time-'+item).attr('data-time'));
$('.count-time-'+item).downCount({
date: $('.count-time-'+item).attr('data-time'),
offset: +8
});
})
},3000);
}
layList.search('search',function(where){
layList.reload(where);
setTime();
});
layList.search('export',function(where){
location.href=layList.U({c:'ump.store_bargain',a:'get_bargain_list',q:{
store_name:where.store_name,
status:where.status,
export:1,
}});
})
layList.switch('status',function (odj,value,name){
if(odj.elem.checked==true){
layList.baseGet(layList.Url({c:'ump.store_bargain',a:'set_bargain_status',p:{status:1,id:value}}),function (res) {
layList.msg(res.msg);
});
}else{
layList.baseGet(layList.Url({c:'ump.store_bargain',a:'set_bargain_status',p:{status:0,id:value}}),function (res) {
layList.msg(res.msg);
});
}
});
layList.tool(function (event,data,obj) {
switch (event) {
case 'delstor':
var url=layList.U({c:'ump.store_bargain',a:'delete',q:{id:data.id}});
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
obj.del();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
break;
}
})
$(document).click(function (e) {
$('.layui-nav-child').hide();
})
function dropdown(that){
var oEvent = arguments.callee.caller.arguments[0] || event;
oEvent.stopPropagation();
var offset = $(that).offset();
var top=offset.top-$(window).scrollTop();
var index = $(that).parents('tr').data('index');
$('.layui-nav-child').each(function (key) {
if (key != index) {
$(this).hide();
}
})
if($(document).height() < top+$(that).next('ul').height()){
$(that).next('ul').css({
'padding': 10,
'top': - ($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
'min-width': 'inherit',
'position': 'absolute'
}).toggle();
}else{
$(that).next('ul').css({
'padding': 10,
'top':$(that).parent('td').height() / 2 + $(that).height(),
'min-width': 'inherit',
'position': 'absolute'
}).toggle();
}
}
</script>
{/block}

View File

@ -1,371 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
{include file="public/head"}
<title>{$title|default=''}</title>
<style>
.demo-upload{
display: block;
height: 33px;
text-align: center;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0,0,0,.2);
margin-right: 4px;
}
.demo-upload img{
width: 100%;
height: 100%;
display: block;
}
.demo-upload-cover{
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.6);
}
.demo-upload:hover .demo-upload-cover{
display: block;
}
.demo-upload-cover i{
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
.check{color: #f00}
</style>
</head>
<body>
<div id="store-attr" class="mp-form" v-cloak="">
<i-Form :label-width="80" style="width: 100%" v-show="hidden == false">
<Form-Item>
<Row>
<i-Col span="5">
<i-Button type="dashed" long @click="hiddenBool" icon="plus-round">添加新规则</i-Button>
</i-Col>
</Row>
</Form-Item>
</i-Form>
<i-Form :label-width="80" style="width: 100%" v-show="hidden == true">
<Form-Item
:label="'规则名称:'">
<Row>
<i-Col style="position: relative;margin-right: 6px" span="5"
v-for="(item, index) in items"
:key="index">
<i-Input type="text" v-model="item.value" placeholder="设置名称"></i-Input>
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="handleRemove(index)" v-show="item.attrHidden == true"><Icon type="close-round" /></i-Button>
<i-Button style="position: absolute;top:0;right:0;margin-top:1px;border: none;font-size: 8px;line-height: 1.8" type="ghost" @click="attrHiddenBool(item)" v-show="item.attrHidden == false"><Icon type="checkmark-round"></Icon></i-Button>
</i-Col>
<i-Col span="5">
<i-Button type="dashed" long @click="handleAdd" icon="plus-round">添加新规则</i-Button>
</i-Col>
</Row>
</Form-Item>
<Form-Item v-show="item.attrHidden == true"
v-for="(item, index) in items"
:key="index"
:label="''+item.value+':'" >
<Row>
<i-Col span="3"
v-for="(attr,k) in item.detail"
:key="attr"
:name="attr">
<Tag type="border" closable color="blue" @on-close="attrRemove(item,k)">{{ attr }}</Tag>
</i-Col>
<i-Col span="5">
<i-Input type="text" v-model="item.detailValue" placeholder="设置属性"></i-Input>
</i-Col>
<i-Col span="5">
<i-Button type="primary" style="margin-left: 6px" @click="attrAdd(item)">添加</i-Button>
</i-Col>
</Row>
</Form-Item>
<Form-Item v-show="hidden == true" style="width: 100%;">
<Row style="margin: 0 88px 0 20px">
<i-Col span="24">
<i-Button type="primary" long @click="addGoods(true)">生成</i-Button>
</i-Col>
</Row>
</Form-Item>
<template v-if="items[0].value!='' && items[0].detail.length>0 && attrs.length">
<template v-for="(attr,index) in attrs">
<Form-Item>
<Row>
<template v-for="(item,index) in attr.detail">
<i-Col span="3" style="margin-right: 3px">
{{index}}:{{item}}
</i-Col>
</template>
<i-Col span="5" style="margin-right: 3px">
<span :class="attr.check ? 'check':''">金额:</span><i-Input placeholder="请输入金额" v-model="attr.price" style="width: 68%"
:number="true"></i-Input>
</i-Col>
<i-Col span="5" style="margin-right: 3px">
<span :class="attr.check ? 'check':''">库存:</span><i-Input placeholder="请输入库存" v-model="attr.sales" style="width: 68%"
:number="true"></i-Input>
</i-Col>
<i-Col span="2" offset="1" style="margin-right: 3px">
<div class="demo-upload">
<img :src="attr.pic">
<div class="demo-upload-cover">
<Icon type="ios-eye-outline" @click.native="openPic(attr.pic)" ></Icon>
<Upload
:show-upload-list="false"
:on-success="uploadSuccess(attr)"
:on-error="uploadError"
:format="['jpg','jpeg','png']"
:max-size="2048"
accept="image/*"
:on-format-error="uploadFormatError"
action="{:Url('upload')}"
style="display: inline-block"
:goods="attr"
>
<Icon type="ios-cloud-upload-outline"></Icon>
</Upload>
</div>
</div>
</i-Col>
<i-Col span="2" style="margin-right: 3px">
<i-Button type="ghost" @click="removeGoods(index)">删除</i-Button>
</i-Col>
</Row>
</Form-Item>
</template>
<Form-Item>
<Row>
<!-- <i-Col span="10">-->
<!-- <i-Button type="dashed" long @click="addGoods" icon="plus-round">添加新商品</i-Button>-->
<!-- </i-Col>-->
<i-Col span="2" offset="2">
<i-Button type="primary" @click="submit">提交</i-Button>
</i-Col>
<i-Col span="2" offset="1">
<i-Button type="error" @click="clear">清空所有属性</i-Button>
</i-Col>
</Row>
</Form-Item>
</template>
</i-Form>
<Spin fix v-show="submiting == true">保存中...</Spin>
</div>
<script>
var _vm ;
mpFrame.start(function(Vue){
new Vue({
data () {
return {
hidden:false,
submiting :false,
items: <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?> || [
{
value: '',
detailValue:'',
attrHidden:false,
detail:[]
}
],
attrs:<?php echo $result && isset($result['value']) && !empty($result['value']) ? json_encode($result['value']) : '[]'; ?>
}
},
watch:{
items:{
handler:function(){
// this.attrs = [];
},
deep:true
}
},
methods: {
attrHiddenBool(item){
if(item.value == ''){
$eb.message('error','请填写规则名称');
}else{
item.attrHidden = true;
}
},
hiddenBool(){
this.hidden = true;
},
handleAdd () {
if(!this.checkAttr())return ;
this.items.push({
value: '',
detailValue:'',
attrHidden:false,
detail:[]
});
},
checkAttr(){
var bool = true;
this.items.map(function(item){
if(!bool) return;
if(!item.value){
$eb.message('error','请填写规则名称');
bool = false;
}else if(!item.detail.length){
$eb.message('error','请设置规则属性');
bool = false;
}
});
return bool;
},
attrAdd (item) {
if(!item.detailValue) return false;
item.detail.push(item.detailValue);
item.detailValue = '';
},
handleRemove (index) {
if(this.items.length > 1)
this.items.splice(index,1);
else
$eb.message('error','请设置至少一个规则');
},
attrRemove(item,k){
if(1==item.detail.length){
$eb.message('error','请设置至少一个属性');
return false;
}
item.detail.splice(k,1);
},
removeGoods(index){
this.attrs.splice(index,1);
},
checkGoods(){
var bool = true;
this.attrs.map(function(attr){
if(!bool) return ;
if(!Object.keys(attr.detail).length){
$eb.message('error','请选择至少一个属性');
bool = false;
}else if(attr.price != parseFloat(attr.price) || attr.price < 0){
$eb.message('error','请输入正确的商品价格');
bool = false;
}else if(attr.sales != parseInt(attr.sales) || attr.sales < 0){
$eb.message('error','请输入正确的商品库存');
bool = false;
}
});
return bool;
},
addGoods(type){
var that = this;
if(this.attrs.length){
if(!this.checkGoods())return ;
}
$eb.axios.post("{:Url('is_format_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
if(res.data.code == 200){
that.attrs = res.data.data
}else{
$eb.message('error',res.data.msg);
}
}).catch(function(err){
if(res.data.code == 200){
that.attrs = res.data.data
}else{
$eb.message('error',res.data.msg);
}
})
// if(type === true){
// this.attrs = [{
// detail:{},
// price:'',
// sales:'',
// pic:'{$image}'
// }];
// }else{
// this.attrs.push({
// detail:{},
// price:'',
// sales:'',
// pic:'{$image}'
// });
// }
},
openPic(src){
$eb.openImage(src);
},
uploadSuccess(data){
return function(response, file, fileList){
if(response.code == 200){
data.pic = response.data.url;
}else{
$eb.message('error',response.data.msg || '图片上传失败!');
}
}
},
uploadError(error, file, fileList){
$eb.message('error',error);
},
uploadFormatError(file, fileList){
$eb.message('error','图片格式错误');
},
submit(){
var that = this;
that.submiting = true;
if(!this.checkAttr() || !this.checkGoods()) return ;
for(let attr in that.attrs){
that.attrs[attr].check = false;
}
$eb.axios.post("{:Url('set_attr',array('id'=>$id))}",{items:this.items,attrs:this.attrs}).then(function(res){
that.submiting = false;
if(res.status == 200 && res.data.code == 200){
$eb.message('success',res.data.msg || '编辑成功!');
$eb.closeModalFrame(window.name);
}else{
$eb.message('error',res.data.msg || '请求失败!');
}
}).catch(function(err){
$eb.message('error',err);
})
},
clear(){
var that = this;
requirejs(['sweetalert'], function (swel) {
swel({
title: "您确定要清空产品属性吗",
text: "删除后将无法恢复,请谨慎操作!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "是的,我要清空!",
cancelButtonText: "让我再考虑一下…",
closeOnConfirm: false,
closeOnCancel: false
}).then(function () {
$eb.axios.post("{:Url('clear_attr',array('id'=>$id))}", {
items: that.items,
attrs: that.attrs
}).then(function (res) {
if (res.status == 200 && res.data.code == 200) {
$eb.message('success', res.data.msg || '清空成功!');
window.location.reload();
} else {
$eb.message('error', res.data.msg || '清空失败!');
}
}).catch(function (err) {
$eb.message('error', err);
})
}).catch(console.log);
});
}
},
mounted (){
_vm = this;
var resultAdmin = <?php echo $result && isset($result['attr']) && !empty($result['attr']) ? json_encode($result['attr']) : 'false'; ?>;
if(resultAdmin) this.hidden = true;
}
}).$mount(document.getElementById('store-attr'));
});
</script>
</body>

View File

@ -1,212 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<form action="" class="form-inline">
<div class="input-group datepicker">
<input style="width: 188px;" type="text" id="data" class="input-sm form-control" name="data" value="{$where.data}" placeholder="请选择日期" >
</div>
<select name="status" aria-controls="editable" class="form-control input-sm">
<option value="">全部</option>
<option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>进行中</option>
<option value="2" {eq name="where.status" value="2"}selected="selected"{/eq}>已完成</option>
<option value="3" {eq name="where.status" value="3"}selected="selected"{/eq}>未完成</option>
</select>
<div class="input-group">
<span class="input-group-btn">
<button type="submit" id="no_export" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button>
</span>
</div>
<script>
$('#export').on('click',function(){
$('input[name=export]').val(1);
});
$('#no_export').on('click',function(){
$('input[name=export]').val(0);
});
</script>
</form>
</div>
</div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">开团团长</th>
<th class="text-center">开团时间</th>
<th class="text-center">拼团产品</th>
<th class="text-center">几人团</th>
<th class="text-center">几人参加</th>
<th class="text-center">结束时间</th>
<th class="text-center">状态</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.uid|getUserNickname}/{$vo.uid}
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{$vo.title}/{$vo.cid}
</td>
<td class="text-center">
{$vo.people}
</td>
<td class="text-center">
{$vo.count_people}
</td>
<td class="text-center">
{$vo.stop_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{if condition="$vo['status'] eq 1"}
<span style="color: #00a0e9">进行中</span>
{elseif condition="$vo['status'] eq 2"}
<span style="color: #e933ce">已完成</span>
{elseif condition="$vo['status'] eq 3"}
<span style="color: #2725e9">未完成</span>
{/if}
</td>
<td class="text-center">
<p><button class="btn btn-default btn-xs btn-outline" type="button" onclick="$eb.createModalFrame('查看详情','{:Url('order_pink',array('id'=>$vo['id']))}')"><i class="fa fa-newspaper-o"></i>查看详情</button></p>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
{include file="public/inner_page"}
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
$('.btn-danger').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.offline_btn').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.add_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id');
$eb.$alert('textarea',{},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
$('.save_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
$eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '清空',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
$("#data").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
});
</script>
{/block}

View File

@ -1,269 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script type="text/javascript" src="{__PLUG_PATH}jquery.downCount.js"></script>
{/block}
{block name="content"}
<div class="layui-fluid">
<div class="layui-row layui-col-space15" id="app">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">拼团产品搜索</div>
<div class="layui-card-body">
<div class="alert alert-success alert-dismissable">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
目前拥有{$countCombination}个拼团产品
</div>
<form class="layui-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">搜  索:</label>
<div class="layui-input-inline">
<input type="text" name="store_name" lay-verify="store_name" style="width: 100%" autocomplete="off" placeholder="请输入产品名称,关键字,编号" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">拼团状态:</label>
<div class="layui-input-inline">
<select name="is_show" lay-verify="is_show">
<option value="">全部</option>
<option value="1">开启</option>
<option value="0">关闭</option>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">
<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="search" style="font-size:14px;line-height: 9px;">
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索</button>
<button lay-submit="export" lay-filter="export" class="layui-btn layui-btn-primary layui-btn-sm">
<i class="layui-icon layui-icon-delete layuiadmin-button-btn" ></i> Excel导出</button>
</label>
</div>
</form>
</div>
</div>
</div>
<div class="layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
总展现量
<span class="layui-badge layuiadmin-badge"></span>
</div>
<div class="layui-card-body">
<p class="layuiadmin-big-font">{$statistics.browseCount}</p>
</div>
</div>
</div>
<div class="layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
访客人数
<span class="layui-badge layuiadmin-badge"></span>
</div>
<div class="layui-card-body">
<p class="layuiadmin-big-font">{$statistics.visitCount}</p>
</div>
</div>
</div>
<div class="layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
参与人数
<span class="layui-badge layuiadmin-badge"></span>
</div>
<div class="layui-card-body">
<p class="layuiadmin-big-font">{$statistics.partakeCount}</p>
</div>
</div>
</div>
<div class="layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
成团数量
<span class="layui-badge layuiadmin-badge"></span>
</div>
<div class="layui-card-body">
<p class="layuiadmin-big-font">{$statistics.pinkCount}</p>
</div>
</div>
</div>
<!-- end-->
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">拼团产品列表</div>
<div class="layui-card-body">
<table class="layui-hide" id="combinationList" lay-filter="combinationList"></table>
<script type="text/html" id="status">
<input type='checkbox' name='status' lay-skin='switch' value="{{d.id}}" lay-filter='status' lay-text='开启|关闭' {{ d.is_show == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="stopTime">
<div class="count-time-{{d.id}}" data-time="{{d._stop_time}}">
<span class="days">00</span>
:
<span class="hours">00</span>
:
<span class="minutes">00</span>
:
<span class="seconds">00</span>
</div>
</script>
<script type="text/html" id="barDemo">
<button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)"><i class="layui-icon layui-icon-edit"></i>操作</button>
<ul class="layui-nav-child layui-anim layui-anim-upbit">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑','{:Url('edit')}?id={{d.id}}')"><i class="layui-icon layui-icon-edit"></i> 编辑</a>
</li>
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.title}}-编辑内容','{:Url('edit_content')}?id={{d.id}}')"><i class="fa fa-pencil"></i> 编辑内容</a>
</li>
<li>
<a href="javascript:void(0);" class="delstor" lay-event='delstor'><i class="layui-icon layui-icon-delete"></i> 删除</a>
</li>
</ul>
</script>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
<script>
layList.form.render();
layList.tableList('combinationList',"{:Url('get_combination_list')}",function () {
return [
{field: 'id', title: '编号', sort: true,event:'id'},
{field: 'image', title: '拼团图片',templet: '<p><img src="{{d.image}}" alt="{{d.title}}" class="open_image" data-image="{{d.image}}"></p>'},
{field: 'title', title: '拼团名称'},
{field: 'ot_price', title: '原价'},
{field: 'price', title: '拼团价'},
{field: 'stock', title: '库存'},
{field: 'people', title: '拼团人数',templet: '<span>【{{d.people}}】人</span>'},
{field: 'count_people_browse', title: '访客人数'},
{field: 'browse', title: '展现量'},
{field: 'count_people_all', title: '参与人数',templet: '<span>【{{d.count_people_all}}】人</span>'},
{field: 'count_people_pink', title: '成团数量',templet: '<span>【{{d.count_people_pink}}】团</span>'},
{field: 'browse', title: '浏览量'},
{field: 'is_show', title: '产品状态',templet:"#status"},
{field: '_stop_time', title: '结束时间',width:'8%',toolbar: '#stopTime'},
{fixed: 'right', title: '操作', align: 'center', toolbar: '#barDemo'}
]
});
layList.search('search',function(where){
layList.reload(where);
setTime();
});
layList.search('export',function(where){
location.href=layList.U({c:'ump.store_combination',a:'save_excel',q:{
is_show:where.is_show,
store_name:where.store_name
}});
})
setTime();
window.$combinationId = <?php echo json_encode($combinationId);?>;
function setTime() {
setTimeout(function () {
$.each($combinationId,function (index,item) {
$('.count-time-'+item).downCount({
date: $('.count-time-'+item).attr('data-time'),
offset: +8
});
})
},3000);
}
layList.switch('status',function (odj,value,name) {
if (odj.elem.checked == true) {
layList.baseGet(layList.Url({
c: 'ump.store_combination',
a: 'set_combination_status',
p: {status: 1, id: value}
}), function (res) {
layList.msg(res.msg);
});
} else {
layList.baseGet(layList.Url({
c: 'ump.store_combination',
a: 'set_combination_status',
p: {status: 0, id: value}
}), function (res) {
layList.msg(res.msg);
});
}
})
layList.tool(function (event,data,obj) {
switch (event) {
case 'delstor':
var url=layList.U({c:'ump.store_combination',a:'delete',q:{id:data.id}});
console.log(url);
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
obj.del();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
break;
}
})
$(document).click(function (e) {
$('.layui-nav-child').hide();
})
function dropdown(that){
var oEvent = arguments.callee.caller.arguments[0] || event;
oEvent.stopPropagation();
var offset = $(that).offset();
var top=offset.top-$(window).scrollTop();
var index = $(that).parents('tr').data('index');
$('.layui-nav-child').each(function (key) {
if (key != index) {
$(this).hide();
}
})
if($(document).height() < top+$(that).next('ul').height()){
$(that).next('ul').css({
'padding': 10,
'top': - ($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
'min-width': 'inherit',
'position': 'absolute'
}).toggle();
}else{
$(that).next('ul').css({
'padding': 10,
'top':$(that).parent('td').height() / 2 + $(that).height(),
'min-width': 'inherit',
'position': 'absolute'
}).toggle();
}
}
$('.js-group-btn').on('click',function(){
$('.js-group-btn').css({zIndex:1});
$(this).css({zIndex:2});
});
$('.delstor').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
console.log(res);
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
_this.parents('tr').remove();
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
});
$(document).on('click',".open_image",function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
</script>
{/block}

View File

@ -1,173 +0,0 @@
{extend name="public/container"}
{block name="head_top"}
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__PLUG_PATH}moment.js"></script>
<link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
<script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-content">
<div class="row">
</div>
<div class="table-responsive" style="overflow:visible">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-center">编号</th>
<th class="text-center">用户名称</th>
<th class="text-center">用户头像</th>
<th class="text-center">订单编号</th>
<th class="text-center">金额</th>
<th class="text-center">订单状态</th>
</thead>
<tbody class="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.nickname}/{$vo.uid}
</td>
<td class="text-center">
<img class="open_image" style="max-width: 80px;" data-image="{$vo.avatar}" src="{$vo.avatar}" alt="{$vo.nickname}">
</td>
<td class="text-center">
<a href="{:Url('order.storeOrder/index')}?real_name={$vo.order_id_key|getOrderId}">{$vo.order_id}</a>
</td>
<td class="text-center">
{$vo.price}
</td>
<td class="text-center">
{if condition="$vo['is_refund']"}
已退款
{else/}
未退款
{/if}
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$(".open_image").on('click',function (e) {
var image = $(this).data('image');
$eb.openImage(image);
})
$('.btn-danger').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.offline_btn').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url'),pay_price =_this.data('pay');
$eb.$swal('delete',function(){
$eb.axios.get(url).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.$swal('success',res.data.msg);
}else
return Promise.reject(res.data.msg || '收货失败')
}).catch(function(err){
$eb.$swal('error',err);
});
},{'title':'您确定要修改已支付'+pay_price+'元的状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
})
$('.add_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id');
$eb.$alert('textarea',{},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
$('.save_mark').on('click',function (e) {
var _this = $(this),url =_this.data('url'),id=_this.data('id'),make=_this.data('make');
$eb.$alert('textarea',{title:'请修改内容',value:make},function (result) {
if(result){
$.ajax({
url:url,
data:'remark='+result+'&id='+id,
type:'post',
dataType:'json',
success:function (res) {
console.log(res);
if(res.code == 200) {
$eb.$swal('success',res.msg);
}else
$eb.$swal('error',res.msg);
}
})
}else{
$eb.$swal('error','请输入要备注的内容');
}
});
})
var dateInput =$('.datepicker');
dateInput.daterangepicker({
autoUpdateInput: false,
"opens": "center",
"drops": "down",
"ranges": {
'今天': [moment(), moment().add(1, 'days')],
'昨天': [moment().subtract(1, 'days'), moment()],
'上周': [moment().subtract(6, 'days'), moment()],
'前30天': [moment().subtract(29, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
"locale" : {
applyLabel : '确定',
cancelLabel : '清空',
fromLabel : '起始时间',
toLabel : '结束时间',
format : 'YYYY/MM/DD',
customRangeLabel : '自定义',
daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月' ],
firstDay : 1
}
});
dateInput.on('cancel.daterangepicker', function(ev, picker) {
$("#data").val('');
});
dateInput.on('apply.daterangepicker', function(ev, picker) {
$("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
});
</script>
{/block}

View File

@ -46,7 +46,7 @@
{$vo.coupon_time} {$vo.coupon_time}
</td> </td>
<td class="text-center"> <td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_all',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放 <button class="btn btn-primary btn-xs grant" data-url="{:Url('ump.storeCouponUser/grant_all',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button> </button>
</td> </td>
</tr> </tr>

View File

@ -46,7 +46,7 @@
{$vo.coupon_time} {$vo.coupon_time}
</td> </td>
<td class="text-center"> <td class="text-center">
<button class="btn btn-primary btn-xs grant" data-id="{$vo['id']}" data-url="{:Url('store.storeCouponUser/grant_group',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放 <button class="btn btn-primary btn-xs grant" data-id="{$vo['id']}" data-url="{:Url('ump.storeCouponUser/grant_group',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button> </button>
</td> </td>
</tr> </tr>

View File

@ -46,7 +46,7 @@
{$vo.coupon_time} {$vo.coupon_time}
</td> </td>
<td class="text-center"> <td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_subscribe',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放 <button class="btn btn-primary btn-xs grant" data-url="{:Url('ump.storeCouponUser/grant_subscribe',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button> </button>
</td> </td>
</tr> </tr>

View File

@ -46,7 +46,7 @@
{$vo.coupon_time} {$vo.coupon_time}
</td> </td>
<td class="text-center"> <td class="text-center">
<button class="btn btn-primary btn-xs grant" data-url="{:Url('store.storeCouponUser/grant_tag',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放 <button class="btn btn-primary btn-xs grant" data-url="{:Url('ump.storeCouponUser/grant_tag',array('id'=>$vo['id']))}" type="button"><i class="fa fa-arrow-circle-o-right"></i> 发放
</button> </button>
</td> </td>
</tr> </tr>

Some files were not shown because too many files have changed in this diff Show More