Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
87d2b5e4
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
87d2b5e4
编写于
1月 02, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
api插件调用优化
上级
72da6fe4
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
419 addition
and
175 deletion
+419
-175
application/admin/controller/Plugins.php
application/admin/controller/Plugins.php
+10
-54
application/api/controller/Plugins.php
application/api/controller/Plugins.php
+87
-0
application/common.php
application/common.php
+10
-3
application/index/controller/Plugins.php
application/index/controller/Plugins.php
+10
-58
application/service/PluginsService.php
application/service/PluginsService.php
+61
-0
application/tags.php
application/tags.php
+97
-0
public/appmini/old/alipay/app.js
public/appmini/old/alipay/app.js
+24
-8
public/appmini/old/alipay/pages/coupon/coupon.js
public/appmini/old/alipay/pages/coupon/coupon.js
+2
-2
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
+1
-1
public/appmini/old/alipay/pages/user-coupon/user-coupon.js
public/appmini/old/alipay/pages/user-coupon/user-coupon.js
+1
-1
public/appmini/old/baidu/app.js
public/appmini/old/baidu/app.js
+28
-5
public/appmini/old/baidu/pages/coupon/coupon.js
public/appmini/old/baidu/pages/coupon/coupon.js
+2
-2
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
+1
-1
public/appmini/old/baidu/pages/user-coupon/user-coupon.js
public/appmini/old/baidu/pages/user-coupon/user-coupon.js
+1
-1
public/appmini/old/qq/app.js
public/appmini/old/qq/app.js
+24
-9
public/appmini/old/qq/pages/coupon/coupon.js
public/appmini/old/qq/pages/coupon/coupon.js
+2
-2
public/appmini/old/qq/pages/goods-detail/goods-detail.js
public/appmini/old/qq/pages/goods-detail/goods-detail.js
+1
-1
public/appmini/old/qq/pages/user-coupon/user-coupon.js
public/appmini/old/qq/pages/user-coupon/user-coupon.js
+1
-1
public/appmini/old/toutiao/app.js
public/appmini/old/toutiao/app.js
+24
-9
public/appmini/old/toutiao/pages/coupon/coupon.js
public/appmini/old/toutiao/pages/coupon/coupon.js
+2
-2
public/appmini/old/toutiao/pages/goods-detail/goods-detail.js
...ic/appmini/old/toutiao/pages/goods-detail/goods-detail.js
+1
-1
public/appmini/old/toutiao/pages/user-coupon/user-coupon.js
public/appmini/old/toutiao/pages/user-coupon/user-coupon.js
+1
-1
public/appmini/old/weixin/app.js
public/appmini/old/weixin/app.js
+24
-9
public/appmini/old/weixin/pages/coupon/coupon.js
public/appmini/old/weixin/pages/coupon/coupon.js
+2
-2
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+1
-1
public/appmini/old/weixin/pages/user-coupon/user-coupon.js
public/appmini/old/weixin/pages/user-coupon/user-coupon.js
+1
-1
未找到文件。
application/admin/controller/Plugins.php
浏览文件 @
87d2b5e4
...
...
@@ -87,71 +87,27 @@ class Plugins extends Common
$pluginscontrol
=
strtolower
(
$params
[
'pluginscontrol'
]);
$pluginsaction
=
strtolower
(
$params
[
'pluginsaction'
]);
// 应用校验
$ret
=
$this
->
PluginsCheck
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
);
if
(
$ret
[
'code'
]
!=
0
)
{
if
(
IS_AJAX
)
{
return
$ret
;
}
else
{
$this
->
assign
(
'msg'
,
$ret
[
'msg'
]);
return
$this
->
fetch
(
'public/tips_error'
);
}
}
// 视图初始化
$this
->
PluginsViewInit
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
);
// 编辑器文件存放地址定义
$this
->
assign
(
'editor_path_type'
,
'plugins_'
.
$pluginsname
);
//
应用控制器
$
plugins
=
'\app\plugins\\'
.
$pluginsname
.
'\admin\\'
.
ucfirst
(
$pluginscontrol
);
if
(
!
class_exists
(
$plugins
)
)
//
调用
$
ret
=
PluginsService
::
PluginsControlCall
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
,
'admin'
,
$params
);
if
(
$ret
[
'code'
]
==
0
)
{
if
(
IS_AJAX
)
{
return
DataReturn
(
ucfirst
(
$pluginscontrol
)
.
' 应用控制器未定义'
,
-
1
);
}
else
{
$this
->
assign
(
'msg'
,
ucfirst
(
$pluginscontrol
)
.
' 应用控制器未定义'
);
return
$this
->
fetch
(
'public/tips_error'
);
}
return
$ret
[
'data'
];
}
// 调用方法
$obj
=
new
$plugins
();
if
(
!
method_exists
(
$obj
,
$pluginsaction
))
{
if
(
IS_AJAX
)
{
return
DataReturn
(
ucfirst
(
$pluginsaction
)
.
' 应用方法未定义'
,
-
1
);
}
else
{
$this
->
assign
(
'msg'
,
ucfirst
(
$pluginsaction
)
.
' 应用方法未定义'
);
return
$this
->
fetch
(
'public/tips_error'
);
}
}
return
$obj
->
$pluginsaction
(
$params
);
}
/**
* 应用校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-05-27T00:13:50+0800
* @param [string] $plugins_name [应用名称]
* @param [string] $plugins_control [控制器名称]
* @param [string] $plugins_action [方法]
*/
private
function
PluginsCheck
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
)
{
$ret
=
PluginsService
::
PluginsField
(
$pluginsname
,
'id'
);
if
(
empty
(
$ret
[
'data'
]))
// 调用失败
if
(
IS_AJAX
)
{
return
DataReturn
(
'应用不存在'
,
-
10
);
return
$ret
;
}
else
{
$this
->
assign
(
'msg'
,
$ret
[
'msg'
]);
return
$this
->
fetch
(
'public/tips_error'
);
}
return
DataReturn
(
'验证成功'
,
0
);
}
/**
...
...
application/api/controller/
Coupon
.php
→
application/api/controller/
Plugins
.php
浏览文件 @
87d2b5e4
...
...
@@ -10,107 +10,78 @@
// +----------------------------------------------------------------------
namespace
app\api\controller
;
use
app\service\PluginsService
;
/**
*
优惠劵
*
应用调用入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Coupon
extends
Common
class
Plugins
extends
Common
{
/**
*
[__construct 构造方法]
*
构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-01-02
* @desc description
*/
public
function
__construct
()
{
// 调用父类前置方法
parent
::
__construct
();
}
/**
*
优惠劵
首页
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 20
19-10-15
* @date 20
20-01-02
* @desc description
*/
public
function
Index
()
{
// 获取基础配置信息
$base
=
CallPluginsData
(
'coupon'
);
// 优惠劵列表
$coupon_params
=
[
'where'
=>
[
'is_enable'
=>
1
,
'is_user_receive'
=>
1
,
// 请求参数校验
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'pluginsname'
,
'error_msg'
=>
'应用名称有误'
,
],
'm'
=>
0
,
'n'
=>
0
,
'is_sure_receive'
=>
1
,
'user'
=>
$this
->
user
,
];
$ret
=
CallPluginsServiceMethod
(
'coupon'
,
'CouponService'
,
'CouponList'
,
$coupon_params
);
// 返回数据
$result
=
[
'base'
=>
$base
[
'data'
],
'data'
=>
$ret
[
'data'
],
];
return
DataReturn
(
'处理成功'
,
0
,
$result
);
}
/**
* 用户优惠劵列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-10-15
* @desc description
*/
public
function
User
()
{
// 是否登录
$this
->
IsLogin
();
// 获取用户优惠劵
$coupon_params
=
[
'user'
=>
$this
->
user
,
'where'
=>
[
'user_id'
=>
$this
->
user
[
'id'
],
'is_valid'
=>
1
,
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'pluginscontrol'
,
'error_msg'
=>
'应用控制器有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'pluginsaction'
,
'error_msg'
=>
'应用操作方法有误'
,
],
];
return
CallPluginsServiceMethod
(
'coupon'
,
'UserCouponService'
,
'CouponUserList'
,
$coupon_params
);
}
$ret
=
ParamsChecked
(
$this
->
data_request
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
5000
);
}
/**
* 领取优惠劵
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-10-15
* @desc description
*/
public
function
Receive
()
{
// 是否登录
$this
->
IsLogin
();
// 应用名称/控制器/方法
$pluginsname
=
$this
->
data_request
[
'pluginsname'
];
$pluginscontrol
=
strtolower
(
$this
->
data_request
[
'pluginscontrol'
]);
$pluginsaction
=
strtolower
(
$this
->
data_request
[
'pluginsaction'
]);
// 是否ajax请求
if
(
!
IS_AJAX
)
// 调用
$ret
=
PluginsService
::
PluginsControlCall
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
,
'api'
,
$this
->
data_request
);
if
(
$ret
[
'code'
]
==
0
)
{
return
$
this
->
error
(
'非法访问'
)
;
return
$
ret
[
'data'
]
;
}
//
领取优惠劵
return
CallPluginsServiceMethod
(
'coupon'
,
'CouponService'
,
'UserReceiveCoupon'
,
$this
->
data_post
)
;
//
调用失败
return
$ret
;
}
}
?>
\ No newline at end of file
application/common.php
浏览文件 @
87d2b5e4
...
...
@@ -100,7 +100,7 @@ function PathToParams($key = null, $default = null, $path = '')
}
/**
* 调用插件方法 - 获取插件配置信息
* 调用插件
服务层
方法 - 获取插件配置信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -118,8 +118,15 @@ function CallPluginsData($plugins, $attachment_field = [], $service_name = '', $
return
DataReturn
(
'插件状态异常['
.
$plugins
.
']'
,
-
1
);
}
// 查看是否存在基础服务层并且定义获取基础配置方法
$plugins_class
=
'app\plugins\\'
.
$plugins
.
'\service\BaseService'
;
if
(
class_exists
(
$plugins_class
)
&&
method_exists
(
$plugins_class
,
'BaseConfig'
))
{
return
$plugins_class
::
BaseConfig
();
}
// 未指定附件字段则自动去获取
$attachment
=
[]
;
$attachment
=
$attachment_field
;
if
(
empty
(
$attachment_field
)
&&
!
empty
(
$attachment_property
))
{
// 类自定义或者默认两个类
...
...
@@ -141,7 +148,7 @@ function CallPluginsData($plugins, $attachment_field = [], $service_name = '', $
}
/**
* 调用插件方法 - 访问为静态
* 调用插件
服务层
方法 - 访问为静态
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
application/index/controller/Plugins.php
浏览文件 @
87d2b5e4
...
...
@@ -81,75 +81,27 @@ class Plugins extends Common
$pluginscontrol
=
strtolower
(
$params
[
'pluginscontrol'
]);
$pluginsaction
=
strtolower
(
$params
[
'pluginsaction'
]);
// 应用校验
$ret
=
$this
->
PluginsCheck
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
);
if
(
$ret
[
'code'
]
!=
0
)
{
if
(
IS_AJAX
)
{
return
$ret
;
}
else
{
$this
->
assign
(
'msg'
,
$ret
[
'msg'
]);
return
$this
->
fetch
(
'public/tips_error'
);
}
}
// 视图初始化
$this
->
PluginsViewInit
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
);
// 编辑器文件存放地址定义
$this
->
assign
(
'editor_path_type'
,
'plugins_'
.
$pluginsname
);
//
应用控制器
$
plugins
=
'\app\plugins\\'
.
$pluginsname
.
'\index\\'
.
ucfirst
(
$pluginscontrol
);
if
(
!
class_exists
(
$plugins
)
)
//
调用
$
ret
=
PluginsService
::
PluginsControlCall
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
,
'index'
,
$params
);
if
(
$ret
[
'code'
]
==
0
)
{
if
(
IS_AJAX
)
{
return
DataReturn
(
ucfirst
(
$pluginscontrol
)
.
' 应用控制器未定义'
,
-
1
);
}
else
{
$this
->
assign
(
'msg'
,
ucfirst
(
$pluginscontrol
)
.
' 应用控制器未定义'
);
return
$this
->
fetch
(
'public/tips_error'
);
}
return
$ret
[
'data'
];
}
// 调用方法
$obj
=
new
$plugins
();
if
(
!
method_exists
(
$obj
,
$pluginsaction
))
{
if
(
IS_AJAX
)
{
return
DataReturn
(
ucfirst
(
$pluginsaction
)
.
' 应用方法未定义'
,
-
1
);
}
else
{
$this
->
assign
(
'msg'
,
ucfirst
(
$pluginsaction
)
.
' 应用方法未定义'
);
return
$this
->
fetch
(
'public/tips_error'
);
}
}
return
$obj
->
$pluginsaction
(
$params
);
}
/**
* 应用校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-05-27T00:13:50+0800
* @param [string] $plugins_name [应用名称]
* @param [string] $plugins_control [控制器名称]
* @param [string] $plugins_action [方法]
*/
private
function
PluginsCheck
(
$pluginsname
,
$pluginscontrol
,
$pluginsaction
)
{
$ret
=
PluginsService
::
PluginsField
(
$pluginsname
,
'is_enable'
);
if
(
$ret
[
'data'
]
===
null
)
{
return
DataReturn
(
'应用未安装['
.
$pluginsname
.
']'
,
-
10
);
}
if
(
$ret
[
'data'
]
!=
1
)
// 调用失败
if
(
IS_AJAX
)
{
return
DataReturn
(
'应用未启用['
.
$pluginsname
.
']'
,
-
10
);
return
$ret
;
}
else
{
$this
->
assign
(
'msg'
,
$ret
[
'msg'
]);
return
$this
->
fetch
(
'public/tips_error'
);
}
return
DataReturn
(
'验证成功'
,
0
);
}
/**
...
...
application/service/PluginsService.php
浏览文件 @
87d2b5e4
...
...
@@ -187,5 +187,66 @@ class PluginsService
$ret
=
self
::
PluginsField
(
$plugins
,
'is_enable'
);
return
$ret
[
'data'
];
}
/**
* 应用校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-01-02
* @param [string] $plugins [应用标记]
*/
public
static
function
PluginsCheck
(
$plugins
)
{
$ret
=
self
::
PluginsStatus
(
$plugins
);
if
(
$ret
===
null
)
{
return
DataReturn
(
'应用未安装['
.
$plugins
.
']'
,
-
10
);
}
if
(
$ret
!=
1
)
{
return
DataReturn
(
'应用未启用['
.
$plugins
.
']'
,
-
10
);
}
return
DataReturn
(
'验证成功'
,
0
);
}
/**
* 应用控制器调用
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-01-02
* @param [string] $plugins [应用标记]
* @param [string] $control [应用控制器]
* @param [string] $action [应用方法]
* @param [string] $group [应用组(admin, index, api)]
* @param [array] $params [输入参数]
*/
public
static
function
PluginsControlCall
(
$plugins
,
$control
,
$action
,
$group
=
'index'
,
$params
=
[])
{
// 应用校验
$ret
=
self
::
PluginsCheck
(
$plugins
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 应用控制器
$control
=
ucfirst
(
$control
);
$plugins
=
'\app\plugins\\'
.
$plugins
.
'\\'
.
$group
.
'\\'
.
$control
;
if
(
!
class_exists
(
$plugins
))
{
return
DataReturn
(
'应用控制器未定义['
.
$control
.
']'
,
-
1
);
}
// 调用方法
$action
=
ucfirst
(
$action
);
$obj
=
new
$plugins
();
if
(
!
method_exists
(
$obj
,
$action
))
{
return
DataReturn
(
'应用方法未定义['
.
$action
.
']'
,
-
1
);
}
return
DataReturn
(
'验证成功'
,
0
,
$obj
->
$action
(
$params
));
}
}
?>
\ No newline at end of file
application/tags.php
浏览文件 @
87d2b5e4
...
...
@@ -32,5 +32,102 @@ return array (
'log_write'
=>
array
(
),
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_navigation_header_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_goods_handle_end'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_spec_base'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_buy_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_user_login_success_record'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_spec_extends_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_admin_user_save'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_user_save_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_save_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_goods_detail_panel_price_top'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_home_goods_inside_bottom'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_search_goods_inside_bottom'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_spec_type'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_users_center_left_menu_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_header_navigation_top_right_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_js'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_goods_detail_panel_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_goods_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_form_inside'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_buy_order_insert_success'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_order_status_change_history_success_handle'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_user_register_end'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
);
?>
\ No newline at end of file
public/appmini/old/alipay/app.js
浏览文件 @
87d2b5e4
...
...
@@ -169,26 +169,42 @@ App({
/**
* 请求地址生成
* a 方法
* c 控制器
* plugins 插件标记(传参则表示为插件请求)
* params url请求参数
*/
get_request_url
(
a
,
c
,
m
,
params
)
{
get_request_url
(
a
,
c
,
plugins
,
params
)
{
a
=
a
||
"
index
"
;
c
=
c
||
"
index
"
;
m
=
m
||
"
api
"
;
// 是否插件请求
var
plugins_params
=
""
;
if
((
plugins
||
null
)
!=
null
)
{
plugins_params
=
"
&pluginsname=
"
+
plugins
+
"
&pluginscontrol=
"
+
c
+
"
&pluginsaction=
"
+
a
;
// 走api统一插件调用控制器
c
=
"
plugins
"
a
=
"
index
"
}
// 参数处理
params
=
params
||
""
;
if
(
params
!=
""
&&
params
.
substr
(
0
,
1
)
!=
"
&
"
)
{
params
=
"
&
"
+
params
;
}
// 用户信息
var
user
=
this
.
get_user_cache_info
();
var
token
=
(
user
==
false
)
?
''
:
user
.
token
||
''
;
return
(
this
.
data
.
request_url
+
"
index.php?s=/
"
+
m
+
"
/
"
+
c
+
"
/
"
+
a
+
"
&application=app&application_client_type=alipay
"
+
return
this
.
data
.
request_url
+
"
index.php?s=/api/
"
+
c
+
"
/
"
+
a
+
plugins_params
+
"
&application=app&application_client_type=weixin
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
);
params
;
},
/**
...
...
public/appmini/old/alipay/pages/coupon/coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -37,7 +37,7 @@ Page({
}
my
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
@@ -112,7 +112,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
my
.
showLoading
({
title
:
"
处理中...
"
});
my
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
浏览文件 @
87d2b5e4
...
...
@@ -803,7 +803,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
my
.
showLoading
({
title
:
"
处理中...
"
});
my
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/alipay/pages/user-coupon/user-coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -54,7 +54,7 @@ Page({
}
my
.
request
({
url
:
app
.
get_request_url
(
"
user
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
public/appmini/old/baidu/app.js
浏览文件 @
87d2b5e4
...
...
@@ -153,21 +153,44 @@ App({
return
system_info
;
},
/**
/**
* 请求地址生成
* a 方法
* c 控制器
* plugins 插件标记(传参则表示为插件请求)
* params url请求参数
*/
get_request_url
(
a
,
c
,
m
,
params
)
{
get_request_url
(
a
,
c
,
plugins
,
params
)
{
a
=
a
||
"
index
"
;
c
=
c
||
"
index
"
;
m
=
m
||
"
api
"
;
// 是否插件请求
var
plugins_params
=
""
;
if
((
plugins
||
null
)
!=
null
)
{
plugins_params
=
"
&pluginsname=
"
+
plugins
+
"
&pluginscontrol=
"
+
c
+
"
&pluginsaction=
"
+
a
;
// 走api统一插件调用控制器
c
=
"
plugins
"
a
=
"
index
"
}
// 参数处理
params
=
params
||
""
;
if
(
params
!=
""
&&
params
.
substr
(
0
,
1
)
!=
"
&
"
)
{
params
=
"
&
"
+
params
;
}
// 用户信息
var
user
=
this
.
get_user_cache_info
();
var
token
=
user
==
false
?
''
:
user
.
token
||
''
;
return
this
.
data
.
request_url
+
"
index.php?s=/
"
+
m
+
"
/
"
+
c
+
"
/
"
+
a
+
"
&application=app&application_client_type=baidu
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
;
var
token
=
(
user
==
false
)
?
''
:
user
.
token
||
''
;
return
this
.
data
.
request_url
+
"
index.php?s=/api/
"
+
c
+
"
/
"
+
a
+
plugins_params
+
"
&application=app&application_client_type=weixin
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
;
},
/**
...
...
public/appmini/old/baidu/pages/coupon/coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -37,7 +37,7 @@ Page({
}
swan
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
@@ -109,7 +109,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
swan
.
showLoading
({
title
:
"
处理中...
"
});
swan
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
浏览文件 @
87d2b5e4
...
...
@@ -732,7 +732,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
swan
.
showLoading
({
title
:
"
处理中...
"
});
swan
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/baidu/pages/user-coupon/user-coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -50,7 +50,7 @@ Page({
}
swan
.
request
({
url
:
app
.
get_request_url
(
"
user
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
public/appmini/old/qq/app.js
浏览文件 @
87d2b5e4
...
...
@@ -129,29 +129,44 @@ App({
return
system_info
;
},
/**
/**
* 请求地址生成
* a 方法
* c 控制器
* plugins 插件标记(传参则表示为插件请求)
* params url请求参数
*/
get_request_url
(
a
,
c
,
m
,
params
)
{
get_request_url
(
a
,
c
,
plugins
,
params
)
{
a
=
a
||
"
index
"
;
c
=
c
||
"
index
"
;
m
=
m
||
"
api
"
;
// 是否插件请求
var
plugins_params
=
""
;
if
((
plugins
||
null
)
!=
null
)
{
plugins_params
=
"
&pluginsname=
"
+
plugins
+
"
&pluginscontrol=
"
+
c
+
"
&pluginsaction=
"
+
a
;
// 走api统一插件调用控制器
c
=
"
plugins
"
a
=
"
index
"
}
// 参数处理
params
=
params
||
""
;
if
(
params
!=
""
&&
params
.
substr
(
0
,
1
)
!=
"
&
"
)
{
params
=
"
&
"
+
params
;
}
// 用户信息
var
user
=
this
.
get_user_cache_info
();
var
token
=
(
user
==
false
)
?
''
:
user
.
token
||
''
;
return
(
this
.
data
.
request_url
+
"
index.php?s=/
"
+
m
+
"
/
"
+
c
+
"
/
"
+
a
+
"
&application=app&application_client_type=qq
"
+
return
this
.
data
.
request_url
+
"
index.php?s=/api/
"
+
c
+
"
/
"
+
a
+
plugins_params
+
"
&application=app&application_client_type=weixin
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
);
params
;
},
/**
...
...
public/appmini/old/qq/pages/coupon/coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -37,7 +37,7 @@ Page({
}
qq
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
@@ -110,7 +110,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
qq
.
showLoading
({
title
:
"
处理中...
"
});
qq
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/qq/pages/goods-detail/goods-detail.js
浏览文件 @
87d2b5e4
...
...
@@ -843,7 +843,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
qq
.
showLoading
({
title
:
"
处理中...
"
});
qq
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/qq/pages/user-coupon/user-coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -54,7 +54,7 @@ Page({
}
qq
.
request
({
url
:
app
.
get_request_url
(
"
user
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
public/appmini/old/toutiao/app.js
浏览文件 @
87d2b5e4
...
...
@@ -129,29 +129,44 @@ App({
return
system_info
;
},
/**
/**
* 请求地址生成
* a 方法
* c 控制器
* plugins 插件标记(传参则表示为插件请求)
* params url请求参数
*/
get_request_url
(
a
,
c
,
m
,
params
)
{
get_request_url
(
a
,
c
,
plugins
,
params
)
{
a
=
a
||
"
index
"
;
c
=
c
||
"
index
"
;
m
=
m
||
"
api
"
;
// 是否插件请求
var
plugins_params
=
""
;
if
((
plugins
||
null
)
!=
null
)
{
plugins_params
=
"
&pluginsname=
"
+
plugins
+
"
&pluginscontrol=
"
+
c
+
"
&pluginsaction=
"
+
a
;
// 走api统一插件调用控制器
c
=
"
plugins
"
a
=
"
index
"
}
// 参数处理
params
=
params
||
""
;
if
(
params
!=
""
&&
params
.
substr
(
0
,
1
)
!=
"
&
"
)
{
params
=
"
&
"
+
params
;
}
// 用户信息
var
user
=
this
.
get_user_cache_info
();
var
token
=
(
user
==
false
)
?
''
:
user
.
token
||
''
;
return
(
this
.
data
.
request_url
+
"
index.php?s=/
"
+
m
+
"
/
"
+
c
+
"
/
"
+
a
+
"
&application=app&application_client_type=toutiao
"
+
return
this
.
data
.
request_url
+
"
index.php?s=/api/
"
+
c
+
"
/
"
+
a
+
plugins_params
+
"
&application=app&application_client_type=weixin
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
);
params
;
},
/**
...
...
public/appmini/old/toutiao/pages/coupon/coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -37,7 +37,7 @@ Page({
}
tt
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
@@ -110,7 +110,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
tt
.
showLoading
({
title
:
"
处理中...
"
});
tt
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/toutiao/pages/goods-detail/goods-detail.js
浏览文件 @
87d2b5e4
...
...
@@ -843,7 +843,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
tt
.
showLoading
({
title
:
"
处理中...
"
});
tt
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/toutiao/pages/user-coupon/user-coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -54,7 +54,7 @@ Page({
}
tt
.
request
({
url
:
app
.
get_request_url
(
"
user
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
public/appmini/old/weixin/app.js
浏览文件 @
87d2b5e4
...
...
@@ -67,7 +67,7 @@ App({
// 请求地址
request_url
:
"
{{request_url}}
"
,
// request_url: 'http://
tp5-dev
.com/',
// request_url: 'http://
shopxo
.com/',
// request_url: 'https://dev.shopxo.net/',
// 基础信息
...
...
@@ -129,29 +129,44 @@ App({
return
system_info
;
},
/**
/**
* 请求地址生成
* a 方法
* c 控制器
* plugins 插件标记(传参则表示为插件请求)
* params url请求参数
*/
get_request_url
(
a
,
c
,
m
,
params
)
{
get_request_url
(
a
,
c
,
plugins
,
params
)
{
a
=
a
||
"
index
"
;
c
=
c
||
"
index
"
;
m
=
m
||
"
api
"
;
// 是否插件请求
var
plugins_params
=
""
;
if
((
plugins
||
null
)
!=
null
)
{
plugins_params
=
"
&pluginsname=
"
+
plugins
+
"
&pluginscontrol=
"
+
c
+
"
&pluginsaction=
"
+
a
;
// 走api统一插件调用控制器
c
=
"
plugins
"
a
=
"
index
"
}
// 参数处理
params
=
params
||
""
;
if
(
params
!=
""
&&
params
.
substr
(
0
,
1
)
!=
"
&
"
)
{
params
=
"
&
"
+
params
;
}
// 用户信息
var
user
=
this
.
get_user_cache_info
();
var
token
=
(
user
==
false
)
?
''
:
user
.
token
||
''
;
return
(
this
.
data
.
request_url
+
"
index.php?s=/
"
+
m
+
"
/
"
+
c
+
"
/
"
+
a
+
return
this
.
data
.
request_url
+
"
index.php?s=/api/
"
+
c
+
"
/
"
+
a
+
plugins_params
+
"
&application=app&application_client_type=weixin
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
);
params
;
},
/**
...
...
public/appmini/old/weixin/pages/coupon/coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -37,7 +37,7 @@ Page({
}
wx
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
index
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
@@ -110,7 +110,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
wx
.
showLoading
({
title
:
"
处理中...
"
});
wx
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
87d2b5e4
...
...
@@ -854,7 +854,7 @@ Page({
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
wx
.
showLoading
({
title
:
"
处理中...
"
});
wx
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
...
...
public/appmini/old/weixin/pages/user-coupon/user-coupon.js
浏览文件 @
87d2b5e4
...
...
@@ -54,7 +54,7 @@ Page({
}
wx
.
request
({
url
:
app
.
get_request_url
(
"
user
"
,
"
coupon
"
),
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录