Files
lgp-admin-plus-api/config/wx_templates.php
2026-08-19 08:16:49 +08:00

383 lines
14 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 小程序装修模板预设4 套店面轻奢 + 1 套刊页)
*
* 色板共用一族暖中性,差异只在主色/底色深浅。layout 同时带旧枚举
* (小程序未升级时仍能用)和 pages.sections装修工作室拖拽编排
* card_scheme 指向 30 套 canvas 卡片预设之一。
*/
$section = static function (string $id, string $type, string $variant, array $props = [], bool $visible = true): array {
return [
'id' => $id,
'type' => $type,
'variant' => $variant,
'visible' => $visible,
'props' => $props,
];
};
$buildPages = static function (
array $home,
array $product,
string $cardScheme,
string $goodsList,
string $listStyle,
string $mineHeader,
string $mineMenu,
string $homePreset = 'home-01-classic',
string $homeSkin = 'shop',
string $searchVariant = 'bar',
string $categoryVariant = '',
array $homeMeta = [],
array $pageCodes = [],
array $chrome = [],
) use ($section): array {
$cat = $categoryVariant !== '' ? $categoryVariant : $home['category'];
return [
'card_scheme' => $cardScheme,
'chrome' => array_merge([
'tabbar' => 'plain',
'navbar' => 'solid',
'tabbar_anim' => 'slide',
], $chrome),
'page_presets' => array_merge([
'home' => $homePreset,
'catalog' => 'catalog-01-waterfall',
'search' => 'search-01-waterfall',
'product' => 'product-00-default',
'cart' => 'cart-01-card',
'mine' => 'mine-01-gradient',
'package' => 'package-00-default',
], $pageCodes),
'pages' => [
'home' => [
'skin' => $homeSkin,
'density' => $homeMeta['density'] ?? 'regular',
'frame' => $homeMeta['frame'] ?? 'none',
'card_scheme' => $cardScheme,
'sections' => [
$section('search', 'search', $searchVariant),
$section('hero', 'hero', $home['hero'], ['height' => (int) ($homeMeta['hero_height'] ?? 480)]),
$section('category', 'category', $cat, ['cols' => 3]),
$section('package', 'package', 'card'),
// 原首页没有商品流,默认关,装修里可再打开
$section('product', 'product', $home['product'], ['card_scheme' => $cardScheme], false),
],
],
'package' => [
'card_scheme' => $cardScheme,
'sections' => [
$section('list', 'list', 'card'),
],
],
'catalog' => [
'card_scheme' => $cardScheme,
'sections' => [
$section('filter', 'filter', 'chip'),
$section('list', 'list', $goodsList, ['card_scheme' => $cardScheme]),
],
],
'search' => [
'card_scheme' => $cardScheme,
'sections' => [
$section('search', 'search', 'bar'),
$section('list', 'list', $goodsList, ['card_scheme' => $cardScheme]),
],
],
'product' => [
'card_scheme' => $cardScheme,
'sections' => [
$section('gallery', 'gallery', $product['gallery']),
$section('info', 'info', $product['info'] ?? 'plain'),
$section('spec', 'spec', $product['spec'] ?? 'plain'),
$section('price', 'price', $product['price'] ?? 'inline'),
$section('action', 'action', $product['action'] ?? 'fixed'),
],
],
'cart' => [
'card_scheme' => $cardScheme,
'sections' => [
$section('list', 'list', $listStyle),
],
],
'mine' => [
'card_scheme' => $cardScheme,
'sections' => [
$section('header', 'header', $mineHeader),
$section('menu', 'menu', $mineMenu),
],
],
],
];
};
return [
[
'code' => 'nature-clay',
'name' => '素胚',
'style_tag' => '轻奢',
'palette' => [
'primary' => '#8A8178',
'accent' => '#C4B8A8',
'bg' => '#F4EFE6',
'surface' => '#EFE8DC',
'text' => '#1C1917',
'border' => '#E7DFD3',
],
'scale' => 'serif-book',
'radius' => 'soft',
'shadow' => 'flat',
'motion' => 'gentle',
'layout' => array_merge(
[
'home' => ['hero' => 'split', 'category' => 'card', 'product' => 'waterfall'],
'product' => ['gallery' => 'swiper', 'price' => 'card', 'action' => 'fixed'],
'list' => ['style' => 'card'],
'mine' => ['header' => 'plain', 'menu' => 'list'],
'effect' => [
'transition' => 'fade',
'skeleton' => 'pulse',
'card' => 'plain',
'icon' => 'line',
],
],
$buildPages(
['hero' => 'split', 'category' => 'card', 'product' => 'waterfall'],
['gallery' => 'swiper', 'action' => 'fixed', 'info' => 'editorial', 'spec' => 'table', 'price' => 'card'],
'clay-edge',
'waterfall',
'card',
'plain',
'list',
'home-03-split-card',
'shop',
'bar',
'',
[],
[
'catalog' => 'catalog-02-waterfall',
'search' => 'search-02-waterfall',
'product' => 'product-00-default',
'cart' => 'cart-02-table',
'mine' => 'mine-11-plain',
],
['tabbar' => 'plain', 'navbar' => 'solid', 'tabbar_anim' => 'none'],
),
),
],
[
'code' => 'lux-pearl',
'name' => '轻奢·珠贝白',
'style_tag' => '轻奢',
'palette' => [
'primary' => '#9C8E7E',
'accent' => '#D4C4A8',
'bg' => '#FFFCF8',
'surface' => '#F7F4EF',
'text' => '#1C1917',
'border' => '#E7DFD3',
],
'scale' => 'sans-refined',
'radius' => 'sharp',
'shadow' => 'airy',
'motion' => 'silk',
'layout' => array_merge(
[
'home' => ['hero' => 'split', 'category' => 'grid', 'product' => 'waterfall'],
'product' => ['gallery' => 'swiper', 'price' => 'inline', 'action' => 'fixed'],
'list' => ['style' => 'table'],
'mine' => ['header' => 'plain', 'menu' => 'grid'],
'effect' => [
'transition' => 'fade',
'skeleton' => 'shimmer',
'card' => 'elevated',
'icon' => 'line',
],
],
$buildPages(
['hero' => 'split', 'category' => 'grid', 'product' => 'waterfall'],
['gallery' => 'swiper', 'action' => 'fixed', 'info' => 'plain', 'spec' => 'plain', 'price' => 'inline'],
'pearl-line',
'waterfall',
'table',
'plain',
'grid',
'home-01-classic',
'shop',
'bar',
'',
[],
[
'catalog' => 'catalog-04-grid',
'search' => 'search-04-grid',
'product' => 'product-00-default',
'cart' => 'cart-02-table',
'mine' => 'mine-03-gradient',
],
['tabbar' => 'line', 'navbar' => 'line', 'tabbar_anim' => 'slide'],
),
),
],
[
'code' => 'lux-walnut',
'name' => '轻奢·胡桃木',
'style_tag' => '轻奢',
'palette' => [
'primary' => '#6F4E37',
'accent' => '#A9784F',
'bg' => '#F6F1EA',
'surface' => '#FFFDFA',
'text' => '#1C1917',
'border' => '#E7DFD3',
],
'scale' => 'serif-elegant',
'radius' => 'round',
'shadow' => 'soft',
'motion' => 'gentle',
'layout' => array_merge(
[
'home' => ['hero' => 'carousel', 'category' => 'card', 'product' => 'waterfall'],
'product' => ['gallery' => 'fullbleed', 'price' => 'card', 'action' => 'fixed'],
'list' => ['style' => 'card'],
'mine' => ['header' => 'gradient', 'menu' => 'list'],
'effect' => [
'transition' => 'fade',
'skeleton' => 'shimmer',
'card' => 'elevated',
'icon' => 'line',
],
],
$buildPages(
['hero' => 'carousel', 'category' => 'card', 'product' => 'waterfall'],
['gallery' => 'fullbleed', 'action' => 'fixed', 'info' => 'plain', 'spec' => 'table', 'price' => 'card'],
'walnut-frame',
'featured',
'card',
'gradient',
'list',
'home-11-carousel-card',
'shop',
'bar',
'',
[],
[
'catalog' => 'catalog-13-featured',
'search' => 'search-13-featured',
'product' => 'product-00-default',
'cart' => 'cart-01-card',
'mine' => 'mine-01-gradient',
],
['tabbar' => 'pill', 'navbar' => 'solid', 'tabbar_anim' => 'spring'],
),
),
],
[
'code' => 'lux-champagne',
'name' => '轻奢·香槟金',
'style_tag' => '轻奢',
'palette' => [
'primary' => '#B08D57',
'accent' => '#8C6A3F',
'bg' => '#FAF7F2',
'surface' => '#FFFFFF',
'text' => '#1C1917',
'border' => '#E7DFD3',
],
'scale' => 'serif-elegant',
'radius' => 'soft',
'shadow' => 'airy',
'motion' => 'silk',
'layout' => array_merge(
[
'home' => ['hero' => 'fullscreen', 'category' => 'scroll', 'product' => 'waterfall'],
'product' => ['gallery' => 'fullbleed', 'price' => 'sticky', 'action' => 'fixed'],
'list' => ['style' => 'ticket'],
'mine' => ['header' => 'split', 'menu' => 'card'],
'effect' => [
'transition' => 'fade',
'skeleton' => 'shimmer',
'card' => 'canvas-frame',
'icon' => 'line',
],
],
$buildPages(
['hero' => 'fullscreen', 'category' => 'scroll', 'product' => 'waterfall'],
['gallery' => 'fullbleed', 'action' => 'fixed', 'info' => 'overlay', 'spec' => 'plain', 'price' => 'sticky'],
'champagne-foil',
'shelf',
'ticket',
'split',
'card',
'home-04-full-scroll',
'shop',
'bar',
'',
[],
[
'catalog' => 'catalog-16-shelf',
'search' => 'search-16-shelf',
'product' => 'product-00-default',
'cart' => 'cart-05-ticket',
'mine' => 'mine-16-split',
],
['tabbar' => 'pill', 'navbar' => 'line', 'tabbar_anim' => 'fade'],
),
),
],
[
'code' => 'lux-folio',
'name' => '轻奢·刊页',
'style_tag' => '刊页',
'palette' => [
'primary' => '#C4A574',
'accent' => '#A3845A',
'bg' => '#F7F1E6',
'surface' => '#FFF9F0',
'text' => '#3F2F24',
'border' => '#E4D6C2',
],
'scale' => 'serif-elegant',
'radius' => 'sharp',
'shadow' => 'airy',
'motion' => 'silk',
'layout' => array_merge(
[
'home' => ['hero' => 'caption', 'category' => 'contents', 'product' => 'waterfall'],
'product' => ['gallery' => 'filmstrip', 'price' => 'sticky', 'action' => 'fixed'],
'list' => ['style' => 'stacked'],
'mine' => ['header' => 'editorial', 'menu' => 'list'],
'effect' => [
'transition' => 'fade',
'skeleton' => 'shimmer',
'card' => 'canvas-frame',
'icon' => 'line',
],
],
$buildPages(
['hero' => 'caption', 'category' => 'contents', 'product' => 'waterfall'],
['gallery' => 'filmstrip', 'action' => 'fixed', 'info' => 'overlay', 'spec' => 'cards', 'price' => 'sticky'],
'folio-number',
'featured',
'stacked',
'editorial',
'list',
'home-magazine-folio',
'magazine',
'overlay',
'contents',
['density' => 'airy', 'frame' => 'ornament', 'hero_height' => 640],
[
'catalog' => 'catalog-13-featured',
'search' => 'search-13-featured',
'product' => 'product-00-default',
'cart' => 'cart-06-stacked',
'mine' => 'mine-26-editorial',
],
['tabbar' => 'dot', 'navbar' => 'line', 'tabbar_anim' => 'spring'],
),
),
],
];