Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
08a5eb3f
ShopXO
项目概览
starsw001
/
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,发现更多精彩内容 >>
提交
08a5eb3f
编写于
2月 20, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
右侧快捷导航新增购物车
上级
496c5b4c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
202 addition
and
33 deletion
+202
-33
application/plugins/commonrightnavigation/Hook.php
application/plugins/commonrightnavigation/Hook.php
+12
-0
application/plugins/view/commonrightnavigation/index/content.html
...ion/plugins/view/commonrightnavigation/index/content.html
+70
-3
public/static/index/default/css/index.css
public/static/index/default/css/index.css
+0
-28
public/static/plugins/css/commonrightnavigation/style.css
public/static/plugins/css/commonrightnavigation/style.css
+120
-2
未找到文件。
application/plugins/commonrightnavigation/Hook.php
浏览文件 @
08a5eb3f
...
...
@@ -122,7 +122,19 @@ class Hook extends Controller
// 用户信息
$this
->
assign
(
'user'
,
$params
[
'user'
]);
// 应用数据
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
// 购物车
$cart_list
=
BuyService
::
CartList
([
'user'
=>
$params
[
'user'
]]);
$this
->
assign
(
'cart_list'
,
$cart_list
[
'data'
]);
$base
=
[
'total_price'
=>
empty
(
$cart_list
[
'data'
])
?
0
:
array_sum
(
array_column
(
$cart_list
[
'data'
],
'total_price'
)),
'cart_count'
=>
empty
(
$cart_list
[
'data'
])
?
0
:
count
(
$cart_list
[
'data'
]),
'ids'
=>
empty
(
$cart_list
[
'data'
])
?
''
:
implode
(
','
,
array_column
(
$cart_list
[
'data'
],
'id'
)),
];
$this
->
assign
(
'base'
,
$base
);
return
$this
->
fetch
(
'../../../plugins/view/commonrightnavigation/index/content'
);
}
else
{
return
$ret
[
'msg'
];
...
...
application/plugins/view/commonrightnavigation/index/content.html
浏览文件 @
08a5eb3f
...
...
@@ -33,15 +33,82 @@
</a>
<!-- 购物车 -->
<
a
href=
"{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/cart/index')}}{{/if}}"
class=
"cart-content {{$login_event_class}} {{if isset($data['is_goods_page_show_cart']) and $data['is_goods_page_show_cart'] eq 1 and $module_controller_action eq 'indexgoodsindex'}} cart-show{{/if}}
"
>
<
div
class=
"base-nav cart
"
>
<
div
class=
"base-nav cart commonrightnavigation-cart
"
>
<
a
href=
"{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/cart/index')}}{{/if}}"
class=
"nav-a {{$login_event_class}} {{if isset($data['is_goods_page_show_cart']) and $data['is_goods_page_show_cart'] eq 1 and $module_controller_action eq 'indexgoodsindex'}} cart-show{{/if}}
"
>
<i
class=
"am-icon-opencart"
></i>
<div
class=
"cart-text"
>
购物车
<div
class=
"cart-count common-cart-total am-badge am-badge-danger"
>
{{if $cart_total > 9}}9+{{else /}}{{$cart_total}}{{/if}}
</div>
</div>
</a>
<div
class=
"mui-mbar-popup am-animation-slide-left cart-content"
>
{{if !empty($cart_list)}}
<!-- 商品列表 -->
<div
class=
"cart-items"
>
<table
class=
"am-table"
>
{{foreach $cart_list as $goods}}
<tr
id=
"data-list-{{$goods.id}}"
data-id=
"{{$goods.id}}"
data-goods-id=
"{{$goods.goods_id}}"
class=
"{{if $goods['is_shelves'] neq 1}}am-warning{{/if}} {{if $goods['is_delete_time'] neq 0}}am-danger{{/if}}"
>
<td
class=
"base"
>
<div
class=
"goods-detail"
>
<a
href=
"{{$goods.goods_url}}"
target=
"_blank"
>
<img
src=
"{{$goods.images}}"
>
</a>
<div
class=
"goods-base"
>
<a
href=
"{{$goods.goods_url}}"
target=
"_blank"
class=
"goods-title"
>
{{$goods.title}}
</a>
{{if !empty($goods.spec)}}
<ul
class=
"goods-attr"
>
{{foreach $goods.spec as $spec}}
<li>
{{$spec.type}}:{{$spec.value}}
</li>
{{/foreach}}
</ul>
{{/if}}
</div>
</div>
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥{{$goods.total_price}}
</strong>
<span
class=
"cart-number"
>
x{{$goods.stock}}
</span>
</td>
<td
class=
"operation"
>
<a
href=
"javascript:;"
class=
"submit-delete"
data-url=
"{{:MyUrl('index/cart/delete')}}"
data-id=
"{{$goods.id}}"
data-view=
"reload"
>
删除
</a>
</td>
</tr>
{{/foreach}}
</table>
</div>
<!-- 导航 -->
<div
class=
"cart-nav"
>
<form
action=
"{{:MyUrl('index/buy/index')}}"
method=
"post"
>
<span
class=
"selected-tips"
>
共
<strong>
{{$base.cart_count}}
</strong>
种商品
</span>
<span
class=
"total-price-tips"
>
共计:
</span>
<strong
class=
"nav-total-price"
>
¥{{$base.total_price}}
</strong>
<input
type=
"hidden"
name=
"ids"
value=
"{{$base.ids}}"
/>
<input
type=
"hidden"
name=
"buy_type"
value=
"cart"
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary separate-submit am-fr"
>
结算
</button>
</form>
</div>
{{/if}}
{{if empty($cart_list)}}
<div
class=
"mixed-tips"
>
<i
class=
"am-icon-cart-plus am-fl icon"
></i>
<div
class=
"mixed-tips-content am-fl"
>
<h1>
您的购物车还是空的,您可以
</h1>
<ul>
<li>
<span>
看看
</span>
<a
href=
"{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/userfavor/goods')}}{{/if}}"
class=
"{{if empty($user)}}login-event{{/if}}"
>
我的收藏夹
</a>
</li>
<li>
<span>
看看
</span>
<a
href=
"{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/order/index')}}{{/if}}"
class=
"{{if empty($user)}}login-event{{/if}}"
>
我的订单
</a>
</li>
</ul>
</div>
</div>
{{/if}}
</div>
</
a
>
</
div
>
<!-- 二维码 -->
<div
class=
"base-nav qrcode-content"
>
...
...
public/static/index/default/css/index.css
浏览文件 @
08a5eb3f
...
...
@@ -43,34 +43,6 @@ dt + dd {margin-top: 0;}
text-align
:
center
;
float
:
none
}
.items-nav-title
h3
,
.items-nav-title
.today-brands
,
.items-nav-title
.more
{
display
:
none
;}
/*导航*/
.absolute
{
position
:
absolute
;}
.text-ellipsis
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
_width
:
100%
;}
.underline
,
.hover-underline
{
text-decoration
:
underline
;}
.block
{
display
:
block
;}
.inline-block
{
display
:
inline-block
;}
.inline
{
display
:
inline
;}
.bold
{
font-weight
:
700
;}
.am-modal
{
width
:
100%
;
left
:
0
;
margin-left
:
0
;
top
:
0
;
background
:
#fefefe
;}
/*推荐*/
.recommendation
{
text-align
:
center
;
padding
:
10px
0px
;
background
:
#fff
;}
.clock
{
display
:
none
;
color
:
#fff
;
text-align
:
center
;
z-index
:
11
;}
.recommendationMain
{
width
:
100%
;
position
:
relative
;
height
:
85px
;
padding
:
5px
0px
0px
;}
.recommendationMain
img
{
width
:
80px
;
position
:
absolute
;
right
:
50%
;
margin-right
:
-40px
;}
/*活动*/
.activity
{
min-height
:
180px
;}
.activity
.am-g
{
background
:
#fff
;
padding
:
10px
0px
;}
.activity
.am-u-sm-3
{
padding
:
0px
2px
;}
.activity
.info
{
margin-top
:
5px
;}
.activity
.icon-sale
{
position
:
absolute
;
width
:
0
;
height
:
0
;
border-top
:
40px
solid
#0087e5
;
border-right
:
40px
solid
transparent
;}
.activity
.icon-sale.one
{
border-top-color
:
#9b0d5f
;}
.activity
.icon-sale.two
{
border-top-color
:
#b48c66
;}
.activity
.icon-sale.three
{
border-top-color
:
#7fb113
;}
.activity
.am-g
h4
{
position
:
absolute
;
color
:
#fff
;
top
:
5px
;
left
:
2px
;}
/*第二套各类活动*/
.row
{
padding
:
10px
0px
;
overflow
:
hidden
;}
...
...
public/static/plugins/css/commonrightnavigation/style.css
浏览文件 @
08a5eb3f
...
...
@@ -26,6 +26,11 @@
position
:
absolute
;
width
:
100%
;
color
:
#ccc
;
}
.commonrightnavigation-right-nav
.base-nav
.nav-a
{
color
:
#ccc
;
}
.commonrightnavigation-right-nav
.base-nav
a
{
cursor
:
pointer
;
}
.commonrightnavigation-right-nav
.base-nav
[
class
*=
"am-icon-"
]
:before
{
...
...
@@ -59,6 +64,10 @@
background
:
#d2364c
;
color
:
#fff
;
}
.commonrightnavigation-right-nav
.base-nav
:hover
.nav-a
{
color
:
#fff
;
text-decoration
:
none
;
}
.commonrightnavigation-right-nav
.base-nav
:hover
.mui-mbar-tab-tip
,
.commonrightnavigation-right-nav
.base-nav
:hover
.mui-mbar-popup
{
display
:
block
;
}
...
...
@@ -174,6 +183,15 @@
.commonrightnavigation-right-nav
.answer-content
.am-form-group
{
width
:
100%
;
}
.commonrightnavigation-right-nav
.cart-content
{
bottom
:
0
;
width
:
400px
;
min-height
:
100px
;
max-height
:
300px
;
background
:
#fff
;
color
:
#666
;
}
}
@media
only
screen
and
(
max-width
:
640px
)
{
...
...
@@ -206,7 +224,7 @@
.cart-show
{
display
:
block
!important
;
}
.commonrightnavigation-right-nav
.cart-show
.cart
{
.commonrightnavigation-right-nav
.cart-show
{
position
:
fixed
;
right
:
0
;
bottom
:
calc
(
50%
-
50px
);
...
...
@@ -221,4 +239,104 @@
border-bottom-left-radius
:
3px
;
z-index
:
1000
;
}
}
\ No newline at end of file
.commonrightnavigation-right-nav
a
.cart-show
{
text-decoration
:
none
;
}
}
/**
* 购物车
*/
.commonrightnavigation-cart
.cart-content
{
text-align
:
left
;
font-size
:
12px
;
}
.commonrightnavigation-cart
.cart-content
.cart-items
{
min-height
:
60px
;
max-height
:
260px
;
overflow-x
:
auto
;
}
.commonrightnavigation-cart
.cart-content
.goods-detail
img
{
width
:
60px
;
height
:
60px
;
position
:
absolute
;
}
.commonrightnavigation-cart
.cart-content
.goods-detail
{
position
:
relative
;
min-height
:
60px
;
}
.commonrightnavigation-cart
.cart-content
.goods-title
{
display
:
block
;
max-height
:
36px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
font-size
:
12px
;
}
.commonrightnavigation-cart
.cart-content
.goods-title
:hover
{
text-decoration
:
underline
;
}
.commonrightnavigation-cart
.cart-content
.goods-base
{
float
:
left
;
top
:
0
;
margin-left
:
65px
;
}
.commonrightnavigation-cart
.cart-content
.goods-attr
{
margin-top
:
5px
;
}
.commonrightnavigation-cart
.cart-content
.goods-attr
li
{
color
:
#888
;
line-height
:
16px
;
}
.commonrightnavigation-cart
.cart-content
strong
.total-price-content
,
.commonrightnavigation-cart
.cart-content
.nav-total-price
{
font-weight
:
700
;
}
.commonrightnavigation-cart
.cart-content
.cart-nav
label
{
cursor
:
pointer
;
}
.commonrightnavigation-cart
.cart-content
.selected-tips
strong
,
.commonrightnavigation-cart
.cart-content
.nav-total-price
{
font-size
:
14px
;
}
.commonrightnavigation-cart
.cart-content
strong
.total-price-content
,
.commonrightnavigation-cart
.cart-content
.selected-tips
strong
,
.commonrightnavigation-cart
.cart-content
.nav-total-price
{
color
:
#d2364c
;
font-family
:
Verdana
,
Tahoma
,
arial
;
}
.commonrightnavigation-cart
.cart-content
.am-table
{
margin-bottom
:
10px
;
}
.commonrightnavigation-cart
.cart-content
.am-table
>
tbody
>
tr
>
td
{
border-top
:
1px
solid
#F5F5F5
;
}
.commonrightnavigation-cart
.cart-content
table
td
.base
input
[
type
=
"checkbox"
]
{
float
:
left
;
}
.commonrightnavigation-cart
.cart-content
.cart-nav
{
background
:
#eee
;
height
:
40px
;
line-height
:
40px
;
padding
:
0
0
0
5px
;
}
.commonrightnavigation-cart
.cart-content
.cart-nav
.separate-submit
{
height
:
40px
;
width
:
100px
;
font-size
:
16px
;
font-weight
:
500
;
}
.commonrightnavigation-cart
.cart-content
.selected-tips
{
margin-right
:
15px
;
}
.commonrightnavigation-cart
.cart-content
table
tr
.base
{
width
:
60%
;
}
.commonrightnavigation-cart
.cart-content
table
tr
.total-price
{
width
:
26%
;
}
.commonrightnavigation-cart
.cart-content
table
tr
.operation
{
width
:
12%
;
}
.commonrightnavigation-cart
.cart-content
.cart-nav
.nav-total-price
{
margin-right
:
5px
;
}
.commonrightnavigation-cart
.cart-content
.mixed-tips
.icon
{
margin-top
:
25px
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录