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
张孝茹
7 years ago
Commit
57bc8d0cc797dcd7298b1b9dc3edeed7652af9ed
1 parent
bc86157a
兑换
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
4 deletions
apps/home/controllers/family.js
apps/home/models/family.js
public/hbs/home/coin-get-list.hbs
public/js/home/family-coinMall.page.js
public/scss/home/family-coinMall.page.css
apps/home/controllers/family.js
View file @
57bc8d0
...
...
@@ -170,7 +170,9 @@ exports.getList = (req, res, next) => {
uid
:
req
.
user
.
uid
,
type
:
req
.
query
.
type
,
page
:
req
.
query
.
page
,
limit
:
req
.
query
.
limit
limit
:
req
.
query
.
limit
,
isMarsApp
:
req
.
yoho
.
isMarsApp
,
isNowApp
:
req
.
yoho
.
isNowApp
};
req
.
ctx
(
family
).
getList
(
params
).
then
((
result
)
=>
{
...
...
apps/home/models/family.js
View file @
57bc8d0
...
...
@@ -624,6 +624,17 @@ class familyModel extends global.yoho.BaseModel {
if
(
_
.
get
(
result
,
'data.list'
))
{
resu
.
list
=
result
.
data
.
list
;
}
_
.
forEach
(
resu
.
list
,
function
(
val
)
{
if
(
params
.
isMarsApp
&&
params
.
type
===
'mars'
)
{
val
.
usable
=
true
;
}
if
(
params
.
isNowApp
&&
params
.
type
===
'now'
)
{
val
.
usable
=
true
;
}
});
return
resu
;
});
}
...
...
public/hbs/home/coin-get-list.hbs
View file @
57bc8d0
...
...
@@ -25,8 +25,7 @@
<div
class=
"remain"
>
仅剩
{{#if
stock
}}{{
stock
}}{{/if}}{{#if
num
}}{{
num
}}{{/if}}
份
</div>
</div>
<div
class=
"right"
>
<a
class=
"go-btn yohonow"
href=
"yohoefashion4In1://yoho.cn/"
>
兑换
</a>
<a
class=
"go-btn mars"
href=
"yohomars://yohomars.com/goapp?openby:mars="
>
兑换
</a>
<span
class=
"go-btn
{{#if
usable
}}
usable
{{/if}}
"
data-id=
"
{{
id
}}
"
data-level=
"
{{
level
}}
"
>
兑换
</span>
</div>
</div>
</div>
...
...
public/js/home/family-coinMall.page.js
View file @
57bc8d0
...
...
@@ -74,6 +74,10 @@ class IconMall extends Page {
this
.
selector
.
$marsTab
.
append
(
$result
);
}
this
.
loading
=
false
;
this
.
selector
.
$goBtn
=
$
(
'.go-btn'
);
this
.
selector
.
$goBtn
.
on
(
'click'
,
this
.
goConversion
.
bind
(
this
));
lazyLoad
(
$result
.
find
(
'img.lazy'
));
}
else
{
this
.
end
=
true
;
...
...
@@ -148,6 +152,28 @@ class IconMall extends Page {
yoho
.
invokeMethod
(
'go.point_detail'
);
}
}
goConversion
(
e
)
{
let
$this
=
$
(
e
.
currentTarget
);
let
type
=
$this
.
closest
(
'.tab-item-c'
).
attr
(
'id'
);
let
goodId
=
$this
.
data
(
'id'
);
let
goodsLevel
=
$this
.
data
(
'level'
);
if
(
$this
.
hasClass
(
'usable'
))
{
if
(
yoho
&&
yoho
.
isMarsApp
)
{
yoho
.
invokeMethod
(
'go.mars_point'
,
{
goodId
:
goodId
,
goods_level
:
goodsLevel
});
}
else
if
(
yoho
&&
yoho
.
isNowApp
)
{
yoho
.
invokeMethod
(
'go.yohoCoins'
,
{
goodId
:
goodId
});
}
}
else
{
if
(
type
===
'yohonow-tab'
)
{
tip
.
show
(
'请到yohonowapp打开'
);
}
else
if
(
type
===
'mars-tab'
)
{
tip
.
show
(
'请到mars打开'
);
}
}
}
}
$
(()
=>
{
...
...
public/scss/home/family-coinMall.page.css
View file @
57bc8d0
...
...
@@ -220,10 +220,14 @@ html {
text-align
:
center
;
color
:
#fff
;
font-size
:
28px
;
background-color
:
#
00
0
;
background-color
:
#
b0b0b
0
;
display
:
block
;
margin-top
:
25px
;
}
.usable
{
background-color
:
#000
;
}
}
}
}
...
...
Please
register
or
login
to post a comment