improve medal display page

This commit is contained in:
xiaomlove
2023-01-30 14:06:12 +08:00
parent 04b94ec4cc
commit 2eaf5eabd1
4 changed files with 17 additions and 14 deletions
+11 -14
View File
@@ -21,9 +21,9 @@ $columnDescriptionLabel = nexus_trans('medal.fields.description');
$columnBuyLabel = nexus_trans('medal.buy_btn'); $columnBuyLabel = nexus_trans('medal.buy_btn');
$columnSaleBeginEndTimeLabel = nexus_trans('medal.fields.sale_begin_end_time'); $columnSaleBeginEndTimeLabel = nexus_trans('medal.fields.sale_begin_end_time');
$columnInventoryLabel = nexus_trans('medal.fields.inventory'); $columnInventoryLabel = nexus_trans('medal.fields.inventory');
$columnBonusAdditionFactorLabel = nexus_trans('medal.fields.bonus_addition_factor'); $columnBonusAdditionLabel = nexus_trans('medal.fields.bonus_addition');
$columnGiftLabel = nexus_trans('medal.gift_btn'); $columnGiftLabel = nexus_trans('medal.gift_btn');
$columnGiftFeeFactorLabel = nexus_trans('medal.fields.gift_fee_factor'); $columnGiftFeeLabel = nexus_trans('medal.fields.gift_fee');
$header = '<h1 style="text-align: center">'.$title.'</h1>'; $header = '<h1 style="text-align: center">'.$title.'</h1>';
$filterForm = <<<FORM $filterForm = <<<FORM
<div> <div>
@@ -40,16 +40,13 @@ $table = <<<TABLE
<table border="1" cellspacing="0" cellpadding="5" width="100%"> <table border="1" cellspacing="0" cellpadding="5" width="100%">
<thead> <thead>
<tr> <tr>
<td class="colhead">ID</td>
<td class="colhead">$columnNameLabel</td>
<td class="colhead">$columnImageLargeLabel</td> <td class="colhead">$columnImageLargeLabel</td>
<td class="colhead" style="width: 115px">$columnSaleBeginEndTimeLabel</td>
<td class="colhead">$columnBonusAdditionFactorLabel</td>
<td class="colhead">$columnGiftFeeFactorLabel</td>
<td class="colhead">$columnPriceLabel</td>
<td class="colhead">$columnDurationLabel</td>
<td class="colhead">$columnInventoryLabel</td>
<td class="colhead">$columnDescriptionLabel</td> <td class="colhead">$columnDescriptionLabel</td>
<td class="colhead" style="width: 115px">$columnSaleBeginEndTimeLabel</td>
<td class="colhead">$columnDurationLabel</td>
<td class="colhead">$columnBonusAdditionLabel</td>
<td class="colhead">$columnPriceLabel</td>
<td class="colhead">$columnInventoryLabel</td>
<td class="colhead">$columnBuyLabel</td> <td class="colhead">$columnBuyLabel</td>
<td class="colhead">$columnGiftLabel</td> <td class="colhead">$columnGiftLabel</td>
</tr> </tr>
@@ -91,12 +88,12 @@ foreach ($rows as $row) {
$buyClass, $row->id, $buyBtnText, $buyDisabled $buyClass, $row->id, $buyBtnText, $buyDisabled
); );
$giftAction = sprintf( $giftAction = sprintf(
'<input type="number" class="uid" %s style="width: 60px" placeholder="UID"><input type="button" class="%s" data-id="%s" value="%s"%s>', '<input type="number" class="uid" %s style="width: 60px" placeholder="UID"><input type="button" class="%s" data-id="%s" value="%s"%s><span class="nowrap">%s: %s</span>',
$giftDisabled, $giftClass, $row->id, $giftBtnText, $giftDisabled $giftDisabled, $giftClass, $row->id, $giftBtnText, $giftDisabled, $columnGiftFeeLabel, (($row->gift_fee_factor ?? 0) * 100).'%'
); );
$table .= sprintf( $table .= sprintf(
'<tr><td><span class="nowrap">%s</span></td><td><span class="nowrap">%s</span></td><td><img src="%s" style="max-width: 60px;max-height: 60px;" class="preview" /></td><td>%s ~<br>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>', '<tr><td><img src="%s" style="max-width: 60px;max-height: 60px;" class="preview" /></td><td><h1>%s</h1>%s</td><td>%s ~<br>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>',
$row->id, $row->name, $row->image_large, $row->sale_begin_time ?? '--', $row->sale_end_time ?? '--', $row->bonus_addition_factor, $row->gift_fee_factor ?? 0, number_format($row->price), $row->durationText, $row->inventory ?? nexus_trans('label.infinite'), $row->description, $buyAction, $giftAction $row->image_large, $row->name, $row->description, $row->sale_begin_time ?? '--', $row->sale_end_time ?? '--', $row->durationText, (($row->bonus_addition_factor ?? 0) * 100).'%', number_format($row->price), $row->inventory ?? nexus_trans('label.infinite'), $buyAction, $giftAction
); );
} }
$table .= '</tbody></table>'; $table .= '</tbody></table>';
+2
View File
@@ -27,8 +27,10 @@ return [
'sale_begin_end_time' => 'Available for sale', 'sale_begin_end_time' => 'Available for sale',
'users_count' => 'Sold counts', 'users_count' => 'Sold counts',
'bonus_addition_factor' => 'Bonus addition factor', 'bonus_addition_factor' => 'Bonus addition factor',
'bonus_addition' => 'Bonus addition',
'bonus_addition_factor_help' => 'For example: 0.01 means 1% addition, leave blank no addition', 'bonus_addition_factor_help' => 'For example: 0.01 means 1% addition, leave blank no addition',
'gift_fee_factor' => 'Gift fee factor', 'gift_fee_factor' => 'Gift fee factor',
'gift_fee' => 'Gift fee',
'gift_fee_factor_help' => 'The additional fee charged for gifts to other users is equal to the price multiplied by this factor', 'gift_fee_factor_help' => 'The additional fee charged for gifts to other users is equal to the price multiplied by this factor',
], ],
'buy_already' => 'Already buy', 'buy_already' => 'Already buy',
+2
View File
@@ -27,8 +27,10 @@ return [
'sale_begin_end_time' => '可购买时间', 'sale_begin_end_time' => '可购买时间',
'users_count' => '已售数量', 'users_count' => '已售数量',
'bonus_addition_factor' => '魔力加成系数', 'bonus_addition_factor' => '魔力加成系数',
'bonus_addition' => '魔力加成',
'bonus_addition_factor_help' => '如:0.01 表示 1% 的加成,留空无加成', 'bonus_addition_factor_help' => '如:0.01 表示 1% 的加成,留空无加成',
'gift_fee_factor' => '赠送手续费系数', 'gift_fee_factor' => '赠送手续费系数',
'gift_fee' => '手续费',
'gift_fee_factor_help' => '赠送给其他用户时额外收取手续费等于价格乘以此系数', 'gift_fee_factor_help' => '赠送给其他用户时额外收取手续费等于价格乘以此系数',
], ],
'buy_already' => '已经购买', 'buy_already' => '已经购买',
+2
View File
@@ -27,8 +27,10 @@ return [
'sale_begin_end_time' => '可購買時間', 'sale_begin_end_time' => '可購買時間',
'users_count' => '已售數量', 'users_count' => '已售數量',
'bonus_addition_factor' => '魔力加成系數', 'bonus_addition_factor' => '魔力加成系數',
'bonus_addition' => '魔力加成',
'bonus_addition_factor_help' => '如:0.01 表示 1% 的加成,留空無加成', 'bonus_addition_factor_help' => '如:0.01 表示 1% 的加成,留空無加成',
'gift_fee_factor' => '贈送手續費系數', 'gift_fee_factor' => '贈送手續費系數',
'gift_fee' => '手續費',
'gift_fee_factor_help' => '贈送給其他用戶時額外收取手續費等於價格乘以此系數', 'gift_fee_factor_help' => '贈送給其他用戶時額外收取手續費等於價格乘以此系數',
], ],
'buy_already' => '已經購買', 'buy_already' => '已經購買',