切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
anyv
6 years ago
提交
6e9cc9274829d86e0de387d2be8b9c3068c9db26
1 个父辈
c40c8a1e
1 个管道 的构建
通过
耗费 0 秒
2
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
45 行增加
和
2 行删除
app/portal/controller/ShopcartController.php
public/themes/simpleboot3/portal/shopcart/shop_cart.html
app/portal/controller/ShopcartController.php
查看文件 @
6e9cc92
...
...
@@ -79,7 +79,33 @@ class ShopcartController extends WeChatBaseController{
}
/**
* 商品数量加一
*/
public
function
shop_cart_numadd
(){
$id
=
$_POST
[
'id'
];
$data
=
Db
::
name
(
'shopping_cart'
)
->
where
(
'id'
,
$id
)
->
find
();
if
(
$data
[
'book_num'
]
<
200
){
Db
::
name
(
'shopping_cart'
)
->
where
(
'id'
,
$id
)
->
setInc
(
'book_num'
);
}
return
true
;
}
/**
* 商品数量减一
*/
public
function
shop_cart_numdec
(){
$id
=
$_POST
[
'id'
];
$data
=
Db
::
name
(
'shopping_cart'
)
->
where
(
'id'
,
$id
)
->
find
();
if
(
$data
[
'book_num'
]
>
1
){
Db
::
name
(
'shopping_cart'
)
->
where
(
'id'
,
$id
)
->
setDec
(
'book_num'
);
}
return
true
;
}
...
...
public/themes/simpleboot3/portal/shopcart/shop_cart.html
查看文件 @
6e9cc92
...
...
@@ -37,9 +37,9 @@
<div
class=
"order_newsTxt3"
>
<p
class=
"de_topTxt1_1"
>
¥
<span>
{$vo.price0}
</span>
.{$vo.price1}
</p>
<div
class=
"order_newsNum"
>
<div
class=
"order_newsJian"
>
-
</div>
<div
class=
"order_newsJian"
onclick=
"jia({$vo.carid})"
>
-
</div>
<input
class=
"order_newsnum"
type=
"text"
readonly=
"readonly"
value=
"1"
/>
<div
class=
"order_newsJia"
>
+
</div>
<div
class=
"order_newsJia"
onclick=
"jian({$vo.carid})"
>
+
</div>
</div>
</div>
</div>
...
...
@@ -146,6 +146,23 @@
}
/**
*点击加一
*/
function
jia
(
id
){
$
.
post
(
"{:url('Shopcart/shop_cart_numadd')}"
,{
id
:
id
},
function
(
data
){
});
}
/**
* 点击减一
*/
function
jian
(
id
){
$
.
post
(
"{:url('Shopcart/shop_cart_numdec')}"
,{
id
:
id
},
function
(
data
){
});
}
// 计算总计
function
calcTotal
()
{
var
checkBoxes
=
$
(
".sh_cartround img"
);
...
...
请
注册
或
登录
后发表评论