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
071a62ddaa4bd8331f0d28130250f75a4c2e33cd
1 parent
8ceb62a4
刷新 跳转
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
12 deletions
apps/home/controllers/family.js
apps/home/models/family.js
apps/home/views/action/family/index.hbs
public/js/home/family-userInfo.page.js
public/js/home/family.page.js
public/js/home/tide-command.page.js
apps/home/controllers/family.js
View file @
071a62d
...
...
@@ -109,7 +109,8 @@ exports.userInfo = (req, res, next) => {
let
params
=
{
uid
:
req
.
user
.
uid
,
isYohoApp
:
req
.
yoho
.
isYohoApp
,
isMarsApp
:
req
.
yoho
.
isMarsApp
isMarsApp
:
req
.
yoho
.
isMarsApp
,
isNowApp
:
req
.
yoho
.
isNowApp
};
req
.
ctx
(
family
).
userInfo
(
params
).
then
(
result
=>
{
...
...
apps/home/models/family.js
View file @
071a62d
...
...
@@ -116,6 +116,10 @@ class familyModel extends global.yoho.BaseModel {
if
(
val
)
{
val
.
nickname
=
key
;
if
(
key
===
'now'
)
{
val
.
isNoOpen
=
true
;
}
if
(
val
.
login
===
true
)
{
loginList
.
push
(
val
);
}
else
{
...
...
@@ -452,10 +456,8 @@ class familyModel extends global.yoho.BaseModel {
if
(
isMarsApp
)
{
familyIndexData
.
userInfoLink
=
'http://m.yohobuy.com/home/family/userInfo?openby:mars={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}'
;
}
else
if
(
isYohoApp
)
{
familyIndexData
.
userInfoLink
=
'http://m.yohobuy.com/home/family/userInfo?openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}'
;
}
else
{
familyIndexData
.
userInfoLink
=
'http://m.yohobuy.com/home/family/userInfo'
;
familyIndexData
.
userInfoLink
=
'http://m.yohobuy.com/home/family/userInfo
?openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}
'
;
}
return
familyIndexData
;
...
...
@@ -536,7 +538,7 @@ class familyModel extends global.yoho.BaseModel {
result
[
0
].
data
.
genderId
=
2
;
result
[
0
].
data
.
otherGenderId
=
1
;
}
if
(
params
.
isYohoApp
)
{
if
(
params
.
isYohoApp
||
params
.
isNowApp
)
{
result
[
0
].
data
.
qrcodeLink
=
`
http
:
//m.yohobuy.com?openby:yohobuy={"action":"go.h5","params":{
"url"
:
"http://m.yohobuy.com/home/user/qrcode"
,
"param"
:
{
...
...
apps/home/views/action/family/index.hbs
View file @
071a62d
...
...
@@ -43,7 +43,7 @@
<div
class=
"title"
>
会员等级及权益
</div>
<div
class=
"grade-content"
>
{{#
appList
}}
<div
class=
"content-item"
data-login=
"
{{
login
}}
"
data-name=
"
{{
nickname
}}
"
data-code=
"
{{
code
}}
"
>
<div
class=
"content-item"
data-login=
"
{{
login
}}
"
data-name=
"
{{
nickname
}}
"
data-code=
"
{{
code
}}
"
{{#if
isNoOpen
}}
data-noopen=
"
{{
isNoOpen
}}
"
{{/if}}
>
<img
class=
"item-tag
{{#
unless
login
}}
gray
{{/
unless
}}
"
src=
"
{{
image
iconUrl
140
140
}}
"
>
<span
class=
"name"
>
{{
sourceName
}}
</span>
<span
class=
"level"
>
{{
name
}}
</span>
...
...
public/js/home/family-userInfo.page.js
View file @
071a62d
...
...
@@ -56,6 +56,7 @@ class UserInfo extends Page {
});
this
.
defaultPic
();
this
.
getCity
();
this
.
refreshUserInfo
();
if
(
yoho
&&
yoho
.
isMarsApp
)
{
yoho
.
ready
(()
=>
{
...
...
@@ -64,6 +65,16 @@ class UserInfo extends Page {
}
}
refreshUserInfo
()
{
// 提供给app更改完个人信息之后刷新
yoho
.
ready
(
function
()
{
yoho
.
addNativeMethod
(
'refreshUserInfomation'
,
function
()
{
location
.
href
=
location
.
href
;
});
});
}
bindEvents
()
{
this
.
selector
.
$chosenCity
.
on
(
'click'
,
this
.
chosenCity
.
bind
(
this
));
this
.
selector
.
$cancelBtn
.
on
(
'click'
,
this
.
cancelFun
.
bind
(
this
));
...
...
@@ -153,6 +164,10 @@ class UserInfo extends Page {
}).
then
(
result
=>
{
if
(
result
&&
result
.
code
===
200
)
{
location
.
href
=
location
.
href
;
if
(
yoho
&&
yoho
.
isApp
)
{
yoho
.
invokeMethod
(
'go.refreshUserInfomation'
);
}
}
else
{
tip
.
show
(
result
.
message
);
}
...
...
public/js/home/family.page.js
View file @
071a62d
...
...
@@ -58,6 +58,7 @@ class FamilyIndex extends Page {
this
.
trendWordMarquee
();
this
.
resources
();
this
.
downLoadInfo
();
this
.
refreshUserInfo
();
}
bindEvents
()
{
...
...
@@ -70,6 +71,16 @@ class FamilyIndex extends Page {
this
.
selector
.
$popover
.
on
(
'mousewheel touchmove'
,
this
.
banSliding
.
bind
(
this
));
}
refreshUserInfo
()
{
// 提供给app更改完个人信息之后刷新
yoho
.
ready
(
function
()
{
yoho
.
addNativeMethod
(
'refreshUserInfomation'
,
function
()
{
location
.
href
=
location
.
href
;
});
});
}
// 头像
headIco
()
{
let
myImage
=
new
Image
(),
...
...
@@ -260,6 +271,7 @@ class FamilyIndex extends Page {
// 积分图表点击跳转
jump
(
params
)
{
let
href
=
`
$
{
location
.
protocol
}
//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`;
let
$linkJump
=
$
(
'#link-jump'
);
if
(
yoho
.
isMarsApp
||
yoho
.
isNowApp
)
{
...
...
@@ -269,11 +281,23 @@ class FamilyIndex extends Page {
}
if
(
yoho
.
isMarsApp
)
{
href
=
href
+
`
&
openby
:
mars
=
{
"action"
:
"go.h5"
,
"params"
:{
"url"
:
"http://m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}"
}}}
`
;
href
=
href
+
'&openby:yohobuy='
+
(
JSON
.
stringify
({
action
:
'go.h5'
,
params
:
{
islogin
:
'N'
,
type
:
0
,
updateflag
:
Date
.
now
()
+
''
,
url
:
href
}
}));
}
$linkJump
.
attr
(
'href'
,
href
);
$linkJump
[
0
].
click
();
return
false
;
}
else
{
yoho
.
goH5
(
href
);
}
...
...
@@ -284,8 +308,9 @@ class FamilyIndex extends Page {
let
$this
=
$
(
e
.
currentTarget
);
let
appType
=
$this
.
data
(
'name'
).
toLowerCase
();
let
isLogin
=
$this
.
data
(
'login'
);
let
isNoOpen
=
$this
.
data
(
'noopen'
);
if
(
isLogin
)
{
if
(
isLogin
&&
!
isNoOpen
)
{
if
(
this
.
vipInfo
[
appType
])
{
this
.
selector
.
$diaC
.
append
(
this
.
view
.
vipDetailInfo
(
this
.
vipInfo
[
appType
]));
}
else
{
...
...
public/js/home/tide-command.page.js
View file @
071a62d
...
...
@@ -41,6 +41,10 @@ $('.save').click(function() {
})
},
true
);
}
if
(
yoho
&&
yoho
.
isApp
)
{
yoho
.
invokeMethod
(
'go.refreshUserInfomation'
);
}
}
});
});
...
...
@@ -48,9 +52,12 @@ $('.save').click(function() {
(
function
()
{
$
(
'.world-number'
).
html
(
15
-
$
(
'.command-textarea'
).
val
().
length
);
if
(
yoho
&&
yoho
.
isMarsApp
)
{
yoho
.
ready
(()
=>
{
yoho
.
invokeMethod
(
'set.removeTopRightButton'
);
});
if
(
yoho
&&
yoho
.
isApp
)
{
if
(
yoho
.
isMarsApp
)
{
yoho
.
ready
(()
=>
{
yoho
.
invokeMethod
(
'set.removeTopRightButton'
);
});
}
}
}());
...
...
Please
register
or
login
to post a comment