平台币线下充值功能修改

master
zhengchanglong 5 years ago
parent 7afc18daae
commit 234151a9ce

@ -128,22 +128,27 @@ class CoinOrderController extends BaseController
$data['order_status'] = 0;
}else{
$data['pay_amount'] = $coin_num;
$collection_account = I("collection_account");
$collection_account = I("collection_account","");
$pay_order_number = I("pay_order_number");
if($collection_account==''){
/*if($collection_account==''){
$this->ajaxReturn(['status'=>0,'info'=>'请选择汇入银行','time'=>1000],"JSON");
}
}*/
if($pay_order_number==''){
$this->ajaxReturn(['status'=>0,'info'=>'请输入支付凭证','time'=>1000],"JSON");
}
$res = $this->upload();
//$res = $this->upload();
$res = $this->uploadPicture();
if($res['status']==0){
$this->ajaxReturn(['status'=>0,'info'=>'请选择支付截图','time'=>1000],"JSON");
}
if($res['error']==1){
$this->ajaxReturn(['status'=>0,'info'=>$res['msg'],'time'=>1000],"JSON");
}
$data['collection_account'] = $collection_account;
$data['pay_order_number'] = $pay_order_number;
$data['remark'] = I("remark");
$data['voucher_img'] = $res['path'];
$data['voucher_img'] = $res['id'];
$data['order_status'] = 2;
$data['pay_way'] = 3;
}
@ -366,12 +371,16 @@ class CoinOrderController extends BaseController
return $ret;
}
public function upload(){
header("content-type:text/html;charset=utf-8");
//设置时区
#date_default_timezone_set('PRC');
//获取文件名
$filename = $_FILES['file']['name'];
if(!$filename){
return array("error"=>1,"msg"=>"请选择支付截图");
}
//获取文件临时路径
$temp_name = $_FILES['file']['tmp_name'];
//获取大小
@ -408,6 +417,36 @@ class CoinOrderController extends BaseController
}
}
/**
* 上传图片
* @author huajie <banhuajie@163.com>
*/
public function uploadPicture(){
/* 返回标准数据 */
$result = array('status' => 1, 'info' => '上传成功', 'data' => '');
/* 调用文件上传组件上传文件 */
$Picture = D('Picture');
$pic_driver = C('PICTURE_UPLOAD_DRIVER');
$info = $Picture->upload(
$_FILES,
C('PICTURE_UPLOAD'),
C('PICTURE_UPLOAD_DRIVER'),
C("UPLOAD_{$pic_driver}_CONFIG")
); //TODO:上传到远程服务器
/* 记录图片信息 */
if($info){
$result['status'] = 1;
$result = array_merge($info['voucher_img'], $result);
} else {
$result['status'] = 0;
$result['info'] = $Picture->getError();
}
ob_clean();
return $result;
}
public function echo_pay_qrcode($trade_no,$real_amont,$pay_amount,$qrcode_url,$type='1'){
if($type==1){
$tips = '请使用支付宝扫描二维码以完成支付';

@ -65,7 +65,7 @@
<select class="reselect select_gallery" name="collection_account">
<option value="" title="暂未开放 暂未开放" acountesc="">暂未开放 暂未开放</option>
<volist name="bank_list" id="bank">
<option value="{$bank.bank_account}" title="{$bank.bank}" acountesc="账户名称:{$bank.bank_name}<br/>汇入账户:{$bank.bank_account}<br/>开户行:{$bank.bank_name}">{$bank.bank}</option>
<option value="{$bank.bank_account}" title="{$bank.bank}" acountesc="账户名称:{$bank.account_name}<br/>汇入账户:{$bank.bank_account}<br/>开户行:{$bank.bank_name}">{$bank.bank}</option>
</volist>
</select>
<div id="acountesc"></div>
@ -165,7 +165,7 @@
function save_model() {
var formElement = document.querySelector("#payform");
var formData = new FormData(formElement);
formData.append("file",$("input[name=voucher_img]")[0].files[0])
formData.append("voucher_img",$("input[name=voucher_img]")[0].files[0])
jQuery.ajax({
type: 'POST',
url:'index.php?s=/Home/CoinOrder/order_add.html',
@ -177,13 +177,14 @@
contentType: false, //必须
success: function (result) {
if (result.status==1){
location.reload();
if(result.pay_type==1){
//op_w('index.php?s=/Home/CoinOrder/pay_center.html&trade_no='+result.trade_no)
window.open('index.php?s=/Home/CoinOrder/pay_center.html&trade_no='+result.trade_no,"_blank");
/*$.ajax().then(res=>{
box.location = res
})*/
location.reload();
}else{
layer.alert(result.info,function () {
parent.layer.closeAll();
location.reload();
});
}
}else{
layer.alert(result.info);

@ -159,6 +159,16 @@
</div>
</div>
</div>
<if condition="$order_info.pay_type eq 2">
<div class="tab detailed-box">
<div class="tr">
<label class="detailed-title detailed-label">支付截图:</label>
<div class="detailed-content-box">
<span><img src="{$order_info.voucher_img|get_cover='path'}" height="auto" width="250px" style="cursor: pointer" onclick="javascript:window.open('{$order_info.voucher_img|get_cover=\'path\'}','_blank')"></span>
</div>
</div>
</div>
</if>
<if condition="$order_info.pay_type eq 2">
<div class="tab detailed-box">
<div class="tr">

Loading…
Cancel
Save