diff --git a/application/admin/controller/Payment.php b/application/admin/controller/Payment.php index 438720d81cb67b9fd14b1e85ed859fda6eac8e5f..fb5974c857369785e5894b0bd0da1a505249d39f 100755 --- a/application/admin/controller/Payment.php +++ b/application/admin/controller/Payment.php @@ -51,9 +51,10 @@ class Payment extends Common public function Index() { // 插件列表 - $this->assign('data_list', PaymentService::PlugPaymentList()); + $ret = PaymentService::PlugPaymentList(); + $this->assign('data_list', $ret['data']); - // 不删除的支付方式 + // 不能删除的支付方式 $this->assign('cannot_deleted_list', PaymentService::$cannot_deleted_list); // 适用平台 @@ -75,7 +76,7 @@ class Payment extends Common public function SaveInfo() { // 参数 - $params = input(); + $params = $this->data_request; // 商品信息 if(!empty($params['id'])) @@ -121,7 +122,7 @@ class Payment extends Common } // 开始操作 - return PaymentService::PaymentUpdate(input()); + return PaymentService::PaymentUpdate($this->data_request); } /** @@ -140,7 +141,7 @@ class Payment extends Common } // 开始操作 - return PaymentService::PaymentStatusUpdate(input()); + return PaymentService::PaymentStatusUpdate($this->data_request); } /** @@ -160,7 +161,7 @@ class Payment extends Common } // 开始操作 - return PaymentService::Install(input()); + return PaymentService::Install($this->data_request); } /** @@ -180,7 +181,7 @@ class Payment extends Common } // 开始操作 - return PaymentService::Uninstall(input()); + return PaymentService::Uninstall($this->data_request); } /** @@ -200,7 +201,7 @@ class Payment extends Common } // 开始操作 - return PaymentService::Delete(input()); + return PaymentService::Delete($this->data_request); } /** @@ -220,7 +221,7 @@ class Payment extends Common } // 开始操作 - return PaymentService::Upload(input()); + return PaymentService::Upload($this->data_request); } } ?> \ No newline at end of file diff --git a/application/admin/form/Payment.php b/application/admin/form/Payment.php new file mode 100644 index 0000000000000000000000000000000000000000..c47455d70b1ca8a9c5afc5ce0a797aa2f46f190e --- /dev/null +++ b/application/admin/form/Payment.php @@ -0,0 +1,104 @@ + [ + 'key_field' => 'payment', + 'status_field' => 'is_enable', + ], + // 表单配置 + 'form' => [ + [ + 'label' => '名称', + 'view_type' => 'field', + 'view_key' => 'name', + ], + [ + 'label' => 'LOGO', + 'view_type' => 'module', + 'view_key' => 'payment/module/logo', + ], + [ + 'label' => '插件版本', + 'view_type' => 'field', + 'view_key' => 'version', + ], + [ + 'label' => '适用版本', + 'view_type' => 'apply_version', + 'view_key' => 'name', + ], + [ + 'label' => '适用终端', + 'view_type' => 'module', + 'view_key' => 'payment/module/apply_terminal', + ], + [ + 'label' => '作者', + 'view_type' => 'module', + 'view_key' => 'payment/module/author', + ], + [ + 'label' => '描述', + 'view_type' => 'field', + 'view_key' => 'desc', + 'grid_size' => 'lg', + ], + [ + 'label' => '是否启用', + 'view_type' => 'module', + 'view_key' => 'payment/module/enable', + 'align' => 'center', + ], + [ + 'label' => '用户开放', + 'view_type' => 'module', + 'view_key' => 'payment/module/open_user', + 'align' => 'center', + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'payment/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Slide.php b/application/admin/form/Slide.php index 93d7797004494c159dab65dd20aee7e78f690771..c27e298cc72c0f1b342411150db721cf267897e0 100644 --- a/application/admin/form/Slide.php +++ b/application/admin/form/Slide.php @@ -102,6 +102,7 @@ class Slide 'label' => '事件值', 'view_type' => 'field', 'view_key' => 'event_value', + 'grid_size' => 'sm', 'search_config' => [ 'form_type' => 'input', 'where_type' => 'like', diff --git a/application/admin/view/default/payment/index.html b/application/admin/view/default/payment/index.html index f60f048a8fe11c9ee33821ae4c22a71b0d90e274..f4634702a9d950f43278688d70bc20b4eccceb1a 100755 --- a/application/admin/view/default/payment/index.html +++ b/application/admin/view/default/payment/index.html @@ -1,171 +1,49 @@ -{{include file="public/header" /}} + +{{extend name="public/module/form" /}} - -
-
- - - - - -
- - - - - - - - - - - - - - - - {{if !empty($data_list)}} - {{foreach $data_list as $v}} - - - - - - - - - - - - {{/foreach}} - {{/if}} - -
名称LOGO适用版本适用终端作者描述是否启用用户开放操作
- {{$v.name}} - {{if !empty($v['version'])}} -

- v {{$v.version}} -

- {{/if}} -
- {{if !empty($v['logo'])}} - - - - {{else /}} - 暂无LOGO - {{/if}} - - {{if empty($v['apply_version'])}}未填写{{else /}}{{$v.apply_version}}{{/if}} - - {{if !empty($v['apply_terminal'])}} - {{foreach $v.apply_terminal as $terminal_k=>$terminal_v}} - {{$common_platform_type[$terminal_v]['name']}} - {{if $terminal_k LT count($v['apply_terminal'])-1}}
{{/if}} - {{/foreach}} - {{else /}} - 未填写 - {{/if}} -
- {{if empty($v['author'])}} - 未填写 - {{else /}} - {{$v.author}} - {{if !empty($v['author_url'])}} - - - - {{/if}} - {{/if}} - - {{if empty($v['desc'])}}未填写{{else /}}{{$v.desc|raw}}{{/if}} - - {{if $v['is_install'] eq 1}} - - {{else /}} - 未安装 - {{/if}} - - {{if $v['is_install'] eq 1}} - - {{else /}} - 未安装 - {{/if}} - -
- {{if $v['is_install'] eq 0}} - - - {{if !in_array($v['payment'], $cannot_deleted_list)}} - - {{/if}} - {{else /}} - - - 编辑 - + +{{block name="form_operate_top"}} + + 更多支付插件下载 + + {__block__} +{{/block}} - - {{/if}} -
-
- {{if empty($data_list)}} -
没有相关数据
- {{/if}} -
- - - -
-
-
-

上传

- × -
-
- -
-
-

- 1 类名必须于文件名一致(去除 .php ),如 Alipay.php 则取 Alipay
- 2 类必须定义三个方法
-     2.1 Config 配置方法
-     2.2 Pay 支付方法
-     2.3 Respond 回调方法
-     2.4 Refund 退款方法(可选) -

-

PS:以上条件不满足则无法查看插件,将插件放入.zip压缩包中、支持一个压缩中包含多个支付插件

-
-
- - -
-
-
- -
-
- -
+ +{{block name="form_extend"}} + +
+
+
+

上传

+ × +
+
+ +
+
+

+ 1 类名必须于文件名一致(去除 .php ),如 Alipay.php 则取 Alipay
+ 2 类必须定义三个方法
+     2.1 Config 配置方法
+     2.2 Pay 支付方法
+     2.3 Respond 回调方法
+     2.4 Refund 退款方法(可选) +

+

PS:以上条件不满足则无法查看插件,将插件放入.zip压缩包中、支持一个压缩中包含多个支付插件

+
+
+ + +
+
+
+ +
+
+
-
-
- - - -{{include file="public/footer" /}} - \ No newline at end of file + +{{/block}} \ No newline at end of file diff --git a/application/admin/view/default/payment/module/apply_terminal.html b/application/admin/view/default/payment/module/apply_terminal.html new file mode 100644 index 0000000000000000000000000000000000000000..df47fbbcfdce5621427dfdd093d6fcf28d1d0ba6 --- /dev/null +++ b/application/admin/view/default/payment/module/apply_terminal.html @@ -0,0 +1,6 @@ + +{{if !empty($module_data['apply_terminal']) and is_array($module_data['apply_terminal'])}} + {{foreach $module_data.apply_terminal as $terminal_k=>$terminal_v}} +

{{$common_platform_type[$terminal_v]['name']}}

+ {{/foreach}} +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/payment/module/author.html b/application/admin/view/default/payment/module/author.html new file mode 100644 index 0000000000000000000000000000000000000000..875e0e2e9b5ac106ee38d9783b9acedb5297e5f7 --- /dev/null +++ b/application/admin/view/default/payment/module/author.html @@ -0,0 +1,9 @@ + +{{if !empty($module_data)}} + {{$module_data.author}} + {{if !empty($module_data['author_url'])}} + + + + {{/if}} +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/payment/module/enable.html b/application/admin/view/default/payment/module/enable.html new file mode 100644 index 0000000000000000000000000000000000000000..b7f40e605cac287effb9943ef32017b70fb33c2d --- /dev/null +++ b/application/admin/view/default/payment/module/enable.html @@ -0,0 +1,3 @@ +{{if !empty($module_data) and isset($module_data['is_install']) and $module_data['is_install'] eq 1}} + +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/payment/module/logo.html b/application/admin/view/default/payment/module/logo.html new file mode 100644 index 0000000000000000000000000000000000000000..4fb28f021cf4e9b996a8102d84223db203c1210f --- /dev/null +++ b/application/admin/view/default/payment/module/logo.html @@ -0,0 +1,6 @@ + +{{if !empty($module_data) and !empty($module_data['logo'])}} + + + +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/payment/module/open_user.html b/application/admin/view/default/payment/module/open_user.html new file mode 100644 index 0000000000000000000000000000000000000000..c967bd0347687c9f27d23981aec9b7f4dcec1411 --- /dev/null +++ b/application/admin/view/default/payment/module/open_user.html @@ -0,0 +1,3 @@ +{{if !empty($module_data) and isset($module_data['is_install']) and $module_data['is_install'] eq 1}} + +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/payment/module/operate.html b/application/admin/view/default/payment/module/operate.html new file mode 100644 index 0000000000000000000000000000000000000000..24d4f717e3bb8f574abf8539aae2c526798d30e4 --- /dev/null +++ b/application/admin/view/default/payment/module/operate.html @@ -0,0 +1,24 @@ + +{{if $module_data['is_install'] eq 0}} + + + {{if !in_array($module_data['payment'], $cannot_deleted_list)}} + + {{/if}} +{{else /}} + + + 编辑 + + + +{{/if}} \ No newline at end of file diff --git a/application/service/PaymentService.php b/application/service/PaymentService.php index ea66f6b5d48e3f223d07a8bad956a836f5b0d810..8d1e198ca113273b3f9fb262c8f8ed48f2151a44 100755 --- a/application/service/PaymentService.php +++ b/application/service/PaymentService.php @@ -77,6 +77,7 @@ class PaymentService { if($dh = opendir(self::$payment_dir)) { + $common_platform_type = lang('common_platform_type'); while(($temp_file = readdir($dh)) !== false) { if(substr($temp_file, 0, 1) != '.') @@ -99,10 +100,24 @@ class PaymentService $temp['id'] = $db_config[0]['id']; $temp['name'] = $db_config[0]['name']; $temp['logo'] = $db_config[0]['logo']; - $temp['apply_terminal'] = $db_config[0]['apply_terminal']; $temp['config'] = $db_config[0]['config']; $temp['is_enable'] = $db_config[0]['is_enable']; $temp['is_open_user'] = $db_config[0]['is_open_user']; + + // 支付平台类型 + $apply_terminal_names = []; + if(!empty($db_config[0]['apply_terminal']) && is_array($db_config[0]['apply_terminal'])) + { + foreach($common_platform_type as $platform_type) + { + if(in_array($platform_type['value'], $db_config[0]['apply_terminal'])) + { + $apply_terminal_names[] = $platform_type['name']; + } + } + } + $temp['apply_terminal_names'] = $apply_terminal_names; + $temp['apply_terminal'] = $db_config[0]['apply_terminal']; } $data[] = $temp; } @@ -111,7 +126,7 @@ class PaymentService closedir($dh); } } - return $data; + return DataReturn('success', 0, $data); } /** diff --git a/public/static/index/default/css/goods.css b/public/static/index/default/css/goods.css index a56a131019c457485f87681c95657ce618b645b8..e2bf1294baa47abda5ae36f86fc57313fccbf768 100755 --- a/public/static/index/default/css/goods.css +++ b/public/static/index/default/css/goods.css @@ -82,7 +82,7 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;} .score-container .am-progress { width: calc(100% - 105px); margin-bottom: 0; margin-top: 18px; line-height: 2rem; text-align: center; } /*详情*/ -.detail-content img { max-width: 100%; } +.detail-content img { max-width: 100%; height: auto; } @media only screen and (min-width:640px) { .theme-span{height:0px;background:#fff ;}