Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9df56fc
commit d077f1e
Showing
82 changed files
with
255 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,96 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of zhuchunshu. | ||
* @link https://github.com/zhuchunshu | ||
* @document https://github.com/zhuchunshu/SForum | ||
* @contact laravel@88.com | ||
* @license https://github.com/zhuchunshu/SForum/blob/master/LICENSE | ||
*/ | ||
namespace App\CodeFec\Ui\Generate; | ||
|
||
use Hyperf\Utils\Str; | ||
use Hyperf\Stringable\Str; | ||
|
||
class PayGenerate | ||
{ | ||
|
||
/** | ||
* 根据不同状态,选择不同文字样式 | ||
* @param string $status | ||
* 根据不同状态,选择不同文字样式. | ||
* @return string | ||
*/ | ||
public function status_class_text(string $status){ | ||
public function status_class_text(string $status) | ||
{ | ||
$style = ['text-blue']; | ||
// 待支付 | ||
if (Str::is('*待支付*','*'.$status.'*') || Str::is('*未支付*','*'.$status.'*') || Str::is('*未付款*','*'.$status.'*')){ | ||
if (Str::is('*待支付*', '*' . $status . '*') || Str::is('*未支付*', '*' . $status . '*') || Str::is('*未付款*', '*' . $status . '*')) { | ||
$style = ['text-lime']; | ||
} | ||
|
||
// 支付成功 | ||
if (Str::is('*成功*','*'.$status.'*')){ | ||
if (Str::is('*成功*', '*' . $status . '*')) { | ||
$style = ['text-azure']; | ||
} | ||
|
||
// 退款 | ||
if (Str::is('*退款*','*'.$status.'*')){ | ||
if (Str::is('*退款*', '*' . $status . '*')) { | ||
$style = ['text-orange']; | ||
} | ||
|
||
// 交易取消 | ||
if (Str::is('*取消*','*'.$status.'*')){ | ||
if (Str::is('*取消*', '*' . $status . '*')) { | ||
$style = ['text-purple']; | ||
} | ||
|
||
// 交易关闭 | ||
if (Str::is('*关闭*','*'.$status.'*')){ | ||
if (Str::is('*关闭*', '*' . $status . '*')) { | ||
$style = ['text-yellow']; | ||
} | ||
|
||
// 支付失败 | ||
if (Str::is('*失败*','*'.$status.'*')){ | ||
if (Str::is('*失败*', '*' . $status . '*')) { | ||
$style = ['text-red']; | ||
} | ||
|
||
return implode(' ',$style); | ||
return implode(' ', $style); | ||
} | ||
|
||
/** | ||
* 根据不同状态,选择不同颜色名 | ||
* @param string $status | ||
* 根据不同状态,选择不同颜色名. | ||
* @return string | ||
*/ | ||
public function status_color_name(string $status){ | ||
public function status_color_name(string $status) | ||
{ | ||
$style = ['blue']; | ||
// 待支付 | ||
if (Str::is('待支付','*'.$status.'*') || Str::is('*未支付*','*'.$status.'*') || Str::is('*未付款*','*'.$status.'*')){ | ||
if (Str::is('待支付', '*' . $status . '*') || Str::is('*未支付*', '*' . $status . '*') || Str::is('*未付款*', '*' . $status . '*')) { | ||
$style = ['lime']; | ||
} | ||
|
||
// 支付成功 | ||
if (Str::is('*成功*','*'.$status.'*',)){ | ||
if (Str::is('*成功*', '*' . $status . '*', )) { | ||
$style = ['azure']; | ||
} | ||
|
||
// 退款 | ||
if (Str::is('*退款*','*'.$status.'*',)){ | ||
if (Str::is('*退款*', '*' . $status . '*', )) { | ||
$style = ['orange']; | ||
} | ||
|
||
|
||
// 交易关闭 | ||
if (Str::is('*关闭*','*'.$status.'*')){ | ||
if (Str::is('*关闭*', '*' . $status . '*')) { | ||
$style = ['yellow']; | ||
} | ||
|
||
// 交易取消 | ||
if (Str::is('*取消*','*'.$status.'*')){ | ||
if (Str::is('*取消*', '*' . $status . '*')) { | ||
$style = ['purple']; | ||
} | ||
|
||
// 支付失败 | ||
if (Str::is('*失败*','*'.$status.'*')){ | ||
if (Str::is('*失败*', '*' . $status . '*')) { | ||
$style = ['red']; | ||
} | ||
|
||
return implode(' ',$style); | ||
return implode(' ', $style); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.