Authored by zhangxiaoru

Merge branch 'feature/family' of git.yoho.cn:fe/yohobuywap-node into feature/family

@@ -55,6 +55,7 @@ module.exports = () => { @@ -55,6 +55,7 @@ module.exports = () => {
55 yoho.clientIp = _getClientIp(req); 55 yoho.clientIp = _getClientIp(req);
56 56
57 // 判断请求是否来自app 57 // 判断请求是否来自app
  58 + yoho.isNowApp = /yohonow/i.test(req.get('User-Agent') || '');
58 yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || ''); 59 yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || '');
59 yoho.isApp = yoho.isMarsApp || 60 yoho.isApp = yoho.isMarsApp ||
60 req.cookies.app_version || 61 req.cookies.app_version ||
@@ -5,6 +5,7 @@ import $ from 'yoho-jquery'; @@ -5,6 +5,7 @@ import $ from 'yoho-jquery';
5 import Page from 'yoho-page'; 5 import Page from 'yoho-page';
6 import tip from 'plugin/tip'; 6 import tip from 'plugin/tip';
7 import cityRender from 'home/chosen-city.hbs'; 7 import cityRender from 'home/chosen-city.hbs';
  8 +import yoho from 'yoho-app';
8 9
9 class UserInfo extends Page { 10 class UserInfo extends Page {
10 constructor() { 11 constructor() {
@@ -25,7 +26,8 @@ class UserInfo extends Page { @@ -25,7 +26,8 @@ class UserInfo extends Page {
25 $cancelBtn: $('.swiper-header .cancel'), 26 $cancelBtn: $('.swiper-header .cancel'),
26 $okBtn: $('.swiper-header .ok'), 27 $okBtn: $('.swiper-header .ok'),
27 $provinceText: $('.province-text'), 28 $provinceText: $('.province-text'),
28 - $cityText: $('.city-text') 29 + $cityText: $('.city-text'),
  30 + $userPic: $('.user-pic')
29 }; 31 };
30 32
31 this.view = { 33 this.view = {
@@ -60,6 +62,17 @@ class UserInfo extends Page { @@ -60,6 +62,17 @@ class UserInfo extends Page {
60 this.selector.$cancelBtn.on('click', this.cancelFun.bind(this)); 62 this.selector.$cancelBtn.on('click', this.cancelFun.bind(this));
61 this.selector.$okBtn.on('click', this.okFun.bind(this)); 63 this.selector.$okBtn.on('click', this.okFun.bind(this));
62 this.selector.$chosenCity.on('DOMNodeInserted', this.modifyInp.bind(this)); 64 this.selector.$chosenCity.on('DOMNodeInserted', this.modifyInp.bind(this));
  65 + this.selector.$userPic.on('click', this.userPic.bind(this));
  66 + }
  67 +
  68 + userPic() {
  69 + if (yoho.isApp) {
  70 + yoho.ready(function() {
  71 + yoho.invokeMethod('go.setAvatar', {}, (data) => {
  72 + console.log(data);
  73 + });
  74 + });
  75 + }
63 } 76 }
64 77
65 cancelFun() { 78 cancelFun() {
@@ -37,6 +37,7 @@ yoho = { @@ -37,6 +37,7 @@ yoho = {
37 /** 37 /**
38 * 判断是否是 APP 38 * 判断是否是 APP
39 */ 39 */
  40 + isNowApp: /yohonow/i.test(navigator.userAgent || ''),
40 isMarsApp: /YohoMars/i.test(navigator.userAgent || ''), 41 isMarsApp: /YohoMars/i.test(navigator.userAgent || ''),
41 isApp: /YohoMars/i.test(navigator.userAgent || '') || 42 isApp: /YohoMars/i.test(navigator.userAgent || '') ||
42 /YohoBuy/i.test(navigator.userAgent || '') || 43 /YohoBuy/i.test(navigator.userAgent || '') ||
@@ -39,7 +39,7 @@ input::-webkit-calendar-picker-indicator { @@ -39,7 +39,7 @@ input::-webkit-calendar-picker-indicator {
39 .main { 39 .main {
40 width: 450px; 40 width: 450px;
41 float: left; 41 float: left;
42 - height: 90px; 42 + min-height: 90px;
43 padding: 10px 0; 43 padding: 10px 0;
44 padding-right: 20px; 44 padding-right: 20px;
45 position: relative; 45 position: relative;