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
郝肖肖
9 years ago
Commit
4f403e77c4957df9d48cf5683fbf055826be7007
1 parent
ca2d38eb
基础模板店铺优惠券
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
51 deletions
static/js/product/list.js
static/js/product/shop.js
template/m.yohobuy.com/actions/product/index/shop.phtml
template/m.yohobuy.com/partials/product/list.phtml
template/m.yohobuy.com/partials/product/shop-coupon.phtml
yohobuy/m.yohobuy.com/application/models/Product/List.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
static/js/product/list.js
View file @
4f403e7
...
...
@@ -638,3 +638,6 @@ $listNav.on('touchstart', 'li', function() {
}).
on
(
'touchend touchcancel'
,
'li'
,
function
()
{
$listNav
.
find
(
'li'
).
removeClass
(
'bytouch'
);
});
//店铺优惠券
require
(
'./shop_coupon'
);
\ No newline at end of file
...
...
static/js/product/shop.js
View file @
4f403e7
...
...
@@ -955,4 +955,5 @@ $('#collect').on('touchstart', function(e) {
}
});
//店铺优惠券
require
(
'./shop_coupon'
);
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/index/shop.phtml
View file @
4f403e7
...
...
@@ -54,55 +54,9 @@
<div
id=
"home-page"
class=
"main"
>
<div
id=
"nav-main"
class=
"nav-main"
>
<!--
优惠卷
-->
<div
class=
"coupon-content"
>
{
{#if
shopCouponsOne
}
}
{
{#each
shopCoupons
}
}
<div
class=
"coupon-big"
>
<div
class='coupon-left'>
<span
class=
"coupon-left-price"
>
<span
class=
"coupon-sign"
>¥</span>
<span
class=
"coupon-price"
>
{
{money
}
}</span>
</span>
<span
class=
"coupon-left-name"
>
{
{name
}
}
</span>
</div>
{
{#if
status
}
}
<div
class='coupon-right
receive-btn'>
立即领取
</div>
{
{^
}
}
<div
class='coupon-right
padding
-20
'>
已领取
</div>
{
{/if
}
}
</div><!--/coupon-big-->
{
{/each
}
}
{
{^
}
}
{
{#each
shopCoupons
}
}
<div
class=
"coupon-small"
data-id
=
"{{id}}"
>
<div
class='coupon-left'>
<span
class=
"coupon-left-price"
>
<span
class=
"coupon-sign"
>¥</span>
<span
class=
"coupon-price"
>
{
{money
}
}</span>
</span>
<span
class=
"coupon-left-name"
>
{
{name
}
}
</span>
</div>
{
{#if
status
}
}
<div
class='coupon-right
receive-btn'>
立即领取
</div>
{
{^
}
}
<div
class='coupon-right
padding
-20
'>
已领取
</div>
{
{/if
}
}
</div><!--/coupon-small-->
{
{/each
}
}
{
{/if
}
}
</div>
{
{#if
shopCoupons
}
}
{
{>
product/shop-coupon
}
}
{
{/if
}
}
<!--
大导航
-->
{
{#if
brandList
}
}
...
...
template/m.yohobuy.com/partials/product/list.phtml
View file @
4f403e7
...
...
@@ -84,6 +84,11 @@
</div>
</div>
<input
type=
"hidden"
name=
"app_version"
value=
"{{appVersion}}"
>
<!--
店铺优惠卷
-->
{
{#if
shopCoupons
}
}
{
{>
product/shop-coupon
}
}
{
{/if
}
}
{
{/
baseShopHome
}
}
<!--
/基础店铺页面
-->
<ul
id=
"list-nav"
class=
"list-nav clearfix"
>
...
...
template/m.yohobuy.com/partials/product/shop-coupon.phtml
0 → 100644
View file @
4f403e7
<div class="coupon-content">
{{#if shopCouponsOne}}
{{#each shopCoupons}}
<div class="coupon-big">
<div class='coupon-left'>
<span class="coupon-left-price">
<span class="coupon-sign">¥</span>
<span class="coupon-price">{{money}}</span>
</span>
<span class="coupon-left-name">
{{name}}
</span>
</div>
{{#if status}}
<div class='coupon-right receive-btn'>
立即领取
</div>
{{^}}
<div class='coupon-right padding-20'>
已领取
</div>
{{/if}}
</div><!--/coupon-big-->
{{/each}}
{{^}}
{{#each shopCoupons}}
<div class="coupon-small" data-id = "{{id}}">
<div class='coupon-left'>
<span class="coupon-left-price">
<span class="coupon-sign">¥</span>
<span class="coupon-price">{{money}}</span>
</span>
<span class="coupon-left-name">
{{name}}
</span>
</div>
{{#if status}}
<div class='coupon-right receive-btn'>
立即领取
</div>
{{^}}
<div class='coupon-right padding-20'>
已领取
</div>
{{/if}}
</div><!--/coupon-small-->
{{/each}}
{{/if}}
</div>
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/models/Product/List.php
View file @
4f403e7
...
...
@@ -514,7 +514,8 @@ class ListModel
'name'
=>
$value
[
'coupon_name'
],
'pic'
=>
$value
[
'coupon_pic'
],
'money'
=>
$value
[
'money'
],
'status'
=>
$value
[
'status'
]
===
1
,
'status'
=>
$key
===
1
,
// 'status' => $value['status'] === 1,
);
}
}
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
4f403e7
...
...
@@ -531,6 +531,18 @@ class IndexController extends AbstractAction
*/
private
function
baseShop
(
$shop
)
{
$appVersion
=
$this
->
get
(
'app_version'
);
$uid
=
''
;
if
(
empty
(
$appVersion
))
{
$uid
=
$this
->
getUid
(
true
);
}
//app环境
else
{
$uid
=
$this
->
get
(
'uid'
);
$this
->
setSession
(
'appUid'
,
$uid
);
$this
->
setCookie
(
'appUid'
,
$uid
);
}
/* 过滤请求参数 */
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'sort'
=>
FILTER_DEFAULT
,
...
...
@@ -609,11 +621,14 @@ class IndexController extends AbstractAction
$data
[
'goodList'
]
+=
$condition
;
$data
[
'pageFooter'
]
=
true
;
$data
[
'shopCoupons'
]
=
ListModel
::
getShopCouponsList
(
$shop
[
'shops_id'
],
$uid
);
$data
[
'shopCouponsOne'
]
=
count
(
$data
[
'shopCoupons'
])
===
1
;
$this
->
setTitle
(
$title
);
$this
->
setNavHeader
(
$title
,
true
,
SITE_MAIN
);
// 店铺使用基础模板
$baseShopInfo
=
ListModel
::
getShopInfoById
(
$shop
[
'shops_id'
],
$
this
->
getUid
()
);
$baseShopInfo
=
ListModel
::
getShopInfoById
(
$shop
[
'shops_id'
],
$
uid
);
if
(
$baseShopInfo
[
'code'
]
===
200
)
{
$data
[
'baseShopHome'
]
=
array
(
...
...
Please
register
or
login
to post a comment