This commit is contained in:
2025-10-29 15:32:26 +08:00
parent d90614805b
commit b7462657cd
78921 changed files with 2753938 additions and 71 deletions

View File

@@ -0,0 +1,18 @@
<?php
namespace app\component\controller;
/**
* 文章·组件
*/
class Article extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("article/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 视频·组件
*/
class Audio extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("audio/design.html");
}
}

View 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);
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 客服信息组件
*/
class Digit extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("digit/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 商品分类·组件
*/
class FloatBtn extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("float_btn/design.html");
}
}

View 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");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 表单提交组件
*/
class Form extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("form/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 商品品牌·组件
*/
class GoodsBrand extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("goods_brand/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 商品分类·组件
*/
class GoodsCategory extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("goods_category/design.html");
}
}

View 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");
}
}

View 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");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 图文导航·组件
*/
class GraphicNav extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("graphic_nav/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 辅助空白·组件
*/
class HorzBlank extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("horz_blank/design.html");
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace app\component\controller;
/**
* 辅助线·组件
*
*/
class HorzLine extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("horz_line/design.html");
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace app\component\controller;
/**
* 热区·组件
*/
class HotArea extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("hot_area/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 图片广告·组件
*/
class ImageAds extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("image_ads/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 图文导航·组件
*/
class ImageNav extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("image_nav/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 客服信息组件
*/
class Kefu extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("kefu/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 客服信息组件
*/
class Listmenu extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("listmenu/design.html");
}
}

View 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");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 地理位置组件
*/
class Map extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("map/design.html");
}
}

View 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");
}
}

View 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");
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace app\component\controller;
/**
* 文章·组件
*/
class MerchList extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("merchlist/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 公告·组件
*/
class Notice extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("notice/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 单图组
*/
class Picture extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("picture/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 快捷导航·组件
*/
class QuickNav extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("quick_nav/design.html");
}
}

View 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");
}
}

View 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("&quot;", '"', $attr['diyHtml']);
}
$this->assign("attr", $attr);
return $this->fetch('rubik_cube/rubik_cube.html');
}
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("rubik_cube/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 商品搜索·组件
*/
class Search extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("search/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 文本·组件
*/
class Text extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("text/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 店铺搜索·组件
*/
class TopCategory extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("top_category/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 视频·组件
*/
class Video extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("video/design.html");
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace app\component\controller;
/**
* 客服信息组件
*/
class VideoList extends BaseDiyView
{
/**
* 后台编辑界面
*/
public function design()
{
return $this->fetch("videolist/design.html");
}
}