Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
b6f49f5c
ShopXO
项目概览
jamesyang1999
/
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,发现更多精彩内容 >>
提交
b6f49f5c
编写于
4月 28, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
钱包
上级
8e841938
变更
28
展开全部
显示空白变更内容
内联
并排
Showing
28 changed file
with
1939 addition
and
51 deletion
+1939
-51
application/admin/controller/Plugins.php
application/admin/controller/Plugins.php
+5
-0
application/index/controller/Plugins.php
application/index/controller/Plugins.php
+5
-0
application/index/view/default/userintegral/index.html
application/index/view/default/userintegral/index.html
+5
-3
application/plugins/petscms/Hook.php
application/plugins/petscms/Hook.php
+10
-19
application/plugins/view/wallet/admin/index.html
application/plugins/view/wallet/admin/index.html
+56
-0
application/plugins/view/wallet/admin/saveinfo.html
application/plugins/view/wallet/admin/saveinfo.html
+49
-0
application/plugins/view/wallet/level/index.html
application/plugins/view/wallet/level/index.html
+92
-0
application/plugins/view/wallet/level/saveinfo.html
application/plugins/view/wallet/level/saveinfo.html
+99
-0
application/plugins/view/wallet/wallet/cash.html
application/plugins/view/wallet/wallet/cash.html
+112
-0
application/plugins/view/wallet/wallet/index.html
application/plugins/view/wallet/wallet/index.html
+99
-0
application/plugins/view/wallet/wallet/nav.html
application/plugins/view/wallet/wallet/nav.html
+85
-0
application/plugins/view/wallet/wallet/recharge.html
application/plugins/view/wallet/wallet/recharge.html
+86
-0
application/plugins/wallet/Admin.php
application/plugins/wallet/Admin.php
+87
-0
application/plugins/wallet/Hook.php
application/plugins/wallet/Hook.php
+93
-0
application/plugins/wallet/Level.php
application/plugins/wallet/Level.php
+135
-0
application/plugins/wallet/Service.php
application/plugins/wallet/Service.php
+457
-0
application/plugins/wallet/Wallet.php
application/plugins/wallet/Wallet.php
+273
-0
application/plugins/wallet/config.json
application/plugins/wallet/config.json
+31
-0
application/service/NavigationService.php
application/service/NavigationService.php
+7
-7
application/tags.php
application/tags.php
+2
-0
config/shopxo.sql
config/shopxo.sql
+5
-5
public/static/admin/default/css/order.css
public/static/admin/default/css/order.css
+1
-1
public/static/index/default/css/common.css
public/static/index/default/css/common.css
+0
-13
public/static/index/default/css/goods.css
public/static/index/default/css/goods.css
+16
-2
public/static/index/default/css/userintegral.css
public/static/index/default/css/userintegral.css
+1
-1
public/static/plugins/css/wallet/wallet.css
public/static/plugins/css/wallet/wallet.css
+110
-0
public/static/plugins/js/wallet/wallet.js
public/static/plugins/js/wallet/wallet.js
+18
-0
public/static/upload/images/plugins_wallet/2019/04/28/1556447296647734.jpg
...oad/images/plugins_wallet/2019/04/28/1556447296647734.jpg
+0
-0
未找到文件。
application/admin/controller/Plugins.php
浏览文件 @
b6f49f5c
...
...
@@ -121,6 +121,11 @@ class Plugins extends Common
*/
public
function
PluginsViewInit
(
$plugins_name
,
$plugins_control
,
$plugins_action
)
{
// 应用名称/控制器/方法
$this
->
assign
(
'plugins_name'
,
$plugins_name
);
$this
->
assign
(
'plugins_control'
,
$plugins_control
);
$this
->
assign
(
'plugins_action'
,
$plugins_action
);
// 当前操作名称
$module_name
=
'plugins'
;
...
...
application/index/controller/Plugins.php
浏览文件 @
b6f49f5c
...
...
@@ -115,6 +115,11 @@ class Plugins extends Common
*/
public
function
PluginsViewInit
(
$plugins_name
,
$plugins_control
,
$plugins_action
)
{
// 应用名称/控制器/方法
$this
->
assign
(
'plugins_name'
,
$plugins_name
);
$this
->
assign
(
'plugins_control'
,
$plugins_control
);
$this
->
assign
(
'plugins_action'
,
$plugins_action
);
// 当前操作名称
$module_name
=
'plugins'
;
...
...
application/index/view/default/userintegral/index.html
浏览文件 @
b6f49f5c
...
...
@@ -24,13 +24,15 @@
<div
class=
"user-content-body"
>
<div
class=
"am-alert am-alert-secondary"
data-am-alert
>
<div
class=
"available"
>
<span>
可用积分
</span>
<span>
正常可用
</span>
<span
class=
"integral-value"
>
{{$user.integral}}
</span>
<span
class=
"integral-tips"
>
正常可以使用的积分
</span>
<em>
积分
</em>
<span
class=
"integral-tips"
>
可以正常使用的积分
</span>
</div>
<div
class=
"locking"
>
<span>
锁定积分
</span>
<span>
当前锁定
</span>
<span
class=
"integral-value"
>
{{$user.locking_integral}}
</span>
<em>
积分
</em>
<span
class=
"integral-tips"
>
一般积分交易中,交易并未完成、锁定相应的积分
</span>
</div>
</div>
...
...
application/plugins/petscms/Hook.php
浏览文件 @
b6f49f5c
...
...
@@ -41,7 +41,7 @@ class Hook extends Controller
$ret
=
$this
->
UserCenterLeftMenuHandle
(
$params
);
break
;
// 顶部小导航右侧-我的
业务
// 顶部小导航右侧-我的
商城
case
'plugins_service_header_navigation_top_right_handle'
:
$ret
=
$this
->
CommonTopNavRightMenuHandle
(
$params
);
break
;
...
...
@@ -64,25 +64,17 @@ class Hook extends Controller
*/
public
function
UserCenterLeftMenuHandle
(
$params
=
[])
{
$menu
=
[[
'name'
=>
'宠物管理'
,
'is_show'
=>
1
,
'icon'
=>
'am-icon-drupal'
,
'item'
=>
[
[
$params
[
'data'
][
'business'
][
'item'
][]
=
[
'name'
=>
'我的宠物'
,
'url'
=>
PluginsHomeUrl
(
'petscms'
,
'pets'
,
'index'
),
'contains'
=>
[
'petsindex'
,
'petssaveinfo'
,
'petshelp'
],
'is_show'
=>
1
,
'icon'
=>
'am-icon-github-alt'
,
],
]
]];
array_splice
(
$params
[
'data'
],
2
,
0
,
$menu
);
];
}
/**
* 顶部小导航右侧-我的
业务
* 顶部小导航右侧-我的
商城
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -92,11 +84,10 @@ class Hook extends Controller
*/
public
function
CommonTopNavRightMenuHandle
(
$params
=
[])
{
$menu
=
[
array_push
(
$params
[
'data'
][
1
][
'items'
],
[
'name'
=>
'我的宠物'
,
'url'
=>
PluginsHomeUrl
(
'petscms'
,
'pets'
,
'index'
),
];
array_push
(
$params
[
'data'
][
1
][
'items'
],
$menu
);
]);
}
}
?>
\ No newline at end of file
application/plugins/view/wallet/admin/index.html
0 → 100755
浏览文件 @
b6f49f5c
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<legend>
<span
class=
"fs-16"
>
会员等级
</span>
<a
href=
"{{:MyUrl('admin/pluginsadmin/index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"membershiplevel-content"
>
<!-- 基础数据 -->
<div
class=
"am-panel am-panel-secondary membershiplevel-middle-banner"
>
<div
class=
"am-panel-hd"
>
<span
class=
"am-panel-title"
>
基础数据
</span>
<a
class=
"am-fr"
href=
"{{:PluginsAdminUrl('membershiplevel', 'admin', 'saveinfo')}}"
>
编辑
</a>
</div>
<div
class=
"am-panel-bd"
>
<div
class=
"items"
>
<label>
等级规则模式
</label>
<div>
{{if isset($data['level_rules']) and isset($members_level_rules_list[$data['level_rules']])}}
{{:$members_level_rules_list[$data['level_rules']]['name']}}
{{else /}}
未设置,默认[ 积分(可用积分)]
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
默认等级图标
</label>
<div
class=
"immages-tag"
>
<img
src=
"{{if !empty($data['default_level_images'])}}{{$data.default_level_images}}{{else /}}{{$attachment_host}}/static/plugins/images/membershiplevel/level-default-images.png{{/if}}"
/>
</div>
</div>
</div>
</div>
<!-- 会员等级 -->
<div
class=
"am-panel am-panel-secondary membershiplevel-level-list"
>
<div
class=
"am-panel-hd"
>
<span
class=
"am-panel-title"
>
会员等级
</span>
<a
class=
"am-fr"
href=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'index')}}"
>
编辑
</a>
</div>
<div
class=
"am-panel-bd"
>
<iframe
src=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'index', ['is_admin_index'=>1])}}"
></iframe>
</div>
</div>
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/wallet/admin/saveinfo.html
0 → 100755
浏览文件 @
b6f49f5c
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:PluginsAdminUrl('membershiplevel', 'admin', 'save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:PluginsAdminUrl('membershiplevel', 'admin', 'index')}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"fs-16"
>
会员等级
</span>
<a
href=
"{{:PluginsAdminUrl('membershiplevel', 'admin', 'index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
<label>
等级规则模式
<span
class=
"am-form-group-label-tips"
>
默认积分
</span></label>
<div>
{{foreach $members_level_rules_list as $v}}
<label
class=
"am-radio-inline m-r-10"
>
<input
type=
"radio"
name=
"level_rules"
value=
"{{$v.value}}"
{{
if
isset
($
data
['
level_rules
'])
and
$
data
['
level_rules
']
eq
$
v
['
value
']}}
checked=
"checked"
{{
else
/}}{{
if
!
isset
($
data
['
level_rules
'])
and
isset
($
v
['
checked
'])
and
$
v
['
checked
']
eq
true
}}
checked=
"checked"
{{/
if
}}{{/
if
}}
data-am-ucheck
/>
{{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<div
class=
"am-form-group am-form-file"
>
<label
class=
"block"
>
默认等级图标
<span
class=
"am-form-group-label-tips"
>
建议50像数X50像数
</span></label>
<ul
class=
"plug-file-upload-view plugins-default_level_images-view"
data-form-name=
"default_level_images"
data-max-number=
"1"
data-dialog-type=
"images"
>
{{if !empty($data['default_level_images'])}}
<li>
<input
type=
"text"
name=
"default_level_images"
value=
"{{$data.default_level_images_old}}"
data-validation-message=
"请上传默认等级图标"
/>
<img
src=
"{{$data.default_level_images}}"
/>
<i>
×
</i>
</li>
{{/if}}
</ul>
<div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.plugins-default_level_images-view"
>
+上传图片
</div>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/wallet/level/index.html
0 → 100755
浏览文件 @
b6f49f5c
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
<legend>
<span
class=
"fs-16"
>
会员等级
</span>
<a
href=
"{{:PluginsAdminUrl('membershiplevel', 'admin', 'index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
{{/if}}
<div
class=
"membershiplevel-content"
>
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
<!-- operation start -->
<div
class=
"am-g m-t-15 m-b-10"
>
<a
href=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'saveinfo')}}"
class=
"am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"
>
新增
</a>
</div>
<!-- operation end -->
{{/if}}
<!-- list start -->
<table
class=
"am-table am-table-striped am-table-hover am-text-middle"
>
<thead>
<tr>
<th>
名称
</th>
<th>
图标
</th>
<th>
规则值
</th>
<th>
优惠信息
</th>
<th
class=
"am-hide-sm-only"
>
是否启用
</th>
<th
class=
"am-hide-sm-only"
>
操作时间
</th>
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
<th>
操作
</th>
{{/if}}
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr
id=
"data-list-{{$v.id}}"
{{
if
isset
($
v
['
is_enable
'])
and
$
v
['
is_enable
']
eq
0}}
class=
"am-active"
{{/
if
}}
>
<td>
{{$v.name}}
</td>
<td
{{
if
!
empty
($
v
['
bg_color
'])}}
style=
"background-color:{{$v.bg_color}};"
{{/
if
}}
>
{{if !empty($v['images_url'])}}
<a
href=
"{{$v['images_url']}}"
target=
"_blank"
>
<img
src=
"{{$v['images_url']}}"
class=
"am-radius"
width=
"100"
/>
</a>
{{else /}}
<span
class=
"cr-ccc"
>
暂无图片
</span>
{{/if}}
</td>
<td>
{{$v.rules_min}}~{{$v.rules_max}}
</td>
<td>
满减:{{if $v['order_price'] gt 0 and $v['full_reduction_price'] gt 0}}
满{{$v.order_price}}元 减{{$v.full_reduction_price}}元
{{else /}}
<span
class=
"cr-ccc"
>
无满减
</span>
{{/if}}
<br
/>
折扣:{{if $v['discount_rate']}}
{{$v.discount_rate}}折
{{else /}}
<span
class=
"cr-ccc"
>
无折扣
</span>
{{/if}}
</td>
<td
class=
"am-hide-sm-only"
>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if isset($v['is_enable']) and $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{if isset($v['is_enable'])}}{{$v['is_enable']}}{{/if}}"
data-field=
"is_enable"
data-is-update-status=
"1"
></a>
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.operation_time_time}}
</td>
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
<td
class=
"view-operation"
>
<a
href=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'saveinfo', ['id'=>$v['id']])}}"
>
<button
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-icon-edit"
>
编辑
</button>
</a>
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o submit-delete"
data-url=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'delete')}}"
data-id=
"{{$v.id}}"
>
删除
</button>
</td>
{{/if}}
</tr>
{{/foreach}}
{{else /}}
<tr><td
colspan=
"5"
class=
"table-no"
>
没有相关数据
</td></tr>
{{/if}}
</tbody>
</table>
<!-- list end -->
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/wallet/level/saveinfo.html
0 → 100755
浏览文件 @
b6f49f5c
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<legend>
<span
class=
"fs-16"
>
{{if empty($data['id'])}}
会员等级添加
{{else /}}
会员等级编辑
{{/if}}
</span>
<a
href=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"membershiplevel-content"
>
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:PluginsAdminUrl('membershiplevel', 'level', 'index')}}"
enctype=
"multipart/form-data"
>
<div
class=
"am-form-group"
>
<label>
名称
</label>
<input
type=
"text"
name=
"name"
placeholder=
"名称"
minlength=
"1"
maxlength=
"30"
data-validation-message=
"名称格式 1~30 个字符"
class=
"am-radius"
{{
if
!
empty
($
data
['
name
'])}}
value=
"{{$data.name}}"
{{/
if
}}
required
/>
</div>
<div
class=
"am-form-group am-form-file"
>
<label
class=
"block"
>
图标
<span
class=
"am-form-group-label-tips"
>
建议50像数x50像数
</span></label>
<ul
class=
"plug-file-upload-view images_url-images-view"
data-form-name=
"images_url"
data-max-number=
"1"
data-delete=
"1"
data-dialog-type=
"images"
>
{{if !empty($data['images_url'])}}
<li>
<input
type=
"text"
name=
"images_url"
value=
"{{$data.images_url_old}}"
data-validation-message=
"请上传图标"
/>
<img
src=
"{{$data.images_url}}"
/>
<i>
×
</i>
</li>
{{/if}}
</ul>
<div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.images_url-images-view"
>
+上传图标
</div>
</div>
<div
class=
"am-alert am-alert-warning"
data-am-alert=
""
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
规则举例
<br>
<span
class=
"mini-tips-text"
>
最小规则0 - 最大规则100 则是小于100
<br>
最小规则1000 - 最大规则0 则是大于1000
<br>
最小规则100 - 最大规则500 则是大于等于100并且小于500
</span>
</p>
</div>
<div
class=
"am-form-group"
>
<label>
规则值
</label>
<div
class=
"rules-value"
>
<input
type=
"number"
placeholder=
"最小值"
name=
"rules_min"
step=
"0.01"
data-validation-message=
"请填写规则最小值"
class=
"am-radius"
{{
if
isset
($
data
['
rules_min
'])}}
value=
"{{$data.rules_min}}"
{{/
if
}}
required
/>
<span>
~
</span>
<input
type=
"number"
placeholder=
"最大值"
step=
"0.01"
name=
"rules_max"
data-validation-message=
"请填写规则最大值"
class=
"am-radius"
{{
if
isset
($
data
['
rules_max
'])}}
value=
"{{$data.rules_max}}"
{{/
if
}}
required
/>
</div>
</div>
<div
class=
"am-alert am-alert-warning"
data-am-alert=
""
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
优惠说明
<br>
<span
class=
"mini-tips-text"
>
满减优惠 与 折扣率可
<span
class=
"cr-red"
>
叠加使用
</span>
,如需只使用其中一项优惠,则请注意只需配置该优惠项即可!!!
</span>
</p>
</div>
<div
class=
"am-form-group"
>
<label>
满减优惠
<span
class=
"am-form-group-label-tips"
>
计算规则,大于等于[订单满金额]则减[满减金额](不含运费),空或0则无优惠
</span></label>
<div
class=
"full-reduction-value"
>
<span>
满
</span>
<input
type=
"number"
name=
"order_price"
min=
"0.00"
step=
"0.01"
placeholder=
"订单满金额"
data-validation-message=
"请输入有效的订单满金额"
class=
"am-radius"
{{
if
!
empty
($
data
['
order_price
'])}}
value=
"{{$data.order_price}}"
{{/
if
}}
/>
<span>
减
</span>
<input
type=
"number"
name=
"full_reduction_price"
min=
"0.00"
step=
"0.01"
placeholder=
"满减金额"
data-validation-message=
"请输入有效的满减金额"
class=
"am-radius"
{{
if
!
empty
($
data
['
full_reduction_price
'])}}
value=
"{{$data.full_reduction_price}}"
{{/
if
}}
/>
</div>
</div>
<div
class=
"am-form-group"
>
<label>
折扣率
<span
class=
"am-form-group-label-tips"
>
空或0则无折扣,最大0.99
</span></label>
<input
type=
"number"
name=
"discount_rate"
placeholder=
"折扣率"
min=
"0.00"
max=
"0.99"
step=
"0.01"
data-validation-message=
"折扣率应输入 0.00~0.99 的数字,小数保留两位"
class=
"am-radius"
{{
if
!
empty
($
data
['
discount_rate
'])}}
value=
"{{$data.discount_rate}}"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
是否启用
</label>
<input
name=
"is_enable"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
(
isset
($
data
['
is_enable
'])
and
$
data
['
is_enable
']
eq
1)
or
empty
($
data
)}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<input
type=
"hidden"
name=
"id"
{{
if
!
empty
($
data
['
id
'])}}
value=
"{{$data.id}}"
{{/
if
}}
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
</div>
</form>
<!-- form end -->
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/wallet/wallet/cash.html
0 → 100755
浏览文件 @
b6f49f5c
{{include file="public/header" /}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- content -->
<div
class=
"am-container user-main"
>
<!-- user menu start -->
{{include file="public/user_menu" /}}
<!-- user menu end -->
<!-- content start -->
<div
class=
"user-content"
>
<div
class=
"user-content-body"
>
<!-- user menu start -->
{{include file="../../../plugins/view/wallet/wallet/nav" /}}
<!-- user menu end -->
<form
class=
"am-form form-validation"
method=
"post"
action=
"{{:PluginsHomeUrl('wallet', 'wallet', 'index')}}"
request-type=
"form"
>
<div
class=
"thin"
>
<div
class=
"am-input-group am-input-group-sm am-fl so"
>
<input
type=
"text"
autocomplete=
"off"
name=
"keywords"
class=
"am-radius"
placeholder=
"申请单号"
value=
"{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}"
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"submit"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
</span>
</div>
<label
class=
"am-fl thin_sub more-submit"
>
更多筛选条件
<input
type=
"checkbox"
name=
"is_more"
value=
"1"
class=
"none am-field-valid"
{{
if
isset
($
params
['
is_more
'])}}
checked
{{/
if
}}
/>
<i
class=
"am-icon-angle-up"
></i>
</label>
</div>
<table
class=
"so-list more-where {{if !isset($params['is_more'])}}none{{/if}}"
>
<tbody>
<tr>
<td>
<span>
状态:
</span>
<select
name=
"type"
class=
"chosen-select"
data-placeholder=
"操作类型..."
>
<option
value=
"-1"
>
操作类型...
</option>
{{if !empty($common_integral_log_type_list)}}
{{foreach $common_integral_log_type_list as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
params
['
type
'])
and
$
params
['
type
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
{{/if}}
</select>
</td>
<td>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius am-btn-xs btn-loading-example"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
<a
href=
"{{:PluginsHomeUrl('wallet', 'wallet', 'index')}}"
class=
"am-btn am-btn-warning am-radius am-btn-sm reset-submit"
>
清除条件
</a>
</td>
</tr>
</tbody>
</table>
</form>
<!-- 列表 -->
<div
class=
"data-list"
>
<table
class=
"am-table"
>
<thead>
<tr>
<th>
操作类型
</th>
<th
class=
"am-hide-sm-only"
>
描述
</th>
<th>
原始积分
</th>
<th>
最新积分
</th>
<th
class=
"am-hide-sm-only"
>
时间
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<td>
{{$v.type_name}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.msg}}
</td>
<td>
{{$v.original_integral}}
</td>
<td>
{{$v.new_integral}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time_time}}
</td>
</tr>
{{/foreach}}
{{/if}}
{{if empty($data_list)}}
<tr>
<td
colspan=
"5"
>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
</td>
</tr>
{{/if}}
</tbody>
</table>
</div>
<!-- 分页 -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
</div>
</div>
<!-- content end -->
</div>
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/wallet/wallet/index.html
0 → 100755
浏览文件 @
b6f49f5c
{{include file="public/header" /}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- content -->
<div
class=
"am-container user-main"
>
<!-- user menu start -->
{{include file="public/user_menu" /}}
<!-- user menu end -->
<!-- content start -->
<div
class=
"user-content"
>
<div
class=
"user-content-body"
>
<!-- user menu start -->
{{include file="../../../plugins/view/wallet/wallet/nav" /}}
<!-- user menu end -->
<form
class=
"am-form form-validation"
method=
"post"
action=
"{{:PluginsHomeUrl('wallet', 'wallet', 'index')}}"
request-type=
"form"
>
<table
class=
"so-list more-where"
>
<tbody>
<tr>
<td>
<span>
类型:
</span>
<select
name=
"type"
class=
"chosen-select"
data-placeholder=
"操作类型..."
>
<option
value=
"-1"
>
操作类型...
</option>
{{if !empty($common_integral_log_type_list)}}
{{foreach $common_integral_log_type_list as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
params
['
type
'])
and
$
params
['
type
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
{{/if}}
</select>
</td>
<td>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius am-btn-xs btn-loading-example"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
<a
href=
"{{:PluginsHomeUrl('wallet', 'wallet', 'index')}}"
class=
"am-btn am-btn-warning am-radius am-btn-sm reset-submit"
>
清除条件
</a>
</td>
</tr>
</tbody>
</table>
</form>
<!-- 列表 -->
<div
class=
"data-list"
>
<table
class=
"am-table"
>
<thead>
<tr>
<th>
操作类型
</th>
<th
class=
"am-hide-sm-only"
>
描述
</th>
<th>
原始积分
</th>
<th>
最新积分
</th>
<th
class=
"am-hide-sm-only"
>
时间
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<td>
{{$v.type_name}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.msg}}
</td>
<td>
{{$v.original_integral}}
</td>
<td>
{{$v.new_integral}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time_time}}
</td>
</tr>
{{/foreach}}
{{/if}}
{{if empty($data_list)}}
<tr>
<td
colspan=
"5"
>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
</td>
</tr>
{{/if}}
</tbody>
</table>
</div>
<!-- 分页 -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
</div>
</div>
<!-- content end -->
</div>
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/wallet/wallet/nav.html
0 → 100755
浏览文件 @
b6f49f5c
<!-- 导航 -->
<ul
class=
"am-nav am-nav-pills"
>
<li
{{
if
!
isset
($
plugins_action
)
or
(
isset
($
plugins_action
)
and
$
plugins_action
eq
'
index
')}}
class=
"am-active"
{{/
if
}}
>
<a
href=
"{{:PluginsHomeUrl('wallet', 'wallet', 'index')}}"
>
账户余额
</a>
</li>
<li
{{
if
isset
($
plugins_action
)
and
$
plugins_action
eq
'
recharge
'}}
class=
"am-active"
{{/
if
}}
>
<a
href=
"{{:PluginsHomeUrl('wallet', 'wallet', 'recharge')}}"
>
充值明细
</a>
</li>
<li
{{
if
isset
($
plugins_action
)
and
$
plugins_action
eq
'
cash
'}}
class=
"am-active"
{{/
if
}}
>
<a
href=
"{{:PluginsHomeUrl('wallet', 'wallet', 'cash')}}"
>
余额提现
</a>
</li>
<div
class=
"am-topbar-right"
>
{{if in_array($plugins_action, ['index', 'recharge'])}}
<button
class=
"am-btn am-btn-secondary am-topbar-btn am-btn-sm am-icon-shield"
data-am-modal=
"{target: '#plugins-recharge-pay-modal-popup'}"
>
在线充值
</button>
{{/if}}
{{if in_array($plugins_action, ['index', 'cash'])}}
<a
class=
"am-btn am-btn-success am-topbar-btn am-btn-sm am-icon-money"
>
申请提现
</a>
{{/if}}
</div>
</ul>
<!-- 账户信息 -->
<div
class=
"am-alert am-alert-secondary"
data-am-alert
>
<div
class=
"available"
>
<span>
可用金额
</span>
<span
class=
"integral-value"
>
{{$user.integral}}
</span>
<em>
元
</em>
<span
class=
"integral-tips"
>
正常可以使用的金额
</span>
</div>
<div
class=
"locking"
>
<span>
冻结金额
</span>
<span
class=
"integral-value"
>
{{$user.locking_integral}}
</span>
<em>
元
</em>
<span
class=
"integral-tips"
>
一般积分交易中、提现、交易并未完成,锁定相应的积分
</span>
</div>
</div>
<!-- 充值窗口 -->
<div
class=
"am-popup"
id=
"plugins-recharge-pay-modal-popup"
>
<div
class=
"am-popup-inner"
>
<div
class=
"am-popup-hd"
>
<h4
class=
"am-popup-title"
>
充值
</h4>
<span
data-am-modal-close
class=
"am-close"
>
×
</span>
</div>
<div
class=
"am-popup-bd"
>
<form
class=
"am-form form-validation-plugins-recharge-pay"
action=
"{{:MyUrl('admin/order/pay')}}"
method=
"POST"
request-type=
"ajax-reload"
>
<!-- 支付方式 -->
<div
class=
"business-item am-form-group"
>
<h3>
选择支付
</h3>
{{if !empty($buy_payment_list)}}
<ul
class=
"payment-list"
data-type=
"payment"
>
{{foreach $buy_payment_list as $payment}}
<li
class=
"payment-items-{{$payment.id}}"
data-value=
"{{$payment.id}}"
>
{{if !empty($payment.logo)}}
<img
src=
"{{$payment.logo}}"
/>
{{/if}}
<span>
{{$payment.name}}
</span>
</li>
{{/foreach}}
</ul>
{{/if}}
{{if empty($buy_payment_list)}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有支付方式
</div>
{{/if}}
<input
type=
"number"
name=
"payment_id"
data-validation-message=
"请选择支付方式"
value=
""
required
/>
</div>
<div
class=
"am-form-group"
>
<label>
充值金额
</label>
<div
class=
"am-input-group am-input-group-sm"
>
<input
type=
"number"
autocomplete=
"off"
name=
"money"
step=
"0.01"
class=
"am-radius"
placeholder=
"充值金额"
data-validation-message=
"请输入充值金额"
required
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
>
元
</button>
</span>
</div>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
确认
</button>
</div>
</form>
</div>
</div>
</div>
\ No newline at end of file
application/plugins/view/wallet/wallet/recharge.html
0 → 100755
浏览文件 @
b6f49f5c
{{include file="public/header" /}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- content -->
<div
class=
"am-container user-main"
>
<!-- user menu start -->
{{include file="public/user_menu" /}}
<!-- user menu end -->
<!-- content start -->
<div
class=
"user-content"
>
<div
class=
"user-content-body"
>
<!-- user menu start -->
{{include file="../../../plugins/view/wallet/wallet/nav" /}}
<!-- user menu end -->
<form
class=
"am-form form-validation"
method=
"post"
action=
"{{:PluginsHomeUrl('wallet', 'wallet', 'recharge')}}"
request-type=
"form"
>
<div
class=
"thin"
>
<div
class=
"am-input-group am-input-group-sm am-fl so"
>
<input
type=
"text"
autocomplete=
"off"
name=
"keywords"
class=
"am-radius"
placeholder=
"充值单号"
value=
"{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}"
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"submit"
data-am-loading=
"{spinner:'circle-o-notch', loadingText:'搜索中...'}"
>
搜索
</button>
</span>
</div>
</div>
</form>
<!-- 列表 -->
<div
class=
"data-list"
>
<table
class=
"am-table"
>
<thead>
<tr>
<th>
操作类型
</th>
<th
class=
"am-hide-sm-only"
>
描述
</th>
<th>
原始积分
</th>
<th>
最新积分
</th>
<th
class=
"am-hide-sm-only"
>
时间
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<td>
{{$v.type_name}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.msg}}
</td>
<td>
{{$v.original_integral}}
</td>
<td>
{{$v.new_integral}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time_time}}
</td>
</tr>
{{/foreach}}
{{/if}}
{{if empty($data_list)}}
<tr>
<td
colspan=
"5"
>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
</td>
</tr>
{{/if}}
</tbody>
</table>
</div>
<!-- 分页 -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
</div>
</div>
<!-- content end -->
</div>
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/wallet/Admin.php
0 → 100755
浏览文件 @
b6f49f5c
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\plugins\wallet
;
use
think\Controller
;
use
app\plugins\wallet\Service
;
use
app\service\PluginsService
;
/**
* 钱包插件 - 管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Admin
extends
Controller
{
/**
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
index
(
$params
=
[])
{
$ret
=
PluginsService
::
PluginsData
(
'wallet'
,
Service
::
$base_config_attachment_field
,
false
);
if
(
$ret
[
'code'
]
==
0
)
{
// 等级规则
$this
->
assign
(
'members_level_rules_list'
,
Service
::
$members_level_rules_list
);
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/wallet/admin/index'
);
}
else
{
return
$ret
[
'msg'
];
}
}
/**
* 编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
saveinfo
(
$params
=
[])
{
$ret
=
PluginsService
::
PluginsData
(
'wallet'
,
Service
::
$base_config_attachment_field
,
false
);
if
(
$ret
[
'code'
]
==
0
)
{
// 等级规则
$this
->
assign
(
'members_level_rules_list'
,
Service
::
$members_level_rules_list
);
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/wallet/admin/saveinfo'
);
}
else
{
return
$ret
[
'msg'
];
}
}
/**
* 数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
save
(
$params
=
[])
{
$level
=
Service
::
LevelDataList
();
$params
[
'level_list'
]
=
$level
[
'data'
];
return
PluginsService
::
PluginsDataSave
([
'plugins'
=>
'wallet'
,
'data'
=>
$params
]);
}
}
?>
\ No newline at end of file
application/plugins/wallet/Hook.php
0 → 100755
浏览文件 @
b6f49f5c
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\plugins\wallet
;
use
think\Controller
;
use
app\plugins\wallet\Service
;
/**
* 会员等级插件 - 钩子入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Hook
extends
Controller
{
/**
* 应用响应入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-09T14:25:44+0800
* @param [array] $params [输入参数]
*/
public
function
run
(
$params
=
[])
{
if
(
!
empty
(
$params
[
'hook_name'
]))
{
switch
(
$params
[
'hook_name'
])
{
// 用户中心左侧导航
case
'plugins_service_users_center_left_menu_handle'
:
$ret
=
$this
->
UserCenterLeftMenuHandle
(
$params
);
break
;
// 顶部小导航右侧-我的商城
case
'plugins_service_header_navigation_top_right_handle'
:
$ret
=
$this
->
CommonTopNavRightMenuHandle
(
$params
);
break
;
default
:
$ret
=
''
;
}
return
$ret
;
}
}
/**
* 用户中心左侧菜单处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-11
* @desc description
* @param array $params [description]
*/
public
function
UserCenterLeftMenuHandle
(
$params
=
[])
{
$params
[
'data'
][
'property'
][
'item'
][]
=
[
'name'
=>
'我的钱包'
,
'url'
=>
PluginsHomeUrl
(
'wallet'
,
'wallet'
,
'index'
),
'contains'
=>
[
'walletindex'
],
'is_show'
=>
1
,
'icon'
=>
'am-icon-github-alt'
,
];
}
/**
* 顶部小导航右侧-我的商城
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-11
* @desc description
* @param array $params [description]
*/
public
function
CommonTopNavRightMenuHandle
(
$params
=
[])
{
array_push
(
$params
[
'data'
][
1
][
'items'
],
[
'name'
=>
'我的钱包'
,
'url'
=>
PluginsHomeUrl
(
'wallet'
,
'wallet'
,
'index'
),
]);
}
}
?>
\ No newline at end of file
application/plugins/wallet/Level.php
0 → 100755
浏览文件 @
b6f49f5c
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\plugins\membershiplevel
;
use
think\Controller
;
use
app\plugins\membershiplevel\Service
;
use
app\service\PluginsService
;
/**
* 会员等级管理插件 - 管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Level
extends
Controller
{
/**
* 等级页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
index
(
$params
=
[])
{
$ret
=
Service
::
LevelDataList
();
if
(
$ret
[
'code'
]
==
0
)
{
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
(
'../../../plugins/view/membershiplevel/level/index'
);
}
else
{
return
$ret
[
'msg'
];
}
}
/**
* 等级编辑
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
saveinfo
(
$params
=
[])
{
// 数据
$data
=
[];
if
(
!
empty
(
$params
[
'id'
]))
{
$data_params
=
[
'get_id'
=>
$params
[
'id'
],
];
$ret
=
Service
::
LevelDataList
(
$data_params
);
$data
=
empty
(
$ret
[
'data'
])
?
[]
:
$ret
[
'data'
];
}
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
(
'../../../plugins/view/membershiplevel/level/saveinfo'
);
}
/**
* 等级保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
save
(
$params
=
[])
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
return
Service
::
LevelDataSave
(
$params
);
}
/**
* 等级状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
* @param [array] $params [输入参数]
*/
public
function
statusupdate
(
$params
=
[])
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
$params
[
'data_field'
]
=
'level_list'
;
return
Service
::
DataStatusUpdate
(
$params
);
}
/**
* 等级删除
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
* @param [array] $params [输入参数]
*/
public
function
delete
(
$params
=
[])
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
$params
[
'data_field'
]
=
'level_list'
;
return
Service
::
DataDelete
(
$params
);
}
}
?>
\ No newline at end of file
application/plugins/wallet/Service.php
0 → 100755
浏览文件 @
b6f49f5c
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\plugins\wallet
;
use
think\Db
;
use
app\service\PluginsService
;
use
app\service\ResourcesService
;
use
app\service\UserService
;
/**
* 会员等级服务层
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Service
{
// 基础数据附件字段
public
static
$base_config_attachment_field
=
[
'default_level_images'
];
// 等级规则
public
static
$members_level_rules_list
=
[
0
=>
[
'value'
=>
0
,
'name'
=>
'积分(可用积分)'
,
'checked'
=>
true
],
1
=>
[
'value'
=>
1
,
'name'
=>
'消费总额(已完成订单)'
],
];
/**
* 获取等级数据列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
LevelDataList
(
$params
=
[])
{
// 数据字段
$data_field
=
'level_list'
;
// 获取数据
$ret
=
PluginsService
::
PluginsData
(
'wallet'
,
self
::
$base_config_attachment_field
);
$data
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
$data_field
]))
?
[]
:
$ret
[
'data'
][
$data_field
];
// 数据处理
return
self
::
LevelDataHandle
(
$data
,
$params
);
}
/**
* 用户等级数据列表处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-04-27T01:08:23+0800
* @param [array] $data [等级数据]
* @param [array] $params [输入参数]
*/
public
static
function
LevelDataHandle
(
$data
,
$params
=
[])
{
if
(
!
empty
(
$data
))
{
$common_is_enable_tips
=
lang
(
'common_is_enable_tips'
);
foreach
(
$data
as
&
$v
)
{
// 是否启用
$v
[
'is_enable_text'
]
=
$common_is_enable_tips
[
$v
[
'is_enable'
]][
'name'
];
// 图片地址
$v
[
'images_url_old'
]
=
$v
[
'images_url'
];
$v
[
'images_url'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'images_url'
]);
// 时间
$v
[
'operation_time_time'
]
=
empty
(
$v
[
'operation_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'operation_time'
]);
$v
[
'operation_time_date'
]
=
empty
(
$v
[
'operation_time'
])
?
''
:
date
(
'Y-m-d'
,
$v
[
'operation_time'
]);
}
}
// 是否读取单条
if
(
!
empty
(
$params
[
'get_id'
])
&&
isset
(
$data
[
$params
[
'get_id'
]]))
{
$data
=
$data
[
$params
[
'get_id'
]];
}
return
DataReturn
(
'处理成功'
,
0
,
$data
);
}
/**
* 获取等级数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
LevelDataSave
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'length'
,
'key_name'
=>
'name'
,
'checked_data'
=>
'1,30'
,
'error_msg'
=>
'名称长度 1~30 个字符'
,
],
[
'checked_type'
=>
'isset'
,
'key_name'
=>
'rules_min'
,
'error_msg'
=>
'请填写规则最小值'
,
],
[
'checked_type'
=>
'isset'
,
'key_name'
=>
'rules_max'
,
'error_msg'
=>
'请填写规则最大值'
,
],
[
'checked_type'
=>
'max'
,
'key_name'
=>
'discount_rate'
,
'checked_data'
=>
0.99
,
'is_checked'
=>
1
,
'error_msg'
=>
'折扣率应输入 0.00~0.99 的数字,小数保留两位'
,
],
[
'checked_type'
=>
'fun'
,
'key_name'
=>
'order_price'
,
'checked_data'
=>
'CheckPrice'
,
'is_checked'
=>
1
,
'error_msg'
=>
'请输入有效的订单满金额'
,
],
[
'checked_type'
=>
'fun'
,
'key_name'
=>
'full_reduction_price'
,
'checked_data'
=>
'CheckPrice'
,
'is_checked'
=>
1
,
'error_msg'
=>
'请输入有效的满减金额'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 请求参数
$p
=
[
[
'checked_type'
=>
'eq'
,
'key_name'
=>
'rules_min'
,
'checked_data'
=>
$params
[
'rules_max'
],
'error_msg'
=>
'规则最小值不能最大值相等'
,
],
[
'checked_type'
=>
'eq'
,
'key_name'
=>
'rules_max'
,
'checked_data'
=>
$params
[
'rules_min'
],
'error_msg'
=>
'规则最大值不能最小值相等'
,
],
];
if
(
intval
(
$params
[
'rules_max'
])
>
0
)
{
$p
[]
=
[
'checked_type'
=>
'max'
,
'key_name'
=>
'rules_min'
,
'checked_data'
=>
intval
(
$params
[
'rules_max'
]),
'error_msg'
=>
'规则最小值不能大于最大值['
.
intval
(
$params
[
'rules_max'
])
.
']'
,
];
$p
[]
=
[
'checked_type'
=>
'min'
,
'key_name'
=>
'rules_max'
,
'checked_data'
=>
intval
(
$params
[
'rules_min'
]),
'error_msg'
=>
'规则最大值不能小于最小值['
.
intval
(
$params
[
'rules_min'
])
.
']'
,
];
}
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 数据字段
$data_field
=
'level_list'
;
// 附件
$data_fields
=
[
'images_url'
];
$attachment
=
ResourcesService
::
AttachmentParams
(
$params
,
$data_fields
);
// 数据
$data
=
[
'name'
=>
$params
[
'name'
],
'rules_min'
=>
$params
[
'rules_min'
],
'rules_max'
=>
$params
[
'rules_max'
],
'images_url'
=>
$attachment
[
'data'
][
'images_url'
],
'is_enable'
=>
isset
(
$params
[
'is_enable'
])
?
intval
(
$params
[
'is_enable'
])
:
0
,
'discount_rate'
=>
isset
(
$params
[
'discount_rate'
])
?
$params
[
'discount_rate'
]
:
0
,
'order_price'
=>
empty
(
$params
[
'order_price'
])
?
0.00
:
PriceNumberFormat
(
$params
[
'order_price'
]),
'full_reduction_price'
=>
empty
(
$params
[
'full_reduction_price'
])
?
0.00
:
PriceNumberFormat
(
$params
[
'full_reduction_price'
]),
'operation_time'
=>
time
(),
];
// 原有数据
$ret
=
PluginsService
::
PluginsData
(
'wallet'
,
self
::
$base_config_attachment_field
,
false
);
// 数据id
$data
[
'id'
]
=
(
empty
(
$params
[
'id'
])
||
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
$data_field
][
$params
[
'id'
]]))
?
date
(
'YmdHis'
)
.
GetNumberCode
(
6
)
:
$params
[
'id'
];
$ret
[
'data'
][
$data_field
][
$data
[
'id'
]]
=
$data
;
// 保存
return
PluginsService
::
PluginsDataSave
([
'plugins'
=>
'wallet'
,
'data'
=>
$ret
[
'data'
]]);
}
/**
* 数据删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
DataDelete
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 数据字段
$data_field
=
empty
(
$params
[
'data_field'
])
?
'data_list'
:
$params
[
'data_field'
];
// 原有数据
$ret
=
PluginsService
::
PluginsData
(
'wallet'
,
self
::
$base_config_attachment_field
,
false
);
$ret
[
'data'
][
$data_field
]
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
$data_field
]))
?
[]
:
$ret
[
'data'
][
$data_field
];
// 删除操作
if
(
isset
(
$ret
[
'data'
][
$data_field
][
$params
[
'id'
]]))
{
unset
(
$ret
[
'data'
][
$data_field
][
$params
[
'id'
]]);
}
// 保存
return
PluginsService
::
PluginsDataSave
([
'plugins'
=>
'wallet'
,
'data'
=>
$ret
[
'data'
]]);
}
/**
* 数据状态更新
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
DataStatusUpdate
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'field'
,
'error_msg'
=>
'操作字段有误'
,
],
[
'checked_type'
=>
'in'
,
'key_name'
=>
'state'
,
'checked_data'
=>
[
0
,
1
],
'error_msg'
=>
'状态有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 数据字段
$data_field
=
empty
(
$params
[
'data_field'
])
?
'data_list'
:
$params
[
'data_field'
];
// 原有数据
$ret
=
PluginsService
::
PluginsData
(
'wallet'
,
self
::
$base_config_attachment_field
,
false
);
$ret
[
'data'
][
$data_field
]
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
$data_field
]))
?
[]
:
$ret
[
'data'
][
$data_field
];
// 删除操作
if
(
isset
(
$ret
[
'data'
][
$data_field
][
$params
[
'id'
]])
&&
is_array
(
$ret
[
'data'
][
$data_field
][
$params
[
'id'
]]))
{
$ret
[
'data'
][
$data_field
][
$params
[
'id'
]][
$params
[
'field'
]]
=
intval
(
$params
[
'state'
]);
$ret
[
'data'
][
$data_field
][
$params
[
'id'
]][
'operation_time'
]
=
time
();
}
// 保存
return
PluginsService
::
PluginsDataSave
([
'plugins'
=>
'wallet'
,
'data'
=>
$ret
[
'data'
]]);
}
/**
* 优惠价格计算
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-26
* @desc description
* @param [string] $price [商品展示金额]
* @param [int] $plugins_discount [折扣系数]
* @param [int] $plugins_price [减金额]
*/
public
static
function
PriceCalculate
(
$price
,
$plugins_discount
=
0
,
$plugins_price
=
0
)
{
if
(
$plugins_discount
<=
0
&&
$plugins_price
<=
0
)
{
return
$price
;
}
// 折扣
if
(
$plugins_discount
>
0
)
{
if
(
stripos
(
$price
,
'-'
)
!==
false
)
{
$text
=
explode
(
'-'
,
$price
);
$min_price
=
$text
[
0
]
*
$plugins_discount
;
$max_price
=
$text
[
1
]
*
$plugins_discount
;
$price
=
(
$min_price
<=
0
)
?
'0.00'
:
PriceNumberFormat
(
$min_price
);
$price
.
=
'-'
.
((
$max_price
<=
0
)
?
'0.00'
:
PriceNumberFormat
(
$max_price
));
}
else
{
$price
=
(
float
)
$price
*
$plugins_discount
;
$price
=
(
$price
<=
0
)
?
'0.00'
:
PriceNumberFormat
(
$price
);
}
}
// 减金额
if
(
$plugins_price
>
0
)
{
if
(
stripos
(
$price
,
'-'
)
!==
false
)
{
$text
=
explode
(
'-'
,
$price
);
$min_price
=
$text
[
0
]
-
$plugins_price
;
$max_price
=
$text
[
1
]
-
$plugins_price
;
$price
=
(
$min_price
<=
0
)
?
'0.00'
:
PriceNumberFormat
(
$min_price
);
$price
.
=
'-'
.
((
$max_price
<=
0
)
?
'0.00'
:
PriceNumberFormat
(
$max_price
));
}
else
{
$price
=
(
float
)
$price
-
$plugins_price
;
$price
=
(
$price
<=
0
)
?
'0.00'
:
PriceNumberFormat
(
$price
);
}
}
return
$price
;
}
/**
* 用户等级匹配
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-28
* @desc description
* @param [array] $user [用户信息]
*/
public
static
function
UserLevelMatching
(
$user
=
[])
{
// 未指定用户信息,则从服务层读取
if
(
empty
(
$user
))
{
$user
=
UserService
::
LoginUserInfo
();
}
if
(
!
empty
(
$user
))
{
// 缓存key
$key
=
'plugins_wallet_cache_user_level_'
.
$user
[
'id'
];
$level
=
cache
(
$key
);
// 应用配置
if
(
empty
(
$level
)
||
config
(
'app_debug'
)
==
true
)
{
$base
=
PluginsService
::
PluginsData
(
'wallet'
,
Service
::
$base_config_attachment_field
);
if
(
!
empty
(
$base
[
'data'
][
'level_list'
]))
{
// 匹配类型
$value
=
0
;
switch
(
$base
[
'data'
][
'level_rules'
])
{
// 积分(可用积分)
case
0
:
$value
=
isset
(
$user
[
'integral'
])
?
intval
(
$user
[
'integral'
])
:
0
;
break
;
// 消费总额(已完成订单)
// 订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)
case
1
:
$where
=
[
'user_id'
=>
$user
[
'id'
],
'status'
=>
4
];
$value
=
(
float
)
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
sum
(
'total_price'
);
break
;
}
// 匹配相应的等级
$level_list
=
self
::
LevelDataHandle
(
$base
[
'data'
][
'level_list'
]);
foreach
(
$level_list
[
'data'
]
as
$rules
)
{
if
(
isset
(
$rules
[
'is_enable'
])
&&
$rules
[
'is_enable'
]
==
1
)
{
// 0-*
if
(
$rules
[
'rules_min'
]
<=
0
&&
$rules
[
'rules_max'
]
>
0
&&
$value
<
$rules
[
'rules_max'
])
{
$level
=
$rules
;
break
;
}
// *-*
if
(
$rules
[
'rules_min'
]
>
0
&&
$rules
[
'rules_max'
]
>
0
&&
$value
>=
$rules
[
'rules_min'
]
&&
$value
<
$rules
[
'rules_max'
])
{
$level
=
$rules
;
break
;
}
// *-0
if
(
$rules
[
'rules_max'
]
<=
0
&&
$rules
[
'rules_min'
]
>
0
&&
$value
>
$rules
[
'rules_min'
])
{
$level
=
$rules
;
break
;
}
}
}
// 等级icon
if
(
!
empty
(
$level
)
&&
empty
(
$level
[
'images_url'
]))
{
$level
[
'images_url'
]
=
empty
(
$base
[
'data'
][
'default_level_images'
])
?
config
(
'shopxo.attachment_host'
)
.
'/static/plugins/images/wallet/level-default-images.png'
:
$base
[
'data'
][
'default_level_images'
];
}
cache
(
$key
,
$level
);
}
}
return
$level
;
}
return
[];
}
}
?>
\ No newline at end of file
application/plugins/wallet/Wallet.php
0 → 100755
浏览文件 @
b6f49f5c
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\plugins\wallet
;
use
think\Controller
;
use
app\plugins\wallet\Service
;
use
app\service\PluginsService
;
use
app\service\UserService
;
use
app\service\IntegralService
;
use
app\service\PaymentService
;
/**
* 我的钱包 - 钱包
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Wallet
extends
Controller
{
private
$user
;
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-15
* @desc description
*/
public
function
__construct
()
{
parent
::
__construct
();
// 用户信息
$this
->
user
=
UserService
::
LoginUserInfo
();
// 登录校验
if
(
empty
(
$this
->
user
))
{
if
(
IS_AJAX
)
{
exit
(
json_encode
(
DataReturn
(
'登录失效,请重新登录'
,
-
400
)));
}
else
{
return
$this
->
redirect
(
'index/user/logininfo'
);
}
}
// 发起支付 - 支付方式
$this
->
assign
(
'buy_payment_list'
,
PaymentService
::
BuyPaymentList
([
'is_enable'
=>
1
,
'is_open_user'
=>
1
]));
}
/**
* 钱包明细
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-03-15T23:51:50+0800
* @param [array] $params [输入参数]
*/
public
function
index
(
$params
=
[])
{
// 参数
$params
=
input
();
$params
[
'user'
]
=
$this
->
user
;
// 分页
$number
=
10
;
// 条件
$where
=
IntegralService
::
UserIntegralLogListWhere
(
$params
);
// 获取总数
$total
=
IntegralService
::
UserIntegralLogTotal
(
$where
);
// 分页
$page_params
=
array
(
'number'
=>
$number
,
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
MyUrl
(
'index/userintegral/index'
),
);
$page
=
new
\
base\Page
(
$page_params
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
// 获取列表
$data_params
=
array
(
'm'
=>
$page
->
GetPageStarNumber
(),
'n'
=>
$number
,
'where'
=>
$where
,
);
$data
=
IntegralService
::
UserIntegralLogList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
// 操作类型
$this
->
assign
(
'common_integral_log_type_list'
,
lang
(
'common_integral_log_type_list'
));
// 参数
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
(
'../../../plugins/view/wallet/wallet/index'
);
}
/**
* 充值明细
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-03-15T23:51:50+0800
* @param [array] $params [输入参数]
*/
public
function
recharge
(
$params
=
[])
{
// 参数
$params
=
input
();
$params
[
'user'
]
=
$this
->
user
;
$this
->
assign
(
'data_list'
,
[]);
// 参数
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
(
'../../../plugins/view/wallet/wallet/recharge'
);
}
/**
* 余额提现
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-03-15T23:51:50+0800
* @param [array] $params [输入参数]
*/
public
function
cash
(
$params
=
[])
{
// 参数
$params
=
input
();
$params
[
'user'
]
=
$this
->
user
;
$this
->
assign
(
'data_list'
,
[]);
// 参数
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
(
'../../../plugins/view/wallet/wallet/cash'
);
}
/**
* 宠物添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-03-15T23:51:50+0800
* @param [array] $params [输入参数]
*/
public
function
saveinfo
(
$params
=
[])
{
// 是否绑定
if
(
!
empty
(
$params
[
'pest_no'
]))
{
$data_params
=
array
(
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
[
'pest_no'
=>
$params
[
'pest_no'
]],
);
$ret
=
Service
::
PetsList
(
$data_params
);
if
(
!
empty
(
$ret
[
'data'
][
0
][
'user_id'
]))
{
$this
->
assign
(
'msg'
,
'该宠物已被绑定'
);
return
$this
->
fetch
(
'public/tips_error'
);
}
$this
->
assign
(
'pest_no'
,
$params
[
'pest_no'
]);
unset
(
$params
[
'pest_no'
]);
}
// 获取数据
$data
=
[];
if
(
!
empty
(
$params
[
'id'
]))
{
$data_params
=
array
(
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
[
'id'
=>
intval
(
$params
[
'id'
])],
);
$ret
=
Service
::
PetsList
(
$data_params
);
if
(
!
empty
(
$ret
[
'data'
][
0
]))
{
$ret
[
'data'
][
0
][
'lose_features'
]
=
str_replace
(
'<br />'
,
"
\n
"
,
$ret
[
'data'
][
0
][
'lose_features'
]);
$data
=
$ret
[
'data'
][
0
];
}
unset
(
$params
[
'id'
]);
}
$this
->
assign
(
'params'
,
$params
);
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'pets_attribute_status_list'
,
Service
::
$pets_attribute_status_list
);
$this
->
assign
(
'pets_attribute_is_text_list'
,
Service
::
$pets_attribute_is_text_list
);
$this
->
assign
(
'pets_attribute_gender_list'
,
Service
::
$pets_attribute_gender_list
);
$this
->
assign
(
'pets_attribute_type_list'
,
Service
::
$pets_attribute_type_list
);
return
$this
->
fetch
(
'../../../plugins/view/wallet/pets/saveinfo'
);
}
/**
* 宠物添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-03-15T23:51:50+0800
* @param [array] $params [输入参数]
*/
public
function
save
(
$params
=
[])
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 用户
$params
[
'user_id'
]
=
$this
->
user
[
'id'
];
return
Service
::
PetsSave
(
$params
);
}
/**
* 宠物解绑
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-15T11:03:30+0800
*/
public
function
untying
(
$params
=
[])
{
// 是否ajax
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 用户
$params
[
'user_id'
]
=
$this
->
user
[
'id'
];
return
Service
::
PetsUntying
(
$params
);
}
/**
* 丢失提供信息添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-03-15T23:51:50+0800
* @param [array] $params [输入参数]
*/
public
function
helpsave
(
$params
=
[])
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 用户
$params
[
'user_id'
]
=
$this
->
user
[
'id'
];
return
Service
::
HelpSave
(
$params
);
}
}
?>
\ No newline at end of file
application/plugins/wallet/config.json
0 → 100755
浏览文件 @
b6f49f5c
{
"base"
:{
"plugins"
:
"wallet"
,
"name"
:
"钱包"
,
"logo"
:
"
\/
static
\/
upload
\/
images
\/
plugins_wallet
\/
2019
\/
04
\/
28
\/
1556447296647734.jpg"
,
"author"
:
"Devil"
,
"author_url"
:
"https:
\/\/
shopxo.net
\/
"
,
"version"
:
"1.0.0"
,
"desc"
:
"用户钱包,在线充值,提现"
,
"apply_terminal"
:[
"pc"
,
"h5"
,
"app"
,
"alipay"
,
"weixin"
,
"baidu"
],
"apply_version"
:[
"1.5.0"
],
"is_home"
:
false
},
"hook"
:{
"plugins_service_users_center_left_menu_handle"
:[
"app
\\
plugins
\\
wallet
\\
Hook"
],
"plugins_service_header_navigation_top_right_handle"
:[
"app
\\
plugins
\\
wallet
\\
Hook"
]
}
}
\ No newline at end of file
application/service/NavigationService.php
浏览文件 @
b6f49f5c
...
...
@@ -515,7 +515,7 @@ class NavigationService
'items'
=>
[],
],
[
'name'
=>
'我的
业务
'
,
'name'
=>
'我的
商城
'
,
'is_login'
=>
1
,
'badge'
=>
null
,
'icon'
=>
'am-icon-cube'
,
...
...
@@ -691,15 +691,15 @@ class NavigationService
// 菜单列表
$data
=
[
[
'center'
=>
[
'name'
=>
'个人中心'
,
'url'
=>
MyUrl
(
'index/user/index'
),
'is_show'
=>
1
,
'contains'
=>
[
'userindex'
],
'icon'
=>
'am-icon-home'
,
],
[
'name'
=>
'
交易
管理'
,
'business'
=>
[
'name'
=>
'
业务
管理'
,
'is_show'
=>
1
,
'icon'
=>
'am-icon-cube'
,
'item'
=>
[
...
...
@@ -719,7 +719,7 @@ class NavigationService
],
]
],
[
'base'
=>
[
'name'
=>
'资料管理'
,
'is_show'
=>
1
,
'icon'
=>
'am-icon-user'
,
...
...
@@ -768,7 +768,7 @@ class NavigationService
],
]
],
[
'property'
=>
[
'name'
=>
'财产中心'
,
'is_show'
=>
1
,
'icon'
=>
'am-icon-trophy'
,
...
...
@@ -782,7 +782,7 @@ class NavigationService
],
]
],
[
'logout'
=>
[
'name'
=>
'安全退出'
,
'url'
=>
MyUrl
(
'index/user/logout'
),
'contains'
=>
[
'userlogout'
],
...
...
application/tags.php
浏览文件 @
b6f49f5c
...
...
@@ -122,10 +122,12 @@ return array (
'plugins_service_users_center_left_menu_handle'
=>
array
(
0
=>
'app\\plugins\\petscms\\Hook'
,
1
=>
'app\\plugins\\wallet\\Hook'
,
),
'plugins_service_header_navigation_top_right_handle'
=>
array
(
0
=>
'app\\plugins\\petscms\\Hook'
,
1
=>
'app\\plugins\\wallet\\Hook'
,
),
'plugins_js'
=>
array
(
...
...
config/shopxo.sql
浏览文件 @
b6f49f5c
此差异已折叠。
点击以展开。
public/static/admin/default/css/order.css
浏览文件 @
b6f49f5c
...
...
@@ -33,7 +33,7 @@ form.am-form .am-form-group { padding-right: 5px; }
/**
*
快递
弹窗
*
业务
弹窗
*/
.business-item
h3
{
border-bottom
:
3px
solid
#e3e3e3
;
margin
:
5px
0
0
0
;
font-size
:
14px
;
font-weight
:
700
;
}
.business-item
ul
{
padding
:
10px
3px
5px
5px
;
overflow
:
hidden
;
}
...
...
public/static/index/default/css/common.css
浏览文件 @
b6f49f5c
...
...
@@ -60,19 +60,6 @@ input.add,input.min{width:15px}
.last
{
border-right
:
none
!important
;}
.am-container
{
margin
:
0
auto
;
}
/*选项卡样式定义*/
.am-nav-tabs
,
.am-tabs-bd
{
border-color
:
transparent
;}
.am-nav-tabs
>
li
.am-active
>
a
,
.am-nav-tabs
>
li
.am-active
>
a
:hover
,
.am-nav-tabs
>
li
.am-active
>
a
:focus
,
.am-nav-tabs
>
li
>
a
:hover
,
.am-nav-tabs
>
li
>
a
:focus
{
color
:
#555555
;
background
:
none
;
border-color
:
transparent
;
cursor
:
default
;}
.am-nav-tabs
>
li
{
border-bottom
:
2px
solid
transparent
;}
.am-nav-tabs
>
li
.am-active
{
border-bottom
:
2px
solid
#d2364c
;}
.am-tabs-nav
li
{
height
:
36px
;
font-size
:
14px
;
line-height
:
36px
;}
.am-tabs-nav
li
a
,
.am-tabs-nav
li
.am-active
a
,
.am-tabs-nav
li
{
cursor
:
pointer
;}
/*选项卡样式*/
.am-nav-tabs
>
li
span
{
font-size
:
14px
;
font-weight
:
500
;}
.am-nav-tabs
>
li
.am-active
span
{
color
:
#E4393C
;}
/* 商品分类 */
#goods-category
{
position
:
relative
;
top
:
-45px
;
}
...
...
public/static/index/default/css/goods.css
浏览文件 @
b6f49f5c
...
...
@@ -133,8 +133,22 @@ fieldset legend{margin-left:15px;padding-left:3px;padding-right:3px;color:#333;}
.introduce-main
.am-nav-tabs
>
li
.am-active
{
border-bottom
:
2px
solid
#F03726
;
}
/*导航固定*/
ul
.am-tabs-nav.am-nav.am-nav-tabs
{
background
:
#F5F5F5
;}
/*导航*/
.introduce
ul
.am-tabs-nav.am-nav.am-nav-tabs
{
background
:
#F5F5F5
;}
.introduce
.am-nav-tabs
,
.introduce
.am-tabs-bd
{
border-color
:
transparent
;}
.introduce
.am-nav-tabs
>
li
.am-active
>
a
,
.introduce
.am-nav-tabs
>
li
.am-active
>
a
:hover
,
.introduce
.am-nav-tabs
>
li
.am-active
>
a
:focus
,
.introduce
.am-nav-tabs
>
li
>
a
:hover
,
.introduce
.am-nav-tabs
>
li
>
a
:focus
{
color
:
#555555
;
background
:
none
;
border-color
:
transparent
;
cursor
:
default
;}
.introduce
.am-nav-tabs
>
li
{
border-bottom
:
2px
solid
transparent
;}
.introduce
.am-nav-tabs
>
li
.am-active
{
border-bottom
:
2px
solid
#d2364c
;}
.introduce
.am-tabs-nav
li
{
height
:
36px
;
font-size
:
14px
;
line-height
:
36px
;}
.introduce
.am-tabs-nav
li
a
,
.introduce
.am-tabs-nav
li
.am-active
a
,
.introduce
.am-tabs-nav
li
{
cursor
:
pointer
;}
.introduce
.am-nav-tabs
>
li
span
{
font-size
:
14px
;
font-weight
:
500
;}
.introduce
.am-nav-tabs
>
li
.am-active
span
{
color
:
#E4393C
;}
/*tab*/
...
...
public/static/index/default/css/userintegral.css
浏览文件 @
b6f49f5c
...
...
@@ -49,5 +49,5 @@
background
:
#e7e3d9
;
padding
:
3px
6px
;
border
:
1px
solid
#e7d8c2
;
margin-left
:
5
px
;
margin-left
:
10
px
;
}
\ No newline at end of file
public/static/plugins/css/wallet/wallet.css
0 → 100644
浏览文件 @
b6f49f5c
/* 筛选 */
.thin
,
.pay-list
{
overflow
:
hidden
;
}
.thin
.so
{
width
:
66%
;
}
.thin_sub
{
font-weight
:
100
;
margin
:
10px
0px
0px
10px
;
cursor
:
pointer
;
}
.so-list
{
width
:
100%
;
margin-top
:
20px
;
}
.so-list
*
{
font-size
:
1.2rem
!important
;
}
.so-list
input
{
height
:
28px
;
display
:
inline
!important
;
}
.time
input
,
.so-list
.chosen-container
{
background
:
#FFF
!important
;
}
.time
input
{
width
:
100px
!important
;
}
.time
i
{
position
:
absolute
;
margin
:
4px
0px
0px
-15px
;
}
.price
input
{
width
:
101px
!important
;
}
.time
,
.time
{
width
:
50%
;
}
.so-list
tr
+
tr
>
td
{
padding-top
:
10px
;
}
.so-list
.chosen-container
{
border-radius
:
2px
;
}
.text-grey
{
color
:
#999
;
}
.chosen-container-single
.chosen-single
,
.so-list
select
{
height
:
28px
;
line-height
:
28px
;
width
:
100%
;
}
.reset-submit
{
margin-left
:
20px
;
}
.so-list
select
{
padding
:
0
0
0
8px
;
}
@media
only
screen
and
(
min-width
:
641px
){
.so-list
.chosen-container
,
.so-list
select
{
width
:
217px
!important
;
display
:
-webkit-inline-box
;
}
.thin_sub
:hover
{
color
:
#F60
;
}
}
@media
only
screen
and
(
max-width
:
641px
){
.so-list
input
{
width
:
40%
!important
;
}
.so-list
td
{
width
:
100%
;
display
:
block
;
}
.so-list
tr
td
:last-child
{
margin-top
:
10px
;
}
.so-list
.chosen-container
{
width
:
85%
;
}
.so-list
.chosen-container
{
width
:
100%
;
}
.so-list
tr
td
:last-child
{
padding-top
:
0px
!important
;
}
.chosen-container-single
.chosen-search
input
[
type
=
"text"
]
{
width
:
100%
!important
;
}
.so-list
select
{
width
:
calc
(
100%
-
44px
);
display
:
-webkit-inline-box
;
}
}
/**
* 账户信息
*/
.user-content-body
.available
.integral-value
{
color
:
#4CAF50
;
}
.user-content-body
.locking
{
margin-top
:
5px
;
}
.user-content-body
.locking
.integral-value
{
color
:
#FF9800
;
}
.user-content-body
.integral-value
{
font-size
:
18px
;
font-weight
:
700
;
}
.user-content-body
.integral-tips
{
color
:
#c27300
;
background
:
#e7e3d9
;
padding
:
3px
6px
;
border
:
1px
solid
#e7d8c2
;
margin-left
:
10px
;
}
/**
* 导航
*/
.user-content-body
.am-nav
{
border-bottom
:
1px
solid
#eee
;
}
.user-content-body
.am-nav
li
{
margin-bottom
:
-1px
;
}
.user-content-body
.am-nav
li
a
{
font-size
:
14px
;
}
.user-content-body
.am-nav
.am-active
{
border-bottom
:
2px
solid
#ed5565
;
}
.user-content-body
.am-nav
>
li
>
a
:hover
,
.user-content-body
.am-nav
>
li
>
a
:focus
{
background
:
transparent
;
}
.user-content-body
.am-nav
.am-topbar-right
{
margin-right
:
0
;
}
.user-content-body
.am-nav
.am-topbar-right
.am-btn
:not
(
:last-child
)
{
margin-right
:
5px
;
}
.user-content-body
.am-nav
.am-topbar-right
.am-topbar-btn
{
margin-top
:
0
;
}
/**
* 业务弹窗
*/
.user-content-body
.business-item
h3
{
font-weight
:
700
;
}
.user-content-body
.business-item
ul
{
padding
:
5px
1px
;
overflow
:
hidden
;
}
.user-content-body
.business-item
ul
li
{
border
:
1px
solid
transparent
;
overflow
:
hidden
;
float
:
left
;
cursor
:
pointer
;
padding
:
5px
;
border
:
1px
solid
#eee
;
margin
:
0
10px
10px
0
;
background
:
#fff
;
}
.user-content-body
.business-item
ul
li
img
{
width
:
36px
;
height
:
36px
;
}
.user-content-body
.business-item
ul
li
:hover
,
.user-content-body
.business-item
ul
li
.selected
{
border-color
:
#e23f36
;
position
:
relative
;
box-shadow
:
0px
0
0px
1px
#e23f36
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
.user-content-body
.business-item
ul
li
{
width
:
calc
(
33%
-
5px
);
}
.user-content-body
.business-item
ul
li
:nth-child
(
3
n
)
{
margin-right
:
0
;
}
}
@media
only
screen
and
(
max-width
:
640px
)
{
.user-content-body
.business-item
ul
li
{
width
:
calc
(
50%
-
5px
);
}
.user-content-body
.business-item
ul
li
:nth-child
(
2
n
)
{
margin-right
:
0
;
}
}
/**
* 充值窗口
*/
#plugins-recharge-pay-modal-popup
input
[
name
=
"payment_id"
]
{
margin-left
:
-10000px
;
position
:
absolute
;
}
\ No newline at end of file
public/static/plugins/js/wallet/wallet.js
0 → 100644
浏览文件 @
b6f49f5c
$
(
function
()
{
// 支付操作表单
FromInit
(
'
form.form-validation-plugins-recharge-pay
'
);
// 混合列表选择
$
(
'
.business-item ul li
'
).
on
(
'
click
'
,
function
()
{
if
(
$
(
this
).
hasClass
(
'
selected
'
))
{
$
(
'
form.form-validation-plugins-recharge-pay input[name=
'
+
$
(
this
).
parent
().
data
(
'
type
'
)
+
'
_id]
'
).
val
(
0
);
$
(
this
).
removeClass
(
'
selected
'
);
}
else
{
$
(
'
form.form-validation-plugins-recharge-pay input[name=
'
+
$
(
this
).
parent
().
data
(
'
type
'
)
+
'
_id]
'
).
val
(
$
(
this
).
data
(
'
value
'
));
$
(
this
).
addClass
(
'
selected
'
).
siblings
(
'
li
'
).
removeClass
(
'
selected
'
);
}
});
});
\ No newline at end of file
public/static/upload/images/plugins_wallet/2019/04/28/1556447296647734.jpg
0 → 100644
浏览文件 @
b6f49f5c
2.8 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录