From bbe88f00d4d1b57e60bbea776c01d1a3bc029bb2 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 9 May 2019 17:48:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=B1=E5=8C=85=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E9=92=A9?= =?UTF-8?q?=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Ueditor.php | 220 ++++++++++++------ .../view/wallet/index/cash/authinfo.html | 1 + .../view/wallet/index/cash/createinfo.html | 76 +++--- .../plugins/view/wallet/index/cash/index.html | 28 ++- application/plugins/wallet/index/Cash.php | 7 +- .../plugins/wallet/service/CashService.php | 4 +- 6 files changed, 219 insertions(+), 117 deletions(-) diff --git a/application/admin/controller/Ueditor.php b/application/admin/controller/Ueditor.php index 7727765d8..dffbd7b9f 100755 --- a/application/admin/controller/Ueditor.php +++ b/application/admin/controller/Ueditor.php @@ -10,6 +10,8 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; +use think\facade\Hook; + /** * 百度编辑器控制器入口 * @author Devil @@ -130,6 +132,14 @@ class Ueditor extends Common $path = input('path'); if(!empty($path)) { + // 附件删除前处理钩子 + $hook_name = 'plugins_controller_attachment_delete_handle_begin'; + Hook::listen($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'path' => &$path, + ]); + $path = (__MY_ROOT_PUBLIC__ == '/') ? substr(ROOT_PATH, 0, -1).$path : str_replace(__MY_ROOT_PUBLIC__, ROOT_PATH, $path); if(file_exists($path)) { @@ -137,6 +147,14 @@ class Ueditor extends Common { if(unlink($path)) { + // 附件删除成功后处理钩子 + $hook_name = 'plugins_controller_attachment_delete_handle_end'; + Hook::listen($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'path' => $path, + ]); + $this->current_result = json_encode(array( 'state'=> 'SUCCESS' )); @@ -171,7 +189,7 @@ class Ueditor extends Common */ private function ActionUpload() { - $type = "file"; + $attachment_type = "file"; switch(htmlspecialchars($this->current_action)) { case 'uploadimage': @@ -181,7 +199,7 @@ class Ueditor extends Common "allowFiles" => $this->current_config['imageAllowFiles'] ); $field_name = $this->current_config['imageFieldName']; - $type = "image"; + $attachment_type = "image"; break; case 'uploadscrawl': @@ -192,7 +210,7 @@ class Ueditor extends Common "oriName" => "scrawl.png" ); $field_name = $this->current_config['scrawlFieldName']; - $type = "base64"; + $attachment_type = "base64"; break; case 'uploadvideo': @@ -202,7 +220,7 @@ class Ueditor extends Common "allowFiles" => $this->current_config['videoAllowFiles'] ); $field_name = $this->current_config['videoFieldName']; - $type = "video"; + $attachment_type = "video"; break; case 'uploadfile': @@ -213,11 +231,21 @@ class Ueditor extends Common "allowFiles" => $this->current_config['fileAllowFiles'] ); $field_name = $this->current_config['fileFieldName']; - $type = "file"; + $attachment_type = "file"; } + // 附件上传前处理钩子 + $hook_name = 'plugins_controller_attachment_upload_handle_begin'; + Hook::listen($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'attachment_type' => $attachment_type, + 'field_name' => $field_name, + 'temp_config' => &$temp_config, + ]); + /* 生成上传实例对象并完成上传 */ - $up = new \base\Uploader($field_name, $temp_config, $type); + $up = new \base\Uploader($field_name, $temp_config, $attachment_type); /** * 得到上传文件所对应的各个参数,数组结构 @@ -230,9 +258,21 @@ class Ueditor extends Common * "size" => "", //文件大小 * ) */ + $data = $up->getFileInfo(); + + // 附件上传成功后处理钩子 + $hook_name = 'plugins_controller_attachment_upload_handle_end'; + Hook::listen($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'attachment_type' => $attachment_type, + 'field_name' => $field_name, + 'temp_config' => $temp_config, + 'data' => &$data, + ]); // 返回数据 - $this->current_result = json_encode($up->getFileInfo()); + $this->current_result = json_encode($data); } /** @@ -275,36 +315,115 @@ class Ueditor extends Common $end = $start + $size; /* 获取文件列表 */ - $path = GetDocumentRoot() . (substr($path, 0, 1) == "/" ? "":"/") . $path; - $files = $this->GetFilesList($path, $allow_files); + $data = array( + "state" => "no match file", + "list" => array(), + "start" => $start, + "total" => 0, + ); + + // 是否从磁盘获取数据 0否, 1是 + $is_disk_get = 1; + + // 附件列表获取处理钩子 + $hook_name = 'plugins_controller_attachment_get_list_handle'; + Hook::listen($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'is_disk_get' => &$is_disk_get, + 'data' => &$data, + ]); + + // 是否从磁盘获取数据 + if($is_disk_get == 1) + { + $path = GetDocumentRoot() . (substr($path, 0, 1) == "/" ? "":"/") . $path; + $this->GetFilesList($path, $allow_files, $size, $start, $end, $data); + } + + /* 返回数据 */ + $this->current_result = json_encode($data); + } + + /** + * [GetFilesList 获取目录下的指定类型的文件] + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2017-01-17T23:24:59+0800 + * @param [string] $path [路径地址] + * @param [string] $allow_files [允许的文件] + * @param [int] $size [条数] + * @param [int] $start [起始] + * @param [int] $end [结束标记] + * @param [array] $data [返回数据] + * @return [array] [数据] + */ + private function GetFilesList($path, $allow_files, $size, $start, $end, &$data) + { + // 从磁盘获取文件 + $files = $this->GetDirFilesList($path, $allow_files, $files); // 倒序 //$files = $this->ArrayQuickSort($files); - if (!count($files)) { - $this->current_result = json_encode(array( - "state" => "no match file", - "list" => array(), + if(count($files) > 0) + { + /* 获取指定范围的列表 */ + $len = count($files); + $list = []; + for ($i = min($end, $len) - 1; $i < $len && $i >= 0 && $i >= $start; $i--) + { + $list[] = $files[$i]; + } + + /* 返回数据 */ + $data = array( + "state" => "SUCCESS", + "list" => $list, "start" => $start, "total" => count($files) - )); + ); } + } - /* 获取指定范围的列表 */ - $len = count($files); - $list = []; - for ($i = min($end, $len) - 1; $i < $len && $i >= 0 && $i >= $start; $i--) + /** + * 遍历获取目录下的指定类型的文件 + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2017-01-17T23:24:59+0800 + * @param [string] $path [路径地址] + * @param [string] $allow_files [允许的文件] + * @param [array] &$files [数据] + * @return [array] [数据] + */ + private function GetDirFilesList($path, $allow_files, &$files = array()) + { + if(!is_dir($path)) return null; + if(substr($path, strlen($path) - 1) != '/') $path .= '/'; + $handle = opendir($path); + $document_root = GetDocumentRoot(); + while(false !== ($file = readdir($handle))) { - $list[] = $files[$i]; + if($file != '.' && $file != '..') + { + $path2 = $path . $file; + if(is_dir($path2)) + { + $this->GetDirFilesList($path2, $allow_files, $files); + } else { + if(preg_match("/\.(".$allow_files.")$/i", $file)) + { + $files[] = array( + 'url'=> substr($path2, strlen($document_root)), + 'mtime'=> filemtime($path2) + ); + } + } + } } - - /* 返回数据 */ - $this->current_result = json_encode(array( - "state" => "SUCCESS", - "list" => $list, - "start" => $start, - "total" => count($files) - )); + return $files; } /** @@ -343,45 +462,6 @@ class Ueditor extends Common } } - /** - * [GetFilesList 遍历获取目录下的指定类型的文件] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-01-17T23:24:59+0800 - * @param [string] $path [路径地址] - * @param [string] $allow_files [允许的文件] - * @param [array] &$files [数据] - * @return [array] [数据] - */ - private function GetFilesList($path, $allow_files, &$files = array()) - { - if(!is_dir($path)) return null; - if(substr($path, strlen($path) - 1) != '/') $path .= '/'; - $handle = opendir($path); - $document_root = GetDocumentRoot(); - while(false !== ($file = readdir($handle))) - { - if($file != '.' && $file != '..') - { - $path2 = $path . $file; - if(is_dir($path2)) - { - $this->GetFilesList($path2, $allow_files, $files); - } else { - if(preg_match("/\.(".$allow_files.")$/i", $file)) - { - $files[] = array( - 'url'=> substr($path2, strlen($document_root)), - 'mtime'=> filemtime($path2) - ); - } - } - } - } - return $files; - } - /** * [ActionCrawler 抓取远程文件] * @author Devil @@ -416,6 +496,14 @@ class Ueditor extends Common )); } + // 附件抓取远程文件取结束处理钩子 + $hook_name = 'plugins_controller_attachment_crawler_handle_end'; + Hook::listen($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'list' => &$list, + ]); + /* 返回抓取数据 */ $this->current_result = json_encode(array( 'state'=> count($list) ? 'SUCCESS':'ERROR', diff --git a/application/plugins/view/wallet/index/cash/authinfo.html b/application/plugins/view/wallet/index/cash/authinfo.html index e6806e141..605dbb73a 100644 --- a/application/plugins/view/wallet/index/cash/authinfo.html +++ b/application/plugins/view/wallet/index/cash/authinfo.html @@ -35,6 +35,7 @@
  • 3. 如果您的手机已失效,可以 绑定邮箱 后通过接收邮件完成验证。
  • 4. 请正确输入下方图形验证码,如看不清可点击图片进行更换,输入完成后进行下一步操作。
  • 5. 收到安全验证码后,请在{{:Myc('common_verify_expire_time', 600, true)/60}}分钟内完成验证。
  • +
  • 6. 安全验证成功后,请在30分钟内完成提现申请。
  • diff --git a/application/plugins/view/wallet/index/cash/createinfo.html b/application/plugins/view/wallet/index/cash/createinfo.html index 8cd290514..590bdbdb3 100644 --- a/application/plugins/view/wallet/index/cash/createinfo.html +++ b/application/plugins/view/wallet/index/cash/createinfo.html @@ -26,50 +26,54 @@ {{include file="../../../plugins/view/wallet/index/public/nav" /}} - -
    -
    - -
    - - - - + {{if isset($check_status) and $check_status eq 1}} + + +
    + +
    + + + + +
    +
    + 当前可用金额 {{$user_wallet.normal_money}} 元 +
    -
    - 当前可用金额 {{$user_wallet.normal_money}} 元 -
    -
    -
    - - -
    - 强烈建议优先填写国有4大银行(中国银行、中国建设银行、中国工商银行和中国农业银行) 请填写详细的开户银行分行名称,虚拟账户如支付宝、财付通、微信 直接填写 支付宝 即可。 +
    + + +
    + 强烈建议优先填写国有4大银行(中国银行、中国建设银行、中国工商银行和中国农业银行) 请填写详细的开户银行分行名称,虚拟账户如支付宝、财付通、微信 直接填写 支付宝 即可。 +
    -
    -
    - - -
    - 银行账号或虚拟账号(支付宝、财付通等账号) +
    + + +
    + 银行账号或虚拟账号(支付宝、财付通等账号) +
    -
    -
    - - -
    - 收款账号的开户人姓名 +
    + + +
    + 收款账号的开户人姓名 +
    -
    -
    - -
    - - +
    + +
    + + + {{else /}} +
    安全验证已超时,请重新验证再操作 申请提现
    + {{/if}}
    diff --git a/application/plugins/view/wallet/index/cash/index.html b/application/plugins/view/wallet/index/cash/index.html index 30745e1f0..92d073513 100755 --- a/application/plugins/view/wallet/index/cash/index.html +++ b/application/plugins/view/wallet/index/cash/index.html @@ -70,13 +70,9 @@ 提现单号 提现金额(元) - 打款金额(元) - 状态 - 收款银行 - 收款账号 - 开户人姓名 + 收款信息 + 打款信息 描述 - 打款时间 创建时间 @@ -86,13 +82,21 @@ {{$v.cash_no}} {{$v.money}} - {{if $v['pay_money'] gt 0}}{{$v.pay_money}}{{/if}} - {{$v.status_text}} - {{$v.bank_name}} - {{$v.bank_accounts}} - {{$v.bank_username}} + + 银行:{{$v.bank_name}}
    + 账号:{{$v.bank_accounts}}
    + 姓名:{{$v.bank_username}}
    + + + {{$v.status_text}}
    + {{if $v['pay_money'] gt 0}} + 金额:{{$v.pay_money}}
    + {{/if}} + {{if !empty($v['pay_time_text'])}} + 时间:{{$v.pay_time_text}} + {{/if}} + {{$v.msg}} - {{$v.pay_time_text}} {{$v.add_time_text}} {{/foreach}} diff --git a/application/plugins/wallet/index/Cash.php b/application/plugins/wallet/index/Cash.php index f1cede716..3296a405a 100644 --- a/application/plugins/wallet/index/Cash.php +++ b/application/plugins/wallet/index/Cash.php @@ -118,6 +118,11 @@ class Cash extends Common */ public function createinfo($params = []) { + // 是否验证成功 + $check_time = session('plugins_wallet_cash_check_success'); + $check_status = (!empty($check_time) && $check_time+1800 >= time()) ? 1 : 0; + $this->assign('check_status', $check_status); + // 参数 $this->assign('params', $params); return $this->fetch('../../../plugins/view/wallet/index/cash/createinfo'); @@ -207,7 +212,7 @@ class Cash extends Common // 开始处理 $params['user'] = $this->user; - return CashService::Create($params); + return CashService::CashCreate($params); } } ?> \ No newline at end of file diff --git a/application/plugins/wallet/service/CashService.php b/application/plugins/wallet/service/CashService.php index cf6cce57b..9374818b1 100644 --- a/application/plugins/wallet/service/CashService.php +++ b/application/plugins/wallet/service/CashService.php @@ -213,7 +213,7 @@ class CashService if($obj->CheckCorrect($params['verify'])) { // 校验成功标记 - session('wallet_cash_'.$params['account_type'], true); + session('plugins_wallet_cash_check_success', time()); // 清除验证码 $obj->Remove(); @@ -232,7 +232,7 @@ class CashService * @desc description * @param [array] $params [输入参数] */ - public static function Create($params = []) + public static function CashCreate($params = []) { // 数据验证 $p = [ -- GitLab