'基础组件', 'sub' => [ [ 'name' => '搜索', 'type' => 'search', 'icon' => 'search', 'param' => [ 'backgroundColorW' => '#eeeeee', 'backgroundColor' => '#ffffff', 'borderRadius' => 4, 'color' => '#b2b2b2', 'textPosition' => 'left', 'text' => '搜索' ] ], [ 'name' => '导航图标', 'type' => 'nav', 'icon' => 'menu', 'param' => [ 'backgroundColor' => '#efeff4', 'count' => 3, 'col' => 1, 'list' => [], 'is_slide' => 1 ] ], [ 'name' => '轮播广告', 'type' => 'banner', 'icon' => 'block', 'param' => [ 'bg_color' => '#ffffff', 'style' => 1, 'fill' => 1, 'list' => [], 'height' => 280 ] ], [ 'name' => '公告', 'type' => 'notice', 'icon' => 'sound', 'param' => [ 'bg_color' => '#f67f79', 'color' => '#ffffff', 'icon' => '', 'name' => '公告', 'content' => '' ] ], [ 'name' => '专题', 'type' => 'topic', 'icon' => 'reconciliation', 'param' => [ 'count' => 1, 'logo_1' => '', 'logo_2' => '', 'heated' => '', 'style' => 0, 'list' => [], 'is_cat' => 0 ] ], [ 'name' => '关联连接', 'type' => 'link', 'icon' => 'link', 'param' => [ 'backgroundColor' => '#ffffff', 'color' => '#353535', 'name' => '', 'icon' => '', 'is_icon' => 1, 'url' => '', 'left' => 0, 'is_jiantou' => 1, 'page_name' => '', 'position' => 0 ] ], [ 'name' => '图片广告', 'type' => 'rubik', 'icon' => 'file-image', 'param' => [ 'style' => 0, 'fill' => 1, 'space' => 0, 'width' => 4, 'height' => 4, 'minHeight' => 360, 'new_minHeight' => 360, 'list' => [] ] ], [ 'name' => '视频', 'type' => 'video', 'icon' => 'video-camera', 'param' => [ 'url' => '', 'pic_url' => '' ] ], [ 'name' => '商品', 'type' => 'goods', 'icon' => 'wallet', 'param' => [ 'is_cat' => 0, 'cat_position' => 0, 'cat_style' => 0, 'list' => [], 'goods_list' => [], 'list_style' => 0, 'fill' => 1, 'per' => 0, 'style' => 0, 'name' => 1, 'price' => 1, 'old_price' => 1, 'buy' => 1, 'buy_list' => [], 'buy_content' => '', 'mark' => 0, 'mark_list' => 4, 'mark_url' => '', 'cat_index' => 0, 'buy_default' => '购买' ] ], [ 'name' => '门店信息', 'type' => 'shop_info', 'icon' => 'contacts', 'param' => [ 'bg_color' => '#ffffff', 'default_search_text' => '搜索', 'font_color' => '#ffffff', 'btn_1_img' => '', 'btn_1_text' => '', 'btn_1_page_name' => '', 'btn_1_url' => '', 'btn_1_open_type' => '', 'btn_2_img' => '', 'btn_2_text' => '', 'btn_2_page_name' => '', 'btn_2_url' => '', 'btn_2_open_type' => '', ] ], [ 'name' => '门店', 'type' => 'shop', 'icon' => 'bank', 'param' => [ 'list' => [], 'name' => 1, 'score' => 1, 'mobile' => 1, 'distance' => 1 ] ], [ 'name' => '超级品牌', 'type' => 'super_brand', 'icon' => 'sketch', 'param' => [ 'name' => '超级品牌周', 'list' => [] ] ], [ 'name' => '附近店铺', 'type' => 'nearby_mch', 'icon' => 'shop', 'param' => [ 'show_num' => 3, 'show_goods_num' => 6 ] ], [ 'name' => '图片活动', 'type' => 'plate', 'icon' => 'picture', 'param' => [ 'list' => [], 'padding_top' => 0, 'padding_bottom' => 0 ] ], [ 'name' => '快捷导航', 'type' => 'fast_nav', 'icon' => 'monitor', 'param' => [ 'list' => [], 'padding_top' => 0, 'padding_bottom' => 0, 'bg_color' => '#F50A0A' ] ], [ 'name' => '推荐商品', 'type' => 'recommend_goods', 'icon' => 'import', 'param' => [ 'list' => [] ] ] ] ], [ 'name' => '营销组件', 'sub' => [ [ 'name' => '优惠券', 'type' => 'coupon', 'icon' => 'account-book', 'param' => [ 'bg' => '', 'bg_1' => '', 'color' => '#ffffff' ] ], [ 'name' => '倒计时', 'type' => 'time', 'icon' => 'hourglass', 'param' => [ 'pic_url' => '', 'url' => '', 'open_type' => '', 'start_time' => '', 'end_time' => '', 'date_start' => '', 'date_end' => '', 'pic_url_1' => '' ] ], [ 'name' => '拼团', 'type' => 'pintuan', 'icon' => 'build', 'param' => [ 'list' => [] ] ], [ 'name' => '秒杀', 'type' => 'miaosha', 'icon' => 'history', 'param' => [ 'list' => [], 'list_style' => 0, 'fill' => 1, 'per' => 0, 'style' => 0, 'time' => 1, 'name' => 1, 'price' => 1, 'old_price' => 1, 'buy' => 1, 'buy_list' => 2, 'buy_content' => '', 'mark' => 0, 'mark_list' => 4, 'mark_url' => '', 'buy_default' => '马上秒' ] ], [ 'name' => '预约', 'type' => 'book', 'icon' => 'dashboard', 'param' => [ 'list' => [], 'list_style' => 0, 'fill' => 1, 'per' => 0, 'style' => 0, 'name' => 1, 'price' => 1, 'buy' => 1, 'buy_list' => 2, 'buy_content' => '', 'mark' => 0, 'mark_list' => 4, 'mark_url' => '', 'buy_default' => '预约' ] ], [ 'name' => '砍价', 'type' => 'bargain', 'icon' => 'thunderbolt', 'param' => [ 'list' => [], 'list_style' => 0, 'fill' => 1, 'per' => 0, 'style' => 0, 'time' => 1, 'name' => 1, 'price' => 1, 'old_price' => 1, 'buy' => 1, 'buy_list' => 2, 'buy_content' => '', 'mark' => 0, 'mark_list' => 4, 'mark_url' => '', 'buy_default' => '去参与' ] ], [ 'name' => '好店推荐', 'type' => 'mch', 'icon' => 'trophy', 'param' => [ 'is_goods' => 0, 'list' => [], 'price' => 1 ] ], [ 'name' => '积分商城', 'type' => 'integral', 'icon' => 'property-safety', 'param' => [ 'bg_1' => '', 'color' => '#ffffff', 'is_coupon' => 1, 'is_goods' => 1, 'list' => [], 'list_style' => 0, 'fill' => 1, 'per' => 0, 'style' => 0, 'name' => 1, 'price' => 1, 'buy' => 1, 'buy_list' => 2, 'buy_content' => '', 'mark' => 0, 'mark_list' => 0, 'mark_url' => '', 'buy_default' => '立即兑换' ] ], [ 'name' => '抽奖', 'type' => 'lottery', 'icon' => 'gift', 'param' => [ 'list' => [], 'list_style' => 0, 'fill' => 1, 'per' => 0, 'style' => 0, 'time' => 1, 'name' => 1, 'price' => 1, 'old_price' => 1, 'buy' => 1, 'buy_list' => 2, 'buy_content' => '', 'mark' => 0, 'mark_list' => 4, 'mark_url' => '', 'buy_default' => '去参与' ] ], [ 'name' => '整点秒杀', 'type' => 'hourly_miaosha', 'icon' => 'history', 'param' => [ 'goods_list' => [], 'show_num' => 3 ] ], [ 'name' => '首页推荐', 'type' => 'index_recommend', 'icon' => 'like', 'param' => [ 'list' => [ [ 'name' => '', 'title' => '', 'title_color' => '#ff0000', 'icon' => '', 'img_1' => '', 'img_1_page_name' => '', 'img_1_url' => '', 'img_1_open_type' => '', 'img_2' => '', 'img_2_page_name' => '', 'img_2_url' => '', 'img_2_open_type' => '' ] ] ] ] ] ], [ 'name' => '其他组件', 'sub' => [ [ 'name' => '空白占位符', 'type' => 'line', 'icon' => 'container', 'param' => [ 'backgroundColor' => '#eeeeee', 'height' => 1 ] ], [ 'name' => '流量主', 'type' => 'ad', 'icon' => 'tags', 'param' => [ 'id' => '' ] ], [ 'name' => '弹窗广告', 'type' => 'modal', 'icon' => 'tablet', 'param' => [ 'show' => 0, 'pic_url' => '', 'url' => '', 'open_type' => '', 'status' => 0, 'pic_width' => 650, 'pic_height' => 700, 'list' => [] ] ], ] ], ]; /** * 获取diy配置 */ public static function getConfig() { return self::DIY_CONFIG; } /** * 获取diy配置 * @param $id * @return DiyTemplate|array|\yii\db\ActiveRecord[]|null */ public static function getSetting($id = 0) { if ($id) { $page = DiyTemplate::findOne([ 'id' => $id, 'store_id' => get_store_id(), 'is_delete' => 0 ]); if ($page) { $page->toArray(); $page['template'] = $page['template'] ? Json::decode($page['template']) : []; return $page; } else { return []; } } $page = DiyTemplate::find() ->where([ 'store_id' => get_store_id(), 'is_delete' => 0 ])->orderBy(['id' => SORT_ASC])->asArray()->all(); foreach ($page as &$val) { $val['template'] = $val['template'] ? Json::decode($page['template']) : []; } return $page; } }