Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
5c1b205e
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,体验更适合开发者的 AI 搜索 >>
提交
5c1b205e
编写于
9月 14, 2018
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
category
上级
81bf8470
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
924 addition
and
421 deletion
+924
-421
service/Application/Home/Controller/CartController.class.php
service/Application/Home/Controller/CartController.class.php
+59
-0
service/Application/Home/Controller/CategoryController.class.php
.../Application/Home/Controller/CategoryController.class.php
+43
-0
service/Application/Home/Controller/CommonController.class.php
...ce/Application/Home/Controller/CommonController.class.php
+11
-5
service/Application/Home/Controller/EmptyController.class.php
...ice/Application/Home/Controller/EmptyController.class.php
+0
-1
service/Application/Home/Controller/GoodsController.class.php
...ice/Application/Home/Controller/GoodsController.class.php
+37
-32
service/Application/Home/View/Default/Cart/Index.html
service/Application/Home/View/Default/Cart/Index.html
+97
-146
service/Application/Home/View/Default/Category/Index.html
service/Application/Home/View/Default/Category/Index.html
+54
-0
service/Application/Home/View/Default/Goods/Index.html
service/Application/Home/View/Default/Goods/Index.html
+84
-78
service/Application/Home/View/Default/Index/Index.html
service/Application/Home/View/Default/Index/Index.html
+3
-3
service/Application/Home/View/Default/Public/Error.html
service/Application/Home/View/Default/Public/Error.html
+20
-4
service/Application/Home/View/Default/Public/Footer.html
service/Application/Home/View/Default/Public/Footer.html
+1
-0
service/Application/Home/View/Default/Public/GoodsCategory.html
...e/Application/Home/View/Default/Public/GoodsCategory.html
+3
-3
service/Application/Home/View/Default/Public/Header.html
service/Application/Home/View/Default/Public/Header.html
+1
-0
service/Application/Home/View/Default/Public/HeaderTopNav.html
...ce/Application/Home/View/Default/Public/HeaderTopNav.html
+23
-4
service/Application/Home/View/Default/Public/TipsError.html
service/Application/Home/View/Default/Public/TipsError.html
+1
-5
service/Application/Service/BuyService.class.php
service/Application/Service/BuyService.class.php
+143
-0
service/Public/Common/Js/Common.js
service/Public/Common/Js/Common.js
+62
-33
service/Public/Home/Default/Css/Cart.css
service/Public/Home/Default/Css/Cart.css
+12
-11
service/Public/Home/Default/Css/Category.css
service/Public/Home/Default/Css/Category.css
+13
-0
service/Public/Home/Default/Css/Common.css
service/Public/Home/Default/Css/Common.css
+25
-28
service/Public/Home/Default/Css/Goods.css
service/Public/Home/Default/Css/Goods.css
+17
-15
service/Public/Home/Default/Css/Index.css
service/Public/Home/Default/Css/Index.css
+2
-2
service/Public/Home/Default/Css/Search.css
service/Public/Home/Default/Css/Search.css
+0
-1
service/Public/Home/Default/Js/Cart.js
service/Public/Home/Default/Js/Cart.js
+143
-0
service/Public/Home/Default/Js/Common.js
service/Public/Home/Default/Js/Common.js
+12
-0
service/Public/Home/Default/Js/Goods.js
service/Public/Home/Default/Js/Goods.js
+58
-50
未找到文件。
service/Application/Home/Controller/CartController.class.php
浏览文件 @
5c1b205e
...
...
@@ -38,6 +38,15 @@ class CartController extends CommonController
*/
public
function
Index
()
{
$cart_list
=
BuyService
::
CartList
([
'user'
=>
$this
->
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'
)),
'total_stock'
=>
empty
(
$cart_list
[
'data'
])
?
0
:
array_sum
(
array_column
(
$cart_list
[
'data'
],
'stock'
)),
'ids'
=>
empty
(
$cart_list
[
'data'
])
?
''
:
implode
(
','
,
array_column
(
$cart_list
[
'data'
],
'id'
)),
];
$this
->
assign
(
'base'
,
$base
);
$this
->
display
(
'Index'
);
}
...
...
@@ -51,10 +60,60 @@ class CartController extends CommonController
*/
public
function
Save
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
$this
->
error
(
L
(
'common_unauthorized_access'
));
}
$params
=
$_POST
;
$params
[
'user'
]
=
$this
->
user
;
$ret
=
BuyService
::
CartAdd
(
$params
);
$this
->
ajaxReturn
(
$ret
[
'msg'
],
$ret
[
'code'
],
$ret
[
'data'
]);
}
/**
* 购物车删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-14
* @desc description
*/
public
function
Delete
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
$this
->
error
(
L
(
'common_unauthorized_access'
));
}
$params
=
$_POST
;
$params
[
'user'
]
=
$this
->
user
;
$ret
=
BuyService
::
CartDelete
(
$params
);
$this
->
ajaxReturn
(
$ret
[
'msg'
],
$ret
[
'code'
],
$ret
[
'data'
]);
}
/**
* 数量保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-14
* @desc description
*/
public
function
Stock
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
$this
->
error
(
L
(
'common_unauthorized_access'
));
}
$params
=
$_POST
;
$params
[
'user'
]
=
$this
->
user
;
$ret
=
BuyService
::
CartStock
(
$params
);
$this
->
ajaxReturn
(
$ret
[
'msg'
],
$ret
[
'code'
],
$ret
[
'data'
]);
}
}
?>
\ No newline at end of file
service/Application/Home/Controller/CategoryController.class.php
0 → 100644
浏览文件 @
5c1b205e
<?php
namespace
Home\Controller
;
use
Service\BannerService
;
use
Service\GoodsService
;
use
Service\ArticleService
;
/**
* 商品分类
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
CategoryController
extends
CommonController
{
/**
* [_initialize 前置操作-继承公共前置方法]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public
function
_initialize
()
{
// 调用父类前置方法
parent
::
_initialize
();
}
/**
* [Index 首页]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-22T16:50:32+0800
*/
public
function
Index
()
{
$this
->
display
(
'Index'
);
}
}
?>
\ No newline at end of file
service/Application/Home/Controller/CommonController.class.php
浏览文件 @
5c1b205e
...
...
@@ -234,7 +234,6 @@ class CommonController extends Controller
protected
function
_empty
(
$name
)
{
$this
->
assign
(
'msg'
,
L
(
'common_unauthorized_access'
));
$this
->
assign
(
'is_footer'
,
0
);
$this
->
display
(
'/Public/Error'
);
}
...
...
@@ -249,10 +248,17 @@ class CommonController extends Controller
{
if
(
MyC
(
'home_site_state'
)
==
0
)
{
$this
->
assign
(
'msg'
,
MyC
(
'home_site_close_reason'
,
L
(
'common_site_maintenance_tips'
),
true
));
$this
->
assign
(
'is_footer'
,
0
);
$this
->
display
(
'/Public/Error'
);
exit
;
// 是否ajax请求
if
(
IS_AJAX
)
{
$this
->
error
(
MyC
(
'home_site_close_reason'
,
L
(
'common_site_maintenance_tips'
)));
}
else
{
$this
->
assign
(
'msg'
,
MyC
(
'home_site_close_reason'
,
L
(
'common_site_maintenance_tips'
),
true
));
$this
->
assign
(
'is_header'
,
0
);
$this
->
assign
(
'is_footer'
,
0
);
$this
->
display
(
'/Public/Error'
);
exit
;
}
}
}
...
...
service/Application/Home/Controller/EmptyController.class.php
浏览文件 @
5c1b205e
...
...
@@ -21,7 +21,6 @@ class EmptyController extends CommonController
public
function
Index
()
{
$this
->
assign
(
'msg'
,
L
(
'common_unauthorized_access'
));
$this
->
assign
(
'is_footer'
,
0
);
$this
->
display
(
'/Public/Error'
);
}
}
...
...
service/Application/Home/Controller/GoodsController.class.php
浏览文件 @
5c1b205e
...
...
@@ -45,43 +45,48 @@ class GoodsController extends CommonController
'is_attribute'
=>
true
,
];
$goods
=
GoodsService
::
GoodsList
(
$params
);
if
(
empty
(
$goods
[
0
])
||
$goods
[
0
][
'is_delete_time'
]
!=
0
)
{
$this
->
assign
(
'msg'
,
L
(
'common_data_no_exist_error'
));
$this
->
display
(
'/Public/TipsError'
);
}
else
{
// 当前登录用户是否已收藏
$ret_favor
=
GoodsService
::
IsUserGoodsFavor
([
'goods_id'
=>
$id
,
'user'
=>
$this
->
user
]);
$goods
[
0
][
'is_favor'
]
=
(
$ret_favor
[
'code'
]
==
0
)
?
$ret_favor
[
'data'
]
:
0
;
// 当前登录用户是否已收藏
$ret_favor
=
GoodsService
::
IsUserGoodsFavor
([
'goods_id'
=>
$id
,
'user'
=>
$this
->
user
]);
$goods
[
0
][
'is_favor'
]
=
(
$ret_favor
[
'code'
]
==
0
)
?
$ret_favor
[
'data'
]
:
0
;
$this
->
assign
(
'goods'
,
$goods
[
0
]);
$this
->
assign
(
'home_seo_site_title'
,
$goods
[
0
][
'title'
]);
$this
->
assign
(
'goods'
,
$goods
[
0
]);
$this
->
assign
(
'home_seo_site_title'
,
$goods
[
0
][
'title'
]
);
// 商品访问统计
M
(
'Goods'
)
->
where
(
array
(
'id'
=>
$id
))
->
setInc
(
'access_count'
);
// 商品访问统计
M
(
'Goods'
)
->
where
(
array
(
'id'
=>
$id
))
->
setInc
(
'access_count'
);
// 左侧商品 看了又看
$params
=
[
'where'
=>
[
'g.is_delete_time'
=>
0
,
'g.is_shelves'
=>
1
],
'order_by'
=>
'access_count desc'
,
'field'
=>
'g.id,g.title,g.title_color,g.price,g.images'
,
'n'
=>
10
,
];
$this
->
assign
(
'left_goods'
,
GoodsService
::
GoodsList
(
$params
));
// 左侧商品 看了又看
$params
=
[
'where'
=>
[
'g.is_delete_time'
=>
0
,
'g.is_shelves'
=>
1
],
'order_by'
=>
'access_count desc'
,
'field'
=>
'g.id,g.title,g.title_color,g.price,g.images'
,
'n'
=>
10
,
];
$this
->
assign
(
'left_goods'
,
GoodsService
::
GoodsList
(
$params
));
// 详情tab商品 猜你喜欢
$params
=
[
'where'
=>
[
'g.is_delete_time'
=>
0
,
'g.is_shelves'
=>
1
,
'is_home_recommended'
=>
1
,
],
'order_by'
=>
'sales_count desc'
,
'field'
=>
'g.id,g.title,g.title_color,g.price,g.images,g.home_recommended_images'
,
'n'
=>
16
,
];
$this
->
assign
(
'detail_like_goods'
,
GoodsService
::
GoodsList
(
$params
));
// 详情tab商品 猜你喜欢
$params
=
[
'where'
=>
[
'g.is_delete_time'
=>
0
,
'g.is_shelves'
=>
1
,
'is_home_recommended'
=>
1
,
],
'order_by'
=>
'sales_count desc'
,
'field'
=>
'g.id,g.title,g.title_color,g.price,g.images,g.home_recommended_images'
,
'n'
=>
16
,
];
$this
->
assign
(
'detail_like_goods'
,
GoodsService
::
GoodsList
(
$params
));
$this
->
display
(
'Index'
);
$this
->
display
(
'Index'
);
}
}
/**
...
...
service/Application/Home/View/Default/Cart/Index.html
浏览文件 @
5c1b205e
...
...
@@ -14,155 +14,106 @@
<!-- content -->
<div
class=
"am-container cart-content"
>
<!-- 商品列表 -->
<table
class=
"am-table"
>
<thead>
<tr>
<th>
商品信息
</th>
<th
class=
"am-hide-sm-only"
>
单价
</th>
<th
class=
"am-hide-sm-only"
>
数量
</th>
<th
class=
"am-hide-sm-only"
>
金额
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr>
<td
class=
"base"
>
<input
type=
"checkbox"
value=
"1"
/>
<div
class=
"goods-detail"
>
<a
href=
"#"
>
<img
src=
"../images/kouhong.jpg_80x80.jpg"
>
</a>
<div
class=
"goods-base"
>
<a
href=
"#"
class=
"goods-title"
>
第三方撒地方啊打广告公司古代诗歌发到广东省古代诗歌发打发归属感发撒的格式干撒的撒个撒个萨嘎说
</a>
<ul
class=
"goods-attr"
>
<li>
颜色分类:黑色
</li>
<li>
尺码:XXL
</li>
</ul>
</div>
</div>
<div
class=
"wap-base am-show-sm-only"
>
<span
class=
"original-price"
>
¥3964.00
</span>
<strong
class=
"total-price-content"
>
¥2378.00
</strong>
<span
class=
"wap-number"
>
x10
</span>
</div>
</td>
<td
class=
"price am-hide-sm-only"
>
<p
class=
"original-price"
>
¥3964.00
</p>
<p
class=
"line-price"
>
¥2378.00
</p>
</td>
<td
class=
"number am-hide-sm-only"
>
<div
class=
"am-input-group am-input-group-sm number-tag"
>
<span
class=
"am-input-group-label"
>
-
</span>
<input
type=
"text"
class=
"am-form-field"
value=
"1"
/>
<span
class=
"am-input-group-label"
>
+
</span>
</div>
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥2378.00
</strong>
</td>
<td
class=
"operation"
>
<a
href=
"javascript:;"
class=
"delete-submit"
>
删除
</a>
</td>
</tr>
<notempty
name=
"cart_list"
>
<!-- 商品列表 -->
<table
class=
"am-table"
>
<thead>
<tr>
<th>
商品信息
</th>
<th
class=
"am-hide-sm-only"
>
单价
</th>
<th
class=
"am-hide-sm-only"
>
数量
</th>
<th
class=
"am-hide-sm-only"
>
金额
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<foreach
name=
"cart_list"
item=
"cart"
>
<tr
id=
"data-list-{{$cart.id}}"
data-id=
"{{$cart.id}}"
data-goods-id=
"{{$cart.goods_id}}"
class=
"<if condition="
$
cart
['
is_shelves
']
neq
1"
>
am-warning
</if>
<if
condition=
"$cart['is_delete_time'] neq 0"
>
am-danger
</if>
">
<td
class=
"base"
>
<input
type=
"checkbox"
value=
"{{$cart.id}}"
<
if
condition=
"$cart['is_shelves'] neq 1 or $cart['is_delete_time'] neq 0"
>
disabled
</if>
/>
<div
class=
"goods-detail"
>
<a
href=
"{{$cart.goods_url}}"
target=
"_blank"
>
<img
src=
"{{$cart.images}}"
>
</a>
<div
class=
"goods-base"
>
<a
href=
"{{$cart.goods_url}}"
target=
"_blank"
class=
"goods-title"
>
{{$cart.title}}
</a>
<notempty
name=
"cart.attribute"
>
<ul
class=
"goods-attr"
>
<foreach
name=
"cart.attribute"
item=
"attr"
>
<li>
{{$attr.attr_type_name}}:{{$attr.attr_name}}
</li>
</foreach>
</ul>
</notempty>
</div>
</div>
<div
class=
"wap-base am-show-sm-only"
>
<span
class=
"original-price"
>
¥{{$cart.original_price}}
</span>
<strong
class=
"total-price-content"
>
¥{{$cart.price}}
</strong>
<span
class=
"wap-number"
>
x{{$cart.stock}}
</span>
</div>
</td>
<td
class=
"price am-hide-sm-only"
>
<p
class=
"original-price"
>
¥{{$cart.original_price}}
</p>
<p
class=
"line-price"
>
¥{{$cart.price}}
</p>
</td>
<td
class=
"number am-hide-sm-only"
>
<div
class=
"am-input-group am-input-group-sm stock-tag"
data-inventory=
"{{$cart.inventory}}"
data-price=
"{{$cart.price}}"
data-ajax-url=
"{{:U('Home/Cart/Stock')}}"
>
<span
class=
"am-input-group-label <if condition="
$
cart
['
is_shelves
']
eq
1
and
$
cart
['
is_delete_time
']
eq
0"
>
stock-submit
</if>
" data-type="min">-
</span>
<input
type=
"text"
class=
"am-form-field"
value=
"{{$cart.stock}}"
<
if
condition=
"$cart['is_shelves'] neq 1 or $cart['is_delete_time'] neq 0"
>
disabled
</if>
/>
<span
class=
"am-input-group-label <if condition="
$
cart
['
is_shelves
']
eq
1
and
$
cart
['
is_delete_time
']
eq
0"
>
stock-submit
</if>
" data-type="add">+
</span>
</div>
<if
condition=
"$cart['is_shelves'] neq 1"
>
<p>
商品已下架
</p>
</if>
<if
condition=
"$cart['is_delete_time'] neq 0"
>
<p>
商品已作废
</p>
</if>
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥{{$cart.total_price}}
</strong>
</td>
<td
class=
"operation"
>
<a
href=
"javascript:;"
class=
"submit-delete"
data-url=
"{{:U('Home/Cart/Delete')}}"
data-id=
"{{$cart.id}}"
>
删除
</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<tr>
<td
class=
"base"
>
<input
type=
"checkbox"
value=
"2"
/>
<div
class=
"goods-detail"
>
<a
href=
"#"
>
<img
src=
"../images/kouhong.jpg_80x80.jpg"
>
</a>
<div
class=
"goods-base"
>
<a
href=
"#"
class=
"goods-title"
>
第三方撒地方啊打广告公司古代诗歌发到广东省古代诗歌发打发归属感发撒的格式干撒的撒个撒个萨嘎说
</a>
<ul
class=
"goods-attr"
>
<li>
颜色分类:黑色
</li>
<li>
尺码:XXL
</li>
</ul>
</div>
</div>
<div
class=
"wap-base am-show-sm-only"
>
<span
class=
"original-price"
>
¥3964.00
</span>
<strong
class=
"total-price-content"
>
¥2378.00
</strong>
<span
class=
"wap-number"
>
x10
</span>
</div>
</td>
<td
class=
"price am-hide-sm-only"
>
<p
class=
"original-price"
>
¥3964.00
</p>
<p
class=
"line-price"
>
¥2378.00
</p>
</td>
<td
class=
"number am-hide-sm-only"
>
<div
class=
"am-input-group am-input-group-sm number-tag"
>
<span
class=
"am-input-group-label"
>
-
</span>
<input
type=
"text"
class=
"am-form-field"
value=
"1"
/>
<span
class=
"am-input-group-label"
>
+
</span>
</div>
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥2378.00
</strong>
</td>
<td
class=
"operation"
>
<a
href=
"javascript:;"
class=
"delete-submit"
>
删除
</a>
</td>
</tr>
<tr>
<td
class=
"base"
>
<input
type=
"checkbox"
value=
"3"
/>
<div
class=
"goods-detail"
>
<a
href=
"#"
>
<img
src=
"../images/kouhong.jpg_80x80.jpg"
>
</a>
<div
class=
"goods-base"
>
<a
href=
"#"
class=
"goods-title"
>
第三方撒地方啊打广告公司古代诗歌发到广东省古代诗歌发打发归属感发撒的格式干撒的撒个撒个萨嘎说
</a>
<ul
class=
"goods-attr"
>
<li>
颜色分类:黑色
</li>
<li>
尺码:XXL
</li>
</ul>
</div>
</div>
<div
class=
"wap-base am-show-sm-only"
>
<span
class=
"original-price"
>
¥3964.00
</span>
<strong
class=
"total-price-content"
>
¥2378.00
</strong>
<span
class=
"wap-number"
>
x10
</span>
</div>
</td>
<td
class=
"price am-hide-sm-only"
>
<p
class=
"original-price"
>
¥3964.00
</p>
<p
class=
"line-price"
>
¥2378.00
</p>
</td>
<td
class=
"number am-hide-sm-only"
>
<div
class=
"am-input-group am-input-group-sm number-tag"
>
<span
class=
"am-input-group-label"
>
-
</span>
<input
type=
"text"
class=
"am-form-field"
value=
"1"
/>
<span
class=
"am-input-group-label"
>
+
</span>
</div>
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥2378.00
</strong>
</td>
<td
class=
"operation"
>
<a
href=
"javascript:;"
class=
"delete-submit"
>
删除
</a>
</td>
</tr>
</tbody>
</table>
<!-- 导航 -->
<div
class=
"cart-nav"
data-am-sticky=
"{bottom:0}"
>
<div
class=
"am-fl"
>
<label>
<input
type=
"checkbox"
value=
"3"
/>
全选
</label>
<a
href=
"javascript:;"
class=
"delete-submit-all"
>
删除
</a>
<!-- 导航 -->
<div
class=
"cart-nav"
>
<div
class=
"am-fl"
>
<label>
<input
type=
"checkbox"
value=
"3"
class=
"select-all-event"
/>
<span>
全选
</span>
</label>
<a
href=
"javascript:;"
class=
"submit-ajax"
data-url=
"{{:U('Home/Cart/Delete')}}"
data-id=
"{{$base.ids}}"
data-view=
"reload"
data-msg=
"清空后不可恢复、确认操作吗?"
>
清空
</a>
</div>
<div
class=
"am-fr"
>
<span
class=
"selected-tips"
>
已选商品
<strong>
0
</strong>
件
</span>
<span
class=
"total-price-tips"
>
合计:
</span>
<strong
class=
"nav-total-price"
>
¥0.00
</strong>
<button
type=
"button"
class=
"am-btn am-btn-primary separate-submit"
>
结算
</button>
</div>
</div>
<div
class=
"am-fr"
>
<span
class=
"selected-tips"
>
已选商品
<strong>
0
</strong>
件
</span>
<span
class=
"total-price-tips"
>
合计:
</span>
<strong
class=
"nav-total-price"
>
¥2131234
</strong>
<button
type=
"button"
class=
"am-btn am-btn-primary separate-submit"
>
结算
</button>
<else
/>
<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 condition="
empty
($
user
)"
>
javascript:;
<else
/>
{{:U('Home/Favor/Index')}}
</if>
" class="
<if
condition=
"empty($user)"
>
login-event
</if>
">我的收藏夹
</a>
</li>
<li>
<span>
看看
</span>
<a
href=
"<if condition="
empty
($
user
)"
>
javascript:;
<else
/>
{{:U('Home/Order/Index')}}
</if>
" class="
<if
condition=
"empty($user)"
>
login-event
</if>
">我的订单
</a>
</li>
</ul>
</div>
</div>
</
div
>
</
notempty
>
</div>
<!-- 罩层 -->
...
...
service/Application/Home/View/Default/Category/Index.html
0 → 100644
浏览文件 @
5c1b205e
<include
file=
"Public/Header"
/>
<!-- header top nav -->
<include
file=
"Public/HeaderTopNav"
/>
<!-- search -->
<include
file=
"Public/NavSearch"
/>
<!-- header nav -->
<include
file=
"Public/HeaderNav"
/>
<!-- goods category -->
<include
file=
"Public/GoodsCategory"
/>
<!-- content -->
<div
class=
"am-container category-list"
>
<notempty
name=
"goods_category_list"
>
<section
data-am-widget=
"accordion"
class=
"am-accordion am-accordion-gapped"
data-am-accordion=
'{ }'
>
<foreach
name=
"goods_category_list"
item=
"v"
>
<dl
class=
"am-accordion-item am-active"
>
<dt
class=
"am-accordion-title"
>
<a
href=
"{{:U('Home/Search/Index', ['category_id'=>$v['id']])}}"
title=
"{{$v.name}}"
>
{{$v.name}}
</a>
</dt>
<dd
class=
"am-accordion-bd am-collapse am-in"
>
<div
class=
"am-accordion-content"
>
<if
condition=
"!empty($v['items'])"
>
<foreach
name=
"v.items"
item=
"vs"
>
<div
class=
"title"
>
<a
href=
"{{:U('Home/Search/Index', ['category_id'=>$vs['id']])}}"
title=
"{{$vs.name}}"
>
{{$vs.name}}
</a>
</div>
<if
condition=
"!empty($vs['items'])"
>
<ul>
<foreach
name=
"vs.items"
key=
"keyss"
item=
"vss"
>
<li
class=
"am-fl"
>
<a
<
if
condition=
"$keyss eq 0"
>
class="first"
</if>
href="{{:U('Home/Search/Index', ['category_id'=>$vss['id']])}}" title="{{$vss.name}}">{{$vss.name}}
</a>
</li>
</foreach>
</ul>
</if>
</foreach>
</if>
</div>
</dd>
</dl>
</foreach>
</section>
<else
/>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
{{:L('common_not_data_tips')}}
</div>
</notempty>
</div>
<!-- footer start -->
<include
file=
"Public/Footer"
/>
<!-- footer end -->
\ No newline at end of file
service/Application/Home/View/Default/Goods/Index.html
浏览文件 @
5c1b205e
...
...
@@ -12,7 +12,7 @@
<!-- goods category -->
<include
file=
"Public/GoodsCategory"
/>
<div
class=
"goods-detail"
data-id=
"{{$goods.id}}"
data-login-url=
"{{:U('Home/User/ModalLoginInfo')}}"
>
<div
class=
"goods-detail"
data-id=
"{{$goods.id}}"
>
<!-- 轮播 -->
<div
class=
"scoll"
>
<div
data-am-widget=
"slider"
class=
"am-slider am-slider-a1"
data-am-slider=
'{"directionNav":false}'
>
...
...
@@ -95,92 +95,98 @@
</ul>
<!--各种规格-->
<dl
class=
"iteminfo_parameter sys_item_specpara"
>
<dt
class=
"theme-login"
>
<div
class=
"cart-title"
>
<span
class=
"specpara-title"
>
可选规格
</span>
<span
class=
"am-icon-angle-right"
></span>
</div>
</dt>
<dd>
<!--操作页面-->
<div
class=
"theme-popover-mask"
></div>
<div
class=
"theme-popover"
>
<div
class=
"theme-span"
></div>
<div
class=
"theme-poptit"
>
<a
href=
"javascript:;"
title=
"关闭"
class=
"close am-icon-close am-icon-sm"
></a>
</div>
<div
class=
"theme-popbod dform"
>
<form
class=
"theme-signin"
name=
"loginform"
action=
""
method=
"post"
>
<div
class=
"theme-signin-left"
>
<if
condition=
"!empty($goods['attribute']['choose'])"
>
<foreach
name=
"goods.attribute.choose"
key=
"key"
item=
"attribute"
>
<div
class=
"theme-options sku-items"
>
<div
class=
"cart-title"
>
{{$attribute.name}}
</div>
<ul>
<if
condition=
"!empty($attribute['find'])"
>
<foreach
name=
"attribute.find"
key=
"keys"
item=
"attr"
>
<li
class=
"sku-line"
data-parent-id=
"{{$attribute.id}}"
data-id=
"{{$attr.id}}"
>
{{$attr.name}}
<i></i></li>
</foreach>
</if>
</ul>
</div>
</foreach>
</if>
<div
class=
"theme-options"
>
<div
class=
"cart-title number"
>
数量
</div>
<dd>
<div
class=
"am-input-group am-input-group-sm number-tag"
>
<button
class=
"am-input-group-label"
id=
"min"
type=
"button"
>
-
</button>
<input
type=
"text"
class=
"am-form-field"
value=
"1"
id=
"text_box"
/>
<button
class=
"am-input-group-label"
id=
"add"
type=
"button"
>
+
</button>
<if
condition=
"$goods['is_shelves'] == 1"
>
<dl
class=
"iteminfo_parameter sys_item_specpara"
>
<dt
class=
"buy-event login-event"
data-type=
"buy"
>
<div
class=
"cart-title"
>
<span
class=
"specpara-title"
>
可选规格
</span>
<span
class=
"am-icon-angle-right"
></span>
</div>
</dt>
<dd>
<!--操作页面-->
<div
class=
"theme-popover-mask"
></div>
<div
class=
"theme-popover"
>
<div
class=
"theme-span"
></div>
<div
class=
"theme-poptit"
>
<a
href=
"javascript:;"
title=
"关闭"
class=
"close am-icon-close am-icon-sm"
></a>
</div>
<div
class=
"theme-popbod dform"
>
<form
class=
"theme-signin"
name=
"loginform"
action=
""
method=
"post"
>
<div
class=
"theme-signin-left"
>
<if
condition=
"!empty($goods['attribute']['choose'])"
>
<foreach
name=
"goods.attribute.choose"
key=
"key"
item=
"attribute"
>
<div
class=
"theme-options sku-items"
>
<div
class=
"cart-title"
>
{{$attribute.name}}
</div>
<ul>
<notempty
name=
"attribute.find"
>
<foreach
name=
"attribute.find"
key=
"keys"
item=
"attr"
>
<li
class=
"sku-line"
data-parent-id=
"{{$attribute.id}}"
data-id=
"{{$attr.id}}"
>
{{$attr.name}}
<i></i></li>
</foreach>
</notempty>
</ul>
</div>
</foreach>
</if>
<div
class=
"theme-options"
>
<div
class=
"cart-title number"
>
数量
</div>
<dd>
<div
class=
"am-input-group am-input-group-sm number-tag"
>
<button
class=
"am-input-group-label"
id=
"min"
type=
"button"
>
-
</button>
<input
type=
"text"
class=
"am-form-field"
value=
"1"
id=
"text_box"
/>
<button
class=
"am-input-group-label"
id=
"add"
type=
"button"
>
+
</button>
</div>
<span
class=
"tb-hidden stock-tips"
>
库存
<span
class=
"stock"
>
{{$goods.inventory}}
</span>
{{$goods.inventory_unit}}
</span>
</dd>
</div>
<span
class=
"tb-hidden stock-tips"
>
库存
<span
class=
"stock"
>
{{$goods.inventory}}
</span>
{{$goods.inventory_unit}}
</span>
</dd>
</div>
<div
class=
"btn-op"
>
<span
class=
"btn am-btn am-btn-default confirm"
data-type=
"cart"
data-ajax-url=
"{{:U('Home/Cart/Save')}}"
>
确认
</span>
<span
class=
"btn close am-btn am-btn-danger cancel"
>
取消
</span>
</div>
</div>
<div
class=
"theme-signin-right"
>
<div
class=
"img-info"
>
<img
src=
"__PUBLIC__/Home/{{$default_theme}}/Images/songzi.jpg"
/>
</div>
<div
class=
"text-info"
>
<span
class=
"price-now"
>
¥{{$goods.price}}
</span>
</div>
<div
class=
"btn-op"
>
<span
class=
"btn am-btn am-btn-default confirm login-event"
data-type=
"cart"
data-ajax-url=
"{{:U('Home/Cart/Save')}}"
>
确认
</span>
<span
class=
"btn close am-btn am-btn-danger cancel"
>
取消
</span>
</div>
</div>
<div
class=
"theme-signin-right"
>
<div
class=
"img-info"
>
<img
src=
"__PUBLIC__/Home/{{$default_theme}}/Images/songzi.jpg"
/>
</div>
<div
class=
"text-info"
>
<span
class=
"price-now"
>
¥{{$goods.price}}
</span>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
</dd>
</dl>
</div>
</dd>
</dl>
</if>
</div>
<!--手机导航-->
<div
class=
"buy-nav"
>
<div
class=
"buy-nav-opt"
>
<a
href=
"{{:__MY_URL__}}"
>
<span
class=
"am-icon-home am-icon-fw"
>
首页
</span>
</a>
<if
condition=
"isset($goods['is_favor']) and $goods['is_favor'] eq 1"
>
<span
class=
"am-icon-heart am-icon-fw favor-submit text-active"
data-ajax-url=
"{{:U('Home/Goods/Favor')}}"
>
已收藏
</span>
<else
/>
<span
class=
"am-icon-heart am-icon-fw favor-submit"
data-ajax-url=
"{{:U('Home/Goods/Favor')}}"
>
收藏
</span>
</if>
</div>
<li>
<div
class=
"clearfix tb-btn tb-btn-buy theme-login"
>
<button
class=
"buy-submit"
title=
"点此按钮到下一步确认购买信息"
href=
"javascript:;"
data-type=
"buy"
type=
"button"
>
立即购买
</button>
<if
condition=
"$goods['is_shelves'] == 1"
>
<div
class=
"buy-nav-opt"
>
<a
href=
"{{:__MY_URL__}}"
>
<span
class=
"am-icon-home am-icon-fw"
>
首页
</span>
</a>
<if
condition=
"isset($goods['is_favor']) and $goods['is_favor'] eq 1"
>
<span
class=
"am-icon-heart am-icon-fw login-event favor-submit text-active"
data-ajax-url=
"{{:U('Home/Goods/Favor')}}"
>
已收藏
</span>
<else
/>
<span
class=
"am-icon-heart am-icon-fw favor-submit login-event"
data-ajax-url=
"{{:U('Home/Goods/Favor')}}"
>
收藏
</span>
</if>
</div>
<div
class=
"submit"
>
<div
class=
"clearfix tb-btn tb-btn-buy buy-event login-event buy-submit"
data-type=
"buy"
>
<button
title=
"点此按钮到下一步确认购买信息"
href=
"javascript:;"
type=
"button"
>
立即购买
</button>
</div>
</div>
</li
>
<li
>
<div
class=
"clearfix tb-btn tb-btn-basket theme-login"
>
<
button
class=
"cart-submit"
title=
"加入购物车"
href=
"javascript:;"
data-type=
"cart"
data-ajax-url=
"{{:U('Home/Cart/Save')}}"
type=
"button"
><i></i>
加入购物车
</button
>
<div
class=
"submit"
>
<div
class=
"clearfix tb-btn tb-btn-basket buy-event login-event cart-submit"
data-type=
"cart"
data-ajax-url=
"{{:U('Home/Cart/Save')}}"
>
<button
title=
"加入购物车"
href=
"javascript:;"
type=
"button"
><i></i>
加入购物车
</button
>
<
/div
>
</div>
</li>
<else
/>
<p
class=
"shelves-tips"
>
商品已下架
</p>
</if>
</div>
</div>
</div>
...
...
service/Application/Home/View/Default/Index/Index.html
浏览文件 @
5c1b205e
...
...
@@ -19,7 +19,7 @@
<!-- 轮播右侧-内容1 -->
<div
class=
"am-g am-g-fixed small-nav"
>
<div
class=
"am-u-sm-3"
>
<a
href=
"
sort.html
"
>
<a
href=
"
{{:U('Home/Category/Index')}}
"
>
<div
class=
"nav-icon mini-nav-goods-category"
>
<img
src=
"__PUBLIC__/Home/{{$default_theme}}/Images/home-mini-nav-category-icon.png"
/>
</div>
...
...
@@ -27,7 +27,7 @@
</a>
</div>
<div
class=
"am-u-sm-3"
>
<a
href=
"{{:U('Home/Cart/Index')}}"
>
<a
<
if
condition=
"empty($user)"
>
href="javascript:;" class="login-event"
<else
/>
href="{{:U('Home/Cart/Index')}}"
</if>
>
<div
class=
"nav-icon mini-nav-cart"
>
<img
src=
"__PUBLIC__/Home/{{$default_theme}}/Images/home-mini-nav-cart-icon.png"
/>
</div>
...
...
@@ -43,7 +43,7 @@
</a>
</div>
<div
class=
"am-u-sm-3"
>
<a
href=
"<if condition="
empty
($
user
)"
>
{{:U('Home/User/LoginInfo')}}
<else
/>
{{:U('Home/User/Index')}}
</if>
"
>
<a
<
if
condition=
"empty($user)"
>
href="javascript:;" class="login-event"
<else
/>
href="{{:U('Home/User/Index')}}"
</if>
>
<div
class=
"nav-icon mini-nav-user"
>
<img
src=
"__PUBLIC__/Home/{{$default_theme}}/Images/home-mini-nav-user-icon.png"
/>
</div>
...
...
service/Application/Home/View/Default/Public/Error.html
浏览文件 @
5c1b205e
<include
file=
"Public/Header"
/>
<notempty
name=
"is_header"
>
<!-- header top nav -->
<include
file=
"Public/HeaderTopNav"
/>
<!-- search -->
<include
file=
"Public/NavSearch"
/>
<!-- header nav -->
<include
file=
"Public/HeaderNav"
/>
<!-- goods category -->
<include
file=
"Public/GoodsCategory"
/>
</notempty>
<!-- content start -->
<div
class=
"am-g my-content"
<
if
condition=
"!empty($max_width_style)"
>
style="{{$max_width_style}}"
</if>
>
<div
class=
"am-panel am-panel-default am-radius my-error"
>
<div
class=
"am-panel-bd"
>
{{$msg}}
</div>
</div>
<div
class=
"am-g my-content"
>
<div
class=
"am-u-md-6 am-u-sm-centered"
>
<div
class=
"am-panel am-panel-danger am-radius tips-error"
>
<div
class=
"am-panel-bd"
>
{{$msg}}
</div>
</div>
</div>
</div>
<!-- content end -->
...
...
service/Application/Home/View/Default/Public/Footer.html
浏览文件 @
5c1b205e
...
...
@@ -16,6 +16,7 @@
<js
href=
"__PUBLIC__/Common/Lib/assets/js/amazeui.min.js?v={{:MyC('home_static_cache_version')}}"
/>
<js
href=
"__PUBLIC__/Common/Lib/echarts/echarts.min.js?v={{:MyC('home_static_cache_version')}}"
/>
<js
href=
"__PUBLIC__/Common/Lib/imagezoom/jquery.imagezoom.min.js?v={{:MyC('home_static_cache_version')}}"
/>
<js
href=
"__PUBLIC__/Common/Lib/amazeui-dialog/amazeui.dialog.min.js?v={{:MyC('home_static_cache_version')}}"
/>
<!-- ueditor 编辑器 -->
<js
href=
"__PUBLIC__/Common/Lib/ueditor/ueditor.config.js?v={{:MyC('home_static_cache_version')}}"
/>
...
...
service/Application/Home/View/Default/Public/GoodsCategory.html
浏览文件 @
5c1b205e
<!-- 商品分类 -->
<div
id=
"goods-category"
class=
"am-container"
data-controller-name=
"{{$controller_name}}"
>
<div
class=
"goods-category-s"
>
<a
href=
"{{:U('Home/
Search
/Index')}}"
>
<a
href=
"{{:U('Home/
Category
/Index')}}"
>
<div
class=
"goods-category-title"
>
<span
class=
"all-goods"
>
全部分类
</span>
</div>
...
...
@@ -9,7 +9,7 @@
<div
class=
"category-content"
<
if
condition=
"isset($controller_name) and $controller_name neq 'Index'"
>
style="display:none;"
</if>
>
<div
class=
"category"
>
<ul
class=
"category-list"
id=
"js_climit_li"
>
<
if
condition=
"!empty($goods_category_list)
"
>
<
notempty
name=
"goods_category_list
"
>
<foreach
name=
"goods_category_list"
item=
"v"
>
<li
class=
"appliance js_toggle relative first"
>
<div
class=
"category-info"
>
...
...
@@ -51,7 +51,7 @@
</div>
</li>
</foreach>
</
if
>
</
notempty
>
</ul>
</div>
</div>
...
...
service/Application/Home/View/Default/Public/Header.html
浏览文件 @
5c1b205e
...
...
@@ -22,6 +22,7 @@
var
__my_url__
=
'
{{:__MY_URL__}}
'
;
var
__public__
=
'
__PUBLIC__
'
;
var
__default_theme__
=
'
{{$default_theme}}
'
;
var
__modal_login_url__
=
'
{{:U(
'
Home
/
User
/
ModalLoginInfo
'
)}}
'
;
var
__user_id__
=
<
if
condition
=
"
empty($user['id'])
"
>
0
<
else
/>{{$user.id}}</i
f
>
;
</script>
</head>
...
...
service/Application/Home/View/Default/Public/HeaderTopNav.html
浏览文件 @
5c1b205e
...
...
@@ -21,16 +21,35 @@
</ul>
<ul
class=
"message-r"
>
<div
class=
"topMessage home"
>
<div
class=
"menu-hd"
><a
href=
"{{:__MY_URL__}}"
target=
"_top"
class=
"h"
>
商城首页
</a></div>
<div
class=
"menu-hd"
>
<a
href=
"{{:__MY_URL__}}"
target=
"_top"
class=
"h"
>
商城首页
</a>
</div>
</div>
<div
class=
"topMessage my-shangcheng"
>
<div
class=
"menu-hd MyShangcheng"
><a
href=
"#"
target=
"_top"
><i
class=
"am-icon-user am-icon-fw"
></i>
个人中心
</a></div>
<div
class=
"menu-hd MyShangcheng <if condition="
empty
($
user
)"
>
login-event
</if>
">
<a
href=
"<if condition="
empty
($
user
)"
>
javascript:;
<else
/>
{{:U('Home/User/Index')}}
</if>
" target="_top">
<i
class=
"am-icon-user am-icon-fw"
></i>
<span>
个人中心
</span>
</a>
</div>
</div>
<div
class=
"topMessage mini-cart"
>
<div
class=
"menu-hd"
><a
id=
"mc-menu-hd"
href=
"{{:U('Home/Cart/Index')}}"
target=
"_top"
><i
class=
"am-icon-shopping-cart am-icon-fw"
></i><span>
购物车
</span><strong
id=
"J_MiniCartNum"
class=
"h"
>
0
</strong></a></div>
<div
class=
"menu-hd <if condition="
empty
($
user
)"
>
login-event
</if>
">
<a
id=
"mc-menu-hd"
href=
"<if condition="
empty
($
user
)"
>
javascript:;
<else
/>
{{:U('Home/Cart/Index')}}
</if>
" target="_top">
<i
class=
"am-icon-shopping-cart am-icon-fw"
></i>
<span>
购物车
</span>
<strong
id=
"J_MiniCartNum"
class=
"h"
>
0
</strong>
</a>
</div>
</div>
<div
class=
"topMessage favorite"
>
<div
class=
"menu-hd"
><a
href=
"#"
target=
"_top"
><i
class=
"am-icon-heart am-icon-fw"
></i><span>
收藏夹
</span></a></div>
<div
class=
"menu-hd <if condition="
empty
($
user
)"
>
login-event
</if>
">
<a
href=
"<if condition="
empty
($
user
)"
>
javascript:;
<else
/>
{{:U('Home/Favor/Index')}}
</if>
" target="_top">
<i
class=
"am-icon-heart am-icon-fw"
></i>
<span>
收藏夹
</span>
</a>
</div>
</div>
</ul>
</div>
</div>
...
...
service/Application/Home/View/Default/Public/TipsError.html
浏览文件 @
5c1b205e
...
...
@@ -13,7 +13,7 @@
<include
file=
"Public/GoodsCategory"
/>
<!-- conntent start -->
<div
class=
"am-g my-content"
<
if
condition=
"!empty($max_width_style)"
>
style="{{$max_width_style}}"
</if>
>
<div
class=
"am-g my-content"
>
<div
class=
"am-u-md-6 am-u-sm-centered"
>
<div
class=
"am-panel am-panel-default am-radius tips-error"
>
<div
class=
"am-panel-bd"
>
{{$msg}}
</div>
...
...
@@ -22,10 +22,6 @@
</div>
<!-- conntent end -->
<!-- layuot common module start -->
<include
file=
"Public/CommonModule"
/>
<!-- layuot common module end -->
<!-- footer start -->
<include
file=
"Public/Footer"
/>
<!-- footer end -->
\ No newline at end of file
service/Application/Service/BuyService.class.php
浏览文件 @
5c1b205e
...
...
@@ -108,5 +108,148 @@ class BuyService
return
DataReturn
(
L
(
'common_join_error'
),
-
100
);
}
/**
* 获取购物车列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-08-29
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
CartList
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'user'
,
'error_msg'
=>
'用户信息有误'
,
],
];
$ret
=
params_checked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
$where
=
[
'c.user_id'
=>
$params
[
'user'
][
'id'
],
];
$field
=
'c.*, g.title, g.images, g.original_price, g.price, g.inventory, g.is_shelves, g.is_delete_time'
;
$data
=
M
(
'Cart'
)
->
alias
(
'c'
)
->
join
(
' __GOODS__ AS g ON g.id=c.goods_id'
)
->
where
(
$where
)
->
field
(
$field
)
->
select
();
if
(
!
empty
(
$data
)
&&
is_array
(
$data
))
{
$images_host
=
C
(
'IMAGE_HOST'
);
foreach
(
$data
as
&
$v
)
{
$v
[
'goods_url'
]
=
HomeUrl
(
'Goods'
,
'Index'
,
[
'id'
=>
$v
[
'goods_id'
]]);
$v
[
'images'
]
=
empty
(
$v
[
'images'
])
?
null
:
$images_host
.
$v
[
'images'
];
$v
[
'attribute'
]
=
empty
(
$v
[
'attribute'
])
?
null
:
json_decode
(
$v
[
'attribute'
],
true
);
$v
[
'total_price'
]
=
$v
[
'stock'
]
*
$v
[
'price'
];
}
}
return
DataReturn
(
L
(
'common_operation_success'
),
0
,
$data
);
}
/**
* 购物车删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-14
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
CartDelete
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'删除数据id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'user'
,
'error_msg'
=>
'用户信息有误'
,
],
];
$ret
=
params_checked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 删除
$where
=
[
'id'
=>
[
'in'
,
explode
(
','
,
$params
[
'id'
])],
'user_id'
=>
$params
[
'user'
][
'id'
]
];
if
(
M
(
'Cart'
)
->
where
(
$where
)
->
delete
())
{
return
DataReturn
(
L
(
'common_operation_delete_success'
),
0
);
}
return
DataReturn
(
L
(
'common_operation_delete_error'
),
-
100
);
}
/**
* 购物车数量保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-14
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
CartStock
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'数据id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'goods_id'
,
'error_msg'
=>
'商品id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'stock'
,
'error_msg'
=>
'购买数量有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'user'
,
'error_msg'
=>
'用户信息有误'
,
],
];
$ret
=
params_checked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 更新
$where
=
[
'id'
=>
intval
(
$params
[
'id'
]),
'goods_id'
=>
intval
(
$params
[
'goods_id'
]),
'user_id'
=>
intval
(
$params
[
'user'
][
'id'
]),
];
$data
=
[
'stock'
=>
intval
(
$params
[
'stock'
]),
'upd_time'
=>
time
(),
];
if
(
M
(
'Cart'
)
->
where
(
$where
)
->
save
(
$data
))
{
return
DataReturn
(
L
(
'common_operation_update_success'
),
0
);
}
return
DataReturn
(
L
(
'common_operation_update_error'
),
-
100
);
}
}
?>
\ No newline at end of file
service/Public/Common/Js/Common.js
浏览文件 @
5c1b205e
...
...
@@ -586,6 +586,35 @@ function ModalLoad(url, title, tag)
$
(
'
#
'
+
tag
).
modal
();
}
/**
* 价格四舍五入,并且指定保留小数位数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-14
* @desc description
* @param {[float]} value [金额]
* @param {[int]} pos [位数 默认2]
*/
function
FomatFloat
(
value
,
pos
)
{
pos
=
pos
||
2
;
var
f_x
=
Math
.
round
(
value
*
Math
.
pow
(
10
,
pos
))
/
Math
.
pow
(
10
,
pos
);
var
s_x
=
f_x
.
toString
();
var
pos_decimal
=
s_x
.
indexOf
(
'
.
'
);
if
(
pos_decimal
<
0
)
{
pos_decimal
=
s_x
.
length
;
s_x
+=
'
.
'
;
}
while
(
s_x
.
length
<=
pos_decimal
+
2
)
{
s_x
+=
'
0
'
;
}
return
s_x
;
}
// 公共数据操作
$
(
function
()
...
...
@@ -619,45 +648,45 @@ $(function()
*/
$
(
document
).
on
(
'
click
'
,
'
.submit-delete
'
,
function
()
{
$
(
'
#common-confirm-delete
'
).
modal
({
relatedTarget
:
this
,
var
id
=
$
(
this
).
data
(
'
id
'
);
var
url
=
$
(
this
).
data
(
'
url
'
);
var
title
=
$
(
this
).
data
(
'
title
'
)
||
'
温馨提示
'
;
var
msg
=
$
(
this
).
data
(
'
msg
'
)
||
'
删除后不可恢复、确认操作吗?
'
;
AMUI
.
dialog
.
confirm
({
title
:
title
,
content
:
msg
,
onConfirm
:
function
(
options
)
{
// 获取参数
var
$tag
=
$
(
this
.
relatedTarget
);
var
id
=
$tag
.
data
(
'
id
'
);
var
url
=
$tag
.
data
(
'
url
'
);
var
list_tag
=
$tag
.
data
(
'
list-tag
'
)
||
'
#data-list-
'
+
id
;
if
(
id
==
undefined
||
url
==
undefined
)
if
((
id
||
null
)
==
null
||
(
url
||
null
)
==
null
)
{
Prompt
(
'
参数配置有误
'
);
return
false
;
}
// 请求删除数据
$
.
ajax
({
url
:
url
,
type
:
'
POST
'
,
dataType
:
"
json
"
,
timeout
:
10000
,
data
:{
"
id
"
:
id
},
success
:
function
(
result
)
{
if
(
result
.
code
==
0
)
}
else
{
// 请求删除数据
$
.
ajax
({
url
:
url
,
type
:
'
POST
'
,
dataType
:
"
json
"
,
timeout
:
10000
,
data
:{
"
id
"
:
id
},
success
:
function
(
result
)
{
Prompt
(
result
.
msg
,
'
success
'
);
if
(
result
.
code
==
0
)
{
Prompt
(
result
.
msg
,
'
success
'
);
// 成功则删除数据列表
$
(
list_tag
).
remove
();
}
else
{
Prompt
(
result
.
msg
);
// 成功则删除数据列表
$
(
'
#data-list-
'
+
id
).
remove
();
}
else
{
Prompt
(
result
.
msg
);
}
},
error
:
function
(
xhr
,
type
)
{
Prompt
(
'
网络异常出错
'
);
}
},
error
:
function
(
xhr
,
type
)
{
Prompt
(
'
网络异常出错
'
);
}
});
});
}
},
onCancel
:
function
(){}
});
...
...
@@ -983,7 +1012,7 @@ $(function()
});
},
onCancel
:
function
(){}
});
});
});
// 地区联动
...
...
service/Public/Home/Default/Css/Cart.css
浏览文件 @
5c1b205e
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
}
.goods-detail
{
position
:
relative
;
margin-left
:
15
px
;
}
.goods-detail
{
position
:
relative
;
margin-left
:
20
px
;
}
.goods-title
{
display
:
block
;
max-height
:
36px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.goods-title
,
.goods-attr
li
,
.original-price
,
.operation
a
,
.wap-number
,
.selected-tips
,
.cart-nav
a
,
.total-price-tips
,
.cart-nav
label
{
font-size
:
12px
;
}
.goods-title
:hover
{
text-decoration
:
underline
;
}
.goods-base
{
position
:
absolute
;
top
:
0
;
left
:
85px
;
}
.goods-attr
{
margin-top
:
5px
;
}
...
...
@@ -10,21 +9,22 @@
.original-price
{
color
:
#9c9c9c
;
text-decoration
:
line-through
;
}
.line-price
{
color
:
#3c3c3c
;
}
.line-price
,
strong
.total-price-content
,
.nav-total-price
{
font-weight
:
700
;
}
.
number
-tag
{
width
:
100px
;
}
.
number
-tag
.am-form-field
{
padding
:
3px
;
height
:
25px
;
text-align
:
center
;
font-size
:
16px
!important
;
}
.
number
-tag
.am-input-group-label
{
line-height
:
23px
;
height
:
25px
;
font-size
:
14px
!important
;
padding
:
0
10px
;
}
.
number
-tag
.am-input-group-label
,
.cart-nav
label
{
cursor
:
pointer
;
}
.
stock
-tag
{
width
:
100px
;
}
.
stock
-tag
.am-form-field
{
padding
:
3px
;
height
:
25px
;
text-align
:
center
;
font-size
:
16px
!important
;
}
.
stock
-tag
.am-input-group-label
{
line-height
:
23px
;
height
:
25px
;
font-size
:
14px
!important
;
padding
:
0
10px
;
}
.
stock
-tag
.am-input-group-label
,
.cart-nav
label
{
cursor
:
pointer
;
}
strong
.total-price-content
,
.selected-tips
strong
,
.nav-total-price
{
color
:
#d2364c
;
font-size
:
16px
;
}
.
operation
a
{
display
:
block
;
}
.
am-table
{
margin-bottom
:
10px
;
}
.am-table
>
tbody
>
tr
>
td
{
border-top
:
1px
solid
#F5F5F5
;
}
.cart-content
table
td
.base
input
[
type
=
"checkbox"
]
{
float
:
left
;
}
.cart-nav
{
background
:
#eee
;
height
:
50px
;
line-height
:
50px
;
padding
:
0
0
0
5
px
;
}
.cart-nav
.separate-submit
{
height
:
50px
;
width
:
100px
;
font-size
:
20px
;
}
.cart-nav
{
background
:
#eee
;
height
:
50px
;
line-height
:
46
px
;
}
.cart-nav
.separate-submit
{
height
:
50px
;
width
:
100px
;
font-size
:
20px
;
font-weight
:
500
;
}
.selected-tips
{
margin-right
:
15px
;
}
.cart-nav
label
{
font-weight
:
100
;
}
.cart-nav
label
{
font-weight
:
500
;
margin
:
0
;
}
.cart-nav
input
[
type
=
"checkbox"
]
{
vertical-align
:
inherit
;
}
.cart-nav
.delete-submit-all
{
margin-left
:
10px
;
}
.cart-nav
.am-fl
{
margin-left
:
5px
;
}
.cart-nav
.am-fl
a
{
margin-left
:
10px
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
.cart-content
table
tr
.base
{
width
:
30%
;
}
...
...
@@ -38,4 +38,5 @@ strong.total-price-content, .selected-tips strong, .nav-total-price { color: #d2
@media
only
screen
and
(
max-width
:
640px
)
{
.cart-content
table
tr
.base
{
width
:
80%
;
}
.selected-tips
{
display
:
none
;
}
.am-footer
{
margin-top
:
10px
;
}
}
\ No newline at end of file
service/Public/Home/Default/Css/Category.css
0 → 100644
浏览文件 @
5c1b205e
.category-list
ul
{
overflow
:
hidden
;
border-bottom
:
1px
solid
#dedede
;
margin-bottom
:
20px
;
}
.category-list
ul
:last-child
{
border-bottom
:
0
;
margin-bottom
:
0
;
}
.category-list
.title
{
font-weight
:
500
;
}
.category-list
ul
li
{
margin-right
:
10px
;
line-height
:
38px
;
font-size
:
14px
;
}
.category-list
ul
li
a
{
color
:
#888
;
border-left
:
1px
solid
#dedede
;
padding-left
:
10px
;
}
.category-list
ul
li
a
.first
{
border-left
:
0
;
padding-left
:
0
;
}
.am-accordion-gapped
.am-accordion-title
{
font-size
:
16px
;
font-weight
:
500
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
.am-accordion-gapped
{
margin
:
0
;
}
}
@media
only
screen
and
(
max-width
:
1025px
)
{
.am-accordion-gapped
{
margin
:
0
5px
;
}
}
\ No newline at end of file
service/Public/Home/Default/Css/Common.css
浏览文件 @
5c1b205e
...
...
@@ -30,8 +30,6 @@ footer, header, hgroup, menu, nav, section, main {
ul
,
li
,
ol
{
list-style
:
none
;}
dl
,
dd
{
margin
:
auto
;}
.am-btn
{
font-size
:
12px
;}
html
{
width
:
100%
;
height
:
100%
;
-ms-text-size-adjust
:
none
;
...
...
@@ -41,11 +39,11 @@ html{width:100%;
}
/*text-size-adjust不管屏幕怎么变文字大小不变*/
*
{
font-size
:
14
px
;
}
*
,
body
,
html
,
.am-btn
{
font-size
:
12
px
;
}
body
{
margin
:
0
;
padding
:
0
;
width
:
100%
;
font-family
:
arial
,
"Lantinghei SC"
,
"Microsoft Yahei"
;
font-family
:
arial
,
"Lantinghei SC"
,
"Microsoft Yahei"
;
}
.am-form
select
,
.am-form
textarea
,
.am-form
input
[
type
=
"text"
],
.am-form
input
[
type
=
"password"
],
.am-form
input
[
type
=
"datetime"
],
.am-form
input
[
type
=
"datetime-local"
],
.am-form
input
[
type
=
"date"
],
.am-form
input
[
type
=
"month"
],
.am-form
input
[
type
=
"time"
],
.am-form
input
[
type
=
"week"
],
.am-form
input
[
type
=
"number"
],
.am-form
input
[
type
=
"email"
],
.am-form
input
[
type
=
"url"
],
.am-form
input
[
type
=
"search"
],
.am-form
input
[
type
=
"tel"
],
.am-form
input
[
type
=
"color"
],
.am-form-field
{
...
...
@@ -55,9 +53,6 @@ body{margin:0;
height
:
32px
;
font-size
:
14px
!important
;
}
a
:link
,
a
:visited
,
a
:hover
{
text-decoration
:
none
;
outline
:
none
;}
a
:hover
,
a
:focus
{
color
:
#d2364c
;
}
/*所有超链接不要下划线*/
*,
*
:after
,
*
:before
{
...
...
@@ -75,6 +70,8 @@ a {
color
:
#333
;
text-decoration
:
none
;
}
a
:link
,
a
:visited
,
a
:hover
{
outline
:
none
;}
a
:hover
,
a
:focus
{
color
:
#d2364c
!important
;
text-decoration
:
underline
;
}
.spatic
{
width
:
100%
;
height
:
16px
;}
h5
{
float
:
right
;
color
:
#666
;
padding-right
:
20px
;}
...
...
@@ -122,7 +119,7 @@ color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px ;}
/* 顶部小导航 */
.header-top
{
background-color
:
#fafafa
;
border-bottom
:
solid
1px
#f0f0f0
;
}
.header-top
a
,
.header-top
span
{
color
:
#333
;
font-size
:
12px
;
}
.header-top
a
,
.header-top
span
{
color
:
#333
;
}
.header
{
display
:
none
;
max-width
:
1000px
;
margin
:
0px
auto
;
font-size
:
12px
;}
.am-footer
{
border-top
:
2px
solid
#d2364c
;
}
...
...
@@ -145,23 +142,6 @@ color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px ;}
@media
only
screen
and
(
min-width
:
640px
)
{
/*公共*/
html
,
body
,
div
,
span
,
applet
,
object
,
iframe
,
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
p
,
blockquote
,
pre
,
a
,
abbr
,
acronym
,
address
,
big
,
cite
,
code
,
del
,
dfn
,
em
,
img
,
ins
,
kbd
,
q
,
s
,
samp
,
small
,
strike
,
strong
,
sub
,
sup
,
tt
,
var
,
b
,
u
,
i
,
center
,
dl
,
dt
,
dd
,
ol
,
ul
,
li
,
fieldset
,
form
,
label
,
legend
,
table
,
caption
,
tbody
,
tfoot
,
thead
,
tr
,
th
,
td
,
article
,
aside
,
canvas
,
details
,
embed
,
figure
,
figcaption
,
footer
,
header
,
hgroup
,
menu
,
nav
,
output
,
ruby
,
section
,
summary
,
time
,
mark
,
audio
,
video
{
font-size
:
14px
;
}
.am-container
{
padding-left
:
0px
;
padding-right
:
0px
;}
.shop-nav
{
position
:
relative
;}
...
...
@@ -218,7 +198,7 @@ color: #F5F5F2;font-size: 14px;cursor:pointer;border-radius:0px 0px ;}
.nav-table
{
max-width
:
1000px
;
margin
:
0px
auto
;
height
:
45px
;
position
:
relative
;
overflow
:
hidden
;}
.all-goods
{
font-size
:
16px
;}
.goods-category-title
{
background
:
#d2364c
;
color
:
#fff
;
height
:
45px
;
line-height
:
45px
;
display
:
block
;
position
:
absolute
;
width
:
150px
;
text-align
:
center
;
font-size
:
16px
;
top
:
0px
;
z-index
:
6
;
cursor
:
pointer
;}
.nav-cont
{
position
:
absolute
;
padding-left
:
150px
;
display
:
block
;
width
:
100%
;
top
:
0
px
}
.nav-cont
{
position
:
absolute
;
padding-left
:
150px
;
display
:
block
;
width
:
100%
;
top
:
4
px
}
.nav-cont
li
{
float
:
left
;
height
:
45px
;
line-height
:
45px
;}
.nav-cont
li
::before
{
content
:
'\20'
;
display
:
inline-block
;
height
:
16px
;
border-right
:
1px
solid
#d9d9d9
;
width
:
0
;
vertical-align
:
middle
;
margin-left
:
-1px
;}
.nav-cont
li
a
{
font-size
:
16px
;
color
:
#333
;
line-height
:
36px
;
margin-left
:
-1px
;
padding
:
0
25px
;
text-decoration
:
none
;
font-weight
:
700
;
display
:
inline-block
;
vertical-align
:
middle
;}
...
...
@@ -363,7 +343,7 @@ background: url(../Images/ibar_sprites.png) no-repeat;
.item
:hover
,
.quick_toggle
li
:hover
{
background
:
#ed145b
;}
.item
p
{
font-size
:
12px
;
width
:
16px
;
margin
:
0px
auto
;
padding-bottom
:
10px
;}
.item
p
{
width
:
16px
;
margin
:
0px
auto
;
padding-bottom
:
10px
;}
.item
,
.nav-content
{
font-size
:
12px
;}
.ibar_login_box
{
width
:
267px
;
height
:
185px
;
padding
:
10px
;
background
:
#fff
;
box-shadow
:
0
0
5px
rgba
(
0
,
0
,
0
,
.4
);
border-radius
:
5px
0
0
5px
;
border-left
:
1px
solid
#ccc
\
0
;
border-top
:
1px
solid
#ccc
\
0
;
border-bottom
:
1px
solid
#ccc
\
0
;
z-index
:
3
;
position
:
absolute
;
top
:
0px
;
left
:
-270px
;
display
:
none
;}
...
...
@@ -466,6 +446,16 @@ background:url(../Images/ibar_sprites.png) no-repeat;background-position:0px -23
/* 页面加载数据 */
.loding-view
{
text-align
:
center
;
color
:
#888
;
padding
:
10px
0
;
}
/**
* 混合提示
*/
.mixed-tips
{
width
:
360px
;
overflow
:
hidden
;
margin
:
0
auto
;
margin-top
:
5%
;
margin-bottom
:
10%
;
}
.mixed-tips
.icon
{
font-size
:
68px
;
color
:
#ccc
;
margin-right
:
20px
;
}
.mixed-tips-content
{
margin-top
:
10px
;
}
.mixed-tips-content
h1
{
font-size
:
14px
;
font-weight
:
500
;
}
.mixed-tips-content
ul
{
margin-top
:
5px
;
}
.mixed-tips-content
ul
li
a
{
color
:
#d13b49
;
}
/**
* 底部
*/
...
...
@@ -547,6 +537,10 @@ background:url(../Images/ibar_sprites.png) no-repeat;background-position:0px -23
background-color
:
#e86175
;
border-color
:
#e86175
;
}
.am-btn-secondary
:active
,
.am-btn-secondary.am-active
,
.am-dropdown.am-active
.am-btn-secondary.am-dropdown-toggle
{
background-image
:
none
;
background-color
:
#d13b49
;
}
.am-btn-primary
{
color
:
#fff
;
...
...
@@ -560,10 +554,13 @@ background:url(../Images/ibar_sprites.png) no-repeat;background-position:0px -23
color
:
#fff
;
border-color
:
#d31e37
;
}
.am-btn-primary.am-disabled
,
.am-btn-primary
[
disabled
],
fieldset
[
disabled
]
.am-btn-primary
,
.am-btn-primary.am-disabled
:hover
,
.am-btn-primary
[
disabled
]
:hover
,
fieldset
[
disabled
]
.am-btn-primary
:hover
,
.am-btn-primary.am-disabled
:focus
,
.am-btn-primary
[
disabled
]
:focus
,
fieldset
[
disabled
]
.am-btn-primary
:focus
,
.am-btn-primary.am-disabled
:active
,
.am-btn-primary
[
disabled
]
:active
,
fieldset
[
disabled
]
.am-btn-primary
:active
,
.am-btn-primary.am-disabled.am-active
,
.am-btn-primary
[
disabled
]
.am-active
,
fieldset
[
disabled
]
.am-btn-primary.am-active
{
background-color
:
#d31e37
;
border-color
:
#d31e37
;
}
.am-btn-primary
:active
,
.am-btn-primary.am-active
,
.am-dropdown.am-active
.am-btn-primary.am-dropdown-toggle
{
background-image
:
none
;
background-color
:
#d13b49
;
}
.am-popup-hd
.am-popup-title
{
font-size
:
18px
;
}
\ No newline at end of file
service/Public/Home/Default/Css/Goods.css
浏览文件 @
5c1b205e
...
...
@@ -8,7 +8,7 @@ a{text-decoration:none;cursor:pointer}
input
{
font-size
:
12px
;
font-size
:
100%
;
outline
:
none
;
line-height
:
normal
;
color
:
#444
;}
.ipt
{
border
:
solid
1px
#d2d2d2
;
border-left-color
:
#ccc
;
border-top-color
:
#ccc
;
border-radius
:
2px
;
box-shadow
:
inset
0
1px
0
#f8f8f8
;
background-color
:
#fff
;
padding
:
4px
6px
;
height
:
21px
;
line-height
:
21px
;
color
:
#555
;
width
:
180px
;
vertical-align
:
baseline
;}
.ipt
:focus
{
border-color
:
#95C8F1
;
box-shadow
:
0
0
4px
#95C8F1
;}
.
theme-login
,
.item-props-can
{
cursor
:
pointer
;}
.
buy-event
,
.item-props-can
{
cursor
:
pointer
;}
.theme-popover-mask
{
z-index
:
1000
;
position
:
fixed
;
left
:
0
;
top
:
0
;
width
:
100%
;
height
:
100%
;
background
:
#333
;
opacity
:
0.5
;
filter
:
alpha
(
opacity
=
50
);
-moz-opacity
:
0.5
;
display
:
none
;}
.theme-popover
{
z-index
:
10000009
;
position
:
fixed
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
display
:
none
;}
...
...
@@ -21,7 +21,7 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
.scoll
{
margin-bottom
:
10px
;
}
/*内容布局*/
.theme-popover
.theme-poptit
h3
,
.btn.close
,
i
.
theme-login
{
display
:
none
}
.theme-popover
.theme-poptit
h3
,
.btn.close
,
i
.
buy-event
{
display
:
none
}
.theme-span
{
width
:
100%
;
background
:
transparent
;
height
:
15px
;}
.theme-popbod.dform
{
background
:
#fff
;}
/*商品信息*/
...
...
@@ -43,7 +43,7 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
.theme-signin
.btn
{
width
:
100%
;
font-size
:
16px
;
padding
:
5px
;}
.btn-op
{
position
:
fixed
;
left
:
0
;
bottom
:
0
;
width
:
100%
;}
.iteminfo_parameter
dt
.
theme-login
{
text-align
:
left
;
width
:
100%
;}
.iteminfo_parameter
dt
.
buy-event
{
text-align
:
left
;
width
:
100%
;}
.theme-options
dd
{
margin
:
10px
0px
;}
.introduce-main
.am-sticky-placeholder
{
margin
:
0px
!important
;
}
...
...
@@ -87,7 +87,7 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
.btn-op
{
overflow
:
hidden
;
padding
:
10px
20%
;
position
:
static
;}
.theme-signin
.btn
{
width
:
auto
;
font-size
:
12px
;
padding
:
5px
15px
;
border-radius
:
0
;}
.btn.close
{
display
:
block
;
float
:
left
;
position
:
static
;}
i
.
theme-login
{
display
:
inline-block
;}
i
.
buy-event
{
display
:
inline-block
;}
.btn.confirm
{
float
:
right
;
}
.buy-nav
.buy-nav-opt
{
position
:
absolute
;
margin-left
:
283px
;
display
:
block
;
}
...
...
@@ -97,7 +97,7 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
@media
only
screen
and
(
min-width
:
1025px
)
{
i
.
theme-login
{
display
:
none
;}
i
.
buy-event
{
display
:
none
;}
.theme-signin-left
{
padding-top
:
15px
;
float
:
left
;
max-width
:
none
;
padding-bottom
:
0px
;}
.theme-signin-right
{
float
:
left
;
display
:
block
;
overflow
:
hidden
;
padding
:
10px
;}
.theme-signin-right
.img-info
,
.theme-signin-right
.text-info
{
position
:
static
;}
...
...
@@ -170,8 +170,8 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;}
/*规格*/
.theme-signin
.btn-op.act
{
display
:
none
;}
.theme-signin
.btn-op.act
.btn
{
width
:
50%
;
float
:
left
;}
.
theme-login
.cart-title
{
width
:
100%
;
padding
:
5px
;}
.
theme-login
.cart-title
.am-icon-angle-right
{
float
:
right
;}
.
buy-event
.cart-title
{
width
:
100%
;
padding
:
5px
;}
.
buy-event
.cart-title
.am-icon-angle-right
{
float
:
right
;}
/*数量*/
.iteminfo_parameter.munber
,
.iteminfo_parameter.freight
{
display
:
none
;}
.iteminfo_parameter.munber
dd
{
margin-left
:
5px
;}
...
...
@@ -181,14 +181,14 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;}
/*购物车*/
.tb-btn
button
,
.buy-nav
li
,
.buy-nav
.buy-nav-opt
,
.buy-nav
span
{
height
:
35px
;
line-height
:
35px
;
}
.tb-btn
button
,
.buy-nav
div
.submit
,
.buy-nav
.buy-nav-opt
,
.buy-nav
span
{
height
:
35px
;
line-height
:
35px
;
}
.tb-btn
button
{
margin-right
:
0px
;
float
:
left
;
overflow
:
hidden
;
position
:
relative
;
width
:
100%
;
background-color
:
#FFEDED
;
color
:
#F03726
;
font-size
:
14px
;
text-align
:
center
;
border
:
0
;}
.tb-btn-basket
button
{
background-color
:
#F03726
;
color
:
#FFF
;}
.buy-nav
.buy-nav-opt
,
.buy-nav
li
{
float
:
left
;
}
.buy-nav
.buy-nav-opt
,
.buy-nav
div
.submit
{
float
:
left
;
}
.buy-nav
.buy-nav-opt
{
width
:
40%
;
}
.buy-nav
li
{
width
:
30%
;
}
.buy-nav
div
.submit
{
width
:
30%
;
}
.buy-nav
span
{
display
:
inline-block
;
width
:
50%
;
float
:
left
;
;
cursor
:
pointer
;
border-top
:
1px
solid
#f5f5f5
;
border-left
:
1px
solid
#f5f5f5
;}
.tb-detail-hd
h1
{
padding-bottom
:
0.4em
;
line-height
:
1
;
font-size
:
14px
;
font-weight
:
600
;
color
:
#333
;
line-height
:
20px
;}
...
...
@@ -276,7 +276,8 @@ li.am-comment{ width:100%}
.buy-nav
{
position
:
fixed
;
bottom
:
0px
;
right
:
0px
;
z-index
:
1000
;
width
:
100%
;
background
:
#fff
;}
.nav.white
,
.tip
{
z-index
:
999
}
/* 文字提示 */
.shelves-tips
{
color
:
#FF5722
;
margin
:
5px
0
;
font-size
:
14px
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
...
...
@@ -291,8 +292,8 @@ li.am-comment{ width:100%}
ul
.detail-attr
li
{
display
:
inline
;
float
:
left
;
width
:
33.33%
;}
/*可选规格*/
.
theme-login
.cart-title
{
border
:
none
;
margin-left
:
-60px
;
position
:
relative
;
padding
:
10px
0px
5px
10px
;}
.
theme-login
.cart-title
.am-icon-angle-right
{
position
:
absolute
;
right
:
-50px
;}
.
buy-event
.cart-title
{
border
:
none
;
margin-left
:
-60px
;
position
:
relative
;
padding
:
10px
0px
5px
10px
;}
.
buy-event
.cart-title
.am-icon-angle-right
{
position
:
absolute
;
right
:
-50px
;}
/*销量*/
.tm-ind-panel
{
border-width
:
1px
0px
;
margin
:
-1px
0px
0px
0px
;
padding
:
10px
0px
;
...
...
@@ -319,7 +320,7 @@ li.am-comment{ width:100%}
/*购物车*/
.tb-btn-buy
{
margin-left
:
50px
;
margin-right
:
20px
;}
.tb-btn
button
{
width
:
98px
;
border
:
1px
solid
#F03726
;}
.buy-nav
li
{
width
:
auto
;}
.buy-nav
div
.submit
{
width
:
auto
;}
/*印象*/
.p-bfc
{
padding
:
0px
;
}
...
...
@@ -368,7 +369,7 @@ li.am-comment{ width:100%}
/*规格*/
.theme-popover
{
display
:
block
;
position
:
static
;
border
:
none
;
box-shadow
:
none
;}
.theme-poptit
,
.theme-signin-right
,
.iteminfo_parameter
dt
.
theme-login
,
.btn-op
{
display
:
none
;}
.theme-poptit
,
.theme-signin-right
,
.iteminfo_parameter
dt
.
buy-event
,
.btn-op
{
display
:
none
;}
.theme-options
{
overflow
:
visible
;
padding
:
0px
0px
;}
.theme-options
ul
{
overflow
:
hidden
;
float
:
none
;}
...
...
@@ -442,4 +443,5 @@ li.am-comment{ width:100%}
/* 推荐商品 */
.like
li
:not
(
:nth-of-type
(
2
n
))
{
border-right
:
1px
solid
#eee
;
}
.like
li
:nth-child
(
1
),
.like
li
:nth-child
(
2
)
{
border-top
:
0px
;
}
.shelves-tips
{
text-align
:
center
;
}
}
\ No newline at end of file
service/Public/Home/Default/Css/Index.css
浏览文件 @
5c1b205e
...
...
@@ -201,7 +201,7 @@ text-align: center;float:none}
/*楼层*/
.flood
{
border
:
1px
solid
#eee
;
border-top
:
none
;}
.outer-con
.describe
,
.recommendation
.info
h3
{
font-size
:
14px
;
font-weight
:
600
;}
.goods-title
,
.outer-con
.price
{
font-size
:
14px
;
}
/*楼层*/
.flood
.text-one
img
{
width
:
90%
;
margin
:
37%
5%
0%
5%
;}
...
...
@@ -292,7 +292,7 @@ text-align: center;float:none}
.list
.word
{
display
:
block
;
padding
:
20px
0
30px
10px
;}
.word
.outer
{
margin
:
0
10px
10px
0
;
float
:
left
;
width
:
50px
;
height
:
50px
;
text-align
:
center
;
color
:
#2f2f2f
;
background-color
:
#fff
;
border-radius
:
50px
;}
.word
.outer
.inner
{
display
:
table-cell
;
vertical-align
:
middle
;
width
:
50px
;
height
:
50px
;}
.word
.outer
.text
{
font-weight
:
400
;
display
:
inline-block
;
max-width
:
40
px
;
margin
:
0
auto
;}
.word
.outer
.text
{
font-weight
:
400
;
display
:
inline-block
;
max-width
:
35
px
;
margin
:
0
auto
;}
/*楼层*/
.flood
.text-one
,
.flood
.text-two
,
.flood
.text-three
{
width
:
20%
;
text-align
:
center
;
margin
:
0px
0px
;
height
:
200px
;}
...
...
service/Public/Home/Default/Css/Search.css
浏览文件 @
5c1b205e
...
...
@@ -8,7 +8,6 @@
/*任何标签、包括它前面、后面生成的内容都不要影响盒子的边框*/
ul
,
li
,
ol
{
list-style
:
none
;}
dl
,
dt
,
dd
{
margin
:
0px
auto
;
padding
:
0px
;}
p
{
margin
:
0
0
.3rem
0
;
font-size
:
14px
;
}
[
class
*=
"am-u-"
]
{
padding-left
:
0rem
;
padding-right
:
0rem
;}
.am-thumbnails
{
margin-left
:
0rem
;
margin-right
:
0rem
;}
.am-thumbnail
{
margin-bottom
:
0
;}
...
...
service/Public/Home/Default/Js/Cart.js
0 → 100644
浏览文件 @
5c1b205e
$
(
function
()
{
// 计算选择的商品总数和总价
function
cart_base_total
()
{
var
total_stock
=
0
;
var
total_price
=
0.00
;
$
(
'
.am-table input[type="checkbox"]
'
).
each
(
function
(
k
,
v
)
{
if
(
$
(
this
).
prop
(
'
checked
'
))
{
var
stock
=
parseInt
(
$
(
this
).
parents
(
'
tr
'
).
find
(
'
.stock-tag input
'
).
val
());
var
price
=
parseFloat
(
$
(
this
).
parents
(
'
tr
'
).
find
(
'
.stock-tag
'
).
data
(
'
price
'
));
total_stock
+=
stock
;
total_price
+=
stock
*
price
;
}
});
$
(
'
.cart-nav .selected-tips strong
'
).
text
(
total_stock
);
$
(
'
.cart-nav .nav-total-price
'
).
text
(
'
¥
'
+
FomatFloat
(
total_price
));
console
.
log
(
total_stock
,
total_price
)
}
// 购物车数量操作
$
(
'
.stock-tag .stock-submit
'
).
on
(
'
click
'
,
function
()
{
var
id
=
parseInt
(
$
(
this
).
parents
(
'
tr
'
).
data
(
'
id
'
));
var
goods_id
=
parseInt
(
$
(
this
).
parents
(
'
tr
'
).
data
(
'
goods-id
'
));
var
inventory
=
parseInt
(
$
(
this
).
parent
().
data
(
'
inventory
'
));
var
price
=
parseFloat
(
$
(
this
).
parent
().
data
(
'
price
'
));
var
stock
=
parseInt
(
$
(
this
).
parent
().
find
(
'
input
'
).
val
());
var
type
=
$
(
this
).
data
(
'
type
'
);
var
temp_stock
=
(
type
==
'
add
'
)
?
stock
+
1
:
stock
-
1
;
if
(
temp_stock
>
inventory
)
{
temp_stock
=
inventory
;
}
if
(
temp_stock
<=
0
)
{
temp_stock
=
1
;
}
$
(
this
).
parent
().
find
(
'
input
'
).
val
(
temp_stock
);
var
temp_price
=
FomatFloat
(
temp_stock
*
price
,
2
);
$
(
this
).
parents
(
'
tr
'
).
find
(
'
.total-price-content
'
).
text
(
'
¥
'
+
temp_price
);
// 数量不一样则更新
if
(
stock
!=
temp_stock
)
{
// 开启进度条
$
.
AMUI
.
progress
.
start
();
// ajax请求
$
.
ajax
({
url
:
$
(
this
).
parent
().
data
(
'
ajax-url
'
),
type
:
'
post
'
,
dataType
:
"
json
"
,
timeout
:
10000
,
data
:
{
"
id
"
:
id
,
"
goods_id
"
:
goods_id
,
"
stock
"
:
temp_stock
},
success
:
function
(
result
)
{
$
.
AMUI
.
progress
.
done
();
if
(
result
.
code
==
0
)
{
Prompt
(
result
.
msg
,
'
success
'
);
// 计算选择的商品总数和总价
cart_base_total
();
}
else
{
Prompt
(
result
.
msg
);
}
},
error
:
function
(
xhr
,
type
)
{
$
.
AMUI
.
progress
.
done
();
Prompt
(
'
网络异常错误
'
);
}
});
}
});
// 全选/反选
$
(
'
.select-all-event
'
).
on
(
'
click
'
,
function
()
{
if
(
$
(
this
).
prop
(
'
checked
'
))
{
$
(
this
).
next
().
text
(
'
取消
'
);
$
(
'
.am-table input[type="checkbox"]
'
).
each
(
function
(
k
,
v
)
{
if
(
!
$
(
this
).
prop
(
'
disabled
'
))
{
this
.
checked
=
true
;
}
});
}
else
{
$
(
this
).
next
().
text
(
'
全选
'
);
$
(
'
.am-table input[type="checkbox"]
'
).
each
(
function
(
k
,
v
)
{
if
(
!
$
(
this
).
prop
(
'
disabled
'
))
{
this
.
checked
=
false
;
}
});
}
// 计算选择的商品总数和总价
cart_base_total
();
});
// 选择
$
(
'
.am-table input[type="checkbox"]
'
).
on
(
'
click
'
,
function
()
{
// 计算选择的商品总数和总价
cart_base_total
();
});
// 导航固定
var
nav_top
=
$
(
'
.cart-nav
'
).
length
>
0
?
$
(
'
.cart-nav
'
).
offset
().
top
:
0
;
function
cart_nav_pop
()
{
var
scroll
=
$
(
document
).
scrollTop
();
var
location
=
scroll
+
$
(
window
).
height
();
if
(
location
<
nav_top
)
{
$
(
'
.cart-nav
'
).
css
({
"
position
"
:
"
fixed
"
,
"
bottom
"
:
0
,
"
width
"
:
$
(
'
.cart-content
'
).
width
()
+
"
px
"
,
"
z-index
"
:
1000
});
}
else
{
$
(
'
.cart-nav
'
).
css
({
"
position
"
:
"
relative
"
,
"
bottom
"
:
0
,
"
z-index
"
:
0
});
}
}
cart_nav_pop
();
$
(
window
).
scroll
(
function
()
{
cart_nav_pop
();
});
// 浏览器窗口实时事件
$
(
window
).
resize
(
function
()
{
// 导航固定初始化
cart_nav_pop
();
});
});
\ No newline at end of file
service/Public/Home/Default/Js/Common.js
浏览文件 @
5c1b205e
...
...
@@ -87,5 +87,17 @@ $(function()
$
(
'
.nav-search
'
).
css
(
'
position
'
,
'
relative
'
);
}
});
// 登录事件
$
(
'
.login-event
'
).
on
(
'
click
'
,
function
()
{
// 是否登录
if
(
__user_id__
==
0
)
{
ModalLoad
(
__modal_login_url__
,
'
登录
'
);
return
false
;
}
});
});
\ No newline at end of file
service/Public/Home/Default/Js/Goods.js
浏览文件 @
5c1b205e
...
...
@@ -136,16 +136,22 @@ $(function() {
});
//弹出规格选择
$
(
'
.theme-login
'
).
on
(
'
click
'
,
function
()
{
if
(
$
(
window
).
width
()
<
1010
)
{
$
(
document
.
body
).
css
(
"
position
"
,
"
fixed
"
);
$
(
'
.theme-popover-mask
'
).
show
();
$
(
'
.theme-popover
'
).
slideDown
(
200
);
$
(
'
.buy-event
'
).
on
(
'
click
'
,
function
()
{
if
(
$
(
window
).
width
()
<
1010
)
{
// 是否登录
if
(
__user_id__
!=
0
)
{
$
(
document
.
body
).
css
(
"
position
"
,
"
fixed
"
);
$
(
'
.theme-popover-mask
'
).
show
();
$
(
'
.theme-popover
'
).
slideDown
(
200
);
$
(
'
.theme-popover .confirm
'
).
attr
(
'
data-type
'
,
$
(
this
).
data
(
'
type
'
));
}
}
else
{
poptit_pc_show
();
}
});
$
(
'
.theme-poptit .close,.btn-op .close
'
).
on
(
'
click
'
,
function
()
{
$
(
'
.theme-poptit .close,
.btn-op .close
'
).
on
(
'
click
'
,
function
()
{
poptit_close
();
});
...
...
@@ -153,68 +159,70 @@ $(function() {
$
(
'
.buy-submit, .cart-submit
'
).
on
(
'
click
'
,
function
()
{
// 是否登录
if
(
__user_id__
=
=
0
)
if
(
__user_id__
!
=
0
)
{
ModalLoad
(
$
(
'
.goods-detail
'
).
data
(
'
login-url
'
),
'
登录
'
);
return
false
;
}
if
(
$
(
window
).
width
()
>=
1010
)
{
CartAdd
(
$
(
this
));
}
else
{
$
(
'
.theme-popover .confirm
'
).
attr
(
'
data-type
'
,
$
(
this
).
data
(
'
type
'
));
if
(
$
(
window
).
width
()
>=
1010
)
{
CartAdd
(
$
(
this
));
}
}
});
// 购买 确认
$
(
'
.theme-popover .confirm
'
).
on
(
'
click
'
,
function
()
{
if
(
$
(
window
).
width
()
<
1010
)
// 是否登录
if
(
__user_id__
!=
0
)
{
CartAdd
(
$
(
this
));
if
(
$
(
window
).
width
()
<
1010
)
{
CartAdd
(
$
(
this
));
}
}
});
// 收藏
$
(
'
.favor-submit
'
).
on
(
'
click
'
,
function
()
{
var
$this
=
$
(
this
);
// 开启进度条
$
.
AMUI
.
progress
.
start
();
// ajax请求
$
.
ajax
({
url
:
$
(
this
).
data
(
'
ajax-url
'
),
type
:
'
post
'
,
dataType
:
"
json
"
,
timeout
:
10000
,
data
:
{
"
goods_id
"
:
$
(
'
.goods-detail
'
).
data
(
'
id
'
)},
success
:
function
(
result
)
{
poptit_close
();
$
.
AMUI
.
progress
.
done
();
// 是否登录
if
(
__user_id__
!=
0
)
{
var
$this
=
$
(
this
);
// 开启进度条
$
.
AMUI
.
progress
.
start
();
if
(
result
.
code
==
0
)
// ajax请求
$
.
ajax
({
url
:
$
(
this
).
data
(
'
ajax-url
'
),
type
:
'
post
'
,
dataType
:
"
json
"
,
timeout
:
10000
,
data
:
{
"
goods_id
"
:
$
(
'
.goods-detail
'
).
data
(
'
id
'
)},
success
:
function
(
result
)
{
$this
.
text
(
'
'
+
result
.
data
.
text
);
if
(
result
.
data
.
status
==
1
)
poptit_close
();
$
.
AMUI
.
progress
.
done
();
if
(
result
.
code
==
0
)
{
$this
.
addClass
(
'
text-active
'
);
$this
.
text
(
'
'
+
result
.
data
.
text
);
if
(
result
.
data
.
status
==
1
)
{
$this
.
addClass
(
'
text-active
'
);
}
else
{
$this
.
removeClass
(
'
text-active
'
);
}
Prompt
(
result
.
msg
,
'
success
'
);
}
else
{
$this
.
removeClass
(
'
text-active
'
);
Prompt
(
result
.
msg
);
}
Prompt
(
result
.
msg
,
'
success
'
);
}
else
{
Prompt
(
result
.
msg
);
},
error
:
function
(
xhr
,
type
)
{
poptit_close
();
$
.
AMUI
.
progress
.
done
();
Prompt
(
'
网络异常错误
'
);
}
},
error
:
function
(
xhr
,
type
)
{
poptit_close
();
$
.
AMUI
.
progress
.
done
();
Prompt
(
'
网络异常错误
'
);
}
});
});
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录