0
0

更新代码

This commit is contained in:
2020-08-04 10:17:22 +08:00
parent c2ac5d964e
commit 55514ed071
954 changed files with 119510 additions and 0 deletions

View File

@@ -0,0 +1,167 @@
@extends('layouts.app')
@section('content')
<section class="padding_btm">
<div class="j_account_money">
余额<span>{{ Auth::user()->account->cash}}</span>&nbsp;
提现额度<span>{{ number_format(Auth::user()->account->score, 2) }}</span>
</div>
<!--提现-->
<form action="{{ route('withdraw.applydo') }}" method="get" accept-charset="utf-8">
<div class="formbox">
<div class="formbox-label" style="position:relative">
提现金额
<div class="touch_num all_ti">全部提现</div>
</div>
<div class="formbox-input">
<input type="tel" name="price" value="" placeholder="最少提现金额为{{ $withdraw_min }}" class="formbox-input-text">
</div>
</div>
<div class="formbox" style="border-bottom:1px solid #eee">
<div class="formbox-label">
提现方式
</div>
<div class="mode_choice">
<img src="/assets/home/img/zhi.png" class="mode_i">
<div class="mode_choice_text">
提现到支付宝
</div>
<div class="mode_choice_input radio">
<input type="radio" id="true_message" value="0" >
<label for="payment" ></label>
</div>
</div>
</div>
<div class="true_show">
<div class="ture_container">
<div class="ture_label text-nowrap">收款人</div>
<input type="text" name="payee" value="{{ $last->payee??'' }}" placeholder="输入收款人" class="ture_input input">
</div>
<div class="ture_container">
<div class="ture_label text-nowrap">支付宝账号</div>
<input type="text" name="alipay" value="{{ $last->alipay??'' }}" placeholder="输入支付宝账号" class="ture_input input">
</div>
<div class="ture_container">
<div class="ture_label text-nowrap">确认支付宝账号</div>
<input type="text" name="alipay_confirmation" value="{{ $last->alipay??'' }}" placeholder="确认支付宝账号" class="ture_input input">
</div>
</div>
<div class="max_notice" style="line-height:1.1rem;text-align:justify;padding:.5rem .75rem">
<i class="icon-exclamation-sign"></i>&nbsp;实际到账额度:<span id="take">0</span></br>
<i class="icon-exclamation-sign"></i>&nbsp;{{ $alipay_basic }}元以内支付宝提现收{{ $alipay_basic_tax }}元手续费</br>
<i class="icon-exclamation-sign"></i>&nbsp;{{ $alipay_basic }}(含{{ $alipay_basic }})元以上支付宝提现收{{ $alipay_tax }}%手续费</br>
<i class="icon-exclamation-sign"></i>&nbsp;每天只可提现一次</br>
<i class="icon-exclamation-sign"></i>&nbsp;{{ $withdraw_min }}起提</br>
</div>
<div class="j_bottom" style="position:static;">
<button class="j_submit btn ajax_post" type="button">提现</button>
</div>
@csrf
</form>
</section>
@endsection
@section('script')
<script type="text/javascript">
/*填写支付宝信息*/
$("#true_message").click(function(){
var value = $(this).val();
if (value==0) {
$(this).val(1);
$(".true_show").show();
}else{
$(this).val(0);
$(".true_show").hide();
}
});
$('.ajax_post').click(function(){
var $this = $(this);
var $form = $this.parents('form');
var $tips = $this.attr('tip') || '确认要执行该操作吗?';
var $action = $form.attr("action");
$this.attr('disabled', 'disabled');
var query = $form.serialize();
$.ajax({
type: "POST",
url: $action,
data: query,
success: function(res) {
if (res.statusCode=='400') {
if (res.redirect) {
layer.confirm(res.message, {
btn: ['跳转','取消'],
offset: ['30%', '15%'],
area: ['70%', '35%']
}, function(){
location.href = res.redirect;
}, function(){});
}else{
updateAlert(res.message, res.status);
}
}else{
updateAlert(res.message, res.status, function() {
if (res.redirect) {
location.href = res.redirect;
}
});
}
$this.removeAttr('disabled');
},
error: function(error) {
$this.removeAttr('disabled');
if (error.responseJSON.errors) {
var err = '';
$.each(error.responseJSON.errors, function(i, n) {
err += n + "\r\n";
})
updateAlert(err, 'warning');
} else if (error.responseJSON.message) {
updateAlert(error.responseJSON.message, 'warning');
} else {
updateAlert('发生未知错误', 'warning');
}
}
});
});
$('.all_ti').click(function(){
var all = "{{ min(Auth::user()->account->cash,Auth::user()->account->score) }}";
var sub_all = "{{ $tax+$subsidy }}";
var take = all-all*sub_all/100;
$('input[name=price]').val(all);
$('#take').html(take.toFixed(2));
});
$('input[name=price]').bind('input propertychange', function() {
var price = parseInt($(this).val());
var sub_all = "{{ $tax+$subsidy }}";
var take = price-price*sub_all/100;
var alipay_basic = "{{ $alipay_basic }}";
var alipay_basic_tax = "{{ $alipay_basic_tax }}";
var alipay_tax = "{{ $alipay_tax }}";
var sub_alipay_tax =0;
if (price>=alipay_basic) {
sub_alipay_tax = price*alipay_tax/100;
sub_alipay_tax = sub_alipay_tax.toFixed(2);
}else{
sub_alipay_tax = alipay_basic_tax;
}
take = take - sub_alipay_tax;
$('#take').html(take.toFixed(2));
});
</script>
@endsection

View File

@@ -0,0 +1,123 @@
@extends('layouts.app')
@section('footer')
@endsection
@section('content')
<section class="padding_btm" >
<!-- 账户总额 Start -->
<div class="accounts-top" style="padding: 2rem 0">
<div class="bi-top-num">
{{ number_format(Auth::user()->account->cash, 2) }}
</div>
<div class="bi-top-name">
账户余额
</div>
<div class="cash_record" data-href="{{ route('withdraw.index') }}">
提现记录
</div>
</div>
<!-- 账户总额 End -->
<!-- 提现表单 Start -->
<form action=" {{ route('withdraw.store') }} " method="get" accept-charset="utf-8">
<div class="formbox">
<div class="formbox-label">
提现金额
</div>
<div class="formbox-input">
<input type="number" name="money" value="" placeholder="输入提现金额" class="formbox-input-text">元
</div>
</div>
<div class="formbox">
<div class="formbox-label">
姓名
</div>
<div class="formbox-input">
<input type="text" name="payee" value="{{ Auth::user()->info->payee ?? '' }}" placeholder="收款人姓名">
</div>
</div>
<div class="formbox">
<div class="formbox-label">
银行卡号
</div>
<div class="formbox-input">
<input type="number" name="bank_no" value="{{ Auth::user()->info->bank_no ?? '' }}" placeholder="收款账号">
</div>
</div>
<div class="formbox">
<div class="formbox-label">
银行名称
</div>
<div class="formbox-radio">
<select name="bank_name" class="select1">
<option value="">请选择银行</option>
@foreach($banks as $bank)
<option value="{{ $bank->title }}" @if(Auth::user()->info->bank_name == $bank->title) selected @endif>{{ $bank->title }}</option>
@endforeach
</select>
<i class="cash_sel_i icon-caret-down"></i>
</div>
</div>
<div class="formbox">
<div class="formbox-label">
开户行
</div>
<div class="formbox-input">
<input type="text" name="bank_address" value="{{ Auth::user()->info->bank_address ?? '' }}" placeholder="开户行">
</div>
</div>
<div class="formbox">
<div class="formbox-label">
备注
</div>
<div class="formbox-input">
<textarea class="textarea" name="remark" rows="3" placeholder="输入备注" style="padding:.5rem 0"></textarea>
</div>
</div>
<div class="button_btm">
@csrf
<input type="hidden" name="openid" value="{{ $openid }}">
<input type="hidden" name="way" value="Bankcard">
<button type="button" class="btn ajax-post">申请提现</button>
</div>
</form>
<!-- 提现表单 End -->
</section>
@endsection
@section('script')
<script type="text/javascript">
$("#way").change(function(data){
var way = $(this).val();
if(way == 'WenxinNo'){
$("#wechat").show();
$("#alipay").hide();
$("#bankcard").hide();
}
if(way == 'Alipay'){
$("#alipay").show();
$("#wechat").hide();
$("#bankcard").hide();
}
if(way == 'Bankcard'){
$("#alipay").hide();
$("#wechat").hide();
$("#bankcard").show();
}
if(way == 'Wechat'){
$("#alipay").hide();
$("#wechat").hide();
$("#bankcard").hide();
}
});
/*提现说明*/
$(".take_notice").click(function (e) {
$(".take_pop").show();
});
$(".take_close").click(function (e) {
$(".take_pop").hide();
});
</script>
@endsection

View File

@@ -0,0 +1,59 @@
@extends('layouts.app')
@section('content')
<section class="padding_btm">
<!--总额-->
<div class="j_account_money" style="border-bottom: 0">
已提金额<span style="font-size: .9rem">{{ $withdraw_total }}</span>
<div class="accounts_apply_btn" data-href="{{ route('withdraw.wechat') }}" style="bottom: 1.5rem;">
提现
</div>
</div>
<!--end 总额-->
<!--记录-->
<div class="accounts_detail">
提现明细
</div>
<ul class="bi-list" style="background:none">
@if($logs->count() > 0)
<div class="record_title">
<span>时间</span>
<span>提现金额</span>
<span>实到金额</span>
<span>提现方式</span>
<span>状态</span>
</div>
@foreach($logs as $log)
<li style="background-color: #fff;padding: .6rem 0">
<div class="record_block">
<div class="bi-list-r bi-list-small">{{ $log->created_at->format('m/d H:i') }}</div>
<div class="bi-list-l bi-list-small">{{ number_format($log->amount,2)}}</div><!--提现金额-->
<div class="bi-list-r bi-list-small">{{ number_format($log->take,2) }}</div><!--实到金额-->
<div class="bi-list-r bi-list-small">{{ $log->type_text }}</div><!--提现方式-->
<div class="bi-list-l" >{{ $log->state_text }}</div>
</div>
</li>
@endforeach
@else
<div class="empty">
<img src="/assets/home/img/c010.png">
<p>暂无提现记录</p>
</div>
@endif
</ul>
<!--end 记录-->
</section>
@endsection
@section('script')
<script type="text/javascript">
$(".take_notice").click(function (e) {
$(".take_pop").show();
});
$(".take_close").click(function (e) {
$(".take_pop").hide();
});
</script>
@endsection

View File

@@ -0,0 +1,234 @@
@extends('layouts.app')
@section('content')
<section class="padding_btm">
<div class="j_account_money">
余额<span style="font-size: .8rem">{{ number_format(Auth::user()->account->cash,2)}}</span>&nbsp;&nbsp;
<br>
@if(!empty(Auth::user()->openid))
您当前绑定的微信昵称为:<span>{{ Auth::user()->info->nickname }}</span>
@endif
</div>
<!--提现-->
<form action="{{ route('withdraw.wechatdo') }}" method="get" accept-charset="utf-8">
<div class="formbox" style="border-bottom:1px solid #eee">
<div class="formbox-label">
提现方式
</div>
<div class="mode_choice">
<img src="/assets/home/img/pay001.jpg" class="mode_i">
<div class="mode_choice_text">
提现到微信零钱
</div>
<div class="mode_choice_input radio">
<input type="radio" checked id="true_message" value="0" >
<label for="payment" ></label>
</div>
</div>
</div>
<div class="formbox" id="register">
<div class="formbox-label" style="position:relative">
提现金额
<div class="touch_num all_ti">全部提现</div>
</div>
<div class="formbox-input">
<input type="hidden" name="mobile" value="{{ Auth::user()->mobile }}" >
<input type="tel" name="amount" value="" placeholder="最少提现金额为{{ $withdraw_min }}" class="formbox-input-text">
</div>
<div class="formbox-input" style="border-top: 0">
<input type="tel" name="code" value="" placeholder="短信验证码" style="width:40%;">
<button type="button" id="send" @click="sendSmsCode" class="btn pull-right has-margin-sm" style="background-color: #ddd;color: #666;border-radius: .2rem;">获取短信验证码</button>
</div>
</div>
<div class="max_notice" style="line-height:1.1rem;text-align:justify;padding:.5rem .75rem">
<i class="icon-exclamation-sign"></i>&nbsp;实际到账额度:<span id="take">0</span></br>
<i class="icon-exclamation-sign"></i>&nbsp;每次提现额度为{{ $withdraw_min }} ~ {{ $withdraw_max }}</br>
</div>
@if(empty(Auth::user()->openid))
<div class="j_bottom" style="position:static;">
<button class="j_submit btn" type="button">请先绑定微信</button>
</div>
@else
@csrf
<div class="j_bottom" style="position:static;">
<button class="j_submit btn ajax_post " tip type="button">提现</button>
</div>
@endif
</form>
</section>
@endsection
@section('script')
<script type="text/javascript">
/*填写支付宝信息*/
$("#true_message").click(function(){
var value = $(this).val();
if (value==0) {
$(this).val(1);
$(".true_show").show();
}else{
$(this).val(0);
$(".true_show").hide();
}
});
$('.ajax_post').click(function(){
var $this = $(this);
var $form = $this.parents('form');
var $tips = $this.attr('tip') || '确认要执行该操作吗?';
var $action = $form.attr("action");
$this.attr('disabled', 'disabled');
var query = $form.serialize();
var amount = $('input[name=amount]').val();
var str = '您提现'+amount+'元,实到'+amount+'元,确定要提现吗?'
layer.confirm(str, {
title:'校验信息',
btn: ['确定','取消'],
offset: ['30%', '15%'],
area: ['70%', '35%']
}, function(){
$.ajax({
type: "POST",
url: $action,
data: query,
success: function(res) {
if (res.statusCode=='200') {
if (res.redirect) {
layer.confirm(res.message, {
title:'提现成功',
btn: ['跳转','取消'],
offset: ['30%', '15%'],
area: ['70%', '35%']
}, function(){
location.href = res.redirect;
}, function(){});
}else{
updateAlert(res.message, res.status);
}
}else{
updateAlert(res.message, res.status, function() {
if (res.redirect) {
location.href = res.redirect;
}
});
}
$this.removeAttr('disabled');
},
error: function(error) {
$this.removeAttr('disabled');
if (error.responseJSON.errors) {
var err = '';
$.each(error.responseJSON.errors, function(i, n) {
err += n + "\r\n";
})
updateAlert(err, 'warning');
} else if (error.responseJSON.message) {
updateAlert(error.responseJSON.message, 'warning');
} else {
updateAlert('发生未知错误', 'warning');
}
}
});
}, function(){
$this.removeAttr('disabled');
});
});
var app = new Vue({
el: '#register',
data: {
inputMobile: false,
inputCode: false,
codeSend: false,
mobile: '',
code: ''
},
methods: {
sendSmsCode: function() {
$.post("{{ route('auth.sms') }}", {mobile: {{ Auth::user()->mobile }}, channel: "BINDLast", '_token': '{{ csrf_token() }}'}, function(res) {
if (res.statusCode == 200) {
updateAlert(res.message);
settime($('#send'));
app.codeSend = true;
} else {
updateAlert(res.message);
}
});
}
},
watch: {
mobile: function() {
var reg = /^1[3456789]{1}[0-9]{9}$|14[57]{1}[0-9]{8}$|^[0][9]\d{8}$/;
if (reg.test(this.mobile)) {
this.inputMobile = true;
} else {
this.inputMobile = false;
}
},
code: function() {
var reg = /\d{4}/;
if (reg.test(this.code)) {
this.inputCode = true;
} else {
this.inputCode = false;
}
},
},
computed: {
disable: function () {
return !(this.inputMobile && this.inputCode && this.codeSend);
}
}
});
var countdown = 60;
function settime(obj) {
if (countdown == 0) {
obj.removeAttr("disabled");
obj.html("获取验证码");
countdown = 60;
return;
} else {
obj.attr("disabled", true);
obj.html("重新发送(" + countdown + ")");
countdown--;
}
setTimeout(function() {
settime(obj)
}, 1000)
}
$('.all_ti').click(function(){
var all = parseInt("{{ Auth::user()->account->cash }}");
var withdraw_max = "{{ $withdraw_max }}";
if(all>withdraw_max){
all=withdraw_max;
}
$('input[name=amount]').val(all);
$('#take').html(all);
});
$('input[name=amount]').bind('input propertychange', function() {
var withdraw_max = "{{ $withdraw_max }}";
if($(this).val()==''){
var price=0
}else{
var price = parseInt($(this).val());
}
if(price>withdraw_max){
price=withdraw_max;
}
$(this).val(price);
var take = price;
$('#take').html(take);
});
</script>
@endsection