index.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /**
  3. * FecShop file.
  4. *
  5. * @link http://www.fecshop.com/
  6. * @copyright Copyright (c) 2016 FecShop Software LLC
  7. * @license http://www.fecshop.com/license/
  8. */
  9. ?>
  10. <div class="main container">
  11. <div id="fecshop-home-big-img">
  12. <div class="container">
  13. <div class="row">
  14. <div class="span12">
  15. <div id="owl-fecshop" class="owl-carousel">
  16. <div class="item">
  17. <a href="#"><img class="lazyOwl" data-src="<?= Yii::$service->image->getImgUrl('images/01.jpg','appfront'); ?>" alt="" /></a>
  18. </div>
  19. <div class="item">
  20. <a href="#"><img class="lazyOwl" data-src="<?= Yii::$service->image->getImgUrl('images/02.jpg','appfront'); ?>" alt="" /></a>
  21. </div><div class="item">
  22. <a href="#"><img class="lazyOwl" data-src="<?= Yii::$service->image->getImgUrl('images/03.jpg','appfront'); ?>" alt="" /></a>
  23. </div><div class="item">
  24. <a href="#"><img class="lazyOwl" data-src="<?= Yii::$service->image->getImgUrl('images/04.jpg','appfront'); ?>" alt="" /></a>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="mt10">
  32. <h4 class="sectionBox_h best_seller"><span><?= Yii::$service->page->translate->__('best seller'); ?></span><em><a href=""><?= Yii::$service->page->translate->__('more'); ?></a></em></h4>
  33. <div class="pro-content">
  34. <?php
  35. $parentThis['products'] = $bestSellerProducts;
  36. $parentThis['name'] = 'best-seller';
  37. $config = [
  38. 'view' => 'cms/home/index/product.php',
  39. ];
  40. echo Yii::$service->page->widget->renderContent('category_product_price',$config,$parentThis);
  41. ?>
  42. </div>
  43. </div>
  44. <div class="clear"></div>
  45. <div class="mt10" style="margin-top:34px;">
  46. <h4 class="sectionBox_h featured"><span><?= Yii::$service->page->translate->__('featured products'); ?></span><em><a href=""><?= Yii::$service->page->translate->__('more'); ?></a></em></h4>
  47. <div class="pro-content">
  48. <?php
  49. $parentThis['products'] = $bestFeaturedProducts;
  50. $parentThis['name'] = 'featured';
  51. $config = [
  52. 'view' => 'cms/home/index/product.php',
  53. ];
  54. echo Yii::$service->page->widget->renderContent('category_product_price',$config,$parentThis);
  55. ?>
  56. </div>
  57. </div>
  58. </div>
  59. <script>
  60. <?php $this->beginBlock('owl_fecshop_slider') ?>
  61. $(document).ready(function(){
  62. $("#owl-fecshop").owlCarousel({
  63. navigation : true,
  64. slideSpeed : 300,
  65. paginationSpeed : 400,
  66. singleItem : true,
  67. autoPlay:3000,
  68. lazyLoad:true
  69. // "singleItem:true" is a shortcut for:
  70. // items : 1,
  71. // itemsDesktop : false,
  72. // itemsDesktopSmall : false,
  73. // itemsTablet: false,
  74. // itemsMobile : false
  75. });
  76. $("#owl-best-seller").owlCarousel({
  77. items : 4,
  78. lazyLoad : true,
  79. navigation : true,
  80. scrollPerPage : true,
  81. pagination:false,
  82. itemsCustom : false,
  83. slideSpeed : 900
  84. });
  85. $("#owl-featured").owlCarousel({
  86. items : 4,
  87. lazyLoad : true,
  88. navigation : true,
  89. scrollPerPage : true,
  90. pagination:false,
  91. itemsCustom : false,
  92. slideSpeed : 900
  93. });
  94. });
  95. <?php $this->endBlock(); ?>
  96. </script>
  97. <?php $this->registerJs($this->blocks['owl_fecshop_slider'],\yii\web\View::POS_END);//将编写的js代码注册到页面底部 ?>