Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
13437246
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
13437246
编写于
4月 28, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
会员等级
上级
672cf994
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
136 addition
and
46 deletion
+136
-46
application/index/view/default/index/index.html
application/index/view/default/index/index.html
+7
-2
application/index/view/default/public/header_top_nav.html
application/index/view/default/public/header_top_nav.html
+8
-2
application/index/view/default/user/index.html
application/index/view/default/user/index.html
+7
-2
application/plugins/membershiplevel/Hook.php
application/plugins/membershiplevel/Hook.php
+29
-1
application/plugins/membershiplevel/Service.php
application/plugins/membershiplevel/Service.php
+25
-17
application/plugins/membershiplevel/config.json
application/plugins/membershiplevel/config.json
+3
-0
application/plugins/view/membershiplevel/level/saveinfo.html
application/plugins/view/membershiplevel/level/saveinfo.html
+8
-5
application/service/UserService.php
application/service/UserService.php
+9
-0
application/tags.php
application/tags.php
+4
-0
config/shopxo.sql
config/shopxo.sql
+13
-13
public/static/index/default/css/common.css
public/static/index/default/css/common.css
+9
-3
public/static/index/default/css/user.index.css
public/static/index/default/css/user.index.css
+1
-1
public/static/plugins/css/membershiplevel/style.css
public/static/plugins/css/membershiplevel/style.css
+13
-0
public/static/plugins/images/membershiplevel/flash.gif
public/static/plugins/images/membershiplevel/flash.gif
+0
-0
public/static/plugins/images/membershiplevel/level-default-images.png
...c/plugins/images/membershiplevel/level-default-images.png
+0
-0
未找到文件。
application/index/view/default/index/index.html
浏览文件 @
13437246
...
...
@@ -47,9 +47,14 @@
<em>
<span
class=
"s-name"
>
{{if !empty($user)}}
Hi, {{$user.user_name_view}}
<em>
Hi,
</em>
{{if !empty($user['icon'])}}
<img
src=
"{{$user.icon}}"
class=
"common-user-icon"
{{
if
!
empty
($
user
['
icon_title
'])}}
title=
"{{$user.icon_title}}"
{{/
if
}}
/>
{{/if}}
<em>
{{$user.user_name_view}}
</em>
{{else /}}
您好,欢迎来到 {{:MyC('home_site_name')}}
<em>
您好,欢迎来到
</em>
<em>
{{:MyC('home_site_name')}}
</em>
{{/if}}
</span>
</em>
...
...
application/index/view/default/public/header_top_nav.html
浏览文件 @
13437246
...
...
@@ -5,7 +5,8 @@
<div
class=
"top-nav-items"
>
<div
class=
"menu-hd"
>
{{if empty($user)}}
<span>
您好,欢迎来到 {{:MyC('home_site_name')}}
</span>
<em>
您好,欢迎来到
</em>
<em>
{{:MyC('home_site_name')}}
</em>
{{if MyC('home_user_login_state') eq 1}}
[
<a
href=
"{{:MyUrl('index/user/logininfo')}}"
>
登录
</a>
]
{{/if}}
...
...
@@ -13,7 +14,12 @@
[
<a
href=
"{{:MyUrl('index/user/regInfo')}}"
>
注册
</a>
]
{{/if}}
{{else /}}
<span>
您好 {{$user.user_name_view}},欢迎来到 {{:MyC('home_site_name')}}
</span>
<em>
您好
</em>
{{if !empty($user['icon'])}}
<img
src=
"{{$user.icon}}"
class=
"common-user-icon"
{{
if
!
empty
($
user
['
icon_title
'])}}
title=
"{{$user.icon_title}}"
{{/
if
}}
/>
{{/if}}
<em>
{{$user.user_name_view}},欢迎来到
</em>
<em>
{{:MyC('home_site_name')}}
</em>
[
<a
href=
"{{:MyUrl('index/user/logout')}}"
>
退出
</a>
]
{{/if}}
...
...
application/index/view/default/user/index.html
浏览文件 @
13437246
...
...
@@ -44,8 +44,13 @@
<div
class=
"user-base"
>
<div
class=
"user-base-left"
>
<div
class=
"user-avatar"
>
<img
src=
"{{$user.avatar}}"
/>
<p
class=
"user-name"
>
{{$user.user_name_view}}
</p>
<img
src=
"{{$user.avatar}}"
class=
"avatar"
/>
<div
class=
"user-name"
>
{{if !empty($user['icon'])}}
<img
src=
"{{$user.icon}}"
class=
"common-user-icon"
{{
if
!
empty
($
user
['
icon_title
'])}}
title=
"{{$user.icon_title}}"
{{/
if
}}
/>
{{/if}}
<span>
{{$user.user_name_view}}
</span>
</div>
</div>
<div
class=
"items"
>
<a
href=
"javascript:;"
class=
"am-icon-camera-retro"
data-am-modal=
"{target:'#user-avatar-popup'}"
>
修改头像
</a>
...
...
application/plugins/membershiplevel/Hook.php
浏览文件 @
13437246
...
...
@@ -73,6 +73,11 @@ class Hook extends Controller
case
'plugins_service_buy_handle'
:
$ret
=
$this
->
FullReductionCalculate
(
$params
);
break
;
// 用户登录成功信息纪录钩子 icon处理
case
'plugins_service_user_login_success_record'
:
$ret
=
$this
->
UserLoginSuccessIconHandle
(
$params
);
break
;
}
return
$ret
;
}
else
{
...
...
@@ -80,6 +85,29 @@ class Hook extends Controller
}
}
/**
* 用户icon处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-28
* @desc description
* @param [array] $params [输入参数]
*/
private
function
UserLoginSuccessIconHandle
(
$params
=
[])
{
if
(
!
empty
(
$params
[
'user'
]))
{
// 用户等级
$level
=
Service
::
UserLevelMatching
(
$params
[
'user'
]);
if
(
!
empty
(
$level
)
&&
$level
[
'images_url'
])
{
$params
[
'user'
][
'icon'
]
=
$level
[
'images_url'
];
}
}
return
DataReturn
(
'处理成功'
,
0
);
}
/**
* 满减计算
* @author Devil
...
...
@@ -136,7 +164,7 @@ class Hook extends Controller
// 价格处理
$goods
[
'price'
]
=
Service
::
PriceCalculate
(
$goods
[
'price'
],
$level
[
'discount_rate'
],
0
);
$price_title
=
empty
(
$level
[
'name'
])
?
'会员价'
:
$level
[
'name'
];
$goods
[
'show_field_price_text'
]
=
'<span class="plugins-membershiplevel-goods-price-icon">'
.
$price_title
.
'</span>'
;
$goods
[
'show_field_price_text'
]
=
'<span class="plugins-membershiplevel-goods-price-icon"
title="'
.
$price_title
.
'"
>'
.
$price_title
.
'</span>'
;
}
}
...
...
application/plugins/membershiplevel/Service.php
浏览文件 @
13437246
...
...
@@ -114,12 +114,6 @@ class Service
'checked_data'
=>
'1,30'
,
'error_msg'
=>
'名称长度 1~30 个字符'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'images_url'
,
'checked_data'
=>
'255'
,
'error_msg'
=>
'请上传图标'
,
],
[
'checked_type'
=>
'isset'
,
'key_name'
=>
'rules_min'
,
...
...
@@ -172,19 +166,22 @@ class Service
'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
)
{
...
...
@@ -373,14 +370,19 @@ class Service
/**
* 用户等级匹配
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-04-27T00:32:00+0800
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-28
* @desc description
* @param [array] $user [用户信息]
*/
public
static
function
UserLevelMatching
()
public
static
function
UserLevelMatching
(
$user
=
[]
)
{
// 用户
$user
=
UserService
::
LoginUserInfo
();
// 未指定用户信息,则从服务层读取
if
(
empty
(
$user
))
{
$user
=
UserService
::
LoginUserInfo
();
}
if
(
!
empty
(
$user
))
{
// 缓存key
...
...
@@ -438,6 +440,12 @@ class Service
}
}
}
// 等级icon
if
(
!
empty
(
$level
)
&&
empty
(
$level
[
'images_url'
]))
{
$level
[
'images_url'
]
=
empty
(
$base
[
'data'
][
'default_level_images'
])
?
config
(
'shopxo.attachment_host'
)
.
'/static/plugins/images/membershiplevel/level-default-images.png'
:
$base
[
'data'
][
'default_level_images'
];
}
cache
(
$key
,
$level
);
}
}
...
...
application/plugins/membershiplevel/config.json
浏览文件 @
13437246
...
...
@@ -32,6 +32,9 @@
],
"plugins_service_buy_handle"
:[
"app
\\
plugins
\\
membershiplevel
\\
Hook"
],
"plugins_service_user_login_success_record"
:[
"app
\\
plugins
\\
membershiplevel
\\
Hook"
]
}
}
\ No newline at end of file
application/plugins/view/membershiplevel/level/saveinfo.html
浏览文件 @
13437246
...
...
@@ -24,11 +24,14 @@
<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=
"0"
data-dialog-type=
"images"
>
<li>
<input
type=
"text"
name=
"images_url"
value=
"{{if !empty($data['images_url'])}}{{$data.images_url}}{{/if}}"
data-validation-message=
"请上传图标"
required
/>
<img
src=
"{{if !empty($data['images_url'])}}{{$data.images_url}}{{else /}}{{$attachment_host}}/static/plugins/images/membershiplevel/default-images.jpg{{/if}}"
/>
</li>
<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>
...
...
application/service/UserService.php
浏览文件 @
13437246
...
...
@@ -753,6 +753,15 @@ class UserService
$user
[
'avatar'
]
=
config
(
'shopxo.attachment_host'
)
.
'/static/index/'
.
strtolower
(
config
(
'DEFAULT_THEME'
,
'default'
))
.
'/images/default-user-avatar.jpg'
;
}
// 用户登录成功信息纪录钩子
$hook_name
=
'plugins_service_user_login_success_record'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'user'
=>
&
$user
,
'user_id'
=>
$user_id
]);
if
(
$is_app
==
true
)
{
return
$user
;
...
...
application/tags.php
浏览文件 @
13437246
...
...
@@ -151,5 +151,9 @@ return array (
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
),
'plugins_service_user_login_success_record'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
),
);
?>
\ No newline at end of file
config/shopxo.sql
浏览文件 @
13437246
此差异已折叠。
点击以展开。
public/static/index/default/css/common.css
浏览文件 @
13437246
...
...
@@ -130,9 +130,9 @@ color: #F5F5F2;font-size: 12px;cursor:pointer;border-radius:0px 0px; position: a
.am-footer
{
text-align
:
center
;
display
:
block
;
position
:
relative
;
margin
:
0px
auto
;
padding
:
10px
0px
;
}
/* 导航上用户 */
.navigation-user
{
display
:
block
;
position
:
absolute
;
right
:
0px
;
top
:
0px
;
font-size
:
14px
;
line-height
:
33px
;
height
:
33px
;
width
:
110
px
;
text-align
:
center
;
background
:
#e1363f
;
cursor
:
pointer
;}
.navigation-user
.nav-user
{
background
:
#e0313b
;
width
:
33px
;
height
:
33px
;
border-radius
:
33px
;
position
:
absolute
;
left
:
-28
px
;
z-index
:
2
;
padding
:
1px
;
overflow
:
hidden
;}
.navigation-user
b
{
display
:
block
;
position
:
absolute
;
width
:
40px
;
height
:
40px
;
border-radius
:
45px
;
z-index
:
1
;
left
:
-31px
;
top
:
-4
px
;
background
:
#fff
;}
.navigation-user
{
display
:
block
;
position
:
absolute
;
right
:
0px
;
bottom
:
6px
;
font-size
:
12px
;
line-height
:
26px
;
height
:
25px
;
width
:
85
px
;
text-align
:
center
;
background
:
#e1363f
;
cursor
:
pointer
;}
.navigation-user
.nav-user
{
background
:
#e0313b
;
width
:
25px
;
height
:
25px
;
border-radius
:
25px
;
position
:
absolute
;
left
:
-22
px
;
z-index
:
2
;
padding
:
1px
;
overflow
:
hidden
;}
.navigation-user
b
{
display
:
block
;
position
:
absolute
;
width
:
25px
;
height
:
27px
;
border-radius
:
45px
;
z-index
:
1
;
left
:
-19px
;
top
:
-1
px
;
background
:
#fff
;}
.navigation-user
.am-icon-angle-right
{
margin-left
:
5px
;
}
.navigation-user
*
{
color
:
#fcff00
;
text-decoration
:
none
;
}
.navigation-user
b
.line
{
display
:
block
;
width
:
100%
;
height
:
2px
;
border-bottom
:
2px
solid
#d2364c
;
position
:
absolute
;
top
:
180px
;
z-index
:
5
;}
...
...
@@ -739,6 +739,12 @@ ul.am-dropdown-content > .am-active > a:focus,
}
}
/* 用户 */
img
.common-user-icon
{
max-height
:
15px
;
vertical-align
:
middle
;
}
/**
* 用户中心
...
...
public/static/index/default/css/user.index.css
浏览文件 @
13437246
...
...
@@ -7,7 +7,7 @@
.user-base
a
,
.order-base
a
,
.order-nav
a
{
text-decoration
:
none
;}
.user-avatar
{
text-align
:
center
;}
.user-avatar
.user-name
{
font-weight
:
500
;}
.user-avatar
img
{
width
:
80px
;
height
:
80px
;
border-radius
:
100%
;}
.user-avatar
img
.avatar
{
width
:
80px
;
height
:
80px
;
border-radius
:
100%
;}
.user-avatar
.user-name
{
margin-top
:
5px
;}
.user-base-left
.items
a
{
color
:
#f8f8f8
;}
.user-base-right
a
:not
(
:last-child
)
{
margin-right
:
15px
;}
...
...
public/static/plugins/css/membershiplevel/style.css
浏览文件 @
13437246
...
...
@@ -2,4 +2,17 @@
padding
:
3px
5px
;
background
:
#fee85c
;
color
:
#d19432
;
position
:
relative
;
}
.plugins-membershiplevel-goods-price-icon
:after
{
content
:
''
;
display
:
inline-block
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
20px
;
background
:
url(../../images/membershiplevel/flash.gif)
no-repeat
center
;
background-size
:
contain
;
opacity
:
0.3
;
}
\ No newline at end of file
public/static/plugins/images/membershiplevel/flash.gif
0 → 100644
浏览文件 @
13437246
3.2 KB
public/static/plugins/images/membershiplevel/level-default-images.png
查看替换文件 @
672cf994
浏览文件 @
13437246
4.4 KB
|
W:
|
H:
1.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录