Authored by 张孝茹

刷新 跳转

@@ -109,7 +109,8 @@ exports.userInfo = (req, res, next) => { @@ -109,7 +109,8 @@ exports.userInfo = (req, res, next) => {
109 let params = { 109 let params = {
110 uid: req.user.uid, 110 uid: req.user.uid,
111 isYohoApp: req.yoho.isYohoApp, 111 isYohoApp: req.yoho.isYohoApp,
112 - isMarsApp: req.yoho.isMarsApp 112 + isMarsApp: req.yoho.isMarsApp,
  113 + isNowApp: req.yoho.isNowApp
113 }; 114 };
114 115
115 req.ctx(family).userInfo(params).then(result => { 116 req.ctx(family).userInfo(params).then(result => {
@@ -116,6 +116,10 @@ class familyModel extends global.yoho.BaseModel { @@ -116,6 +116,10 @@ class familyModel extends global.yoho.BaseModel {
116 if (val) { 116 if (val) {
117 val.nickname = key; 117 val.nickname = key;
118 118
  119 + if (key === 'now') {
  120 + val.isNoOpen = true;
  121 + }
  122 +
119 if (val.login === true) { 123 if (val.login === true) {
120 loginList.push(val); 124 loginList.push(val);
121 } else { 125 } else {
@@ -452,10 +456,8 @@ class familyModel extends global.yoho.BaseModel { @@ -452,10 +456,8 @@ class familyModel extends global.yoho.BaseModel {
452 456
453 if (isMarsApp) { 457 if (isMarsApp) {
454 familyIndexData.userInfoLink = 'http://m.yohobuy.com/home/family/userInfo?openby:mars={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}'; 458 familyIndexData.userInfoLink = 'http://m.yohobuy.com/home/family/userInfo?openby:mars={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}';
455 - } else if (isYohoApp) {  
456 - familyIndexData.userInfoLink = 'http://m.yohobuy.com/home/family/userInfo?openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}';  
457 } else { 459 } else {
458 - familyIndexData.userInfoLink = 'http://m.yohobuy.com/home/family/userInfo'; 460 + familyIndexData.userInfoLink = 'http://m.yohobuy.com/home/family/userInfo?openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}';
459 } 461 }
460 462
461 return familyIndexData; 463 return familyIndexData;
@@ -536,7 +538,7 @@ class familyModel extends global.yoho.BaseModel { @@ -536,7 +538,7 @@ class familyModel extends global.yoho.BaseModel {
536 result[0].data.genderId = 2; 538 result[0].data.genderId = 2;
537 result[0].data.otherGenderId = 1; 539 result[0].data.otherGenderId = 1;
538 } 540 }
539 - if (params.isYohoApp) { 541 + if (params.isYohoApp || params.isNowApp) {
540 result[0].data.qrcodeLink = `http://m.yohobuy.com?openby:yohobuy={"action":"go.h5","params":{ 542 result[0].data.qrcodeLink = `http://m.yohobuy.com?openby:yohobuy={"action":"go.h5","params":{
541 "url":"http://m.yohobuy.com/home/user/qrcode", 543 "url":"http://m.yohobuy.com/home/user/qrcode",
542 "param": { 544 "param": {
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 <div class="title">会员等级及权益</div> 43 <div class="title">会员等级及权益</div>
44 <div class="grade-content"> 44 <div class="grade-content">
45 {{# appList}} 45 {{# appList}}
46 - <div class="content-item" data-login="{{login}}" data-name="{{nickname}}" data-code="{{code}}"> 46 + <div class="content-item" data-login="{{login}}" data-name="{{nickname}}" data-code="{{code}}" {{#if isNoOpen}}data-noopen="{{isNoOpen}}"{{/if}}>
47 <img class="item-tag {{#unless login}}gray{{/unless}}" src="{{image iconUrl 140 140}}"> 47 <img class="item-tag {{#unless login}}gray{{/unless}}" src="{{image iconUrl 140 140}}">
48 <span class="name">{{sourceName}}</span> 48 <span class="name">{{sourceName}}</span>
49 <span class="level">{{name}}</span> 49 <span class="level">{{name}}</span>
@@ -56,6 +56,7 @@ class UserInfo extends Page { @@ -56,6 +56,7 @@ class UserInfo extends Page {
56 }); 56 });
57 this.defaultPic(); 57 this.defaultPic();
58 this.getCity(); 58 this.getCity();
  59 + this.refreshUserInfo();
59 60
60 if (yoho && yoho.isMarsApp) { 61 if (yoho && yoho.isMarsApp) {
61 yoho.ready(() => { 62 yoho.ready(() => {
@@ -64,6 +65,16 @@ class UserInfo extends Page { @@ -64,6 +65,16 @@ class UserInfo extends Page {
64 } 65 }
65 } 66 }
66 67
  68 + refreshUserInfo() {
  69 +
  70 + // 提供给app更改完个人信息之后刷新
  71 + yoho.ready(function() {
  72 + yoho.addNativeMethod('refreshUserInfomation', function() {
  73 + location.href = location.href;
  74 + });
  75 + });
  76 + }
  77 +
67 bindEvents() { 78 bindEvents() {
68 this.selector.$chosenCity.on('click', this.chosenCity.bind(this)); 79 this.selector.$chosenCity.on('click', this.chosenCity.bind(this));
69 this.selector.$cancelBtn.on('click', this.cancelFun.bind(this)); 80 this.selector.$cancelBtn.on('click', this.cancelFun.bind(this));
@@ -153,6 +164,10 @@ class UserInfo extends Page { @@ -153,6 +164,10 @@ class UserInfo extends Page {
153 }).then(result => { 164 }).then(result => {
154 if (result && result.code === 200) { 165 if (result && result.code === 200) {
155 location.href = location.href; 166 location.href = location.href;
  167 +
  168 + if (yoho && yoho.isApp) {
  169 + yoho.invokeMethod('go.refreshUserInfomation');
  170 + }
156 } else { 171 } else {
157 tip.show(result.message); 172 tip.show(result.message);
158 } 173 }
@@ -58,6 +58,7 @@ class FamilyIndex extends Page { @@ -58,6 +58,7 @@ class FamilyIndex extends Page {
58 this.trendWordMarquee(); 58 this.trendWordMarquee();
59 this.resources(); 59 this.resources();
60 this.downLoadInfo(); 60 this.downLoadInfo();
  61 + this.refreshUserInfo();
61 } 62 }
62 63
63 bindEvents() { 64 bindEvents() {
@@ -70,6 +71,16 @@ class FamilyIndex extends Page { @@ -70,6 +71,16 @@ class FamilyIndex extends Page {
70 this.selector.$popover.on('mousewheel touchmove', this.banSliding.bind(this)); 71 this.selector.$popover.on('mousewheel touchmove', this.banSliding.bind(this));
71 } 72 }
72 73
  74 + refreshUserInfo() {
  75 +
  76 + // 提供给app更改完个人信息之后刷新
  77 + yoho.ready(function() {
  78 + yoho.addNativeMethod('refreshUserInfomation', function() {
  79 + location.href = location.href;
  80 + });
  81 + });
  82 + }
  83 +
73 // 头像 84 // 头像
74 headIco() { 85 headIco() {
75 let myImage = new Image(), 86 let myImage = new Image(),
@@ -260,6 +271,7 @@ class FamilyIndex extends Page { @@ -260,6 +271,7 @@ class FamilyIndex extends Page {
260 // 积分图表点击跳转 271 // 积分图表点击跳转
261 jump(params) { 272 jump(params) {
262 let href = `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`; 273 let href = `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`;
  274 +
263 let $linkJump = $('#link-jump'); 275 let $linkJump = $('#link-jump');
264 276
265 if (yoho.isMarsApp || yoho.isNowApp) { 277 if (yoho.isMarsApp || yoho.isNowApp) {
@@ -269,11 +281,23 @@ class FamilyIndex extends Page { @@ -269,11 +281,23 @@ class FamilyIndex extends Page {
269 } 281 }
270 282
271 if (yoho.isMarsApp) { 283 if (yoho.isMarsApp) {
272 - href = href + `&openby:mars={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}"}}}`; 284 +
  285 + href = href + '&openby:yohobuy=' + (JSON.stringify({
  286 + action: 'go.h5',
  287 + params: {
  288 + islogin: 'N',
  289 + type: 0,
  290 + updateflag: Date.now() + '',
  291 + url: href
  292 + }
  293 + }));
273 } 294 }
274 295
275 $linkJump.attr('href', href); 296 $linkJump.attr('href', href);
276 $linkJump[0].click(); 297 $linkJump[0].click();
  298 +
  299 + return false;
  300 +
277 } else { 301 } else {
278 yoho.goH5(href); 302 yoho.goH5(href);
279 } 303 }
@@ -284,8 +308,9 @@ class FamilyIndex extends Page { @@ -284,8 +308,9 @@ class FamilyIndex extends Page {
284 let $this = $(e.currentTarget); 308 let $this = $(e.currentTarget);
285 let appType = $this.data('name').toLowerCase(); 309 let appType = $this.data('name').toLowerCase();
286 let isLogin = $this.data('login'); 310 let isLogin = $this.data('login');
  311 + let isNoOpen = $this.data('noopen');
287 312
288 - if (isLogin) { 313 + if (isLogin && !isNoOpen) {
289 if (this.vipInfo[appType]) { 314 if (this.vipInfo[appType]) {
290 this.selector.$diaC.append(this.view.vipDetailInfo(this.vipInfo[appType])); 315 this.selector.$diaC.append(this.view.vipDetailInfo(this.vipInfo[appType]));
291 } else { 316 } else {
@@ -41,6 +41,10 @@ $('.save').click(function() { @@ -41,6 +41,10 @@ $('.save').click(function() {
41 }) 41 })
42 }, true); 42 }, true);
43 } 43 }
  44 +
  45 + if (yoho && yoho.isApp) {
  46 + yoho.invokeMethod('go.refreshUserInfomation');
  47 + }
44 } 48 }
45 }); 49 });
46 }); 50 });
@@ -48,9 +52,12 @@ $('.save').click(function() { @@ -48,9 +52,12 @@ $('.save').click(function() {
48 (function() { 52 (function() {
49 $('.world-number').html(15 - $('.command-textarea').val().length); 53 $('.world-number').html(15 - $('.command-textarea').val().length);
50 54
51 - if (yoho && yoho.isMarsApp) {  
52 - yoho.ready(() => {  
53 - yoho.invokeMethod('set.removeTopRightButton');  
54 - }); 55 + if (yoho && yoho.isApp) {
  56 +
  57 + if (yoho.isMarsApp) {
  58 + yoho.ready(() => {
  59 + yoho.invokeMethod('set.removeTopRightButton');
  60 + });
  61 + }
55 } 62 }
56 }()); 63 }());