应用优化
parent
51f26f6b7e
commit
1609c48874
|
|
@ -106,29 +106,7 @@ class Plugins extends Common
|
|||
$this->assign('msg', ucfirst($pluginsaction).' 应用方法未定义');
|
||||
return $this->fetch('public/error');
|
||||
}
|
||||
$ret = $obj->$pluginsaction($params);
|
||||
|
||||
// 是否ajax
|
||||
if(IS_AJAX)
|
||||
{
|
||||
return $ret;
|
||||
} else {
|
||||
// 调用应用模板
|
||||
if(isset($ret['code']))
|
||||
{
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign($ret['data']);
|
||||
return $this->fetch('../../../plugins/view/'.$pluginsname.'/'.$pluginscontrol.'/'.$pluginsaction);
|
||||
} else {
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch('public/error');
|
||||
}
|
||||
} else {
|
||||
$this->assign('msg', '应用返回数据格式有误');
|
||||
return $this->fetch('public/error');
|
||||
}
|
||||
}
|
||||
return $obj->$pluginsaction($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -100,29 +100,7 @@ class Plugins extends Common
|
|||
$this->assign('msg', ucfirst($pluginsaction).' 应用方法未定义');
|
||||
return $this->fetch('public/error');
|
||||
}
|
||||
$ret = $obj->$pluginsaction($params);
|
||||
|
||||
// 是否ajax
|
||||
if(IS_AJAX)
|
||||
{
|
||||
return $ret;
|
||||
} else {
|
||||
// 调用应用模板
|
||||
if(isset($ret['code']))
|
||||
{
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign($ret['data']);
|
||||
return $this->fetch('../../../plugins/view/'.$pluginsname.'/'.$pluginscontrol.'/'.$pluginsaction);
|
||||
} else {
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch('public/error');
|
||||
}
|
||||
} else {
|
||||
$this->assign('msg', '应用返回数据格式有误');
|
||||
return $this->fetch('public/error');
|
||||
}
|
||||
}
|
||||
return $obj->$pluginsaction($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commongobacktop;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
|
|
@ -34,13 +35,10 @@ class Admin
|
|||
$ret = PluginsService::PluginsData('commongobacktop', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commongobacktop/admin/index');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,14 +61,11 @@ class Admin
|
|||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
// 数组组装
|
||||
$data = [
|
||||
'is_whether_list' => $is_whether_list,
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commongobacktop/admin/saveinfo');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commongobacktop;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
|
|
@ -132,10 +133,6 @@ class Hook
|
|||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commongobacktop', ['images']);
|
||||
|
||||
// html拼接
|
||||
$html = '<div data-am-smooth-scroll class="am-hide-sm-only">';
|
||||
$content = '';
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 图片是否为空
|
||||
|
|
@ -154,16 +151,11 @@ class Hook
|
|||
}
|
||||
}
|
||||
|
||||
$content = '<div id="plugins-commongobacktop" title="回到顶部">';
|
||||
$content .= '<img src="'.$ret['data']['images'].'" />';
|
||||
$content .= '</div>';
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commongobacktop/index/content');
|
||||
} else {
|
||||
$content = $ret['msg'];
|
||||
return $ret['msg'];
|
||||
}
|
||||
$html .= $content;
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commononlineservice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
|
|
@ -37,13 +38,10 @@ class Admin
|
|||
// 数据处理
|
||||
$ret['data']['online_service'] = str_replace("\n", '<br />', $ret['data']['online_service']);
|
||||
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commononlineservice/admin/index');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,14 +64,11 @@ class Admin
|
|||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
// 数组组装
|
||||
$data = [
|
||||
'is_whether_list' => $is_whether_list,
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commononlineservice/admin/saveinfo');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commononlineservice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
|
|
@ -86,10 +87,6 @@ class Hook
|
|||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commononlineservice', ['images']);
|
||||
|
||||
// html拼接
|
||||
$html = '<div class="commononlineservice"';
|
||||
$content = '';
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 非全局
|
||||
|
|
@ -102,75 +99,42 @@ class Hook
|
|||
}
|
||||
}
|
||||
|
||||
// 距离顶部距离
|
||||
if(isset($ret['data']['distance_top']))
|
||||
{
|
||||
$html .= ' style="top:'.intval($ret['data']['distance_top']).'%"';
|
||||
}
|
||||
|
||||
// li数量
|
||||
$online_service_li_count = 0;
|
||||
|
||||
// 客服
|
||||
$online_service = empty($ret['data']['online_service']) ? [] : explode("\n", $ret['data']['online_service']);
|
||||
$online_service_html = '';
|
||||
$online_service_data = [];
|
||||
if(!empty($online_service))
|
||||
{
|
||||
foreach($online_service as $v)
|
||||
{
|
||||
$items = explode('|', $v);
|
||||
if(!empty($items) && count($items) == 2)
|
||||
if(count($items) == 2)
|
||||
{
|
||||
$online_service_html .= '<li>
|
||||
<span>'.$items[0].'</span>
|
||||
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin='.$items[1].'&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:'.$items[1].':51" alt="点击这里给我发消息" title="点击这里给我发消息"/></a>
|
||||
</li>';
|
||||
$online_service_data[] = $items;
|
||||
$online_service_li_count++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$ret['data']['online_service'] = $online_service_data;
|
||||
|
||||
// 电话
|
||||
$tel_html = '';
|
||||
if(!empty($ret['data']['tel']))
|
||||
{
|
||||
$tel_html .= '<li>
|
||||
<span>电话:'.$ret['data']['tel'].'</span>
|
||||
</li>';
|
||||
$online_service_li_count++;
|
||||
}
|
||||
|
||||
// 背景色
|
||||
$bg_color = empty($ret['data']['bg_color']) ? '' : 'background:'.$ret['data']['bg_color'].';';
|
||||
// li数量
|
||||
$ret['data']['online_service_li_count'] = $online_service_li_count;
|
||||
|
||||
// 内容css
|
||||
$content_css = $bg_color;
|
||||
if($online_service_li_count <= 2)
|
||||
{
|
||||
$content_css .= 'border-radius:0;';
|
||||
}
|
||||
|
||||
// 组装
|
||||
$content = '<div class="float-left" style="'.$bg_color.'">
|
||||
<a class="btn-open" title="查看在线客服" href="javascript:void(0);">展开</a>
|
||||
<a class="btn-ctn" title="关闭在线客服" href="javascript:void(0);">收缩</a>
|
||||
</div>
|
||||
<div class="content" style="'.$content_css.'">
|
||||
<div class="cn">
|
||||
<h3 class="title">'.$ret['data']['title'].'</h3>
|
||||
<ul>'.$online_service_html.$tel_html.'
|
||||
</ul>
|
||||
</div>
|
||||
</div>';
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commononlineservice/index/content');
|
||||
} else {
|
||||
$content = $ret['msg'];
|
||||
return $ret['msg'];
|
||||
}
|
||||
$html .= '>';
|
||||
$html .= $content;
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commonrightnavigation;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
|
|
@ -34,13 +35,10 @@ class Admin
|
|||
$ret = PluginsService::PluginsData('commonrightnavigation', ['alipay_mini_qrcode_images', 'alipay_fuwu_qrcode_images', 'weixin_mini_qrcode_images', 'weixin_fuwu_qrcode_images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commonrightnavigation/admin/index');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,14 +61,11 @@ class Admin
|
|||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
// 数组组装
|
||||
$data = [
|
||||
'is_whether_list' => $is_whether_list,
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commonrightnavigation/admin/saveinfo');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commonrightnavigation;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\service\BuyService;
|
||||
|
||||
|
|
@ -20,7 +21,7 @@ use app\service\BuyService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
|
|
@ -103,116 +104,29 @@ class Hook
|
|||
}
|
||||
}
|
||||
|
||||
// 当前模块/控制器/方法
|
||||
$this->assign('module_controller_action', $module_name.$controller_name.$action_name);
|
||||
|
||||
// 是否新窗口打开
|
||||
$is_new_window_open = (isset($ret['data']['is_new_window_open']) && $ret['data']['is_new_window_open'] == 1) ? 'target="_blank"' : '';
|
||||
$is_new_window_open_html = (isset($ret['data']['is_new_window_open']) && $ret['data']['is_new_window_open'] == 1) ? 'target="_blank"' : '';
|
||||
$this->assign('is_new_window_open_html', $is_new_window_open_html);
|
||||
|
||||
// 购物车总数
|
||||
$cart_total = BuyService::UserCartTotal(['user'=>$params['user']]);
|
||||
$this->assign('cart_total', $cart_total);
|
||||
|
||||
// 是否需要登录
|
||||
$login_event = empty($params['user']) ? 'login-event' : '';
|
||||
$login_event_class = empty($params['user']) ? 'login-event' : '';
|
||||
$this->assign('login_event_class', $login_event_class);
|
||||
|
||||
// 内容
|
||||
$content .= '<!-- 用户中心 -->
|
||||
<a href="'.(empty($params['user']) ? 'javascript:;' : MyUrl('index/user/index')).'" '.$is_new_window_open.' class="user-content '.$login_event.'">
|
||||
<div class="base-nav user-center">
|
||||
<img src="'.(!empty($user['avatar']) ? $params['user']['avatar'] : config('shopxo.attachment_host').'/static/index/default/images/default-user-avatar.jpg').'" class="user-avatar" />
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
用户中心
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 我的足迹 -->
|
||||
<a href="'.(empty($params['user']) ? 'javascript:;' : MyUrl('index/usergoodsbrowse/index')).'" '.$is_new_window_open.' class="browse-content '.$login_event.'">
|
||||
<div class="base-nav browse">
|
||||
<i class="am-icon-lastfm"></i>
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
我的足迹
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 我的收藏 -->
|
||||
<a href="'.(empty($params['user']) ? 'javascript:;' : MyUrl('index/userfavor/goods')).'" '.$is_new_window_open.' class="favor-content '.$login_event.'">
|
||||
<div class="base-nav favor">
|
||||
<i class="am-icon-star-o"></i>
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
我的收藏
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 购物车 -->
|
||||
<a href="'.(empty($params['user']) ? 'javascript:;' : MyUrl('index/cart/index')).'" '.$is_new_window_open.' class="cart-content '.$login_event.' '.(($ret['data']['is_goods_page_show_cart'] == 1 && $module_name.$controller_name.$action_name == 'indexgoodsindex' ? 'cart-show' : '')).'">
|
||||
<div class="base-nav cart">
|
||||
<i class="am-icon-opencart"></i>
|
||||
<div class="cart-text">
|
||||
购物车
|
||||
<div class="cart-count common-cart-total am-badge am-badge-danger">'.($cart_total > 9 ? '9+' : $cart_total).'</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>';
|
||||
|
||||
$qrcode = '';
|
||||
if(!empty($ret['data']['alipay_mini_qrcode_images']))
|
||||
{
|
||||
$qrcode .= '<li>
|
||||
<p>支付宝小程序</p>
|
||||
<img src="'.$ret['data']['alipay_mini_qrcode_images'].'" alt="支付宝小程序" />
|
||||
</li>';
|
||||
}
|
||||
if(!empty($ret['data']['alipay_fuwu_qrcode_images']))
|
||||
{
|
||||
$qrcode .= '<li>
|
||||
<p>支付宝生活号</p>
|
||||
<img src="'.$ret['data']['alipay_fuwu_qrcode_images'].'" alt="支付宝生活号" />
|
||||
</li>';
|
||||
}
|
||||
if(!empty($ret['data']['weixin_mini_qrcode_images']))
|
||||
{
|
||||
$qrcode .= '<li>
|
||||
<p>微信小程序</p>
|
||||
<img src="'.$ret['data']['weixin_mini_qrcode_images'].'" alt="微信小程序" />
|
||||
</li>';
|
||||
}
|
||||
if(!empty($ret['data']['weixin_fuwu_qrcode_images']))
|
||||
{
|
||||
$qrcode .= '<li>
|
||||
<p>微信公众号</p>
|
||||
<img src="'.$ret['data']['weixin_fuwu_qrcode_images'].'" alt="微信公众号" />
|
||||
</li>';
|
||||
}
|
||||
if(!empty($qrcode))
|
||||
{
|
||||
$content .= '<!-- 二维码 -->
|
||||
<div class="base-nav qrcode-content">
|
||||
<i class="am-icon-qrcode"></i>
|
||||
<div class="mui-mbar-popup qrcode-items am-animation-slide-left">
|
||||
<ul>'.$qrcode.'</ul>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
$content .= '<!-- 回顶部 -->
|
||||
<div class="base-nav go-top" data-am-smooth-scroll id="plugins-commonrightnavigation">
|
||||
<i class="am-icon-arrow-up"></i>
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
返回顶部
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>';
|
||||
// 用户信息
|
||||
$this->assign('user', $params['user']);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commonrightnavigation/index/content');
|
||||
} else {
|
||||
$content = $ret['msg'];
|
||||
return $ret['msg'];
|
||||
}
|
||||
$html .= $content;
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopmaxpicture;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
|
|
@ -34,13 +35,10 @@ class Admin
|
|||
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopmaxpicture/admin/index');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,14 +61,11 @@ class Admin
|
|||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
// 数组组装
|
||||
$data = [
|
||||
'is_whether_list' => $is_whether_list,
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopmaxpicture/admin/saveinfo');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopmaxpicture;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 顶部大图广告插件 - 钩子入口
|
||||
* @author Devil
|
||||
|
|
@ -19,7 +19,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
|
|
@ -59,10 +59,6 @@ class Hook
|
|||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
|
||||
|
||||
// html拼接
|
||||
$html = '<div style="text-align: center;';
|
||||
$content = '';
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 图片是否为空
|
||||
|
|
@ -99,22 +95,11 @@ class Hook
|
|||
}
|
||||
}
|
||||
|
||||
// 背景色
|
||||
if(!empty($ret['data']['bg_color']))
|
||||
{
|
||||
$html .= 'background: '.$ret['data']['bg_color'].';';
|
||||
}
|
||||
$content .= '<a href="'.(empty($ret['data']['url']) ? 'javascript:;' : $ret['data']['url']).'" '.($ret['data']['is_new_window_open'] == 1 ? 'target="_blank"' : '').'>';
|
||||
$content .= '<img src="'.$ret['data']['images'].'" />';
|
||||
$content .= '</a>';
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopmaxpicture/index/content');
|
||||
} else {
|
||||
$content = $ret['msg'];
|
||||
return $ret['msg'];
|
||||
}
|
||||
$html .= '">';
|
||||
$html .= $content;
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopnotice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
|
|
@ -34,13 +35,10 @@ class Admin
|
|||
$ret = PluginsService::PluginsData('commontopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopnotice/admin/index');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,14 +61,11 @@ class Admin
|
|||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
// 数组组装
|
||||
$data = [
|
||||
'is_whether_list' => $is_whether_list,
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopnotice/admin/saveinfo');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopnotice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
|
|
@ -59,10 +60,6 @@ class Hook
|
|||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commontopnotice');
|
||||
|
||||
// html拼接
|
||||
$html = '<div class="am-alert am-alert-warning am-radius" style="margin: 0;">';
|
||||
$content = '';
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 内容是否为空
|
||||
|
|
@ -99,14 +96,11 @@ class Hook
|
|||
}
|
||||
}
|
||||
|
||||
$content .= '<div class="am-container">'.$ret['data']['content'].'</div>';
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopnotice/index/content');
|
||||
} else {
|
||||
$content = $ret['msg'];
|
||||
return $ret['msg'];
|
||||
}
|
||||
$html .= $content;
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\usercentertopnotice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
|
|
@ -34,13 +35,10 @@ class Admin
|
|||
$ret = PluginsService::PluginsData('usercentertopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usercentertopnotice/admin/index');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,13 +55,10 @@ class Admin
|
|||
$ret = PluginsService::PluginsData('usercentertopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usercentertopnotice/admin/saveinfo');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\usercentertopnotice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
|
|
@ -52,17 +53,8 @@ class Hook
|
|||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('usercentertopnotice');
|
||||
|
||||
// html拼接
|
||||
$html = '<div class="am-alert am-alert-warning am-radius" style="margin: 0;">';
|
||||
$content = '';
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 内容是否为空
|
||||
|
|
@ -89,14 +81,11 @@ class Hook
|
|||
}
|
||||
}
|
||||
|
||||
$content .= '<div class="am-container">'.$ret['data']['content'].'</div>';
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usercentertopnotice/index/content');
|
||||
} else {
|
||||
$content = $ret['msg'];
|
||||
return $ret['msg'];
|
||||
}
|
||||
$html .= $content;
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\userloginrewardintegral;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
|
|
@ -34,13 +35,10 @@ class Admin
|
|||
$ret = PluginsService::PluginsData('userloginrewardintegral');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数组组装
|
||||
$data = [
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/userloginrewardintegral/admin/index');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,14 +61,11 @@ class Admin
|
|||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
// 数组组装
|
||||
$data = [
|
||||
'is_whether_list' => $is_whether_list,
|
||||
'data' => $ret['data'],
|
||||
];
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/userloginrewardintegral/admin/saveinfo');
|
||||
} else {
|
||||
return $ret;
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<div data-am-smooth-scroll="" class="am-hide-sm-only">
|
||||
<div id="plugins-commongobacktop" title="回到顶部">
|
||||
<img src="{{$data.images}}">
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<div class="commononlineservice" {{if !empty($data['distance_top'])}} style="top:{{$data.distance_top}}%"{{/if}}>
|
||||
<div class="float-left" style="{{if !empty($data['bg_color'])}}background: {{$data.bg_color}};{{/if}}">
|
||||
<a class="btn-open" title="查看在线客服" href="javascript:void(0);">展开</a>
|
||||
<a class="btn-ctn" title="关闭在线客服" href="javascript:void(0);">收缩</a>
|
||||
</div>
|
||||
<div class="content" style="{{if isset($data['online_service_li_count']) and $data['online_service_li_count'] ELT 2}}border-radius: 0;{{/if}} {{if !empty($data['bg_color'])}}background: {{$data.bg_color}};{{/if}}">
|
||||
<div class="cn">
|
||||
{{if !empty($data['title'])}}
|
||||
<h3 class="title">{{$data.title}}</h3>
|
||||
{{/if}}
|
||||
{{if !empty($data['online_service'])}}
|
||||
<ul>
|
||||
{{foreach name=$data.online_service as $v}}
|
||||
<li>
|
||||
<span>{{$v[0]}}</span>
|
||||
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin={{$v[1]}}&site=qq&menu=yes">
|
||||
<img border="0" src="http://wpa.qq.com/pa?p=2:{{$v[1]}}:51" alt="点击这里给我发消息" title="点击这里给我发消息">
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
{{if !empty($data['title'])}}
|
||||
<li>
|
||||
<span>电话:{{$data.tel}}</span>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<div class="commonrightnavigation-right-nav">
|
||||
<!-- 用户中心 -->
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/user/index')}}{{/if}}" class="user-content {{$login_event_class}}">
|
||||
<div class="base-nav user-center">
|
||||
<img src="{{if empty($user['avatar'])}}{{:config('shopxo.attachment_host')}}/static/index/default/images/default-user-avatar.jpg{{else /}}{{$user.avatar}}{{/if}}" class="user-avatar">
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
用户中心
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 我的足迹 -->
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/usergoodsbrowse/index')}}{{/if}}" class="browse-content {{$login_event_class}}">
|
||||
<div class="base-nav browse">
|
||||
<i class="am-icon-lastfm"></i>
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
我的足迹
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 我的收藏 -->
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/userfavor/goods')}}{{/if}}" class="favor-content {{$login_event_class}}">
|
||||
<div class="base-nav favor">
|
||||
<i class="am-icon-star-o"></i>
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
我的收藏
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 购物车 -->
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/cart/index')}}{{/if}}" class="cart-content {{$login_event_class}} {{if isset($data['is_goods_page_show_cart']) and $data['is_goods_page_show_cart'] eq 1 and $module_controller_action eq 'indexgoodsindex'}} cart-show{{/if}}">
|
||||
<div class="base-nav cart">
|
||||
<i class="am-icon-opencart"></i>
|
||||
<div class="cart-text">
|
||||
购物车
|
||||
<div class="cart-count common-cart-total am-badge am-badge-danger">{{if $cart_total > 9}}9+{{else /}}{{$cart_total}}{{/if}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 二维码 -->
|
||||
<div class="base-nav qrcode-content">
|
||||
<i class="am-icon-qrcode"></i>
|
||||
<div class="mui-mbar-popup qrcode-items am-animation-slide-left">
|
||||
<ul>
|
||||
{{if !empty($data['alipay_mini_qrcode_images'])}}
|
||||
<li>
|
||||
<p>支付宝小程序</p>
|
||||
<img src="{{$data.alipay_mini_qrcode_images}}" alt="支付宝小程序">
|
||||
</li>
|
||||
{{/if}}
|
||||
{{if !empty($data['alipay_fuwu_qrcode_images'])}}
|
||||
<li>
|
||||
<p>支付宝生活号</p>
|
||||
<img src="{{$data.alipay_fuwu_qrcode_images}}" alt="支付宝生活号">
|
||||
</li>
|
||||
{{/if}}
|
||||
{{if !empty($data['weixin_mini_qrcode_images'])}}
|
||||
<li>
|
||||
<p>微信小程序</p>
|
||||
<img src="{{$data.weixin_mini_qrcode_images}}" alt="微信小程序">
|
||||
</li>
|
||||
{{/if}}
|
||||
{{if !empty($data['weixin_fuwu_qrcode_images'])}}
|
||||
<li>
|
||||
<p>微信公众号</p>
|
||||
<img src="{{$data.weixin_fuwu_qrcode_images}}" alt="微信公众号">
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 回顶部 -->
|
||||
<div class="base-nav go-top" data-am-smooth-scroll id="plugins-commonrightnavigation">
|
||||
<i class="am-icon-arrow-up"></i>
|
||||
<div class="mui-mbar-tab-tip am-animation-slide-left">
|
||||
返回顶部
|
||||
<div class="mui-mbar-arr mui-mbar-tab-tip-arr">◆</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<div style="text-align: center; {{if !empty($data['bg_color'])}}background: {{$data.bg_color}};{{/if}}">
|
||||
<a href="{{if !empty($data['url'])}}{{$data.url}}{{else /}}javascript:;{{/if}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq 1}}target="_blank"{{/if}}>
|
||||
<img src="{{$data.images}}" />
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<div class="am-alert am-alert-warning am-radius" style="margin: 0;">
|
||||
<div class="am-container">{{$data.content}}</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<div class="am-alert am-alert-warning am-radius" style="margin: 0;">
|
||||
<div class="am-container">{{$data.content}}</div>
|
||||
</div>
|
||||
|
|
@ -486,7 +486,7 @@ class PluginsAdminService
|
|||
$admin=<<<php
|
||||
<?php
|
||||
namespace app\plugins\\$plugins;
|
||||
|
||||
use think\Controller;
|
||||
/**
|
||||
* {$params['name']} - 后台管理
|
||||
* @author Devil
|
||||
|
|
@ -494,17 +494,15 @@ namespace app\plugins\\$plugins;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin
|
||||
class Admin extends Controller
|
||||
{
|
||||
// 后台管理入口
|
||||
public function index(\$params = [])
|
||||
{
|
||||
// 数组组装
|
||||
\$data = [
|
||||
'data' => ['hello', 'world!'],
|
||||
'msg' => 'hello world! admin',
|
||||
];
|
||||
return DataReturn('处理成功', 0, \$data);
|
||||
\$this->assign('data', ['hello', 'world!']);
|
||||
\$this->assign('msg', 'hello world! admin');
|
||||
return \$this->fetch('../../../plugins/view/$plugins/admin/index');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -513,7 +511,7 @@ php;
|
|||
$hook=<<<php
|
||||
<?php
|
||||
namespace app\plugins\\$plugins;
|
||||
|
||||
use think\Controller;
|
||||
/**
|
||||
* {$params['name']} - 钩子入口
|
||||
* @author Devil
|
||||
|
|
@ -521,7 +519,7 @@ namespace app\plugins\\$plugins;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
class Hook extends Controller
|
||||
{
|
||||
// 应用响应入口
|
||||
public function run(\$params = [])
|
||||
|
|
@ -548,7 +546,7 @@ php;
|
|||
$index=<<<php
|
||||
<?php
|
||||
namespace app\plugins\\$plugins;
|
||||
|
||||
use think\Controller;
|
||||
/**
|
||||
* {$params['name']} - 前端独立页面入口
|
||||
* @author Devil
|
||||
|
|
@ -556,17 +554,15 @@ namespace app\plugins\\$plugins;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Index
|
||||
class Index extends Controller
|
||||
{
|
||||
// 前端页面入口
|
||||
public function index(\$params = [])
|
||||
{
|
||||
// 数组组装
|
||||
\$data = [
|
||||
'data' => ['hello', 'world!'],
|
||||
'msg' => 'hello world! index',
|
||||
];
|
||||
return DataReturn('处理成功', 0, \$data);
|
||||
\$this->assign('data', ['hello', 'world!']);
|
||||
\$this->assign('msg', 'hello world! index');
|
||||
return \$this->fetch('../../../plugins/view/$plugins/index/index');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,20 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\userloginrewardintegral\\Hook',
|
||||
),
|
||||
'plugins_view_common_bottom' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\commongobacktop\\Hook',
|
||||
1 => 'app\\plugins\\commonrightnavigation\\Hook',
|
||||
2 => 'app\\plugins\\commononlineservice\\Hook',
|
||||
),
|
||||
'plugins_common_page_bottom' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\commongobacktop\\Hook',
|
||||
),
|
||||
'plugins_common_header' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\commongobacktop\\Hook',
|
||||
),
|
||||
'plugins_css' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\commonrightnavigation\\Hook',
|
||||
|
|
@ -55,10 +69,5 @@ return array (
|
|||
0 => 'app\\plugins\\commonrightnavigation\\Hook',
|
||||
1 => 'app\\plugins\\commononlineservice\\Hook',
|
||||
),
|
||||
'plugins_view_common_bottom' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\commonrightnavigation\\Hook',
|
||||
1 => 'app\\plugins\\commononlineservice\\Hook',
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
return [
|
||||
// 开发模式
|
||||
'is_develop' => false,
|
||||
'is_develop' => true,
|
||||
|
||||
// 默认编码
|
||||
'default_charset' => 'utf-8',
|
||||
|
|
|
|||
Loading…
Reference in New Issue