Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
2016-04-21 15:14:10 +0800
Commit
0e334648a35cdbc78be52900c84e04780e15e1a1
1 parent
29b75927
领券单张图的数据
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
43 deletions
library/Plugin/DataProcess/CouponFloorProcess.php
template/m.yohobuy.com/actions/index/coupon/index.phtml
yohobuy/m.yohobuy.com/application/controllers/Coupon.php
library/Plugin/DataProcess/CouponFloorProcess.php
View file @
0e33464
...
...
@@ -30,15 +30,22 @@ class CouponFloorProcess
$build
=
array
();
foreach
(
$data
as
$k
=>
&
$v
)
{
$fun
=
''
;
if
(
empty
(
$v
)
||
!
is_array
(
$v
)
||
!
array_key_exists
(
'template_name'
,
$v
))
{
continue
;
if
(
array_key_exists
(
'templateName'
,
$v
))
{
$fun
=
$v
[
'templateName'
];
}
else
{
continue
;
}
}
if
(
$fun
!==
'single_image'
)
{
$fun
=
$v
[
'template_name'
];
}
$fun
=
$v
[
'template_name'
];
if
(
empty
(
$v
[
'data'
])
||
!
is_callable
(
"self::
$fun
"
))
{
continue
;
}
// tar note 处理楼层标题
if
(
$fun
===
'getCoupon'
&&
$data
[
$k
-
1
][
'template_name'
]
===
'text'
)
{
if
(
$fun
===
'getCoupon'
&&
array_key_exists
(
'template_name'
,
$data
[
$k
-
1
])
&&
$data
[
$k
-
1
][
'template_name'
]
===
'text'
)
{
$v
[
'data'
][
'floorTitle'
]
=
$data
[
$k
-
1
][
'data'
];
}
$build
=
self
::
$fun
(
$v
[
'data'
]);
...
...
@@ -63,8 +70,10 @@ class CouponFloorProcess
return
array
();
}
foreach
(
$data
[
'list'
]
as
&
$item
)
{
$imageSrc
=
Images
::
getImageUrl
(
$item
[
'src'
],
0
,
0
);
$item
[
'src'
]
=
$imageSrc
;
$item
[
'img'
]
=
Images
::
getImageUrl
(
$item
[
'src'
],
0
,
0
);
if
(
!
is_string
(
$item
[
'url'
]))
{
$item
[
'url'
]
=
''
;
}
}
$data
[
'isCarouselBanner'
]
=
true
;
return
$data
;
...
...
@@ -132,14 +141,15 @@ class CouponFloorProcess
/**
*
* 单张图片的处理方法
,不用
* 单张图片的处理方法
*
* @param $data
* @return mixed
*/
private
static
function
single_image
(
$data
)
{
$data
[
'isSingleImage'
]
=
true
;
return
$data
;
$data
[
0
][
'src'
]
=
Images
::
getImageUrl
(
$data
[
0
][
'src'
],
0
,
0
);
$data
[
0
][
'isSingleImage'
]
=
true
;
return
$data
[
0
];
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/coupon/index.phtml
View file @
0e33464
{
{>layout/header
}
}
{
{#
content
}
}
{
{#if
isCarouselBanner
}
}
{
{>home/baner_top
}
}
{
{#if
isCarouselBanner
}
}
<div
class=
"banner-top"
>
<div
class=
"banner-swiper swiper-container"
>
<ul
class=
"swiper-wrapper"
>
{
{#each
list
}
}
{
{#if
@first
}
}
<li
class=
"swiper-slide"
>
<a
href=
"{{url}}"
>
<img
src=
"{{img}}"
>
</a>
</li>
{
{^
}
}
<li
class=
"swiper-slide"
>
<a
href=
"{{url}}"
>
<img
class=
"swiper-lazy"
src=
"{{img}}"
>
</a>
<div
class=
"swiper-lazy-preloader"
></div>
</li>
{
{/if
}
}
{
{/each
}
}
</ul>
</div>
<div
class=
"swiper-pagination"
>
<div
class=
"pagination-inner"
>
</div>
</div>
</div>
{
{/if
}
}
{
{#if
isCoupon
}
}
<div
class=
"coupon-floor"
>
{
{#if
showFloorTitle
}
}
<div
class=
"floor-title"
>
{
{floorTitle
}
}
</div>
{
{/if
}
}
{
{#if
isCoupon
}
}
<div
class=
"coupon-floor"
>
{
{#if
showFloorTitle
}
}
<div
class=
"floor-title"
>
{
{floorTitle
}
}
</div>
{
{/if
}
}
<div
class=
"floor-main"
style=
"background-image: url({{image.src}});"
>
<a
href=
"{{image.url}}"
class=
"main-left"
></a>
{
{#if
isGet
}
}
<div
class=
"main-right-receive"
>
<span
class=
"on-receive"
></span>
</div>
<a
href=
"{{image.url}}"
class=
"main-right-use"
style=
"display: none"
>
<span
class=
"received"
></span>
</a>
{
{/if
}
}
{
{#if
isGeted
}
}
<a
href=
"{{image.url}}"
class=
"main-right-use"
>
<span
class=
"received"
></span>
</a>
{
{/if
}
}
{
{#if
isZero
}
}
<a
href=
"{{image.url}}"
class=
"main-right-go"
>
<span
class=
"zero"
></span>
</a>
{
{/if
}
}
</div>
</div>
<div
class=
"floor-main"
style=
"background-image: url({{image.src}});"
>
<a
href=
"{{image.url}}"
class=
"main-left"
></a>
{
{#if
isGet
}
}
<div
class=
"main-right-receive"
>
<span
class=
"on-receive"
></span>
</div>
<a
href=
"{{image.url}}"
class=
"main-right-use"
style=
"display: none"
>
<span
class=
"received"
></span>
</a>
{
{/if
}
}
{
{#if
isGeted
}
}
<a
href=
"{{image.url}}"
class=
"main-right-use"
>
<span
class=
"received"
></span>
</a>
{
{/if
}
}
{
{#if
isZero
}
}
<a
href=
"{{image.url}}"
class=
"main-right-go"
>
<span
class=
"zero"
></span>
</a>
{
{/if
}
}
</div>
</div>
{
{/if
}
}
{
{/
content
}
}
<div
class=
"floor-mask"
></div>
<div
class=
"floor-message"
>
...
...
yohobuy/m.yohobuy.com/application/controllers/Coupon.php
View file @
0e33464
...
...
@@ -31,10 +31,6 @@ class CouponController extends AbstractAction
if
(
isset
(
$resource
[
'code'
])
&&
$resource
[
'code'
]
==
200
)
{
$result
=
CouponFloorProcess
::
getContent
(
$resource
[
'data'
]);
}
// header("Content-type:text/html;charset=utf-8");
// echo '<pre>';
// print_r($result);
// echo '</pre>';exit;
$this
->
_view
->
display
(
'index'
,
array
(
'content'
=>
$result
,
'floorPage'
=>
true
...
...
Please
register
or
login
to post a comment