SlideloadWidget.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Author: Jack.Chen
  4. * Create time: 20-5-30 下午1:38
  5. * Description: 操作内容模型关联的字段操作
  6. */
  7. namespace app\common\widget;
  8. use yii\base\Widget;
  9. use Yii;
  10. class SlideloadWidget extends Widget
  11. {
  12. public $pageCount;//总页数
  13. public $currentPage;//当前页
  14. public $count;//记录总数
  15. public $ajaxUrl;//数据读取接口
  16. public $searchConditions;//搜索序列化条件
  17. public $keyword;//搜索关键词
  18. public $modelId;//内容模型
  19. public $listContentId = 'content_list';//列表页内容容器Id
  20. public $marginHeight=100;//距离底部高度临界值
  21. public $loadBtnTitle='加载更多';
  22. public function init()
  23. {
  24. }
  25. public function run()
  26. {
  27. $view = defined('IN_WAP')&&IN_WAP==TRUE?'slideload/wap':'slideload/pc';
  28. return $this->render($view,array(
  29. 'pageCount'=>$this->pageCount,
  30. 'currentPage'=>$this->currentPage,
  31. 'count'=>$this->count,
  32. 'ajaxUrl'=>$this->ajaxUrl,
  33. 'searchConditions'=>$this->searchConditions,
  34. 'keyword'=>$this->keyword,
  35. 'modelId'=>$this->modelId,
  36. 'listContentId'=>$this->listContentId,
  37. 'loadBtnTitle'=>$this->loadBtnTitle,
  38. 'marginHeight'=>$this->marginHeight
  39. )
  40. );
  41. }
  42. }