切换导航条
此项目
正在载入...
登录
潘浩文
/
scoreshop
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
58a0754afcd91236ed6e2fe73bde18d2cfe649aa
1 个父辈
0638af41
1 个管道 的构建
通过
耗费 0 秒
1
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
45 行增加
和
9 行删除
app/portal/controller/ActiveController.php
public/themes/simpleboot3/portal/active/active.html
app/portal/controller/ActiveController.php
查看文件 @
58a0754
...
...
@@ -113,7 +113,13 @@ class ActiveController extends WeChatBaseController
public
function
activeAjax
(){
$this
->
checkUser
();
$status
=
$this
->
request
->
param
(
'status'
);
$data
=
Db
::
name
(
'active'
)
->
where
(
'status'
,
$status
)
->
select
();
$data
=
Db
::
name
(
'active'
)
->
where
(
'status'
,
$status
)
->
select
()
->
toArray
();
foreach
(
$data
as
$k
=>
$v
)
{
$data
[
$k
][
'url'
]
=
url
(
'portal/active/activeDetail'
,
array
(
'id'
=>
$data
[
$k
][
'id'
]));
$data
[
$k
][
'image'
]
=
cmf_get_image_preview_url
(
$data
[
$k
][
'thumbnail'
]);
$data
[
$k
][
'active_time'
]
=
date
(
'Y-m-d'
,
$data
[
$k
][
'active_time'
]);
$data
[
$k
][
'end_time'
]
=
date
(
'Y-m-d'
,
$data
[
$k
][
'end_time'
]);
};
$this
->
assign
(
'list'
,
$data
);
return
$this
->
fetch
();
}
...
...
public/themes/simpleboot3/portal/active/active.html
查看文件 @
58a0754
...
...
@@ -117,19 +117,19 @@
</div>
</div>
<div
class=
"kind"
>
<div
class=
"kind_type active"
>
<div
class=
"kind_type active"
data-id=
"1"
>
<p
class=
"kind_img"
>
<img
src=
"__TMPL__/public/assets/images/img/huiyuan.png"
alt=
""
>
</p>
<p
class=
"kind_name"
>
会员活动
</p>
</div>
<div
class=
"kind_type"
>
<div
class=
"kind_type"
data-id=
"2"
>
<p
class=
"kind_img"
>
<img
src=
"__TMPL__/public/assets/images/img/shop.png"
alt=
""
>
</p>
<p
class=
"kind_name"
>
商家活动
</p>
</div>
<div
class=
"kind_type"
>
<div
class=
"kind_type"
data-id=
"3"
>
<p
class=
"kind_img"
>
<img
src=
"__TMPL__/public/assets/images/img/shang.png"
alt=
""
>
</p>
...
...
@@ -138,6 +138,7 @@
</div>
<div
class=
"list"
>
<foreach
name=
"list"
item=
"vo"
>
<a
href=
"{:url('portal/active/activeDetail',array('id'=>$vo.id))}"
style=
"text-decoration:none;"
>
<div
class=
"list_item"
>
<div
class=
"item_img"
>
<img
src=
"{:cmf_get_image_preview_url($vo.thumbnail)}"
alt=
""
>
...
...
@@ -148,12 +149,46 @@
<p
class=
"item_date"
>
{:date('Y-m-d',$vo['active_time'])}-{:date('Y-m-d',$vo['end_time'])}
</p>
</div>
</div>
</a>
</foreach>
</div>
</div>
<script
type=
"text/javascript"
src=
"__TMPL__/public/assets/js/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"__TMPL__/public/assets/js/swiper.min.js"
></script>
<script>
$
(
".kind_type"
).
click
(
function
(){
$
(
this
).
addClass
(
"active"
);
$
(
this
).
siblings
(
".kind_type"
).
removeClass
(
"active"
)
})
$
(
".active"
).
click
(
function
(){
var
status
=
$
(
this
).
data
(
'id'
)
$
.
ajax
({
url
:
"{:url('portal/active/activeAjax')}"
,
type
:
"post"
,
data
:
{
status
:
status
,
},
success
:
function
(
data
)
{
var
html
=
""
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
html
+=
' <a href="'
+
data
[
i
].
url
+
'" style="text-decoration:none;">\n'
+
' <div class="list_item">\n'
+
' <div class="item_img">\n'
+
' <img src="'
+
data
[
i
].
image
+
'" alt="">\n'
+
' </div>\n'
+
' <div class="flooritem">\n'
+
' <p class="item_name">'
+
data
[
i
].
name
+
'</p>\n'
+
'\n'
+
' <p class="item_date">'
+
data
[
i
].
active_time
+
'-'
+
data
[
i
].
end_time
+
'</p>\n'
+
' </div>\n'
+
' </div>\n'
+
' </a>'
}
$
(
".list"
).
html
(
html
);
}
})
})
var
mySwiper
=
new
Swiper
(
'.swiper-container'
,
{
pagination
:
{
el
:
'.swiper-pagination'
,
...
...
@@ -161,11 +196,6 @@
autoplay
:
true
,
//可选选项,自动滑动
})
//活动详情页
$
(
".list_item"
).
click
(
function
(){
window
.
location
.
href
=
'activedetail.html'
})
</script>
</body>
</html>
...
...
请
注册
或
登录
后发表评论