上传后台会员等级

This commit is contained in:
liaofei 2019-05-16 14:27:53 +08:00
parent 39a31f5d9e
commit cab7164f65
94 changed files with 6548 additions and 649 deletions

View File

@ -102,3 +102,18 @@ function clearfile($path,$ext = '*.log')
}
return true;
}
/**获取当前类方法
* @param $class
* @return array
*/
function get_this_class_methods($class,$array4 = []) {
$array1 = get_class_methods($class);
if ($parent_class = get_parent_class($class)) {
$array2 = get_class_methods($parent_class);
$array3 = array_diff($array1, $array2);//去除父级的
} else {
$array3 = $array1;
}
$array5 = array_diff($array3, $array4);//去除无用的
return $array5;
}

View File

@ -57,13 +57,13 @@ class Index extends AuthController
->count();
//库存预警
$replenishment_num = SystemConfig::getValue('store_stock') > 0 ? SystemConfig::getValue('store_stock') : 20;//库存预警界限
$topData['stockProduct'] = StoreProduct::where('stock','<=',$replenishment_num)->where('is_del',0)->count();
$topData['stockProduct'] = StoreProduct::where('stock','<=',$replenishment_num)->where('is_show',1)->where('is_del',0)->count();
//待处理提现
$topData['treatedExtract'] = UserExtractModel::where('status',0)->count();
//订单数->
$now_day_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$now_day)->count();
//订单数->
$now_day_order_p = StoreOrderModel::where('paid',1)->whereTime('pay_time','yesterday')->count();
$pre_day_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$pre_day)->where('pay_time','lt',$now_day)->count();
$first_line['d_num'] = [
'data' => $now_day_order_p ? $now_day_order_p : 0,
@ -72,8 +72,8 @@ class Index extends AuthController
];
//交易额->昨天
$now_month_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$pre_day)->value('sum(pay_price)');
$pre_month_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$beforyester_day)->where('pay_time','lt',$pre_day)->value('sum(pay_price)');
$now_month_order_p = StoreOrderModel::where('paid',1)->whereTime('pay_time','yesterday')->sum('pay_price');
$pre_month_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$beforyester_day)->where('pay_time','lt',$pre_day)->sum('pay_price');
$first_line['d_price'] = [
'data' => $now_month_order_p > 0 ? $now_month_order_p : 0,
'percent' => abs($now_month_order_p - $pre_month_order_p),
@ -81,7 +81,7 @@ class Index extends AuthController
];
//交易额->月
$now_month_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$now_month)->value('sum(pay_price)');
$now_month_order_p = StoreOrderModel::where('paid',1)->whereTime('pay_time','month')->sum('pay_price');
$pre_month_order_p = StoreOrderModel::where('paid',1)->where('pay_time','gt',$pre_month)->where('pay_time','lt',$now_month)->value('sum(pay_price)');
$first_line['m_price'] = [
'data' => $now_month_order_p > 0 ? $now_month_order_p : 0,
@ -156,8 +156,8 @@ class Index extends AuthController
$datalist[date('m-d',strtotime($i.' day'))] = date('m-d',strtotime($i.' day'));
}
$order_list = StoreOrderModel::where('add_time','between time',[$datebefor,$dateafter])
->field("FROM_UNIXTIME(add_time,'%m-%e') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m%e')")
->field("FROM_UNIXTIME(add_time,'%m-%d') as day,count(*) as count,sum(pay_price) as price")
->group("FROM_UNIXTIME(add_time, '%Y%m%d')")
->order('add_time asc')
->select()->toArray();
if(empty($order_list)) return Json::fail('无数据');
@ -567,7 +567,7 @@ class Index extends AuthController
$data = [];
$data['ordernum'] = StoreOrderModel::statusByWhere(1)->count();//待发货
$replenishment_num = SystemConfig::getValue('store_stock') > 0 ? SystemConfig::getValue('store_stock') : 2;//库存预警界限
$data['inventory'] = ProductModel::where('stock','<=',$replenishment_num)->where('is_del',0)->count();//库存
$data['inventory'] = ProductModel::where('stock','<=',$replenishment_num)->where('is_show',1)->where('is_del',0)->count();//库存
$data['commentnum'] = StoreProductReplyModel::where('is_reply',0)->count();//评论
$data['reflectnum'] = UserExtractModel::where('status',0)->count();;//提现
$data['msgcount'] = intval($data['ordernum'])+intval($data['inventory'])+intval($data['commentnum'])+intval($data['reflectnum']);

View File

@ -7,7 +7,7 @@ use app\admin\model\order\StoreOrder;
use app\admin\model\user\User;
use app\admin\model\wechat\WechatUser as UserModel;
use app\admin\library\FormBuilder;
use app\wap\model\user\UserBill;
use app\core\model\user\UserBill;
use service\UtilService as Util;
/**
@ -75,7 +75,7 @@ class AgentManage extends AuthController
->order('u.add_time DESC')
->select()
->toArray();
foreach ($list as $key=>$value) $list[$key]['orderCount'] = StoreOrder::getOrderCount($value['uid']);
foreach ($list as $key=>$value) $list[$key]['orderCount'] = StoreOrder::getOrderCount($value['uid'])?:0;
$this->assign('list',$list);
return $this->fetch();
}

View File

@ -159,7 +159,7 @@ class Article extends AuthController
if($res)
return Json::successful('修改图文成功!',$id);
else
return Json::fail('修改图文失败!',$id);
return Json::fail('修改图文失败,您并没有修改什么!',$id);
}else{
$data['add_time'] = time();
$data['admin_id'] = $this->adminId;

View File

@ -0,0 +1,186 @@
<?php
namespace app\admin\controller\article;
use app\admin\controller\AuthController;
use service\UtilService as Util;
use service\JsonService as Json;
use service\UploadService as Upload;
use think\Request;
use app\admin\model\article\ArticleCategory as ArticleCategoryModel;
use app\admin\model\article\Article as ArticleModel;
use app\admin\model\system\SystemAttachment;
/**
* 图文管理
* Class WechatNews
* @package app\admin\controller\wechat
*/
class WechatNews extends AuthController
{
/**
* 显示后台管理员添加的图文
* @return mixed
*/
public function index($cid = 0)
{
$where = Util::getMore([
['title','']
],$this->request);
if($cid)
$where['cid'] = $cid;
else
$where['cid'] = '';
$this->assign('where',$where);
$where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
$this->assign('cid',$cid);
$this->assign(ArticleModel::getAll($where));
return $this->fetch();
}
/**
* 展示页面 添加和删除
* @return mixed
*/
public function create(){
$id = input('id');
$cid = input('cid');
$news = array();
$news['id'] = '';
$news['image_input'] = '';
$news['title'] = '';
$news['author'] = '';
$news['content'] = '';
$news['synopsis'] = '';
$news['url'] = '';
$news['cid'] = array();
if($id){
$news = \app\admin\model\wechat\WechatNews::where('n.id',$id)->alias('n')->field('n.*,c.content')->join('__WECHAT_NEWS_CONTENT__ c','c.nid=n.id')->find();
if(!$news) return $this->failedNotice('数据不存在!');
$news['cid'] = explode(',',$news['cid']);
// dump($news);
}
$all = array();
$select = 0;
if(!$cid)
$cid = '';
else {
if($id){
$all = ArticleCategoryModel::where('id',$cid)->where('hidden','neq',0)->column('id,title');
$select = 1;
}else{
$all = ArticleCategoryModel::where('id',$cid)->column('id,title');
$select = 1;
}
}
if(empty($all)){
$all = ArticleCategoryModel::getField('id,title');//新闻分类
$select = 0;
}
$this->assign('all',$all);
$this->assign('news',$news);
$this->assign('cid',$cid);
$this->assign('select',$select);
return $this->fetch();
}
/**
* 上传图文图片
* @return \think\response\Json
*/
public function upload_image(){
$res = Upload::Image($_POST['file'],'wechat/image/'.date('Ymd'));
//产品图片上传记录
$fileInfo = $res->fileInfo->getinfo();
SystemAttachment::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,'',5);
if(!$res->status) return Json::fail($res->error);
return Json::successful('上传成功!',['url'=>$res->filePath]);
}
/**
* 添加和修改图文
* @param Request $request
* @return \think\response\Json
*/
public function add_new(Request $request){
$post = $request->post();
$data = Util::postMore([
['id',0],
['cid',[]],
'title',
'author',
'image_input',
'content',
'synopsis',
'share_title',
'share_synopsis',
['visit',0],
['sort',0],
'url',
['status',1],],$request);
$data['cid'] = implode(',',$data['cid']);
$content = $data['content'];
unset($data['content']);
if($data['id']){
$id = $data['id'];
unset($data['id']);
ArticleModel::beginTrans();
$res1 = ArticleModel::edit($data,$id,'id');
$res2 = ArticleModel::setContent($id,$content);
if($res1 && $res2)
$res = true;
else
$res =false;
// dump($res);
// exit();
ArticleModel::checkTrans($res);
if($res)
return Json::successful('修改图文成功!',$id);
else
return Json::fail('修改图文失败!',$id);
}else{
$data['add_time'] = time();
$data['admin_id'] = $this->adminId;
ArticleModel::beginTrans();
$res1 = ArticleModel::set($data);
$res2 = false;
if($res1)
$res2 = ArticleModel::setContent($res1->id,$content);
if($res1 && $res2)
$res = true;
else
$res =false;
ArticleModel::checkTrans($res);
if($res)
return Json::successful('添加图文成功!',$res1->id);
else
return Json::successful('添加图文失败!',$res1->id);
}
}
/**
* 删除图文
* @param $id
* @return \think\response\Json
*/
public function delete($id)
{
$res = ArticleModel::del($id);
if(!$res)
return Json::fail('删除失败,请稍候再试!');
else
return Json::successful('删除成功!');
}
public function merchantIndex(){
$where = Util::getMore([
['title','']
],$this->request);
$this->assign('where',$where);
$where['cid'] = input('cid');
$where['merchant'] = 1;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
$this->assign(ArticleModel::getAll($where));
return $this->fetch();
}
}

View File

@ -2,7 +2,7 @@
namespace app\admin\controller\finance;
use app\admin\controller\AuthController;
use app\admin\model\user\UserRecharge as UserRechargeModel;
use app\wap\model\user\UserBill;
use app\core\model\user\UserBill;
use service\UtilService as Util;
use service\JsonService as Json;
use think\Url;
@ -10,7 +10,7 @@ use service\FormBuilder as Form;
use think\Request;
use service\HookService;
use behavior\wechat\PaymentBehavior;
use service\WechatTemplateService;
use app\core\util\WechatTemplateService;
use app\wap\model\user\WechatUser as WechatUserWap;
/**
* 微信充值记录
@ -69,6 +69,8 @@ class UserRecharge extends AuthController
if($bj < 0) return Json::fail('退款金额大于支付金额,请修改退款金额');
$refund_data['pay_price'] = $UserRecharge['price'];
$refund_data['refund_price'] = $refund_price;
// $refund_data['refund_account']='REFUND_SOURCE_RECHARGE_FUNDS';
try{
HookService::listen('user_recharge_refund',$UserRecharge['order_id'],$refund_data,true,PaymentBehavior::class);
}catch(\Exception $e){

File diff suppressed because one or more lines are too long

View File

@ -47,13 +47,13 @@ class SystemGroupData extends AuthController
$f = array();
foreach ($Fields["fields"] as $key => $value) {
$info = [];
if(!empty($value["param"])){
if(isset($value["param"])){
$value["param"] = str_replace("\r\n","\n",$value["param"]);//防止不兼容
$params = explode("\n",$value["param"]);
if(is_array($params) && !empty($params)){
foreach ($params as $index => $v) {
$vl = explode('=>',$v);
if(!empty($vl[0]) && !empty($vl[1])){
if(isset($vl[0]) && isset($vl[1])){
$info[$index]["value"] = $vl[0];
$info[$index]["label"] = $vl[1];
}
@ -150,13 +150,13 @@ class SystemGroupData extends AuthController
$f = array();
foreach ($Fields['fields'] as $key => $value) {
$info = [];
if(!empty($value["param"])){
if(isset($value["param"])){
$value["param"] = str_replace("\r\n","\n",$value["param"]);//防止不兼容
$params = explode("\n",$value["param"]);
if(is_array($params) && !empty($params)){
foreach ($params as $index => $v) {
$vl = explode('=>',$v);
if(!empty($vl[0]) && !empty($vl[1])){
if(isset($vl[0]) && isset($vl[1])){
$info[$index]["value"] = $vl[0];
$info[$index]["label"] = $vl[1];
}
@ -221,7 +221,7 @@ class SystemGroupData extends AuthController
foreach ($params as $key => $param) {
foreach ($Fields['fields'] as $index => $field) {
if($key == $field["title"]){
if($param == "" || count($param) == 0)
if(!$param)
return Json::fail($field["name"]."不能为空!");
else{
$value[$key]["type"] = $field["type"];

View File

@ -9,6 +9,7 @@ use app\admin\model\store\StoreProductAttrResult;
use app\admin\model\store\StoreProductRelation;
use app\admin\model\system\SystemConfig;
use service\JsonService;
use think\Db;
use traits\CurdControllerTrait;
use service\UtilService as Util;
use service\JsonService as Json;
@ -72,6 +73,7 @@ class StoreProduct extends AuthController
['store_name',''],
['cate_id',''],
['excel',0],
['order',''],
['type',$this->request->param('type')]
]);
return JsonService::successlayui(ProductModel::ProductList($where));
@ -138,27 +140,22 @@ class StoreProduct extends AuthController
$menus[] = ['value'=>$menu['id'],'label'=>$menu['html'].$menu['cate_name'],'disabled'=>$menu['pid']== 0];//,'disabled'=>$menu['pid']== 0];
}
return $menus;
})->filterable(1)->multiple(1)->required(),
Form::input('store_name','产品名称')->col(Form::col(24))->validateFn(function($validate){
$validate->min(5)->max(32);
})->required(),
})->filterable(1)->multiple(1),
Form::input('store_name','产品名称')->col(Form::col(24)),
Form::input('store_info','产品简介')->type('textarea'),
Form::input('keyword','产品关键字')->placeholder('多个用英文状态下的逗号隔开'),
Form::input('unit_name','产品单位','件')->required(),
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')))->maxLength(5)->icon('images')->width('100%')->height('500px')->spin(0)
->required()->validateFn(function($validate){
$validate->min(1)->max(5);
}),
Form::number('price','产品售价')->min(0)->col(8)->required(),
Form::input('unit_name','产品单位','件'),
Form::frameImageOne('image','产品主图片(305*305px)',Url::build('admin/widget.images/index',array('fodder'=>'image')))->icon('image')->width('100%')->height('500px'),
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),
Form::number('ot_price','产品市场价')->min(0)->col(8),
Form::number('give_integral','赠送积分')->min(0)->precision(0)->col(8),
Form::number('postage','邮费')->min(0)->col(Form::col(8))->required(),
Form::number('postage','邮费')->min(0)->col(Form::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('stock','库存')->min(0)->precision(0)->col(8)->required(),
Form::number('stock','库存')->min(0)->precision(0)->col(8),
Form::number('cost','产品成本价')->min(0)->col(8),
Form::number('sort','排序',0)->col(8)->required(),
Form::number('sort','排序')->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_benefit','促销单品',0)->options([['label'=>'是','value'=>1],['label'=>'否','value'=>0]])->col(8),
@ -204,13 +201,13 @@ class StoreProduct extends AuthController
['unit_name','件'],
['image',[]],
['slider_image',[]],
'postage',
'ot_price',
'price',
'sort',
'stock',
['postage',0],
['ot_price',0],
['price',0],
['sort',0],
['stock',100],
'sales',
'ficti',
['ficti',100],
['give_integral',0],
['is_show',0],
['cost',0],
@ -222,24 +219,22 @@ class StoreProduct extends AuthController
['is_postage',0],
],$request);
if(count($data['cate_id']) < 1) return Json::fail('请选择产品分类');
$cate_id=$data['cate_id'];
$data['cate_id'] = implode(',',$data['cate_id']);
if(!$data['store_name']) return Json::fail('请输入产品名称');
// if(!$data['store_info']) return Json::fail('请输入产品简介');
// if(!$data['keyword']) return Json::fail('请输入产品关键字');
if(count($data['image'])<1) return Json::fail('请上传产品图片');
if(count($data['slider_image'])<1) return Json::fail('请上传产品轮播图');
if($data['price'] == '' || $data['price'] < 0) return Json::fail('请输入产品售价');
if($data['ot_price'] == '' || $data['ot_price'] < 0) return Json::fail('请输入产品市场价');
if($data['postage'] == '' || $data['postage'] < 0) return Json::fail('请输入邮费');
if($data['stock'] == '' || $data['stock'] < 0) return Json::fail('请输入库存');
if($data['cost'] == '' || $data['ot_price'] < 0) return Json::fail('请输入产品成本价');
if($data['sales'] == '' || $data['sales'] < 0) return Json::fail('请输入销量');
if($data['give_integral'] < 0) return Json::fail('请输入赠送积分');
$data['image'] = $data['image'][0];
$data['slider_image'] = json_encode($data['slider_image']);
$data['add_time'] = time();
$data['description'] = '';
ProductModel::set($data);
$res=ProductModel::set($data);
foreach ($cate_id as $cid){
Db::name('store_product_cate')->insert(['product_id'=>$res['id'],'cate_id'=>$cid,'add_time'=>time()]);
}
return Json::successful('添加产品成功!');
}
@ -281,7 +276,7 @@ class StoreProduct extends AuthController
Form::input('keyword','产品关键字',$product->getData('keyword'))->placeholder('多个用英文状态下的逗号隔开'),
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('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')->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')->width('100%')->height('500px'),
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('give_integral','赠送积分',$product->getData('give_integral'))->min(0)->precision(0)->col(8),
@ -322,13 +317,12 @@ class StoreProduct extends AuthController
['unit_name','件'],
['image',[]],
['slider_image',[]],
'postage',
'ot_price',
'price',
'sort',
'stock',
// 'sales',
'ficti',
['postage',0],
['ot_price',0],
['price',0],
['sort',0],
['stock',0],
['ficti',100],
['give_integral',0],
['is_show',0],
['cost',0],
@ -340,23 +334,22 @@ class StoreProduct extends AuthController
['is_postage',0],
],$request);
if(count($data['cate_id']) < 1) return Json::fail('请选择产品分类');
$cate_id=$data['cate_id'];
$data['cate_id'] = implode(',',$data['cate_id']);
if(!$data['store_name']) return Json::fail('请输入产品名称');
// if(!$data['store_info']) return Json::fail('请输入产品简介');
// if(!$data['keyword']) return Json::fail('请输入产品关键字');
if(count($data['image'])<1) return Json::fail('请上传产品图片');
if(count($data['slider_image'])<1) return Json::fail('请上传产品轮播图');
if(count($data['slider_image'])>5) return Json::fail('轮播图最多5张图');
if($data['price'] == '' || $data['price'] < 0) return Json::fail('请输入产品售价');
if($data['ot_price'] == '' || $data['ot_price'] < 0) return Json::fail('请输入产品市场价');
if($data['postage'] == '' || $data['postage'] < 0) return Json::fail('请输入邮费');
if($data['cost'] == '' || $data['cost'] < 0) return Json::fail('请输入产品成本价');
if($data['stock'] == '' || $data['stock'] < 0) return Json::fail('请输入库存');
// if($data['sales'] == '' || $data['sales'] < 0) return Json::fail('请输入销量');
if($data['give_integral'] < 0) return Json::fail('请输入赠送积分');
$data['image'] = $data['image'][0];
$data['slider_image'] = json_encode($data['slider_image']);
ProductModel::edit($data,$id);
Db::name('store_product_cate')->where('product_id',$id)->delete();
foreach ($cate_id as $cid){
Db::name('store_product_cate')->insert(['product_id'=>$id,'cate_id'=>$cid,'add_time'=>time()]);
}
return Json::successful('修改成功!');
}
@ -365,7 +358,7 @@ class StoreProduct extends AuthController
if(!$id) return $this->failed('数据不存在!');
$result = StoreProductAttrResult::getResult($id);
$image = ProductModel::where('id',$id)->value('image');
$this->assign(compact('id','result','product','image'));
$this->assign(compact('id','result','image'));
return $this->fetch();
}
/**
@ -443,10 +436,15 @@ class StoreProduct extends AuthController
*/
public function delete($id)
{
if(!$id) return $this->failed('数据不存在');
if(!ProductModel::be(['id'=>$id])) return $this->failed('产品数据不存在');
if(ProductModel::be(['id'=>$id,'is_del'=>1])){
return Json::fail(ProductModel::getErrorInfo('暂不支持回收站删除产品!'));
$data['is_del'] = 0;
if(!ProductModel::edit($data,$id))
return Json::fail(ProductModel::getErrorInfo('恢复失败,请稍候再试!'));
else
return Json::successful('成功恢复产品!');
}else{
$data['is_del'] = 1;
if(!ProductModel::edit($data,$id))

View File

@ -3,6 +3,8 @@
namespace app\admin\controller\store;
use app\admin\controller\AuthController;
use service\JsonService;
use service\UtilService;
use traits\CurdControllerTrait;
use service\UtilService as Util;
use service\JsonService as Json;
@ -38,10 +40,34 @@ class StoreProductReply extends AuthController
else
$where['product_id'] = 0;
$this->assign('where',$where);
$this->assign('is_layui',true);
$this->assign(ProductReplyModel::systemPage($where));
return $this->fetch();
}
public function get_product_imaes_list()
{
$where=UtilService::getMore([
['page',1],
['limit',10],
['title',''],
['is_reply',''],
]);
return JsonService::successful(ProductReplyModel::getProductImaesList($where));
}
public function get_product_reply_list()
{
$where=UtilService::getMore([
['limit',10],
['title',''],
['is_reply',''],
['message_page',1],
['producr_id',0],
]);
return JsonService::successful(ProductReplyModel::getProductReplyList($where));
}
/**
* @param $id
* @return \think\response\Json|void

View File

@ -21,9 +21,6 @@ class SystemAttachment extends AuthController
public function upload()
{
$res = Upload::image('upfile','editor/'.date('Ymd'));
if($res->status==false && $res->error){
exit(json_encode(['state'=>$res->error]));
}
//产品图片上传记录
$fileInfo = $res->fileInfo->getinfo();
$thumbPath = Upload::thumb($res->dir);

View File

@ -1,7 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: liying
* User: sugar1569
* Date: 2018/5/24
* Time: 10:58
*/
@ -10,115 +10,133 @@ namespace app\admin\controller\system;
use app\admin\controller\AuthController;
use app\admin\model\user\User;
use app\admin\model\wechat\WechatUser;
use service\JsonService as Json;
use think\db;
use think\Config;
/**
* 清除默认数据理控制器
* Class SystemCleardata
* Class SystemclearData
* @package app\admin\controller\system
*
*/
class SystemCleardata extends AuthController
class SystemclearData extends AuthController
{
public function index(){
public function index(){
return $this->fetch();
}
//清除用户数据
public function UserRelevant(){
SystemCleardata::ClearData('user_recharge',1);
SystemCleardata::ClearData('user_address',1);
SystemCleardata::ClearData('user_bill',1);
SystemCleardata::ClearData('user_enter',1);
SystemCleardata::ClearData('user_extract',1);
SystemCleardata::ClearData('user_notice',1);
SystemCleardata::ClearData('user_notice_see',1);
SystemCleardata::ClearData('wechat_qrcode',1);
SystemCleardata::ClearData('wechat_message',1);
SystemCleardata::ClearData('store_coupon_user',1);
SystemCleardata::ClearData('store_coupon_issue_user',1);
SystemCleardata::ClearData('store_bargain_user',1);
SystemCleardata::ClearData('store_bargain_user_help',1);
SystemCleardata::ClearData('store_product_reply',1);
public function userRelevantData(){
self::clearData('user_recharge',1);
self::clearData('user_address',1);
self::clearData('user_bill',1);
self::clearData('user_enter',1);
self::clearData('user_extract',1);
self::clearData('user_notice',1);
self::clearData('user_notice_see',1);
self::clearData('wechat_qrcode',1);
self::clearData('wechat_message',1);
self::clearData('store_visit',1);
self::clearData('store_coupon_user',1);
self::clearData('store_coupon_issue_user',1);
self::clearData('store_bargain_user',1);
self::clearData('store_bargain_user_help',1);
self::clearData('store_product_reply',1);
self::clearData('routine_qrcode',1);
self::clearData('routine_form_id',1);
self::clearData('user_sign',1);
self::clearData('user_task_finish',1);
self::clearData('user_level',1);
self::clearData('token',1);
self::clearData('user_group',1);
$this->delDirAndFile('./public/uploads/store/comment');
SystemCleardata::ClearData('store_product_relation',1);
self::clearData('store_product_relation',1);
return Json::successful('清除数据成功!');
}
//清除商城数据
public function storedata(){
SystemCleardata::ClearData('store_coupon',1);
SystemCleardata::ClearData('store_coupon_issue',1);
SystemCleardata::ClearData('store_bargain',1);
SystemCleardata::ClearData('store_combination',1);
SystemCleardata::ClearData('store_product_attr',1);
SystemCleardata::ClearData('store_product_attr_result',1);
SystemCleardata::ClearData('store_product_attr_value',1);
SystemCleardata::ClearData('store_seckill',1);
SystemCleardata::ClearData('store_product',1);
$this->delDirAndFile('./public/uploads/store/product');
public function storeData(){
self::clearData('store_coupon',1);
self::clearData('store_coupon_issue',1);
self::clearData('store_bargain',1);
self::clearData('store_combination',1);
self::clearData('store_combination_attr',1);
self::clearData('store_combination_attr_result',1);
self::clearData('store_combination_attr_value',1);
self::clearData('store_product_attr',1);
self::clearData('store_product_attr_result',1);
self::clearData('store_product_attr_value',1);
self::clearData('store_seckill',1);
self::clearData('store_seckill_attr',1);
self::clearData('store_seckill_attr_result',1);
self::clearData('store_seckill_attr_value',1);
self::clearData('store_product',1);
self::clearData('store_visit',1);
return Json::successful('清除数据成功!');
}
//清除产品分类
public function categorydata(){
SystemCleardata::ClearData('store_category',1);
$this->delDirAndFile('./public/uploads/store/product');
public function categoryData(){
self::clearData('store_category',1);
return Json::successful('清除数据成功!');
}
//清除订单数据
public function orderdata(){
SystemCleardata::ClearData('store_order',1);
SystemCleardata::ClearData('store_order_cart_info',1);
SystemCleardata::ClearData('store_order_copy',1);
SystemCleardata::ClearData('store_order_status',1);
SystemCleardata::ClearData('store_pink',1);
SystemCleardata::ClearData('store_cart',1);
public function orderData(){
self::clearData('store_order',1);
self::clearData('store_order_cart_info',1);
self::clearData('store_order_status',1);
self::clearData('store_pink',1);
self::clearData('store_cart',1);
self::clearData('store_order_status',1);
return Json::successful('清除数据成功!');
}
//清除客服数据
public function kefudata(){
SystemCleardata::ClearData('store_service',1);
public function kefuData(){
self::clearData('store_service',1);
$this->delDirAndFile('./public/uploads/store/service');
SystemCleardata::ClearData('store_service_log',1);
self::clearData('store_service_log',1);
return Json::successful('清除数据成功!');
}
//清除微信管理数据
public function wechatdata(){
SystemCleardata::ClearData('wechat_media',1);
SystemCleardata::ClearData('wechat_reply',1);
$this->delDirAndFile('./public/uploads/wechat');
public function wechatData(){
self::clearData('wechat_media',1);
self::clearData('wechat_reply',1);
self::clearData('cache',1);
$this->delDirAndFile('./public/uploads/wechat');
return Json::successful('清除数据成功!');
}
//清除所有附件
public function uploaddata(){
$this->delDirAndFile('./public/uploads');
public function uploadData(){
self::clearData('system_attachment',1);
self::clearData('system_attachment_category',1);
$this->delDirAndFile('./public/uploads/');
return Json::successful('清除上传文件成功!');
}
//清除微信用户
public function wechatuserdata(){
SystemCleardata::ClearData('wechat_user',1);
SystemCleardata::ClearData('user',1);
public function wechatuserData(){
self::clearData('wechat_user',1);
self::clearData('user',1);
return Json::successful('清除数据成功!');
}
//清除内容分类
public function articledata(){
SystemCleardata::ClearData('article_category',1);
SystemCleardata::ClearData('article',1);
SystemCleardata::ClearData('article_content',1);
$this->delDirAndFile('./public/uploads/article/');
self::clearData('article_category',1);
self::clearData('article',1);
self::clearData('article_content',1);
return Json::successful('清除数据成功!');
}
//清除系统记录
public function systemdata(){
self::clearData('system_notice_admin',1);
self::clearData('system_log',1);
return Json::successful('清除数据成功!');
}
//清除制定表数据
public function ClearData($table_name,$status){
public function clearData($table_name,$status){
$table_name = Config::get('database')['prefix'].$table_name;
if($status){
@db::query('TRUNCATE TABLE '.$table_name);
@db::execute('TRUNCATE TABLE '.$table_name);
}else{
@db::query('DELETE FROM'.$table_name);
@db::execute('DELETE FROM'.$table_name);
}
}

View File

@ -19,7 +19,7 @@ class SystemDatabackup extends AuthController
public function _initialize()
{
$config = array(
'path' => '.'.PUBILC_PATH.'/backup/data/',
'path' => '.'.PUBILC_PATH.'backup/data/',
//数据库备份路径
'part' => 20971520,
//数据库备份卷大小

View File

@ -42,14 +42,14 @@ class StoreCoupon extends AuthController
public function create()
{
$f = array();
$f[] = Form::input('title','优惠券名称')->required();
$f[] = Form::input('title','优惠券名称');
$f[] = Form::number('coupon_price','优惠券面值',0)->min(0);
$f[] = Form::number('use_min_price','优惠券最低消费')->min(0);
$f[] = Form::number('coupon_time','优惠券有效期限')->min(0);
$f[] = Form::number('sort','排序');
$f[] = Form::radio('status','状态',0)->options([['label'=>'开启','value'=>1],['label'=>'关闭','value'=>0]]);
$form = Form::make_post_form('添加优惠券',$f,Url::build('save'));//->setSuccessScript('<script>formCreate.formSuccess = function(form,$r){$r.closeModal();};</script>');
$form = Form::make_post_form('添加优惠券',$f,Url::build('save'));
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
@ -227,8 +227,8 @@ class StoreCoupon extends AuthController
public function update_issue(Request $request,$id)
{
list($_id,$rangeTime,$count,$status) = UtilService::postMore([
'id',['range_date',['','']],['count',0],['status',0]
list($_id,$rangeTime,$count,$status,$is_permanent) = UtilService::postMore([
'id',['range_date',['','']],['count',0],['status',0],['is_permanent',0]
],$request,true);
if($_id != $id) return JsonService::fail('操作失败,信息不对称');
if(!$count) $count = 0;
@ -241,7 +241,7 @@ class StoreCoupon extends AuthController
if(!$endTime) $endTime = 0;
if(!$startTime && $endTime) return JsonService::fail('请选择正确的开始时间');
if($startTime && !$endTime) return JsonService::fail('请选择正确的结束时间');
if(StoreCouponIssue::setIssue($id,$count,strtotime($startTime),strtotime($endTime),$count,$status))
if(StoreCouponIssue::setIssue($id,$count,strtotime($startTime),strtotime($endTime),$count,$status,$is_permanent))
return JsonService::successful('发布优惠劵成功!');
else
return JsonService::fail('发布优惠劵失败!');

View File

@ -23,6 +23,9 @@ class UserPoint extends AuthController
public function index()
{
$this->assign([
// 'sum_point'=>UserBill::where(['category'=>'integral','type'=>'system_add'])->sum('number'),
// 'count'=>UserBill::where(['category'=>'integral','type'=>'sign'])->group('uid')->count(),
// 'song_point'=>UserBill::where(['category'=>'integral','type'=>'sign'])->group('uid')->sum('number'),
'is_layui'=>true,
'year'=>getMonth('y'),
]);

View File

@ -0,0 +1,335 @@
<?php
namespace app\admin\controller\user;
use app\admin\controller\AuthController;
use app\admin\model\system\SystemUserLevel;
use app\admin\model\system\SystemUserTask;
use service\FormBuilder as Form;
use service\JsonService;
use service\UtilService;
use think\Url;
use traits\CurdControllerTrait;
use app\admin\model\user\UserLevel as UserLevelModel;
/**
* 会员设置
* Class UserLevel
* @package app\admin\controller\user
*/
class UserLevel extends AuthController
{
use CurdControllerTrait;
/*
* 等级展示
* */
public function index()
{
return $this->fetch();
}
/*
* 创建form表单
* */
public function create($id=0)
{
if($id) $vipinfo=SystemUserLevel::get($id);
$field[]= Form::input('name','等级名称',isset($vipinfo) ? $vipinfo->name : '')->col(Form::col(24));
$field[]= Form::radio('is_forever','是否为永久',isset($vipinfo) ? $vipinfo->is_forever : 0)->options([['label'=>'永久','value'=>1],['label'=>'非永久','value'=>0]])->col(24);
$field[]= Form::number('money','等级价格',isset($vipinfo) ? $vipinfo->money : 0)->min(0)->col(24);
$field[]= Form::radio('is_pay','是否需要购买',isset($vipinfo) ? $vipinfo->is_pay : 0)->options([['label'=>'需要','value'=>1],['label'=>'免费','value'=>0]])->col(24);
$field[]= Form::number('valid_date','有效时间(天)',isset($vipinfo) ? $vipinfo->valid_date : 0)->min(0)->col(8);
$field[]= Form::number('grade','等级',isset($vipinfo) ? $vipinfo->grade : 0)->min(0)->col(8);
$field[]= Form::number('discount','享受折扣',isset($vipinfo) ? $vipinfo->discount : 0)->min(0)->col(8);
$field[]= Form::frameImageOne('icon','图标',Url::build('admin/widget.images/index',array('fodder'=>'icon')),isset($vipinfo) ? $vipinfo->icon : '')->icon('image')->width('100%')->height('500px');
$field[]= Form::frameImageOne('image','会员背景',Url::build('admin/widget.images/index',array('fodder'=>'image')),isset($vipinfo) ? $vipinfo->image : '')->icon('image')->width('100%')->height('500px');
$field[]= Form::radio('is_show','是否显示',isset($vipinfo) ? $vipinfo->is_show : 0)->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]])->col(8);
$field[]= Form::textarea('explain','等级说明',isset($vipinfo) ? $vipinfo->explain : '');
$form = Form::make_post_form('添加等级设置',$field,Url::build('save',['id'=>$id]),2);
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
/*
* 会员等级添加或者修改
* @param $id 修改的等级id
* @return json
* */
public function save($id=0)
{
$data=UtilService::postMore([
['name',''],
['is_forever',0],
['money',0],
['is_pay',0],
['valid_date',0],
['grade',0],
['discount',0],
['icon',''],
['image',''],
['is_show',''],
['explain',''],
]);
if(!$data['name']) return JsonService::fail('请输入等级名称');
if(!$data['grade']) return JsonService::fail('请输入等级');
if(!$data['explain']) return JsonService::fail('请输入等级说明');
if($data['is_forever']==0 && !$data['valid_date']) return JsonService::fail('请输入有效时间(天)');
if($data['is_pay'] && !$data['money']) return JsonService::fail('请输入购买金额');
if(!$data['icon']) return JsonService::fail('请上传等级图标');
if(!$data['image']) return JsonService::fail('请上传等级背景图标');
SystemUserLevel::beginTrans();
try{
//修改
if($id){
if(SystemUserLevel::edit($data,$id)){
SystemUserLevel::commitTrans();
return JsonService::successful('修改成功');
}else{
SystemUserLevel::rollbackTrans();
return JsonService::fail('添加失败');
}
}else{
//新增
$data['add_time']=time();
if(SystemUserLevel::set($data)){
SystemUserLevel::commitTrans();
return JsonService::successful('添加成功');
}else{
SystemUserLevel::rollbackTrans();
return JsonService::fail('添加失败');
}
}
}catch (\Exception $e){
SystemUserLevel::rollbackTrans();
return JsonService::fail($e->getMessage());
}
}
/*
* 获取系统设置的vip列表
* @param int page
* @param int limit
* */
public function get_system_vip_list()
{
$where=UtilService::getMore([
['page',0],
['limit',10],
['title',''],
['is_show',''],
]);
return JsonService::successlayui(SystemUserLevel::getSytemList($where));
}
/*
* 删除会员等级
* @param int $id
* */
public function delete($id=0)
{
if(SystemUserLevel::edit(['is_del'=>1],$id))
return JsonService::successful('删除成功');
else
return JsonService::fail('删除失败');
}
/**
* 设置单个产品上架|下架
*
* @return json
*/
public function set_show($is_show='',$id=''){
($is_show=='' || $id=='') && Json::fail('缺少参数');
$res=SystemUserLevel::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_value($field='',$id='',$value=''){
$field=='' || $id=='' || $value=='' && Json::fail('缺少参数');
if(SystemUserLevel::where(['id'=>$id])->update([$field=>$value]))
return JsonService::successful('保存成功');
else
return JsonService::fail('保存失败');
}
/*
* 等级任务列表
* @param int $vip_id 等级id
* @return json
* */
public function tash($level_id=0)
{
$this->assign('level_id',$level_id);
return $this->fetch();
}
/**
* 快速编辑
*
* @return json
*/
public function set_tash_value($field='',$id='',$value=''){
$field=='' || $id=='' || $value=='' && Json::fail('缺少参数');
if(SystemUserTask::where(['id'=>$id])->update([$field=>$value]))
return JsonService::successful('保存成功');
else
return JsonService::fail('保存失败');
}
/**
* 设置单个产品上架|下架
*
* @return json
*/
public function set_tash_show($is_show='',$id=''){
($is_show=='' || $id=='') && Json::fail('缺少参数');
$res=SystemUserTask::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_tash_must($is_must='',$id=''){
($is_must=='' || $id=='') && Json::fail('缺少参数');
$res=SystemUserTask::where(['id'=>$id])->update(['is_must'=>(int)$is_must]);
if($res){
return JsonService::successful('设置成功');
}else{
return JsonService::fail('设置失败');
}
}
/*
* 生成任务表单
* @param int $id 任务id
* @param int $vip_id 会员id
* @return html
* */
public function create_tash($id=0,$level_id=0)
{
if($id) $tash=SystemUserTask::get($id);
$field[]= Form::select('task_type','任务类型',isset($tash) ? $tash->task_type : '')->setOptions(function(){
$list = SystemUserTask::getTaskTypeAll();
$menus=[];
foreach ($list as $menu){
$menus[] = ['value'=>$menu['type'],'label'=>$menu['name'].'----单位['.$menu['unit'].']'];
}
return $menus;
})->filterable(1);
$field[]= Form::number('number','限定数量',isset($tash) ? $tash->number : 0)->min(0)->col(24);
$field[]= Form::number('sort','排序',isset($tash) ? $tash->sort : 0)->min(0)->col(24);
$field[]= Form::radio('is_show','是否显示',isset($tash) ? $tash->is_show : 1)->options([['label'=>'显示','value'=>1],['label'=>'隐藏','value'=>0]])->col(24);
$field[]= Form::radio('is_must','是否务必达成',isset($tash) ? $tash->is_must : 1)->options([['label'=>'务必达成','value'=>1],['label'=>'完成其一','value'=>0]])->col(24);
$field[]= Form::textarea('illustrate','任务说明',isset($tash) ? $tash->illustrate : '');
$form = Form::make_post_form('添加任务',$field,Url::build('save_tash',['id'=>$id,'level_id'=>$level_id]),2);
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
/*
* 保存或者修改任务
* @param int $id 任务id
* @param int $vip_id 会员id
* */
public function save_tash($id=0,$level_id=0)
{
if(!$level_id) return JsonService::fail('缺少参数');
$data=UtilService::postMore([
['task_type',''],
['number',0],
['is_show',0],
['sort',0],
['is_must',0],
['illustrate',''],
]);
if(!$data['task_type']) return JsonService::fail('请选择任务类型');
if($data['number'] < 0) return JsonService::fail('请输入限定数量');
$tash=SystemUserTask::getTaskType($data['task_type']);
if($tash['max_number']!=0 && $data['number'] > $tash['max_number']) return JsonService::fail('您设置的限定数量超出最大限制,最大限制为:'.$tash['max_number']);
$data['name']=SystemUserTask::setTaskName($data['task_type'],$data['number']);
try{
if($id){
SystemUserTask::edit($data,$id);
return JsonService::successful('修改成功');
}else{
$data['level_id']=$level_id;
$data['add_time']=time();
$data['real_name']=$tash['real_name'];
if(SystemUserTask::set($data))
return JsonService::successful('添加成功');
else
return JsonService::fail('添加失败');
}
}catch (\Exception $e){
return JsonService::fail($e->getMessage());
}
}
/*
* 异步获取等级任务列表
* @param int $vip_id 会员id
* @param int $page 分页
* @param int $limit 显示条数
* @return json
* */
public function get_tash_list($level_id=0)
{
list($page,$limit)=UtilService::getMore([
['page',1],
['limit',10],
],$this->request,true);
return JsonService::successlayui(SystemUserTask::getTashList($level_id,(int)$page,(int)$limit));
}
/*
* 删除任务
* @param int 任务id
* */
public function delete_tash($id=0)
{
if(!$id) return JsonService::fail('缺少差参数');
if(SystemUserTask::del($id))
return JsonService::successful('删除成功');
else
return JsonService::fail('删除失败');
}
/*
* 会员等级展示
*
* */
public function user_level_list()
{
$this->assign('level',SystemUserLevel::where('is_del',0)->where('is_show',1)->order('grade asc')->field(['id','name'])->select());
return $this->fetch();
}
public function get_user_vip_list()
{
$where=UtilService::getMore([
['page',1],
['limit',10],
['nickname',''],
['level_id',''],
]);
return JsonService::successlayui(UserLevelModel::getUserVipList($where));
}
}

View File

@ -2,7 +2,7 @@
namespace app\admin\controller\wechat;
use app\admin\controller\AuthController;
use service\WechatService;
use app\core\util\WechatService;
use think\Cache;
use think\Db;
use think\Request;

View File

@ -23,10 +23,23 @@ class Reply extends AuthController
{
if(empty(input('key'))) return $this->failed('请输入参数key');
if(empty(input('title'))) return $this->failed('请输入参数title');
$replay = WechatReply::getDataByKey(input('key'));
$key = input('key');
switch($key){
case 'subscribe':
$title = '编辑关注回复';
break;
case 'default':
$title = '编辑关键字默认回复';
break;
default:
$title = '编辑关键字回复';
break;
}
$replay = WechatReply::getDataByKey($key);
$this->assign('replay_arr',json_encode($replay));
$this->assign('key',input('key'));
$this->assign('title',urldecode(input('title')));
$this->assign('key',$key);
$this->assign('title',$title);
return $this->fetch();
}

View File

@ -14,7 +14,7 @@ use service\UtilService;
use think\Db;
use think\Request;
use think\Url;
use service\WechatService;
use app\core\util\WechatService;
use \app\admin\model\wechat\WechatNewsCategory as WechatNewsCategoryModel;
use app\admin\model\article\Article as ArticleModel;
/**
@ -235,8 +235,8 @@ class WechatNewsCategory extends AuthController
if($v['author'] == '') return JsonService::fail('作者不能为空');
if($v['content'] == '') return JsonService::fail('正文不能为空');
if($v['synopsis'] == '') return JsonService::fail('摘要不能为空');
$v['add_time'] = time();
$v['status'] = 1;
$v['add_time'] = time();
if($v['id']){
$idC = $v['id'];
unset($v['id']);

View File

@ -6,7 +6,7 @@ use app\admin\controller\AuthController;
use service\FormBuilder as Form;
use service\UtilService as Util;
use service\JsonService as Json;
use service\WechatTemplateService;
use app\core\util\WechatTemplateService;
use think\Cache;
use think\Request;
use think\Url;
@ -32,10 +32,15 @@ class WechatTemplate extends AuthController
$this->assign('where',$where);
$this->assign(WechatTemplateModel::SystemPage($where));
$industry = Cache::tag($this->cacheTag)->remember('_wechat_industry',function(){
$cache = WechatTemplateService::getIndustry();
if(!$cache) return [];
Cache::tag($this->cacheTag,['_wechat_industry']);
return $cache->toArray();
try{
$cache = WechatTemplateService::getIndustry();
if(!$cache) return [];
Cache::tag($this->cacheTag,['_wechat_industry']);
return $cache->toArray();
}catch (\Exception $e){
return $e->getMessage();
}
},0)?:[];
!is_array($industry) && $industry = [];
$this->assign('industry',$industry);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -10,7 +10,7 @@ namespace app\admin\model\finance;
use traits\ModelTrait;
use basic\ModelBasic;
use service\ExportService;
use app\wap\model\user\UserBill;
use app\core\model\user\UserBill;
use app\admin\model\user\User;
use service\PHPExcelService;
/*数据统计处理*/

View File

@ -8,19 +8,22 @@
namespace app\admin\model\order;
use app\admin\model\ump\StoreCouponUser;
use app\admin\model\wechat\WechatUser;
use app\admin\model\ump\StorePink;
use app\admin\model\order\StoreOrderCartInfo;
use app\admin\model\store\StoreProduct;
use app\admin\model\routine\RoutineFormId;
use app\admin\model\routine\RoutineTemplate;
use app\core\model\routine\RoutineTemplate;
use service\ProgramTemplateService;
use service\PHPExcelService;
use traits\ModelTrait;
use basic\ModelBasic;
use service\WechatTemplateService;
use service\RoutineTemplateService;
use app\core\util\WechatTemplateService;
use think\Url;
use think\Db;
use app\admin\model\user\User;
use app\admin\model\user\UserBill;
/**
* 订单管理Model
* Class StoreOrder
@ -38,9 +41,10 @@ class StoreOrder extends ModelBasic
$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();
$data['general']=self::where(['pink_id'=>0,'combination_id'=>0,'seckill_id'=>0,'bargain_id'=>0])->count();
$data['pink']=self::where('pink_id|combination_id','>',0)->count();
$data['seckill']=self::where('seckill_id','>',0)->count();
$data['bargain']=self::where('bargain_id','>',0)->count();
return $data;
}
@ -84,14 +88,15 @@ class StoreOrder extends ModelBasic
$item['color'] = '#457856';
break;
}
}elseif ($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9';
}elseif ($item['bargain_id']){
$item['pink_name'] = '[砍价订单]';
$item['color'] = '#12c5e9';
}else{
if($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9';
}else{
$item['pink_name'] = '[普通订单]';
$item['color'] = '#895612';
}
$item['pink_name'] = '[普通订单]';
$item['color'] = '#895612';
}
if($item['paid']==1){
switch ($item['pay_type']){
@ -276,6 +281,9 @@ HTML;
if($item['seckill_id']){
$item['pink_name'] = '[秒杀订单]';
$item['color'] = '#32c5e9';
}elseif ($item['bargain_id']){
$item['pink_name'] = '[砍价订单]';
$item['color'] = '#12c5e9';
}else{
$item['pink_name'] = '[普通订单]';
$item['color'] = '#895612';
@ -336,7 +344,7 @@ HTML;
}
/**
* 退款发送模板消息
* TODO 公众号退款发送模板消息
* @param $oid
* $oid 订单id key
*/
@ -352,6 +360,26 @@ HTML;
],Url::build('wap/My/order',['uni'=>$order['order_id']],true,true));
}
/**
* TODO 小程序余额退款模板消息
* @param $oid
* @return bool|mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function refundRoutineTemplate($oid){
$order = self::where('id',$oid)->find();
$data['keyword1'] = $order['order_id'];
$data['keyword2'] = date('Y-m-d H:i:s',time());
$data['keyword3'] = $order['pay_price'];
if($order['pay_type'] == 'yue') $data['keyword4'] = '余额支付';
else if($order['pay_type'] == 'weixin') $data['keyword4'] = '微信支付';
else if($order['pay_type'] == 'offline') $data['keyword4'] = '线下支付';
$data['keyword5'] = '已成功退款';
return RoutineTemplate::sendOut('ORDER_REFUND_SUCCESS',$order['uid'],$data);
}
/**
* 处理where条件
* @param $where
@ -364,7 +392,7 @@ HTML;
if($where['is_del'] != '' && $where['is_del'] != -1) $model = $model->where($aler.'is_del',$where['is_del']);
if(isset($where['combination_id'])){
if($where['combination_id'] =='普通订单'){
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0);
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0)->where($aler.'bargain_id',0);
}
if($where['combination_id'] =='拼团订单'){
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
@ -372,18 +400,25 @@ HTML;
if($where['combination_id'] =='秒杀订单'){
$model = $model->where($aler.'seckill_id',">",0);
}
if($where['combination_id'] =='砍价订单'){
$model = $model->where($aler.'bargain_id',">",0);
}
}
if(isset($where['type'])){
switch ($where['type']){
case 1:
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0);
$model = $model->where($aler.'combination_id',0)->where($aler.'seckill_id',0)->where($aler.'bargain_id',0);
break;
case 2:
$model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
// $model = $model->where($aler.'combination_id',">",0)->where($aler.'pink_id',">",0);
$model = $model->where($aler.'combination_id',">",0);
break;
case 3:
$model = $model->where($aler.'seckill_id',">",0);
break;
case 4:
$model = $model->where($aler.'bargain_id',">",0);
break;
}
}
@ -482,23 +517,32 @@ HTML;
$price['back_integral'] = 0;//退积分总数
$price['deduction_price'] = 0;//抵扣金额
$price['total_num'] = 0; //商品总数
$model = self::getOrderWhere($where,$model);
$list = $model->where('is_del',0)->select()->toArray();
$sumNumber =self::getOrderWhere($where,$model)->where('is_del',0)->field([
'sum(total_num) as sum_total_num',
'sum(pay_price) as sum_pay_price',
'sum(refund_price) as sum_refund_price',
'sum(use_integral) as sum_use_integral',
'sum(back_integral) as sum_back_integral',
'sum(deduction_price) as sum_deduction_price'
])->find();
if($sumNumber) {
$price['total_num'] = $sumNumber['sum_total_num'];
$price['pay_price'] = $sumNumber['sum_pay_price'];
$price['refund_price'] = $sumNumber['sum_refund_price'];
$price['use_integral'] = $sumNumber['sum_use_integral'];
$price['back_integral'] = $sumNumber['sum_back_integral'];
$price['deduction_price'] = $sumNumber['sum_deduction_price'];
}
$list=self::getOrderWhere($where,$model)->where('is_del',0)->group('pay_type')->field(['sum(pay_price) as sum_pay_price','pay_type'])->select();
foreach ($list as $v){
$price['total_num'] = bcadd($price['total_num'],$v['total_num'],0);
$price['pay_price'] = bcadd($price['pay_price'],$v['pay_price'],2);
$price['refund_price'] = bcadd($price['refund_price'],$v['refund_price'],2);
$price['use_integral'] = bcadd($price['use_integral'],$v['use_integral'],2);
$price['back_integral'] = bcadd($price['back_integral'],$v['back_integral'],2);
$price['deduction_price'] = bcadd($price['deduction_price'],$v['deduction_price'],2);
if ($v['pay_type'] == 'weixin'){
$price['pay_price_wx'] = bcadd($price['pay_price_wx'],$v['pay_price'],2);
$price['pay_price_wx'] = $v['sum_pay_price'];
}elseif($v['pay_type'] == 'yue'){
$price['pay_price_yue'] = bcadd($price['pay_price_yue'],$v['pay_price'],2);
$price['pay_price_yue'] = $v['sum_pay_price'];
}elseif($v['pay_type'] == 'offline'){
$price['pay_price_offline'] = bcadd($price['pay_price_offline'],$v['pay_price'],2);
$price['pay_price_offline'] = $v['sum_pay_price'];
}else{
$price['pay_price_other'] = bcadd($price['pay_price_other'],$v['pay_price'],2);
$price['pay_price_other'] = $v['sum_pay_price'];
}
}
return $price;
@ -670,7 +714,7 @@ HTML;
switch ($where['type']){
case 1:
//普通商品
$model=$model->where('combination_id',0)->where('seckill_id',0);
$model=$model->where('combination_id',0)->where('seckill_id',0)->where('bargain_id',0);
break;
case 2:
//拼团商品
@ -759,26 +803,6 @@ HTML;
public static function getOrderBadge($where){
return [
[
'name'=>'拼团订单数量',
'field'=>'个',
'count'=>self::setEchatWhere($where,2)->count(),
'content'=>'拼团总订单数量',
'background_color'=>'layui-bg-cyan',
'sum'=>self::setEchatWhere($where,2,true)->count(),
'class'=>'fa fa-line-chart',
'col'=>2
],
[
'name'=>'砍价订单数量',
'field'=>'个',
'count'=>self::setEchatWhere($where,4)->count(),
'content'=>'砍价总订单数量',
'background_color'=>'layui-bg-cyan',
'sum'=>self::setEchatWhere($where,4,true)->count(),
'class'=>'fa fa-line-chart',
'col'=>2
],
[
'name'=>'秒杀订单数量',
'field'=>'个',
@ -888,8 +912,8 @@ HTML;
*/
public static function orderPostageAfter($oid,$postageData = [])
{
$order = self::where('id',$oid)->find();
$openid = WechatUser::uidToOpenid($order['uid']);
$url = Url::build('wap/My/order',['uni'=>$order['order_id']],true,true);
$group = [
'first'=>'亲,您的订单已发货,请注意查收',
@ -897,23 +921,35 @@ HTML;
];
if($postageData['delivery_type'] == 'send'){//送货
$goodsName = StoreOrderCartInfo::getProductNameList($order['id']);
$group = array_merge($group,[
'keyword1'=>$goodsName,
'keyword2'=>$order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i',$order['pay_time']),
'keyword3'=>$order['user_address'],
'keyword4'=>$postageData['delivery_name'],
'keyword5'=>$postageData['delivery_id']
]);
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);
if($order['is_channel']){
//小程序送货模版消息
RoutineTemplate::sendOrderPostage($order);
}else{//公众号
$openid = WechatUser::where('uid',$order['uid'])->value('openid');
$group = array_merge($group,[
'keyword1'=>$goodsName,
'keyword2'=>$order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i',$order['pay_time']),
'keyword3'=>$order['user_address'],
'keyword4'=>$postageData['delivery_name'],
'keyword5'=>$postageData['delivery_id']
]);
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_DELIVER_SUCCESS,$group,$url);
}
}else if($postageData['delivery_type'] == 'express') {//发货
if ($order['is_channel']) {
//小程序发货模版消息
RoutineTemplate::sendOrderPostage($order,1);
} else {//公众号
$openid = WechatUser::where('uid',$order['uid'])->value('openid');
$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);
}
}
}
/**
* 小程序 订单发货提醒
@ -927,38 +963,76 @@ HTML;
$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);
}
RoutineTemplate::sendOrderPostage($order);
}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);
}
RoutineTemplate::sendOrderPostage($order,1);
}
}
/** 收货后发送模版消息
* @param $order
*/
public static function orderTakeAfter($order)
{
if($order['is_channel']){//小程序
RoutineTemplate::sendOut('OREDER_TAKEVER',$order['uid'],[
'keyword1'=>$order['order_id'],
'keyword2'=>self::getDb('store_cart')->alias('a')->join('__STORE_PRODUCT__ P','a.product_id=p.id')->where('a.id','in',$order['cart_id'])->value('p.title'),
'keyword3'=>$order['pay_price'],
'keyword4'=>date('Y-m-d H:i:s',time()),
]);
}else{
$openid = WechatUser::where('uid',$order['uid'])->value('openid');
$title='';
$cartInfo = self::getDb('StoreOrderCartInfo')->where('oid', $order['id'])->column('product_id') ?: [];
foreach ($cartInfo as $k => $productId) {
$store_name=self::getDb('store_product')->where('id',$productId)->value('store_name');
$title.=$store_name.',';
}
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_TAKE_SUCCESS,[
'first'=>'亲,您的订单已收货',
'keyword1'=>$order['order_id'],
'keyword2'=>'已收货',
'keyword3'=>date('Y-m-d H:i:s',time()),
'keyword4'=>$title,
'remark'=>'感谢您的光临!'
]);
}
}
/*
* 不退款发送模板消息
* @param int $id 订单id
* @param array $data 退款详情
* */
public static function refundNoPrieTemplate($id,$data)
{
$order=self::get($id);
if($order) return false;
//小程序模板消息
$cartInfo = self::getDb('StoreOrderCartInfo')->where('oid', $order['id'])->column('product_id') ?: [];
$title='';
foreach ($cartInfo as $k => $productId) {
$store_name=self::getDb('store_product')->where('id',$productId)->value('store_name');
$title.=$store_name.',';
}
if($order->is_channel){
RoutineTemplate::sendOut('ORDER_REFUND_FILE',$order->uid,[
'keyword1'=>$order->order_id,
'keyword2'=>$title,
'keyword3'=>$order->pay_price,
'keyword4'=>$data,
]);
}else{
WechatTemplateService::sendTemplate(WechatUser::where(['uid'=>$order->uid])->value('openid'),WechatTemplateService::ORDER_REFUND_STATUS,[
'first'=>'很抱歉您的订单退款失败,失败原因:'.$data,
'keyword1'=>$order->order_id,
'keyword2'=>$order->pay_price,
'keyword3'=>date('Y-m-d H:i:s',time()),
'remark'=>'给您带来的不便,请谅解!'
]);
}
}
/**
* 获取订单总数
@ -986,4 +1060,46 @@ HTML;
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();
}
/** 订单收货处理积分
* @param $order
* @return bool
*/
public static function gainUserIntegral($order)
{
if($order['gain_integral'] > 0){
$userInfo = User::get($order['uid']);
ModelBasic::beginTrans();
$res1 = false != User::where('uid',$userInfo['uid'])->update(['integral'=>bcadd($userInfo['integral'],$order['gain_integral'],2)]);
$res2 = false != UserBill::income('购买商品赠送积分',$order['uid'],'integral','gain',$order['gain_integral'],$order['id'],bcadd($userInfo['integral'],$order['gain_integral'],2),'购买商品赠送'.floatval($order['gain_integral']).'积分');
$res = $res1 && $res2;
ModelBasic::checkTrans($res);
return $res;
}
return true;
}
public static function integralBack($id){
$order = self::get($id)->toArray();
if(!(float)bcsub($order['use_integral'],0,2) && !$order['back_integral']) return true;
if($order['back_integral'] && !(int)$order['use_integral']) return true;
ModelBasic::beginTrans();
$data['back_integral'] = bcsub($order['use_integral'],$order['use_integral'],0);
if(!$data['back_integral']) return true;
$data['use_integral'] = 0;
$data['deduction_price'] = 0.00;
$data['pay_price'] = 0.00;
$data['coupon_id'] = 0.00;
$data['coupon_price'] = 0.00;
$res4 = true;
$integral = User::where('uid',$order['uid'])->value('integral');
$res1 = User::bcInc($order['uid'],'integral',$data['back_integral'],'uid');
$res2 = UserBill::income('商品退积分',$order['uid'],'integral','pay_product_integral_back',$data['back_integral'],$order['id'],bcadd($integral,$data['back_integral'],2),'订单退积分'.floatval($data['back_integral']).'积分到用户积分');
$res3 = self::edit($data,$id);
if($order['coupon_id']) $res4 = StoreCouponUser::recoverCoupon($order['coupon_id']);
StoreOrderStatus::setStatus($id,'integral_back','商品退积分:'.$data['back_integral']);
$res = $res1 && $res2 && $res3 && $res4;
ModelBasic::checkTrans($res);
return $res;
}
}

View File

@ -10,7 +10,7 @@ namespace app\admin\model\record;
use traits\ModelTrait;
use basic\ModelBasic;
use service\ExportService;
use app\wap\model\user\UserBill;
use app\core\model\user\UserBill;
use app\admin\model\user\User;
use service\PHPExcelService;
class StoreStatistics extends ModelBasic
@ -97,22 +97,28 @@ class StoreStatistics extends ModelBasic
*/
public static function getTime($where,$model=null,$prefix='add_time'){
if ($model == null) $model = new self;
if(!$where['date']) return $model;
if ($where['data'] == '') {
switch ($where['date']){
case 'today':case 'week':case 'month':case 'year':
$model=$model->whereTime($prefix,$where['date']);
break;
case 'quarter':
list($startTime,$endTime)=User::getMonth('n');
$model = $model->where($prefix, '>', strtotime($startTime));
$model = $model->where($prefix, '<', strtotime($endTime));
break;
}
}else{
list($startTime, $endTime) = explode(' - ', $where['data']);
$model = $model->where($prefix, '>', strtotime($startTime));
$model = $model->where($prefix, '<', strtotime($endTime));
$limitTimeList = [
'today'=>implode(' - ',[date('Y/m/d'),date('Y/m/d',strtotime('+1 day'))]),
'week'=>implode(' - ',[
date('Y/m/d', (time() - ((date('w') == 0 ? 7 : date('w')) - 1) * 24 * 3600)),
date('Y-m-d', (time() + (7 - (date('w') == 0 ? 7 : date('w'))) * 24 * 3600))
]),
'month'=>implode(' - ',[date('Y/m').'/01',date('Y/m').'/'.date('t')]),
'quarter'=>implode(' - ',[
date('Y').'/'.(ceil((date('n'))/3)*3-3+1).'/01',
date('Y').'/'.(ceil((date('n'))/3)*3).'/'.date('t',mktime(0,0,0,(ceil((date('n'))/3)*3),1,date('Y')))
]),
'year'=>implode(' - ',[
date('Y').'/01/01',date('Y/m/d',strtotime(date('Y').'/01/01 + 1year -1 day'))
])
];
$where['data'] = $limitTimeList[$where['date']];
}
list($startTime, $endTime) = explode(' - ', $where['data']);
$model = $model->where($prefix, '>', strtotime($startTime));
$model = $model->where($prefix, '<', strtotime($endTime));
return $model;
}
/**
@ -120,7 +126,7 @@ class StoreStatistics extends ModelBasic
*/
public static function getConsumption($where)
{
$consumption=self::getTime($where,new UserBill,'b.add_time')->alias('a')->join('user b','a.uid = b.uid')
$consumption=self::getTime($where,new UserBill,'b.add_time')->alias('a')->join('__USER__ b','a.uid = b.uid')
->field('sum(a.number) number')
->where('a.type','pay_product')->find()->toArray();
return $consumption;
@ -172,7 +178,7 @@ class StoreStatistics extends ModelBasic
public static function trans()
{
$trans = self::alias('a')
->join('user b', 'a.uid=b.uid')
->join('__USER__ b', 'a.uid=b.uid','left')
->join('__STORE_ORDER_CART_INFO__ c', 'a.id=c.oid')
->join('__STORE_PRODUCT__ d', 'c.product_id=d.id')
->field('b.nickname,a.pay_price,d.store_name')

View File

@ -7,7 +7,7 @@ use traits\ModelTrait;
/**
* 表单ID表
* Class RoutineFormId
* @package app\routine\model\routine
* @package app\admin\model\routine
*/
class RoutineFormId extends ModelBasic {

View File

@ -49,6 +49,8 @@ class StoreCategory extends ModelBasic
if($isAjax===true){
if(isset($where['order']) && $where['order']!=''){
$model=$model->order(self::setOrder($where['order']));
}else{
$model=$model->order('sort desc,id desc');
}
return $model;
}
@ -78,7 +80,7 @@ class StoreCategory extends ModelBasic
public static function getTierList($model = null)
{
if($model === null) $model = new self();
return UtilService::sortListTier($model->select()->toArray());
return UtilService::sortListTier($model->order('sort desc,id desc')->select()->toArray());
}
public static function delCategory($id){

View File

@ -28,6 +28,14 @@ class StoreProductAttrValue extends ModelBasic
return self::uniqueId($data['product_id'].$data['suk'].uniqid(true));
}
/*
* 减少销量增加库存
* */
public static function incProductAttrStock($productId,$unique,$num)
{
return false !== self::where('product_id',$productId)->where('unique',$unique)->inc('stock',$num)->dec('sales',$num)->update();
}
public static function decProductAttrStock($productId,$unique,$num)
{
return false !== self::where('product_id',$productId)->where('unique',$unique)

View File

@ -19,6 +19,55 @@ class StoreProductReply extends ModelBasic
{
use ModelTrait;
protected function getPicsAttr($value)
{
return json_decode($value,true);
}
/*
* 设置where条件
* @param array $where
* @param string $alias
* @param object $model
* */
public static function valiWhere($where,$alias='',$model=null)
{
$model=is_null($model) ? new self() : $model;
if($alias){
$model=$model->alias($alias);
$alias.='.';
}
if(isset($where['title']) && $where['title']!='') $model=$model->where("{$alias}comment",'LIKE',"%$where[title]%");
if(isset($where['is_reply']) && $where['is_reply']!='') $model= $where['is_reply'] >= 0 ? $model->where("{$alias}is_reply",$where['is_reply']) : $model->where("{$alias}is_reply",'GT',0);
if(isset($where['producr_id']) && $where['producr_id']!=0) $model=$model->where('product_id',$where['producr_id']);
return $model->where("{$alias}is_del",0);
}
public static function getProductImaesList($where)
{
$list=self::valiWhere($where,'a')->group('p.id')->join('__WECHAT_USER__ u','u.uid=a.uid')->join("__STORE_PRODUCT__ p",'a.product_id=p.id')->field(['p.id','p.image','p.store_name','p.price'])->page($where['page'],$where['limit'])->select();
$list=count($list) ? $list->toArray() : [];
foreach ($list as &$item){
$item['store_name']=self::getSubstrUTf8($item['store_name'],10,'UTF-8','');
}
return $list;
}
public static function getProductReplyList($where)
{
$data=self::valiWhere($where,'a')->join("__STORE_PRODUCT__ p",'a.product_id=p.id')
->join('__WECHAT_USER__ u','u.uid=a.uid')
->order('a.add_time desc,a.is_reply asc')
->field('a.*,u.nickname,u.headimgurl as avatar')
->page((int)$where['message_page'],(int)$where['limit'])
->select();
$data=count($data) ? $data->toArray() : [];
foreach ($data as &$item){
$item['time']=\service\UtilService::timeTran($item['add_time']);
}
$count=self::valiWhere($where,'a')->join('__WECHAT_USER__ u','u.uid=a.uid')->join("__STORE_PRODUCT__ p",'a.product_id=p.id')->count();
return ['list'=>$data,'count'=>$count];
}
/**
* @param $where
* @return array
@ -38,6 +87,7 @@ class StoreProductReply extends ModelBasic
$model = $model->join('__STORE_PRODUCT__ p','p.id=r.product_id');
$model = $model->where('r.is_del',0);
$model = $model->field('r.*,u.nickname,u.headimgurl,p.store_name');
$model = $model->order('r.add_time desc,r.is_reply asc');
return self::page($model,function($itme){
},$where);

View File

@ -11,7 +11,7 @@ use traits\ModelTrait;
use basic\ModelBasic;
/**
* Class SystemAdmin
* Class Express
* @package app\admin\model\system
*/
class Express extends ModelBasic

View File

@ -0,0 +1,51 @@
<?php
/**
* 附件目录
*
*/
namespace app\admin\model\system;
use traits\ModelTrait;
use basic\ModelBasic;
/**
* 文件检验model
* Class SystemFile
* @package app\admin\model\system
*/
class SystemAttachmentType extends ModelBasic
{
use ModelTrait;
/**添加附件记录
*/
public static function attachmentAdd($name,$att_size,$att_type,$att_dir,$satt_dir='',$pid = 0 )
{
$data['name'] = $name;
$data['att_dir'] = $att_dir;
$data['satt_dir'] = $satt_dir;
$data['att_size'] = $att_size;
$data['att_type'] = $att_type;
$data['time'] = time();
$data['pid'] = $pid;
return self::create($data);
}
/**
* 获取分类图
* */
public static function getAll($id){
$model = new self;
$where['pid'] = $id;
$model->where($where)->order('att_id desc');
return $model->page($model,$where,'',30);
}
/**
* 获取单条信息
* */
public static function getinfo($att_id){
$model = new self;
$where['att_id'] = $att_id;
return $model->where($where)->select()->toArray()[0];
}
}

File diff suppressed because one or more lines are too long

View File

@ -49,6 +49,11 @@ class SystemGroupData extends ModelBasic
});
}
/**获得组合数据信息+组合数据列表
* @param $config_name
* @param int $limit
* @return array|bool|false|\PDOStatement|string|\think\Model
*/
public static function getGroupData($config_name,$limit = 0)
{
$group = SystemGroup::where('config_name',$config_name)->field('name,info,config_name')->find();

View File

@ -0,0 +1,53 @@
<?php
/**
*
* @author: xaboy<365615158@qq.com>
* @day: 2017/11/13
*/
namespace app\admin\model\system;
use traits\ModelTrait;
use basic\ModelBasic;
/**
* 设置会员vip model
* Class SystemVip
* @package app\admin\model\system
*/
class SystemUserLevel extends ModelBasic
{
use ModelTrait;
public static function setAddTimeAttr()
{
return time();
}
public static function getAddTimeAttr($value)
{
return date('Y-m-d H:i:s',$value);
}
/*
* 获取查询条件
* */
public static function setWhere($where,$alert='',$model=null)
{
$model=$model===null ? new self() : $model;
if($alert) $model=$model->alias($alert);
$alert=$alert ? $alert.'.': '';
if(isset($where['is_show']) && $where['is_show']!=='') $model=$model->where("{$alert}is_show",$where['is_show']);
if(isset($where['title']) && $where['title']) $model=$model->where("{$alert}name",'LIKE',"%$where[title]%");
return $model;
}
/*
* 查找系统设置的会员等级列表
* */
public static function getSytemList($where)
{
$data=self::setWhere($where)->order('grade asc')->page((int)$where['page'],(int)$where['limit'])->select();
$data=count($data) ? $data->toArray() : [];
$count=self::setWhere($where)->count();
return compact('data','count');
}
}

View File

@ -0,0 +1,136 @@
<?php
/**
*
* @author: xaboy<365615158@qq.com>
* @day: 2017/11/13
*/
namespace app\admin\model\system;
use app\admin\model\order\StoreOrder;
use app\admin\model\user\User;
use app\admin\model\user\UserBill;
use app\admin\model\user\UserLevel;
use app\admin\model\user\UserTaskFinish;
use traits\ModelTrait;
use basic\ModelBasic;
/**
* 设置等级任务 model
* Class SystemVipTask
* @package app\admin\model\system
*/
class SystemUserTask extends ModelBasic
{
use ModelTrait;
/*
* 任务类型
* type 记录在数据库中用来区分任务
* name 任务名 (任务名中的{$num}会自动替换成设置的数字 + 单位)
* max_number 最大设定数值 0为不限定
* min_number 最小设定数值
* unit 单位
* */
protected static $TaskType=[
[
'type'=>'SatisfactionIntegral',
'name'=>'满足积分{$num}',
'real_name'=>'积分数',
'max_number'=>0,
'min_number'=>0,
'unit'=>'分'
],
[
'type'=>'ConsumptionAmount',
'name'=>'消费满{$num}',
'real_name'=>'消费金额',
'max_number'=>0,
'min_number'=>0,
'unit'=>'元'
],
[
'type'=>'ConsumptionFrequency',
'name'=>'消费{$num}',
'real_name'=>'消费次数',
'max_number'=>0,
'min_number'=>0,
'unit'=>'次'
],
[
'type'=>'CumulativeAttendance',
'name'=>'累计签到{$num}',
'real_name'=>'累计签到',
'max_number'=>365,
'min_number'=>1,
'unit'=>'天'
],
[
'type'=>'SharingTimes',
'name'=>'分享给朋友{$num}',
'real_name'=>'分享给朋友',
'max_number'=>1000,
'min_number'=>1,
'unit'=>'次'
],
[
'type'=>'InviteGoodFriends',
'name'=>'邀请好友{$num}成为下线',
'real_name'=>'邀请好友成为下线',
'max_number'=>1000,
'min_number'=>1,
'unit'=>'人'
],
[
'type'=>'InviteGoodFriendsLevel',
'name'=>'邀请好友{$num}成为会员',
'real_name'=>'邀请好友成为会员',
'max_number'=>1000,
'min_number'=>1,
'unit'=>'人'
],
];
public function profile()
{
return $this->hasOne('SystemUserLevel','level_id','id')->field('name');
}
public static function getTaskTypeAll()
{
return self::$TaskType;
}
/*
* 获取某个任务
* */
public static function getTaskType($type)
{
foreach (self::$TaskType as $item){
if($item['type']==$type) return $item;
}
}
/*
* 设置任务名
* */
public static function setTaskName($type,$num)
{
$systemType=self::getTaskType($type);
return str_replace('{$num}',$num.$systemType['unit'],$systemType['name']);
}
/*
* 获取等级会员任务列表
* */
public static function getTashList($level_id,$page,$limit)
{
$data=self::where('level_id',$level_id)->order('sort desc,add_time desc')->page($page,$limit)->select();
$data=count($data) ? $data->toArray() : [];
foreach ($data as &$item){
$item['level_name']=SystemUserLevel::where('id',$item['level_id'])->value('name');
}
$count=self::where('level_id',$level_id)->count();
return compact('data','count');
}
}

View File

@ -33,8 +33,8 @@ class StoreCouponIssue extends ModelBasic
return time();
}
public static function setIssue($cid,$total_count = 0,$start_time = 0,$end_time = 0,$remain_count = 0,$status = 0)
public static function setIssue($cid,$total_count = 0,$start_time = 0,$end_time = 0,$remain_count = 0,$status = 0,$is_permanent=0)
{
return self::set(compact('cid','start_time','end_time','total_count','remain_count','status'));
return self::set(compact('cid','start_time','end_time','total_count','remain_count','status','is_permanent'));
}
}

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@ use app\admin\model\wechat\WechatUser;
use think\Url;
use traits\ModelTrait;
use basic\ModelBasic;
use service\WechatTemplateService;
use app\core\util\WechatTemplateService;
/**
* 用户提现管理 model
* Class User
@ -49,16 +49,18 @@ class UserExtract extends ModelBasic
$uid=$data['uid'];
$status = -1;
$User= User::find(['uid'=>$uid])->toArray();
UserBill::income('提现失败',$uid,'now_money','extract',$extract_number,$id,$User['now_money'],$mark);
UserBill::income('提现失败',$uid,'now_money','extract',$extract_number,$id,bcadd($User['now_money'],$extract_number,2),$mark);
User::bcInc($uid,'now_money',$extract_number,'uid');
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid),WechatTemplateService::USER_BALANCE_CHANGE,[
'first'=> $mark,
'keyword1'=>'佣金提现',
'keyword2'=>date('Y-m-d H:i:s',time()),
'keyword3'=>$extract_number,
'remark'=>'错误原因:'.$fail_msg
],Url::build('wap/my/user_pro',[],true,true));
if($User['user_type'] == 'wechat'){
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid),WechatTemplateService::USER_BALANCE_CHANGE,[
'first'=> $mark,
'keyword1'=>'佣金提现',
'keyword2'=>date('Y-m-d H:i:s',time()),
'keyword3'=>$extract_number,
'remark'=>'错误原因:'.$fail_msg
],Url::build('wap/my/user_pro',[],true,true));
}
return self::edit(compact('fail_time','fail_msg','status'),$id);
}
@ -69,13 +71,16 @@ class UserExtract extends ModelBasic
$extract_number=$data['extract_price'];
$mark='成功提现佣金'.$extract_number.'元';
$uid=$data['uid'];
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid),WechatTemplateService::USER_BALANCE_CHANGE,[
'first'=> $mark,
'keyword1'=>'佣金提现',
'keyword2'=>date('Y-m-d H:i:s',time()),
'keyword3'=>$extract_number,
'remark'=>'点击查看我的佣金明细'
],Url::build('wap/my/user_pro',[],true,true));
$User= User::find(['uid'=>$uid])->toArray();
if($User['user_type'] == 'wechat') {
WechatTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), WechatTemplateService::USER_BALANCE_CHANGE, [
'first' => $mark,
'keyword1' => '佣金提现',
'keyword2' => date('Y-m-d H:i:s', time()),
'keyword3' => $extract_number,
'remark' => '点击查看我的佣金明细'
], Url::build('wap/my/user_pro', [], true, true));
}
return self::edit(compact('status'),$id);
}
//测试数据

View File

@ -0,0 +1,54 @@
<?php
/**
*
* @author: xaboy<365615158@qq.com>
* @day: 2017/11/11
*/
namespace app\admin\model\user;
use app\admin\model\system\SystemUserLevel;
use traits\ModelTrait;
use basic\ModelBasic;
/**
* 用户管理 model
* Class User
* @package app\admin\model\user
*/
class UserLevel extends ModelBasic
{
use ModelTrait;
public static function setWhere($where,$alias='',$userAlias='u.',$model=null)
{
$model=is_null($model) ? new self() : $model;
if($alias){
$model=$model->alias($alias);
$alias.='.';
}
if(isset($where['nickname']) && $where['nickname']!='') $model=$model->where("{$userAlias}nickanme",$where['nickname']);
if(isset($where['level_id']) && $where['level_id']!='') $model=$model->where("{$alias}level_id",$where['level_id']);
return $model->where(["{$alias}status"=>1,"{$alias}is_del"=>0]);
}
/*
* 查询用户vip列表
* @param array $where
* */
public static function getUserVipList($where)
{
$data=self::setWhere($where,'a')->group('a.uid')->order('grade desc')
->field(['a.*','u.nickname','u.avatar'])
->join('__USER__ u','a.uid=u.uid')->page((int)$where['page'],(int)$where['limit'])->select();
$data=count($data) ? $data->toArray() : [];
foreach ($data as &$item){
$info=SystemUserLevel::where('id',$item['level_id'])->find();
if($info){
$item['name']=$info['name'];
$item['icon']=$info['icon'];
}
$item['is_forever']= $item['is_forever'] ? '永久会员':'限时会员';
$item['valid_time']=$item['is_forever'] ? '永久':date('Y-m-d H:i:s',$item['valid_time']);
}
$count=self::setWhere($where,'a')->group('a.level_id')->order('grade desc')->join('__USER__ u','a.uid=u.uid')->count();
return compact('data','count');
}
}

View File

@ -1,12 +1,18 @@
<?php
/**
*
* @author: xaboy<365615158@qq.com>
* @day: 2017/11/28
*/
namespace app\admin\model\user;
use traits\ModelTrait;
use basic\ModelBasic;
use app\admin\model\user\User;
/**
* 提现记录
* 用户充值记录
* Class UserRecharge
* @package app\admin\model\user
*/
@ -19,8 +25,9 @@ use app\admin\model\user\User;
$model = new self;
$model = $model->alias('A');
if($where['order_id'] != '') {
$model = $model->where('A.order_id|B.nickname','like',"%$where[order_id]%");
$model = $model->whereOr('A.order_id','like',"%$where[order_id]%");
$model = $model->whereOr('A.id',(int)$where['order_id']);
$model = $model->whereOr('B.nickname','like',"%$where[order_id]%");
}
$model = $model->where('A.recharge_type','weixin');
$model = $model->where('A.paid',1);

View File

@ -0,0 +1,29 @@
<?php
namespace app\admin\model\user;
use traits\ModelTrait;
use basic\ModelBasic;
/**
* 用户等级完成任务记录 model
* Class UserTaskFinish
* @package app\admin\model\user
*/
class UserTaskFinish extends ModelBasic
{
use ModelTrait;
/*
* 设置任务完成情况
* @param int $uid 用户uid
* @param int $task_id 任务id
* @return Boolean
* */
public static function setFinish($uid,$task_id)
{
$add_time=time();
if(self::be(['uid'=>$uid,'task_id'=>$task_id])) return true;
return self::set(compact('uid','task_id','add_time'));
}
}

View File

@ -10,7 +10,7 @@ namespace app\admin\model\wechat;
use traits\ModelTrait;
use basic\ModelBasic;
use service\WechatService;
use app\core\util\WechatService;
/**
* 获取二维码

View File

@ -12,7 +12,7 @@ use traits\ModelTrait;
use basic\ModelBasic;
use service\HookService;
use service\UtilService;
use service\WechatService;
use app\core\util\WechatService;
use think\Url;
/**
@ -30,7 +30,7 @@ class WechatReply extends ModelBasic
* @param $key
*/
public static function getDataByKey($key){
$resdata = [];
$resdata = ['data'=>''];
$resdata = self::where('key',$key)->find();
$resdata['data'] = json_decode($resdata['data'],true);
return $resdata;
@ -187,9 +187,7 @@ class WechatReply extends ModelBasic
public static function reply($key,$default=''){
$res = self::where('key',$key)->where('status','1')->find();
if(empty($res)) $res = self::where('key','default')->where('status','1')->find();
if(empty($res)){
return WechatService::textMessage($default);
}
if(empty($res)) return WechatService::transfer();
$res['data'] = json_decode($res['data'],true);
if($res['type'] == 'text'){
return WechatService::textMessage($res['data']['content']);

View File

@ -12,14 +12,14 @@ use app\admin\model\order\StoreOrder;
use app\admin\model\user\User;
use app\admin\model\user\UserExtract;
use service\ExportService;
use service\QrcodeService;
use app\core\util\QrcodeService;
use think\Cache;
use think\Config;
use traits\ModelTrait;
use basic\ModelBasic;
use service\WechatService;
use app\core\util\WechatService;
use service\PHPExcelService;
use service\SystemConfigService;
use app\core\util\SystemConfigService;
/**
* 微信用户 model
@ -215,7 +215,11 @@ use service\SystemConfigService;
->ExcelSave();
}
return self::page($model,function ($item){
$item['qr_code'] = QrcodeService::getForeverQrcode('spread',$item['uid']);
try{
$item['qr_code'] = QrcodeService::getForeverQrcode('spread',$item['uid']);
}catch (\Exception $e){
$item['qr_code'] = '';
}
$item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid']);//累计提现
$item['extract_count_num'] = UserExtract::getUserCountNum($item['uid']);//提现次数
},$where);

View File

@ -8,6 +8,7 @@
<link href="{__FRAME_PATH}css/plugins/footable/footable.core.css" rel="stylesheet">
<script src="{__PLUG_PATH}sweetalert2/sweetalert2.all.min.js"></script>
<script src="{__FRAME_PATH}js/plugins/footable/footable.all.min.js"></script>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
<style>
.on-tag{background-color: #eea91e;}
.height-auto{height: 300px;}
@ -386,7 +387,11 @@
{if condition="$vo['user_type'] eq 'routine'"}
暂无
{else/}
{if isset($vo.qr_code.url)}
<img src="{$vo.qr_code.url}" alt="{$vo.nickname}" title="{$vo.nickname}" style="width:50px;height: 50px;cursor: pointer;" class="head_image" data-image="{$vo.qr_code.url}">
{else}
暂无
{/if}
{/if}
</td>
<td class="text-center">
@ -547,7 +552,8 @@
}
}
var str = chk_value.join(',');
var url = "http://"+window.location.host+"/admin/store.store_coupon/grant/id/"+str;
// var url = "http://"+window.location.host+"/admin/store.store_coupon/grant/id/"+str;
var url = layList.U({c:'store.store_coupon',a:'grant',p:{id:str}});
$eb.createModalFrame(this.innerText,url,{'w':800});
})
$('.news').on('click',function (e) {
@ -570,7 +576,8 @@
}
}
var str = chk_value.join(',');
var url = "http://"+window.location.host+"/admin/wechat.wechat_news_category/send_news/id/"+str;
// var url = "http://"+window.location.host+"/admin/wechat.wechat_news_category/send_news/id/"+str;
var url = layList.U({c:'wechat.wechat_news_category',a:'send_news',p:{id:str}});
$eb.createModalFrame(this.innerText,url,{'w':800});
})
$('.synchro').on('click',function(){

View File

@ -93,7 +93,7 @@
return;
}
}
layList.reload(where);
layList.reload(where,true);
});
layList.search('export',function(where){
location.href=layList.U({a:'save_bell_export',q:{type:where.type,start_time:where.start_time,end_time:where.end_time,nickname:where.nickname}});

View File

@ -0,0 +1,58 @@
{extend name="public/bootstraptable"}
{block name="head"}
{/block}
{block name="content"}
<div class="row">
<div class="col-sm-12">
<table id="table1"></table>
<table id="table2"></table>
</div>
</div>
{/block}
{block name="script"}
<script>
$('#table2').bootstrapTable({
method: "POST",
url: "{:Url('billlist')}",
dataType: "json",
toolbar: '#toolbar', //工具按钮用哪个容器
pagination: true, //是否显示分页(*
cache: false,
clickToSelect: true,
showRefresh: true, //是否显示刷新按钮
showPaginationSwitch: true, //是否显示选择分页数按钮
pageNumber: 1, //初始化加载第一页,默认第一页
showColumns:true,
pageSize: 5, //每页的记录行数(*
search: true,
showToggle:true,//是否显示切换视图table/card按钮
showFullscreen:true,//是否显示全屏按钮
sortable: true, //是否启用排序
sortOrder: "asc",
columns: [
{checkbox : true},
{ field: 'id', title: '编号',sortable:true },
{ field: 'title', title: '标题',sortable:true },
{ field: 'link_id', title: '关联ID',sortable:true },
{ field: 'pm', title: '是否支出',sortable:true },
{ field: 'number', title: '明细数字',sortable:true },
{ field: 'status', title: '状态',sortable:true },
{ field: 'add_time', title: '时间',sortable:true},
{ field: 'balance', title: '余额',sortable:true },
{ field: 'uid', title: '学生编号',sortable:true },
{ field: 'balance', title: '金额' },
{ field: 'mark', title: '生日' }
],
onLoadSuccess: function(){ //加载成功时执行
console.info("加载成功");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
});
</script>
{/block}

View File

@ -99,7 +99,7 @@
{/if}
<li class="layui-col-xs4">
<div class="backlog-body">
<h3>佣金总</h3>
<h3>佣金总</h3>
<p><cite>{$userinfo.number}</cite></p>
</div>
</li>
@ -166,7 +166,7 @@
return;
}
}
layList.reload(where);
layList.reload(where,true);
});
</script>
{/block}

View File

@ -14,6 +14,9 @@
<link href="{__FRAME_PATH}css/font-awesome.min.css" rel="stylesheet">
<link href="{__FRAME_PATH}css/animate.min.css" rel="stylesheet">
<link href="{__FRAME_PATH}css/style.min.css" rel="stylesheet">
<style>
.swal2-container{z-index: 100000000000!important;}
</style>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
@ -279,7 +282,6 @@
$(function() {
function getnotice() {
$.getJSON("{:Url('Jnotice')}",function(res){
console.log(res);
var info = eval("("+res+")");
var data = info.data;
$('#msgcount').html(data.msgcount);
@ -290,7 +292,7 @@
});
}
getnotice();
setInterval(getnotice, 3000);
setInterval(getnotice, 600000);
});
</script>

View File

@ -82,29 +82,30 @@
<table class="layui-hide" id="List" lay-filter="List"></table>
<!--订单-->
<script type="text/html" id="order_id">
{{d.order_id}}
<span style="color: {{d.color}};">{{d.pink_name}}</span>  
{{d.order_id}}<br/>
<span style="color: {{d.color}};">{{d.pink_name}}</span><br/> 
{{# if(d.is_del == 1){ }}<span style="color: {{d.color}};">用户已删除</span>{{# } }} 
</script>
<!--用户信息-->
<script type="text/html" id="userinfo">
{{d.nickname==null ? '暂无信息':d.nickname}}/{{d.uid}}
{{d.nickname==null ? '暂无信息':d.nickname}}/{{d.uid}}
</script>
<!--支付状态-->
<script type="text/html" id="paid">
{{# if(d.pay_type==1){ }}
<p>{{d.pay_type_name}}</p>
<p>{{d.pay_type_name}}</p>
{{# }else{ }}
{{# if(d.pay_type_info!=undefined){ }}
<p><span>线下支付</span></p>
<p><button type="button" class="btn btn-w-m btn-white">立即支付</button></p>
{{# }else{ }}
<p>{{d.pay_type_name}}</p>
{{# } }}
{{# if(d.pay_type_info!=undefined){ }}
<p><span>线下支付</span></p>
<p><button type="button" class="btn btn-w-m btn-white">立即支付</button></p>
{{# }else{ }}
<p>{{d.pay_type_name}}</p>
{{# } }}
{{# }; }}
</script>
<!--订单状态-->
<script type="text/html" id="status">
{{d.status_name}}
{{d.status_name}}
</script>
<!--商品信息-->
<script type="text/html" id="info">
@ -131,7 +132,7 @@
<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">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.nickname}}-订单详情','{:Url('order_info')}?oid={{d.id}}')">
<a href="javascript:void(0);" lay-event='order_info'>
<i class="fa fa-file-text"></i> 订单详情
</a>
</li>
@ -157,7 +158,7 @@
<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">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.nickname}}-订单详情','{:Url('order_info')}?oid={{d.id}}')">
<a href="javascript:void(0);" lay-event='order_info'>
<i class="fa fa-file-text"></i> 订单详情
</a>
</li>
@ -171,7 +172,7 @@
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
{{# if(d.pay_price!=d.refund_price){ }}
{{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}',{w:400,h:300})">
<i class="fa fa-history"></i> 立即退款
@ -194,7 +195,7 @@
<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">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.nickname}}-订单详情','{:Url('order_info')}?oid={{d.id}}')">
<a href="javascript:void(0);" lay-event='order_info'>
<i class="fa fa-file-text"></i> 订单详情
</a>
</li>
@ -214,7 +215,8 @@
<i class="fa fa-history"></i> 退积分
</a>
</li>
{{# }else if(d.pay_price != d.refund_price){ }}
{{# };}}
{{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}',{w:400,h:300})">
<i class="fa fa-history"></i>立即退款
@ -238,7 +240,7 @@
<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">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.nickname}}-订单详情','{:Url('order_info')}?oid={{d.id}}')">
<a href="javascript:void(0);" lay-event='order_info'>
<i class="fa fa-file-text"></i> 订单详情
</a>
</li>
@ -252,7 +254,7 @@
<i class="fa fa-cart-arrow-down"></i> 已收货
</a>
</li>
{{# if(d.pay_price != d.refund_price){ }}
{{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}')">
<i class="fa fa-history"></i> 立即退款
@ -275,7 +277,7 @@
<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">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.nickname}}-订单详情','{:Url('order_info')}?oid={{d.id}}')">
<a href="javascript:void(0);" lay-event='order_info'>
<i class="fa fa-file-text"></i> 订单详情
</a>
</li>
@ -284,13 +286,14 @@
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
{{# if(d.pay_price != d.refund_price){ }}
{{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}')">
<i class="fa fa-history"></i> 立即退款
</a>
</li>
{{# }else if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
{{# };}}
{{# if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
<i class="fa fa-history"></i> 退积分
@ -307,7 +310,7 @@
<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">
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('{{d.nickname}}-订单详情','{:Url('order_info')}?oid={{d.id}}')">
<a href="javascript:void(0);" lay-event='order_info'>
<i class="fa fa-file-text"></i> 订单详情
</a>
</li>
@ -316,6 +319,13 @@
<i class="fa fa-paste"></i> 订单备注
</a>
</li>
{{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}')">
<i class="fa fa-history"></i> 立即退款
</a>
</li>
{{# } }}
{{# if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
<li>
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
@ -391,6 +401,9 @@
});
},{'title':'您确定要修改收货状态吗?','text':'修改后将无法恢复,请谨慎操作!','confirm':'是的,我要修改'})
break;
case 'order_info':
$eb.createModalFrame(data.nickname+'订单详情',layList.U({a:'order_info',q:{oid:data.id}}));
break;
}
})
//下拉框
@ -434,8 +447,7 @@
orderType: [
{name: '全部', value: ''},
{name: '普通订单', value: 1,count:orderCount.general},
{name: '拼团订单', value: 2,count:orderCount.pink},
{name: '秒杀订单', value: 3,count:orderCount.seckill},
{name: '秒杀订单', value: 3,count:orderCount.seckill}
],
orderStatus: [
{name: '全部', value: ''},
@ -488,7 +500,7 @@
search:function () {
this.where.excel=0;
this.getBadge();
layList.reload(this.where);
layList.reload(this.where,true);
},
refresh:function () {
layList.reload();
@ -515,4 +527,4 @@
})
});
</script>
{/block}
{/block}

View File

@ -8,8 +8,7 @@
{block name="head"}{/block}
</head>
<body class="gray-bg">
<!--演示地址https://daneden.github.io/animate.css/?-->
<div class="wrapper wrapper-content animated ">
<div class="wrapper wrapper-content">
{block name="content"}{/block}
{block name="foot"}{/block}
{block name="script"}{/block}

View File

@ -3,12 +3,12 @@
<head>
<meta charset="UTF-8">
<title><?=$form->getTitle()?></title>
<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>
<script src="{__PLUG_PATH}vue/dist/vue.min.js"></script>
<link href="{__PLUG_PATH}iview/dist/styles/iview.css" rel="stylesheet">
<script src="{__PLUG_PATH}iview/dist/iview.min.js"></script>
<script src="{__PLUG_PATH}jquery/jquery.min.js"></script>
<script src="{__PLUG_PATH}form-create/province_city.js"></script>
<script src="{__PLUG_PATH}form-create/form-create.min.js"></script>
<style>
/*弹框样式修改*/
.ivu-modal-body{padding: 5;}

View File

@ -14,7 +14,6 @@
<script src="{__PLUG_PATH}layui/layui.all.js"></script>
<script>
$eb = parent._mpApi;
// if(!$eb) top.location.reload();
window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", think\Request::instance()->controller()), "_"));?>";
window.module="<?php echo think\Request::instance()->module();?>";
</script>

View File

@ -5,5 +5,5 @@
{include file="public/style"}
<script>
$eb = parent._mpApi;
if(!$eb) top.location.reload();
// if(!$eb) top.location.reload();
</script>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="{__FRAME_PATH}js/jquery.min.js"></script>
<link href="{__PLUG_PATH}layui/css/layui.css" rel="stylesheet">
<script src="{__PLUG_PATH}layui/layui.js"></script>
<script>
$eb = parent._mpApi;
if(!$eb) top.location.reload();
</script>
{block name="head"}{/block}
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
{block name="content"}{/block}
{block name="script"}{/block}
</div>
<!--全局layout模版-->
</body>
</html>

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -176,7 +224,7 @@
info:function(){
var that=this;
var index=layList.layer.load(2,{shade: [0.3,'#fff']});
layList.baseGet(layList.Url({c:'auth_api',a:'get_echarts_product',q:{type:this.status,data:this.data}}),function (res){
layList.baseGet(layList.Url({c:'record.record',a:'get_mark_echarts_product',q:{type:this.status,data:this.data}}),function (res){
layList.layer.close(index);
that.badge=res.data.badge;
that.count=res.data.count;
@ -191,26 +239,26 @@
},
getSalesList:function(){
var that=this;
layList.baseGet(layList.Url({c:'auth_api',a:'get_echarts_maxlist',q:{data:this.data}}),function (rem) {
layList.baseGet(layList.Url({c:'record.record',a:'get_mark_echarts_maxlist',q:{data:this.data}}),function (rem) {
that.SalesList=rem.data;
});
},
getProfityList:function(){
var that=this;
layList.baseGet(layList.Url({c:'auth_api',a:'get_echarts_profity',q:{data:this.data}}),function (rem) {
layList.baseGet(layList.Url({c:'record.record',a:'get_mark_echarts_profity',q:{data:this.data}}),function (rem) {
that.ProfityList=rem.data;
});
},
getTuiPriesList:function(){
var that=this;
layList.baseGet(layList.Url({c:'auth_api',a:'get_bargain_refund_list'}),function (rem) {
layList.baseGet(layList.Url({c:'record.record',a:'get_mark_bargain_refund_list'}),function (rem) {
that.TuiPriesList=rem.data;
});
},/*待补货*/
getLackList:function(){
var that=layList;
var data={
url:that.U({c:'auth_api',a:'getLackList'}),
url:that.U({c:'record.record',a:'get_mark_lack_list'}),
limit:10
};
layList.tables('PhList',data,[
@ -219,21 +267,6 @@
{field: 'stock', title: '库存',edit:'stock'},
{field: 'right', title: '操作',align:'center',toolbar:'#bar'},
]);
that.table.on('edit(PhList)',function (obj) {
var value = obj.value //得到修改后的值
,data = obj.data //得到所在行所有键值
,field = obj.field; //得到字段
switch (field){
case 'stock':
that.basePost(that.U({c:'auth_api',a:'editField',p:{id:obj.data.id}}),{stock:obj.value},function (rem) {
that.msg(rem.msg);
});
break;
default:
console.log('未检测到指定字段'+name);
break;
}
});
that.table.on('tool(PhList)', function (obj) {
var data = obj.data, layEvent = obj.event;
switch (layEvent) {
@ -248,7 +281,7 @@
},/*获取砍价产品的评论*/
getnegativeList:function(){
var that=this;
layList.baseGet(layList.Url({c:'auth_api',a:'getnegativelist'}),function(rem) {
layList.baseGet(layList.Url({c:'record.record',a:'get_mark_negative_list'}),function(rem) {
that.negativeList=rem.data.data;
});
},

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -160,15 +208,11 @@
this.setChart(this.$refs.echarts_price,'price');
this.getBadgeList();
this.getExtractData();
var that=this;
layList.laydate.render({
elem:this.$refs.date_time,
trigger:'click',
eventElem:this.$refs.time,
range:true,
change:function (value) {
that.data=value;
}
});
}
})

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}

View File

@ -1,5 +1,19 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -116,8 +164,6 @@
typeList:[
{name:'全部',value:''},
{name:'普通',value:1},
{name:'拼团',value:2},
{name:'砍价',value:3},
{name:'秒杀',value:4},
],
status:'',
@ -162,6 +208,7 @@
setoption:function(seriesdata,xdata,legend,title,type,Zoom){
var _type=type || 'line';
var _title=title || '订单数据统计图';
switch (_type){
case 'line':
this.option={
@ -204,6 +251,9 @@
};
break;
}
this.option.grid = {
x: 50,x2: 40,y: 60,y2: 50
};
if(Zoom!='' && Zoom!=undefined){
this.option.dataZoom=[{startValue:Zoom},{type:'inside'}];
}

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -333,15 +381,11 @@
this.getLackList();
this.getnegativeList();
this.getTuiPriesList();
var that=this;
layList.laydate.render({
elem:this.$refs.date_time,
trigger:'click',
eventElem:this.$refs.time,
range:true,
change:function (value) {
that.data=value;
}
});
}
});

View File

@ -1,5 +1,56 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
.layadmin-text-center{
text-align: center;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -236,15 +287,11 @@
this.getEchartsData();
this.getbadge();
this.getFanList();
var that=this;
layList.laydate.render({
elem:this.$refs.date_time,
trigger:'click',
eventElem:this.$refs.time,
range:true,
change:function (value) {
that.data=value;
}
});
var that=this;
layList.baseGet(layList.U({a:'getFanCount'}),function (rem) {
@ -259,6 +306,7 @@
}
});
});
}
})
})

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -149,15 +197,11 @@
this.setChart(this.$refs.echarts_list,'list');
this.setChart(this.$refs.echarts_price,'price');
this.getEchartsRecharge();
var that=this;
layList.laydate.render({
elem:this.$refs.date_time,
trigger:'click',
eventElem:this.$refs.time,
range:true,
change:function (value) {
that.data=value;
}
});
}
})

View File

@ -1,5 +1,19 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}

View File

@ -1,5 +1,20 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
margin-bottom: 10px;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -142,15 +190,11 @@
this.setChart(this.$refs.echarts_list,'list');
this.setChart(this.$refs.echarts_list_sex,'sex');
this.getEchartsData();
var that=this;
layList.laydate.render({
elem:this.$refs.date_time,
trigger:'click',
eventElem:this.$refs.time,
range:true,
change:function (value) {
that.data=value;
}
});
}
})

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}
@ -71,6 +119,26 @@
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">分销商数量饼状图</div>
<div class="layui-card-body layui-row">
<div class="layui-col-md12">
<div class="layui-btn-container" ref="echarts_fenxiao" style="height:400px"></div>
</div>
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">多次购物会员数量饼状图</div>
<div class="layui-card-body layui-row">
<div class="layui-col-md12">
<div class="layui-btn-container" ref="echarts_shop" style="height:400px"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
@ -118,6 +186,10 @@
var option=that.setoption(rem.data.seriesdata,rem.data.xdata,rem.data.Zoom);
console.log(option);
that.myChart.list.setOption(option);
var fenxiao=that.setoption(rem.data.fenbu_data,rem.data.fenbu_xdata,'','分销商分布','pic');
that.myChart.fenxiao.setOption(fenxiao);
var shop=that.setoption(rem.data.shop_data,rem.data.shop_xdata,'','购物会员分布','pic');
that.myChart.shop.setOption(shop);
});
},
setoption:function(seriesdata,xdata,Zoom,title,type){
@ -187,6 +259,8 @@
},
mounted:function () {
this.setChart(this.$refs.echarts_list,'list');
this.setChart(this.$refs.echarts_fenxiao,'fenxiao');
this.setChart(this.$refs.echarts_shop,'shop');
this.getBadgeList();
this.getUserChart();
var that=this;

View File

@ -1,5 +1,53 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.layui-input-block button{
border: 1px solid rgba(0,0,0,0.1);
}
.layui-card-body{
padding-left: 10px;
padding-right: 10px;
}
.layui-card-body p.layuiadmin-big-font {
font-size: 36px;
color: #666;
line-height: 36px;
padding: 5px 0 10px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.layuiadmin-badge, .layuiadmin-btn-group, .layuiadmin-span-color {
position: absolute;
right: 15px;
}
.layuiadmin-badge {
top: 50%;
margin-top: -9px;
color: #01AAED;
}
.layuiadmin-span-color i {
padding-left: 5px;
}
.block-rigit{
text-align: right;
}
.block-rigit button{
width: 100px;
letter-spacing: .5em;
line-height: 28px;
}
.layuiadmin-card-list{
padding: 1.6px;
}
.layuiadmin-card-list p.layuiadmin-normal-font {
padding-bottom: 10px;
font-size: 20px;
color: #666;
line-height: 24px;
}
</style>
<script src="{__PLUG_PATH}echarts.common.min.js"></script>
{/block}
{block name="content"}

View File

@ -1,4 +1,5 @@
<!DOCTYPE html>
<!--suppress JSAnnotator -->
<html lang="zh-CN">
<head>
{include file="public/head"}

View File

@ -12,6 +12,23 @@
<div class="ibox-content">
<div class="row">
<div class="m-b m-l">
<?php /* <form action="" class="form-inline">
<i class="fa fa-search" style="margin-right: 10px;"></i>
<select name="is_show" aria-controls="editable" class="form-control input-sm">
<option value="">是否显示</option>
<option value="1" {eq name="params.is_show" value="1"}selected="selected"{/eq}>显示</option>
<option value="0" {eq name="params.is_show" value="0"}selected="selected"{/eq}>不显示</option>
</select>
<select name="access" aria-controls="editable" class="form-control input-sm">
<option value="">子管理员是否可用</option>
<option value="1" {eq name="params.access" value="1"}selected="selected"{/eq}>可用</option>
<option value="0" {eq name="params.access" value="0"}selected="selected"{/eq}>不可用</option>
</select>
<div class="input-group">
<input type="text" name="keyword" value="{$params.keyword}" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form> */ ?>
<form action="" class="form-inline">
<select name="status" aria-controls="editable" class="form-control input-sm">

View File

@ -197,7 +197,7 @@
},
methods: {
getAttrPic(index){
this.createFrame('选择图片','{:Url('widget.images/index')}?fodder='+index);
this.createFrame('选择图片','/admin/widget.images/index/fodder/'+index+'.html');
},
createFrame:function(title,src,opt){
opt === undefined && (opt = {});

View File

@ -340,8 +340,8 @@
});
$('.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')
dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary')
.siblings().addClass('btn-outline btn-link').removeClass('btn-primary')
});
$(".btn").mouseover(function (event){
$(this).closest('table').find("tr:eq(1)").find("td:eq(3)").find("button:eq(0)").removeClass('btn-info');

View File

@ -1,201 +1,304 @@
{extend name="public/container"}
{block name="head_top"}
<style>
.message-content .media-body {margin-bottom: 60px;}
.layadmin-homepage-list-imgtxt .media-body {width: auto;display: block;overflow: hidden;}
.layadmin-message-fluid .layui-col-md12 {background: #fff;height: auto;padding-bottom: 50px;}
.message-content {padding: 0 40px;}
.message-content .media-left {float: left;margin-right: 10px;}
.message-content .media-body{margin-top:10px;}
.message-content .media-body .pad-btm {padding-bottom: 0;}
.message-content .media-left img {border-radius: 50%;}
.layadmin-homepage-list-imgtxt .media-body .pad-btm p:first-child {padding-bottom: 5px;}
.layadmin-homepage-list-imgtxt .media-body .pad-btm .fontColor a {font-weight: 600;color: #337ab7;}
.layadmin-homepage-list-imgtxt .media-body .min-font {margin-bottom: 10px;}
.layui-breadcrumb {visibility: hidden;font-size: 0;}
.layadmin-homepage-list-imgtxt .media-body .min-font .layui-breadcrumb a {font-size: 11px;}
.layui-breadcrumb a {color: #999!important;}
.media-body .message-text {padding-top: 10px;padding-bottom: 10px;border-bottom: 1px solid #e0e0e0;}
.media-body .message-text .image-box{margin-top: 10px;}
.media-body .message-text .image-box img{max-width: 300px;max-height: 200px;margin-right: 10px;margin-bottom: 10px}
.message-content-btn {text-align: center;padding: 10px 0;}
.media-body .message-but{margin-top: 10px;}
.message-content .message-content-btn .layui-btn {height: auto;line-height: 26px;padding: 5px 30px;font-size: 16px;}
.message-content .homepage-bottom .layadmin-privateletterlist-item .meida-left img{width: 151px;height: 81px;}
.message-content .homepage-bottom .layadmin-privateletterlist-item{border: 1px solid #e0e0e0;margin-bottom: 10px;cursor:pointer;}
.message-content .homepage-bottom .layadmin-privateletterlist-item .meida-right{padding: 10px;}
.message-content .homepage-bottom .layadmin-privateletterlist-item.on{border: 1px solid #0092DC!important;}
.message-content .homepage-bottom .layadmin-privateletterlist-item .meida-right .meida-store_name{font-size: 20px;}
.message-content .homepage-bottom .layadmin-privateletterlist-item .centent{text-align: center;}
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.message-content .homepage-bottom .producr-load{text-align: center;margin-bottom: 10px}
.message-content .homepage-bottom .producr-load .layui-btn{margin-bottom: 10px}
</style>
<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="m-b m-l">
<form action="" class="form-inline">
<select name="is_reply" aria-controls="editable" class="form-control input-sm">
<option value="">评论状态</option>
<option value="0" {eq name="where.is_reply" value="0"}selected="selected"{/eq}>未回复</option>
<!-- <option value="1" {eq name="where.is_reply" value="1"}selected="selected"{/eq}>客户已评价且管理员未回复</option>-->
<option value="2" {eq name="where.is_reply" value="2"}selected="selected"{/eq}>已回复</option>
</select>
<div class="input-group">
<input type="text" name="comment" value="{$where.comment}" placeholder="请输入评论内容" class="input-sm form-control" size="38"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form>
</div>
</div>
<div class="ibox">
{volist name="list" id="vo"}
<div class="col-sm-12">
<div class="social-feed-box">
<div class="pull-right social-action dropdown">
<button data-toggle="dropdown" class="dropdown-toggle btn-white" aria-expanded="false">
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu m-t-xs">
{if condition="$vo['is_reply'] eq 2"}
<li><a href="#" class="reply_update" data-url="{:Url('set_reply')}" data-content="{$vo['merchant_reply_content']}" data-id="{$vo['id']}">编辑</a></li>
{else/}
<li><a href="#" class="reply" data-url="{:Url('set_reply')}" data-id="{$vo['id']}">回复</a></li>
{/if}
<li><a href="#" class="delete" data-url="{:Url('delete',array('id'=>$vo['id']))}">删除</a></li>
</ul>
</div>
<div class="social-avatar">
<a href="" class="pull-left">
<img alt="image" src="{$vo.headimgurl}">
</a>
<div class="media-body">
<a href="#">
{$vo.nickname}
</a>
<small class="text-muted">{$vo.add_time|date='Y-m-d H:i:s',###} 来自产品: {$vo.store_name}</small>
<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">
<input type="text" name="title" class="layui-input">
</div>
</div>
<div class="social-body">
<p>{$vo.comment}
<?php $image = json_decode($vo['pics'],true);?>
{if condition="$image"}
{volist name="image" id="v"}
<img src="{$v}" alt="{$vo.store_name}" class="open_image" data-image="{$v}" style="width: 50px;height: 50px;cursor: pointer;">
{/volist}
{else/}
[无图]
{/if}
</p>
<div class="layui-inline">
<label class="layui-form-label">筛选类型</label>
<div class="layui-input-block">
<select name="is_reply">
<option value="">全部</option>
<option value="2">已回复</option>
<option value="0">未回复</option>
</select>
</div>
</div>
{if condition="$vo['merchant_reply_content']"}
<div class="social-footer">
<div class="social-comment">
<div class="media-body">回复时间:<small class="text-muted">{$vo.merchant_reply_time|date='Y-m-d H:i:s',###}</small></div>
<div class="media-body">
<p>{$vo['merchant_reply_content']}</p>
<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 class="message-box" id="app" v-cloak="">
<div class="layui-col-md3" style="padding: 0 10px 0 0">
<div class="layui-card">
<div class="layui-card-header">评论产品</div>
<div class="layui-card-body layadmin-homepage-list-imgtxt message-content" ref="producr">
<div class="grid-demo">
<div class="layui-card homepage-bottom">
<div class="layui-card-body clearfix">
<div class="layadmin-privateletterlist-item" :class="where.producr_id==0 ? 'on':'' " @click="where.producr_id=0">
<div class="meida-right centent">
<mdall class="meida-store_name">全部评论商品</mdall>
</div>
</div>
<div class="layadmin-privateletterlist-item layui-col-md6 layui-col-xs6 layui-col-lg6" :class="where.producr_id==item.id ? 'on':'' " v-for="item in productImaesList" @click="where.producr_id=item.id">
<div class="meida-left">
<img :src="item.image" @click="lockImage(item.image)">
</div>
<div class="meida-right">
<p>{{item.price}}</p>
<mdall v-text="item.store_name"></mdall>
</div>
</div>
</div>
<div class="layui-row producr-load clearfix">
<a href="javascript:;" class="layui-btn" v-text="product.loadTitle" @click="loadList(0)">更多</a>
</div>
</div>
{/if}
</div>
</div>
{/volist}
</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="">
{volist name="list" id="vo"}
<tr>
<td class="text-center">
{$vo.id}
</td>
<td class="text-center">
{$vo.store_name}
</td>
<td class="text-center">
{$vo.nickname}
</td>
<td class="text-center">
{$vo.comment}
</td>
<td class="text-center">
<?php /*$image = json_decode($vo['pics'],true);*/?>
{if condition="$image"}
{volist name="image" id="v"}
<img src="{$v}" alt="{$vo.store_name}" class="open_image" data-image="{$v}" style="width: 50px;height: 50px;cursor: pointer;">
{/volist}
{else/}
无图
{/if}
</td>
<td class="text-center">
{$vo.add_time|date='Y-m-d H:i:s',###}
</td>
<td class="text-center">
{if condition="$vo['merchant_reply_content']"}
{$vo['merchant_reply_content']}
<br/>
{$vo.merchant_reply_time|date='Y-m-d H:i:s',###}
{elseif condition="$vo['comment']"/}
<button class="reply btn btn-primary btn-xs" data-url="{:Url('set_reply')}" data-id="{$vo['id']}" type="button"><i class="fa fa-eyedropper"></i> 回复
</button>
{else/}
未评论
{/if}
</td>
<td class="text-center">
{if condition="$vo['is_reply'] eq 2"}
<button class="reply_update btn btn-info btn-xs" data-url="{:Url('edit_reply')}" data-content="{$vo['merchant_reply_content']}" data-id="{$vo['id']}" type="button"><i class="fa fa-paste"></i> 修改
</button>
{/if}
<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 class="layui-col-md9">
<div class="layui-card">
<div class="layui-card-header">评论列表</div>
<div class="layui-card-body layadmin-homepage-list-imgtxt message-content">
<div class="media-body" v-for="(item,index) in messageList">
<a href="javascript:;" class="media-left" style="float: left;">
<img :src="item.avatar" height="46px" width="46px">
</a>
<div class="pad-btm">
<p class="fontColor"><a href="javascript:;" v-text="item.nickname"></a></p>
<p class="min-font">
<span class="layui-breadcrumb" style="visibility: visible;">
<a href="javascript:;" v-text="item.time"></a>
</span>
</p>
</div>
<div class="message-text">
<p v-text="item.comment"></p>
<div class="image-box" v-if="item.pics.length">
<img :src="pic" alt="" v-for="pic in item.pics" @click="lockImage(pic)">
</div>
</div>
<div class="message-but">
<div class="layui-btn-group">
<button class="layui-btn layui-btn-normal layui-btn-sm" @click="edit(item,index)">{{item.merchant_reply_time ? "编辑":"回复"}}</button>
<button class="layui-btn layui-btn-danger layui-btn-sm" @click="delReply(item,index)">删除</button>
</div>
</div>
<fieldset class="layui-elem-field" style="margin-top: 10px" v-if="item.merchant_reply_time">
<legend style="font-size: 15px">回复</legend>
<div class="layui-field-box" v-text="item.merchant_reply_content"></div>
</fieldset>
</div>
<div class="layui-row message-content-btn">
<div id="message"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
{/block}
{block name="script"}
<script>
$('.delete').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);
})
$('.reply').on('click',function(){
window.t = $(this);
var _this = $(this),url =_this.data('url'),rid =_this.data('id');
$eb.$alert('textarea',{'title':'请输入回复内容','value':''},function(result){
$eb.axios.post(url,{content:result,id:rid}).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.swal(res.data.msg);
}else
$eb.swal(res.data.msg);
});
})
});
$('.reply_update').on('click',function (e) {
window.t = $(this);
var _this = $(this),url =_this.data('url'),rid =_this.data('id'),content =_this.data('content');
$eb.$alert('textarea',{'title':'请输入回复内容','value':content},function(result){
$eb.axios.post(url,{content:result,id:rid}).then(function(res){
if(res.status == 200 && res.data.code == 200) {
$eb.swal(res.data.msg);
}else{
$eb.swal(res.data.msg);
<script type="text/javascript">
require(['vue'],function(Vue) {
new Vue({
el: "#app",
data: {
productImaesList:[],
where:{
page:1,
title:'',
is_reply:'',
limit:10,
producr_id:0,
message_page:1,
},
product:{
loading:false,
loadend:false,
loadTitle:'加载更多',
},
messageList:[],
message:{
loading:false,
loadend:false,
loadTitle:'加载更多',
},
count:0,
},
watch:{
'where.producr_id':function (n) {
this.message.loadend=false;
this.where.message_page=1;
this.$set(this,'messageList',[]);
this.getMessageList();
},
'where.message_page':function () {
this.getMessageList(true);
}
});
},
methods:{
delReply:function(item,index){
var url = layList.U({a:'delete',p:{id:item.id}}),that=this;
$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);
that.messageList.splice(index,1);
that.$set(that,'messageList',that.messageList);
}else
return Promise.reject(res.data.msg || '删除失败')
}).catch(function(err){
$eb.$swal('error',err);
});
})
},
edit:function(item,index){
var url=layList.U({a:'set_reply'}),rid=item.id;
$eb.$alert('textarea',{'title':'请输入回复内容','value':item.merchant_reply_content},function(result){
$eb.axios.post(url,{content:result,id:rid}).then(function(res){
if(res.status == 200 && res.data.code == 200) {
item.merchant_reply_time=1;
item.merchant_reply_content=result;
$eb.swal(res.data.msg);
}else
$eb.swal(res.data.msg);
});
})
},
loadList:function(){
this.getProductImaesList();
},
lockImage:function(href){
return layList.layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
content: '<img src="'+href+'" style="display: block;width: 100%;" />'
});
},
getProductImaesList:function () {
var that=this;
if(that.product.loading) return;
if(that.product.loadend) return;
that.product.loadTitle='加载中';
layList.baseGet(layList.U({a:'get_product_imaes_list',q:that.where}),function (res) {
var list=res.data;
var loadend=list.length < that.where.limit;
that.where.page=that.where.page+1;
that.product.loading=false;
that.product.loadend=loadend;
that.product.loadTitle=loadend ? '已全部加载' : '加载更多';
that.productImaesList.push.apply(that.productImaesList,list);
that.$set(that,'productImaesList',that.productImaesList);
that.slitherMonitor();
},function (res) {
that.product.loading=false;
that.product.loadTitle='加载更多';
});
},
getMessageList:function (isFa) {
var that=this;
if(that.message.loading) return;
if(that.message.loadend) return;
that.message.loadTitle='加载中';
var index=layList.layer.load(1, {shade: [0.1,'#fff'] });
layList.baseGet(layList.U({a:'get_product_reply_list',q:that.where}),function (res) {
var list=res.data.list;
var loadend=list.length < that.where.limit;
that.message.loading=false;
that.message.loadend=loadend;
that.count=res.data.count;
that.message.loadTitle=loadend ? '已全部加载' : '加载更多';
that.$set(that,'messageList',list);
layList.layer.close(index);
isFa || that.initPage();
},function (res) {
that.message.loading=false;
that.message.loadTitle='加载更多';
layList.layer.close(index);
});
},
slitherMonitor:function () {
var clientHeight=document.documentElement.clientHeight;
if(this.$refs.producr.offsetHeight >= clientHeight) this.$refs.producr.style.overflowX='scroll';
else this.$refs.producr.style.overflow='hidden';
},
initPage:function () {
var that=this;
layList.laypage.render({
elem: 'message'
,count: that.count
,limit:10
,jump: function(obj){
that.where.message_page=obj.curr;
}
});
}
},
mounted:function () {
layList.form.render();
this.getProductImaesList();
this.getMessageList();
//查询
var that=this;
layList.search('search',function(where){
if(that.where.title==where.title && that.where.is_reply==where.is_reply) return false;
that.where.title=where.title;
that.where.is_reply=where.is_reply;
that.where.message_page=1;
that.message.loadend=false;
that.getMessageList();
});
}
})
});
})
</script>
{/block}

View File

@ -77,9 +77,7 @@
reiframesize();//设置编辑框的尺寸
$("#savefile").click(function(){
$.post("{:Url('savefile')}",{comment:editor.getValue(),filepath:'{$filepath}'},function (res) {
if(res.code == 200) {
$eb.message('success',res.msg);
}
$eb.message('success',res.msg);
},'json');
});
$("#undo").click(function(){

View File

@ -0,0 +1,93 @@
{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">
<div class="input-group">
<input type="text" name="key" value="" 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>
</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.type}
</td>
<td class="text-center">
{$vo.template}
</td>
<td class="text-center">
{$vo.push_admin_name}
</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">
<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>
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script>
$('.btn-warning').on('click',function(){
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);
});
})
});
</script>
{/block}

View File

@ -0,0 +1,225 @@
{extend name="public/container"}
{block name="head_top"}
<link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
{/block}
{block name="content"}
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-12 animated fadeInRight">
<div class="mail-box-header">
<form method="get" action="index.html" class="pull-right mail-search">
<div class="input-group">
<input type="text" class="form-control input-sm" name="search" placeholder="搜索邮件标题,正文等">
<div class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary">
搜索
</button>
</div>
</div>
</form>
<h2>
收件箱 (16)
</h2>
<div class="mail-tools tooltip-demo m-t-md">
<div class="btn-group pull-right">
<button class="btn btn-white btn-sm"><i class="fa fa-arrow-left"></i>
</button>
<button class="btn btn-white btn-sm"><i class="fa fa-arrow-right"></i>
</button>
</div>
<button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="left" title="刷新邮件列表"><i class="fa fa-refresh"></i> 刷新</button>
<button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="标为已读"><i class="fa fa-eye"></i>
</button>
<button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="标为重要"><i class="fa fa-exclamation"></i>
</button>
<button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="标为垃圾邮件"><i class="fa fa-trash-o"></i>
</button>
</div>
</div>
<div class="mail-box">
<table class="table table-hover table-mail">
<tbody>
<tr class="unread">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">支付宝</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">支付宝提醒</a>
</td>
<td class=""><i class="fa fa-paperclip"></i>
</td>
<td class="text-right mail-date">昨天 10:20</td>
</tr>
<tr class="unread">
<td class="check-mail">
<input type="checkbox" class="i-checks" checked>
</td>
<td class="mail-ontact"><a href="mail_detail.html">Amaze UI</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">Amaze UI Beta2 发布</a>
</td>
<td class=""></td>
<td class="text-right mail-date">上午10:57</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">WordPress</a> <span class="label label-warning pull-right">验证邮件</span>
</td>
<td class="mail-subject"><a href="mail_detail.html">wp-user-frontend-pro v2.1.9</a>
</td>
<td class=""></td>
<td class="text-right mail-date">上午9:21</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">淘宝网</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">史上最全淘宝双11红包疯抢攻略</a>
</td>
<td class=""></td>
<td class="text-right mail-date">中午12:24</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">淘宝网</a> <span class="label label-danger pull-right">AD</span>
</td>
<td class="mail-subject"><a href="mail_detail.html">双11来啦帮你挑货还送你4999元红包仅此一次</a>
</td>
<td class=""><i class="fa fa-paperclip"></i>
</td>
<td class="text-right mail-date">上午6:48</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">支付宝</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">支付宝提醒</a>
</td>
<td class=""><i class="fa fa-paperclip"></i>
</td>
<td class="text-right mail-date">昨天 10:20</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">Amaze UI</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">Amaze UI Beta2 发布</a>
</td>
<td class=""></td>
<td class="text-right mail-date">上午10:57</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">WordPress</a> <span class="label label-warning pull-right">验证邮件</span>
</td>
<td class="mail-subject"><a href="mail_detail.html">wp-user-frontend-pro v2.1.9</a>
</td>
<td class=""></td>
<td class="text-right mail-date">上午9:21</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">淘宝网</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">史上最全淘宝双11红包疯抢攻略</a>
</td>
<td class=""></td>
<td class="text-right mail-date">中午12:24</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">淘宝网</a> <span class="label label-danger pull-right">AD</span>
</td>
<td class="mail-subject"><a href="mail_detail.html">双11来啦帮你挑货还送你4999元红包仅此一次</a>
</td>
<td class=""><i class="fa fa-paperclip"></i>
</td>
<td class="text-right mail-date">上午6:48</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">支付宝</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">支付宝提醒</a>
</td>
<td class=""><i class="fa fa-paperclip"></i>
</td>
<td class="text-right mail-date">昨天 10:20</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">Amaze UI</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">Amaze UI Beta2 发布</a>
</td>
<td class=""></td>
<td class="text-right mail-date">上午10:57</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">WordPress</a> <span class="label label-warning pull-right">验证邮件</span>
</td>
<td class="mail-subject"><a href="mail_detail.html">wp-user-frontend-pro v2.1.9</a>
</td>
<td class=""></td>
<td class="text-right mail-date">上午9:21</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">淘宝网</a>
</td>
<td class="mail-subject"><a href="mail_detail.html">史上最全淘宝双11红包疯抢攻略</a>
</td>
<td class=""></td>
<td class="text-right mail-date">中午12:24</td>
</tr>
<tr class="read">
<td class="check-mail">
<input type="checkbox" class="i-checks">
</td>
<td class="mail-ontact"><a href="mail_detail.html">淘宝网</a> <span class="label label-danger pull-right">AD</span>
</td>
<td class="mail-subject"><a href="mail_detail.html">双11来啦帮你挑货还送你4999元红包仅此一次</a>
</td>
<td class=""><i class="fa fa-paperclip"></i>
</td>
<td class="text-right mail-date">上午6:48</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
{/block}

View File

@ -2,23 +2,18 @@
{block name="content"}
<style>
.code{
color: #97824B;
font-size: 3em;
border: 2px solid #ccc;
padding: 10px;
width: 50%;
color: #298dff;
font-size: 1.4em;
border: 1px solid #298dff;
padding: 20px 10px;
width: 30%;
margin: 0 auto;
font-weight: 700;
font-family: 'Raleway', sans-serif;
visibility: visible;
animation-duration: 1000ms;
animation-delay: 500ms;
text-align: center;
-webkit-box-shadow:0 0 10px #000;
-moz-box-shadow:0 0 10px #000;
box-shadow:0 0 10px #000;
cursor: pointer;
border-radius: 2%;
border-radius: .3em;
}
.colore{
background-color: #CCCCCC;
@ -154,14 +149,11 @@
auto_upgrad:function () {
var that=this;
if(this.count<=0) return;
that.content='正在升级中请勿关闭浏览器或者页面';
axios.post("{:Url('auto_upgrad')}",{id:this.version_code}).then(function (rem) {
if(rem.data.code==200){
if(rem.data.code=200){
that.version_code=rem.data.data.code;
that.version=rem.data.data.version;
that.count=0;
}else{
that.content=rem.data.msg;
}
})
},

View File

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

View File

@ -0,0 +1,371 @@
<!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>&nbsp;&nbsp;<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>&nbsp;&nbsp;<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

@ -0,0 +1,76 @@
{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="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.id}
</td>
<td class="text-center">
{$vo.role_name}
</td>
<td class="text-center" style="width: 70%;">
{$vo.rules}
</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">
<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>
</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);
});
})
});
</script>
{/block}

View File

@ -53,10 +53,10 @@
</div>
</div>
<div class="ibox-content" style="display: block;">
<div class="alert alert-success alert-dismissable">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
目前拥有{$count_user}个会员
</div>
<!-- <div class="alert alert-success alert-dismissable">-->
<!-- <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>-->
<!-- 目前拥有{$count_user}个会员-->
<!-- </div>-->
<form class="layui-form">
<div class="layui-form-item">
<div class="layui-inline">
@ -191,11 +191,12 @@
<button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="set_info"><i class="fa fa-check-circle-o"></i>发送站内消息</button>
<button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="refresh"><i class="layui-icon layui-icon-refresh" ></i>刷新</button>
</div>
<table class="layui-hide" id="userList" lay-filter="userList">
</table>
<script type="text/html" id="user_type">
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">{{d.user_type}}</button>
<table class="layui-hide" id="userList" lay-filter="userList"></table>
<script type="text/html" id="nickname">
{{d.nickname}}
{{# if(d.vip_name){ }}
<p style="color:#dab176">{{d.vip_name}}</p>
{{# } }}
</script>
<script type="text/html" id="checkboxstatus">
<input type='checkbox' name='status' lay-skin='switch' value="{{d.uid}}" lay-filter='status' lay-text='正常|禁止' {{ d.status == 1 ? 'checked' : '' }}>
@ -255,7 +256,7 @@
{type:'checkbox'},
{field: 'uid', title: '编号', width:'6%',event:'uid'},
{field: 'avatar', title: '头像', event:'open_image', width: '6%', templet: '<p><img class="avatar" style="cursor: pointer" class="open_image" data-image="{{d.avatar}}" src="{{d.avatar}}" alt="{{d.nickname}}"></p>'},
{field: 'nickname', title: '姓名'},
{field: 'nickname', title: '姓名',templet:'#nickname'},
{field: 'now_money', title: '余额',width:'6%',sort:true,event:'now_money'},
{field: 'pay_count', title: '购买次数',align:'center',width:'6%'},
{field: 'extract_count_price', title: '累计提现',align:'center',width:'6%'},
@ -265,7 +266,7 @@
{field: 'add_time', title: '首次访问日期',align:'center',width:'12%'},
{field: 'last_time', title: '最近访问日期',align:'center',width:'12%'},
{field: 'status', title: '状态',templet:"#checkboxstatus",width:'6%'},
{field: 'user_type', title: '用户类型',templet:'#user_type',width:'6%'},
{field: 'user_type', title: '用户类型',width:'6%'},
{fixed: 'right', title: '操作', width: '10%', align: 'center', toolbar: '#barDemo'}
];
});
@ -319,7 +320,7 @@
layList.search('search',function(where){
if(where['user_time_type'] != '' && where['user_time'] == '') return layList.msg('请选择选择时间');
if(where['user_time_type'] == '' && where['user_time'] != '') return layList.msg('请选择访问情况');
layList.reload(where);
layList.reload(where,true);
});
var action={

View File

@ -0,0 +1,76 @@
{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="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.id}
</td>
<td class="text-center">
{$vo.role_name}
</td>
<td class="text-center" style="width: 70%;">
{$vo.rules}
</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">
<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>
</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);
});
})
});
</script>
{/block}

View File

@ -0,0 +1,203 @@
{extend name="public/container"}
{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">
<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">
<input type="text" name="title" 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 class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">分类列表</div>
<div class="layui-card-body">
<div class="layui-btn-container">
<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="icon">
<img style="cursor: pointer" lay-event='open_image' src="{{d.icon}}">
</script>
<script type="text/html" id="is_forever">
<input type='checkbox' name='id' disabled lay-skin='switch' value="{{d.id}}" lay-filter='is_forever' lay-text='永久|非永久' {{ d.is_forever == 1 ? 'checked' : '' }}>
</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="is_pay">
<input type='checkbox' name='id' disabled lay-skin='switch' value="{{d.id}}" lay-filter='is_pay' lay-text='付费|免费' {{ d.is_pay == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="act">
<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">
<li>
<a href="javascript:void(0)" onclick="$eb.createModalFrame(this.innerText,'{:Url(\'tash\')}?level_id={{d.id}}',{w:1000})">
<i class="fa fa-paste"></i> 等级任务
</a>
</li>
<li>
<a href="javascript:void(0)" onclick="$eb.createModalFrame(this.innerText,'{:Url(\'create\')}?id={{d.id}}')">
<i class="fa fa-paste"></i> 编辑等级
</a>
</li>
<li>
<a lay-event='delect' href="javascript:void(0)" >
<i class="fa fa-paste"></i> 删除等级
</a>
</li>
</ul>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
{/block}
{block name="script"}
<script>
//实例化form
layList.form.render();
//加载列表
layList.tableList('List',"{:Url('get_system_vip_list')}",function (){
return [
{field: 'id', title: '编号', sort: true,event:'id'},
{field: 'icon', title: '等级图标',templet:'#icon'},
{field: 'name', title: '等级名称',edit:'name'},
{field: 'grade', title: '等级',edit:'grade'},
{field: 'discount', title: '享受折扣',edit:'discount'},
{field: 'valid_date', title: '有效时间'},
{field: 'is_forever', title: '是否永久',templet:'#is_forever',width:'8%'},
{field: 'is_pay', title: '是否付费',templet:'#is_pay',width:'6%'},
{field: 'is_show', title: '是否显示',templet:'#is_show',width:'6%'},
{field: 'explain', title: '等级说明',width:'10%'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'5%'},
];
});
//自定义方法
var action= {
set_value: function (field, id, value) {
layList.baseGet(layList.Url({
a: 'set_value',
q: {field: field, id: id, value: value}
}), function (res) {
layList.msg(res.msg);
});
},
}
//查询
layList.search('search',function(where){
layList.reload(where,true);
});
layList.switch('is_show',function (odj,value) {
if(odj.elem.checked==true){
layList.baseGet(layList.Url({a:'set_show',p:{is_show:1,id:value}}),function (res) {
layList.msg(res.msg);
});
}else{
layList.baseGet(layList.Url({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 'name':
action.set_value('name',id,value);
break;
case 'grade':
action.set_value('grade',id,value);
break;
case 'discount':
action.set_value('discount',id,value);
break;
}
});
//监听并执行排序
layList.sort(['id','sort'],true);
//点击事件绑定
layList.tool(function (event,data,obj) {
switch (event) {
case 'delete':
var url=layList.U({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.icon);
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

@ -0,0 +1,168 @@
{extend name="public/container"}
{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">
<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">
<input type="text" name="title" 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 class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">任务列表</div>
<div class="layui-card-body">
<div class="alert alert-info" role="alert">
添加等级任务,任务类型中的{literal}{$num}{/literal}会自动替换成限定数量+系统预设的单位生成任务名
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create_tash',['level_id'=>$level_id])}')">添加会员任务</button>
<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="window.location.reload()"><i class="layui-icon layui-icon-refresh"></i> 刷新</button>
</div>
<table class="layui-hide" id="List" lay-filter="List"></table>
<script type="text/html" id="image">
<img style="cursor: pointer" lay-event='open_image' src="{{d.image}}">
</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="is_must">
<input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_must' lay-text='全部完成|达成其一' {{ d.is_must == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="act">
<button class="layui-btn layui-btn-xs" onclick="$eb.createModalFrame('编辑','{:Url('create_tash',['level_id'=>$level_id])}?id={{d.id}}')">
<i class="fa fa-paste"></i> 编辑
</button>
<button class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete'>
<i class="fa fa-warning"></i> 删除
</button>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
{/block}
{block name="script"}
<script>
//实例化form
layList.form.render();
//加载列表
layList.tableList('List',"{:Url('get_tash_list',['level_id'=>$level_id])}",function (){
return [
{field: 'id', title: '编号', sort: true,event:'id'},
{field: 'level_name', title: '等级名称',},
{field: 'name', title: '任务名称',},
{field: 'sort', title: '排序',sort: true,event:'sort',edit:'sort',width:'7%'},
{field: 'is_show', title: '是否显示',templet:'#is_show',width:'10%'},
{field: 'is_must', title: '务必达成',templet:'#is_must',width:'15%'},
{field: 'illustrate', title: '任务说明'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'13%'},
];
});
//自定义方法
var action= {
set_value: function (field, id, value) {
layList.baseGet(layList.Url({
a: 'set_tash_value',
q: {field: field, id: id, value: value}
}), function (res) {
layList.msg(res.msg);
});
},
}
//查询
layList.search('search',function(where){
layList.reload(where,true);
});
layList.switch('is_show',function (odj,value) {
if(odj.elem.checked==true){
layList.baseGet(layList.Url({a:'set_tash_show',p:{is_show:1,id:value}}),function (res) {
layList.msg(res.msg);
});
}else{
layList.baseGet(layList.Url({a:'set_tash_show',p:{is_show:0,id:value}}),function (res) {
layList.msg(res.msg);
});
}
});
layList.switch('is_must',function (odj,value) {
if(odj.elem.checked==true){
layList.baseGet(layList.Url({a:'set_tash_must',p:{is_must:1,id:value}}),function (res) {
layList.msg(res.msg);
});
}else{
layList.baseGet(layList.Url({a:'set_tash_must',p:{is_must: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 'title':
action.set_value('title',id,value);
break;
case 'sort':
action.set_value('sort',id,value);
break;
}
});
//监听并执行排序
layList.sort(['id','sort'],true);
//点击事件绑定
layList.tool(function (event,data,obj) {
switch (event) {
case 'delete':
var url=layList.U({a:'delete_tash',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.image);
break;
}
})
</script>
{/block}

View File

@ -0,0 +1,161 @@
{extend name="public/container"}
{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">
<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">
<input type="text" name="title" 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 class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">会员等级列表</div>
<div class="layui-card-body">
<table class="layui-hide" id="List" lay-filter="List"></table>
<script type="text/html" id="is_forever">
<input type='checkbox' name='id' disabled lay-skin='switch' value="{{d.id}}" lay-filter='is_forever' lay-text='永久|非永久' {{ d.is_forever == 1 ? 'checked' : '' }}>
</script>
<script type="text/html" id="act">
<button class="layui-btn layui-btn-sm"><i class="fa fa-paste"></i> 删除等级</button>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
{/block}
{block name="script"}
<script>
//实例化form
layList.form.render();
//加载列表
layList.tableList('List',"{:Url('get_user_vip_list')}",function (){
return [
{field: 'id', title: '编号', sort: true,event:'id'},
{field: 'nickname', title: '用户名'},
{field: 'name', title: '等级名称',edit:'name'},
{field: 'grade', title: '等级',edit:'grade'},
{field: 'discount', title: '享受折扣',edit:'discount'},
{field: 'valid_time', title: '有效时间'},
{field: 'is_forever', title: '是否永久'},
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'8%'},
];
});
//自定义方法
var action= {
set_value: function (field, id, value) {
layList.baseGet(layList.Url({
a: 'set_value',
q: {field: field, id: id, value: value}
}), function (res) {
layList.msg(res.msg);
});
},
}
//查询
layList.search('search',function(where){
layList.reload(where,true);
});
layList.switch('is_show',function (odj,value) {
if(odj.elem.checked==true){
layList.baseGet(layList.Url({a:'set_show',p:{is_show:1,id:value}}),function (res) {
layList.msg(res.msg);
});
}else{
layList.baseGet(layList.Url({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 'name':
action.set_value('name',id,value);
break;
case 'grade':
action.set_value('grade',id,value);
break;
case 'discount':
action.set_value('discount',id,value);
break;
}
});
//监听并执行排序
layList.sort(['id','sort'],true);
//点击事件绑定
layList.tool(function (event,data,obj) {
switch (event) {
case 'delete':
var url=layList.U({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.icon);
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

@ -38,14 +38,14 @@
<div class="menu-content control-body">
<form action="">
<div class="form-group clearfix">
<label for="" class="col-sm-3">菜单名称</label>
<label for="" class="col-sm-2">菜单名称</label>
<div class="col-sm-9 group-item">
<input type="text" placeholder="菜单名称" class="form-control" v-model="checkedMenu.name">
<span>字数不超过13个汉字或40个字母</span>
</div>
</div>
<div class="form-group clearfix">
<label class="col-sm-3 control-label tips" for="">规则状态</label>
<label class="col-sm-2 control-label tips" for="">规则状态</label>
<div class="group-item col-sm-9">
<select class="form-control m-b" name="" id="" v-model="checkedMenu.type">
<?php /* <option value="text">文字消息</option> */ ?>
@ -72,6 +72,12 @@
<div class="url item" :class="{show:checkedMenu.type=='view'}">
<p>跳转地址</p>
<input type="text" v-model="checkedMenu.url" placeholder="请输入跳转地址" class="form-control">
<p class="text-left"></p>
<div class="well well-lg">
<span class="help-block m-b-none">首页:{$Request.domain}{:url('wap/index/index')}</span>
<span class="help-block m-b-none">个人中心:{$Request.domain}{:url('wap/my/index')}</span>
</div>
</div>
<!-- 事件功能 -->
<?php /* <div class="feat-select item" :class="{show:type=='feat'}">

View File

@ -119,11 +119,13 @@
</div>
</div>
</form>
<button type="button" class="btn btn-w-m btn-info" style="width: 100%;" @click="submit">提交保存图文</button>
</div>
</div>
</div>
</div>
<div class="col-sm-8" style="position: fixed;right:44px;bottom: 0;z-index: 999;text-align: right">
<button type="button" class="btn btn-w-m btn-info" style="width: 100%;" @click="submit">提交保存图文</button>
</div>
</div>
{/block}
{block name="script"}

View File

@ -1,21 +1 @@
<!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;
var rules = {$rules};
console.log(rules);
_mpApi = parent._mpApi;
mpFrame.start(function (Vue) {
require(['axios', 'system/util/mpFormBuilder'], function (axios, mpFormBuilder) {
Vue.use(mpFormBuilder, _mpApi, rules, {action: '{$save}'});
new Vue({
el: "#form-add", mounted: function () {
}
})
});
});</script>
</body>
<!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=""> <?php /* <i-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80"> <form-Item label="菜单名称" prop="name"> <i-input v-model="formValidate.name" placeholder="请输入姓名"></i-input> </form-Item> <form-Item label="邮箱" prop="mail"> <i-input v-model="formValidate.mail" placeholder="请输入邮箱"></i-input> </form-Item> <form-Item label="城市" prop="city"> <i-select v-model="formValidate.city" placeholder="请选择所在地"> <i-option value="beijing">北京市</i-option> <i-option value="shanghai">上海市</i-option> <i-option value="shenzhen">深圳市</i-option> </i-select> </form-Item> <Form-Item label="选择日期"> <Row> <i-col span="11"> <form-Item prop="date"> <Date-Picker type="date" placeholder="选择日期" v-model="formValidate.date"></Date-Picker> </form-Item> </i-col> <i-Col span="1" style="text-align: center">-</i-Col> <i-Col span="11"> <form-Item prop="time"> <Time-Picker type="time" placeholder="选择时间" v-model="formValidate.time"></Time-Picker> </form-Item> </i-Col> </Row> </Form-Item> <form-Item label="性别" prop="gender"> <Radio-Group v-model="formValidate.gender"> <Radio label="male">男</Radio> <Radio label="female">女</Radio> </Radio-Group> </form-Item> <form-Item label="爱好" prop="interest"> <Checkbox-Group v-model="formValidate.interest"> <Checkbox label="吃饭"></Checkbox> <Checkbox label="睡觉"></Checkbox> <Checkbox label="跑步"></Checkbox> <Checkbox label="看电影"></Checkbox> </Checkbox-Group> </form-Item> <component :is="componentId" label="介绍" prop="desc"> <component :is="componentIs" v-model="formValidate.desc" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入..."></component> </component> <form-Item label="介绍" prop="desc"> <i-input v-model="formValidate.desc" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入..."></i-input> </form-Item> <form-Item> <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button> </form-Item> </i-form> <m-mycom> </m-mycom> */ ?> <form-builder></form-builder></div><script> var _vm ; var rules = {$rules}; console.log(rules); _mpApi = parent._mpApi; mpFrame.start(function(Vue){ require(['axios','system/util/mpFormBuilder'],function(axios,mpFormBuilder){ Vue.use(mpFormBuilder,_mpApi,rules,{ action:'{$save}' }); new Vue({ el:"#form-add", mounted:function(){ } }) }); });</script></body>

View File

@ -1,20 +1 @@
<!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) {
axios.post('{$read}').then((result) = > {Vue.use(mpFormBuilder, _mpApi, result.data, {action: '{$update}'});
new Vue({
el: "#form-add", mounted: function () {
}
})
})
});
});</script>
</body>
<!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=""> <?php /* <i-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80"> <form-Item label="菜单名称" prop="name"> <i-input v-model="formValidate.name" placeholder="请输入姓名"></i-input> </form-Item> <form-Item label="邮箱" prop="mail"> <i-input v-model="formValidate.mail" placeholder="请输入邮箱"></i-input> </form-Item> <form-Item label="城市" prop="city"> <i-select v-model="formValidate.city" placeholder="请选择所在地"> <i-option value="beijing">北京市</i-option> <i-option value="shanghai">上海市</i-option> <i-option value="shenzhen">深圳市</i-option> </i-select> </form-Item> <Form-Item label="选择日期"> <Row> <i-col span="11"> <form-Item prop="date"> <Date-Picker type="date" placeholder="选择日期" v-model="formValidate.date"></Date-Picker> </form-Item> </i-col> <i-Col span="1" style="text-align: center">-</i-Col> <i-Col span="11"> <form-Item prop="time"> <Time-Picker type="time" placeholder="选择时间" v-model="formValidate.time"></Time-Picker> </form-Item> </i-Col> </Row> </Form-Item> <form-Item label="性别" prop="gender"> <Radio-Group v-model="formValidate.gender"> <Radio label="male">男</Radio> <Radio label="female">女</Radio> </Radio-Group> </form-Item> <form-Item label="爱好" prop="interest"> <Checkbox-Group v-model="formValidate.interest"> <Checkbox label="吃饭"></Checkbox> <Checkbox label="睡觉"></Checkbox> <Checkbox label="跑步"></Checkbox> <Checkbox label="看电影"></Checkbox> </Checkbox-Group> </form-Item> <component :is="componentId" label="介绍" prop="desc"> <component :is="componentIs" v-model="formValidate.desc" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入..."></component> </component> <form-Item label="介绍" prop="desc"> <i-input v-model="formValidate.desc" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入..."></i-input> </form-Item> <form-Item> <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button> </form-Item> </i-form> <m-mycom> </m-mycom> */ ?> <form-builder></form-builder></div><script> var _vm ; _mpApi = parent._mpApi; mpFrame.start(function(Vue){ require(['axios','system/util/mpFormBuilder'],function(axios,mpFormBuilder){ axios.post('{$read}').then((result)=>{ Vue.use(mpFormBuilder,_mpApi,result.data,{ action:'{$update}' }); new Vue({ el:"#form-add", mounted:function(){ } }) }) }); });</script></body>

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@
}
.form-control{
display: inline-block;
width: 85%;
width: 75%;
}
</style>
</head>
@ -33,7 +33,6 @@
<div class="form-group">
<input type="email" class="form-control" id="search" placeholder="输入关键词搜索:注意全是英文">
<button id="qingkong" class="btn btn-default">清空选择</button>
<!-- <button id="close" class="btn btn-default">关闭</button>-->
</div>
<div>
<h5> v4.3.0新增图标 </h5>
@ -794,11 +793,6 @@
parent.$f.closeModal();
});
// //close
// $('#close').on('click', function () {
// parent.$f.closeModal();
//
// });
//搜索图标
$("#search").on('input',function () {

View File

@ -1,2 +1,2 @@
version=CRMEB-DTKY v2.5.33
version_code=129
version=CRMEB-DTKY v2.6.03
version_code=131