order_id = $orderId; $this->currentPage = $currentPage; parent::__construct($title); } public function render() { // 实例化表单类并传递自定义参数 $form = MyDetailPage::make(['order_id' => $this->order_id]); return Modal::make() ->xl() ->title('订单详情') ->body($form) ->button($this->title); } // /** // * 添加JS // * @return string // */ // protected function script() // { // return <<order_id}').on('click', function () { // window.location.href ="detail?order_id={$this->order_id}&page={$this->currentPage}"; // }); //JS; // } // public function html() { $this->setHtmlAttribute(['class'=>"detail_{$this->order_id}"]); return parent::html(); } }