Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
郭成尧
8 years ago
Commit
d0530c31119979e711141858a31062a5d8ac2823
1 parent
05a338a9
'shop-coupon-status'
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
39 deletions
apps/product/controllers/list.js
apps/product/models/list.js
apps/product/views/partial/shop/shop-coupon.hbs
public/js/product/shop/shop.js
public/scss/product/shop/_shop-index-coupon.css
apps/product/controllers/list.js
View file @
d0530c3
...
...
@@ -62,7 +62,7 @@ const baseShopFav = (req, res) => {
const
_shop
=
(
req
,
res
,
shopId
)
=>
{
let
isApp
=
req
.
query
.
app_version
||
req
.
query
.
appVersion
||
false
;
let
pageHeader
=
{};
let
uid
=
0
;
let
uid
=
req
.
user
.
uid
;
// pagecache前端判断
if
(
!
isApp
)
{
...
...
@@ -190,6 +190,7 @@ const brand = (req, res, next) => {
if
(
!
domain
)
{
res
.
redirect
(
'/?go=1'
);
return
;
}
listModel
.
getBrandLogoByDomain
(
domain
).
then
((
result
)
=>
{
...
...
apps/product/models/list.js
View file @
d0530c3
...
...
@@ -166,16 +166,16 @@ const _shopCouponsList = (shopId, uid) => {
let
shopCoupons
=
[];
_
.
forEach
(
result
.
data
,
value
=>
{
let
status
=
parseInt
(
value
.
status
,
10
);
let
couPon
status
=
parseInt
(
value
.
status
,
10
);
if
(
status
===
1
||
status
===
3
)
{
if
(
couPonstatus
===
1
||
couPon
status
===
3
)
{
shopCoupons
.
push
({
validity
:
value
.
couponValidity
,
id
:
crypto
.
encryption
(
''
,
value
.
coupon_id
),
id
:
crypto
.
encryption
(
''
,
value
.
coupon_id
+
''
),
name
:
value
.
coupon_name
,
pic
:
value
.
coupon_pic
,
money
:
value
.
money
,
status
:
status
===
1
money
:
parseInt
(
value
.
money
,
10
),
status
:
couPonstatus
===
1
});
}
});
...
...
apps/product/views/partial/shop/shop-coupon.hbs
View file @
d0530c3
...
...
@@ -12,7 +12,7 @@
{{
name
}}
</span>
</div>
{{#if
status
}}
{{#if
status
}}
<div
class=
'coupon-right receive-btn'
>
立即领取
</div>
...
...
@@ -35,7 +35,7 @@
{{
name
}}
</span>
</div>
{{#if
status
}}
{{#if
status
}}
<div
class=
'coupon-right receive-btn'
>
立即领取
</div>
...
...
public/js/product/shop/shop.js
View file @
d0530c3
...
...
@@ -43,36 +43,36 @@ var winH = $(window).height(),
require
(
'../../common'
);
// pagecache判断app设置cookie,判断是否收藏
(
function
()
{
var
param
=
location
.
search
;
var
isApp
=
param
.
indexOf
(
'app_version'
)
>
-
1
||
param
.
indexOf
(
'appVersion'
)
>
-
1
;
if
(
isApp
)
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/index/shopAppCookie'
,
error
:
function
()
{
tip
.
show
(
'网络断开连接了~'
);
}
});
}
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/index/shopFav'
,
data
:
{
shopId
:
$
(
'.shopid'
).
val
(),
},
success
:
function
(
data
)
{
if
(
data
.
collect
)
{
$collect
.
attr
(
'class'
,
'already-collect'
);
}
},
error
:
function
()
{
tip
.
show
(
'网络断开连接了~'
);
}
});
}());
// (function () {
// var param = location.search;
// var isApp = param.indexOf('app_version') > -1 || param.indexOf('appVersion') > -1;
//
// if (isApp) {
// $.ajax({
// type: 'GET',
// url: '/product/index/shopAppCookie',
// error: function () {
// tip.show('网络断开连接了~');
// }
// });
// }
//
// $.ajax({
// type: 'GET',
// url: '/product/index/shopFav',
// data: {
// shopId: $('.shopid').val(),
// },
// success: function (data) {
// if (data.collect) {
// $collect.attr('class', 'already-collect');
// }
// },
// error: function () {
// tip.show('网络断开连接了~');
// }
// });
// }());
// 默认筛选条件
var
defaultOpt
=
require
(
'../../common/query-param'
);
...
...
public/scss/product/shop/_shop-index-coupon.css
View file @
d0530c3
...
...
@@ -17,7 +17,7 @@
}
.coupon-left
.coupon-left-price
{
margin
:
0
50
px
;
margin
:
0
15
px
;
float
:
left
;
}
...
...
Please
register
or
login
to post a comment