1
0
Files
lkafu/app/Agent/Views/cashout/cashedit.blade.php
2020-08-06 14:45:56 +08:00

88 lines
3.0 KiB
PHP

@extends('Agent::layouts.app')
@section('title', '修改支付宝')
@section('content')
<section>
<!-- 添加银行卡 -->
<div class="withdrawForm">
<form action="{{ url()->current() }}" method="post" accept-charset="utf-8">
<div class="formbox">
<div class="formbox-label">
支付宝账户
</div>
<div class="formbox-input">
<input type="text" name="alipay_account" value="{{ $cashaccount->alipay_account }}" placeholder="支付宝账户">
</div>
</div>
<div class="formbox">
<div class="formbox-label">
姓名
</div>
<div class="formbox-input">
<input type="text" name="name" value="{{ $cashaccount->name }}" placeholder="开户人姓名">
</div>
</div>
<div class="formbox">
<div class="formbox-label">
支付宝收款二维码
</div>
<div class="formbox-file-margin">
<div class="formbox-file">
<input type="hidden" id="storage" name="alipay_account_code" value="{{ $cashaccount->alipay_account_code }}">
<input type="file" id="file" accept="image/*">
<span id="show" class="formbox-input-img" style="background-image:url(/storage{{ $cashaccount->alipay_account_code }})"></span>
</div>
<span class="ce-text-c worksFile-btn">上传支付宝收款二维码</span>
</div>
</div>
@csrf
@method('put')
<div class="withdrawForm-btn ajax-post">
修改信息
</div>
</form>
</div>
</section>
@endsection
@section('script')
<script src="{{ asset('assets/agent/js/lrz.all.bundle.js') }}"></script>
<script type="text/javascript">
// 图片上传
$('#show').click(function(event){
$('#file').click();
});
$('#file').change(function(event){
console.log(event);
var $this = $(this);
lrz(this.files[0], {
width: 640,
fieldName: 'image'
}).then(function(rst) {
$('#show').attr('style', 'background-image:url(' + rst.base64 + ')');
return rst;
}).then(function(rst) {
var xhr = new XMLHttpRequest();
xhr.open('POST', "{{ route('Agent.storages.index') }}?_token={{ csrf_token() }}", true);
xhr.onload = function () {
var data = $.parseJSON(xhr.responseText);
if (data.code == 1) {
$('#storage').val(data.path);
} else {
updateAlert(data.message);
}
};
xhr.onerror = function () {
};
xhr.send(rst.formData);
return rst;
}).catch(function (err) {
updateAlert(err);
}).always(function () {
// 不管是成功失败,这里都会执行
});
});
</script>
@endsection