| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- @extends('base.base')
- @section('base')
- <!-- 内容区域 -->
- <div class="main-panel">
- <div class="content-wrapper">
- <div class="row">
- <div class="col-12 grid-margin stretch-card">
- <div class="card">
- <div class="card-body">
- <h4 class="card-title">{{ __('auto.添加咖啡档位') }}</h4>
- <form class="forms-sample" id="form">
- <div class="form-group">
- <label for="nickname">*咖啡金额</label>
- <input type="number" step="0.01" class="form-control required" name="money" placeholder="{{ __('auto.请输入咖啡金额') }}">
- </div>
- <div class="form-group">
- <label for="nickname">*咖啡档位(优惠价)</label>
- <input type="number" step="0.01" class="form-control required" name="favorable_price" placeholder="{{ __('auto.请输入咖啡档位') }}">
- </div>
- <div class="form-group">
- <label for="nickname">*咖啡档位(赠送彩金)</label>
- <input type="number" step="0.01" class="form-control required" name="give" placeholder="{{ __('auto.请输入咖啡档位') }}" value="0">
- </div>
- <div class="form-group">
- <label for="pay_methods">*支持的支付方式</label><br>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="cashapp" value="1">
- <label class="form-check-label" for="cashapp">CashApp</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="paypal" value="2">
- <label class="form-check-label" for="paypal">PayPal</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="applepay" value="4">
- <label class="form-check-label" for="applepay">ApplePay</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="googlepay" value="8">
- <label class="form-check-label" for="googlepay">GooglePay</label>
- </div>
- <br><br>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-trc20" value="64">
- <label class="form-check-label" for="usdt-trc20">USDT-TRC20</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-erc20" value="128">
- <label class="form-check-label" for="usdt-erc20">USDT-ERC20</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-trc20" value="256">
- <label class="form-check-label" for="usdc-trc20">USDC-TRC20</label>
- </div>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-erc20" value="512">
- <label class="form-check-label" for="usdc-erc20">USDC-ERC20</label>
- </div>
- </div>
- <div class="form-group">
- <label for="in_shop">*是否在商城展示</label><br>
- 显示 <input type="radio" name="in_shop" value="1" checked>
- 隐藏 <input type="radio" name="in_shop" value="0">
- </div>
- <div class="form-group">
- <label for="account">*开关</label><br>
- {{ __('auto.开启') }} <input type="radio" name="status" value="1" checked>
- {{ __('auto.关闭') }} <input type="radio" name="status" value="-1">
- </div>
- <button type="button" onclick="commit()" class="btn btn-sm btn-gradient-primary btn-icon-text">
- <i class="mdi mdi-file-check btn-icon-prepend"></i>
- {{ __('auto.提交') }}
- </button>
- <button type="button" onclick="cancel()" class="btn btn-sm btn-gradient-warning btn-icon-text">
- <i class="mdi mdi-reload btn-icon-prepend"></i>
- {{ __('auto.取消') }}
- </button>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- function commit(){
- if($("#password").val() != $("#password_verify").val()){
- layer.msg('{{ __('auto.两次密码输入不一致') }}', function(){});
- }
- if(!checkForm()){
- return false;
- }
- // var config_ids = []
- // $("input:checkbox:checked").each(function () {
- // config_ids.push($(this).val())
- // })
- var data = $("#form").serializeObject();
- var money = data.money
- var status = data.status
- var favorable_price = data.favorable_price
- var give = data.give
- var in_shop = data.in_shop
-
- // 计算支付方式位掩码
- var pay_methods = 0;
- $("input[name='pay_methods[]']:checked").each(function() {
- pay_methods += parseInt($(this).val());
- });
-
- myRequest("/admin/recharge/add","post", {money,status,favorable_price,give,pay_methods,in_shop},function(res){
- if(res.code == '200'){
- layer.msg(res.msg)
- setTimeout(function(){
- parent.location.reload();
- },1500)
- }else{
- layer.msg(res.msg)
- }
- });
- }
- function cancel() {
- parent.location.reload();
- }
- </script>
- @endsection
|