ComponentDict.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的多应用管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\diy;
  12. use core\dict\DictLoader;
  13. /**
  14. * 基础组件
  15. * Class ComponentDict
  16. * @package app\dict\diy
  17. */
  18. class ComponentDict
  19. {
  20. public static function getComponent()
  21. {
  22. $system_components = [
  23. 'BASIC' => [
  24. 'title' => get_lang('dict_diy.component_type_basic'),
  25. 'list' => [
  26. 'Text' => [
  27. 'title' => '标题',
  28. 'icon' => 'iconfont-iconbiaoti',
  29. 'path' => 'edit-text', // 编辑组件属性名称
  30. 'support_page' => [], // 支持页面
  31. 'uses' => 0, // 最大添加数量
  32. 'sort' => 10001,
  33. 'position' => '', // 组件置顶标识,不能拖拽,可选值:fixed、top_fixed、right_fixed、bottom_fixed、left_fixed
  34. // 组件属性
  35. 'template' => [
  36. "textColor" => "#303133", // 文字颜色
  37. 'pageStartBgColor' => '', // 底部背景颜色(开始)
  38. 'pageEndBgColor' => '', // 底部背景颜色(结束)
  39. 'pageGradientAngle' => 'to bottom', // 渐变角度,从上到下(to bottom)、从左到右(to right)
  40. 'componentBgUrl' => '', // 组件背景图片
  41. 'componentBgAlpha' => 2, // 组件背景图片的透明度,0~10
  42. "componentStartBgColor" => '', // 组件背景颜色(开始)
  43. "componentEndBgColor" => '', // 组件背景颜色(结束)
  44. "componentGradientAngle" => 'to bottom', // 渐变角度,上下(to bottom)、左右(to right)
  45. "topRounded" => 0, // 组件上圆角
  46. "bottomRounded" => 0, // 组件下圆角
  47. "elementBgColor" => '', // 元素背景颜色
  48. "topElementRounded" => 0,// 元素上圆角
  49. "bottomElementRounded" => 0, // 元素下圆角
  50. "margin" => [
  51. "top" => 0, // 上边距
  52. "bottom" => 0, // 下边距
  53. "both" => 0 // 左右边距
  54. ],
  55. ],
  56. 'value' => [
  57. "style" => "style-1",
  58. "styleName" => "风格1",
  59. "text" => "标题栏",
  60. "link" => [
  61. "name" => ""
  62. ],
  63. "textColor" => "#303133",
  64. "fontSize" => 16,
  65. "fontWeight" => "normal",
  66. "textAlign" => "center",
  67. "subTitle" => [
  68. "text" => "副标题",
  69. "color" => "#999999",
  70. "fontSize" => 14,
  71. "control" => false,
  72. "fontWeight" => "normal"
  73. ],
  74. "more" => [
  75. "text" => "查看更多",
  76. "control" => false,
  77. "isShow" => true,
  78. "link" => [
  79. "name" => ""
  80. ],
  81. "color" => "#999999"
  82. ],
  83. ]
  84. ],
  85. 'ImageAds' => [
  86. 'title' => '图片广告',
  87. 'icon' => 'iconfont-icontupianguanggao1',
  88. 'path' => 'edit-image-ads',
  89. 'support_page' => [],
  90. 'uses' => 0,
  91. 'sort' => 10002,
  92. 'value' => [
  93. "imageHeight" => 180,
  94. "list" => [
  95. [
  96. "link" => [
  97. "name" => ""
  98. ],
  99. "imageUrl" => "",
  100. "imgWidth" => 0,
  101. "imgHeight" => 0
  102. ]
  103. ],
  104. 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
  105. "indicatorActiveColor" => '#FF0E0E',
  106. 'indicatorAlign' => 'center'
  107. ]
  108. ],
  109. 'GraphicNav' => [
  110. 'title' => '图文导航',
  111. 'icon' => 'iconfont-icontuwendaohang2',
  112. 'path' => 'edit-graphic-nav',
  113. 'support_page' => [],
  114. 'uses' => 0,
  115. 'sort' => 10003,
  116. 'value' => [
  117. "layout" => "horizontal",
  118. "mode" => "graphic",
  119. "type" => "img",
  120. "showStyle" => "fixed",
  121. "rowCount" => 4,
  122. "pageCount" => 2,
  123. "carousel" => [
  124. "type" => "circle",
  125. "color" => "#FFFFFF"
  126. ],
  127. "imageSize" => 40,
  128. "aroundRadius" => 25,
  129. "font" => [
  130. "size" => 14,
  131. "weight" => "normal",
  132. "color" => "#303133"
  133. ],
  134. "list" => [
  135. [
  136. "title" => "",
  137. "link" => [
  138. "name" => ""
  139. ],
  140. "imageUrl" => "",
  141. "label" => [
  142. "control" => false,
  143. "text" => "热门",
  144. "textColor" => "#FFFFFF",
  145. "bgColorStart" => "#F83287",
  146. "bgColorEnd" => "#FE3423"
  147. ]
  148. ],
  149. [
  150. "title" => "",
  151. "link" => [
  152. "name" => ""
  153. ],
  154. "imageUrl" => "",
  155. "label" => [
  156. "control" => false,
  157. "text" => "热门",
  158. "textColor" => "#FFFFFF",
  159. "bgColorStart" => "#F83287",
  160. "bgColorEnd" => "#FE3423"
  161. ]
  162. ],
  163. [
  164. "title" => "",
  165. "link" => [
  166. "name" => ""
  167. ],
  168. "imageUrl" => "",
  169. "label" => [
  170. "control" => false,
  171. "text" => "热门",
  172. "textColor" => "#FFFFFF",
  173. "bgColorStart" => "#F83287",
  174. "bgColorEnd" => "#FE3423"
  175. ]
  176. ],
  177. [
  178. "title" => "",
  179. "link" => [
  180. "name" => ""
  181. ],
  182. "imageUrl" => "",
  183. "label" => [
  184. "control" => false,
  185. "text" => "热门",
  186. "textColor" => "#FFFFFF",
  187. "bgColorStart" => "#F83287",
  188. "bgColorEnd" => "#FE3423"
  189. ]
  190. ]
  191. ],
  192. ]
  193. ],
  194. 'RubikCube' => [
  195. 'title' => '魔方',
  196. 'icon' => 'iconfont-iconmofang1',
  197. 'path' => 'edit-rubik-cube',
  198. 'support_page' => [],
  199. 'uses' => 0,
  200. 'sort' => 10004,
  201. 'value' => [
  202. "mode" => "row1-of2",
  203. "imageGap" => 0,
  204. "list" => [
  205. [
  206. "imageUrl" => "",
  207. "imgWidth" => 0,
  208. "imgHeight" => 0,
  209. "link" => [
  210. "name" => ""
  211. ]
  212. ],
  213. [
  214. "imageUrl" => "",
  215. "imgWidth" => 0,
  216. "imgHeight" => 0,
  217. "link" => [
  218. "name" => ""
  219. ]
  220. ]
  221. ]
  222. ],
  223. ],
  224. 'HotArea' => [
  225. 'title' => '热区',
  226. 'icon' => 'iconfont-iconrequ',
  227. 'path' => 'edit-hot-area',
  228. 'support_page' => [],
  229. 'uses' => 0,
  230. 'sort' => 10007,
  231. 'value' => [
  232. "imageUrl" => "",
  233. "imgWidth" => 0,
  234. "imgHeight" => 0,
  235. "heatMapData" => []
  236. ],
  237. ],
  238. 'MemberInfo' => [
  239. 'title' => '会员信息',
  240. 'icon' => 'iconfont-iconhuiyuanzhongxin',
  241. 'path' => 'edit-member-info',
  242. 'support_page' => [ 'DIY_MEMBER_INDEX' ],
  243. 'uses' => 1,
  244. 'sort' => 10008,
  245. 'value' => [
  246. "style" => "style-1",
  247. "styleName" => "风格1",
  248. 'bgUrl' => '',
  249. 'bgColorStart' => '',
  250. 'bgColorEnd' => ''
  251. ],
  252. ],
  253. 'MemberLevel' => [
  254. 'title' => '会员等级',
  255. 'icon' => 'iconfont iconhuangguan',
  256. 'path' => 'edit-member-level',
  257. 'support_page' => [],
  258. 'uses' => 1,
  259. 'sort' => 10009,
  260. 'value' => [
  261. "style" => "style-1",
  262. "styleName" => "风格1"
  263. ],
  264. ],
  265. 'Notice' => [
  266. 'title' => '公告',
  267. 'icon' => 'iconfont-icongonggao',
  268. 'path' => 'edit-notice',
  269. 'support_page' => [],
  270. 'uses' => 0,
  271. 'sort' => 10010,
  272. 'value' => [
  273. "noticeType" => 'img',
  274. 'imgType' => 'system',
  275. "systemUrl" => "style_1", // 系统定义的图片
  276. "imageUrl" => "", // 上传自定义图片
  277. "showType" => "popup", // 点击类型 弹出框,跳转
  278. "scrollWay" => "upDown", // 滚动方式 upDown:上下滚动,horizontal:横向滚动
  279. "fontSize" => 14,
  280. "fontWeight" => "normal",
  281. "noticeTitle" => "公告", // 公告标题文字
  282. "list" => [
  283. [
  284. "text" => "公告",
  285. "link" => [
  286. "name" => ""
  287. ]
  288. ]
  289. ],
  290. ],
  291. ],
  292. 'RichText' => [
  293. 'title' => '富文本',
  294. 'icon' => 'iconfont-iconfuwenben1',
  295. 'path' => 'edit-rich-text',
  296. 'support_page' => [],
  297. 'uses' => 0,
  298. 'sort' => 10011,
  299. 'value' => [
  300. "html" => ""
  301. ],
  302. ],
  303. 'ActiveCube' => [
  304. 'title' => '活动魔方',
  305. 'icon' => 'iconfont-iconmofang1',
  306. 'path' => 'edit-active-cube',
  307. 'support_page' => [],
  308. 'uses' => 0,
  309. 'sort' => 10012,
  310. 'value' => [
  311. "titleStyle" => [
  312. 'title' => '风格1',
  313. 'value' => 'style-1'
  314. ],
  315. 'text' => '超值爆款',
  316. "textLink" => [
  317. "name" => ""
  318. ],
  319. "titleColor" => "#F91700",
  320. "subTitle" => [
  321. "text" => "为您精选爆款",
  322. "textColor" => "#FFFFFF",
  323. "startColor" => "#FB792F",
  324. "endColor" => "#F91700",
  325. "link" => [
  326. "name" => ""
  327. ],
  328. ],
  329. "blockStyle" => [
  330. 'title' => '风格1',
  331. 'value' => 'style-1',
  332. 'fontWeight' => 'normal'
  333. ],
  334. 'list' => [
  335. [
  336. "title" => [
  337. "text" => "今日推荐",
  338. "textColor" => "#303133"
  339. ],
  340. "subTitle" => [
  341. "text" => "诚意推荐",
  342. "textColor" => "#999999",
  343. "startColor" => "",
  344. "endColor" => "",
  345. ],
  346. "moreTitle" => [
  347. "text" => "去看看",
  348. "startColor" => "#FEA715",
  349. "endColor" => "#FE1E00",
  350. ],
  351. "listFrame" => [
  352. "startColor" => "#FEA715",
  353. "endColor" => "#FE1E00",
  354. ],
  355. "link" => [
  356. "name" => ""
  357. ],
  358. "imageUrl" => "static/resource/images/diy/active_cube/active_cube_goods1.png",
  359. ],
  360. [
  361. "title" => [
  362. "text" => "优惠好物",
  363. "textColor" => "#303133"
  364. ],
  365. "subTitle" => [
  366. "text" => "领券更优惠",
  367. "textColor" => "#999999",
  368. "startColor" => "",
  369. "endColor" => "",
  370. ],
  371. "moreTitle" => [
  372. "text" => "去看看",
  373. "startColor" => "#FFBF50",
  374. "endColor" => "#FF9E03",
  375. ],
  376. "listFrame" => [
  377. "startColor" => "#FFBF50",
  378. "endColor" => "#FF9E03",
  379. ],
  380. "link" => [
  381. "name" => ""
  382. ],
  383. "imageUrl" => "static/resource/images/diy/active_cube/active_cube_goods2.png",
  384. ],
  385. [
  386. "title" => [
  387. "text" => "热销推荐",
  388. "textColor" => "#303133"
  389. ],
  390. "subTitle" => [
  391. "text" => "本周热销商品",
  392. "textColor" => "#999999",
  393. "startColor" => "",
  394. "endColor" => "",
  395. ],
  396. "moreTitle" => [
  397. "text" => "去看看",
  398. "startColor" => "#A2E792",
  399. "endColor" => "#49CD2D",
  400. ],
  401. "listFrame" => [
  402. "startColor" => "#A2E792",
  403. "endColor" => "#49CD2D",
  404. ],
  405. "link" => [
  406. "name" => ""
  407. ],
  408. "imageUrl" => "static/resource/images/diy/active_cube/active_cube_goods3.png",
  409. ],
  410. [
  411. "title" => [
  412. "text" => "书桌好物",
  413. "textColor" => "#303133"
  414. ],
  415. "subTitle" => [
  416. "text" => "办公好物推荐",
  417. "textColor" => "#999999",
  418. "startColor" => "",
  419. "endColor" => "",
  420. ],
  421. "moreTitle" => [
  422. "text" => "去看看",
  423. "startColor" => "#4AC1FF",
  424. "endColor" => "#1D7CFF",
  425. ],
  426. "listFrame" => [
  427. "startColor" => "#4AC1FF",
  428. "endColor" => "#1D7CFF",
  429. ],
  430. "link" => [
  431. "name" => ""
  432. ],
  433. "imageUrl" => "static/resource/images/diy/active_cube/active_cube_goods4.png",
  434. ],
  435. ],
  436. // 组件属性
  437. 'template' => [
  438. "textColor" => "#303133", // 文字颜色
  439. 'pageStartBgColor' => '', // 底部背景颜色(开始)
  440. 'pageEndBgColor' => '', // 底部背景颜色(结束)
  441. 'pageGradientAngle' => 'to bottom', // 渐变角度,从上到下(to bottom)、从左到右(to right)
  442. 'componentBgUrl' => '', // 组件背景图片
  443. 'componentBgAlpha' => 2, // 组件背景图片的透明度,0~10
  444. "componentStartBgColor" => '', // 组件背景颜色(开始)
  445. "componentEndBgColor" => '', // 组件背景颜色(结束)
  446. "componentGradientAngle" => 'to bottom', // 渐变角度,上下(to bottom)、左右(to right)
  447. "topRounded" => 12, // 组件上圆角
  448. "bottomRounded" => 12, // 组件下圆角
  449. "elementBgColor" => '#FFFAF5', // 元素背景颜色
  450. "topElementRounded" => 0,// 元素上圆角
  451. "bottomElementRounded" => 0, // 元素下圆角
  452. "margin" => [
  453. "top" => 10, // 上边距
  454. "bottom" => 10, // 下边距
  455. "both" => 10 // 左右边距
  456. ],
  457. ],
  458. ],
  459. ],
  460. 'CarouselSearch' => [
  461. 'title' => '轮播搜索',
  462. 'icon' => 'iconfont-iconsousuokuang',
  463. 'path' => 'edit-carousel-search',
  464. 'support_page' => [],
  465. 'uses' => 1,
  466. 'sort' => 10013,
  467. 'position' => 'top_fixed', // 组件置顶标识,不能拖拽
  468. 'value' => [
  469. 'positionWay' => 'static',
  470. 'fixedBgColor' => '',
  471. 'bgGradient' => false,
  472. // 搜索设置
  473. 'search' => [
  474. 'logo' => '',
  475. 'text' => '请输入搜索关键词',
  476. "link" => [
  477. "name" => ""
  478. ],
  479. 'hotWord' => [
  480. "interval" => 3,
  481. 'list' => []
  482. ]
  483. ],
  484. // 选项卡设置
  485. 'tab' => [
  486. 'control' => true, // 控制显示隐藏
  487. 'noColor' => '', // 未选中颜色
  488. 'selectColor' => '', // 选中颜色
  489. 'fixedNoColor' => '', // 下滑未选中颜色
  490. 'fixedSelectColor' => '', // 下滑选中颜色
  491. 'list' => [
  492. [
  493. 'text' => '分类名称', // 最多4个字
  494. 'source' => 'diy_page',
  495. 'diy_id' => '',
  496. 'diy_title' => ''
  497. ],
  498. [
  499. 'text' => '分类名称',
  500. 'source' => 'diy_page',
  501. 'diy_id' => '',
  502. 'diy_title' => ''
  503. ],
  504. [
  505. 'text' => '分类名称',
  506. 'source' => 'diy_page',
  507. 'diy_id' => '',
  508. 'diy_title' => ''
  509. ],
  510. [
  511. 'text' => '分类名称',
  512. 'source' => 'diy_page',
  513. 'diy_id' => '',
  514. 'diy_title' => ''
  515. ]
  516. ]
  517. ],
  518. // 轮播图设置
  519. 'swiper' => [
  520. 'control' => true, // 控制显示隐藏
  521. "interval" => 5,
  522. 'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
  523. "indicatorActiveColor" => '#FF0E0E',
  524. 'indicatorStyle' => 'style-1',
  525. 'indicatorAlign' => 'center',
  526. 'swiperStyle' => 'style-1',
  527. 'imageHeight' => 168,
  528. 'topRounded' => 0,
  529. 'bottomRounded' => 0,
  530. 'list' => [
  531. [
  532. "imageUrl" => "",
  533. "imgWidth" => 690,
  534. "imgHeight" => 330,
  535. "link" => [
  536. "name" => ""
  537. ]
  538. ]
  539. ]
  540. ]
  541. ],
  542. ],
  543. 'FloatBtn' => [
  544. 'title' => '浮动按钮',
  545. 'icon' => 'iconfont-iconfudonganniu1',
  546. 'path' => 'edit-float-btn',
  547. 'support_page' => [],
  548. 'uses' => 1,
  549. 'sort' => 10014,
  550. 'position' => 'fixed',
  551. 'value' => [
  552. "imageSize" => 40,
  553. "aroundRadius" => 0,
  554. "bottomPosition" => "lowerRight", // 左上:upperLeft,右上:upperRight,左下:lowerLeft,右下:lowerRight
  555. "list" => [
  556. [
  557. "imageUrl" => "",
  558. "link" => [
  559. "name" => ""
  560. ]
  561. ]
  562. ],
  563. "offset" => 0 // 偏移量
  564. ],
  565. ],
  566. 'HorzBlank' => [
  567. 'title' => '辅助空白',
  568. 'icon' => 'iconfont-iconfuzhukongbai1',
  569. 'path' => 'edit-horz-blank',
  570. 'support_page' => [],
  571. 'uses' => 0,
  572. 'sort' => 10015,
  573. 'value' => [
  574. 'height' => 20
  575. ],
  576. ],
  577. 'HorzLine' => [
  578. 'title' => '辅助线',
  579. 'icon' => 'iconfont-iconfuzhuxian1',
  580. 'path' => 'edit-horz-line',
  581. 'support_page' => [],
  582. 'uses' => 0,
  583. 'sort' => 10016,
  584. 'value' => [
  585. 'borderWidth' => 1,
  586. 'borderColor' => '#303133',
  587. 'borderStyle' => 'solid'
  588. ],
  589. ],
  590. ],
  591. ],
  592. ];
  593. return ( new DictLoader("UniappComponent") )->load($system_components);
  594. }
  595. }