切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
anyv
6 years ago
提交
8eec72f5d1ad019991879b895a151b2e0d9443ef
1 个父辈
d30ba2ab
master
...
liuzhen
wangxiaogang
1 个管道 的构建
通过
耗费 1 秒
25
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
57 行增加
和
7 行删除
app/portal/controller/GoodsdetailsController.php
public/themes/simpleboot3/portal/goodsdetails/goods_details.html
app/portal/controller/GoodsdetailsController.php
查看文件 @
8eec72f
...
...
@@ -138,7 +138,7 @@ class GoodsdetailsController extends WeChatBaseController{
$uid
=
cmf_get_current_user_id
();
$arr
[
'goods_id'
]
=
$goods_id
;
$arr
[
'uid'
]
=
$uid
;
$collect
=
Db
::
name
(
'collect'
)
->
where
(
'goods_id'
,
$arr
[
'goods_id'
])
->
find
();
$collect
=
Db
::
name
(
'collect'
)
->
where
(
'goods_id'
,
$arr
[
'goods_id'
])
->
where
(
'uid'
,
$uid
)
->
find
();
if
(
$collect
){
return
3
;
}
else
{
...
...
@@ -153,6 +153,35 @@ class GoodsdetailsController extends WeChatBaseController{
}
/**
* 点击取消收藏
*/
public
function
cancel_goods_collection
(){
$uid
=
cmf_get_current_user_id
();
$goods_id
=
$_POST
[
'goods_id'
];
$data
=
Db
::
name
(
'collect'
)
->
where
(
"uid="
.
$uid
.
" and goods_id="
.
$goods_id
)
->
delete
();
if
(
$data
){
return
true
;
}
else
{
return
false
;
}
}
/**
* 立即支付判断
*/
public
function
goodsdetails_go_pay
(){
...
...
public/themes/simpleboot3/portal/goodsdetails/goods_details.html
查看文件 @
8eec72f
...
...
@@ -121,8 +121,8 @@
<div
class=
"de_footer"
>
<if
condition=
"$is_collect eq 1"
>
<div
class=
"de_footerLeft"
>
<div
class=
"de_footerLeftLi"
style=
"margin-top: 0.1rem"
onclick=
"goods_collection({$data.id})"
>
<div
class=
"de_footerLeftImg"
>
<div
class=
"de_footerLeftLi collection"
style=
"margin-top: 0.1rem"
>
<div
class=
"de_footerLeftImg"
onclick=
"goods_collection({$data.id})"
>
<img
src=
"__TMPL__/public/assets/images/26.png"
alt=
""
id=
"imgsss"
>
</div>
<p
id=
"shoucang"
>
收藏
</p>
...
...
@@ -130,8 +130,8 @@
</div>
<else/>
<div
class=
"de_footerLeft"
>
<div
class=
"de_footerLeftLi"
>
<div
class=
"de_footerLeftImg"
>
<div
class=
"de_footerLeftLi cancel"
>
<div
class=
"de_footerLeftImg"
onclick=
"cancel_goods_collection({{$data.id}})"
>
<img
src=
"__TMPL__/public/assets/images/xin (1).png"
alt=
""
>
</div>
<p>
已收藏
</p>
...
...
@@ -253,9 +253,11 @@
alert
(
'已收藏'
);
}
else
{
if
(
data
){
$
(
"#imgsss"
).
attr
(
"src"
,
"__TMPL__/public/assets/images/xin (1).png"
);
/*
$("#imgsss").attr("src","__TMPL__/public/assets/images/xin (1).png");
$('#shoucang').text('已收藏');
alert
(
'收藏成功'
);
alert('收藏成功');*/
$
(
'.collection'
).
html
(
"<div class='de_footerLeftImg' onclick='cancel_goods_collection("
+
id
+
")'><img src='__TMPL__/public/assets/images/xin (1).png' ></div><p>已收藏</p>"
);
}
else
{
alert
(
'收藏失败'
);
}
...
...
@@ -268,10 +270,29 @@
}
});
}
/**
*点击取消收藏
*/
function
cancel_goods_collection
(
id
){
$
.
post
(
"{:url('Goodsdetails/cancel_goods_collection')}"
,{
goods_id
:
id
},
function
(
data
){
if
(
data
){
$
(
'.cancel'
).
html
(
"<div class='de_footerLeftImg' onclick='goods_collection("
+
id
+
")'><img src='__TMPL__/public/assets/images/26.png' id='imgsss'></div><p id='shoucang'>收藏</p>"
);
}
else
{
alert
(
'取消收藏失败'
);
}
});
}
/**
*点击加入购物车
*/
...
...
请
注册
或
登录
后发表评论