链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

43 lines
1020 B

<?php
namespace App\Admin\Extensions;
use Dcat\Admin\Grid\RowAction;
class OrderDetail extends RowAction
{
protected $title;
protected $order_id;
protected $currentPage;
protected $last_url;
public function __construct($orderId,$currentPage,$lastUrl,$title=null)
{
$this->order_id = $orderId;
$this->currentPage = $currentPage;
$this->last_url = $lastUrl;
parent::__construct($title);
}
/**
* 添加JS
* @return string
*/
protected function script()
{
return <<<JS
$('.detail_{$this->order_id}').on('click', function () {
//window.location.href ="detail?order_id={$this->order_id}&page={$this->currentPage}&last_url={$this->last_url}";
window.open("detail?order_id={$this->order_id}&page={$this->currentPage}&last_url={$this->last_url}");
});
JS;
}
public function html()
{
$this->setHtmlAttribute(['class'=>"detail_{$this->order_id}"]);
return parent::html();
}
}