Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
30794c53
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
30794c53
编写于
12月 25, 2018
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug
上级
19c9cb6b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
155 addition
and
1 deletion
+155
-1
application/index/view/default/cart/index.html
application/index/view/default/cart/index.html
+152
-0
application/service/BuyService.php
application/service/BuyService.php
+3
-1
未找到文件。
application/index/view/default/cart/index.html
0 → 100755
浏览文件 @
30794c53
{{include file="public/header" /}}
<!-- nav start -->
{{include file="public/nav" /}}
<!-- nav end -->
<!-- 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 cart-content"
>
{{if !empty($cart_list)}}
<!-- 商品列表 -->
<table
class=
"am-table"
>
<thead>
<tr>
<th>
商品信息
</th>
<th
class=
"am-hide-sm-only"
>
单价
</th>
<th>
数量
</th>
<th
class=
"am-hide-sm-only"
>
金额
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
{{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"
>
<input
type=
"checkbox"
value=
"{{$goods.id}}"
{{
if
$
goods
['
is_shelves
']
neq
1
or
$
goods
['
is_delete_time
']
neq
0}}
disabled
{{/
if
}}
/>
<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>
<div
class=
"wap-base am-show-sm-only"
>
{{if $goods['original_price'] gt 0}}
<span
class=
"original-price"
>
¥{{$goods.original_price}}
</span>
{{/if}}
<strong
class=
"total-price-content"
>
¥{{$goods.price}}
</strong>
<span
class=
"wap-number"
>
x{{$goods.stock}}
</span>
</div>
</td>
<td
class=
"price am-hide-sm-only"
>
{{if $goods['original_price'] gt 0}}
<p
class=
"original-price"
>
¥{{$goods.original_price}}
</p>
{{/if}}
<p
class=
"line-price"
>
¥{{$goods.price}}
</p>
</td>
<td
class=
"number"
>
<div
class=
"am-input-group am-input-group-sm stock-tag"
data-inventory=
"{{$goods.inventory}}"
data-price=
"{{$goods.price}}"
data-ajax-url=
"{{:url('index/cart/Stock')}}"
>
<span
class=
"am-input-group-label {{if $goods['is_shelves'] eq 1 and $goods['is_delete_time'] eq 0}}stock-submit{{/if}}"
data-type=
"min"
>
-
</span>
<input
type=
"number"
class=
"am-form-field"
value=
"{{$goods.stock}}"
{{
if
$
goods
['
is_shelves
']
neq
1
or
$
goods
['
is_delete_time
']
neq
0}}
disabled
{{/
if
}}
/>
<span
class=
"am-input-group-label {{if $goods['is_shelves'] eq 1 and $goods['is_delete_time'] eq 0}}stock-submit{{/if}}"
data-type=
"add"
>
+
</span>
</div>
{{if $goods['is_shelves'] neq 1}}
<p>
商品已下架
</p>
{{/if}}
{{if $goods['is_delete_time'] neq 0}}
<p>
商品已作废
</p>
{{/if}}
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥{{$goods.total_price}}
</strong>
</td>
<td
class=
"operation"
>
<a
href=
"javascript:;"
class=
"submit-delete"
data-url=
"{{:url('index/cart/delete')}}"
data-id=
"{{$goods.id}}"
data-view=
"fun"
data-value=
"ViewDeleteBack"
>
删除
</a>
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<!-- 导航 -->
<div
class=
"cart-nav"
>
<div
class=
"am-fl nav-left"
>
<label>
<input
type=
"checkbox"
value=
"3"
class=
"select-all-event"
/>
<span>
全选
</span>
</label>
<a
href=
"javascript:;"
class=
"submit-ajax"
data-url=
"{{:url('index/cart/delete')}}"
data-id=
"{{$base.ids}}"
data-view=
"reload"
data-msg=
"清空后不可恢复、确认操作吗?"
>
清空
</a>
</div>
<div
class=
"am-fr nav-right"
>
<form
action=
"{{:url('index/buy/index')}}"
method=
"post"
>
<span
class=
"selected-tips am-fl"
>
已选商品
<strong>
0
</strong>
件
</span>
<span
class=
"total-price-tips am-fl"
>
合计:
</span>
<strong
class=
"nav-total-price am-fl"
>
¥0.00
</strong>
<input
type=
"hidden"
name=
"ids"
value=
"0"
/>
<input
type=
"hidden"
name=
"buy_type"
value=
"cart"
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary separate-submit"
>
结算
</button>
</form>
</div>
</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 /}}{{:url('index/userfavor/goods')}}{{/if}}"
class=
"{{if empty($user)}}login-event{{/if}}"
>
我的收藏夹
</a>
</li>
<li>
<span>
看看
</span>
<a
href=
"{{if empty($user)}}javascript:;{{else /}}{{:url('index/order/index')}}{{/if}}"
class=
"{{if empty($user)}}login-event{{/if}}"
>
我的订单
</a>
</li>
</ul>
</div>
</div>
{{/if}}
</div>
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
<script
type=
"text/javascript"
>
// 返回处理
function
ViewDeleteBack
(
e
)
{
if
(
e
.
code
==
0
)
{
$
.
AMUI
.
progress
.
done
();
Prompt
(
e
.
msg
,
'
success
'
);
$
(
'
#data-list-
'
+
e
.
data_id
).
remove
();
HomeCartNumberTotalUpdate
(
parseInt
(
e
.
data
));
}
else
{
$
(
'
form.form-validation
'
).
find
(
'
button[type="submit"]
'
).
button
(
'
reset
'
);
$
.
AMUI
.
progress
.
done
();
Prompt
(
e
.
msg
);
}
}
</script>
\ No newline at end of file
application/service/BuyService.php
浏览文件 @
30794c53
...
...
@@ -116,12 +116,14 @@ class BuyService
*/
private
static
function
GoodsSpecificationsHandle
(
$params
=
[])
{
$spec
=
[]
;
$spec
=
''
;
if
(
!
empty
(
$params
[
'spec'
]))
{
if
(
!
is_array
(
$params
[
'spec'
]))
{
$spec
=
json_decode
(
$params
[
'spec'
],
true
);
}
else
{
$spec
=
$params
[
'spec'
];
}
}
return
empty
(
$spec
)
?
''
:
$spec
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录