Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
______--______
ShopXO
提交
eb317cbf
ShopXO
项目概览
______--______
/
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,体验更适合开发者的 AI 搜索 >>
提交
eb317cbf
编写于
11月 15, 2021
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
拖拽设计商品分类排序修复
上级
abe130a1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
94 addition
and
93 deletion
+94
-93
app/index/controller/Index.php
app/index/controller/Index.php
+11
-11
app/index/view/default/index/index.html
app/index/view/default/index/index.html
+78
-81
app/layout/service/BaseLayout.php
app/layout/service/BaseLayout.php
+5
-1
未找到文件。
app/index/controller/Index.php
浏览文件 @
eb317cbf
...
...
@@ -57,6 +57,17 @@ class Index extends Common
$banner
=
BannerService
::
Banner
();
MyViewAssign
(
'banner_list'
,
$banner
);
// H5导航
MyViewAssign
(
'navigation'
,
AppHomeNavService
::
AppHomeNav
());
// 用户订单状态
$user_order_status
=
OrderService
::
OrderStatusStepTotal
([
'user_type'
=>
'user'
,
'user'
=>
$this
->
user
,
'is_comments'
=>
1
]);
MyViewAssign
(
'user_order_status'
,
$user_order_status
[
'data'
]);
// 文章
$article_list
=
ArticleService
::
HomeArticleList
();
MyViewAssign
(
'article_list'
,
$article_list
);
// 数据模式
$floor_data_type
=
MyC
(
'home_index_floor_data_type'
,
0
,
true
);
MyViewAssign
(
'floor_data_type'
,
$floor_data_type
);
...
...
@@ -117,19 +128,8 @@ class Index extends Common
// 加载布局样式
MyViewAssign
(
'is_load_layout'
,
1
);
}
else
{
// H5导航
MyViewAssign
(
'navigation'
,
AppHomeNavService
::
AppHomeNav
());
// 楼层数据
MyViewAssign
(
'goods_floor_list'
,
GoodsService
::
HomeFloorList
());
// 文章
$article_list
=
ArticleService
::
HomeArticleList
();
MyViewAssign
(
'article_list'
,
$article_list
);
// 用户订单状态
$user_order_status
=
OrderService
::
OrderStatusStepTotal
([
'user_type'
=>
'user'
,
'user'
=>
$this
->
user
,
'is_comments'
=>
1
]);
MyViewAssign
(
'user_order_status'
,
$user_order_status
[
'data'
]);
}
}
...
...
app/index/view/default/index/index.html
浏览文件 @
eb317cbf
...
...
@@ -16,99 +16,96 @@
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- 数据模式、拖拽默认则不展示轮播和聚合内容 -->
{{if !isset($floor_data_type) or $floor_data_type neq 2}}
<!-- banner -->
{{include file="public/home_banner" /}}
<!-- banner -->
{{include file="public/home_banner" /}}
<!-- 轮播上内容 -->
<div
class=
"am-container slideall"
>
<!-- 轮播-手机导航 -->
{{include file="public/home_nav" /}}
<!-- 轮播上内容 -->
<div
class=
"am-container slideall"
>
<!-- 轮播-手机导航 -->
{{include file="public/home_nav" /}}
<!-- 轮播-聚合内容 -->
{{if MyC('home_index_banner_right_status', 1) eq 1}}
<div
class=
"banner-mixed"
>
<div
class=
"mod-vip"
>
<div
class=
"m-baseinfo"
>
<a
{{
if
!
empty
($
user
)}}
href=
"{{:MyUrl('index/user/index')}}"
target=
"_blank"
{{
else
/}}
href=
"javascript:;"
{{/
if
}}
>
<img
src=
"{{if !empty($user['avatar'])}}{{$user.avatar}}{{else /}}{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/default-user-avatar.jpg{{/if}}"
class=
"user-avatar"
/>
</a>
<em>
<span
class=
"s-name am-text-truncate"
>
{{if !empty($user)}}
<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 /}}
<em>
您好,欢迎来到
</em>
<em>
{{:MyC('home_site_name')}}
</em>
<!-- 轮播-聚合内容 -->
{{if MyC('home_index_banner_right_status', 1) eq 1}}
<div
class=
"banner-mixed"
>
<div
class=
"mod-vip"
>
<div
class=
"m-baseinfo"
>
<a
{{
if
!
empty
($
user
)}}
href=
"{{:MyUrl('index/user/index')}}"
target=
"_blank"
{{
else
/}}
href=
"javascript:;"
{{/
if
}}
>
<img
src=
"{{if !empty($user['avatar'])}}{{$user.avatar}}{{else /}}{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/default-user-avatar.jpg{{/if}}"
class=
"user-avatar"
/>
</a>
<em>
<span
class=
"s-name am-text-truncate"
>
{{if !empty($user)}}
<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}}
</span>
</em>
{{if !empty($user)}}
<a
href=
"{{:MyUrl('index/user/logout')}}"
class=
"member-logout"
>
退出
</a>
{{/if}}
</div>
{{if empty($user) and (!empty($home_user_login_type) or !empty($home_user_reg_type))}}
<div
class=
"member-login"
>
{{if !empty($home_user_login_type)}}
<a
class=
"am-btn-primary btn am-fl"
href=
"{{:MyUrl('index/user/loginInfo')}}"
>
登录
</a>
{{/if}}
{{if !empty($home_user_reg_type)}}
<a
class=
"am-btn-primary btn am-fr"
href=
"{{:MyUrl('index/user/regInfo')}}"
>
注册
</a>
<em>
{{$user.user_name_view}}
</em>
{{else /}}
<em>
您好,欢迎来到
</em>
<em>
{{:MyC('home_site_name')}}
</em>
{{/if}}
</
div
>
{{/if}}
</
span
>
</em>
{{if !empty($user)}}
<div
class=
"member-center"
>
{{if !empty($user_order_status)}}
{{foreach $user_order_status as $v}}
{{if in_array($v['status'], [1,2,3])}}
<a
href=
"{{:MyUrl('index/order/index', ['is_more'=>1, 'status'=>$v['status']])}}"
target=
"_blank"
><strong>
{{$v.count}}
</strong>
{{$v.name}}
</a>
{{elseif in_array($v['status'], [100]) /}}
<a
href=
"{{:MyUrl('index/order/index', ['is_more'=>1, 'is_comments'=>0, 'status'=>4])}}"
target=
"_blank"
><strong>
{{$v.count}}
</strong>
{{$v.name}}
</a>
{{/if}}
{{/foreach}}
{{/if}}
</div>
<a
href=
"{{:MyUrl('index/user/logout')}}"
class=
"member-logout"
>
退出
</a>
{{/if}}
</div>
{{if !empty($article_list)}}
<div
class=
"banner-news"
>
<p
class=
"banner-news-title am-text-truncate"
>
新闻头条
</p>
<ul>
{{foreach $article_list as $article}}
<li
class=
"am-text-truncate"
>
{{if isset($article['article_category_name']) and isset($article['category_url'])}}
<span>
[
</span><a
href=
"{{$article.category_url}}"
target=
"_blank"
><p
class=
"news-category-name am-inline-block am-text-truncate"
>
{{$article.article_category_name}}
</p></a><span>
]
</span>
{{/if}}
<a
href=
"{{$article.url}}"
target=
"_blank"
{{
if
!
empty
($
article.title_color
)}}
style=
"color:{{$article.title_color}};"
{{/
if
}}
>
{{$article.title}}
</a>
</li>
{{/foreach}}
</ul>
</div>
{{/if}}
<!-- 轮播混合数据底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_home_banner_mixed_bottom
</span>
{{if empty($user) and (!empty($home_user_login_type) or !empty($home_user_reg_type))}}
<div
class=
"member-login"
>
{{if !empty($home_user_login_type)}}
<a
class=
"am-btn-primary btn am-fl"
href=
"{{:MyUrl('index/user/loginInfo')}}"
>
登录
</a>
{{/if}}
{{if !empty($home_user_reg_type)}}
<a
class=
"am-btn-primary btn am-fr"
href=
"{{:MyUrl('index/user/regInfo')}}"
>
注册
</a>
{{/if}}
</div>
{{/if}}
{{if !empty($plugins_view_home_banner_mixed_bottom_data) and is_array($plugins_view_home_banner_mixed_bottom_data)}}
{{foreach $plugins_view_home_banner_mixed_bottom_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{if !empty($user)}}
<div
class=
"member-center"
>
{{if !empty($user_order_status)}}
{{foreach $user_order_status as $v}}
{{if in_array($v['status'], [1,2,3])}}
<a
href=
"{{:MyUrl('index/order/index', ['is_more'=>1, 'status'=>$v['status']])}}"
target=
"_blank"
><strong>
{{$v.count}}
</strong>
{{$v.name}}
</a>
{{elseif in_array($v['status'], [100]) /}}
<a
href=
"{{:MyUrl('index/order/index', ['is_more'=>1, 'is_comments'=>0, 'status'=>4])}}"
target=
"_blank"
><strong>
{{$v.count}}
</strong>
{{$v.name}}
</a>
{{/if}}
{{/foreach}}
{{/if}}
{{/foreach}}
</div>
{{/if}}
</div>
{{/if}}
</div>
{{/if}}
{{if !empty($article_list)}}
<div
class=
"banner-news"
>
<p
class=
"banner-news-title am-text-truncate"
>
新闻头条
</p>
<ul>
{{foreach $article_list as $article}}
<li
class=
"am-text-truncate"
>
{{if isset($article['article_category_name']) and isset($article['category_url'])}}
<span>
[
</span><a
href=
"{{$article.category_url}}"
target=
"_blank"
><p
class=
"news-category-name am-inline-block am-text-truncate"
>
{{$article.article_category_name}}
</p></a><span>
]
</span>
{{/if}}
<a
href=
"{{$article.url}}"
target=
"_blank"
{{
if
!
empty
($
article.title_color
)}}
style=
"color:{{$article.title_color}};"
{{/
if
}}
>
{{$article.title}}
</a>
</li>
{{/foreach}}
</ul>
</div>
{{/if}}
<!-- 轮播混合数据底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_home_banner_mixed_bottom
</span>
</div>
{{/if}}
{{if !empty($plugins_view_home_banner_mixed_bottom_data) and is_array($plugins_view_home_banner_mixed_bottom_data)}}
{{foreach $plugins_view_home_banner_mixed_bottom_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</div>
{{/if}}
</div>
<!-- 楼层数据顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
...
...
app/layout/service/BaseLayout.php
浏览文件 @
eb317cbf
...
...
@@ -220,6 +220,8 @@ class BaseLayout
$category
=
json_decode
(
urldecode
(
$vss
[
'config'
][
'goods_category_value'
]),
true
);
$p
[
'category_id'
]
=
$category
[
count
(
$category
)
-
1
][
'id'
];
$p
[
'order_limit_number'
]
=
empty
(
$vss
[
'config'
][
'goods_order_limit_number'
])
?
0
:
$vss
[
'config'
][
'goods_order_limit_number'
];
$p
[
'order_by_type'
]
=
isset
(
$vss
[
'config'
][
'goods_order_by_type'
])
?
$vss
[
'config'
][
'goods_order_by_type'
]
:
0
;
$p
[
'order_by_rule'
]
=
isset
(
$vss
[
'config'
][
'goods_order_by_rule'
])
?
$vss
[
'config'
][
'goods_order_by_rule'
]
:
0
;
break
;
}
$res
=
self
::
GoodsDataList
(
$p
);
...
...
@@ -327,7 +329,7 @@ class BaseLayout
// 商品
case
'goods'
:
$p
=
[
'data_type'
=>
$vss
[
'config'
][
'goods_data_type'
],
'data_type'
=>
$vss
[
'config'
][
'goods_data_type'
],
];
switch
(
$vss
[
'config'
][
'goods_data_type'
])
{
...
...
@@ -341,6 +343,8 @@ class BaseLayout
$category
=
json_decode
(
urldecode
(
$vss
[
'config'
][
'goods_category_value'
]),
true
);
$p
[
'category_id'
]
=
$category
[
count
(
$category
)
-
1
][
'id'
];
$p
[
'order_limit_number'
]
=
empty
(
$vss
[
'config'
][
'goods_order_limit_number'
])
?
0
:
$vss
[
'config'
][
'goods_order_limit_number'
];
$p
[
'order_by_type'
]
=
isset
(
$vss
[
'config'
][
'goods_order_by_type'
])
?
$vss
[
'config'
][
'goods_order_by_type'
]
:
0
;
$p
[
'order_by_rule'
]
=
isset
(
$vss
[
'config'
][
'goods_order_by_rule'
])
?
$vss
[
'config'
][
'goods_order_by_rule'
]
:
0
;
break
;
}
$res
=
self
::
GoodsDataList
(
$p
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录