mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-07-08 22:40:43 +08:00
去除应用
This commit is contained in:
@ -90,6 +90,8 @@ class Pluginsadmin extends Common
|
||||
$data = PluginsAdminService::PluginsList($data_params);
|
||||
$this->assign('data_list', $data['data']);
|
||||
|
||||
$this->assign('store_url', config('shopxo.store_url').'?url='.urlencode(__MY_URL__));
|
||||
|
||||
return $this->fetch();
|
||||
} else {
|
||||
return $this->fetch('upload');
|
||||
|
||||
@ -74,7 +74,10 @@
|
||||
</div>
|
||||
</div>
|
||||
{{else /}}
|
||||
<div colspan="20" class="table-no">还没有相关应用<div>
|
||||
<div colspan="20" class="table-no">
|
||||
<span>还没有相关应用</span>
|
||||
<a href="{{$store_url}}" class="am-margin-left-xs">应用商店</a>
|
||||
<div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
1
application/plugins/.gitignore
vendored
Normal file → Executable file
1
application/plugins/.gitignore
vendored
Normal file → Executable file
@ -1,3 +1,4 @@
|
||||
*
|
||||
!.gitignore
|
||||
!index.html
|
||||
!view
|
||||
@ -1,59 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\answers;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 问答 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 钩子入口
|
||||
* @author Guoguo
|
||||
* @blog http://gadmin.cojz8.com
|
||||
* @version 1.0.0
|
||||
* @datetime 2019年3月14日
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 大导航前面添加问答地址
|
||||
if(!empty($params['hook_name']) && $params['hook_name'] == 'plugins_service_navigation_header_handle')
|
||||
{
|
||||
if(is_array($params['header']))
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('answers', ['images', 'images_bottom']);
|
||||
if($ret['code'] == 0 && !empty($ret['data']['application_name']))
|
||||
{
|
||||
$nav = [
|
||||
'id' => 0,
|
||||
'pid' => 0,
|
||||
'name' => $ret['data']['application_name'],
|
||||
'url' => PluginsHomeUrl('answers', 'index', 'index'),
|
||||
'data_type' => 'custom',
|
||||
'is_show' => 1,
|
||||
'is_new_window_open' => 0,
|
||||
'items' => [],
|
||||
];
|
||||
array_unshift($params['header'], $nav);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,291 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\answers\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\plugins\answers\service\Service;
|
||||
use app\service\GoodsService;
|
||||
|
||||
/**
|
||||
* 问答 - 后台管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
// 基础数据
|
||||
$base = PluginsService::PluginsData('answers', ['images', 'images_bottom']);
|
||||
$this->assign('data', isset($base['data']) ? $base['data'] : []);
|
||||
|
||||
// 幻灯片
|
||||
$data_params = [
|
||||
'where' => ['is_enable'=>1],
|
||||
];
|
||||
$slider = Service::SlideList($data_params);
|
||||
$this->assign('slider', isset($slider['data']) ? $slider['data'] : []);
|
||||
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('goods_list', $goods['data']['goods']);
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/admin/admin/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础信息编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function baseinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('answers', ['images', 'images_bottom']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
|
||||
// 获取推荐问答
|
||||
if(!empty($ret['data']['category_ids']))
|
||||
{
|
||||
$answers = Service::AnswerList(['n'=>100, 'field'=>'id,content as title', 'category_ids'=> $ret['data']['category_ids']]);
|
||||
$this->assign('answers_rc_list', $answers['data']);
|
||||
} else {
|
||||
$this->assign('answers_rc_list', []);
|
||||
}
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/admin/admin/baseinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function basesave($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'answers', 'data'=>$params], ['images', 'images_bottom']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function slider($params = [])
|
||||
{
|
||||
$ret = Service::SlideList();
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/answers/admin/admin/slider');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片编辑
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function sliderinfo($params = [])
|
||||
{
|
||||
// 数据
|
||||
$data = [];
|
||||
if(!empty($params['id']))
|
||||
{
|
||||
$data_params = array(
|
||||
'where' => ['id'=>intval($params['id'])],
|
||||
);
|
||||
$ret = Service::SlideList($data_params);
|
||||
$data = empty($ret['data'][0]) ? [] : $ret['data'][0];
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/admin/admin/sliderinfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function slidersave($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::SlideSave($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-15T11:03:30+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function sliderdelete($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::SlideDelete($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片状态更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-01-12T22:23:06+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function sliderstatusupdate($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::SlideStatusUpdate($params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推荐商品编辑编辑
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function goodsinfo($params = [])
|
||||
{
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('goods', $goods['data']);
|
||||
|
||||
// 商品分类
|
||||
$this->assign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/admin/admin/goodsinfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function goodssearch($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 搜索数据
|
||||
return Service::GoodsSearchList($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function goodssave($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 搜索数据
|
||||
return Service::GoodsSave($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 问答搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function answerssearch($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 问答内容
|
||||
return Service::AnswerList(['n'=>100, 'field'=>'id,content as title']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"answers",
|
||||
"name":"问答增强版",
|
||||
"logo":"\/static\/upload\/images\/plugins_answers\/2019\/03\/06\/1551853529634743.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"问答系统增强、独立首页、详情、搜索、可配置推荐问答及商品",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":true
|
||||
},
|
||||
"hook":{
|
||||
"plugins_service_navigation_header_handle":[
|
||||
"app\\plugins\\answers\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,224 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\answers\index;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\service\AnswerService;
|
||||
use app\service\UserService;
|
||||
use app\service\SeoService;
|
||||
use app\service\GoodsService;
|
||||
use app\plugins\answers\service\Service;
|
||||
|
||||
/**
|
||||
* 问答 - 前端独立页面入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-07
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
// 基础数据
|
||||
$base = PluginsService::PluginsData('answers', ['images', 'images_bottom']);
|
||||
$this->assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []);
|
||||
|
||||
// 幻灯片
|
||||
$data_params = [
|
||||
'where' => ['is_enable'=>1],
|
||||
];
|
||||
$slider = Service::SlideList($data_params);
|
||||
$this->assign('plugins_answers_slider', isset($slider['data']) ? $slider['data'] : []);
|
||||
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('plugins_answers_goods_list', $goods['data']['goods']);
|
||||
|
||||
// 最新问答内容
|
||||
$middle_new_page_number = isset($base['data']['middle_new_page_number']) ? intval($base['data']['middle_new_page_number']) : 15;
|
||||
$answer = Service::AnswerList(['n'=>$middle_new_page_number]);
|
||||
$this->assign('plugins_answers_middle_answer_list', $answer['data']);
|
||||
|
||||
// 推荐问答
|
||||
if(!empty($base['data']['category_ids']))
|
||||
{
|
||||
$answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]);
|
||||
$this->assign('plugins_answers_rc_list', $answers['data']);
|
||||
} else {
|
||||
$this->assign('plugins_answers_rc_list', []);
|
||||
}
|
||||
|
||||
// 最新商品
|
||||
if(!empty($base['data']['home_new_goods_number']))
|
||||
{
|
||||
$goods = GoodsService::GoodsList(['where'=>['is_delete_time'=>0], 'field'=>'id,title,images,min_price', 'n'=>intval($base['data']['home_new_goods_number'])]);
|
||||
$this->assign('plugins_new_goods_list', $goods['data']);
|
||||
}
|
||||
|
||||
// 浏览器标题
|
||||
$seo_name = empty($base['data']['application_name']) ? '问答' : $base['data']['application_name'];
|
||||
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($seo_name, 1));
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/index/index/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-07
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function detail($params = [])
|
||||
{
|
||||
// 基础数据
|
||||
$base = PluginsService::PluginsData('answers', ['images', 'images_bottom']);
|
||||
$this->assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []);
|
||||
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('plugins_answers_goods_list', $goods['data']['goods']);
|
||||
|
||||
// 推荐问答
|
||||
if(!empty($base['data']['category_ids']))
|
||||
{
|
||||
$answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]);
|
||||
$this->assign('plugins_answers_rc_list', $answers['data']);
|
||||
} else {
|
||||
$this->assign('plugins_answers_rc_list', []);
|
||||
}
|
||||
|
||||
// 获取问答数据
|
||||
$detail = Service::AnswerRow($params);
|
||||
$this->assign('plugins_answers_detail', $detail);
|
||||
|
||||
// 浏览次数
|
||||
if($detail['code'] == 0 && !empty($detail['data']['id']))
|
||||
{
|
||||
AnswerService::AnswerAccessCountInc(['answer_id'=>$detail['data']['id']]);
|
||||
}
|
||||
|
||||
// 浏览器标题
|
||||
if(!empty($detail['data']['title']))
|
||||
{
|
||||
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($detail['data']['title']));
|
||||
} else if(!empty($detail['data']['content']))
|
||||
{
|
||||
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($detail['data']['content']));
|
||||
}
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/index/index/detail');
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-11
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function search($params = [])
|
||||
{
|
||||
if(input('post.answers_keywords'))
|
||||
{
|
||||
$answers_keywords = str_replace(['?', ' ', '+', '-'], '', trim(input('post.answers_keywords')));
|
||||
return redirect(PluginsHomeUrl('answers', 'index', 'search', ['answers_keywords'=>$answers_keywords]));
|
||||
} else {
|
||||
// 基础数据
|
||||
$base = PluginsService::PluginsData('answers', ['images', 'images_bottom']);
|
||||
$this->assign('plugins_answers_data', isset($base['data']) ? $base['data'] : []);
|
||||
|
||||
// 商品数据
|
||||
$goods = Service::GoodsList();
|
||||
$this->assign('plugins_answers_goods_list', $goods['data']['goods']);
|
||||
|
||||
// 推荐问答
|
||||
if(!empty($base['data']['category_ids']))
|
||||
{
|
||||
$answers = Service::AnswerList(['n'=>100, 'category_ids'=> $base['data']['category_ids']]);
|
||||
$this->assign('plugins_answers_rc_list', $answers['data']);
|
||||
} else {
|
||||
$this->assign('plugins_answers_rc_list', []);
|
||||
}
|
||||
|
||||
// 获取搜索数据
|
||||
// 分页
|
||||
$number = isset($base['data']['search_page_number']) ? intval($base['data']['search_page_number']) : 28;
|
||||
|
||||
// 条件
|
||||
$keywords_arr = empty($params['answers_keywords']) ? [] : ['keywords'=>$params['answers_keywords']];
|
||||
$where = Service::AnswerListWhere(array_merge($params, $keywords_arr));
|
||||
|
||||
// 获取总数
|
||||
$total = AnswerService::AnswerTotal($where);
|
||||
|
||||
// 分页
|
||||
$page_params = array(
|
||||
'number' => $number,
|
||||
'total' => $total,
|
||||
'where' => $params,
|
||||
'page' => isset($params['page']) ? intval($params['page']) : 1,
|
||||
'url' => PluginsHomeUrl('answers', 'index', 'search'),
|
||||
);
|
||||
$page = new \base\Page($page_params);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => $page->GetPageStarNumber(),
|
||||
'n' => $number,
|
||||
'where' => $where,
|
||||
'field' => 'id,title,content,add_time,is_reply',
|
||||
);
|
||||
$data = AnswerService::AnswerList($data_params);
|
||||
$this->assign('plugins_answers_data_list', $data['data']);
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
|
||||
// 浏览器标题
|
||||
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('问答搜索', 1));
|
||||
|
||||
return $this->fetch('../../../plugins/view/answers/index/index/search');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提问
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function answer($params = [])
|
||||
{
|
||||
$params = input('post.');
|
||||
$params['user'] = UserService::LoginUserInfo();
|
||||
return AnswerService::AnswerSave($params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,23 +0,0 @@
|
||||
# 问答系统商品 - 应用
|
||||
CREATE TABLE `{PREFIX}plugins_answers_goods` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
|
||||
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `goods_id` (`goods_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='问答系统商品 - 应用';
|
||||
|
||||
# 问答系统轮播图 - 应用
|
||||
CREATE TABLE `{PREFIX}plugins_answers_slide` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`name` char(60) NOT NULL DEFAULT '' COMMENT '别名',
|
||||
`images_url` char(255) NOT NULL DEFAULT '' COMMENT '图片地址',
|
||||
`url` char(255) NOT NULL DEFAULT '' COMMENT 'url地址',
|
||||
`is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
|
||||
`sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
|
||||
`upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `is_enable` (`is_enable`),
|
||||
KEY `sort` (`sort`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='问答系统轮播图 - 应用';
|
||||
@ -1,406 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\answers\service;
|
||||
|
||||
use think\Db;
|
||||
use app\service\ResourcesService;
|
||||
use app\service\GoodsService;
|
||||
use app\service\AnswerService;
|
||||
|
||||
/**
|
||||
* 问答系统服务层
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
/**
|
||||
* 幻灯片数据列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-08-29
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function SlideList($params = [])
|
||||
{
|
||||
$where = empty($params['where']) ? [] : $params['where'];
|
||||
$data = Db::name('PluginsAnswersSlide')->where($where)->order('sort asc')->select();
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_is_enable_tips = lang('common_is_enable_tips');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 是否启用
|
||||
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
|
||||
|
||||
// 图片地址
|
||||
$v['images_url_old'] = $v['images_url'];
|
||||
$v['images_url'] = ResourcesService::AttachmentPathViewHandle($v['images_url']);
|
||||
|
||||
// 时间
|
||||
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
|
||||
$v['add_time_date'] = date('Y-m-d', $v['add_time']);
|
||||
$v['upd_time_time'] = date('Y-m-d H:i:s', $v['upd_time']);
|
||||
$v['upd_time_date'] = date('Y-m-d', $v['upd_time']);
|
||||
}
|
||||
}
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-19
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function SlideSave($params = [])
|
||||
{
|
||||
// 请求类型
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'length',
|
||||
'key_name' => 'name',
|
||||
'checked_data' => '2,60',
|
||||
'error_msg' => '名称长度 2~60 个字符',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'images_url',
|
||||
'checked_data' => '255',
|
||||
'error_msg' => '请上传图片',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'fun',
|
||||
'key_name' => 'url',
|
||||
'is_checked' => 1,
|
||||
'checked_data' => 'CheckUrl',
|
||||
'error_msg' => 'url格式有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'length',
|
||||
'key_name' => 'sort',
|
||||
'checked_data' => '3',
|
||||
'error_msg' => '顺序 0~255 之间的数值',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 附件
|
||||
$data_fields = ['images_url'];
|
||||
$attachment = ResourcesService::AttachmentParams($params, $data_fields);
|
||||
|
||||
// 数据
|
||||
$data = [
|
||||
'name' => $params['name'],
|
||||
'url' => $params['url'],
|
||||
'images_url' => $attachment['data']['images_url'],
|
||||
'sort' => intval($params['sort']),
|
||||
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
|
||||
];
|
||||
|
||||
if(empty($params['id']))
|
||||
{
|
||||
$data['add_time'] = time();
|
||||
if(Db::name('PluginsAnswersSlide')->insertGetId($data) > 0)
|
||||
{
|
||||
return DataReturn('添加成功', 0);
|
||||
}
|
||||
return DataReturn('添加失败', -100);
|
||||
} else {
|
||||
$data['upd_time'] = time();
|
||||
if(Db::name('PluginsAnswersSlide')->where(['id'=>intval($params['id'])])->update($data))
|
||||
{
|
||||
return DataReturn('编辑成功', 0);
|
||||
}
|
||||
return DataReturn('编辑失败', -100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function SlideDelete($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
if(Db::name('PluginsAnswersSlide')->where(['id'=>$params['id']])->delete())
|
||||
{
|
||||
return DataReturn('删除成功');
|
||||
}
|
||||
|
||||
return DataReturn('删除失败或资源不存在', -100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 幻灯片状态更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function SlideStatusUpdate($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'in',
|
||||
'key_name' => 'state',
|
||||
'checked_data' => [0,1],
|
||||
'error_msg' => '状态有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 数据更新
|
||||
if(Db::name('PluginsAnswersSlide')->where(['id'=>intval($params['id'])])->update(['is_enable'=>intval($params['state'])]))
|
||||
{
|
||||
return DataReturn('编辑成功');
|
||||
}
|
||||
return DataReturn('编辑失败或数据未改变', -100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function GoodsSearchList($params = [])
|
||||
{
|
||||
// 条件
|
||||
$where = [
|
||||
['g.is_delete_time', '=', 0],
|
||||
['g.is_shelves', '=', 1]
|
||||
];
|
||||
|
||||
// 关键字
|
||||
if(!empty($params['keywords']))
|
||||
{
|
||||
$where[] = ['g.title', 'like', '%'.$params['keywords'].'%'];
|
||||
}
|
||||
|
||||
// 分类id
|
||||
if(!empty($params['category_id']))
|
||||
{
|
||||
$category_ids = GoodsService::GoodsCategoryItemsIds([$params['category_id']], 1);
|
||||
$category_ids[] = $params['category_id'];
|
||||
$where[] = ['gci.category_id', 'in', $category_ids];
|
||||
}
|
||||
|
||||
// 指定字段
|
||||
$field = 'g.id,g.title';
|
||||
|
||||
// 获取数据
|
||||
return GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field, 'is_admin_access'=>1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联商品保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-07
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function GoodsSave($params = [])
|
||||
{
|
||||
// 清除商品id
|
||||
Db::name('PluginsAnswersGoods')->where('id', '>', 0)->delete();
|
||||
|
||||
// 写入商品id
|
||||
if(!empty($params['category_ids']))
|
||||
{
|
||||
$ids_all = explode(',', $params['category_ids']);
|
||||
$data = [];
|
||||
foreach($ids_all as $goods_id)
|
||||
{
|
||||
$data[] = [
|
||||
'goods_id' => $goods_id,
|
||||
'add_time' => time(),
|
||||
];
|
||||
}
|
||||
if(Db::name('PluginsAnswersGoods')->insertAll($data) < count($data))
|
||||
{
|
||||
return DataReturn('操作失败', -100);
|
||||
}
|
||||
}
|
||||
return DataReturn('操作成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function GoodsList($params = [])
|
||||
{
|
||||
// 获取推荐商品id
|
||||
$goods_ids = Db::name('PluginsAnswersGoods')->column('goods_id');
|
||||
if(empty($goods_ids))
|
||||
{
|
||||
return DataReturn('没有商品', 0, ['goods'=>[], 'goods_ids'=>[]]);
|
||||
}
|
||||
|
||||
// 条件
|
||||
$where = [
|
||||
['g.is_delete_time', '=', 0],
|
||||
['g.is_shelves', '=', 1],
|
||||
['g.id', 'in', $goods_ids],
|
||||
];
|
||||
|
||||
// 指定字段
|
||||
$field = 'g.id,g.title,g.images,g.min_price';
|
||||
|
||||
// 获取数据
|
||||
$ret = GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field]);
|
||||
return DataReturn('操作成功', 0, ['goods'=>$ret['data'], 'goods_ids'=>$goods_ids]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-11
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function AnswerListWhere($params = [])
|
||||
{
|
||||
// 条件
|
||||
$where = [
|
||||
['is_show', '=', 1],
|
||||
];
|
||||
|
||||
// 搜索关键字
|
||||
if(!empty($params['keywords']))
|
||||
{
|
||||
$where[] = ['title|content', 'like', '%'.$params['keywords'].'%'];
|
||||
}
|
||||
|
||||
// 指定问答id
|
||||
if(!empty($params['category_ids']))
|
||||
{
|
||||
$where[] = ['id', 'in', explode(',', $params['category_ids'])];
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
* 问答列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function AnswerList($params = [])
|
||||
{
|
||||
// 字段
|
||||
$field = empty($params['field']) ? 'id,name,title,content,reply,is_reply,reply_time,add_time' : $params['field'];
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => isset($params['n']) ? intval($params['n']) : 10,
|
||||
'where' => self::AnswerListWhere($params),
|
||||
'field' => $field,
|
||||
);
|
||||
return AnswerService::AnswerList($data_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一条问答
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function AnswerRow($params = [])
|
||||
{
|
||||
// 参数
|
||||
if(empty($params['id']))
|
||||
{
|
||||
return DataReturn('问答id有误', -1);
|
||||
}
|
||||
// 条件
|
||||
$where = [
|
||||
['is_show', '=', 1],
|
||||
['id', '=', intval($params['id'])],
|
||||
];
|
||||
|
||||
// 字段
|
||||
$field = 'id,name,title,content,reply,is_reply,access_count,reply_time,add_time';
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => 1,
|
||||
'where' => $where,
|
||||
'field' => $field,
|
||||
);
|
||||
$ret = AnswerService::AnswerList($data_params);
|
||||
if(isset($ret['data'][0]))
|
||||
{
|
||||
$ret['data'] = $ret['data'][0];
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,5 +0,0 @@
|
||||
# 问答系统商品 - 应用
|
||||
DROP TABLE `{PREFIX}plugins_answers_goods`;
|
||||
|
||||
# 问答系统轮播图 - 应用
|
||||
DROP TABLE `{PREFIX}plugins_answers_slide`;
|
||||
@ -1,148 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commongobacktop;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 回到顶部 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
case 'plugins_view_common_bottom' :
|
||||
$ret = $this->html($params);
|
||||
break;
|
||||
|
||||
case 'plugins_common_page_bottom' :
|
||||
$ret = $this->js($params);
|
||||
break;
|
||||
|
||||
case 'plugins_common_header' :
|
||||
$ret = $this->css($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* css
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function css($params = [])
|
||||
{
|
||||
return '<style type="text/css">
|
||||
#plugins-commongobacktop {
|
||||
display:none;
|
||||
position: fixed;
|
||||
right: 50px;
|
||||
bottom: 100px;
|
||||
z-index: 100;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>';
|
||||
}
|
||||
|
||||
/**
|
||||
* js
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function js($params = [])
|
||||
{
|
||||
return '<script type="text/javascript">
|
||||
// 回顶部监测
|
||||
$(window).scroll(function()
|
||||
{
|
||||
if($(window).scrollTop() > 100)
|
||||
{
|
||||
$("#plugins-commongobacktop").fadeIn(1000);
|
||||
} else {
|
||||
$("#plugins-commongobacktop").fadeOut(1000);
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commongobacktop', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 图片是否为空
|
||||
if(empty($ret['data']['images']))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
// 非全局
|
||||
if($ret['data']['is_overall'] != 1)
|
||||
{
|
||||
// 非首页则空
|
||||
if($module_name.$controller_name.$action_name != 'indexindexindex')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commongobacktop/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commongobacktop\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 回到顶部 - 后台管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commongobacktop', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commongobacktop/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commongobacktop', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否'),
|
||||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commongobacktop/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'commongobacktop', 'data'=>$params], ['images']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,30 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"commongobacktop",
|
||||
"name":"回到顶部",
|
||||
"logo":"\/static\/upload\/images\/plugins_commongobacktop\/2019\/02\/15\/1550200927239565.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"当滚动到底部的时候出现回到顶部操作",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_view_common_bottom":[
|
||||
"app\\plugins\\commongobacktop\\Hook"
|
||||
],
|
||||
"plugins_common_page_bottom":[
|
||||
"app\\plugins\\commongobacktop\\Hook"
|
||||
],
|
||||
"plugins_common_header":[
|
||||
"app\\plugins\\commongobacktop\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,125 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commononlineservice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 在线客服 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否控制器钩子
|
||||
// is_backend 当前为后端业务处理
|
||||
// hook_name 钩子名称
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
// 参数一 描述
|
||||
// 参数二 0 为处理成功, 负数为失败
|
||||
// 参数三 返回数据
|
||||
return DataReturn('返回描述', 0);
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
case 'plugins_css' :
|
||||
$ret = __MY_ROOT_PUBLIC__.'static/plugins/css/commononlineservice/index/style.css';
|
||||
break;
|
||||
|
||||
case 'plugins_js' :
|
||||
$ret = __MY_ROOT_PUBLIC__.'static/plugins/js/commononlineservice/index/style.js';
|
||||
break;
|
||||
|
||||
case 'plugins_view_common_bottom' :
|
||||
$ret = $this->html($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commononlineservice', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 非全局
|
||||
if($ret['data']['is_overall'] != 1)
|
||||
{
|
||||
// 非首页则空
|
||||
if($module_name.$controller_name.$action_name != 'indexindexindex')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// 客服
|
||||
$online_service = empty($ret['data']['online_service']) ? [] : explode("\n", $ret['data']['online_service']);
|
||||
$online_service_data = [];
|
||||
if(!empty($online_service))
|
||||
{
|
||||
foreach($online_service as $v)
|
||||
{
|
||||
$items = explode('|', $v);
|
||||
if(count($items) == 2)
|
||||
{
|
||||
$online_service_data[] = $items;
|
||||
}
|
||||
}
|
||||
}
|
||||
$ret['data']['online_service'] = $online_service_data;
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commononlineservice/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,88 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commononlineservice\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 在线客服 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commononlineservice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数据处理
|
||||
$ret['data']['online_service'] = str_replace("\n", '<br />', $ret['data']['online_service']);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commononlineservice/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commononlineservice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否'),
|
||||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commononlineservice/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'commononlineservice', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,30 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"commononlineservice",
|
||||
"name":"在线客服",
|
||||
"logo":"\/static\/upload\/images\/plugins_commononlineservice\/2019\/02\/17\/1550393245526672.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"在线客服、QQ、电话",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_css":[
|
||||
"app\\plugins\\commononlineservice\\Hook"
|
||||
],
|
||||
"plugins_js":[
|
||||
"app\\plugins\\commononlineservice\\Hook"
|
||||
],
|
||||
"plugins_view_common_bottom":[
|
||||
"app\\plugins\\commononlineservice\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,144 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commonrightnavigation;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\service\BuyService;
|
||||
|
||||
/**
|
||||
* 右侧快捷导航 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否控制器钩子
|
||||
// is_backend 当前为后端业务处理
|
||||
// hook_name 钩子名称
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
// 参数一 描述
|
||||
// 参数二 0 为处理成功, 负数为失败
|
||||
// 参数三 返回数据
|
||||
return DataReturn('返回描述', 0);
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
case 'plugins_css' :
|
||||
$ret = __MY_ROOT_PUBLIC__.'static/plugins/css/commonrightnavigation/index/style.css';
|
||||
break;
|
||||
|
||||
case 'plugins_js' :
|
||||
$ret = __MY_ROOT_PUBLIC__.'static/plugins/js/commonrightnavigation/index/style.js';
|
||||
break;
|
||||
|
||||
case 'plugins_view_common_bottom' :
|
||||
$ret = $this->html($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commonrightnavigation', ['alipay_mini_qrcode_images', 'alipay_fuwu_qrcode_images', 'weixin_mini_qrcode_images', 'weixin_fuwu_qrcode_images']);
|
||||
|
||||
// html拼接
|
||||
$html = '<div class="commonrightnavigation-right-nav">';
|
||||
$content = '';
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 非全局
|
||||
if($ret['data']['is_overall'] != 1)
|
||||
{
|
||||
// 非首页则空
|
||||
if($module_name.$controller_name.$action_name != 'indexindexindex')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// 当前模块/控制器/方法
|
||||
$this->assign('module_controller_action', $module_name.$controller_name.$action_name);
|
||||
|
||||
// 是否新窗口打开
|
||||
$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_class = empty($params['user']) ? 'login-event' : '';
|
||||
$this->assign('login_event_class', $login_event_class);
|
||||
|
||||
// 用户信息
|
||||
$this->assign('user', $params['user']);
|
||||
|
||||
// 应用数据
|
||||
$this->assign('data', $ret['data']);
|
||||
|
||||
// 购物车
|
||||
$cart_list = BuyService::CartList(['user'=>$params['user']]);
|
||||
$this->assign('cart_list', $cart_list['data']);
|
||||
$base = [
|
||||
'total_price' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'total_price')),
|
||||
'cart_count' => empty($cart_list['data']) ? 0 : count($cart_list['data']),
|
||||
'ids' => empty($cart_list['data']) ? '' : implode(',', array_column($cart_list['data'], 'id')),
|
||||
];
|
||||
$this->assign('base', $base);
|
||||
|
||||
return $this->fetch('../../../plugins/view/commonrightnavigation/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commonrightnavigation\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 右侧快捷导航 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commonrightnavigation', ['alipay_mini_qrcode_images', 'alipay_fuwu_qrcode_images', 'weixin_mini_qrcode_images', 'weixin_fuwu_qrcode_images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commonrightnavigation/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commonrightnavigation', ['alipay_mini_qrcode_images', 'alipay_fuwu_qrcode_images', 'weixin_mini_qrcode_images', 'weixin_fuwu_qrcode_images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否'),
|
||||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commonrightnavigation/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'commonrightnavigation', 'data'=>$params], ['alipay_mini_qrcode_images', 'alipay_fuwu_qrcode_images', 'weixin_mini_qrcode_images', 'weixin_fuwu_qrcode_images']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,30 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"commonrightnavigation",
|
||||
"name":"右侧快捷导航",
|
||||
"logo":"\/static\/upload\/images\/plugins_commonrightnavigation\/2019\/02\/15\/1550222872753553.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"浏览器右侧快捷导航",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_css":[
|
||||
"app\\plugins\\commonrightnavigation\\Hook"
|
||||
],
|
||||
"plugins_js":[
|
||||
"app\\plugins\\commonrightnavigation\\Hook"
|
||||
],
|
||||
"plugins_view_common_bottom":[
|
||||
"app\\plugins\\commonrightnavigation\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commonrightnavigation\index;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\AnswerService;
|
||||
use app\service\BuyService;
|
||||
use app\service\UserService;
|
||||
|
||||
/**
|
||||
* 右侧快捷导航 - 前端
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
/**
|
||||
* 留言
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function answer($params = [])
|
||||
{
|
||||
$params = input('post.');
|
||||
$params['user'] = UserService::LoginUserInfo();
|
||||
return AnswerService::AnswerSave($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 购物车
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function cart($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 当前模块/控制器/方法
|
||||
$this->assign('module_controller_action', $module_name.$controller_name.$action_name);
|
||||
|
||||
// 购物车
|
||||
$cart_list = BuyService::CartList(['user'=>UserService::LoginUserInfo()]);
|
||||
|
||||
// 基础数据
|
||||
$base = [
|
||||
'total_price' => empty($cart_list['data']) ? '0.00' : PriceNumberFormat(array_sum(array_column($cart_list['data'], 'total_price'))),
|
||||
'cart_count' => empty($cart_list['data']) ? 0 : count($cart_list['data']),
|
||||
'ids' => empty($cart_list['data']) ? '' : implode(',', array_column($cart_list['data'], 'id')),
|
||||
];
|
||||
$data = [
|
||||
'cart_list' => $cart_list['data'],
|
||||
'base' => $base,
|
||||
];
|
||||
return DataReturn('操作成功', 0, $data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,105 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopmaxpicture;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
/**
|
||||
* 顶部大图广告插件 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否后端钩子
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return $this->html($params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 图片是否为空
|
||||
if(empty($ret['data']['images']))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
// 有效时间
|
||||
if(!empty($ret['data']['time_start']))
|
||||
{
|
||||
// 是否已开始
|
||||
if(strtotime($ret['data']['time_start']) > time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if(!empty($ret['data']['time_end']))
|
||||
{
|
||||
// 是否已结束
|
||||
if(strtotime($ret['data']['time_end']) < time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// 非全局
|
||||
if($ret['data']['is_overall'] != 1)
|
||||
{
|
||||
// 非首页则空
|
||||
if($module_name.$controller_name.$action_name != 'indexindexindex')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopmaxpicture/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopmaxpicture\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 顶部大图广告插件 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopmaxpicture/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopmaxpicture/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'commontopmaxpicture', 'data'=>$params], ['images']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"commontopmaxpicture",
|
||||
"name":"顶部广告",
|
||||
"logo":"\/static\/upload\/images\/plugins_commontopmaxpicture\/2019\/02\/09\/1549671733987654.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"顶部大图广告,突破视觉",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_view_common_top":[
|
||||
"app\\plugins\\commontopmaxpicture\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopnotice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 顶部公告 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否后端钩子
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return $this->html($params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('commontopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 内容是否为空
|
||||
if(empty($ret['data']['content']))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
// 有效时间
|
||||
if(!empty($ret['data']['time_start']))
|
||||
{
|
||||
// 是否已开始
|
||||
if(strtotime($ret['data']['time_start']) > time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if(!empty($ret['data']['time_end']))
|
||||
{
|
||||
// 是否已结束
|
||||
if(strtotime($ret['data']['time_end']) < time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// 非全局
|
||||
if($ret['data']['is_overall'] != 1)
|
||||
{
|
||||
// 非首页则空
|
||||
if($module_name.$controller_name.$action_name != 'indexindexindex')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopnotice/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\commontopnotice\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 顶部公告插件 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commontopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopnotice/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('commontopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/commontopnotice/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'commontopnotice', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"commontopnotice",
|
||||
"name":"顶部公告",
|
||||
"logo":"\/static\/upload\/images\/plugins_commontopnotice\/2019\/02\/12\/1549671733987652.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"顶部公告,通知",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_view_common_top":[
|
||||
"app\\plugins\\commontopnotice\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,154 +0,0 @@
|
||||
<?php
|
||||
namespace app\plugins\expressforkdn;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 快递鸟API接口 - 钩子入口
|
||||
* @author GuoGuo
|
||||
* @blog http://gadmin.cojz8.com/
|
||||
* @version 1.0.0
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
// 应用响应入口
|
||||
public function run($params = [])
|
||||
{
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// 操作按钮
|
||||
case 'plugins_service_order_handle_begin' :
|
||||
$ret = $this->operation($params);
|
||||
break;
|
||||
|
||||
// 弹窗代码
|
||||
case 'plugins_view_common_bottom' :
|
||||
case 'plugins_admin_view_common_bottom' :
|
||||
$ret = $this->html($params);
|
||||
break;
|
||||
|
||||
// 页面底部
|
||||
case 'plugins_common_page_bottom' :
|
||||
case 'plugins_admin_common_page_bottom' :
|
||||
$ret = $this->js($params);
|
||||
break;
|
||||
|
||||
// header代码
|
||||
case 'plugins_common_header' :
|
||||
case 'plugins_admin_common_header' :
|
||||
$ret = $this->css($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* css
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function css($params = [])
|
||||
{
|
||||
return '<style type="text/css">
|
||||
#plugins-expressforkdn-popup p { font-size: 16px; color: #FF9800; font-weight: 500; padding: 1rem; text-align: center; margin: 0; }
|
||||
#plugins-expressforkdn-popup .am-list-static > li { padding: .8rem 1rem; }
|
||||
#plugins-expressforkdn-popup .am-popup-bd { padding: 0; }
|
||||
#plugins-expressforkdn-popup .am-list > li { border: 1px dashed #dedede; border-width: 1px 0; }
|
||||
</style>';
|
||||
}
|
||||
|
||||
/**
|
||||
* js
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function js($params = [])
|
||||
{
|
||||
return '<script type="text/javascript">
|
||||
$(function()
|
||||
{
|
||||
$(".plugins-expressforkdn-submit").on("click", function()
|
||||
{
|
||||
$.ajax({
|
||||
url:"'.PluginsHomeUrl('expressforkdn', 'index', 'getexpinfo').'",
|
||||
type:"POST",
|
||||
dataType:"json",
|
||||
data: {express_id: $(this).data("exp-id"), express_number: $(this).data("exp-num")},
|
||||
success:function(result)
|
||||
{
|
||||
$("#plugins-expressforkdn-popup").modal();
|
||||
if(result.code == 0)
|
||||
{
|
||||
$("#plugins-expressforkdn-popup .am-popup-bd").html(result.data);
|
||||
} else {
|
||||
$("#plugins-expressforkdn-popup .am-popup-bd").html(result.data || result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('expressforkdn', ['images']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/expressforkdn/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function operation($params = [])
|
||||
{
|
||||
if(empty($params['order']))
|
||||
{
|
||||
return DataReturn('订单为空', -1);
|
||||
}
|
||||
|
||||
// 钩子html
|
||||
if(isset($params['order']['status']) && in_array($params['order']['status'], [3,4]))
|
||||
{
|
||||
|
||||
$params['order']['plugins_service_order_handle_operation_html'][] = '<button class="am-btn am-btn-warning am-btn-xs am-radius am-icon-cube am-btn-block plugins-expressforkdn-submit" data-exp-id="'.$params['order']['express_id'].'" data-exp-num="'.$params['order']['express_number'].'"> 物流</button>';
|
||||
}
|
||||
|
||||
return DataReturn('处理成功', 0);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,64 +0,0 @@
|
||||
<?php
|
||||
namespace app\plugins\expressforkdn\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\service\ExpressService;
|
||||
|
||||
/**
|
||||
* 快递鸟API接口 - 后台管理
|
||||
* @author GuoGuo
|
||||
* @blog http://gadmin.cojz8.com/
|
||||
* @version 1.0.0
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
// 后台管理入口
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('expressforkdn');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('express_list', ExpressService::ExpressList());
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/expressforkdn/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('expressforkdn');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('express_list', ExpressService::ExpressList());
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/expressforkdn/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'expressforkdn', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,42 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"expressforkdn",
|
||||
"name":"快递鸟API接口",
|
||||
"logo":"\/static\/upload\/images\/plugins_expressforkdn\/2019\/03\/11\/1552286675575734.png",
|
||||
"author":"guoguo",
|
||||
"author_url":"http:\/\/gadmin.cojz8.com",
|
||||
"version":"1.0.0",
|
||||
"desc":"集成快递鸟第三方后台查询接口",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_view_common_bottom":[
|
||||
"app\\plugins\\expressforkdn\\Hook"
|
||||
],
|
||||
"plugins_admin_view_common_bottom":[
|
||||
"app\\plugins\\expressforkdn\\Hook"
|
||||
],
|
||||
"plugins_common_page_bottom":[
|
||||
"app\\plugins\\expressforkdn\\Hook"
|
||||
],
|
||||
"plugins_admin_common_page_bottom":[
|
||||
"app\\plugins\\expressforkdn\\Hook"
|
||||
],
|
||||
"plugins_common_header":[
|
||||
"app\\plugins\\expressforkdn\\Hook"
|
||||
],
|
||||
"plugins_admin_common_header":[
|
||||
"app\\plugins\\expressforkdn\\Hook"
|
||||
],
|
||||
"plugins_service_order_handle_begin":[
|
||||
"app\\plugins\\expressforkdn\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,179 +0,0 @@
|
||||
<?php
|
||||
namespace app\plugins\expressforkdn\index;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 快递鸟API接口 - 前端
|
||||
* @author GuoGuo
|
||||
* @blog http://gadmin.cojz8.com/
|
||||
* @version 1.0.0
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
/**
|
||||
* 获取物流信息
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-12
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function getexpinfo($params = [])
|
||||
{
|
||||
// html
|
||||
$html = '';
|
||||
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'express_id',
|
||||
'error_msg' => '快递id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'express_number',
|
||||
'error_msg' => '快递单号有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1, '<p>'.$ret.'</p>');
|
||||
}
|
||||
|
||||
// 获取配置数据
|
||||
$ret = PluginsService::PluginsData('expressforkdn');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否配置物流代码
|
||||
if(empty($ret['data']['express_ids'][$params['express_id']]))
|
||||
{
|
||||
return DataReturn('请先再后台配置物流代码', -1, '<p>请先再后台配置物流代码</p>');
|
||||
}
|
||||
|
||||
// 获取快递信息
|
||||
$data = $this->expresstraces(['shipper_code'=>$ret['data']['express_ids'][$params['express_id']],'logistic_code'=>$params['express_number'], 'config'=>$ret['data']]);
|
||||
|
||||
// 状态列表
|
||||
$status_arr = [
|
||||
0 => '暂无物流信息',
|
||||
1 => '快递公司已揽收',
|
||||
2 => '快递正在配送途中...',
|
||||
3 => '该物流已被签收',
|
||||
4 => '该物流问题件,请咨询物流商处理!',
|
||||
];
|
||||
if(!isset($data['State']) || !isset($status_arr[$data['State']]))
|
||||
{
|
||||
return DataReturn('查询失败', -1, '<p>查询失败</p>');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
$html .='<p>'.$status_arr[$data['State']].'</p>';
|
||||
$html .= '<ul class="am-list am-list-static">';
|
||||
|
||||
// 快递信息
|
||||
if(in_array($data['State'], [2,3]) && !empty($data['Traces']) && is_array($data['Traces']))
|
||||
{
|
||||
foreach($data['Traces'] as $k=>$v)
|
||||
{
|
||||
$html .='<li class="items">'.$v['AcceptTime'].''.$v['AcceptStation'].'</li>';
|
||||
}
|
||||
}
|
||||
return DataReturn('处理成功', 0, $html);
|
||||
} else {
|
||||
return DataReturn($ret['msg'], -100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物流信息
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-12
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function expresstraces($params = [])
|
||||
{
|
||||
// 参数
|
||||
if(empty($params['shipper_code']) || empty($params['logistic_code']) || empty($params['config']))
|
||||
{
|
||||
return ['State'=>0, 'Reason'=>'请求参数有误'];
|
||||
}
|
||||
|
||||
// 请求数据
|
||||
$url = 'http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx';
|
||||
$request_data = json_encode([
|
||||
'OrderCode' => '',
|
||||
'ShipperCode' => $params['shipper_code'],
|
||||
'LogisticCode' => $params['logistic_code'],
|
||||
]);
|
||||
$data = array(
|
||||
'EBusinessID' => $params['config']['ebid'],
|
||||
'RequestType' => '1002',
|
||||
'RequestData' => urlencode($request_data) ,
|
||||
'DataType' => '2',
|
||||
);
|
||||
$data['DataSign'] = $this->encrypt($request_data, $params['config']['appkey']);
|
||||
return $this->request_post($url, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* post提交数据
|
||||
* @param string $url 请求Url
|
||||
* @param array $data 提交的数据
|
||||
* @return url响应返回的html
|
||||
*/
|
||||
public function request_post($url, $data)
|
||||
{
|
||||
$temps = array();
|
||||
foreach ($data as $key => $value) {
|
||||
$temps[] = sprintf('%s=%s', $key, $value);
|
||||
}
|
||||
$post_data = implode('&', $temps);
|
||||
$url_info = parse_url($url);
|
||||
if(empty($url_info['port']))
|
||||
{
|
||||
$url_info['port']=80;
|
||||
}
|
||||
$httpheader = "POST " . $url_info['path'] . " HTTP/1.0\r\n";
|
||||
$httpheader.= "Host:" . $url_info['host'] . "\r\n";
|
||||
$httpheader.= "Content-Type:application/x-www-form-urlencoded\r\n";
|
||||
$httpheader.= "Content-Length:" . strlen($post_data) . "\r\n";
|
||||
$httpheader.= "Connection:close\r\n\r\n";
|
||||
$httpheader.= $post_data;
|
||||
$fd = fsockopen($url_info['host'], $url_info['port']);
|
||||
fwrite($fd, $httpheader);
|
||||
$gets = "";
|
||||
$headerFlag = true;
|
||||
while (!feof($fd)) {
|
||||
if (($header = @fgets($fd)) && ($header == "\r\n" || $header == "\n")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (!feof($fd)) {
|
||||
$gets.= fread($fd, 128);
|
||||
}
|
||||
fclose($fd);
|
||||
|
||||
return json_decode($gets, true);
|
||||
}
|
||||
/**
|
||||
* 电商Sign签名生成
|
||||
* @param data 内容
|
||||
* @param appkey Appkey
|
||||
* @return DataSign签名
|
||||
*/
|
||||
public function encrypt($data, $appkey) {
|
||||
return urlencode(base64_encode(md5($data.$appkey)));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,134 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\footercustomerservice;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\footercustomerservice\service\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 底部客户服务介绍插件 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// css
|
||||
case 'plugins_css' :
|
||||
$ret = $this->CssFile($params);
|
||||
break;
|
||||
|
||||
// 底部导航上面钩子
|
||||
case 'plugins_view_common_footer_top' :
|
||||
$ret = $this->FooterServerData($params);
|
||||
break;
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户服务数据
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function FooterServerData($params = [])
|
||||
{
|
||||
$ret = $this->IsNormal($params);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/footercustomerservice/index/public/content');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* css
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function CssFile($params = [])
|
||||
{
|
||||
$ret = $this->IsNormal($params);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
return __MY_ROOT_PUBLIC__.'static/plugins/css/footercustomerservice/index/style.css';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否正常
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-23
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
private function IsNormal($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('footercustomerservice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否仅首页
|
||||
if(isset($ret['data']['is_only_home']) && $ret['data']['is_only_home'] == 1)
|
||||
{
|
||||
// 非首页则空
|
||||
if($module_name.$controller_name.$action_name != 'indexindexindex')
|
||||
{
|
||||
return DataReturn('仅首页展示', -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取图片列表
|
||||
$ret = Service::DataList();
|
||||
if($ret['code'] == 0 && !empty($ret['data']))
|
||||
{
|
||||
return DataReturn('成功', 0, $ret['data']);
|
||||
}
|
||||
|
||||
return DataReturn('失败', -100);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,199 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\footercustomerservice\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\footercustomerservice\service\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 底部客户服务介绍插件 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('footercustomerservice', null, false);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数据列表
|
||||
$list = Service::DataList();
|
||||
$this->assign('data_list', $list['data']);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/footercustomerservice/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('footercustomerservice', null, false);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/footercustomerservice/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
$list = Service::DataList();
|
||||
$params['data_list'] = $list['data'];
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'footercustomerservice', 'data'=>$params]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据列表页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function dataindex($params = [])
|
||||
{
|
||||
$list = Service::DataList();
|
||||
if($list['code'] == 0)
|
||||
{
|
||||
$this->assign('data_list', $list['data']);
|
||||
return $this->fetch('../../../plugins/view/footercustomerservice/admin/admin/dataindex');
|
||||
} else {
|
||||
return $list['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表编辑
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datainfo($params = [])
|
||||
{
|
||||
// 数据
|
||||
$data = [];
|
||||
if(!empty($params['id']))
|
||||
{
|
||||
$data_params = [
|
||||
'get_id' => $params['id'],
|
||||
];
|
||||
$ret = Service::DataList($data_params);
|
||||
$data = empty($ret['data']) ? [] : $ret['data'];
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
|
||||
return $this->fetch('../../../plugins/view/footercustomerservice/admin/admin/datainfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datasave($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::DataSave($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-15T11:03:30+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datadelete($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::DataDelete($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表状态更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-01-12T22:23:06+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datastatusupdate($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::DataStatusUpdate($params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,27 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"footercustomerservice",
|
||||
"name":"底部客户服务介绍",
|
||||
"logo":"\/static\/upload\/images\/plugins_footercustomerservice\/2019\/04\/23\/1555984179784604.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"底部客户服务介绍,最多可添加4项",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_css":[
|
||||
"app\\plugins\\footercustomerservice\\Hook"
|
||||
],
|
||||
"plugins_view_common_footer_top":[
|
||||
"app\\plugins\\footercustomerservice\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,228 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\footercustomerservice\service;
|
||||
|
||||
use app\service\PluginsService;
|
||||
use app\service\ResourcesService;
|
||||
|
||||
/**
|
||||
* 底部客户服务介绍服务层
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
/**
|
||||
* 获取数据列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataList($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('footercustomerservice');
|
||||
$data = (empty($ret['data']) || empty($ret['data']['data_list'])) ? [] : $ret['data']['data_list'];
|
||||
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_is_enable_tips = lang('common_is_enable_tips');
|
||||
$common_is_text_list = lang('common_is_text_list');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 是否启用
|
||||
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
|
||||
|
||||
// 图片地址
|
||||
$v['images_url_old'] = $v['images_url'];
|
||||
$v['images_url'] = ResourcesService::AttachmentPathViewHandle($v['images_url']);
|
||||
|
||||
// 时间
|
||||
$v['operation_time_time'] = empty($v['operation_time']) ? '' : date('Y-m-d H:i:s', $v['operation_time']);
|
||||
$v['operation_time_date'] = empty($v['operation_time']) ? '' : date('Y-m-d', $v['operation_time']);
|
||||
}
|
||||
}
|
||||
|
||||
// 是否读取单条
|
||||
if(!empty($params['get_id']) && isset($data[$params['get_id']]))
|
||||
{
|
||||
$data = $data[$params['get_id']];
|
||||
}
|
||||
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataSave($params = [])
|
||||
{
|
||||
// 请求类型
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'length',
|
||||
'key_name' => 'name',
|
||||
'checked_data' => '1,8',
|
||||
'error_msg' => '名称长度 1~8 个字符',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'length',
|
||||
'key_name' => 'desc',
|
||||
'checked_data' => '30',
|
||||
'error_msg' => '描述格式最多 30 个字符',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'images_url',
|
||||
'checked_data' => '255',
|
||||
'error_msg' => '请上传图片',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 附件
|
||||
$data_fields = ['images_url'];
|
||||
$attachment = ResourcesService::AttachmentParams($params, $data_fields);
|
||||
|
||||
// 数据
|
||||
$data = [
|
||||
'name' => $params['name'],
|
||||
'desc' => $params['desc'],
|
||||
'images_url' => $attachment['data']['images_url'],
|
||||
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
|
||||
'operation_time' => time(),
|
||||
];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('footercustomerservice', null, false);
|
||||
|
||||
// 数据id
|
||||
$data['id'] = (empty($params['id']) || empty($ret['data']) || empty($ret['data']['data_list'][$params['id']])) ? date('YmdHis').GetNumberCode(6) : $params['id'];
|
||||
$ret['data']['data_list'][$data['id']] = $data;
|
||||
|
||||
// 添加最多添加4条
|
||||
if(empty($params['id']))
|
||||
{
|
||||
if(count($ret['data']['data_list']) > 4)
|
||||
{
|
||||
return DataReturn('最多添加4条数据', -1);
|
||||
}
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'footercustomerservice', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataDelete($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('footercustomerservice', null, false);
|
||||
$ret['data']['data_list'] = (empty($ret['data']) || empty($ret['data']['data_list'])) ? [] : $ret['data']['data_list'];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data']['data_list'][$params['id']]))
|
||||
{
|
||||
unset($ret['data']['data_list'][$params['id']]);
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'footercustomerservice', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataStatusUpdate($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'field',
|
||||
'error_msg' => '操作字段有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'in',
|
||||
'key_name' => 'state',
|
||||
'checked_data' => [0,1],
|
||||
'error_msg' => '状态有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('footercustomerservice', null, false);
|
||||
$ret['data']['data_list'] = (empty($ret['data']) || empty($ret['data']['data_list'])) ? [] : $ret['data']['data_list'];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data']['data_list'][$params['id']]) && isset($ret['data']['data_list'][$params['id']][$params['field']]))
|
||||
{
|
||||
$ret['data']['data_list'][$params['id']][$params['field']] = intval($params['state']);
|
||||
$ret['data']['data_list'][$params['id']]['operation_time'] = time();
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'footercustomerservice', 'data'=>$ret['data']]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,316 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\freightfee;
|
||||
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 运费设置 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// css
|
||||
case 'plugins_css' :
|
||||
$ret = __MY_ROOT_PUBLIC__.'static/plugins/css/freightfee/index/style.css';
|
||||
break;
|
||||
|
||||
// 运费计算
|
||||
case 'plugins_service_buy_handle' :
|
||||
$ret = $this->FreightFeeCalculate($params);
|
||||
break;
|
||||
|
||||
// 商品免运费icon
|
||||
case 'plugins_view_goods_detail_title' :
|
||||
$ret = $this->FreeShippingGoodsIcon($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品免运费icon
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-26
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
private function FreeShippingGoodsIcon($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('freightfee');
|
||||
if($ret['code'] == 0 && !empty($ret['data']['goods_ids']) && !empty($params['goods_id']))
|
||||
{
|
||||
$goods_all = explode(',', $ret['data']['goods_ids']);
|
||||
if(in_array($params['goods_id'], $goods_all))
|
||||
{
|
||||
return '<span class="am-badge am-radius plugins-freightfee-goods-icon">免运费</span>';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 运费计算
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-21
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function FreightFeeCalculate($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('freightfee');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 默认运费
|
||||
$price = 0;
|
||||
|
||||
// 支付方式免运费
|
||||
$is_payment = true;
|
||||
if(!empty($ret['data']['payment']) && !empty($params['params']['payment_id']))
|
||||
{
|
||||
$payment = array_map(function($v){return explode('-', $v);}, explode(',', $ret['data']['payment']));
|
||||
if(!empty($payment) && is_array($payment))
|
||||
{
|
||||
foreach($payment as $v)
|
||||
{
|
||||
if(isset($v[0]) && $v[0] == $params['params']['payment_id'])
|
||||
{
|
||||
$is_payment = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 免运费商品
|
||||
$free_goods = $this->FreeShippingGoods(empty($ret['data']['goods_ids']) ? '' : $ret['data']['goods_ids'], $params);
|
||||
$params['data']['base']['buy_count'] -= $free_goods['buy_count'];
|
||||
$params['data']['base']['spec_weight_total'] -= $free_goods['spec_weight'];
|
||||
|
||||
// 是否设置运费数据
|
||||
if($is_payment === true && !empty($ret['data']['data'][0]))
|
||||
{
|
||||
// 规则
|
||||
$rules = $this->RulesHandle($ret['data']['data'], $params['data']['base']['address']);
|
||||
|
||||
// 计费方式
|
||||
if(!empty($rules))
|
||||
{
|
||||
// 订单金额满免运费
|
||||
if(empty($rules['free_shipping_price']) || $params['data']['base']['total_price'] < $rules['free_shipping_price'])
|
||||
{
|
||||
// 根据规则计算运费
|
||||
switch($ret['data']['valuation'])
|
||||
{
|
||||
// 按件
|
||||
case 0 :
|
||||
$price = $this->PieceCalculate($rules, $params['data']);
|
||||
break;
|
||||
|
||||
// 按量
|
||||
case 1 :
|
||||
$price = $this->QuantityCalculate($rules, $params['data']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 扩展展示数据
|
||||
$show_name = empty($ret['data']['show_name']) ? '运费' : $ret['data']['show_name'];
|
||||
$params['data']['extension_data'][] = [
|
||||
'name' => $show_name,
|
||||
'price' => $price,
|
||||
'type' => 1,
|
||||
'tips' => '+¥'.$price.'元',
|
||||
];
|
||||
|
||||
// 金额
|
||||
$params['data']['base']['increase_price'] += $price;
|
||||
$params['data']['base']['actual_price'] += $price;
|
||||
|
||||
return DataReturn('无需处理', 0);
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 免运费商品
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-26
|
||||
* @desc description
|
||||
* @param [string] $goods_ids [商品ids]
|
||||
* @param [array] $params [钩子参数]
|
||||
*/
|
||||
private function FreeShippingGoods($goods_ids, $params)
|
||||
{
|
||||
$result = [
|
||||
'buy_count' => 0,
|
||||
'spec_weight' => 0,
|
||||
];
|
||||
if(!empty($goods_ids))
|
||||
{
|
||||
$goods_all = explode(',', $goods_ids);
|
||||
foreach($params['data']['goods'] as $goods)
|
||||
{
|
||||
if(in_array($goods['goods_id'], $goods_all))
|
||||
{
|
||||
$result['buy_count'] += $goods['stock'];
|
||||
$result['spec_weight'] += $goods['spec_weight'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按重计费
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-21
|
||||
* @desc description
|
||||
* @param [array] $rules [规则]
|
||||
* @param [array] $buy [生成订单数据]
|
||||
*/
|
||||
public function QuantityCalculate($rules, $buy)
|
||||
{
|
||||
$price = 0;
|
||||
if($rules['first_price'] > 0 && $buy['base']['spec_weight_total'] >= $rules['first'])
|
||||
{
|
||||
$price = $rules['first_price'];
|
||||
}
|
||||
if($rules['continue_price'] > 0 && $buy['base']['spec_weight_total'] >= $rules['continue']+$rules['first'])
|
||||
{
|
||||
$number = ($buy['base']['spec_weight_total']-$rules['first'])/$rules['continue'];
|
||||
if($number > 0)
|
||||
{
|
||||
$price += round($rules['continue_price']*$number);
|
||||
}
|
||||
}
|
||||
|
||||
return $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按件计费
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-21
|
||||
* @desc description
|
||||
* @param [array] $rules [规则]
|
||||
* @param [array] $buy [生成订单数据]
|
||||
*/
|
||||
public function PieceCalculate($rules, $buy)
|
||||
{
|
||||
$price = 0;
|
||||
if($rules['first_price'] > 0 && $buy['base']['buy_count'] >= $rules['first'])
|
||||
{
|
||||
$price = $rules['first_price'];
|
||||
}
|
||||
if($rules['continue_price'] > 0 && $buy['base']['buy_count'] >= $rules['continue']+$rules['first'])
|
||||
{
|
||||
$number = round(($buy['base']['buy_count']-$rules['first'])/$rules['continue']);
|
||||
if($number > 0)
|
||||
{
|
||||
$price += round($rules['continue_price']*$number);
|
||||
}
|
||||
}
|
||||
|
||||
return $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运费规则匹配
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-21
|
||||
* @desc description
|
||||
* @param [array] $rules [运费规则列表]
|
||||
* @param [array] $address [用户地址]
|
||||
*/
|
||||
public function RulesHandle($rules, $address)
|
||||
{
|
||||
if(count($rules) > 1 && !empty($address))
|
||||
{
|
||||
$data = [
|
||||
'province' => ['rules' => [], 'number' => 0],
|
||||
'city' => ['rules' => [], 'number' => 0],
|
||||
];
|
||||
foreach($rules as $k=>$v)
|
||||
{
|
||||
if($k != 0)
|
||||
{
|
||||
$region = explode('-', $v['region']);
|
||||
if(!empty($region))
|
||||
{
|
||||
if(in_array($address['province'], $region))
|
||||
{
|
||||
$data['province']['rules'] = $v;
|
||||
$data['province']['number']++;
|
||||
}
|
||||
if(in_array($address['city'], $region))
|
||||
{
|
||||
$data['city']['rules'] = $v;
|
||||
$data['city']['number']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($data['city']['number'] > 0)
|
||||
{
|
||||
if($data['province']['number'] > $data['city']['number'])
|
||||
{
|
||||
return $data['province']['rules'];
|
||||
}
|
||||
return $data['city']['rules'];
|
||||
} else {
|
||||
if($data['province']['number'] > 0)
|
||||
{
|
||||
return $data['province']['rules'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $rules[0];
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,128 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\freightfee\admin;
|
||||
|
||||
use think\Db;
|
||||
use think\Controller;
|
||||
use app\plugins\freightfee\service\Service;
|
||||
use app\service\PluginsService;
|
||||
use app\service\RegionService;
|
||||
use app\service\PaymentService;
|
||||
use app\service\GoodsService;
|
||||
|
||||
/**
|
||||
* 运费设置 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('freightfee');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', Service::DataHandle($ret['data']));
|
||||
return $this->fetch('../../../plugins/view/freightfee/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('freightfee');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '按件数', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '按重量'),
|
||||
];
|
||||
|
||||
// 地区
|
||||
$region = RegionService::RegionItems(['pid'=>0, 'field'=>'id,name']);
|
||||
if(!empty($region))
|
||||
{
|
||||
$region = array_map(function($v)
|
||||
{
|
||||
$v['items'] = RegionService::RegionItems(['pid'=>$v['id'], 'field'=>'id,name']);
|
||||
return $v;
|
||||
}, $region);
|
||||
}
|
||||
|
||||
// 支付方式
|
||||
$this->assign('payment_list', PaymentService::PaymentList(['is_enable'=>1, 'is_open_user'=>1]));
|
||||
|
||||
// 商品分类
|
||||
$this->assign('goods_category_list', GoodsService::GoodsCategoryAll());
|
||||
|
||||
$this->assign('region_list', $region);
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', Service::DataHandle($ret['data']));
|
||||
return $this->fetch('../../../plugins/view/freightfee/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'freightfee', 'data'=>$params]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function goodssearch($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 搜索数据
|
||||
return Service::GoodsSearchList($params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,34 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"freightfee",
|
||||
"name":"运费设置",
|
||||
"logo":"\/static\/upload\/images\/plugins_freightfee\/2019\/03\/18\/1552894366387964.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.2.0",
|
||||
"desc":"快递运费设置",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5",
|
||||
"app",
|
||||
"alipay",
|
||||
"weixin",
|
||||
"baidu"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_css":[
|
||||
"app\\plugins\\freightfee\\Hook"
|
||||
],
|
||||
"plugins_service_buy_handle":[
|
||||
"app\\plugins\\freightfee\\Hook"
|
||||
],
|
||||
"plugins_view_goods_detail_title":[
|
||||
"app\\plugins\\freightfee\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,132 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\freightfee\service;
|
||||
|
||||
use think\Db;
|
||||
use app\service\ResourcesService;
|
||||
use app\service\GoodsService;
|
||||
use app\service\AnswerService;
|
||||
|
||||
/**
|
||||
* 运费设置服务层
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
/**
|
||||
* 数据处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-22
|
||||
* @desc description
|
||||
* @param [array] $data [应用数据]
|
||||
*/
|
||||
public static function DataHandle($data)
|
||||
{
|
||||
if(!empty($data['data']))
|
||||
{
|
||||
// 支付方式
|
||||
if(empty($data['payment']))
|
||||
{
|
||||
$data['payment'] = [];
|
||||
$data['payment_names'] = '';
|
||||
} else {
|
||||
$data['payment'] = explode(',', $data['payment']);
|
||||
$data['payment_names'] = implode('、', array_map(function($v){return mb_substr($v, strrpos($v, '-')+1, null, 'utf-8');}, $data['payment']));
|
||||
}
|
||||
|
||||
// 地区
|
||||
foreach($data['data'] as &$v)
|
||||
{
|
||||
$v['region_names'] = (empty($v['region_show']) || $v['region_show'] == 'default') ? '' : implode('、', Db::name('Region')->where('id', 'in', explode('-', $v['region_show']))->column('name'));
|
||||
}
|
||||
|
||||
// 商品列表
|
||||
$data['goods_list'] = empty($data['goods_ids']) ? [] : self::GoodsList($data['goods_ids']);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品搜索
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function GoodsSearchList($params = [])
|
||||
{
|
||||
// 条件
|
||||
$where = [
|
||||
['g.is_delete_time', '=', 0],
|
||||
['g.is_shelves', '=', 1]
|
||||
];
|
||||
|
||||
// 关键字
|
||||
if(!empty($params['keywords']))
|
||||
{
|
||||
$where[] = ['g.title', 'like', '%'.$params['keywords'].'%'];
|
||||
}
|
||||
|
||||
// 分类id
|
||||
if(!empty($params['category_id']))
|
||||
{
|
||||
$category_ids = GoodsService::GoodsCategoryItemsIds([$params['category_id']], 1);
|
||||
$category_ids[] = $params['category_id'];
|
||||
$where[] = ['gci.category_id', 'in', $category_ids];
|
||||
}
|
||||
|
||||
// 指定字段
|
||||
$field = 'g.id,g.title';
|
||||
|
||||
// 获取数据
|
||||
return GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field, 'is_admin_access'=>1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
* @param [string] $goods_ids [商品id]
|
||||
*/
|
||||
public static function GoodsList($goods_ids = [])
|
||||
{
|
||||
// 商品id
|
||||
if(empty($goods_ids))
|
||||
{
|
||||
return [];
|
||||
} else {
|
||||
$goods_ids = explode(',', $goods_ids);
|
||||
}
|
||||
|
||||
// 条件
|
||||
$where = [
|
||||
['g.is_delete_time', '=', 0],
|
||||
['g.is_shelves', '=', 1],
|
||||
['g.id', 'in', $goods_ids],
|
||||
];
|
||||
|
||||
// 指定字段
|
||||
$field = 'g.id,g.title,g.images,g.price';
|
||||
|
||||
// 获取数据
|
||||
$ret = GoodsService::CategoryGoodsList(['where'=>$where, 'm'=>0, 'n'=>100, 'field'=>$field]);
|
||||
return $ret['data'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,138 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\homemiddleadv;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\homemiddleadv\service\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 首页中间广告插件 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// style css
|
||||
case 'plugins_common_header' :
|
||||
$ret = $this->StyleCss($params);
|
||||
break;
|
||||
|
||||
// 楼层数据上面
|
||||
case 'plugins_view_home_floor_top' :
|
||||
$ret = $this->HomeFloorTopAdv($params);
|
||||
break;
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页楼层顶部广告
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function HomeFloorTopAdv($params = [])
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('homemiddleadv');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 有效时间
|
||||
if(!empty($ret['data']['time_start']))
|
||||
{
|
||||
// 是否已开始
|
||||
if(strtotime($ret['data']['time_start']) > time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if(!empty($ret['data']['time_end']))
|
||||
{
|
||||
// 是否已结束
|
||||
if(strtotime($ret['data']['time_end']) < time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取图片列表
|
||||
$ret = Service::DataList();
|
||||
if($ret['code'] == 0 && !empty($ret['data']))
|
||||
{
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/homemiddleadv/index/public/content');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* css
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function StyleCss($params = [])
|
||||
{
|
||||
return '<style type="text/css">
|
||||
@media only screen and (min-width:640px) {
|
||||
.plugins-homemiddleadv-home-adv ul.am-gallery img {
|
||||
-webkit-transition: transform .3s ease-in;
|
||||
-moz-transition: transform .3s ease-in;
|
||||
-ms-transition: transform .3s ease-in;
|
||||
-o-transition: transform .3s ease-in;
|
||||
transition: transform .3s ease-in;
|
||||
}
|
||||
.plugins-homemiddleadv-home-adv ul.am-gallery img:hover {
|
||||
-ms-transform: translate3d(0px, -3px, 0px);
|
||||
-webkit-transform: translate3d(0px, -3px, 0px);
|
||||
-o-transform: translate3d(0px, -3px, 0px);
|
||||
transform: translate3d(0px, -3px, 0px);
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width:1025px) {
|
||||
.plugins-homemiddleadv-home-adv {
|
||||
overflow: hidden;
|
||||
}
|
||||
.plugins-homemiddleadv-home-adv ul.am-gallery {
|
||||
width: calc(100% + 20px);
|
||||
margin-left: -10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,192 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\homemiddleadv\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\homemiddleadv\service\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 首页中间广告插件 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('homemiddleadv', null, false);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 数据列表
|
||||
$list = Service::DataList();
|
||||
$this->assign('data_list', $list['data']);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/homemiddleadv/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('homemiddleadv', null, false);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/homemiddleadv/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
$list = Service::DataList();
|
||||
$params['data_list'] = $list['data'];
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'homemiddleadv', 'data'=>$params]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据列表页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function dataindex($params = [])
|
||||
{
|
||||
$list = Service::DataList();
|
||||
if($list['code'] == 0)
|
||||
{
|
||||
$this->assign('data_list', $list['data']);
|
||||
return $this->fetch('../../../plugins/view/homemiddleadv/admin/admin/dataindex');
|
||||
} else {
|
||||
return $list['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表编辑
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datainfo($params = [])
|
||||
{
|
||||
// 数据
|
||||
$data = [];
|
||||
if(!empty($params['id']))
|
||||
{
|
||||
$data_params = [
|
||||
'get_id' => $params['id'],
|
||||
];
|
||||
$ret = Service::DataList($data_params);
|
||||
$data = empty($ret['data']) ? [] : $ret['data'];
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
|
||||
return $this->fetch('../../../plugins/view/homemiddleadv/admin/admin/datainfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datasave($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::DataSave($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-15T11:03:30+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datadelete($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::DataDelete($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表状态更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-01-12T22:23:06+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function datastatusupdate($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::DataStatusUpdate($params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,27 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"homemiddleadv",
|
||||
"name":"首页中间广告",
|
||||
"logo":"\/static\/upload\/images\/plugins_homemiddleadv\/2019\/04\/22\/1555917416820968.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"首页中间广告,推荐位",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_common_header":[
|
||||
"app\\plugins\\homemiddleadv\\Hook"
|
||||
],
|
||||
"plugins_view_home_floor_top":[
|
||||
"app\\plugins\\homemiddleadv\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,224 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\homemiddleadv\service;
|
||||
|
||||
use app\service\PluginsService;
|
||||
use app\service\ResourcesService;
|
||||
|
||||
/**
|
||||
* 首页中间广告服务层
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
/**
|
||||
* 获取数据列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataList($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('homemiddleadv');
|
||||
$data = (empty($ret['data']) || empty($ret['data']['data_list'])) ? [] : $ret['data']['data_list'];
|
||||
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_is_enable_tips = lang('common_is_enable_tips');
|
||||
$common_is_text_list = lang('common_is_text_list');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 是否新创建
|
||||
$v['is_new_window_open_text'] = $common_is_text_list[$v['is_new_window_open']]['name'];
|
||||
|
||||
// 是否启用
|
||||
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
|
||||
|
||||
// 图片地址
|
||||
$v['images_url_old'] = $v['images_url'];
|
||||
$v['images_url'] = ResourcesService::AttachmentPathViewHandle($v['images_url']);
|
||||
|
||||
// 时间
|
||||
$v['operation_time_time'] = empty($v['operation_time']) ? '' : date('Y-m-d H:i:s', $v['operation_time']);
|
||||
$v['operation_time_date'] = empty($v['operation_time']) ? '' : date('Y-m-d', $v['operation_time']);
|
||||
}
|
||||
}
|
||||
|
||||
// 是否读取单条
|
||||
if(!empty($params['get_id']) && isset($data[$params['get_id']]))
|
||||
{
|
||||
$data = $data[$params['get_id']];
|
||||
}
|
||||
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataSave($params = [])
|
||||
{
|
||||
// 请求类型
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'length',
|
||||
'key_name' => 'name',
|
||||
'checked_data' => '2,60',
|
||||
'error_msg' => '名称长度 2~60 个字符',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'images_url',
|
||||
'checked_data' => '255',
|
||||
'error_msg' => '请上传图片',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'fun',
|
||||
'key_name' => 'url',
|
||||
'is_checked' => 1,
|
||||
'checked_data' => 'CheckUrl',
|
||||
'error_msg' => 'url格式有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 附件
|
||||
$data_fields = ['images_url'];
|
||||
$attachment = ResourcesService::AttachmentParams($params, $data_fields);
|
||||
|
||||
// 数据
|
||||
$data = [
|
||||
'name' => $params['name'],
|
||||
'url' => $params['url'],
|
||||
'images_url' => $attachment['data']['images_url'],
|
||||
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
|
||||
'is_new_window_open' => isset($params['is_new_window_open']) ? intval($params['is_new_window_open']) : 0,
|
||||
'operation_time' => time(),
|
||||
];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('homemiddleadv', null, false);
|
||||
|
||||
// 数据id
|
||||
$data['id'] = (empty($params['id']) || empty($ret['data']) || empty($ret['data']['data_list'][$params['id']])) ? date('YmdHis').GetNumberCode(6) : $params['id'];
|
||||
$ret['data']['data_list'][$data['id']] = $data;
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'homemiddleadv', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataDelete($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('homemiddleadv', null, false);
|
||||
$ret['data']['data_list'] = (empty($ret['data']) || empty($ret['data']['data_list'])) ? [] : $ret['data']['data_list'];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data']['data_list'][$params['id']]))
|
||||
{
|
||||
unset($ret['data']['data_list'][$params['id']]);
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'homemiddleadv', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表状态更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataStatusUpdate($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'field',
|
||||
'error_msg' => '操作字段有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'in',
|
||||
'key_name' => 'state',
|
||||
'checked_data' => [0,1],
|
||||
'error_msg' => '状态有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('homemiddleadv', null, false);
|
||||
$ret['data']['data_list'] = (empty($ret['data']) || empty($ret['data']['data_list'])) ? [] : $ret['data']['data_list'];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data']['data_list'][$params['id']]) && isset($ret['data']['data_list'][$params['id']][$params['field']]))
|
||||
{
|
||||
$ret['data']['data_list'][$params['id']][$params['field']] = intval($params['state']);
|
||||
$ret['data']['data_list'][$params['id']]['operation_time'] = time();
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'homemiddleadv', 'data'=>$ret['data']]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,203 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\membershiplevel;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\membershiplevel\service\Service;
|
||||
|
||||
/**
|
||||
* 会员等级插件 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 后端访问不处理
|
||||
if(isset($params['params']['is_admin_access']) && $params['params']['is_admin_access'] == 1)
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
|
||||
// 钩子名称
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 页面参数
|
||||
$input = input();
|
||||
|
||||
$ret = '';
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
case 'plugins_css' :
|
||||
$ret = __MY_ROOT_PUBLIC__.'static/plugins/css/membershiplevel/index/style.css';
|
||||
break;
|
||||
|
||||
// 商品数据处理后
|
||||
case 'plugins_service_goods_handle_end' :
|
||||
if($module_name != 'admin')
|
||||
{
|
||||
$this->GoodsHandleEnd($params['goods']);
|
||||
}
|
||||
break;
|
||||
|
||||
// 商品规格基础数据
|
||||
case 'plugins_service_goods_spec_base' :
|
||||
$this->GoodsSpecBase($params['spec_base']);
|
||||
break;
|
||||
|
||||
// 满减优惠
|
||||
case 'plugins_service_buy_handle' :
|
||||
$ret = $this->FullReductionCalculate($params);
|
||||
break;
|
||||
|
||||
// 用户登录成功信息纪录钩子 icon处理
|
||||
case 'plugins_service_user_login_success_record' :
|
||||
$ret = $this->UserLoginSuccessIconHandle($params);
|
||||
break;
|
||||
}
|
||||
return $ret;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户icon处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-28
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
private function UserLoginSuccessIconHandle($params = [])
|
||||
{
|
||||
if(!empty($params['user']))
|
||||
{
|
||||
// 用户等级
|
||||
$level = Service::UserLevelMatching($params['user']);
|
||||
if(!empty($level) && $level['images_url'])
|
||||
{
|
||||
$params['user']['icon'] = $level['images_url'];
|
||||
}
|
||||
}
|
||||
return DataReturn('处理成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减计算
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-21
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function FullReductionCalculate($params = [])
|
||||
{
|
||||
// 用户等级
|
||||
$level = Service::UserLevelMatching();
|
||||
if(!empty($level) && $level['order_price'] > 0 && $level['full_reduction_price'] > 0 && $params['data']['base']['total_price'] >= $level['order_price'])
|
||||
{
|
||||
// 扩展展示数据
|
||||
$show_name = $level['name'].'-满减';
|
||||
$params['data']['extension_data'][] = [
|
||||
'name' => $show_name,
|
||||
'price' => $level['full_reduction_price'],
|
||||
'type' => 1,
|
||||
'tips' => '-¥'.$level['full_reduction_price'].'元',
|
||||
];
|
||||
|
||||
// 金额
|
||||
$params['data']['base']['preferential_price'] += $level['full_reduction_price'];
|
||||
$params['data']['base']['actual_price'] -= $level['full_reduction_price'];
|
||||
|
||||
return DataReturn('处理成功', 0);
|
||||
}
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品处理结束钩子
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-26
|
||||
* @desc description
|
||||
* @param [array] &$goods [商品数据]
|
||||
*/
|
||||
private function GoodsHandleEnd(&$goods = [])
|
||||
{
|
||||
// 用户等级
|
||||
$level = Service::UserLevelMatching();
|
||||
if(!empty($level) && $level['discount_rate'] > 0)
|
||||
{
|
||||
// 无价格字段则不处理
|
||||
if(isset($goods['price']))
|
||||
{
|
||||
$goods['original_price'] = $goods['price'];
|
||||
$goods['price'] = Service::PriceCalculate($goods['price'], $level['discount_rate'], 0);
|
||||
$price_title = empty($level['name']) ? '会员价' : $level['name'];
|
||||
$goods['show_field_price_text'] = '<span class="plugins-membershiplevel-goods-price-icon" title="'.$price_title.'">'.$price_title.'</span>';
|
||||
}
|
||||
|
||||
// 最低价最高价
|
||||
if(isset($goods['min_price']))
|
||||
{
|
||||
$goods['min_price'] = Service::PriceCalculate($goods['min_price'], $level['discount_rate'], 0);
|
||||
}
|
||||
if(isset($goods['max_price']))
|
||||
{
|
||||
$goods['max_price'] = Service::PriceCalculate($goods['max_price'], $level['discount_rate'], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格基础数据
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-26
|
||||
* @desc description
|
||||
* @param [array] &$spec_base [规格信息]
|
||||
*/
|
||||
private function GoodsSpecBase(&$spec_base = [])
|
||||
{
|
||||
// 用户等级
|
||||
$level = Service::UserLevelMatching();
|
||||
if(!empty($level) && $level['discount_rate'] > 0 && isset($spec_base['price']))
|
||||
{
|
||||
if(empty($spec_base['original_price']))
|
||||
{
|
||||
$spec_base['original_price'] = $spec_base['price'];
|
||||
}
|
||||
$spec_base['price'] = Service::PriceCalculate($spec_base['price'], $level['discount_rate'], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,88 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\membershiplevel\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\membershiplevel\service\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 会员等级插件 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('membershiplevel', Service::$base_config_attachment_field, false);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 等级规则
|
||||
$this->assign('members_level_rules_list', Service::$members_level_rules_list);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/membershiplevel/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('membershiplevel', Service::$base_config_attachment_field, false);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 等级规则
|
||||
$this->assign('members_level_rules_list', Service::$members_level_rules_list);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/membershiplevel/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
// 会员等级数据
|
||||
$level = Service::LevelDataList();
|
||||
$params['level_list'] = $level['data'];
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'membershiplevel', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,135 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\membershiplevel\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\membershiplevel\service\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 会员等级管理插件 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Level extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 等级页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = Service::LevelDataList();
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data_list', $ret['data']);
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch('../../../plugins/view/membershiplevel/admin/level/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级编辑
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
// 数据
|
||||
$data = [];
|
||||
if(!empty($params['id']))
|
||||
{
|
||||
$data_params = [
|
||||
'get_id' => $params['id'],
|
||||
];
|
||||
$ret = Service::LevelDataList($data_params);
|
||||
$data = empty($ret['data']) ? [] : $ret['data'];
|
||||
}
|
||||
$this->assign('data', $data);
|
||||
|
||||
return $this->fetch('../../../plugins/view/membershiplevel/admin/level/saveinfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
return Service::LevelDataSave($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级状态更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-01-12T22:23:06+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function statusupdate($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
$params['data_field'] = 'level_list';
|
||||
return Service::DataStatusUpdate($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-15T11:03:30+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function delete($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
return $this->error('非法访问');
|
||||
}
|
||||
|
||||
// 开始处理
|
||||
$params['data_field'] = 'level_list';
|
||||
return Service::DataDelete($params);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,40 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"membershiplevel",
|
||||
"name":"会员等级",
|
||||
"logo":"\/static\/upload\/images\/plugins_membershiplevel\/2019\/04\/25\/1556163954923228.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"根据不同等级设置不同折扣,满减优惠",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5",
|
||||
"app",
|
||||
"alipay",
|
||||
"weixin",
|
||||
"baidu"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_css":[
|
||||
"app\\plugins\\membershiplevel\\Hook"
|
||||
],
|
||||
"plugins_service_goods_handle_end":[
|
||||
"app\\plugins\\membershiplevel\\Hook"
|
||||
],
|
||||
"plugins_service_goods_spec_base":[
|
||||
"app\\plugins\\membershiplevel\\Hook"
|
||||
],
|
||||
"plugins_service_buy_handle":[
|
||||
"app\\plugins\\membershiplevel\\Hook"
|
||||
],
|
||||
"plugins_service_user_login_success_record":[
|
||||
"app\\plugins\\membershiplevel\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,460 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\membershiplevel\service;
|
||||
|
||||
use think\Db;
|
||||
use app\service\PluginsService;
|
||||
use app\service\ResourcesService;
|
||||
use app\service\UserService;
|
||||
|
||||
/**
|
||||
* 会员等级服务层
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
// 基础数据附件字段
|
||||
public static $base_config_attachment_field = [
|
||||
'default_level_images'
|
||||
];
|
||||
|
||||
// 等级规则
|
||||
public static $members_level_rules_list = [
|
||||
0 => ['value' => 0, 'name' => '积分(可用积分)', 'checked' => true],
|
||||
1 => ['value' => 1, 'name' => '消费总额(已完成订单)'],
|
||||
];
|
||||
|
||||
/**
|
||||
* 获取等级数据列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function LevelDataList($params = [])
|
||||
{
|
||||
// 数据字段
|
||||
$data_field = 'level_list';
|
||||
|
||||
// 获取数据
|
||||
$ret = PluginsService::PluginsData('membershiplevel', self::$base_config_attachment_field);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][$data_field])) ? [] : $ret['data'][$data_field];
|
||||
|
||||
// 数据处理
|
||||
return self::LevelDataHandle($data, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户等级数据列表处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-04-27T01:08:23+0800
|
||||
* @param [array] $data [等级数据]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function LevelDataHandle($data, $params = [])
|
||||
{
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_is_enable_tips = lang('common_is_enable_tips');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 是否启用
|
||||
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
|
||||
|
||||
// 图片地址
|
||||
$v['images_url_old'] = $v['images_url'];
|
||||
$v['images_url'] = ResourcesService::AttachmentPathViewHandle($v['images_url']);
|
||||
|
||||
// 时间
|
||||
$v['operation_time_time'] = empty($v['operation_time']) ? '' : date('Y-m-d H:i:s', $v['operation_time']);
|
||||
$v['operation_time_date'] = empty($v['operation_time']) ? '' : date('Y-m-d', $v['operation_time']);
|
||||
}
|
||||
}
|
||||
|
||||
// 是否读取单条
|
||||
if(!empty($params['get_id']) && isset($data[$params['get_id']]))
|
||||
{
|
||||
$data = $data[$params['get_id']];
|
||||
}
|
||||
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function LevelDataSave($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'length',
|
||||
'key_name' => 'name',
|
||||
'checked_data' => '1,30',
|
||||
'error_msg' => '名称长度 1~30 个字符',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'isset',
|
||||
'key_name' => 'rules_min',
|
||||
'error_msg' => '请填写规则最小值',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'isset',
|
||||
'key_name' => 'rules_max',
|
||||
'error_msg' => '请填写规则最大值',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'max',
|
||||
'key_name' => 'discount_rate',
|
||||
'checked_data' => 0.99,
|
||||
'is_checked' => 1,
|
||||
'error_msg' => '折扣率应输入 0.00~0.99 的数字,小数保留两位',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'fun',
|
||||
'key_name' => 'order_price',
|
||||
'checked_data' => 'CheckPrice',
|
||||
'is_checked' => 1,
|
||||
'error_msg' => '请输入有效的订单满金额',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'fun',
|
||||
'key_name' => 'full_reduction_price',
|
||||
'checked_data' => 'CheckPrice',
|
||||
'is_checked' => 1,
|
||||
'error_msg' => '请输入有效的满减金额',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'eq',
|
||||
'key_name' => 'rules_min',
|
||||
'checked_data' => $params['rules_max'],
|
||||
'error_msg' => '规则最小值不能最大值相等',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'eq',
|
||||
'key_name' => 'rules_max',
|
||||
'checked_data' => $params['rules_min'],
|
||||
'error_msg' => '规则最大值不能最小值相等',
|
||||
],
|
||||
];
|
||||
if(intval($params['rules_max']) > 0)
|
||||
{
|
||||
$p[] = [
|
||||
'checked_type' => 'max',
|
||||
'key_name' => 'rules_min',
|
||||
'checked_data' => intval($params['rules_max']),
|
||||
'error_msg' => '规则最小值不能大于最大值['.intval($params['rules_max']).']',
|
||||
];
|
||||
$p[] = [
|
||||
'checked_type' => 'min',
|
||||
'key_name' => 'rules_max',
|
||||
'checked_data' => intval($params['rules_min']),
|
||||
'error_msg' => '规则最大值不能小于最小值['.intval($params['rules_min']).']',
|
||||
];
|
||||
}
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 数据字段
|
||||
$data_field = 'level_list';
|
||||
|
||||
// 附件
|
||||
$data_fields = ['images_url'];
|
||||
$attachment = ResourcesService::AttachmentParams($params, $data_fields);
|
||||
|
||||
// 数据
|
||||
$data = [
|
||||
'name' => $params['name'],
|
||||
'rules_min' => $params['rules_min'],
|
||||
'rules_max' => $params['rules_max'],
|
||||
'images_url' => $attachment['data']['images_url'],
|
||||
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
|
||||
'discount_rate' => isset($params['discount_rate']) ? $params['discount_rate'] : 0,
|
||||
'order_price' => empty($params['order_price']) ? 0.00 : PriceNumberFormat($params['order_price']),
|
||||
'full_reduction_price' => empty($params['full_reduction_price']) ? 0.00 : PriceNumberFormat($params['full_reduction_price']),
|
||||
'operation_time' => time(),
|
||||
];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('membershiplevel', self::$base_config_attachment_field, false);
|
||||
|
||||
// 数据id
|
||||
$data['id'] = (empty($params['id']) || empty($ret['data']) || empty($ret['data'][$data_field][$params['id']])) ? date('YmdHis').GetNumberCode(6) : $params['id'];
|
||||
$ret['data'][$data_field][$data['id']] = $data;
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'membershiplevel', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataDelete($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 数据字段
|
||||
$data_field = empty($params['data_field']) ? 'data_list' : $params['data_field'];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('membershiplevel', self::$base_config_attachment_field, false);
|
||||
$ret['data'][$data_field] = (empty($ret['data']) || empty($ret['data'][$data_field])) ? [] : $ret['data'][$data_field];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data'][$data_field][$params['id']]))
|
||||
{
|
||||
unset($ret['data'][$data_field][$params['id']]);
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'membershiplevel', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据状态更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataStatusUpdate($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'field',
|
||||
'error_msg' => '操作字段有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'in',
|
||||
'key_name' => 'state',
|
||||
'checked_data' => [0,1],
|
||||
'error_msg' => '状态有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 数据字段
|
||||
$data_field = empty($params['data_field']) ? 'data_list' : $params['data_field'];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('membershiplevel', self::$base_config_attachment_field, false);
|
||||
$ret['data'][$data_field] = (empty($ret['data']) || empty($ret['data'][$data_field])) ? [] : $ret['data'][$data_field];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data'][$data_field][$params['id']]) && is_array($ret['data'][$data_field][$params['id']]))
|
||||
{
|
||||
$ret['data'][$data_field][$params['id']][$params['field']] = intval($params['state']);
|
||||
$ret['data'][$data_field][$params['id']]['operation_time'] = time();
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'membershiplevel', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠价格计算
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-26
|
||||
* @desc description
|
||||
* @param [string] $price [商品展示金额]
|
||||
* @param [int] $plugins_discount [折扣系数]
|
||||
* @param [int] $plugins_price [减金额]
|
||||
*/
|
||||
public static function PriceCalculate($price, $plugins_discount = 0, $plugins_price = 0)
|
||||
{
|
||||
if($plugins_discount <= 0 && $plugins_price <= 0)
|
||||
{
|
||||
return $price;
|
||||
}
|
||||
|
||||
// 折扣
|
||||
if($plugins_discount > 0)
|
||||
{
|
||||
if(stripos($price, '-') !== false)
|
||||
{
|
||||
$text = explode('-', $price);
|
||||
$min_price = $text[0]*$plugins_discount;
|
||||
$max_price = $text[1]*$plugins_discount;
|
||||
$price = ($min_price <= 0) ? '0.00' : PriceNumberFormat($min_price);
|
||||
$price .= '-'.(($max_price <= 0) ? '0.00' : PriceNumberFormat($max_price));
|
||||
} else {
|
||||
$price = (float) $price *$plugins_discount;
|
||||
$price = ($price <= 0) ? '0.00' : PriceNumberFormat($price);
|
||||
}
|
||||
}
|
||||
|
||||
// 减金额
|
||||
if($plugins_price > 0)
|
||||
{
|
||||
if(stripos($price, '-') !== false)
|
||||
{
|
||||
$text = explode('-', $price);
|
||||
$min_price = $text[0]-$plugins_price;
|
||||
$max_price = $text[1]-$plugins_price;
|
||||
$price = ($min_price <= 0) ? '0.00' : PriceNumberFormat($min_price);
|
||||
$price .= '-'.(($max_price <= 0) ? '0.00' : PriceNumberFormat($max_price));
|
||||
} else {
|
||||
$price = (float) $price-$plugins_price;
|
||||
$price = ($price <= 0) ? '0.00' : PriceNumberFormat($price);
|
||||
}
|
||||
}
|
||||
return $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户等级匹配
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-28
|
||||
* @desc description
|
||||
* @param [array] $user [用户信息]
|
||||
*/
|
||||
public static function UserLevelMatching($user = [])
|
||||
{
|
||||
// 未指定用户信息,则从服务层读取
|
||||
if(empty($user))
|
||||
{
|
||||
$user = UserService::LoginUserInfo();
|
||||
}
|
||||
if(!empty($user))
|
||||
{
|
||||
// 缓存key
|
||||
$key = 'plugins_membershiplevel_cache_user_level_'.$user['id'];
|
||||
$level = cache($key);
|
||||
|
||||
// 应用配置
|
||||
if(empty($level) || config('app_debug') == true)
|
||||
{
|
||||
$base = PluginsService::PluginsData('membershiplevel', Service::$base_config_attachment_field);
|
||||
if(!empty($base['data']['level_list']))
|
||||
{
|
||||
// 规则
|
||||
$level_rules = isset($base['data']['level_rules']) ? $base['data']['level_rules'] : 0;
|
||||
|
||||
// 匹配类型
|
||||
$value = 0;
|
||||
switch($level_rules)
|
||||
{
|
||||
// 积分(可用积分)
|
||||
case 0 :
|
||||
$value = isset($user['integral']) ? intval($user['integral']) : 0;
|
||||
break;
|
||||
|
||||
// 消费总额(已完成订单)
|
||||
// 订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)
|
||||
case 1 :
|
||||
$where = ['user_id'=>$user['id'], 'status'=>4];
|
||||
$value = (float) Db::name('Order')->where($where)->sum('total_price');
|
||||
break;
|
||||
}
|
||||
|
||||
// 匹配相应的等级
|
||||
$level_list = self::LevelDataHandle($base['data']['level_list']);
|
||||
foreach($level_list['data'] as $rules)
|
||||
{
|
||||
if(isset($rules['is_enable']) && $rules['is_enable'] == 1)
|
||||
{
|
||||
// 0-*
|
||||
if($rules['rules_min'] <= 0 && $rules['rules_max'] > 0 && $value < $rules['rules_max'])
|
||||
{
|
||||
$level = $rules;
|
||||
break;
|
||||
}
|
||||
|
||||
// *-*
|
||||
if($rules['rules_min'] > 0 && $rules['rules_max'] > 0 && $value >= $rules['rules_min'] && $value < $rules['rules_max'])
|
||||
{
|
||||
$level = $rules;
|
||||
break;
|
||||
}
|
||||
|
||||
// *-0
|
||||
if($rules['rules_max'] <= 0 && $rules['rules_min'] > 0 && $value > $rules['rules_min'])
|
||||
{
|
||||
$level = $rules;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 等级icon
|
||||
if(!empty($level) && empty($level['images_url']))
|
||||
{
|
||||
$level['images_url'] = empty($base['data']['default_level_images']) ? config('shopxo.attachment_host').'/static/plugins/images/membershiplevel/level-default-images.png' : $base['data']['default_level_images'];
|
||||
}
|
||||
cache($key, $level);
|
||||
}
|
||||
}
|
||||
return $level;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,156 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\newuserreduction;
|
||||
|
||||
use think\Db;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 新用户立减 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// 立减计算
|
||||
case 'plugins_service_buy_handle' :
|
||||
$ret = $this->ReductionCalculate($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = '';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 立减计算
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-21
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function ReductionCalculate($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('newuserreduction');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否设置需满金额
|
||||
if(isset($ret['data']['full_amount']) && $ret['data']['full_amount'] > 0 && $params['data']['base']['total_price'] < $ret['data']['full_amount'])
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
|
||||
// 默认金额
|
||||
$price = isset($ret['data']['price']) ? (float) $ret['data']['price'] : 0;
|
||||
$unit = '元';
|
||||
$price_show = $price;
|
||||
if($price > 0 && $this->IsNewUser($params))
|
||||
{
|
||||
// 是否随机
|
||||
if(isset($ret['data']['is_random']) && $ret['data']['is_random'] == 1)
|
||||
{
|
||||
// 随机金额需要提交步骤生效
|
||||
if(!isset($params['params']['is_order_submit']) || $params['params']['is_order_submit'] != 1)
|
||||
{
|
||||
$price = 0;
|
||||
$price_show = '随机减';
|
||||
$unit = '';
|
||||
} else {
|
||||
$price = $this->RandomFloat(0, $price);
|
||||
$price_show = $price;
|
||||
}
|
||||
}
|
||||
|
||||
// 扩展展示数据
|
||||
$show_name = empty($ret['data']['show_name']) ? '新用户立减' : $ret['data']['show_name'];
|
||||
$params['data']['extension_data'][] = [
|
||||
'name' => $show_name,
|
||||
'price' => $price,
|
||||
'type' => 0,
|
||||
'tips' => '-¥'.$price_show.$unit,
|
||||
];
|
||||
|
||||
// 金额
|
||||
$params['data']['base']['preferential_price'] += $price;
|
||||
if($params['data']['base']['actual_price'] > 0)
|
||||
{
|
||||
$params['data']['base']['actual_price'] -= $price;
|
||||
}
|
||||
}
|
||||
return DataReturn('无需处理', 0);
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否满足新用户条件
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-25
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
private function IsNewUser($params = [])
|
||||
{
|
||||
// 用户信息是否存在
|
||||
if(empty($params['params']['user']))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取用户订单
|
||||
// 订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)
|
||||
$where = [
|
||||
['user_id', '=', intval($params['params']['user']['id'])],
|
||||
['status', '<=', 4],
|
||||
];
|
||||
$temp = Db::name('Order')->where($where)->count();
|
||||
return empty($temp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机金额
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-25
|
||||
* @desc description
|
||||
* @param [int] $min [最小值]
|
||||
* @param [int] $max [最大值]
|
||||
*/
|
||||
private function RandomFloat($min = 0, $max = 10)
|
||||
{
|
||||
return sprintf("%.2f", $min+mt_rand()/mt_getrandmax()*($max-$min));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\newuserreduction\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 新用户立减 - 后台管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('newuserreduction');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/newuserreduction/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('newuserreduction');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/newuserreduction/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'newuserreduction', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,28 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"newuserreduction",
|
||||
"name":"新用户立减",
|
||||
"logo":"\/static\/upload\/images\/plugins_newuserreduction\/2019\/03\/25\/1553483752670109.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.2.0",
|
||||
"desc":"新用户立减优惠",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5",
|
||||
"app",
|
||||
"alipay",
|
||||
"weixin",
|
||||
"baidu"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_service_buy_handle":[
|
||||
"app\\plugins\\newuserreduction\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,114 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\share;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 分享 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
$ret = '';
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
case 'plugins_css' :
|
||||
$ret = [
|
||||
__MY_ROOT_PUBLIC__.'static/plugins/css/share/index/iconfont.css',
|
||||
__MY_ROOT_PUBLIC__.'static/plugins/css/share/index/style.css',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'plugins_js' :
|
||||
$ret = __MY_ROOT_PUBLIC__.'static/plugins/js/share/index/style.js';
|
||||
break;
|
||||
|
||||
case 'plugins_view_common_bottom' :
|
||||
$ret = $this->Content($params);
|
||||
break;
|
||||
|
||||
case 'plugins_view_goods_detail_photo_bottom' :
|
||||
$ret = $this->GoodsPhotoBottom($params);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品页面相册底部钩子
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-04-22T02:08:26+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
private function GoodsPhotoBottom($params = [])
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('share', ['pic']);
|
||||
if($ret['code'] == 0 && isset($ret['data']['is_goods_detail']) && $ret['data']['is_goods_detail'] == 1)
|
||||
{
|
||||
// html
|
||||
$html ='<div class="am-dropdown plugins-goods-share-view" data-am-dropdown>';
|
||||
$html .= '<a href="javascript:;" class="am-dropdown-toggle am-icon-share-alt" data-am-dropdown-toggle> 分享</a>';
|
||||
$html .= '<div class="am-dropdown-content plugins-share-view"';
|
||||
|
||||
// 默认图片
|
||||
if(!empty($params['goods']['photo'][0]['images']))
|
||||
{
|
||||
$html .= ' data-pic="'.$params['goods']['photo'][0]['images'].'"';
|
||||
}
|
||||
|
||||
return $html.'></div></div>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图html
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
private function Content($params = [])
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('share', ['pic']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/share/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,90 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\share\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 分享 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
// 是否开启
|
||||
private $share_is_enable_list = [
|
||||
0 => ['value' => 0, 'name' => '关闭', 'checked' => true],
|
||||
1 => ['value' => 1, 'name' => '开启'],
|
||||
];
|
||||
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('share', ['pic']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否开启
|
||||
$this->assign('share_is_enable_list', $this->share_is_enable_list);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/share/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('share', ['pic']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否开启
|
||||
$this->assign('share_is_enable_list', $this->share_is_enable_list);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/share/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'share', 'data'=>$params], ['pic']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,33 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"share",
|
||||
"name":"分享",
|
||||
"logo":"\/static\/upload\/images\/plugins_share\/2019\/04\/19\/1555667271928933.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"分享组件",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_css":[
|
||||
"app\\plugins\\share\\Hook"
|
||||
],
|
||||
"plugins_js":[
|
||||
"app\\plugins\\share\\Hook"
|
||||
],
|
||||
"plugins_view_common_bottom":[
|
||||
"app\\plugins\\share\\Hook"
|
||||
],
|
||||
"plugins_view_goods_detail_photo_bottom":[
|
||||
"app\\plugins\\share\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,196 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\touristbuy;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\touristbuy\service\Service;
|
||||
use app\service\PluginsService;
|
||||
use app\service\UserService;
|
||||
|
||||
/**
|
||||
* 游客购买 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否后端钩子
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// 顶部登录入口/登录信息
|
||||
case 'plugins_view_header_navigation_top_left' :
|
||||
$ret = $this->LoginNavTopHtml($params);
|
||||
break;
|
||||
|
||||
// 用户登录页面顶部
|
||||
case 'plugins_view_user_login_info_top' :
|
||||
case 'plugins_view_user_reg_info' :
|
||||
$ret = $this->UserLoginInfoHtml($params);
|
||||
break;
|
||||
|
||||
// header代码
|
||||
case 'plugins_common_header' :
|
||||
$ret = $this->Style($params);
|
||||
break;
|
||||
|
||||
// 导航链接
|
||||
case 'plugins_service_navigation_header_handle' :
|
||||
$ret = $this->NavTitle($params);
|
||||
break;
|
||||
|
||||
// 系统运行开始
|
||||
case 'plugins_service_system_begin' :
|
||||
$ret = $this->SystemBegin($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = DataReturn('无需处理', 0);
|
||||
}
|
||||
return $ret;
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统运行开始
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-18
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function SystemBegin($params = [])
|
||||
{
|
||||
// 是否开启默认游客
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
if($ret['code'] == 0 && isset($ret['data']['is_default_tourist']) && $ret['data']['is_default_tourist'] == 1 && strtolower(request()->module()) == 'index')
|
||||
{
|
||||
return Service::TouristReg();
|
||||
}
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* css
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function NavTitle($params = [])
|
||||
{
|
||||
if(!empty($params['header']) && is_array($params['header']))
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
if($ret['code'] == 0 && !empty($ret['data']['application_name']))
|
||||
{
|
||||
$params['header'][] = [
|
||||
'id' => 0,
|
||||
'pid' => 0,
|
||||
'name' => $ret['data']['application_name'],
|
||||
'url' => PluginsHomeUrl('touristbuy', 'index', 'index'),
|
||||
'data_type' => 'custom',
|
||||
'is_show' => 1,
|
||||
'is_new_window_open' => 0,
|
||||
'items' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* css
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Style($params = [])
|
||||
{
|
||||
return '<style type="text/css">
|
||||
.plugins-touristbuy-nav-top { color: #FF5722; }
|
||||
</style>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端顶部小导航展示登入
|
||||
* @author Guoguo
|
||||
* @blog http://gadmin.cojz8.com
|
||||
* @version 1.0.0
|
||||
* @datetime 2019年3月14日
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function UserLoginInfoHtml($params = [])
|
||||
{
|
||||
// 获取已登录用户信息,已登录则不展示入口
|
||||
$user = UserService::LoginUserInfo();
|
||||
if(empty($user))
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 当前窗口登录父级
|
||||
$is_parent = ($module_name.$controller_name.$action_name == 'indexusermodallogininfo') ? 1 : 0;
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
$login_name = empty($ret['data']['login_name']) ? '游客' : $ret['data']['login_name'];
|
||||
return '<a href="'.PluginsHomeUrl('touristbuy', 'index', 'login', ['is_parent'=>$is_parent]).'" class="am-btn am-btn-warning am-btn-xs am-radius am-margin-left-xs">'.$login_name.'</a>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端顶部小导航展示登入
|
||||
* @author Guoguo
|
||||
* @blog http://gadmin.cojz8.com
|
||||
* @version 1.0.0
|
||||
* @datetime 2019年3月14日
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function LoginNavTopHtml($params = [])
|
||||
{
|
||||
// 获取已登录用户信息,已登录则不展示入口
|
||||
$user = UserService::LoginUserInfo();
|
||||
if(empty($user))
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
$login_name = empty($ret['data']['login_name']) ? '游客' : $ret['data']['login_name'];
|
||||
return '<a href="'.PluginsHomeUrl('touristbuy', 'index', 'login').'" class="plugins-touristbuy-nav-top am-margin-left-xs">'.$login_name.'</a>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\touristbuy\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 游客购买 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/touristbuy/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/touristbuy/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'touristbuy', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,39 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"touristbuy",
|
||||
"name":"游客购买",
|
||||
"logo":"\/static\/upload\/images\/plugins_touristbuy\/2019\/03\/15\/1552656656517586.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"无需登录实现游客购物,在线支付,订单查询",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.4.0"
|
||||
],
|
||||
"is_home":true
|
||||
},
|
||||
"hook":{
|
||||
"plugins_service_system_begin":[
|
||||
"app\\plugins\\touristbuy\\Hook"
|
||||
],
|
||||
"plugins_common_header":[
|
||||
"app\\plugins\\touristbuy\\Hook"
|
||||
],
|
||||
"plugins_view_header_navigation_top_left":[
|
||||
"app\\plugins\\touristbuy\\Hook"
|
||||
],
|
||||
"plugins_view_user_login_info_top":[
|
||||
"app\\plugins\\touristbuy\\Hook"
|
||||
],
|
||||
"plugins_view_user_reg_info":[
|
||||
"app\\plugins\\touristbuy\\Hook"
|
||||
],
|
||||
"plugins_service_navigation_header_handle":[
|
||||
"app\\plugins\\touristbuy\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,137 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\touristbuy\index;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\touristbuy\service\Service;
|
||||
use app\service\SeoService;
|
||||
use app\service\OrderService;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 游客购买 - 前端独立页面入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
/**
|
||||
* 订单查询入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('订单查询', 1));
|
||||
return $this->fetch('../../../plugins/view/touristbuy/index/index/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单详情
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function detail($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'order_no',
|
||||
'error_msg' => '请输入订单号',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'name',
|
||||
'error_msg' => '请输入收件人姓名',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'tel',
|
||||
'error_msg' => '请输入收件人电话',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
$this->assign('msg', $ret);
|
||||
return $this->fetch('public/tips_error');
|
||||
}
|
||||
|
||||
// 参数
|
||||
$params['user_type'] = 'user';
|
||||
|
||||
// 条件
|
||||
$where = OrderService::OrderListWhere($params);
|
||||
$where[] = ['order_no', '=', $params['order_no']];
|
||||
$where[] = ['receive_name', '=', $params['name']];
|
||||
$where[] = ['receive_tel', '=', $params['tel']];
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => 1,
|
||||
'where' => $where,
|
||||
);
|
||||
$data = OrderService::OrderList($data_params);
|
||||
if(!empty($data['data'][0]))
|
||||
{
|
||||
$this->assign('data', $data['data'][0]);
|
||||
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('订单详情', 1));
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch('../../../plugins/view/touristbuy/index/index/detail');
|
||||
} else {
|
||||
$this->assign('msg', '没有相关数据');
|
||||
return $this->fetch('public/tips_error');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 游客登录
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T22:31:29+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function login($params = [])
|
||||
{
|
||||
$ret = Service::TouristReg();
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('msg', $ret['msg']);
|
||||
$this->assign('data', $ret['data']);
|
||||
$this->assign('is_parent', isset($params['is_parent']) ? $params['is_parent'] : 0);
|
||||
return $this->fetch('public/login_success');
|
||||
} else {
|
||||
$this->assign('msg', $ret['msg']);
|
||||
return $this->fetch('public/tips_error');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,90 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\touristbuy\service;
|
||||
|
||||
use think\Db;
|
||||
use app\service\UserService;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 问答系统服务层
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
/**
|
||||
* 游客注册
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-03
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function TouristReg($params = [])
|
||||
{
|
||||
// 获取登录用户
|
||||
$user = UserService::LoginUserInfo();
|
||||
if(!empty($user))
|
||||
{
|
||||
return DataReturn('已登录,请先退出', -1);
|
||||
}
|
||||
|
||||
// 是否有登录纪录
|
||||
$tourist_user_id = session('tourist_user_id');
|
||||
if(!empty($tourist_user_id))
|
||||
{
|
||||
$user = UserService::UserInfo('id', $tourist_user_id);
|
||||
if(!empty($user))
|
||||
{
|
||||
// 用户登录
|
||||
return UserService::UserLoginHandle($tourist_user_id, $params);
|
||||
}
|
||||
session('tourist_user_id', null);
|
||||
}
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('touristbuy');
|
||||
$nickname = empty($ret['data']['nickname']) ? '游客' : $ret['data']['nickname'];
|
||||
$nickname = $nickname.'-'.RandomString(6);
|
||||
|
||||
// 游客数据
|
||||
$salt = GetNumberCode(6);
|
||||
$data = [
|
||||
'username' => $nickname,
|
||||
'nickname' => $nickname,
|
||||
'status' => 0,
|
||||
'salt' => $salt,
|
||||
'pwd' => LoginPwdEncryption($nickname, $salt),
|
||||
'add_time' => time(),
|
||||
'upd_time' => time(),
|
||||
];
|
||||
|
||||
// 数据添加
|
||||
$ret = UserService::UserInsert($data, ['nickname'=>$nickname, 'pwd'=>$nickname]);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 单独存储用户id
|
||||
session('tourist_user_id', $ret['data']['user_id']);
|
||||
|
||||
// 用户登录session纪录
|
||||
if(UserService::UserLoginRecord($ret['data']['user_id']))
|
||||
{
|
||||
return DataReturn('登录成功', 0, $ret['data']);
|
||||
}
|
||||
}
|
||||
return DataReturn('登录失败', -100);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,263 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\ucenter;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* UCenter - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
if(!empty($params['hook_name']))
|
||||
{
|
||||
$config = PluginsService::PluginsData('ucenter');
|
||||
if($config['code'] == 0)
|
||||
{
|
||||
$ret = DataReturn('无需处理', 0);
|
||||
if(!empty($params['user']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// 注册
|
||||
case 'plugins_service_user_register_end' :
|
||||
$ret = $this->RegisterEndHandle($config['data'], $params);
|
||||
break;
|
||||
|
||||
// 登录
|
||||
case 'plugins_service_user_login_end' :
|
||||
$ret = $this->LoginEndHandle($config['data'], $params);
|
||||
break;
|
||||
|
||||
// 登录密码修改
|
||||
case 'plugins_service_user_login_pwd_update' :
|
||||
$ret = $this->LoginPwdUpdateHandle($config['data'], $params);
|
||||
break;
|
||||
|
||||
// 账号修改
|
||||
case 'plugins_service_user_accounts_update' :
|
||||
$ret = $this->AccountsUpdateHandle($config['data'], $params);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 退出
|
||||
if(in_array($params['hook_name'], ['plugins_service_user_logout_handle']))
|
||||
{
|
||||
$ret = $this->LogoutEndHandle($config['data'], $params);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 账号修改
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-02
|
||||
* @desc description
|
||||
* @param [array] $config [配置信息]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function AccountsUpdateHandle($config = [], $params = [])
|
||||
{
|
||||
// 异步接口
|
||||
if(!empty($config['accounts_async_url']))
|
||||
{
|
||||
$accounts_async_url = explode("\n", $config['accounts_async_url']);
|
||||
if(!empty($accounts_async_url) && is_array($accounts_async_url))
|
||||
{
|
||||
foreach($accounts_async_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
SyncJob($url.$join.'data='.urlencode(json_encode($params['user'])).'¶ms='.urlencode(json_encode($params['params'])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录密码修改
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-02
|
||||
* @desc description
|
||||
* @param [array] $config [配置信息]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function LoginPwdUpdateHandle($config = [], $params = [])
|
||||
{
|
||||
// 异步接口
|
||||
if(!empty($config['loginpwdupdate_async_url']))
|
||||
{
|
||||
$loginpwdupdate_async_url = explode("\n", $config['loginpwdupdate_async_url']);
|
||||
if(!empty($loginpwdupdate_async_url) && is_array($loginpwdupdate_async_url))
|
||||
{
|
||||
foreach($loginpwdupdate_async_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
SyncJob($url.$join.'data='.urlencode(json_encode($params['user'])).'¶ms='.urlencode(json_encode($params['params'])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-02
|
||||
* @desc description
|
||||
* @param [array] $config [配置信息]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function LogoutEndHandle($config = [], $params = [])
|
||||
{
|
||||
// 用户信息
|
||||
$user = empty($params['user']) ? '' : $params['user'];
|
||||
|
||||
// 同步接口
|
||||
if(!empty($config['logout_sync_url']))
|
||||
{
|
||||
$logout_sync_url = explode("\n", $config['logout_sync_url']);
|
||||
if(!empty($logout_sync_url) && is_array($logout_sync_url))
|
||||
{
|
||||
foreach($logout_sync_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
$params['body_html'][] = '<script type="text/javascript" src="'.$url.$join.'data='.urlencode(json_encode($user)).'"></script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 异步接口
|
||||
if(!empty($config['logout_async_url']))
|
||||
{
|
||||
$logout_async_url = explode("\n", $config['logout_async_url']);
|
||||
if(!empty($logout_async_url) && is_array($logout_async_url))
|
||||
{
|
||||
foreach($logout_async_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
SyncJob($url.$join.'data='.urlencode(json_encode($user)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-02
|
||||
* @desc description
|
||||
* @param [array] $config [配置信息]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function RegisterEndHandle($config = [], $params = [])
|
||||
{
|
||||
// 同步接口
|
||||
if(!empty($config['register_sync_url']))
|
||||
{
|
||||
$register_sync_url = explode("\n", $config['register_sync_url']);
|
||||
if(!empty($register_sync_url) && is_array($register_sync_url))
|
||||
{
|
||||
foreach($register_sync_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
$params['body_html'][] = '<script type="text/javascript" src="'.$url.$join.'data='.urlencode(json_encode($params['user'])).'¶ms='.urlencode(json_encode($params['params'])).'"></script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 异步接口
|
||||
if(!empty($config['register_async_url']))
|
||||
{
|
||||
$register_async_url = explode("\n", $config['register_async_url']);
|
||||
if(!empty($register_async_url) && is_array($register_async_url))
|
||||
{
|
||||
foreach($register_async_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
SyncJob($url.$join.'data='.urlencode(json_encode($params['user'])).'¶ms='.urlencode(json_encode($params['params'])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-02
|
||||
* @desc description
|
||||
* @param [array] $config [配置信息]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function LoginEndHandle($config = [], $params = [])
|
||||
{
|
||||
// 同步接口
|
||||
if(!empty($config['login_sync_url']))
|
||||
{
|
||||
$login_sync_url = explode("\n", $config['login_sync_url']);
|
||||
if(!empty($login_sync_url) && is_array($login_sync_url))
|
||||
{
|
||||
foreach($login_sync_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
$params['body_html'][] = '<script type="text/javascript" src="'.$url.$join.'data='.urlencode(json_encode($params['user'])).'¶ms='.urlencode(json_encode($params['params'])).'"></script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 异步接口
|
||||
if(!empty($config['login_async_url']))
|
||||
{
|
||||
$login_async_url = explode("\n", $config['login_async_url']);
|
||||
if(!empty($login_async_url) && is_array($login_async_url))
|
||||
{
|
||||
foreach($login_async_url as $url)
|
||||
{
|
||||
$join = (stripos($url, '?') === false) ? '?' : '&';
|
||||
SyncJob($url.$join.'data='.urlencode(json_encode($params['user'])).'¶ms='.urlencode(json_encode($params['params'])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,94 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\ucenter\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* UCenter - 后台管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('ucenter');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$ret['data']['login_sync_url'] = empty($ret['data']['login_sync_url']) ? '' : str_replace("\n", '<br />', $ret['data']['login_sync_url']);
|
||||
$ret['data']['login_async_url'] = empty($ret['data']['login_async_url']) ? '' : str_replace("\n", '<br />', $ret['data']['login_async_url']);
|
||||
$ret['data']['register_sync_url'] = empty($ret['data']['register_sync_url']) ? '' : str_replace("\n", '<br />', $ret['data']['register_sync_url']);
|
||||
$ret['data']['register_async_url'] = empty($ret['data']['register_async_url']) ? '' : str_replace("\n", '<br />', $ret['data']['register_async_url']);
|
||||
$ret['data']['logout_sync_url'] = empty($ret['data']['logout_sync_url']) ? '' : str_replace("\n", '<br />', $ret['data']['logout_sync_url']);
|
||||
$ret['data']['logout_async_url'] = empty($ret['data']['logout_async_url']) ? '' : str_replace("\n", '<br />', $ret['data']['logout_async_url']);
|
||||
$ret['data']['loginpwdupdate_async_url'] = empty($ret['data']['loginpwdupdate_async_url']) ? '' : str_replace("\n", '<br />', $ret['data']['loginpwdupdate_async_url']);
|
||||
$ret['data']['accounts_async_url'] = empty($ret['data']['accounts_async_url']) ? '' : str_replace("\n", '<br />', $ret['data']['accounts_async_url']);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/ucenter/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('ucenter');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '是'),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/ucenter/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'ucenter', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,36 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"ucenter",
|
||||
"name":"UCenter",
|
||||
"logo":"\/static\/upload\/images\/plugins_ucenter\/2019\/04\/02\/1554185833720976.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"同步用户登录、注册、密码修改、账号修改",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_service_user_login_end":[
|
||||
"app\\plugins\\ucenter\\Hook"
|
||||
],
|
||||
"plugins_service_user_register_end":[
|
||||
"app\\plugins\\ucenter\\Hook"
|
||||
],
|
||||
"plugins_service_user_logout_handle":[
|
||||
"app\\plugins\\ucenter\\Hook"
|
||||
],
|
||||
"plugins_service_user_login_pwd_update":[
|
||||
"app\\plugins\\ucenter\\Hook"
|
||||
],
|
||||
"plugins_service_user_accounts_update":[
|
||||
"app\\plugins\\ucenter\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,173 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\ucenter\index;
|
||||
|
||||
use think\Db;
|
||||
use app\service\UserService;
|
||||
use app\service\SafetyService;
|
||||
|
||||
/**
|
||||
* UCenter - Api
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Api
|
||||
{
|
||||
/**
|
||||
* 密码修改
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function LoginPwdUpdate($params = [])
|
||||
{
|
||||
$user = empty($params['data']) ? '' : json_decode(htmlspecialchars_decode($params['data']), true);
|
||||
$data = empty($params['params']) ? '' : json_decode(htmlspecialchars_decode($params['params']), true);
|
||||
|
||||
if(empty($user))
|
||||
{
|
||||
return json(DataReturn('用户信息为空', -400));
|
||||
}
|
||||
if(empty($data))
|
||||
{
|
||||
return json(DataReturn('参数为空', -401));
|
||||
}
|
||||
if(empty($data['accounts']) || empty($data['my_pwd']) || empty($data['new_pwd']) || empty($data['confirm_new_pwd']))
|
||||
{
|
||||
return json(DataReturn('账号或密码为空', -402));
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
$where = array('username|mobile|email' => $data['accounts'], 'is_delete_time'=>0);
|
||||
$temp = Db::name('User')->where($where)->find();
|
||||
if(empty($temp))
|
||||
{
|
||||
return json(DataReturn('用户信息不存在', -402));
|
||||
}
|
||||
|
||||
// 调用服务层
|
||||
$salt = GetNumberCode(6);
|
||||
$user_data = [
|
||||
'accounts' => $data['accounts'],
|
||||
'my_pwd' => $data['my_pwd'],
|
||||
'new_pwd' => $data['new_pwd'],
|
||||
'confirm_new_pwd' => $data['confirm_new_pwd'],
|
||||
'user' => $temp,
|
||||
];
|
||||
$ret = SafetyService::LoginPwdUpdate($user_data);
|
||||
return json(DataReturn($ret['msg'], $ret['code']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Login($params = [])
|
||||
{
|
||||
$user = empty($params['data']) ? '' : json_decode(htmlspecialchars_decode($params['data']), true);
|
||||
$data = empty($params['params']) ? '' : json_decode(htmlspecialchars_decode($params['params']), true);
|
||||
|
||||
if(empty($user))
|
||||
{
|
||||
return json(DataReturn('用户信息为空', -400));
|
||||
}
|
||||
if(empty($data))
|
||||
{
|
||||
return json(DataReturn('参数为空', -401));
|
||||
}
|
||||
if(empty($data['accounts']) || empty($data['pwd']))
|
||||
{
|
||||
return json(DataReturn('账号或密码为空', -402));
|
||||
}
|
||||
|
||||
// 调用服务层
|
||||
$ret = UserService::Login($data);
|
||||
return json(DataReturn($ret['msg'], $ret['code']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Register($params = [])
|
||||
{
|
||||
$user = empty($params['data']) ? '' : json_decode(htmlspecialchars_decode($params['data']), true);
|
||||
$data = empty($params['params']) ? '' : json_decode(htmlspecialchars_decode($params['params']), true);
|
||||
|
||||
if(empty($user))
|
||||
{
|
||||
return json(DataReturn('用户信息为空', -400));
|
||||
}
|
||||
if(empty($data))
|
||||
{
|
||||
return json(DataReturn('参数为空', -401));
|
||||
}
|
||||
if(empty($data['accounts']) || empty($data['pwd']))
|
||||
{
|
||||
return json(DataReturn('账号或密码为空', -402));
|
||||
}
|
||||
|
||||
// 用户注册数据
|
||||
$salt = GetNumberCode(6);
|
||||
$user_data = [
|
||||
'username' => $data['accounts'],
|
||||
'nickname' => $data['accounts'],
|
||||
'email' => CheckEmail($data['accounts']) ? $data['accounts'] : '',
|
||||
'mobile' => CheckMobile($data['accounts']) ? $data['accounts'] : '',
|
||||
'salt' => $salt,
|
||||
'pwd' => LoginPwdEncryption($data['pwd'], $salt),
|
||||
];
|
||||
|
||||
// 调用服务层
|
||||
$ret = UserService::UserInsert($user_data, $data);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$ret = UserService::Login($data);
|
||||
}
|
||||
return json(DataReturn($ret['msg'], $ret['code']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Logout($params = [])
|
||||
{
|
||||
$user = empty($params['data']) ? '' : json_decode(htmlspecialchars_decode($params['data']), true);
|
||||
|
||||
if(empty($user))
|
||||
{
|
||||
return json(DataReturn('用户信息为空', -400));
|
||||
}
|
||||
|
||||
// 调用服务层
|
||||
$ret = UserService::Logout();
|
||||
return json(DataReturn($ret['msg'], $ret['code']));
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -1,91 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\usercentertopnotice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 用户中心顶部公告 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否后端钩子
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return $this->html($params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function html($params = [])
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('usercentertopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 内容是否为空
|
||||
if(empty($ret['data']['content']))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
// 有效时间
|
||||
if(!empty($ret['data']['time_start']))
|
||||
{
|
||||
// 是否已开始
|
||||
if(strtotime($ret['data']['time_start']) > time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if(!empty($ret['data']['time_end']))
|
||||
{
|
||||
// 是否已结束
|
||||
if(strtotime($ret['data']['time_end']) < time())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usercentertopnotice/index/public/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,78 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\usercentertopnotice\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 用户中心顶部公告插件 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('usercentertopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usercentertopnotice/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('usercentertopnotice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usercentertopnotice/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'usercentertopnotice', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"usercentertopnotice",
|
||||
"name":"用户中心顶部公告",
|
||||
"logo":"\/static\/upload\/images\/plugins_usercentertopnotice\/2019\/02\/12\/1549671733967341.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"用户中心顶部公告,通知",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.3.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_view_user_center_top":[
|
||||
"app\\plugins\\usercentertopnotice\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,137 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\userloginrewardintegral;
|
||||
|
||||
use think\Db;
|
||||
use app\service\PluginsService;
|
||||
use app\service\IntegralService;
|
||||
use app\service\UserService;
|
||||
|
||||
/**
|
||||
* 登录奖励积分 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-09T14:25:44+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否后端钩子
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
if(!empty($params['user_id']))
|
||||
{
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// 用户登录成功后赠送积分
|
||||
case 'plugins_service_user_login_end' :
|
||||
$ret = $this->LoginGiveIntegral($params);
|
||||
break;
|
||||
|
||||
default :
|
||||
$ret = DataReturn('无需处理', 0);
|
||||
}
|
||||
return $ret;
|
||||
} else {
|
||||
return DataReturn('钩子传入参数有误', -600);
|
||||
}
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-14T22:19:08+0800
|
||||
* @param [array] $params [参数]
|
||||
*/
|
||||
private function LoginGiveIntegral($params)
|
||||
{
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('userloginrewardintegral');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 限制时间是否已结束
|
||||
if(!empty($ret['data']['time_start']))
|
||||
{
|
||||
// 是否已开始
|
||||
if(strtotime($ret['data']['time_start']) > time())
|
||||
{
|
||||
return DataReturn('不在限制时间范围、无需处理', 0);
|
||||
}
|
||||
}
|
||||
if(!empty($ret['data']['time_end']))
|
||||
{
|
||||
// 是否已结束
|
||||
if(strtotime($ret['data']['time_end']) < time())
|
||||
{
|
||||
return DataReturn('不在限制时间范围、无需处理', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// 是否日一次限制
|
||||
if(isset($ret['data']['is_day_once']) && $ret['data']['is_day_once'] == 1)
|
||||
{
|
||||
$where = [
|
||||
['user_id', '=', $params['user_id']],
|
||||
['add_time', '>=', strtotime(date('Y-m-d 00:00:00'))],
|
||||
['type', '=', 1],
|
||||
['msg', '=', '登录奖励积分'],
|
||||
];
|
||||
$log = Db::name('UserIntegralLog')->where($where)->find();
|
||||
if(!empty($log))
|
||||
{
|
||||
return DataReturn('今日已赠送、无需处理', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取用户积分
|
||||
$give_integral = empty($ret['data']['give_integral']) ? 0 : intval($ret['data']['give_integral']);
|
||||
if(!empty($give_integral))
|
||||
{
|
||||
// 用户积分添加
|
||||
$user_integral = Db::name('User')->where(['id'=>$params['user_id']])->value('integral');
|
||||
if(!Db::name('User')->where(['id'=>$params['user_id']])->setInc('integral', $give_integral))
|
||||
{
|
||||
return DataReturn('登录奖励积分失败', -10);
|
||||
}
|
||||
|
||||
// 积分日志
|
||||
IntegralService::UserIntegralLogAdd($params['user_id'], $user_integral, $user_integral+$give_integral, '登录奖励积分', 1);
|
||||
|
||||
// 更新用户登录缓存数据
|
||||
UserService::UserLoginRecord($params['user_id']);
|
||||
|
||||
return DataReturn('登录奖励积分成功', 0);
|
||||
} else {
|
||||
return DataReturn('登录奖励积分应用配置有误', -600);
|
||||
}
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\userloginrewardintegral\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 登录奖励积分 - 后台管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('userloginrewardintegral');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/userloginrewardintegral/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('userloginrewardintegral');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '否'),
|
||||
1 => array('id' => 1, 'name' => '是', 'checked' => true),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/userloginrewardintegral/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'userloginrewardintegral', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"userloginrewardintegral",
|
||||
"name":"登录奖励积分",
|
||||
"logo":"\/static\/upload\/images\/plugins_userloginrewardintegral\/2019\/02\/14\/1550151082834629.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"用户登录成功后奖励积分",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_service_user_login_end":[
|
||||
"app\\plugins\\userloginrewardintegral\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,151 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\usernotloginhidegoodsprice;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
use app\service\UserService;
|
||||
|
||||
/**
|
||||
* 未登录隐藏商品价格 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
// 应用响应入口
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否控制器钩子
|
||||
// is_backend 当前为后端业务处理
|
||||
// hook_name 钩子名称
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
return $this->PriceHandle($params);
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 价格处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-14T22:19:08+0800
|
||||
* @param [array] $params [参数]
|
||||
*/
|
||||
private function PriceHandle($params)
|
||||
{
|
||||
// 后端访问不处理
|
||||
if(isset($params['params']['is_admin_access']) && $params['params']['is_admin_access'] == 1)
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
|
||||
// 用户是否已登录
|
||||
$user = UserService::LoginUserInfo();
|
||||
if(!empty($user))
|
||||
{
|
||||
// 查询用户状态是否正常
|
||||
$ret = UserService::UserStatusCheck('id', $user['id']);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取应用数据
|
||||
$ret = PluginsService::PluginsData('usernotloginhidegoodsprice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 限制终端
|
||||
if(!empty($ret['data']['limit_terminal']))
|
||||
{
|
||||
$limit_terminal_all = explode(',', $ret['data']['limit_terminal']);
|
||||
$client_type = APPLICATION_CLIENT_TYPE;
|
||||
if($client_type == 'pc' && IsMobile())
|
||||
{
|
||||
$client_type = 'h5';
|
||||
}
|
||||
if(!in_array($client_type, $limit_terminal_all))
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// 原价
|
||||
$original_price_placeholder = isset($ret['data']['original_price_placeholder']) ? $ret['data']['original_price_placeholder'] : '';
|
||||
|
||||
// 销售价
|
||||
$price_placeholder = empty($ret['data']['price_placeholder']) ? '登录可见' : $ret['data']['price_placeholder'];
|
||||
|
||||
switch($params['hook_name'])
|
||||
{
|
||||
// 商品数据处理后
|
||||
case 'plugins_service_goods_handle_end' :
|
||||
// 商品原价
|
||||
if(isset($params['goods']['original_price']))
|
||||
{
|
||||
$params['goods']['original_price'] = $original_price_placeholder;
|
||||
}
|
||||
if(isset($params['goods']['min_original_price']))
|
||||
{
|
||||
$params['goods']['min_original_price'] = $original_price_placeholder;
|
||||
}
|
||||
if(isset($params['goods']['max_original_price']))
|
||||
{
|
||||
$params['goods']['max_original_price'] = $original_price_placeholder;
|
||||
}
|
||||
|
||||
// 销售价
|
||||
if(isset($params['goods']['price']))
|
||||
{
|
||||
$params['goods']['price'] = $price_placeholder;
|
||||
}
|
||||
if(isset($params['goods']['min_price']))
|
||||
{
|
||||
$params['goods']['min_price'] = $price_placeholder;
|
||||
}
|
||||
if(isset($params['goods']['max_price']))
|
||||
{
|
||||
$params['goods']['max_price'] = $price_placeholder;
|
||||
}
|
||||
break;
|
||||
|
||||
// 商品规格基础数据
|
||||
case 'plugins_service_goods_spec_base' :
|
||||
if(isset($params['spec_base']['original_price']))
|
||||
{
|
||||
$params['spec_base']['original_price'] = $original_price_placeholder;
|
||||
}
|
||||
if(isset($params['spec_base']['price']))
|
||||
{
|
||||
$params['spec_base']['price'] = $price_placeholder;
|
||||
}
|
||||
break;
|
||||
|
||||
// 默认
|
||||
default :
|
||||
return DataReturn('无需处理', 0);
|
||||
}
|
||||
|
||||
return DataReturn('处理成功', 0);
|
||||
} else {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,96 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\usernotloginhidegoodsprice\admin;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 未登录隐藏商品价格 - 后台管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('usernotloginhidegoodsprice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 限制终端
|
||||
$common_platform_type = lang('common_platform_type');
|
||||
$limit_terminal_all = [];
|
||||
if(!empty($ret['data']['limit_terminal']))
|
||||
{
|
||||
foreach(explode(',', $ret['data']['limit_terminal']) as $type)
|
||||
{
|
||||
if(isset($common_platform_type[$type]))
|
||||
{
|
||||
$limit_terminal_all[] = $common_platform_type[$type]['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$ret['data']['limit_terminal_text'] = implode(',', $limit_terminal_all);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usernotloginhidegoodsprice/admin/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('usernotloginhidegoodsprice');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 限制终端
|
||||
$ret['data']['limit_terminal'] = empty($ret['data']['limit_terminal']) ? [] : explode(',', $ret['data']['limit_terminal']);
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/usernotloginhidegoodsprice/admin/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'usernotloginhidegoodsprice', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,31 +0,0 @@
|
||||
{
|
||||
"base":{
|
||||
"plugins":"usernotloginhidegoodsprice",
|
||||
"name":"未登录隐藏商品价格",
|
||||
"logo":"\/static\/upload\/images\/plugins_usernotloginhidegoodsprice\/2019\/02\/26\/1551184745400164.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"用户未登录不展示商品价格",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5",
|
||||
"app",
|
||||
"alipay",
|
||||
"weixin",
|
||||
"baidu"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
"plugins_service_goods_handle_end":[
|
||||
"app\\plugins\\usernotloginhidegoodsprice\\Hook"
|
||||
],
|
||||
"plugins_service_goods_spec_base":[
|
||||
"app\\plugins\\usernotloginhidegoodsprice\\Hook"
|
||||
]
|
||||
}
|
||||
}
|
||||
0
application/plugins/view/.gitignore
vendored
Normal file → Executable file
0
application/plugins/view/.gitignore
vendored
Normal file → Executable file
@ -1,147 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('answers', 'admin', 'basesave')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('answers', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">问答系统</span>
|
||||
<a href="{{:PluginsAdminUrl('answers', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>应用导航名称<span class="am-form-group-label-tips">空则不显示</span></label>
|
||||
<input type="text" name="application_name" placeholder="应用导航名称" maxlength="16" data-validation-message="应用导航名称格式最多 16 个字符" class="am-radius" {{if !empty($data['application_name'])}} value="{{$data.application_name}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">中间横幅<span class="am-form-group-label-tips">建议1200像数X80像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-images-view" data-form-name="images" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['images_old'])}}
|
||||
<li>
|
||||
<input type="text" name="images" value="{{$data.images_old}}" data-validation-message="请上中间横幅传图片" required />
|
||||
<img src="{{$data.images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-view">+上传图片</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>中间横幅-链接地址<span class="am-form-group-label-tips">带http://或https://</span></label>
|
||||
<input type="url" placeholder="链接地址" name="url" data-validation-message="链接地址格式有误" class="am-radius" {{if !empty($data['url'])}} value="{{$data.url}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>中间横幅-是否新窗口打开</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_new_window_open" value="{{$v.id}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_new_window_open']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">底部横幅<span class="am-form-group-label-tips">建议1200像数X80像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-images-bottom-view" data-form-name="images_bottom" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['images_bottom_old'])}}
|
||||
<li>
|
||||
<input type="text" name="images_bottom" value="{{$data.images_bottom_old}}" data-validation-message="请上传底部横幅图片" required />
|
||||
<img src="{{$data.images_bottom}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-bottom-view">+上传图片</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>底部横幅-链接地址<span class="am-form-group-label-tips">带http://或https://</span></label>
|
||||
<input type="url" placeholder="链接地址" name="url_bottom" data-validation-message="链接地址格式有误" class="am-radius" {{if !empty($data['url_bottom'])}} value="{{$data.url_bottom}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>底部横幅-是否新窗口打开</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_new_window_open_bottom" value="{{$v.id}}" {{if isset($data['is_new_window_open_bottom']) and $data['is_new_window_open_bottom'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_new_window_open_bottom']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>右侧推荐问答名称<span class="am-form-group-label-tips">默认 推荐问答</span></label>
|
||||
<input type="text" name="right_top_rec_name" placeholder="右侧推荐问答名称" maxlength="30" data-validation-message="右侧推荐问答名称格式最多 30 个字符" class="am-radius" {{if !empty($data['right_top_rec_name'])}} value="{{$data.right_top_rec_name}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>中间最新问答名称<span class="am-form-group-label-tips">默认 最新问答</span></label>
|
||||
<input type="text" name="middle_new_name" placeholder="中间最新问答名称" maxlength="30" data-validation-message="中间最新问答名称格式最多 30 个字符" class="am-radius" {{if !empty($data['middle_new_name'])}} value="{{$data.middle_new_name}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>右侧推荐商品名称<span class="am-form-group-label-tips">默认 推荐商品</span></label>
|
||||
<input type="text" name="right_top_goods_name" placeholder="右侧推荐商品名称" maxlength="30" data-validation-message="右侧推荐商品名称格式最多 30 个字符" class="am-radius" {{if !empty($data['right_top_goods_name'])}} value="{{$data.right_top_goods_name}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>最新问答展示数量<span class="am-form-group-label-tips">默认 15 条</span></label>
|
||||
<input type="number" name="middle_new_page_number" placeholder="最新问答展示数量" maxlength="30" data-validation-message="请填写最新问答展示数量" class="am-radius" value="{{if !empty($data['middle_new_page_number'])}}{{$data.middle_new_page_number}}{{else /}}15{{/if}}" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>搜索问答展示数量<span class="am-form-group-label-tips">默认 28 条</span></label>
|
||||
<input type="number" name="search_page_number" placeholder="搜索问答展示数量" maxlength="30" data-validation-message="请填写搜索问答展示数量数量" class="am-radius" value="{{if !empty($data['search_page_number'])}}{{$data.search_page_number}}{{else /}}28{{/if}}" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>首页开启最新商品展示<span class="am-form-group-label-tips">空则不展示</span></label>
|
||||
<input type="number" name="home_new_goods_number" placeholder="首页开启最新商品展示" maxlength="30" data-validation-message="请填写首页开启最新商品展示数量" class="am-radius" value="{{if !empty($data['home_new_goods_number'])}}{{$data.home_new_goods_number}}{{/if}}" />
|
||||
</div>
|
||||
|
||||
<label>右侧推荐问答</label>
|
||||
<div class="forth-selection-container">
|
||||
<div class="forth-selection-form" data-search-url="{{:PluginsAdminUrl('answers', 'admin', 'answerssearch')}}">
|
||||
<input type="text" placeholder="商品名称" class="am-radius forth-selection-form-keywords" />
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm search-submit">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing forth-selection-list">
|
||||
<input type="text" name="category_ids" value="{{if !empty($data['category_ids'])}}{{$data.category_ids}}{{/if}}" data-validation-message="请选择问答" />
|
||||
<div class="forth-selection-items am-fl">
|
||||
<div class="title">可选</div>
|
||||
<ul class="forth-selection-content am-list ul-left">
|
||||
<div class="table-no">没有相关数据</div>
|
||||
</ul>
|
||||
</div>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-xs selected-all">全选 <i class="am-icon-angle-double-right"></i></button>
|
||||
<div class="forth-selection-items am-fr">
|
||||
<div class="title">已选</div>
|
||||
<ul class="forth-selection-content am-list ul-right">
|
||||
<div class="table-no {{if !empty($answers_rc_list)}}none{{/if}}">没有相关数据</div>
|
||||
{{if !empty($answers_rc_list)}}
|
||||
{{foreach $answers_rc_list as $v}}
|
||||
<li class="am-animation-slide-bottom items-li-{{$v.id}}">
|
||||
<span class="name" data-value="{{$v.id}}">{{$v.title}}</span>
|
||||
<i class="am-icon-trash-o am-fr"></i>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,82 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">
|
||||
{{if empty($data['id'])}}
|
||||
商品添加
|
||||
{{else /}}
|
||||
商品编辑
|
||||
{{/if}}
|
||||
</span>
|
||||
<a href="{{:PluginsAdminUrl('answers', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="answers-content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('answers', 'admin', 'goodssave')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('answers', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<div class="forth-selection-container">
|
||||
<div class="forth-selection-form" data-search-url="{{:PluginsAdminUrl('answers', 'admin', 'goodssearch')}}">
|
||||
<select class="am-radius c-p chosen-select forth-selection-form-category" data-placeholder="可选择..." data-validation-message="请选择商品分类">
|
||||
<option value="">可选择...</option>
|
||||
{{if !empty($goods_category_list)}}
|
||||
{{foreach $goods_category_list as $v}}
|
||||
<option value="{{$v.id}}">一级 - {{$v.name}}</option>
|
||||
{{if !empty($v['items'])}}
|
||||
{{foreach $v.items as $vs}}
|
||||
<option style="padding-left: 30px;" value="{{$vs.id}}">二级 - {{$vs.name}}</option>
|
||||
{{if !empty($vs['items'])}}
|
||||
{{foreach $vs.items as $vss}}
|
||||
<option style="padding-left: 60px;" value="{{$vss.id}}">三级 - {{$vss.name}}</option>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</select>
|
||||
<input type="text" placeholder="商品名称" class="am-radius forth-selection-form-keywords" />
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm search-submit">搜索</button>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing forth-selection-list">
|
||||
<input type="text" name="category_ids" value="{{if !empty($goods['goods_ids'])}}{{:implode(',', $goods['goods_ids'])}}{{/if}}" data-validation-message="请选择商品" />
|
||||
<div class="forth-selection-items am-fl">
|
||||
<div class="title">可选</div>
|
||||
<ul class="forth-selection-content am-list ul-left">
|
||||
<div class="table-no">没有相关数据</div>
|
||||
</ul>
|
||||
</div>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-xs selected-all">全选 <i class="am-icon-angle-double-right"></i></button>
|
||||
<div class="forth-selection-items am-fr">
|
||||
<div class="title">已选</div>
|
||||
<ul class="forth-selection-content am-list ul-right">
|
||||
<div class="table-no {{if !empty($goods['goods'])}}none{{/if}}">没有相关数据</div>
|
||||
{{if !empty($goods['goods'])}}
|
||||
{{foreach $goods['goods'] as $v}}
|
||||
<li class="am-animation-slide-bottom items-li-{{$v.id}}">
|
||||
<span class="name" data-value="{{$v.id}}">{{$v.title}}</span>
|
||||
<i class="am-icon-trash-o am-fr"></i>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="hidden" name="id" {{if !empty($params['id'])}} value="{{$params.id}}"{{/if}} />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,178 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">问答系统</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="answers-content">
|
||||
<!-- 基础数据 -->
|
||||
<div class="am-panel am-panel-secondary answers-middle-banner">
|
||||
<div class="am-panel-hd">
|
||||
<span class="am-panel-title">基础数据</span>
|
||||
<a class="am-fr" href="{{:PluginsAdminUrl('answers', 'admin', 'baseinfo')}}">编辑</a>
|
||||
</div>
|
||||
<div class="am-panel-bd">
|
||||
<div class="items">
|
||||
<label>应用导航名称</label>
|
||||
<div>
|
||||
{{if empty($data['application_name'])}}
|
||||
未设置应用导航名称
|
||||
{{else /}}
|
||||
{{$data.application_name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>右侧推荐问答名称</label>
|
||||
<div>
|
||||
{{if empty($data['right_top_rec_name'])}}
|
||||
推荐问答
|
||||
{{else /}}
|
||||
{{$data.right_top_rec_name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>中间最新问答名称</label>
|
||||
<div>
|
||||
{{if empty($data['middle_new_name'])}}
|
||||
最新问答
|
||||
{{else /}}
|
||||
{{$data.middle_new_name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>右侧推荐商品名称</label>
|
||||
<div>
|
||||
{{if empty($data['right_top_goods_name'])}}
|
||||
推荐商品
|
||||
{{else /}}
|
||||
{{$data.right_top_goods_name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>最新问答展示数量</label>
|
||||
<div>
|
||||
{{if empty($data['middle_new_page_number'])}}
|
||||
默认 15 条
|
||||
{{else /}}
|
||||
{{$data.middle_new_page_number}} 条
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>搜索问答展示数量</label>
|
||||
<div>
|
||||
{{if empty($data['search_page_number'])}}
|
||||
默认 28 条
|
||||
{{else /}}
|
||||
{{$data.search_page_number}} 条
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>首页开启最新商品展示</label>
|
||||
<div>
|
||||
{{if empty($data['home_new_goods_number'])}}
|
||||
不展示
|
||||
{{else /}}
|
||||
{{$data.home_new_goods_number}} 条
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>中间横幅</label>
|
||||
<div class="immages-tag">
|
||||
<a href="{{if empty($data['url'])}}javascript:;{{else /}}{{$data.url}}{{/if}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{if !empty($data['images'])}}{{$data.images}}{{else /}}{{$attachment_host}}/static/plugins/images/answers/default-images.jpg{{/if}}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>底部横幅</label>
|
||||
<div class="immages-tag">
|
||||
<a href="{{if empty($data['url_bottom'])}}javascript:;{{else /}}{{$data.url_bottom}}{{/if}}" {{if isset($data['is_new_window_open_bottom']) and $data['is_new_window_open_bottom'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{if !empty($data['images_bottom'])}}{{$data.images_bottom}}{{else /}}{{$attachment_host}}/static/plugins/images/answers/default-images.jpg{{/if}}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 幻灯片 -->
|
||||
<div class="am-panel am-panel-secondary answers-slider">
|
||||
<div class="am-panel-hd">
|
||||
<span class="am-panel-title">幻灯片</span>
|
||||
<a class="am-fr" href="{{:PluginsAdminUrl('answers', 'admin', 'slider')}}">编辑</a>
|
||||
</div>
|
||||
<div class="am-panel-bd">
|
||||
{{if !empty($slider)}}
|
||||
<div data-am-widget="slider" class="am-slider am-slider-c3" data-am-slider='{"controlNav":false}'>
|
||||
<ul class="am-slides">
|
||||
{{foreach $slider as $k=>$v}}
|
||||
<li>
|
||||
<a href="{{$v.url}}" target="_blank">
|
||||
<img src="{{$v.images_url}}">
|
||||
<div class="am-slider-desc">
|
||||
<div class="am-slider-counter">
|
||||
<span class="am-active">{{$k+1}}</span>/{{:count($slider)}}</div>
|
||||
{{$v.name}}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
||||
{{else /}}
|
||||
没有幻灯片
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧商品 -->
|
||||
<div class="am-panel am-panel-secondary answers-goods">
|
||||
<div class="am-panel-hd">
|
||||
<span class="am-panel-title">右侧商品</span>
|
||||
<a class="am-fr" href="{{:PluginsAdminUrl('answers', 'admin', 'goodsinfo')}}">编辑</a>
|
||||
</div>
|
||||
<div class="am-panel-bd">
|
||||
{{if !empty($goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-4 am-avg-lg-8 am-gallery-bordered" data-am-gallery="{ }" >
|
||||
{{foreach $goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{else /}}
|
||||
没有商品数据
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,71 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">问答系统</span>
|
||||
<a href="{{:PluginsAdminUrl('answers', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="answers-content">
|
||||
<!-- operation start -->
|
||||
<div class="am-g m-t-15">
|
||||
<a href="{{:PluginsAdminUrl('answers', 'admin', 'sliderinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
|
||||
</div>
|
||||
<!-- operation end -->
|
||||
|
||||
<!-- list start -->
|
||||
<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<th>图片</th>
|
||||
<th>url地址</th>
|
||||
<th class="am-hide-sm-only">是否启用</th>
|
||||
<th class="am-hide-sm-only">创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if !empty($data_list)}}
|
||||
{{foreach $data_list as $v}}
|
||||
<tr id="data-list-{{$v.id}}" {{if $v['is_enable'] eq 0}}class="am-active"{{/if}}>
|
||||
<td>{{$v.name}}</td>
|
||||
<td {{if !empty($v['bg_color'])}}style="background-color:{{$v.bg_color}};"{{/if}}>
|
||||
{{if !empty($v['images_url'])}}
|
||||
<a href="{{$v['images_url']}}" target="_blank">
|
||||
<img src="{{$v['images_url']}}" class="am-radius" width="100" height="60" />
|
||||
</a>
|
||||
{{else /}}
|
||||
<span class="cr-ddd">暂无图片</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{$v.url}}</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:PluginsAdminUrl('answers', 'admin', 'sliderstatusupdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1"></a>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">{{$v.add_time_time}}</td>
|
||||
<td class="view-operation">
|
||||
<a href="{{:PluginsAdminUrl('answers', 'admin', 'sliderinfo', ['id'=>$v['id']])}}">
|
||||
<button class="am-btn am-btn-secondary am-btn-xs am-radius am-icon-edit"> 编辑</button>
|
||||
</a>
|
||||
<button class="am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:PluginsAdminUrl('answers', 'admin', 'sliderdelete')}}" data-id="{{$v.id}}"> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{if empty($data_list)}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
<!-- list end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,64 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">
|
||||
{{if empty($data['id'])}}
|
||||
幻灯片添加
|
||||
{{else /}}
|
||||
幻灯片编辑
|
||||
{{/if}}
|
||||
</span>
|
||||
<a href="{{:PluginsAdminUrl('answers', 'admin', 'slider')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="answers-content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('answers', 'admin', 'slidersave')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('answers', 'admin', 'slider')}}" enctype="multipart/form-data">
|
||||
<div class="am-form-group">
|
||||
<label>名称</label>
|
||||
<input type="text" name="name" placeholder="名称" minlength="2" maxlength="60" data-validation-message="名称格式 2~60 个字符" class="am-radius" {{if !empty($data)}} value="{{$data.name}}"{{/if}} required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>url地址<span class="am-form-group-label-tips">带http://或https://</span></label>
|
||||
<input type="url" placeholder="url地址" name="url" data-validation-message="url格式有误" class="am-radius" {{if !empty($data)}} value="{{$data.url}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">图片</label>
|
||||
<ul class="plug-file-upload-view slide-images_url-images-view" data-form-name="images_url" data-max-number="1" data-delete="0" data-dialog-type="images">
|
||||
<li>
|
||||
<input type="text" name="images_url" value="{{if !empty($data['images_url'])}}{{$data.images_url}}{{/if}}" data-validation-message="请上传图片" required />
|
||||
<img src="{{if !empty($data['images_url'])}}{{$data.images_url}}{{else /}}{{$attachment_host}}/static/plugins/images/answers/default-images.jpg{{/if}}" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.slide-images_url-images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>顺序</label>
|
||||
<input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="{{if isset($data['sort'])}}{{$data.sort}}{{else /}}0{{/if}}" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="block">是否启用</label>
|
||||
<input name="is_enable" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (!empty($data) and $data['is_enable'] eq 1) or empty($data)}}checked="true"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}} />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,134 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
<!-- search -->
|
||||
{{include file="public/nav_search" /}}
|
||||
|
||||
<!-- header nav -->
|
||||
{{include file="public/header_nav" /}}
|
||||
|
||||
<!-- goods category -->
|
||||
{{include file="public/goods_category" /}}
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-g am-container plugins-answers plugins-answers-detail">
|
||||
<!-- 详情 -->
|
||||
<div class="am-u-md-8">
|
||||
{{if isset($plugins_answers_detail['code']) and $plugins_answers_detail['code'] eq 0}}
|
||||
{{if !empty($plugins_answers_detail['data']['content'])}}
|
||||
<div class="base-title">
|
||||
{{if !empty($plugins_answers_detail['data']['title'])}}
|
||||
<h2><span class="highlighted">主题:</span>{{$plugins_answers_detail.data.title}}</h2>
|
||||
{{/if}}
|
||||
<p class="gray-text">阅读数:<span class="highlighted">{{$plugins_answers_detail.data.access_count}}</span></p>
|
||||
</div>
|
||||
<div class="base-content">{{$plugins_answers_detail.data.content|raw}}</div>
|
||||
<div class="base-footer gray-text">
|
||||
留言时间:{{$plugins_answers_detail.data.add_time_date}}
|
||||
{{if !empty($plugins_answers_detail['data']['name'])}}
|
||||
|
||||
留言人:{{$plugins_answers_detail.data.name}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="am-panel base {{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}} am-panel-success{{else /}} am-panel-warning{{/if}}">
|
||||
{{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}}
|
||||
<div class="am-panel-bd">
|
||||
<span class="am-badge am-radius am-badge-success">管理员已回答</span>
|
||||
<p class="reply-content">{{$plugins_answers_detail.data.reply|raw}}</p>
|
||||
</div>
|
||||
<div class="base-footer gray-text reply-footer">
|
||||
回复时间:{{$plugins_answers_detail.data.reply_time_date}}
|
||||
</div>
|
||||
{{else /}}
|
||||
<div class="am-panel-bd">
|
||||
<span class="am-badge am-radius">管理员待回复</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> {{$plugins_answers_detail.msg}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 右侧列表 -->
|
||||
<div class="am-u-md-4 answers-sidebar">
|
||||
<!-- 操作 -->
|
||||
{{include file="../../../plugins/view/answers/index/public/operation" /}}
|
||||
|
||||
<!-- 右侧推荐问答 -->
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_rec_name'])}}
|
||||
推荐问答
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_rec_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'search')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_rc_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_rc_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<div class="answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_goods_name'])}}
|
||||
推荐商品
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_goods_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:MyUrl('index/search/index')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
{{if !empty($plugins_answers_goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-2 am-avg-lg-2 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_answers_goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 提问popup -->
|
||||
{{include file="../../../plugins/view/answers/index/public/popup" /}}
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,202 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
<!-- search -->
|
||||
{{include file="public/nav_search" /}}
|
||||
|
||||
<!-- header nav -->
|
||||
{{include file="public/header_nav" /}}
|
||||
|
||||
<!-- goods category -->
|
||||
{{include file="public/goods_category" /}}
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-g am-container plugins-answers">
|
||||
<div class="answers-top">
|
||||
<!-- 幻灯片 -->
|
||||
<div class="am-u-md-8 answers-slider">
|
||||
{{if !empty($plugins_answers_slider)}}
|
||||
<div data-am-widget="slider" class="am-slider am-slider-c3" data-am-slider='{"controlNav":false}'>
|
||||
<ul class="am-slides">
|
||||
{{foreach $plugins_answers_slider as $k=>$v}}
|
||||
<li>
|
||||
<a href="{{if empty($v['url'])}}javascript:;{{else /}}{{$v.url}}{{/if}}" target="_blank">
|
||||
<img src="{{$v.images_url}}" alt="{{$v.name}}">
|
||||
<div class="am-slider-desc">
|
||||
<div class="am-slider-counter">
|
||||
<span class="am-active">{{$k+1}}</span>/{{:count($plugins_answers_slider)}}
|
||||
</div>
|
||||
{{$v.name}}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 右侧列表 -->
|
||||
<div class="am-u-md-4 answers-sidebar">
|
||||
<!-- 操作 -->
|
||||
{{include file="../../../plugins/view/answers/index/public/operation" /}}
|
||||
|
||||
<!-- 右侧推荐问答 -->
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_rec_name'])}}
|
||||
推荐问答
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_rec_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'search')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_rc_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_rc_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 中间横幅广告 -->
|
||||
{{if !empty($plugins_answers_data['images'])}}
|
||||
<div class="answers-middle-banner">
|
||||
<a href="{{if empty($plugins_answers_data['url'])}}javascript:;{{else /}}{{$plugins_answers_data.url}}{{/if}}" {{if isset($plugins_answers_data['is_new_window_open']) and $plugins_answers_data['is_new_window_open'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{$plugins_answers_data.images}}" />
|
||||
</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="answers-middle">
|
||||
<!-- 最新问答 -->
|
||||
<div class="am-u-md-8 answers-middle-list">
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['middle_new_name'])}}
|
||||
最新问答
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.middle_new_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'search')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_middle_answer_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_middle_answer_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
<div class="am-list-news-ft">
|
||||
<a class="am-list-news-more am-btn am-btn-default" href="{{:PluginsHomeUrl('answers', 'index', 'search')}}">查看更多 »</a>
|
||||
</div>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<div class="am-u-md-4 answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_goods_name'])}}
|
||||
推荐商品
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_goods_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:MyUrl('index/search/index')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
{{if !empty($plugins_answers_goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-2 am-avg-lg-2 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_answers_goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部横幅广告 -->
|
||||
{{if !empty($plugins_answers_data['images_bottom'])}}
|
||||
<div class="answers-middle-banner">
|
||||
<a href="{{if empty($plugins_answers_data['url_bottom'])}}javascript:;{{else /}}{{$plugins_answers_data.url_bottom}}{{/if}}" {{if isset($plugins_answers_data['is_new_window_open_bottom']) and $plugins_answers_data['is_new_window_open_bottom'] eq 1}} target="_blank"{{/if}}>
|
||||
<img src="{{$plugins_answers_data.images_bottom}}" />
|
||||
</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 最新商品 -->
|
||||
{{if !empty($plugins_new_goods_list)}}
|
||||
<div class="answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>最新商品</h2>
|
||||
<a href="{{:MyUrl('index/search/index')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-6 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_new_goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 提问popup -->
|
||||
{{include file="../../../plugins/view/answers/index/public/popup" /}}
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,125 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
<!-- search -->
|
||||
{{include file="public/nav_search" /}}
|
||||
|
||||
<!-- header nav -->
|
||||
{{include file="public/header_nav" /}}
|
||||
|
||||
<!-- goods category -->
|
||||
{{include file="public/goods_category" /}}
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-g am-container plugins-answers plugins-answers-search">
|
||||
<!-- 详情 -->
|
||||
<div class="am-u-md-8">
|
||||
{{if !empty($plugins_answers_data_list)}}
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default">
|
||||
<div class="am-list-news-bd">
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_data_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if isset($answers['is_reply']) and $answers['is_reply'] eq 1}}
|
||||
<span class="am-badge am-radius am-badge-success">已回复</span>
|
||||
{{else /}}
|
||||
<span class="am-badge am-radius">待回复</span>
|
||||
{{/if}}
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{$page_html|raw}}
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 右侧列表 -->
|
||||
<div class="am-u-md-4 answers-sidebar">
|
||||
<!-- 操作 -->
|
||||
{{include file="../../../plugins/view/answers/index/public/operation" /}}
|
||||
|
||||
<!-- 右侧推荐问答 -->
|
||||
<div data-am-widget="list_news" class="am-list-news am-list-news-default">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_rec_name'])}}
|
||||
推荐问答
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_rec_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'search')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
<div class="am-list-news-bd">
|
||||
{{if !empty($plugins_answers_rc_list)}}
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_rc_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 推荐商品 -->
|
||||
<div class="answers-goods">
|
||||
<div class="am-list-news-hd am-cf">
|
||||
<h2>
|
||||
{{if empty($plugins_answers_data['right_top_goods_name'])}}
|
||||
推荐商品
|
||||
{{else /}}
|
||||
{{$plugins_answers_data.right_top_goods_name}}
|
||||
{{/if}}
|
||||
</h2>
|
||||
<a href="{{:MyUrl('index/search/index')}}" target="_blank" class="am-list-news-more am-fr">更多 »</a>
|
||||
</div>
|
||||
{{if !empty($plugins_answers_goods_list)}}
|
||||
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-2 am-avg-lg-2 am-gallery-bordered" data-am-gallery="{}">
|
||||
{{foreach $plugins_answers_goods_list as $goods}}
|
||||
<li>
|
||||
<div class="am-gallery-item">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}" alt="{{$goods.title}}"/>
|
||||
<h3 class="am-gallery-title">{{$goods.title}}</h3>
|
||||
<div class="price">
|
||||
<strong>¥{{$goods.min_price}}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 提问popup -->
|
||||
{{include file="../../../plugins/view/answers/index/public/popup" /}}
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,17 +0,0 @@
|
||||
<!-- 操作按钮 -->
|
||||
<div class="answers-btn-list">
|
||||
<a href="javascript:;" type="button" class="am-btn am-btn-warning am-icon-plus" data-am-modal="{target: '#plugins-answers-popup-ask'}"> 我要提问</a>
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/answer/index')}}{{/if}}" type="button" class="am-btn am-btn-danger am-icon-list-ul am-fr {{if empty($user)}}login-event{{/if}}"> 我的提问</a>
|
||||
</div>
|
||||
|
||||
<!-- 搜索 -->
|
||||
<form action="{{:PluginsHomeUrl('answers', 'index', 'search')}}" method="post">
|
||||
<div class="am-input-group am-input-group-sm answers-search">
|
||||
<input type="text" name="answers_keywords" class="am-form-field" placeholder="其实搜索很简单^_^ !" autocomplete="off" {{if !empty($params['answers_keywords'])}}value="{{$params.answers_keywords}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="submit">
|
||||
<span class="am-icon-search am-icon-sm"></span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
@ -1,31 +0,0 @@
|
||||
<div class="am-popup" id="plugins-answers-popup-ask">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">提问</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form form-validation-plugins-answer-ask view-save" action="{{:PluginsHomeUrl('answers', 'index', 'answer')}}" method="POST" request-type="ajax-reload">
|
||||
<div class="am-form-group">
|
||||
<label>昵称<span class="am-form-group-label-tips-must">必填</span></label>
|
||||
<input type="text" name="name" placeholder="昵称" minlength="1" maxlength="30" data-validation-message="昵称格式 1~30 个字符之间" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>电话<span class="am-form-group-label-tips">选填</span></label>
|
||||
<input type="text" name="tel" placeholder="电话" data-validation-message="请填写电话" class="am-radius" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>标题<span class="am-form-group-label-tips-must">必填</span></label>
|
||||
<input type="text" name="title" placeholder="标题" minlength="1" maxlength="60" data-validation-message="标题格式 1~60 个字符之间" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>内容<span class="am-form-group-label-tips-must">必填</span></label>
|
||||
<textarea class="am-radius am-validate" name="content" rows="5" minlength="5" maxlength="1000" placeholder="内容至少5个字" data-validation-message="内容格式 5~1000 个字符之间" required></textarea>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,36 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">回到顶部</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="commongobacktop-content">
|
||||
<div class="items">
|
||||
<label>图片</label>
|
||||
<div class="immages-tag">
|
||||
<img src="{{if !empty($data['images'])}}{{$data.images}}{{else /}}{{$attachment_host}}/static/plugins/images/commongobacktop/default-images.jpg{{/if}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>是否全局</label>
|
||||
<div>
|
||||
{{if isset($data['is_overall']) and $data['is_overall'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{:PluginsAdminUrl('commongobacktop', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,46 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('commongobacktop', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('commongobacktop', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">回到顶部</span>
|
||||
<a href="{{:PluginsAdminUrl('commongobacktop', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">图片<span class="am-form-group-label-tips">建议50像数X50像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-images-view" data-form-name="images" data-max-number="1" data-delete="0" data-dialog-type="images">
|
||||
<li>
|
||||
<input type="text" name="images" value="{{if !empty($data['images_old'])}}{{$data.images_old}}{{/if}}" data-validation-message="请上传图片" required />
|
||||
<img src="{{if !empty($data['images'])}}{{$data.images}}{{else /}}{{$attachment_host}}/static/plugins/images/commongobacktop/default-images.jpg{{/if}}" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>是否全局<span class="am-form-group-label-tips">否则只在首页显示,是则全局展示</span></label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_overall" value="{{$v.id}}" {{if isset($data['is_overall']) and $data['is_overall'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_overall']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,5 +0,0 @@
|
||||
<div data-am-smooth-scroll="" class="am-hide-sm-only">
|
||||
<div id="plugins-commongobacktop" title="回到顶部">
|
||||
<img src="{{$data.images}}">
|
||||
</div>
|
||||
</div>
|
||||
@ -1,77 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">在线客服</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="commononlineservice-content">
|
||||
<div class="items">
|
||||
<label>标题</label>
|
||||
<div>
|
||||
{{if !empty($data['title'])}}
|
||||
{{$data.title}}
|
||||
{{else /}}
|
||||
未填写
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>在线客服</label>
|
||||
<div>
|
||||
{{if !empty($data['online_service'])}}
|
||||
{{$data.online_service|raw}}
|
||||
{{else /}}
|
||||
未填写
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>电话</label>
|
||||
<div>
|
||||
{{if !empty($data['tel'])}}
|
||||
{{$data.tel}}
|
||||
{{else /}}
|
||||
未填写
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>是否全局</label>
|
||||
<div>
|
||||
{{if isset($data['is_overall']) and $data['is_overall'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>背景色</label>
|
||||
<div class="bg-color-tag" {{if !empty($data['bg_color'])}}style="background:{{$data.bg_color}}"{{/if}}></div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>距离顶部</label>
|
||||
<div>
|
||||
{{if !empty($data['distance_top'])}}
|
||||
{{$data.distance_top}}
|
||||
{{else /}}
|
||||
0
|
||||
{{/if}}
|
||||
%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{:PluginsAdminUrl('commononlineservice', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,68 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('commononlineservice', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('commononlineservice', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">在线客服</span>
|
||||
<a href="{{:PluginsAdminUrl('commononlineservice', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>标题</label>
|
||||
<input type="text" name="title" placeholder="标题" minlength="2" maxlength="16" data-validation-message="标题格式 2~16 个字符之间" class="am-radius" value="{{if !empty($data)}}{{$data.title}}{{/if}}" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">在线客服<span class="am-form-group-label-tips">一行一个、以竖线 | 分割、如:客服一|123456</span></label>
|
||||
<textarea rows="5" name="online_service" class="am-radius am-field-valid" placeholder="在线客服" data-validation-message="请填写在线客服" required>{{if !empty($data['online_service'])}}{{$data.online_service}}{{/if}}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>电话</label>
|
||||
<input type="text" name="tel" placeholder="电话" data-validation-message="请填写电话" class="am-radius" value="{{if !empty($data)}}{{$data.tel}}{{/if}}" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>是否全局<span class="am-form-group-label-tips">否则只在首页显示,是则全局展示</span></label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_overall" value="{{$v.id}}" {{if isset($data['is_overall']) and $data['is_overall'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_overall']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>背景色</label>
|
||||
<input type="hidden" name="bg_color" value="{{if !empty($data['bg_color'])}}{{$data.bg_color}}{{/if}}" />
|
||||
<button class="am-btn am-btn-default am-btn-xs colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r am-radius" type="button" data-input-tag="button.bg-color-tag" data-color-tag="input[name='bg_color']" data-color-style="background-color" {{if !empty($data['bg_color'])}}style="background:{{$data.bg_color}}"{{/if}}>
|
||||
<img src="{{$attachment_host}}/static/common/images/colorpicker.png" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>距离顶部<span class="am-form-group-label-tips">默认距离顶部30%</span></label>
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" name="distance_top" placeholder="距离顶部" min="0" max="100" data-validation-message="距离顶部 0~100" class="am-form-field" value="{{if isset($data['distance_top'])}}{{$data.distance_top}}{{else /}}30{{/if}}" required />
|
||||
<span class="am-input-group-btn">
|
||||
<button type="button" class="am-btn am-btn-default am-radius">%</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,35 +0,0 @@
|
||||
<div class="commononlineservice" {{if isset($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 !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>
|
||||
{{if IsMobile()}}
|
||||
<a target="_blank" href="mqqwpa://im/chat?chat_type=wpa&uin={{$v[1]}}&version=1&src_type=web&web_src=shopxo.net">
|
||||
{{else /}}
|
||||
<a target="_blank" href="https://wpa.qq.com/msgrd?v=3&uin={{$v[1]}}&site=qq&menu=yes">
|
||||
{{/if}}
|
||||
<img border="0" src="https://pub.idqqimg.com/qconn/wpa/button/button_111.gif" alt="点击这里给我发消息" title="点击这里给我发消息">
|
||||
</a>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
{{if !empty($data['title'])}}
|
||||
<li>
|
||||
<span>电话:</span>
|
||||
<a href="tel:{{$data.tel}}">{{$data.tel}}</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,74 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">右侧快捷导航</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="commonrightnavigation-content">
|
||||
<div class="items">
|
||||
<label>支付宝小程序二维码</label>
|
||||
<div class="immages-tag">
|
||||
<img src="{{if !empty($data['weixin_fuwu_qrcode_images'])}}{{$data.weixin_fuwu_qrcode_images}}{{else /}}{{$attachment_host}}/static/plugins/images/commonrightnavigation/default-images.jpg{{/if}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>支付宝生活号二维码</label>
|
||||
<div class="immages-tag">
|
||||
<img src="{{if !empty($data['alipay_fuwu_qrcode_images'])}}{{$data.alipay_fuwu_qrcode_images}}{{else /}}{{$attachment_host}}/static/plugins/images/commonrightnavigation/default-images.jpg{{/if}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>微信小程序二维码</label>
|
||||
<div class="immages-tag">
|
||||
<img src="{{if !empty($data['weixin_mini_qrcode_images'])}}{{$data.weixin_mini_qrcode_images}}{{else /}}{{$attachment_host}}/static/plugins/images/commonrightnavigation/default-images.jpg{{/if}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>微信公众号二维码</label>
|
||||
<div class="immages-tag">
|
||||
<img src="{{if !empty($data['weixin_fuwu_qrcode_images'])}}{{$data.weixin_fuwu_qrcode_images}}{{else /}}{{$attachment_host}}/static/plugins/images/commonrightnavigation/default-images.jpg{{/if}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>链接是否新窗口打开</label>
|
||||
<div>
|
||||
{{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>是否全局</label>
|
||||
<div>
|
||||
{{if isset($data['is_overall']) and $data['is_overall'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>商品详情页面展示购物车入口</label>
|
||||
<div>
|
||||
{{if isset($data['is_goods_page_show_cart']) and $data['is_goods_page_show_cart'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{:PluginsAdminUrl('commonrightnavigation', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,113 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('commonrightnavigation', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('commonrightnavigation', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">右侧快捷导航</span>
|
||||
<a href="{{:PluginsAdminUrl('commonrightnavigation', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">支付宝小程序二维码<span class="am-form-group-label-tips">建议100像数X100像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-alipay_mini_qrcode_images-view" data-form-name="alipay_mini_qrcode_images" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['alipay_mini_qrcode_images'])}}
|
||||
<li>
|
||||
<input type="text" name="alipay_mini_qrcode_images" value="{{$data.alipay_mini_qrcode_images_old}}" data-validation-message="请上传支付宝小程序二维码" />
|
||||
<img src="{{$data.alipay_mini_qrcode_images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-alipay_mini_qrcode_images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">支付宝生活号二维码<span class="am-form-group-label-tips">建议100像数X100像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-alipay_fuwu_qrcode_images-view" data-form-name="alipay_fuwu_qrcode_images" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['alipay_fuwu_qrcode_images'])}}
|
||||
<li>
|
||||
<input type="text" name="alipay_fuwu_qrcode_images" value="{{$data.alipay_fuwu_qrcode_images_old}}" data-validation-message="请上传支付宝生活号二维码" />
|
||||
<img src="{{$data.alipay_fuwu_qrcode_images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-alipay_fuwu_qrcode_images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">微信小程序二维码<span class="am-form-group-label-tips">建议100像数X100像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-weixin_mini_qrcode_images-view" data-form-name="weixin_mini_qrcode_images" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['weixin_mini_qrcode_images'])}}
|
||||
<li>
|
||||
<input type="text" name="weixin_mini_qrcode_images" value="{{$data.weixin_mini_qrcode_images_old}}" data-validation-message="请上传微信小程序二维码" />
|
||||
<img src="{{$data.weixin_mini_qrcode_images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-weixin_mini_qrcode_images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">微信公众号二维码<span class="am-form-group-label-tips">建议100像数X100像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-weixin_fuwu_qrcode_images-view" data-form-name="weixin_fuwu_qrcode_images" data-max-number="1" data-dialog-type="images">
|
||||
{{if !empty($data['weixin_fuwu_qrcode_images'])}}
|
||||
<li>
|
||||
<input type="text" name="weixin_fuwu_qrcode_images" value="{{$data.weixin_fuwu_qrcode_images_old}}" data-validation-message="请上传微信公众号二维码" />
|
||||
<img src="{{$data.weixin_fuwu_qrcode_images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-weixin_fuwu_qrcode_images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>链接是否新窗口打开</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_new_window_open" value="{{$v.id}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_new_window_open']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>是否全局<span class="am-form-group-label-tips">否则只在首页显示,是则全局展示</span></label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_overall" value="{{$v.id}}" {{if isset($data['is_overall']) and $data['is_overall'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_overall']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>商品详情页面展示购物车入口</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_goods_page_show_cart" value="{{$v.id}}" {{if isset($data['is_goods_page_show_cart']) and $data['is_goods_page_show_cart'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_goods_page_show_cart']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,220 +0,0 @@
|
||||
<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>
|
||||
|
||||
<!-- 购物车 -->
|
||||
<div class="base-nav cart commonrightnavigation-cart" data-cart-ajax-url="{{:PluginsHomeUrl('commonrightnavigation', 'index', 'cart')}}" data-cart-delete-ajax-url="{{:MyUrl('index/cart/delete')}}">
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/cart/index')}}{{/if}}" class="nav-a {{$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}}">
|
||||
<i class="am-icon-opencart"></i>
|
||||
<div class="cart-text">
|
||||
购物车
|
||||
<div class="cart-count common-cart-total {{if $cart_total gt 0}}am-badge am-badge-danger{{/if}}">{{if $cart_total > 9}}9+{{else /}}{{$cart_total}}{{/if}}</div>
|
||||
</div>
|
||||
</a>
|
||||
{{if !isset($module_controller_action) or $module_controller_action != 'indexcartindex'}}
|
||||
<div class="mui-mbar-popup am-animation-slide-left cart-content">
|
||||
<!-- 商品列表 -->
|
||||
<div class="cart-items" style="display: {{if !empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
{{if !empty($cart_list)}}
|
||||
<table class="am-table">
|
||||
{{foreach $cart_list as $goods}}
|
||||
<tr id="data-list-{{$goods.id}}" data-id="{{$goods.id}}" data-goods-id="{{$goods.goods_id}}" class="{{if $goods['is_shelves'] neq 1}}am-warning{{/if}} {{if $goods['is_delete_time'] neq 0}}am-danger{{/if}}">
|
||||
<td class="base">
|
||||
<div class="goods-detail">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}">
|
||||
</a>
|
||||
<div class="goods-base">
|
||||
<a href="{{$goods.goods_url}}" target="_blank" class="goods-title">{{$goods.title}}</a>
|
||||
{{if !empty($goods.spec)}}
|
||||
<ul class="goods-attr">
|
||||
{{foreach $goods.spec as $spec}}
|
||||
<li>{{$spec.type}}:{{$spec.value}}</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="total-price">
|
||||
<strong class="total-price-content">¥{{$goods.total_price}}</strong>
|
||||
<span class="cart-number">x{{$goods.stock}}</span>
|
||||
</td>
|
||||
<td class="operation">
|
||||
<a href="javascript:;" class="submit-delete" data-url="{{:MyUrl('index/cart/delete')}}" data-id="{{$goods.id}}" data-view="fun" data-value="PluginsCartViewDeleteBack" data-is-confirm="0">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</table>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 导航 -->
|
||||
<div class="cart-nav" style="display: {{if !empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
<form action="{{:MyUrl('index/buy/index')}}" method="post">
|
||||
<span class="selected-tips">共 <strong>{{$base.cart_count}}</strong> 种商品</span>
|
||||
<span class="total-price-tips">共计:</span>
|
||||
<strong class="nav-total-price">¥{{$base.total_price}}</strong>
|
||||
<input type="hidden" name="ids" value="{{$base.ids}}" />
|
||||
<input type="hidden" name="buy_type" value="cart" />
|
||||
<button type="submit" class="am-btn am-btn-primary separate-submit am-fr">结算</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- 空购物车 -->
|
||||
<div class="mixed-tips" style="display: {{if empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
<i class="am-icon-cart-plus am-fl icon"></i>
|
||||
<div class="mixed-tips-content am-fl">
|
||||
<h1>您的购物车还是空的,您可以</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<span>看看</span>
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/userfavor/goods')}}{{/if}}" class="{{if empty($user)}}login-event{{/if}}">我的收藏夹</a>
|
||||
</li>
|
||||
<li>
|
||||
<span>看看</span>
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/order/index')}}{{/if}}" class="{{if empty($user)}}login-event{{/if}}">我的订单</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 二维码 -->
|
||||
{{if !empty($data['alipay_mini_qrcode_images']) or !empty($data['alipay_fuwu_qrcode_images']) or !empty($data['weixin_mini_qrcode_images']) or !empty($data['weixin_fuwu_qrcode_images'])}}
|
||||
<a href="javascript:;">
|
||||
<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>
|
||||
</a>
|
||||
{{/if}}
|
||||
|
||||
<!-- 在线留言 -->
|
||||
<a href="javascript:;">
|
||||
<div class="base-nav answer-content">
|
||||
<i class="am-icon-edit"></i>
|
||||
<div class="mui-mbar-popup am-animation-slide-left">
|
||||
<form class="am-form form-validation-plugins-commonrightnavigation-answer view-save" action="{{:PluginsHomeUrl('commonrightnavigation', 'index', 'answer')}}" method="POST" request-type="ajax-reload">
|
||||
<legend>
|
||||
<span class="fs-16">在线留言</span>
|
||||
</legend>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<label>姓名</label>
|
||||
<input type="text" name="name" placeholder="姓名" maxlength="30" data-validation-message="联系人最多30个字符" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<label>电话</label>
|
||||
<input type="text" name="tel" placeholder="电话" data-validation-message="请填写电话" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<label>内容</label>
|
||||
<textarea class="am-radius am-validate" name="content" rows="3" minlength="5" maxlength="230" placeholder="内容格式 5~230 个字符之间" data-validation-message="内容格式 5~300 个字符之间" required></textarea>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 回顶部 -->
|
||||
<a href="javascript:;">
|
||||
<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>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 返回处理
|
||||
function PluginsCartViewDeleteBack(e)
|
||||
{
|
||||
if(e.code == 0)
|
||||
{
|
||||
$.AMUI.progress.done();
|
||||
Prompt(e.msg, 'success');
|
||||
$('#data-list-'+e.data_id).remove();
|
||||
HomeCartNumberTotalUpdate(parseInt(e.data));
|
||||
|
||||
// 为空的时候处理
|
||||
if(e.data <= 0)
|
||||
{
|
||||
var $this = $('.commonrightnavigation-cart');
|
||||
$this.find('.mixed-tips').show();
|
||||
$this.find('.cart-nav').hide();
|
||||
$this.find('.cart-items').hide();
|
||||
$this.find('.cart-nav .selected-tips strong').text(0);
|
||||
$this.find('.cart-nav .nav-total-price').text('¥0.00');
|
||||
$this.find('.cart-nav input[name="ids"]').val('');
|
||||
}
|
||||
} else {
|
||||
$.AMUI.progress.done();
|
||||
Prompt(e.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -1,74 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">顶部大图</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="commontopmaxpicture-content">
|
||||
<div class="items">
|
||||
<label>图片</label>
|
||||
<div class="immages-tag">
|
||||
<img src="{{if !empty($data['images'])}}{{$data.images}}{{else /}}{{$attachment_host}}/static/plugins/images/commontopmaxpicture/default-images.jpg{{/if}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>背景色</label>
|
||||
<div class="bg-color-tag" {{if !empty($data['bg_color'])}}style="background:{{$data.bg_color}}"{{/if}}></div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>链接地址</label>
|
||||
<div>
|
||||
{{if !empty($data['url'])}}
|
||||
<a href="{{$data.url}}" target="_blank">{{$data.url}}</a>
|
||||
{{else /}}
|
||||
无
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>是否新窗口打开</label>
|
||||
<div>
|
||||
{{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>是否全局</label>
|
||||
<div>
|
||||
{{if isset($data['is_overall']) and $data['is_overall'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>有效时间</label>
|
||||
<div>
|
||||
{{if !empty($data['time_start']) and !empty($data['time_end'])}}
|
||||
{{$data.time_start}} ~ {{$data.time_end}}
|
||||
{{elseif !empty($data['time_start']) and empty($data['time_end'])}}
|
||||
{{$data.time_start}} ~ 长期有效
|
||||
{{elseif empty($data['time_start']) and !empty($data['time_end'])}}
|
||||
立即生效 ~ {{$data.time_end}}
|
||||
{{else /}}
|
||||
无限制
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,79 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">顶部大图</span>
|
||||
<a href="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">图片<span class="am-form-group-label-tips">建议1200像数X80像数</span></label>
|
||||
<ul class="plug-file-upload-view plugins-images-view" data-form-name="images" data-max-number="1" data-delete="0" data-dialog-type="images">
|
||||
<li>
|
||||
<input type="text" name="images" value="{{if !empty($data['images_old'])}}{{$data.images_old}}{{/if}}" data-validation-message="请上传图片" required />
|
||||
<img src="{{if !empty($data['images'])}}{{$data.images}}{{else /}}{{$attachment_host}}/static/plugins/images/commontopmaxpicture/default-images.jpg{{/if}}" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-view">+上传图片</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>背景色</label>
|
||||
<input type="hidden" name="bg_color" value="{{if !empty($data['bg_color'])}}{{$data.bg_color}}{{/if}}" />
|
||||
<button class="am-btn am-btn-default am-btn-xs colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r" type="button" data-input-tag="button.bg-color-tag" data-color-tag="input[name='bg_color']" data-color-style="background-color" {{if !empty($data['bg_color'])}}style="background:{{$data.bg_color}}"{{/if}}>
|
||||
<img src="{{$attachment_host}}/static/common/images/colorpicker.png" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>链接地址<span class="am-form-group-label-tips">带http://或https://</span></label>
|
||||
<input type="url" placeholder="链接地址" name="url" data-validation-message="链接地址格式有误" class="am-radius" {{if !empty($data)}} value="{{$data.url}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>是否新窗口打开</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_new_window_open" value="{{$v.id}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_new_window_open']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>是否全局<span class="am-form-group-label-tips">默认首页</span></label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_overall" value="{{$v.id}}" {{if isset($data['is_overall']) and $data['is_overall'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_overall']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>有效时间<span class="am-form-group-label-tips">留空则不限制</span></label>
|
||||
<div class="form-date">
|
||||
<input type="text" autocomplete="off" name="time_start" class="Wdate am-radius" placeholder="起始时间" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_start'])}}value="{{$data.time_start}}"{{/if}}/>
|
||||
<span>~</span>
|
||||
<input type="text" autocomplete="off" class="Wdate am-radius" placeholder="结束时间" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_end'])}}value="{{$data.time_end}}"{{/if}}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,5 +0,0 @@
|
||||
<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}}" alt="顶部大图" style="max-width: 100%;vertical-align: middle;" />
|
||||
</a>
|
||||
</div>
|
||||
@ -1,54 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">顶部公告</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="commontopnotice-content">
|
||||
<div class="items">
|
||||
<label>公告内容</label>
|
||||
<div>
|
||||
{{if !empty($data['content'])}}
|
||||
{{$data.content}}
|
||||
{{else /}}
|
||||
无
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>是否全局</label>
|
||||
<div>
|
||||
{{if isset($data['is_overall']) and $data['is_overall'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>有效时间</label>
|
||||
<div>
|
||||
{{if !empty($data['time_start']) and !empty($data['time_end'])}}
|
||||
{{$data.time_start}} ~ {{$data.time_end}}
|
||||
{{elseif !empty($data['time_start']) and empty($data['time_end'])}}
|
||||
{{$data.time_start}} ~ 长期有效
|
||||
{{elseif empty($data['time_start']) and !empty($data['time_end'])}}
|
||||
立即生效 ~ {{$data.time_end}}
|
||||
{{else /}}
|
||||
无限制
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{:PluginsAdminUrl('commontopnotice', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,49 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('commontopnotice', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('commontopnotice', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">顶部公告</span>
|
||||
<a href="{{:PluginsAdminUrl('commontopnotice', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">公告内容<span class="am-form-group-label-tips">空则不显示</span></label>
|
||||
<textarea rows="3" name="content" class="am-radius am-field-valid" placeholder="公告内容" data-validation-message="请填写公告内容">{{if !empty($data['content'])}}{{$data.content}}{{/if}}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>是否全局<span class="am-form-group-label-tips">默认首页</span></label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="is_overall" value="{{$v.id}}" {{if isset($data['is_overall']) and $data['is_overall'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_overall']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>有效时间<span class="am-form-group-label-tips">留空则不限制</span></label>
|
||||
<div class="form-date">
|
||||
<input type="text" autocomplete="off" name="time_start" class="Wdate am-radius" placeholder="起始时间" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_start'])}}value="{{$data.time_start}}"{{/if}}/>
|
||||
<span>~</span>
|
||||
<input type="text" autocomplete="off" class="Wdate am-radius" placeholder="结束时间" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_end'])}}value="{{$data.time_end}}"{{/if}}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,3 +0,0 @@
|
||||
<div class="am-alert am-alert-warning am-radius" style="margin: 0;">
|
||||
<div class="am-container">{{$data.content}}</div>
|
||||
</div>
|
||||
@ -1,54 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">快递鸟API接口</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="expressforkdn-content">
|
||||
<div class="items">
|
||||
<label>EBusinessID</label>
|
||||
<div>
|
||||
{{if empty($data['ebid'])}}
|
||||
未填写
|
||||
{{else /}}
|
||||
{{$data.ebid}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>AppKey</label>
|
||||
<div>
|
||||
{{if empty($data['appkey'])}}
|
||||
未填写
|
||||
{{else /}}
|
||||
{{$data.appkey}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>快递对应代码</label>
|
||||
<div class="express-items">
|
||||
{{if !empty($express_list)}}
|
||||
{{foreach $express_list as $express}}
|
||||
{{if $express.is_enable eq 1}}
|
||||
<p>{{$express.name}} {{if !empty($data['express_ids'][$express['id']])}}({{$data.express_ids[$express.id]}}){{/if}}</p>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<a href="{{:PluginsAdminUrl('expressforkdn', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,43 +0,0 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content expressforkdn-content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('expressforkdn', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('expressforkdn', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">快递鸟API接口</span>
|
||||
<a href="{{:PluginsAdminUrl('expressforkdn', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>EBusinessID</label>
|
||||
<input type="text" name="ebid" placeholder="商户ID" maxlength="16" class="am-radius" value="{{if !empty($data['ebid'])}}{{$data.ebid}}{{/if}}" />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="block">AppKey</label>
|
||||
<input type="text" name="appkey" placeholder="AppKey" maxlength="80" class="am-radius" value="{{if !empty($data['appkey'])}}{{$data.appkey}}{{/if}}" />
|
||||
</div>
|
||||
<div class="am-form-group express-items">
|
||||
<label class="block">快递代码<span class="am-form-group-label-tips"> 下面应对应快递代号 <a href='http://www.kdniao.com/file/2019%E5%BF%AB%E9%80%92%E9%B8%9F%E6%8E%A5%E5%8F%A3%E6%94%AF%E6%8C%81%E5%BF%AB%E9%80%92%E5%85%AC%E5%8F%B8%E7%BC%96%E7%A0%81.xlsx'>点击下载</a></span></label>
|
||||
{{if !empty($express_list)}}
|
||||
{{foreach $express_list as $express}}
|
||||
{{if $express.is_enable eq 1}}
|
||||
<p>{{$express.name}} <input type="text" name="express_ids[{{$express.id}}]" placeholder="快递代号" class="am-radius" value="{{if !empty($data['express_ids']) and isset($data.express_ids[$express.id])}}{{$data.express_ids[$express.id]}}{{/if}}"/></p>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
@ -1,10 +0,0 @@
|
||||
<!-- 物流信息 -->
|
||||
<div class="am-popup" id="plugins-expressforkdn-popup">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">物流信息</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">...</div>
|
||||
</div>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user