| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Web\Components\Meeting;
- use App\Exceptions\ApiException;
- use App\Web\Facades\MeetingFacade;
- use App\Web\Facades\WebFacade;
- use App\Web\Services\WebService;
- use Illuminate\View\Component;
- class MeetingList extends Component
- {
- protected $page; //这是参数
- protected $pageSize;
- protected $viewFile; //视图地址
- protected $typeIds;
- protected $tagIds;
- protected $keyword;
- protected $country;
- protected $expo_date;
- protected $router_path;
- public function __construct($viewFile = "", $params = [], $page = 1, $pageSize = 10,$routerPath = '',$typeIds = [],$tagIds=[],$keyword='',$country='',$expo_date='')
- {
- if (empty($viewFile)) {
- throw new ApiException("common.page_none", '您访问的地址不存在~');
- }
- $this->page = isset($params['page']) ? $params['page'] : $page;
- $this->pageSize = isset($params['page_size']) ? $params['page_size'] : $pageSize;
- $this->typeIds = isset($params['type_ids']) ? $params['type_ids'] : $typeIds;
- $this->tagIds = isset($params['tag_ids']) ? $params['tag_ids'] : $tagIds;
- $this->keyword = isset($params['keyword']) ? $params['keyword'] : $keyword;
- $this->country = isset($params['country']) ? $params['country'] : $country;
- $this->expo_date = isset($params['expo_date']) ? $params['expo_date'] : $expo_date;
- $this->router_path = $params['router_path'] ?? $routerPath;
- $this->viewFile= $viewFile;
- }
- /**
- * 资讯列表组件
- */
- public function render()
- {
- $params = [
- "page" => $this->page,
- "page_size" => $this->pageSize,
- "type_ids" => $this->typeIds,
- "tag_ids" => $this->tagIds,
- "keyword" => $this->keyword,
- "country" => $this->country,
- "expo_date" => $this->expo_date
- ];
- $params['status']=0;
- $params['sort']= [];
- $params['is_paginate']=1;
- $retData = MeetingFacade::getPublishMeetingList($params);
- if (!empty($this->router_path)) {
- $pageContent = WebFacade::getStaticPageInfo(['route_path' => $this->router_path]);
- $retData['page_content'] = $pageContent['page_content'];
- $retData['router_path'] = $this->router_path;
- }
- $retData['menu_data']=WebFacade::getWebMenu();
- return view($this->viewFile, $retData);
- }
- }
|