添加:消费返利佣金提现添加手续费

This commit is contained in:
wuhui_zzw 2024-03-18 17:11:41 +08:00
parent 97d36eca89
commit dbd05d6614
3 changed files with 79 additions and 0 deletions

View File

@ -74,6 +74,10 @@ class PluginApplication extends \app\common\services\PluginApplication{
public function getWidgetItems()
{
return [
'withdraw.rebate_commission' => [
'title' => '消费返利提现',
'class' => 'Yunshop\Rebate\admin\widget\RebateWithdrawWidget'
],
'vue-goods.rebate' => [
'title' => '消费返利',
'class' => \Yunshop\Rebate\admin\widget\RebateWidget::class,

View File

@ -0,0 +1,18 @@
<?php
namespace Yunshop\Rebate\admin\widget;
use app\common\components\Widget;
use app\common\facades\Setting;
class RebateWithdrawWidget extends Widget{
public function run(){
$set = Setting::get('withdraw.rebate', ['roll_out_limit' => '', 'poundage_rate' => '']);
return view('Yunshop\Rebate::widget.withdraw.set', [
'set' => $set,
])->render();
}
}

View File

@ -0,0 +1,57 @@
<div class='panel panel-default'>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">提现额度</label>
<div class="col-sm-9 col-xs-12">
<input type="text" name="withdraw[rebate][roll_out_limit]" class="form-control" value="{{$set['roll_out_limit']}}"/>
<span class="help-block">当前分销商的佣金达到此额度时才能提现</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">提现手续费</label>
<div class="col-sm-9 col-xs-12">
<div class="switch">
<label class='radio-inline'>
<input type='radio' name='withdraw[rebate][poundage_type]' value='1' @if($set['poundage_type'] == 1) checked @endif />
固定金额
</label>
<label class='radio-inline'>
<input type='radio' name='withdraw[rebate][poundage_type]' value='0' @if(empty($set['poundage_type'])) checked @endif />
手续费比例
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
<div class="col-sm-9 col-xs-12">
<div class="cost">
<label class='radio-inline'>
<div class="input-group">
<div class="input-group-addon" id="rebate_poundage_hint" style="width: 120px;">
@if($set['poundage_type'] == 1) 固定金额 @else 手续费比例 @endif
</div>
<input type="text" name="withdraw[rebate][poundage_rate]" class="form-control" value="{{ $set['poundage_rate'] ?? '' }}" placeholder="请输入提现手续费计算值"/>
<div class="input-group-addon" id="rebate_poundage_unit">
@if($set['poundage_type'] == 1) @else % @endif
</div>
</div>
</label>
</div>
</div>
</div>
</div>
<script language="javascript">
$(function () {
$(":radio[name='withdraw[rebate][poundage_type]']").click(function () {
if ($(this).val() == 1) {
$("#rebate_poundage_unit").html('元');
$("#rebate_poundage_hint").html('固定金额');
}
else {
$("#rebate_poundage_unit").html('%');
$("#rebate_poundage_hint").html('手续费比例')
}
});
})
</script>