From 0c8c249fceceb93fe5a12c5ed03d3d495561583a Mon Sep 17 00:00:00 2001 From: devil Date: Tue, 22 Sep 2020 18:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=94=AF=E4=BB=98=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/view/default/site/siteset.html | 19 +- application/index/form/Order.php | 679 +++++++++--------- .../index/view/default/order/index.html | 5 +- application/service/BaseService.php | 3 + application/service/OrderCurrencyService.php | 5 +- application/service/OrderService.php | 3 + extend/payment/IEPayAliPay.php | 377 ++++++++++ extend/payment/IEPayWeixin.php | 477 ++++++++++++ .../alipay/pages/user-order/user-order.axml | 4 +- .../alipay/pages/user-order/user-order.js | 17 + .../baidu/pages/user-order/user-order.js | 19 +- .../baidu/pages/user-order/user-order.swan | 4 +- sourcecode/qq/pages/user-order/user-order.js | 17 + sourcecode/qq/pages/user-order/user-order.qml | 4 +- .../toutiao/pages/user-order/user-order.js | 46 +- .../toutiao/pages/user-order/user-order.ttml | 4 +- sourcecode/weixin/app.js | 2 +- .../weixin/pages/user-order/user-order.js | 17 + .../weixin/pages/user-order/user-order.wxml | 4 +- 19 files changed, 1336 insertions(+), 370 deletions(-) create mode 100644 extend/payment/IEPayAliPay.php create mode 100644 extend/payment/IEPayWeixin.php diff --git a/application/admin/view/default/site/siteset.html b/application/admin/view/default/site/siteset.html index 1098e3860..0f6b330b3 100644 --- a/application/admin/view/default/site/siteset.html +++ b/application/admin/view/default/site/siteset.html @@ -152,7 +152,24 @@ - + + +
+
+

订单

+
+
+
+ + +
+
+
+
diff --git a/application/index/form/Order.php b/application/index/form/Order.php index e0eed4995..3d4ab47a9 100644 --- a/application/index/form/Order.php +++ b/application/index/form/Order.php @@ -58,342 +58,351 @@ class Order */ public function Run($params = []) { + // 基础配置 + $base = [ + 'key_field' => 'id', + 'is_search' => 1, + 'search_url' => MyUrl('index/order/index'), + 'detail_title' => '基础信息', + 'is_middle' => 0, + ]; + + // 表单配置 + $form = [ + [ + 'label' => '基础信息', + 'view_type' => 'module', + 'view_key' => 'order/module/goods', + 'grid_size' => 'xl', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'id', + 'where_type' => 'like', + 'where_type_custom' => 'in', + 'where_value_custom' => 'WhereBaseGoodsInfo', + 'placeholder' => '请输入订单号/商品名称/型号', + ], + ], + [ + 'label' => '订单状态', + 'view_type' => 'field', + 'view_key' => 'status', + 'view_data_key' => 'name', + 'view_data' => lang('common_order_user_status'), + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_order_user_status'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '支付状态', + 'view_type' => 'module', + 'view_key' => 'order/module/pay_status', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'pay_status', + 'where_type' => 'in', + 'data' => lang('common_order_pay_status'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '总价(元)', + 'view_type' => 'field', + 'view_key' => 'total_price', + 'search_config' => [ + 'form_type' => 'section', + 'is_point' => 1, + ], + ], + [ + 'label' => '支付金额(元)', + 'view_type' => 'field', + 'view_key' => 'pay_price', + 'search_config' => [ + 'form_type' => 'section', + 'is_point' => 1, + ], + ], + [ + 'label' => '单价(元)', + 'view_type' => 'field', + 'view_key' => 'price', + 'search_config' => [ + 'form_type' => 'section', + 'is_point' => 1, + ], + ], + [ + 'label' => '订单模式', + 'view_type' => 'field', + 'view_key' => 'order_model', + 'view_data_key' => 'name', + 'view_data' => lang('common_site_type_list'), + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_site_type_list'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '下单平台', + 'view_type' => 'field', + 'view_key' => 'client_type', + 'view_data_key' => 'name', + 'view_data' => lang('common_platform_type'), + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_platform_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '地址信息', + 'view_type' => 'module', + 'view_key' => 'order/module/address', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'id', + 'where_type' => 'like', + 'where_type_custom' => 'in', + 'where_value_custom' => 'WhereValueAddressInfo', + ], + ], + [ + 'label' => '取货信息', + 'view_type' => 'module', + 'view_key' => 'order/module/take', + 'width' => 125, + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'id', + 'where_type' => 'like', + 'where_type_custom' => 'in', + 'where_value_custom' => 'WhereValueTakeInfo', + ], + ], + [ + 'label' => '退款金额(元)', + 'view_type' => 'field', + 'view_key' => 'refund_price', + 'search_config' => [ + 'form_type' => 'section', + 'is_point' => 1, + ], + ], + [ + 'label' => '退货数量', + 'view_type' => 'field', + 'view_key' => 'returned_quantity', + 'search_config' => [ + 'form_type' => 'section', + ], + ], + [ + 'label' => '购买总数', + 'view_type' => 'field', + 'view_key' => 'buy_number_count', + 'search_config' => [ + 'form_type' => 'section', + ], + ], + [ + 'label' => '增加金额(元)', + 'view_type' => 'field', + 'view_key' => 'increase_price', + 'search_config' => [ + 'form_type' => 'section', + 'is_point' => 1, + ], + ], + [ + 'label' => '优惠金额(元)', + 'view_type' => 'field', + 'view_key' => 'preferential_price', + 'search_config' => [ + 'form_type' => 'section', + 'is_point' => 1, + ], + ], + [ + 'label' => '支付方式', + 'view_type' => 'field', + 'view_key' => 'payment_name', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'payment_id', + 'where_type' => 'in', + 'data' => PaymentService::PaymentList(), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '留言信息', + 'view_type' => 'field', + 'view_key' => 'user_note', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'like', + ], + ], + [ + 'label' => '扩展信息', + 'view_type' => 'module', + 'view_key' => 'order/module/extension', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'extension_data', + 'where_type' => 'like', + ], + ], + [ + 'label' => '快递公司', + 'view_type' => 'field', + 'view_key' => 'express_name', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'express_id', + 'data' => ExpressService::ExpressList(), + 'where_type' => 'in', + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '快递单号', + 'view_type' => 'field', + 'view_key' => 'express_number', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '是否评论', + 'view_type' => 'module', + 'view_key' => 'order/module/is_comments', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'form_name' => 'user_is_comments', + 'data' => lang('common_is_text_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'where_type_custom' => 'WhereTypyUserIsComments', + 'where_value_custom' => 'WhereValueUserIsComments', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '确认时间', + 'view_type' => 'field', + 'view_key' => 'confirm_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '支付时间', + 'view_type' => 'field', + 'view_key' => 'pay_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '发货时间', + 'view_type' => 'field', + 'view_key' => 'delivery_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '完成时间', + 'view_type' => 'field', + 'view_key' => 'collect_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '取消时间', + 'view_type' => 'field', + 'view_key' => 'cancel_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '关闭时间', + 'view_type' => 'field', + 'view_key' => 'close_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'add_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '更新时间', + 'view_type' => 'field', + 'view_key' => 'upd_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'order/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ]; + + // 是否启用订单批量支付 + if(MyC('home_is_enable_order_bulk_pay') == 1) + { + array_unshift($form, [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'not_show_key' => 'status', + 'not_show_data' => [0,2,3,4,5,6], + 'align' => 'center', + 'width' => 80, + 'view_key' => 'order_form_checkbox_value', + ]); + } + return [ - // 基础配置 - 'base' => [ - 'key_field' => 'id', - 'is_search' => 1, - 'search_url' => MyUrl('index/order/index'), - 'detail_title' => '基础信息', - 'is_middle' => 0, - ], - // 表单配置 - 'form' => [ - [ - 'view_type' => 'checkbox', - 'is_checked' => 0, - 'checked_text' => '反选', - 'not_checked_text' => '全选', - 'not_show_key' => 'status', - 'not_show_data' => [0,2,3,4,5,6], - 'align' => 'center', - 'width' => 80, - 'view_key' => 'order_form_checkbox_value', - ], - [ - 'label' => '基础信息', - 'view_type' => 'module', - 'view_key' => 'order/module/goods', - 'grid_size' => 'xl', - 'search_config' => [ - 'form_type' => 'input', - 'form_name' => 'id', - 'where_type' => 'like', - 'where_type_custom' => 'in', - 'where_value_custom' => 'WhereBaseGoodsInfo', - 'placeholder' => '请输入订单号/商品名称/型号', - ], - ], - [ - 'label' => '订单状态', - 'view_type' => 'field', - 'view_key' => 'status', - 'view_data_key' => 'name', - 'view_data' => lang('common_order_user_status'), - 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'in', - 'data' => lang('common_order_user_status'), - 'data_key' => 'id', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '支付状态', - 'view_type' => 'module', - 'view_key' => 'order/module/pay_status', - 'search_config' => [ - 'form_type' => 'select', - 'form_name' => 'pay_status', - 'where_type' => 'in', - 'data' => lang('common_order_pay_status'), - 'data_key' => 'id', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '总价(元)', - 'view_type' => 'field', - 'view_key' => 'total_price', - 'search_config' => [ - 'form_type' => 'section', - 'is_point' => 1, - ], - ], - [ - 'label' => '支付金额(元)', - 'view_type' => 'field', - 'view_key' => 'pay_price', - 'search_config' => [ - 'form_type' => 'section', - 'is_point' => 1, - ], - ], - [ - 'label' => '单价(元)', - 'view_type' => 'field', - 'view_key' => 'price', - 'search_config' => [ - 'form_type' => 'section', - 'is_point' => 1, - ], - ], - [ - 'label' => '订单模式', - 'view_type' => 'field', - 'view_key' => 'order_model', - 'view_data_key' => 'name', - 'view_data' => lang('common_site_type_list'), - 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'in', - 'data' => lang('common_site_type_list'), - 'data_key' => 'value', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '下单平台', - 'view_type' => 'field', - 'view_key' => 'client_type', - 'view_data_key' => 'name', - 'view_data' => lang('common_platform_type'), - 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'in', - 'data' => lang('common_platform_type'), - 'data_key' => 'value', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '地址信息', - 'view_type' => 'module', - 'view_key' => 'order/module/address', - 'grid_size' => 'sm', - 'search_config' => [ - 'form_type' => 'input', - 'form_name' => 'id', - 'where_type' => 'like', - 'where_type_custom' => 'in', - 'where_value_custom' => 'WhereValueAddressInfo', - ], - ], - [ - 'label' => '取货信息', - 'view_type' => 'module', - 'view_key' => 'order/module/take', - 'width' => 125, - 'search_config' => [ - 'form_type' => 'input', - 'form_name' => 'id', - 'where_type' => 'like', - 'where_type_custom' => 'in', - 'where_value_custom' => 'WhereValueTakeInfo', - ], - ], - [ - 'label' => '退款金额(元)', - 'view_type' => 'field', - 'view_key' => 'refund_price', - 'search_config' => [ - 'form_type' => 'section', - 'is_point' => 1, - ], - ], - [ - 'label' => '退货数量', - 'view_type' => 'field', - 'view_key' => 'returned_quantity', - 'search_config' => [ - 'form_type' => 'section', - ], - ], - [ - 'label' => '购买总数', - 'view_type' => 'field', - 'view_key' => 'buy_number_count', - 'search_config' => [ - 'form_type' => 'section', - ], - ], - [ - 'label' => '增加金额(元)', - 'view_type' => 'field', - 'view_key' => 'increase_price', - 'search_config' => [ - 'form_type' => 'section', - 'is_point' => 1, - ], - ], - [ - 'label' => '优惠金额(元)', - 'view_type' => 'field', - 'view_key' => 'preferential_price', - 'search_config' => [ - 'form_type' => 'section', - 'is_point' => 1, - ], - ], - [ - 'label' => '支付方式', - 'view_type' => 'field', - 'view_key' => 'payment_name', - 'search_config' => [ - 'form_type' => 'select', - 'form_name' => 'payment_id', - 'where_type' => 'in', - 'data' => PaymentService::PaymentList(), - 'data_key' => 'id', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '留言信息', - 'view_type' => 'field', - 'view_key' => 'user_note', - 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'like', - ], - ], - [ - 'label' => '扩展信息', - 'view_type' => 'module', - 'view_key' => 'order/module/extension', - 'grid_size' => 'sm', - 'search_config' => [ - 'form_type' => 'input', - 'form_name' => 'extension_data', - 'where_type' => 'like', - ], - ], - [ - 'label' => '快递公司', - 'view_type' => 'field', - 'view_key' => 'express_name', - 'search_config' => [ - 'form_type' => 'select', - 'form_name' => 'express_id', - 'data' => ExpressService::ExpressList(), - 'where_type' => 'in', - 'data_key' => 'id', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '快递单号', - 'view_type' => 'field', - 'view_key' => 'express_number', - 'search_config' => [ - 'form_type' => 'input', - 'where_type' => 'like', - ], - ], - [ - 'label' => '是否评论', - 'view_type' => 'module', - 'view_key' => 'order/module/is_comments', - 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'in', - 'form_name' => 'user_is_comments', - 'data' => lang('common_is_text_list'), - 'data_key' => 'id', - 'data_name' => 'name', - 'where_type_custom' => 'WhereTypyUserIsComments', - 'where_value_custom' => 'WhereValueUserIsComments', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '确认时间', - 'view_type' => 'field', - 'view_key' => 'confirm_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '支付时间', - 'view_type' => 'field', - 'view_key' => 'pay_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '发货时间', - 'view_type' => 'field', - 'view_key' => 'delivery_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '完成时间', - 'view_type' => 'field', - 'view_key' => 'collect_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '取消时间', - 'view_type' => 'field', - 'view_key' => 'cancel_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '关闭时间', - 'view_type' => 'field', - 'view_key' => 'close_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '创建时间', - 'view_type' => 'field', - 'view_key' => 'add_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '更新时间', - 'view_type' => 'field', - 'view_key' => 'upd_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '操作', - 'view_type' => 'operate', - 'view_key' => 'order/module/operate', - 'align' => 'center', - 'fixed' => 'right', - ], - ], + 'base' => $base, + 'form' => $form, ]; } diff --git a/application/index/view/default/order/index.html b/application/index/view/default/order/index.html index 67378ba7e..7b317d620 100755 --- a/application/index/view/default/order/index.html +++ b/application/index/view/default/order/index.html @@ -3,7 +3,10 @@ {{block name="form_operate_top"}} - + + {{if MyC('home_is_enable_order_bulk_pay') eq 1}} + + {{/if}} {__block__} {{/block}} diff --git a/application/service/BaseService.php b/application/service/BaseService.php index 772e0da8c..b47071952 100644 --- a/application/service/BaseService.php +++ b/application/service/BaseService.php @@ -55,6 +55,9 @@ class BaseService 'common_user_is_mandatory_bind_mobile'=> (int) MyC('common_user_is_mandatory_bind_mobile', 0), 'common_user_is_onekey_bind_mobile' => (int) MyC('common_user_is_onekey_bind_mobile', 0), + // 订单相关 + 'home_is_enable_order_bulk_pay' => (int) MyC('home_is_enable_order_bulk_pay', 0), + // 用户中心相关 'common_user_center_notice' => MyC('common_user_center_notice', null, true), 'common_app_is_head_vice_nav' => (int) MyC('common_app_is_head_vice_nav', 0), diff --git a/application/service/OrderCurrencyService.php b/application/service/OrderCurrencyService.php index 70a500f2f..38ce8e344 100644 --- a/application/service/OrderCurrencyService.php +++ b/application/service/OrderCurrencyService.php @@ -60,17 +60,20 @@ class OrderCurrencyService * @date 2020-09-17 * @desc description * @param [array|int] $order_ids [订单id] + * @return [array] [货币数据、参数是多个id则返回二维数组,一个id则返回一维数组] */ public static function OrderCurrencyGroupList($order_ids) { $data = Db::name('OrderCurrency')->where(['order_id'=>$order_ids])->select(); $result = []; - if(!empty($data)) + if(!empty($data) && is_array($order_ids) && count($order_ids) > 1) { foreach($data as $v) { $result[$v['order_id']] = $v; } + } else { + $result = isset($data[0]) ? $data[0] : []; } return $result; } diff --git a/application/service/OrderService.php b/application/service/OrderService.php index bb75d2236..39fd630ca 100755 --- a/application/service/OrderService.php +++ b/application/service/OrderService.php @@ -224,6 +224,9 @@ class OrderService $pay_data = [ 'user' => $params['user'], 'out_user' => md5($params['user']['id']), + 'business_type' => 'system-order', + 'business_ids' => $order_ids, + 'business_nos' => $order_nos, 'order_id' => $pay_log['data']['id'], 'order_no' => $pay_log['data']['log_no'], 'name' => '订单支付', diff --git a/extend/payment/IEPayAliPay.php b/extend/payment/IEPayAliPay.php new file mode 100644 index 000000000..08a33f71e --- /dev/null +++ b/extend/payment/IEPayAliPay.php @@ -0,0 +1,377 @@ +config = $params; + } + + /** + * 配置信息 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-19 + * @desc description + */ + public function Config() + { + // 基础信息 + $base = [ + 'name' => 'IEPay支付宝', // 插件名称 + 'version' => '1.0.0', // 插件版本 + 'apply_version' => '不限', // 适用系统版本描述 + 'apply_terminal'=> ['pc', 'h5', 'ios', 'android'], // 适用终端 默认全部 ['pc', 'h5', 'ios', 'android', 'alipay', 'weixin', 'baidu', 'toutiao'] + 'desc' => '适用PC+H5+APP,即时到帐支付方式,买家的交易资金直接打入卖家账户,新西兰货币支付。 立即申请', // 插件描述(支持html) + 'author' => 'Devil', // 开发者 + 'author_url' => 'http://shopxo.net/', // 开发者主页 + ]; + + // 配置信息 + $element = [ + [ + 'element' => 'input', + 'type' => 'text', + 'default' => '', + 'name' => 'mid', + 'placeholder' => '商户ID', + 'title' => '商户ID', + 'is_required' => 0, + 'message' => '请填写商户ID', + ], + [ + 'element' => 'input', + 'type' => 'text', + 'default' => '', + 'name' => 'key', + 'placeholder' => '密钥', + 'title' => '密钥', + 'is_required' => 0, + 'message' => '请填写密钥', + ], + ]; + + return [ + 'base' => $base, + 'element' => $element, + ]; + } + + /** + * 支付入口 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-19 + * @desc description + * @param [array] $params [输入参数] + */ + public function Pay($params = []) + { + // 参数 + if(empty($params)) + { + return DataReturn('参数不能为空', -1); + } + + // 配置信息 + if(empty($this->config)) + { + return DataReturn('支付缺少配置', -1); + } + + // 支付参数 + $parameter = [ + 'mid' => $this->config['mid'], + 'total_fee' => (int) (($params['total_price']*1000)/10), + 'goods' => $params['name'], + 'out_trade_no' => $params['order_no'], + 'return_url' => $params['call_back_url'].'?out_trade_no='.$params['order_no'], + 'notify_url' => $params['notify_url'], + 'pay_type' => $this->GetPayType(), + 'version' => 'v1', + ]; + + // 订单货币是否人民币 + // 仅一个订单支付 + // 仅支付宝pc+h5支付有效 + if(in_array($parameter['pay_type'], ['IE0012', 'IE0013']) && isset($params['business_type']) && $params['business_type'] == 'system-order' && !empty($params['business_ids']) && is_array($params['business_ids']) && count($params['business_ids']) == 1) + { + $currency_data = \app\service\OrderCurrencyService::OrderCurrencyGroupList($params['business_ids'][0]); + if(!empty($currency_data) && isset($currency_data['currency_code']) && $currency_data['currency_code'] == 'RMB') + { + $parameter['rmb_fee'] = (int) (($params['total_price']*1000)/10); + unset($parameter['total_fee']); + } + } + + // 生成签名 + $parameter['sign'] = $this->SignCreated($parameter); + + // 请求post + $result = $this->HttpRequest('https://a.mypaynz.com/api/online', $parameter); + if(isset($result['is_success']) && $result['is_success'] == 'TRUE' && !empty($result['extra']) && !empty($result['extra']['pay_url'])) + { + return DataReturn('处理成功', 0, $result['extra']['pay_url']); + } + return DataReturn(empty($result['message']) ? '支付错误' : $result['message'], -100); + } + + /** + * 获取支付平台类型 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-09-22 + * @desc description + * @param [string] $client_type [订单客户端类型] + */ + private function GetPayType($client_type = '') + { + // 平台 + if(empty($client_type)) + { + $client_type = ApplicationClientType(); + } + + // 终端平台 + $client_type_arr = [ + 'pc' => 'IE0012', + 'h5' => 'IE0013', + 'ios' => 'IE0015', + 'android' => 'IE0015', + ]; + return isset($client_type_arr[$client_type]) ? $client_type_arr[$client_type] : $client_type_arr['pc']; + } + + + /** + * 支付回调处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-19 + * @desc description + * @param [array] $params [输入参数] + */ + public function Respond($params = []) + { + // 支付参数 + $data = input(); + if(empty($data['out_trade_no'])) + { + return DataReturn('支付平台返回的订单号为空', -1); + } + + // 远程查询支付状态 + $parameter = [ + 'mid' => $this->config['mid'], + 'pay_type' => $this->GetPayType(), + 'out_trade_no' => $data['out_trade_no'], + 'version' => 'v1', + ]; + + // 生成签名 + $parameter['sign'] = $this->SignCreated($parameter); + + // 请求post + $result = $this->HttpRequest('https://a.mypaynz.com/api/check_order_status', $parameter); + if(isset($result['is_success']) && $result['is_success'] == 'TRUE' && !empty($result['extra'])) + { + if(isset($result['extra']['order_status']) && $result['extra']['order_status'] == 1) + { + return DataReturn('支付成功', 0, $this->ReturnData($result['extra'])); + } + } + return DataReturn(empty($result['message']) ? '支付失败' : $result['message'], -100); + } + + /** + * [ReturnData 返回数据统一格式] + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2018-10-06T16:54:24+0800 + * @param [array] $data [返回数据] + */ + private function ReturnData($data) + { + // 返回数据固定基础参数 + $data['trade_no'] = $data['trade_no']; // 支付平台 - 订单号 + $data['buyer_user'] = $data['pay_type']; // 支付平台 - 用户 + $data['out_trade_no'] = $data['out_trade_no']; // 本系统发起支付的 - 订单号 + $data['subject'] = isset($data['order_status']) ? '状态:'.$data['order_status'] : ''; // 本系统发起支付的 - 商品名称 + $data['pay_price'] = $data['total_fee']/100; // 本系统发起支付的 - 总价 + + return $data; + } + + /** + * 退款处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-05-28 + * @desc description + * @param [array] $params [输入参数] + */ + public function Refund($params = []) + { + // 参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'order_no', + 'error_msg' => '订单号不能为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'trade_no', + 'error_msg' => '交易平台订单号不能为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'refund_price', + 'error_msg' => '退款金额不能为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'client_type', + 'error_msg' => '订单客户端类型不能为空', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + // 远程查询支付状态 + $parameter = [ + 'mid' => $this->config['mid'], + 'pay_type' => $this->GetPayType($params['client_type']), + 'out_trade_no' => $params['order_no'], + 'refund_amount' => (int) (($params['refund_price']*1000)/10), + 'version' => 'v1', + ]; + + // 生成签名 + $parameter['sign'] = $this->SignCreated($parameter); + + // 请求post + $result = $this->HttpRequest('https://a.mypaynz.com/api/refund', $parameter); + if(isset($result['is_success']) && $result['is_success'] == 'TRUE') + { + // 统一返回格式 + $data = [ + 'out_trade_no' => isset($result['out_trade_no']) ? $result['out_trade_no'] : '', + 'trade_no' => isset($result['trade_no']) ? $result['trade_no'] : '', + 'buyer_user' => isset($result['buyer_user_id']) ? $result['buyer_user_id'] : '', + 'refund_price' => isset($result['refund_fee']) ? $result['refund_fee']/100 : $params['refund_price'], + 'return_params' => $result, + ]; + return DataReturn('退款成功', 0, $data); + } + return DataReturn(empty($result['message']) ? '退款失败' : $result['message'], -100); + } + + /** + * [HttpRequest 网络请求] + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2017-09-25T09:10:46+0800 + * @param [string] $url [请求url] + * @param [array] $data [发送数据] + * @return [mixed] [请求返回数据] + */ + private function HttpRequest($url, $data) + { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_FAILONERROR, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + + $body_string = ''; + if(is_array($data) && 0 < count($data)) + { + foreach($data as $k => $v) + { + $body_string .= $k.'='.urlencode($v).'&'; + } + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $body_string); + } + $headers = array('content-type: application/x-www-form-urlencoded;charset=UTF-8'); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + $reponse = curl_exec($ch); + if(curl_errno($ch)) + { + return false; + } else { + $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if(200 !== $httpStatusCode) + { + return false; + } + } + curl_close($ch); + return json_decode($reponse, true); + } + + /** + * 签名生成 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-15 + * @desc description + * @param [array] $params [需要签名的参数] + */ + public function SignCreated($params) + { + ksort($params); + $sign = ''; + foreach($params as $k=>$v) + { + if(!in_array($k, ['sign', 'sign_type']) && $v != '' && $v != null) + { + $sign .= "$k=$v&"; + } + } + return strtolower(md5(substr($sign, 0, -1).$this->config['key'])); + } +} +?> \ No newline at end of file diff --git a/extend/payment/IEPayWeixin.php b/extend/payment/IEPayWeixin.php new file mode 100644 index 000000000..c3f48abff --- /dev/null +++ b/extend/payment/IEPayWeixin.php @@ -0,0 +1,477 @@ +config = $params; + } + + /** + * 配置信息 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-19 + * @desc description + */ + public function Config() + { + // 基础信息 + $base = [ + 'name' => 'IEPay微信', // 插件名称 + 'version' => '1.0.0', // 插件版本 + 'apply_version' => '不限', // 适用系统版本描述 + 'apply_terminal'=> ['pc', 'h5', 'weixin', 'ios', 'android'], // 适用终端 默认全部 ['pc', 'h5', 'ios', 'android', 'alipay', 'weixin', 'baidu', 'toutiao'] + 'desc' => '适用PC+H5+APP,即时到帐支付方式,买家的交易资金直接打入卖家账户,新西兰货币支付。 立即申请', // 插件描述(支持html) + 'author' => 'Devil', // 开发者 + 'author_url' => 'http://shopxo.net/', // 开发者主页 + ]; + + // 配置信息 + $element = [ + [ + 'element' => 'input', + 'type' => 'text', + 'default' => '', + 'name' => 'mid', + 'placeholder' => '商户ID', + 'title' => '商户ID', + 'is_required' => 0, + 'message' => '请填写商户ID', + ], + [ + 'element' => 'input', + 'type' => 'text', + 'default' => '', + 'name' => 'key', + 'placeholder' => '密钥', + 'title' => '密钥', + 'is_required' => 0, + 'message' => '请填写密钥', + ], + [ + 'element' => 'input', + 'type' => 'text', + 'default' => '', + 'name' => 'mini_appid', + 'placeholder' => '小程序ID', + 'title' => '小程序ID', + 'is_required' => 0, + 'message' => '请填写微信分配的小程序ID', + ], + ]; + + return [ + 'base' => $base, + 'element' => $element, + ]; + } + + /** + * 支付入口 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-19 + * @desc description + * @param [array] $params [输入参数] + */ + public function Pay($params = []) + { + // 参数 + if(empty($params)) + { + return DataReturn('参数不能为空', -1); + } + + // 配置信息 + if(empty($this->config)) + { + return DataReturn('支付缺少配置', -1); + } + + // 支付参数 + $parameter = [ + 'mid' => $this->config['mid'], + 'total_fee' => (int) (($params['total_price']*1000)/10), + 'goods' => $params['name'], + 'out_trade_no' => $params['order_no'], + 'return_url' => $params['call_back_url'].'?out_trade_no='.$params['order_no'], + 'notify_url' => $params['notify_url'], + 'pay_type' => $this->GetPayType('', true), + 'version' => 'v1', + ]; + + // 微信小程序 + if($parameter['pay_type'] == 'IE0026') + { + $parameter['appid'] = $this->config['mini_appid']; + $parameter['openid'] = isset($params['user']['weixin_openid']) ? $params['user']['weixin_openid'] : ''; + } + + // 生成签名 + $parameter['sign'] = $this->SignCreated($parameter); + + // 客户端类型 + switch($parameter['pay_type']) + { + // 微信小程序 + case 'IE0026' : + $result = $this->HttpRequest('https://a.mypaynz.com/wechatApi/mini_pay', $parameter); + if(isset($result['code']) && $result['code'] == 200 && !empty($result['data'])) + { + return $this->PayHandleReturn($parameter, $result['data'], $params); + } + break; + + // 默认 + default : + $result = $this->HttpRequest('https://a.mypaynz.com/api/online', $parameter); + if(isset($result['is_success']) && $result['is_success'] == 'TRUE' && !empty($result['extra']) && !empty($result['extra']['pay_url'])) + { + return $this->PayHandleReturn($parameter, $result['extra'], $params); + } + } + + return DataReturn(empty($result['message']) ? '支付错误' : $result['message'], -100); + } + + /** + * 支付返回处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-01-08 + * @desc description + * @param [array] $pay_params [支付参数] + * @param [array] $data [支付返回数据] + * @param [array] $params [输入参数] + */ + private function PayHandleReturn($pay_params = [], $data = [], $params = []) + { + // 客户端类型 + $client_type = ApplicationClientType(); + + // 微信环境中 + if($client_type == 'h5' && IsWeixinEnv()) + { + $client_type = 'weixin_h5'; + } + + // 类型处理 + $result = DataReturn('支付接口异常', -1); + switch($client_type) + { + // web支付/非微信环境h5 + case 'pc' : + case 'h5' : + if(empty($params['ajax_url'])) + { + return DataReturn('支付状态校验地址不能为空', -50); + } + $pay_params = [ + 'url' => urlencode(base64_encode($data['pay_url'])), + 'order_no' => $params['order_no'], + 'name' => urlencode('微信支付'), + 'msg' => urlencode('打开微信APP扫一扫进行支付'), + 'ajax_url' => urlencode(base64_encode($params['ajax_url'])), + ]; + $url = MyUrl('index/pay/qrcode', $pay_params); + $result = DataReturn('success', 0, $url); + break; + + // 微信小程序 + case 'weixin' : + $result = DataReturn('success', 0, $data); + break; + + // h5支付 + // 苹果手机 + // 安卓手机 + case 'weixin_h5' : + case 'ios' : + case 'android' : + $result = DataReturn('success', 0, $data['pay_url']); + break; + } + return $result; + } + + /** + * 获取支付平台类型 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-09-22 + * @desc description + * @param [string] $client_type [订单客户端类型] + * @param [boolean] $is_pay [是否支付请求操作] + */ + private function GetPayType($client_type = '', $is_pay = false) + { + // 平台 + if(empty($client_type)) + { + $client_type = ApplicationClientType(); + } + + // 终端平台 + $client_type_arr = [ + 'pc' => 'IE0021', + 'h5' => 'IE0022', + 'weixin' => 'IE0026', + 'ios' => 'IE0025', + 'android' => 'IE0025', + ]; + + // 手机H5非微信环境中使用PC二维码、支付平台暂时不支持H5支付方式,这里使用PC二维码方式兼容一下(就是体验差一点) + if($is_pay === true && $client_type == 'h5' && !IsWeixinEnv()) + { + $client_type_arr['h5'] = 'IE0021'; + } + + return isset($client_type_arr[$client_type]) ? $client_type_arr[$client_type] : $client_type_arr['pc']; + } + + + /** + * 支付回调处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-19 + * @desc description + * @param [array] $params [输入参数] + */ + public function Respond($params = []) + { + // 支付参数 + $data = input(); + if(empty($data['out_trade_no'])) + { + return DataReturn('支付平台返回的订单号为空', -1); + } + + // 远程查询支付状态 + $parameter = [ + 'mid' => $this->config['mid'], + 'pay_type' => $this->GetPayType(), + 'out_trade_no' => $data['out_trade_no'], + 'version' => 'v1', + ]; + + // 生成签名 + $parameter['sign'] = $this->SignCreated($parameter); + + // 请求post + $result = $this->HttpRequest('https://a.mypaynz.com/api/check_order_status', $parameter); + if(isset($result['is_success']) && $result['is_success'] == 'TRUE' && !empty($result['extra'])) + { + if(isset($result['extra']['order_status']) && $result['extra']['order_status'] == 1) + { + return DataReturn('支付成功', 0, $this->ReturnData($result['extra'])); + } + } + return DataReturn(empty($result['message']) ? '支付失败' : $result['message'], -100); + } + + /** + * [ReturnData 返回数据统一格式] + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2018-10-06T16:54:24+0800 + * @param [array] $data [返回数据] + */ + private function ReturnData($data) + { + // 返回数据固定基础参数 + $data['trade_no'] = $data['trade_no']; // 支付平台 - 订单号 + $data['buyer_user'] = $data['pay_type']; // 支付平台 - 用户 + $data['out_trade_no'] = $data['out_trade_no']; // 本系统发起支付的 - 订单号 + $data['subject'] = isset($data['order_status']) ? '状态:'.$data['order_status'] : ''; // 本系统发起支付的 - 商品名称 + $data['pay_price'] = $data['total_fee']/100; // 本系统发起支付的 - 总价 + + return $data; + } + + /** + * 退款处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-05-28 + * @desc description + * @param [array] $params [输入参数] + */ + public function Refund($params = []) + { + // 参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'order_no', + 'error_msg' => '订单号不能为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'trade_no', + 'error_msg' => '交易平台订单号不能为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'refund_price', + 'error_msg' => '退款金额不能为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'client_type', + 'error_msg' => '订单客户端类型不能为空', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + // 远程查询支付状态 + $parameter = [ + 'mid' => $this->config['mid'], + 'pay_type' => $this->GetPayType($params['client_type']), + 'out_trade_no' => $params['order_no'], + 'refund_amount' => (int) (($params['refund_price']*1000)/10), + 'version' => 'v1', + ]; + + // 生成签名 + $parameter['sign'] = $this->SignCreated($parameter); + + // 请求post + $result = $this->HttpRequest('https://a.mypaynz.com/api/refund', $parameter); + if(isset($result['is_success']) && $result['is_success'] == 'TRUE') + { + // 统一返回格式 + $data = [ + 'out_trade_no' => isset($result['out_trade_no']) ? $result['out_trade_no'] : '', + 'trade_no' => isset($result['trade_no']) ? $result['trade_no'] : '', + 'buyer_user' => isset($result['buyer_user_id']) ? $result['buyer_user_id'] : '', + 'refund_price' => isset($result['refund_fee']) ? $result['refund_fee']/100 : $params['refund_price'], + 'return_params' => $result, + ]; + return DataReturn('退款成功', 0, $data); + } + + // 1. 退款失败则,提示订单不存在 + // 2. 判断订单是否h5类型,可能是pay_type参数兼容性问题导致,再次发起退款操作 + if(isset($result['message']) && $result['message'] == 'PAY_ROW_ERROR' && $params['client_type'] == 'h5') + { + // 支付的时候h5 非微信环境使用的pc支付类型 + $params['client_type'] = 'pc'; + return $this->Refund($params); + } + + // 失败直接返回错误 + return DataReturn(empty($result['message']) ? '退款失败' : $result['message'], -100); + } + + /** + * [HttpRequest 网络请求] + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2017-09-25T09:10:46+0800 + * @param [string] $url [请求url] + * @param [array] $data [发送数据] + * @return [mixed] [请求返回数据] + */ + private function HttpRequest($url, $data) + { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_FAILONERROR, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + + $body_string = ''; + if(is_array($data) && 0 < count($data)) + { + foreach($data as $k => $v) + { + $body_string .= $k.'='.urlencode($v).'&'; + } + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $body_string); + } + $headers = array('content-type: application/x-www-form-urlencoded;charset=UTF-8'); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + $reponse = curl_exec($ch); + if(curl_errno($ch)) + { + return false; + } else { + $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if(200 !== $httpStatusCode) + { + return false; + } + } + curl_close($ch); + return json_decode($reponse, true); + } + + /** + * 签名生成 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-03-15 + * @desc description + * @param [array] $params [需要签名的参数] + */ + public function SignCreated($params) + { + ksort($params); + $sign = ''; + foreach($params as $k=>$v) + { + if(!in_array($k, ['sign', 'sign_type']) && $v != '' && $v != null) + { + $sign .= "$k=$v&"; + } + } + return strtolower(md5(substr($sign, 0, -1).$this->config['key'])); + } +} +?> \ No newline at end of file diff --git a/sourcecode/alipay/pages/user-order/user-order.axml b/sourcecode/alipay/pages/user-order/user-order.axml index d6367c20e..6306f85aa 100644 --- a/sourcecode/alipay/pages/user-order/user-order.axml +++ b/sourcecode/alipay/pages/user-order/user-order.axml @@ -12,7 +12,7 @@ - + @@ -60,7 +60,7 @@ - + diff --git a/sourcecode/alipay/pages/user-order/user-order.js b/sourcecode/alipay/pages/user-order/user-order.js index 67b7bf75d..874c2fac1 100644 --- a/sourcecode/alipay/pages/user-order/user-order.js +++ b/sourcecode/alipay/pages/user-order/user-order.js @@ -23,6 +23,9 @@ Page({ ], nav_status_index: 0, order_select_ids: [], + + // 基础配置 + home_is_enable_order_bulk_pay: 0, }, onLoad(params) { @@ -48,6 +51,20 @@ Page({ // 数据加载 this.init(); + + // 初始化配置 + this.init_config(); + }, + + // 初始化配置 + init_config(status) { + if((status || false) == true) { + this.setData({ + home_is_enable_order_bulk_pay: app.get_config('config.home_is_enable_order_bulk_pay'), + }); + } else { + app.is_config(this, 'init_config'); + } }, // 获取数据 diff --git a/sourcecode/baidu/pages/user-order/user-order.js b/sourcecode/baidu/pages/user-order/user-order.js index b05289f0a..4b5899f97 100755 --- a/sourcecode/baidu/pages/user-order/user-order.js +++ b/sourcecode/baidu/pages/user-order/user-order.js @@ -22,7 +22,10 @@ Page({ { name: "已失效", value: "5,6" }, ], nav_status_index: 0, - order_select_ids: [] + order_select_ids: [], + + // 基础配置 + home_is_enable_order_bulk_pay: 0, }, onLoad(params) { @@ -48,6 +51,20 @@ Page({ // 数据加载 this.init(); + + // 初始化配置 + this.init_config(); + }, + + // 初始化配置 + init_config(status) { + if((status || false) == true) { + this.setData({ + home_is_enable_order_bulk_pay: app.get_config('config.home_is_enable_order_bulk_pay'), + }); + } else { + app.is_config(this, 'init_config'); + } }, // 获取数据 diff --git a/sourcecode/baidu/pages/user-order/user-order.swan b/sourcecode/baidu/pages/user-order/user-order.swan index ee1dd43ca..1673a0f36 100755 --- a/sourcecode/baidu/pages/user-order/user-order.swan +++ b/sourcecode/baidu/pages/user-order/user-order.swan @@ -13,7 +13,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/sourcecode/qq/pages/user-order/user-order.js b/sourcecode/qq/pages/user-order/user-order.js index 90bf66e1d..d8e660e6e 100755 --- a/sourcecode/qq/pages/user-order/user-order.js +++ b/sourcecode/qq/pages/user-order/user-order.js @@ -23,6 +23,9 @@ Page({ ], nav_status_index: 0, order_select_ids: [], + + // 基础配置 + home_is_enable_order_bulk_pay: 0, }, onLoad(params) { @@ -48,6 +51,20 @@ Page({ // 数据加载 this.init(); + + // 初始化配置 + this.init_config(); + }, + + // 初始化配置 + init_config(status) { + if((status || false) == true) { + this.setData({ + home_is_enable_order_bulk_pay: app.get_config('config.home_is_enable_order_bulk_pay'), + }); + } else { + app.is_config(this, 'init_config'); + } }, // 获取数据 diff --git a/sourcecode/qq/pages/user-order/user-order.qml b/sourcecode/qq/pages/user-order/user-order.qml index 1f278bd7d..9313f1127 100755 --- a/sourcecode/qq/pages/user-order/user-order.qml +++ b/sourcecode/qq/pages/user-order/user-order.qml @@ -13,7 +13,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/sourcecode/toutiao/pages/user-order/user-order.js b/sourcecode/toutiao/pages/user-order/user-order.js index 8488af620..f594a5a76 100755 --- a/sourcecode/toutiao/pages/user-order/user-order.js +++ b/sourcecode/toutiao/pages/user-order/user-order.js @@ -13,27 +13,19 @@ Page({ payment_list: [], payment_id: 0, temp_pay_value: '', - nav_status_list: [{ - name: "全部", - value: "-1" - }, { - name: "待付款", - value: "1" - }, { - name: "待发货", - value: "2" - }, { - name: "待收货", - value: "3" - }, { - name: "已完成", - value: "4" - }, { - name: "已失效", - value: "5,6" - }], + nav_status_list: [ + { name: "全部", value: "-1" }, + { name: "待付款", value: "1" }, + { name: "待发货", value: "2" }, + { name: "待收货", value: "3" }, + { name: "已完成", value: "4" }, + { name: "已失效", value: "5,6" }, + ], nav_status_index: 0, - order_select_ids: [] + order_select_ids: [], + + // 基础配置 + home_is_enable_order_bulk_pay: 0, }, onLoad(params) { @@ -60,6 +52,20 @@ Page({ // 数据加载 this.init(); + + // 初始化配置 + this.init_config(); + }, + + // 初始化配置 + init_config(status) { + if((status || false) == true) { + this.setData({ + home_is_enable_order_bulk_pay: app.get_config('config.home_is_enable_order_bulk_pay'), + }); + } else { + app.is_config(this, 'init_config'); + } }, // 获取数据 diff --git a/sourcecode/toutiao/pages/user-order/user-order.ttml b/sourcecode/toutiao/pages/user-order/user-order.ttml index af3f1b9f6..acbea71f8 100755 --- a/sourcecode/toutiao/pages/user-order/user-order.ttml +++ b/sourcecode/toutiao/pages/user-order/user-order.ttml @@ -13,7 +13,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/sourcecode/weixin/app.js b/sourcecode/weixin/app.js index 481a271b6..03b77e0c2 100755 --- a/sourcecode/weixin/app.js +++ b/sourcecode/weixin/app.js @@ -71,7 +71,7 @@ App({ // 请求地址 request_url: "{{request_url}}", request_url: 'http://shopxo.com/', - request_url: 'https://dev.shopxo.net/', + // request_url: 'https://dev.shopxo.net/', // 基础信息 application_title: "{{application_title}}", diff --git a/sourcecode/weixin/pages/user-order/user-order.js b/sourcecode/weixin/pages/user-order/user-order.js index d54d8e070..0e5ecaba4 100755 --- a/sourcecode/weixin/pages/user-order/user-order.js +++ b/sourcecode/weixin/pages/user-order/user-order.js @@ -23,6 +23,9 @@ Page({ ], nav_status_index: 0, order_select_ids: [], + + // 基础配置 + home_is_enable_order_bulk_pay: 0, }, onLoad(params) { @@ -48,6 +51,20 @@ Page({ // 数据加载 this.init(); + + // 初始化配置 + this.init_config(); + }, + + // 初始化配置 + init_config(status) { + if((status || false) == true) { + this.setData({ + home_is_enable_order_bulk_pay: app.get_config('config.home_is_enable_order_bulk_pay'), + }); + } else { + app.is_config(this, 'init_config'); + } }, // 获取数据 diff --git a/sourcecode/weixin/pages/user-order/user-order.wxml b/sourcecode/weixin/pages/user-order/user-order.wxml index 8076e1f1e..3c49f0fc2 100755 --- a/sourcecode/weixin/pages/user-order/user-order.wxml +++ b/sourcecode/weixin/pages/user-order/user-order.wxml @@ -13,7 +13,7 @@ - + @@ -61,7 +61,7 @@ - +