2022-11-16 10:06:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\View\Components;
|
|
|
|
|
2022-12-27 16:25:22 +00:00
|
|
|
use Illuminate\Contracts\View\View;
|
2022-11-16 10:06:51 +00:00
|
|
|
use Illuminate\View\Component;
|
|
|
|
|
|
|
|
class Payment extends Component
|
|
|
|
{
|
2023-01-16 20:36:43 +00:00
|
|
|
public string|null $payment = '';
|
2022-11-16 10:06:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new component instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2023-01-16 20:36:43 +00:00
|
|
|
public function __construct(string|null $payment)
|
2022-11-16 10:06:51 +00:00
|
|
|
{
|
|
|
|
//
|
|
|
|
$this->payment = $payment;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the view / contents that represent the component.
|
|
|
|
*
|
2023-01-10 13:42:27 +00:00
|
|
|
* @return View
|
2022-11-16 10:06:51 +00:00
|
|
|
*/
|
2023-01-10 13:42:27 +00:00
|
|
|
public function render(): View
|
2022-11-16 10:06:51 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
$this->payment = match ($this->payment) {
|
|
|
|
'alipay' => '支付宝',
|
|
|
|
'wechat', 'wepay' => '微信支付',
|
|
|
|
'drops' => 'Drops',
|
2022-11-16 11:49:12 +00:00
|
|
|
'balance', 'balances' => '余额',
|
2022-11-16 10:06:51 +00:00
|
|
|
'unfreeze' => '解冻',
|
|
|
|
'freeze' => '冻结',
|
|
|
|
'console' => '控制台',
|
2022-11-16 11:49:12 +00:00
|
|
|
'transfer' => '转账',
|
2022-11-16 10:06:51 +00:00
|
|
|
default => $this->payment,
|
|
|
|
};
|
|
|
|
|
|
|
|
return view('components.payment', ['payment' => $this->payment]);
|
|
|
|
}
|
|
|
|
}
|