切换导航条
此项目
正在载入...
登录
李涵
/
integral
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
徐治堂
6 years ago
提交
a4406079dc8299191ac321453e9df1b8779e9aff
1 个父辈
dbe972ad
master
...
juan
juanli
li
lilijuan
xv
首页、商品列表页,细节优化,商品列表页上拉加载未测试
隐藏空白字符变更
内嵌
并排对比
正在显示
11 个修改的文件
包含
112 行增加
和
26 行删除
app/admin/controller/ZjGoodsController.php
app/admin/controller/ZjNewsController.php
app/goods/controller/GoodsController.php
app/goods/model/GoodsModel.php
app/index/controller/IndexController.php
public/static/index/css/dinnerpart.css
public/static/index/css/index.css
public/themes/simpleboot3/cart/zj_cart/cart.html
public/themes/simpleboot3/goods/list.html
public/themes/simpleboot3/index/index/index.html
public/themes/simpleboot3/user/center/index.html
app/admin/controller/ZjGoodsController.php
查看文件 @
a440607
...
...
@@ -88,6 +88,14 @@ class ZjGoodsController extends AdminBaseController
public
function
state
(){
if
(
$this
->
request
->
isAjax
()){
$param
=
input
(
'param.'
);
if
(
empty
(
$param
[
'is_shove'
])){
if
(
$param
[
'is_shove'
]
==
2
){
$num
=
Db
::
name
(
'zj_goods'
)
->
where
([
'delete_time'
=>
0
,
'is_shove'
=>
2
])
->
count
();
if
(
$num
>=
6
){
$this
->
error
(
'推荐商品最多为6个'
);
}
}
}
$edit
=
Db
::
name
(
'zj_goods'
)
->
update
(
$param
);
if
(
empty
(
$edit
)){
$this
->
error
(
'商品状态修改失败'
);
...
...
app/admin/controller/ZjNewsController.php
查看文件 @
a440607
...
...
@@ -39,8 +39,8 @@ class ZjNewsController extends AdminBaseController
$arr
[
'create_time'
]
=
time
();
if
(
$arr
[
'is_sta'
]
==
1
){
$num
=
Db
::
name
(
'zj_news'
)
->
where
([
'is_sta'
=>
1
,
'delete_time'
=>
0
])
->
count
();
if
(
$num
>=
3
){
$this
->
error
(
'最多同时发布三条系统消息'
);
if
(
$num
>=
1
){
$this
->
error
(
'最多同时发布一条系统消息'
);
}
}
$add
=
Db
::
name
(
'zj_news'
)
->
insert
(
$arr
);
...
...
@@ -71,8 +71,8 @@ class ZjNewsController extends AdminBaseController
$arr
=
input
(
'param.'
);
if
(
$arr
[
'is_sta'
]
==
1
){
$num
=
Db
::
name
(
'zj_news'
)
->
where
([
'is_sta'
=>
1
,
'delete_time'
=>
0
])
->
count
();
if
(
$num
>=
3
){
$this
->
error
(
'最多同时发布三条系统消息'
);
if
(
$num
>=
1
){
$this
->
error
(
'最多同时发布一条系统消息'
);
}
}
$edit
=
Db
::
name
(
'zj_news'
)
->
update
(
$arr
);
...
...
@@ -92,8 +92,8 @@ class ZjNewsController extends AdminBaseController
$arr
=
input
(
'param.'
);
if
(
$arr
[
'is_sta'
]
==
1
){
$num
=
Db
::
name
(
'zj_news'
)
->
where
([
'is_sta'
=>
1
,
'delete_time'
=>
0
])
->
count
();
if
(
$num
>=
3
){
$this
->
error
(
'最多同时发布三条系统消息'
);
if
(
$num
>=
1
){
$this
->
error
(
'最多同时发布一条系统消息'
);
}
}
$edit
=
Db
::
name
(
'zj_news'
)
->
update
(
$arr
);
...
...
app/goods/controller/GoodsController.php
查看文件 @
a440607
...
...
@@ -22,6 +22,11 @@ class GoodsController extends HomeBaseController
$html
=
''
;
if
(
!
empty
(
$goodsList
))
{
foreach
(
$goodsList
as
$item
)
{
if
(
$item
[
'caid'
]
==
1
){
$integral
=
'购买可获得'
.
$item
[
'price'
]
*
2
.
'积分'
;
}
else
{
$integral
=
'该商品无积分奖励'
;
}
$html
.=
'
<a href="'
.
url
(
'goods/Goods/detail'
,
[
'id'
=>
$item
[
'id'
]])
.
'">
<div class="container_list">
...
...
@@ -37,7 +42,7 @@ class GoodsController extends HomeBaseController
</p>
<div class="people">
<p class="people_weight">
购买可获得40积分
'
.
$integral
.
'
</p>
<p class="people_money">¥<span class="money">'
.
$item
[
'price'
]
.
'</span></p>
</div>
...
...
app/goods/model/GoodsModel.php
查看文件 @
a440607
...
...
@@ -8,16 +8,16 @@ class GoodsModel extends Model
public
function
getGoods
(
$is_shove
=
null
,
$cid
=
null
)
{
$map
[
'is_sta'
]
=
[
'eq'
,
1
];
$map
[
'delete_time'
]
=
[
'eq'
,
0
];
$map
[
'g.is_sta'
]
=
[
'eq'
,
1
];
$map
[
'g.delete_time'
]
=
[
'eq'
,
0
];
if
(
$cid
!=
null
)
{
$map
[
'cid'
]
=
[
'eq'
,
$cid
];
$map
[
'
g.
cid'
]
=
[
'eq'
,
$cid
];
}
if
(
$is_shove
!=
null
)
{
$map
[
'is_shove'
]
=
[
'eq'
,
$is_shove
];
$map
[
'
g.
is_shove'
]
=
[
'eq'
,
$is_shove
];
}
$res
=
Db
::
name
(
'zj_goods'
)
->
field
(
'id,name,intro,price,thumb'
)
->
where
(
$map
)
$res
=
Db
::
name
(
'zj_goods'
)
->
alias
(
'g'
)
->
join
(
'zj_category c'
,
'g.cid=c.id'
)
->
field
(
'g.id,g.name,g.intro,g.price,g.thumb,c.cid as caid'
)
->
where
(
$map
)
->
select
()
->
toArray
();
foreach
(
$res
as
$k
=>
$v
)
{
$res
[
$k
][
'thumb'
]
=
cmf_get_image_url
(
$v
[
'thumb'
]);
...
...
app/index/controller/IndexController.php
查看文件 @
a440607
...
...
@@ -17,7 +17,27 @@ class IndexController extends HomeBaseController
{
$goods
=
new
GoodsModel
;
$goodsList
=
$goods
->
getGoods
(
2
);
$id
=
[];
foreach
(
$goodsList
as
$k
=>
$v
){
$id
[
$k
]
=
$v
[
'id'
];
}
$num
=
Db
::
name
(
'zj_evaluate'
)
->
where
([
'delete_time'
=>
'0'
,
'is_sta'
=>
'2'
,
'gid'
=>
[
'in'
,
$id
]])
->
group
(
'gid'
)
->
field
(
"count('gid') as num,gid"
)
->
select
();
foreach
(
$goodsList
as
$k
=>
$v
){
foreach
(
$num
as
$val
){
if
(
$v
[
'id'
]
==
$val
[
'gid'
]){
$goodsList
[
$k
][
'eva'
]
=
$val
[
'num'
];
break
;
}
else
{
$goodsList
[
$k
][
'eva'
]
=
0
;
}
}
}
$notice
=
Db
::
name
(
'zj_news'
)
->
where
([
'delete_time'
=>
0
,
'is_sta'
=>
1
])
->
find
();
$return
=
[
'notice'
=>
$notice
,
'banner'
=>
getBanner
(),
'goodsList'
=>
$goodsList
];
...
...
public/static/index/css/dinnerpart.css
查看文件 @
a440607
...
...
@@ -72,7 +72,8 @@ body,html{
padding
:
0.23rem
0
;
}
.text_img
img
{
width
:
100%
;
width
:
1.2rem
;
height
:
1.2rem
;
border-radius
:
0.1rem
;
}
.container_info
{
...
...
public/static/index/css/index.css
查看文件 @
a440607
...
...
@@ -113,7 +113,8 @@ body,html{
height
:
3.71rem
;
}
.good_img
img
{
width
:
100%
;
width
:
3.71rem
;
height
:
3.71rem
;
}
.good_name
{
width
:
3rem
;
...
...
public/themes/simpleboot3/cart/zj_cart/cart.html
查看文件 @
a440607
...
...
@@ -91,6 +91,8 @@
</p>
<if
condition=
"$vo.caid eq 1"
>
<p
class=
"inter"
>
购买可获得{$vo.price*2}积分
</p>
<else>
<p
class=
"inter"
>
该商品无积分奖励
</p>
</if>
<div
class=
"addcart"
>
<p
class=
"price"
>
...
...
@@ -288,7 +290,7 @@
window
.
location
.
href
=
"{:url('index/index/index')}"
})
$
(
".membercenter"
).
click
(
function
(){
window
.
location
.
href
=
"{:url('
index/index
/index')}"
window
.
location
.
href
=
"{:url('
user/Center
/index')}"
})
</script>
</html>
...
...
public/themes/simpleboot3/goods/list.html
查看文件 @
a440607
...
...
@@ -41,7 +41,7 @@
</p>
<div
class=
"people"
>
<p
class=
"people_weight"
>
购买可获得40积分
<if
condition=
"$vo.caid eq 1"
>
购买可获得{$vo.price*2}积分
<else>
该商品无积分奖励
</if>
</p>
<p
class=
"people_money"
>
¥
<span
class=
"money"
>
{$vo.price}
</span></p>
</div>
...
...
public/themes/simpleboot3/index/index/index.html
查看文件 @
a440607
...
...
@@ -9,6 +9,25 @@
<link
rel=
"stylesheet"
href=
"__INDEX__/css/swiper.min.css"
>
<script
type=
"text/javascript"
src=
"__INDEX__/js/base.js"
></script>
<title>
天生红积分商城
</title>
<style>
.notice_text
{
width
:
6rem
;
height
:
18px
;
overflow
:
hidden
;
margin-top
:
0.15rem
;
position
:
relative
;
}
.companynotice
{
height
:
max-content
;
font-size
:
0.26rem
;
color
:
#1A1A1A
;
margin-left
:
0.17rem
;
position
:
absolute
;
left
:
0
;
top
:
0
}
</style>
</head>
<body>
<!--绑定手机号-->
...
...
@@ -31,7 +50,7 @@
<div
class=
"swiper-wrapper"
>
<volist
name=
"data.banner"
id=
"vo"
>
<div
class=
"swiper-slide"
>
<a
href=
"{$vo.url}"
><img
src=
"{$vo.image}"
alt=
""
></a>
<a
href=
"{$vo.url}"
><img
src=
"{$vo.image}"
></a>
</div>
</volist>
</div>
...
...
@@ -40,17 +59,19 @@
</div>
<div
class=
"notice"
>
<p
class=
"iconfont icon-laba"
></p>
<p
class=
"companynotice"
>
公司公告
</p>
<div
class=
"notice_text"
>
<p
class=
"companynotice"
>
{$data.notice.title}:{$data.notice.content}
</p>
</div>
</div>
<div
class=
"special"
>
<p
class=
"memberarea"
>
<a
href=
"{:url('goods/Goods/goodsList',['cid'=>1])}"
><img
src=
"__INDEX__/img/aicon01@2x.png"
alt=
""
></a>
<a
href=
"{:url('goods/Goods/goodsList',['cid'=>1])}"
><img
src=
"__INDEX__/img/aicon01@2x.png"
></a>
</p>
<p
class=
"cashzone"
>
<a
href=
"{:url('goods/Goods/goodsList',['cid'=>2])}"
><img
src=
"__INDEX__/img/aicon02@2x.png"
alt=
""
></a>
<a
href=
"{:url('goods/Goods/goodsList',['cid'=>2])}"
><img
src=
"__INDEX__/img/aicon02@2x.png"
></a>
</p>
<p
class=
"intergralarea"
>
<a
href=
"{:url('goods/Goods/goodsList',['cid'=>3])}"
><img
src=
"__INDEX__/img/money.png"
alt=
""
></a>
<a
href=
"{:url('goods/Goods/goodsList',['cid'=>3])}"
><img
src=
"__INDEX__/img/money.png"
></a>
</p>
</div>
<div
class=
"specialword"
>
...
...
@@ -78,11 +99,11 @@
{$vo.intro}
</p>
<p
class=
"good_points"
>
购买可获得40积分
<if
condition=
"$vo.caid eq 1"
>
购买可获得{$vo.price*2}积分
<else>
该商品无积分奖励
</if>
</p>
<div
class=
"people"
>
<p
class=
"people_price"
>
¥
<span
class=
"money"
>
{$vo.price}
</span></p>
<p
class=
"people_comment"
>
40
人好评
</p>
<p
class=
"people_comment"
>
{$vo.eva}
人好评
</p>
</div>
</div>
</volist>
...
...
@@ -139,11 +160,39 @@
})
$
(
".shopcart"
).
click
(
function
(){
window
.
location
.
href
=
'shopcar/cart.html'
window
.
location
.
href
=
"{:url('cart/zj_cart/cart')}"
})
$
(
".membercenter"
).
click
(
function
(){
window
.
location
.
href
=
"{:url('user/Center/index')}"
;
})
//系统消息
var
otoutiaoCt
=
document
.
querySelectorAll
(
'.companynotice'
)[
0
];
var
otoutiaoC
=
document
.
querySelectorAll
(
'.notice_text'
)[
0
];
// console.log($('.companynotice').css('height'));
// console.log(otoutiaoCt.offsetHeight);
var
timer0
=
null
;
otoutiaoCt
.
style
.
top
=
otoutiaoC
.
offsetHeight
+
'px'
;
var
tt
=
otoutiaoC
.
offsetHeight
;
console
.
log
(
tt
)
console
.
log
(
otoutiaoCt
.
offsetTop
);
console
.
log
(
otoutiaoCt
.
offsetHeight
);
console
.
log
(
otoutiaoCt
.
style
.
top
);
// // console.log( otoutiaoCt.style.top)
// console.log(otoutiaoCt.offsetTop)
timer0
=
setInterval
(
function
(){
if
(
otoutiaoCt
.
offsetTop
<=-
otoutiaoCt
.
offsetHeight
-
2
){
tt
=
otoutiaoC
.
offsetHeight
;
otoutiaoCt
.
style
.
top
=
tt
+
'px'
;
// console.log( otoutiaoCt.style.Top)
}
else
{
tt
=
tt
-
1
;
otoutiaoCt
.
style
.
top
=
tt
+
'px'
;
// console.log(otoutiaoCt.offsetTop)
var
ll
=-
otoutiaoCt
.
offsetHeight
-
2
+
"px"
;
}
},
4000
/
60
)
</script>
</body>
</html>
...
...
public/themes/simpleboot3/user/center/index.html
查看文件 @
a440607
...
...
@@ -137,7 +137,7 @@
window
.
location
.
href
=
"{:url('index/Index/index')}"
;
})
$
(
".shopcart"
).
click
(
function
(){
window
.
location
.
href
=
'__INDEX__/shopcar/cart.html'
window
.
location
.
href
=
"{:url('cart/zj_cart/cart')}"
})
</script>
</html>
...
...
请
注册
或
登录
后发表评论