初始上传
This commit is contained in:
18
app/component/controller/Article.php
Executable file
18
app/component/controller/Article.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
|
||||
/**
|
||||
* 文章·组件
|
||||
*/
|
||||
class Article extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("article/design.html");
|
||||
}
|
||||
}
|
||||
68
app/component/controller/BaseDiyView.php
Executable file
68
app/component/controller/BaseDiyView.php
Executable file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
use app\Controller;
|
||||
use liliuwei\think\Jump;
|
||||
|
||||
class BaseDiyView extends Controller
|
||||
{
|
||||
use Jump;
|
||||
|
||||
// 当前组件路径
|
||||
private $path;
|
||||
|
||||
// 资源路径
|
||||
private $resource_path;
|
||||
|
||||
// 相对路径
|
||||
private $relative_path;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$class = get_class($this);
|
||||
$routes = explode('\\', $class);
|
||||
if ($routes[ 0 ] == 'app') {
|
||||
//系统·组件:app/component/controller/Text
|
||||
$this->path = './' . $routes[ 0 ] . '/';
|
||||
$this->resource_path = __ROOT__ . '/' . $routes[ 0 ] . '/' . $routes[ 1 ] . '/view';
|
||||
$this->relative_path = $routes[ 0 ] . '/' . $routes[ 1 ] . '/view';
|
||||
} elseif ($routes[ 0 ] == 'addon') {
|
||||
//插件·组件:addon/seckill/component/controller/seckill
|
||||
$this->path = './' . $routes[ 0 ] . '/' . $routes[ 1 ] . '/';
|
||||
$this->resource_path = __ROOT__ . '/' . $routes[ 0 ] . '/' . $routes[ 1 ] . '/' . $routes[ 2 ] . '/view';
|
||||
$this->relative_path = $routes[ 0 ] . '/' . $routes[ 1 ] . '/' . $routes[ 2 ] . '/view';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载模板输出
|
||||
*
|
||||
* @access protected
|
||||
* @param string $template 模板文件名
|
||||
* @param array $vars 模板输出变量
|
||||
* @param array $replace 模板替换
|
||||
*/
|
||||
protected function fetch($template = '', $vars = [], $replace = [])
|
||||
{
|
||||
$comp_folder_name = explode('/', $template)[ 0 ];// 获取组件文件夹名称
|
||||
$template = $this->path . 'component/view/' . $template;
|
||||
$this->resource_path .= '/' . $comp_folder_name; // 拼接组件文件夹名称
|
||||
$this->relative_path .= '/' . $comp_folder_name; // 拼接组件文件夹名称
|
||||
|
||||
parent::assign('resource_path', $this->resource_path);
|
||||
parent::assign('relative_path', $this->relative_path);
|
||||
return parent::fetch($template, $vars, $replace);
|
||||
}
|
||||
}
|
||||
17
app/component/controller/FloatBtn.php
Executable file
17
app/component/controller/FloatBtn.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 商品分类·组件
|
||||
*/
|
||||
class FloatBtn extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("float_btn/design.html");
|
||||
}
|
||||
}
|
||||
18
app/component/controller/FollowOfficialAccount.php
Executable file
18
app/component/controller/FollowOfficialAccount.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
|
||||
/**
|
||||
* 关注公众号·组件
|
||||
*/
|
||||
class FollowOfficialAccount extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("follow_official_account/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/GoodsBrand.php
Executable file
17
app/component/controller/GoodsBrand.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 商品品牌·组件
|
||||
*/
|
||||
class GoodsBrand extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("goods_brand/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/GoodsCategory.php
Executable file
17
app/component/controller/GoodsCategory.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 商品分类·组件
|
||||
*/
|
||||
class GoodsCategory extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("goods_category/design.html");
|
||||
}
|
||||
}
|
||||
27
app/component/controller/GoodsList.php
Executable file
27
app/component/controller/GoodsList.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
use app\model\goods\GoodsCategory;
|
||||
|
||||
/**
|
||||
* 商品列表·组件
|
||||
*/
|
||||
class GoodsList extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
$site_id = request()->siteid();
|
||||
$goods_category_model = new GoodsCategory();
|
||||
$category_condition = [
|
||||
[ 'site_id', '=', $site_id ]
|
||||
];
|
||||
$category_list = $goods_category_model->getCategoryTree($category_condition)[ 'data' ];
|
||||
$this->assign("category_list", $category_list);
|
||||
|
||||
return $this->fetch("goods_list/design.html");
|
||||
}
|
||||
}
|
||||
27
app/component/controller/GoodsRecommend.php
Executable file
27
app/component/controller/GoodsRecommend.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
use app\model\goods\GoodsCategory;
|
||||
|
||||
/**
|
||||
* 商品推荐·组件
|
||||
*/
|
||||
class GoodsRecommend extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
$site_id = request()->siteid();
|
||||
$goods_category_model = new GoodsCategory();
|
||||
$category_condition = [
|
||||
[ 'site_id', '=', $site_id ]
|
||||
];
|
||||
$category_list = $goods_category_model->getCategoryTree($category_condition)[ 'data' ];
|
||||
$this->assign("category_list", $category_list);
|
||||
|
||||
return $this->fetch("goods_recommend/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/GraphicNav.php
Executable file
17
app/component/controller/GraphicNav.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 图文导航·组件
|
||||
*/
|
||||
class GraphicNav extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("graphic_nav/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/HorzBlank.php
Executable file
17
app/component/controller/HorzBlank.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 辅助空白·组件
|
||||
*/
|
||||
class HorzBlank extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("horz_blank/design.html");
|
||||
}
|
||||
}
|
||||
18
app/component/controller/HorzLine.php
Executable file
18
app/component/controller/HorzLine.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 辅助线·组件
|
||||
*
|
||||
*/
|
||||
class HorzLine extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("horz_line/design.html");
|
||||
}
|
||||
}
|
||||
18
app/component/controller/HotArea.php
Executable file
18
app/component/controller/HotArea.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
|
||||
/**
|
||||
* 热区·组件
|
||||
*/
|
||||
class HotArea extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("hot_area/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/ImageAds.php
Executable file
17
app/component/controller/ImageAds.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 图片广告·组件
|
||||
*/
|
||||
class ImageAds extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("image_ads/design.html");
|
||||
}
|
||||
}
|
||||
27
app/component/controller/ManyGoodsList.php
Executable file
27
app/component/controller/ManyGoodsList.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
use app\model\goods\GoodsCategory;
|
||||
|
||||
/**
|
||||
* 商品列表·组件
|
||||
*/
|
||||
class ManyGoodsList extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
$site_id = request()->siteid();
|
||||
$goods_category_model = new GoodsCategory();
|
||||
$category_condition = [
|
||||
[ 'site_id', '=', $site_id ]
|
||||
];
|
||||
$category_list = $goods_category_model->getCategoryTree($category_condition)[ 'data' ];
|
||||
$this->assign("category_list", $category_list);
|
||||
|
||||
return $this->fetch("many_goods_list/design.html");
|
||||
}
|
||||
}
|
||||
24
app/component/controller/MemberInfo.php
Executable file
24
app/component/controller/MemberInfo.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
|
||||
use app\model\web\DiyView as DiyViewModel;
|
||||
|
||||
/**
|
||||
* 会员中心—>会员信息·组件
|
||||
*/
|
||||
class MemberInfo extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
$site_id = request()->siteid();
|
||||
$diy_view = new DiyViewModel();
|
||||
$system_color = $diy_view->getStyleConfig($site_id)[ 'data' ][ 'value' ];
|
||||
$this->assign('system_color', $system_color);
|
||||
return $this->fetch("member_info/design.html");
|
||||
}
|
||||
}
|
||||
18
app/component/controller/MemberMyOrder.php
Executable file
18
app/component/controller/MemberMyOrder.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
|
||||
/**
|
||||
* 会员中心—>我的订单·组件
|
||||
*/
|
||||
class MemberMyOrder extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("member_my_order/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/Notice.php
Executable file
17
app/component/controller/Notice.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 公告·组件
|
||||
*/
|
||||
class Notice extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("notice/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/QuickNav.php
Executable file
17
app/component/controller/QuickNav.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 快捷导航·组件
|
||||
*/
|
||||
class QuickNav extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("quick_nav/design.html");
|
||||
}
|
||||
}
|
||||
19
app/component/controller/RichText.php
Executable file
19
app/component/controller/RichText.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 富文本·组件
|
||||
*
|
||||
*/
|
||||
class RichText extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
$this->assign("unique_random", unique_random());
|
||||
return $this->fetch("rich_text/design.html");
|
||||
}
|
||||
}
|
||||
30
app/component/controller/RubikCube.php
Executable file
30
app/component/controller/RubikCube.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 魔方·组件
|
||||
*/
|
||||
class RubikCube extends BaseDiyView
|
||||
{
|
||||
|
||||
/**
|
||||
* 前台输出
|
||||
*/
|
||||
public function parseHtml($attr)
|
||||
{
|
||||
if (!empty($attr['diyHtml'])) {
|
||||
$attr['diyHtml'] = str_replace(""", '"', $attr['diyHtml']);
|
||||
}
|
||||
$this->assign("attr", $attr);
|
||||
return $this->fetch('rubik_cube/rubik_cube.html');
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("rubik_cube/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/Search.php
Executable file
17
app/component/controller/Search.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 商品搜索·组件
|
||||
*/
|
||||
class Search extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("search/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/Text.php
Executable file
17
app/component/controller/Text.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 文本·组件
|
||||
*/
|
||||
class Text extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("text/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/TopCategory.php
Executable file
17
app/component/controller/TopCategory.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 店铺搜索·组件
|
||||
*/
|
||||
class TopCategory extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("top_category/design.html");
|
||||
}
|
||||
}
|
||||
17
app/component/controller/Video.php
Executable file
17
app/component/controller/Video.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\component\controller;
|
||||
|
||||
/**
|
||||
* 视频·组件
|
||||
*/
|
||||
class Video extends BaseDiyView
|
||||
{
|
||||
/**
|
||||
* 后台编辑界面
|
||||
*/
|
||||
public function design()
|
||||
{
|
||||
return $this->fetch("video/design.html");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user