v1.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. namespace zin;
  3. class thinkCover extends wg
  4. {
  5. /**
  6. * @var mixed[]
  7. */
  8. protected static $defineProps = array(
  9. 'item: object', // 模型信息
  10. 'actionUrl: string', // 开始按钮链接
  11. );
  12. public static function getPageCSS()
  13. {
  14. return file_get_contents(__DIR__ . DS . 'css' . DS . 'v1.css');
  15. }
  16. protected function buildCoverContentBlock()
  17. {
  18. global $lang;
  19. $item = $this->prop('item');
  20. return div
  21. (
  22. setClass('bg-white px-8 w-full relative pt-10 pb-6'),
  23. div
  24. (
  25. setClass('flex items-center w-full pt-10 pb-10'),
  26. div
  27. (
  28. setClass('w-3/5 px-4'),
  29. div
  30. (
  31. setClass('text-2xl'),
  32. $item->name
  33. ),
  34. div
  35. (
  36. setClass('mb-4 text-lg'),
  37. setStyle(array('margin-top' => '-18px')),
  38. section
  39. (
  40. setClass('break-words'),
  41. set::content($item->desc),
  42. set::useHtml(true)
  43. )
  44. ),
  45. div
  46. (
  47. setClass('text-md text-black leading-6.5'),
  48. $lang->thinkwizard->expect,
  49. $item->duration,
  50. $lang->thinkwizard->minute
  51. )
  52. ),
  53. div
  54. (
  55. setClass('w-2/5 pr-4'),
  56. img
  57. (
  58. set::src($item->thumbnail)
  59. )
  60. )
  61. )
  62. );
  63. }
  64. protected function buildAction()
  65. {
  66. global $lang;
  67. $actionUrl = $this->prop('actionUrl');
  68. return div
  69. (
  70. setClass('py-3 fixed bottom-0 flex justify-center bg-white toolbar-btn border-t border-gray-100'),
  71. a
  72. (
  73. setClass('btn primary px-8 py-2'),
  74. set::href($actionUrl),
  75. $lang->thinkwizard->start
  76. )
  77. );
  78. }
  79. protected function build()
  80. {
  81. return array
  82. (
  83. $this->buildCoverContentBlock(),
  84. $this->buildAction()
  85. );
  86. }
  87. }