index.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. <?= Yii::$service->cms->staticblock->getStoreContentByIdentify('home-big-img','appfront') ?>
  12. <div class="mt10">
  13. <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>
  14. <div class="pro-content">
  15. <?php
  16. $parentThis['products'] = $bestSellerProducts;
  17. $parentThis['name'] = 'best-seller';
  18. $config = [
  19. 'view' => 'cms/home/index/product.php',
  20. ];
  21. echo Yii::$service->page->widget->renderContent('category_product_price',$config,$parentThis);
  22. ?>
  23. </div>
  24. </div>
  25. <div class="clear"></div>
  26. <div class="mt10" style="margin-top:34px;">
  27. <h4 class="sectionBox_h featured"><span><?= Yii::$service->page->translate->__('featured products'); ?></span><em><a href=""><?= Yii::$service->page->translate->__('more'); ?></a></em></h4>
  28. <div class="pro-content">
  29. <?php
  30. $parentThis['products'] = $bestFeaturedProducts;
  31. $parentThis['name'] = 'featured';
  32. $config = [
  33. 'view' => 'cms/home/index/product.php',
  34. ];
  35. echo Yii::$service->page->widget->renderContent('category_product_price',$config,$parentThis);
  36. ?>
  37. </div>
  38. </div>
  39. </div>
  40. <script>
  41. <?php $this->beginBlock('owl_fecshop_slider') ?>
  42. $(document).ready(function(){
  43. $("#owl-fecshop").owlCarousel({
  44. navigation : true,
  45. slideSpeed : 300,
  46. paginationSpeed : 400,
  47. singleItem : true,
  48. autoPlay:3000,
  49. lazyLoad:true
  50. // "singleItem:true" is a shortcut for:
  51. // items : 1,
  52. // itemsDesktop : false,
  53. // itemsDesktopSmall : false,
  54. // itemsTablet: false,
  55. // itemsMobile : false
  56. });
  57. $("#owl-best-seller").owlCarousel({
  58. items : 4,
  59. lazyLoad : true,
  60. navigation : true,
  61. scrollPerPage : true,
  62. pagination:false,
  63. itemsCustom : false,
  64. slideSpeed : 900
  65. });
  66. $("#owl-featured").owlCarousel({
  67. items : 4,
  68. lazyLoad : true,
  69. navigation : true,
  70. scrollPerPage : true,
  71. pagination:false,
  72. itemsCustom : false,
  73. slideSpeed : 900
  74. });
  75. });
  76. <?php $this->endBlock(); ?>
  77. </script>
  78. <?php $this->registerJs($this->blocks['owl_fecshop_slider'],\yii\web\View::POS_END);//将编写的js代码注册到页面底部 ?>