Authored by 李靖

yohonow

... ... @@ -55,6 +55,7 @@ module.exports = () => {
yoho.clientIp = _getClientIp(req);
// 判断请求是否来自app
yoho.isNowApp = /yohonow/i.test(req.get('User-Agent') || '');
yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || '');
yoho.isApp = yoho.isMarsApp ||
req.cookies.app_version ||
... ...
... ... @@ -5,6 +5,7 @@ import $ from 'yoho-jquery';
import Page from 'yoho-page';
import tip from 'plugin/tip';
import cityRender from 'home/chosen-city.hbs';
import yoho from 'yoho-app';
class UserInfo extends Page {
constructor() {
... ... @@ -25,7 +26,8 @@ class UserInfo extends Page {
$cancelBtn: $('.swiper-header .cancel'),
$okBtn: $('.swiper-header .ok'),
$provinceText: $('.province-text'),
$cityText: $('.city-text')
$cityText: $('.city-text'),
$userPic: $('.user-pic')
};
this.view = {
... ... @@ -60,6 +62,17 @@ class UserInfo extends Page {
this.selector.$cancelBtn.on('click', this.cancelFun.bind(this));
this.selector.$okBtn.on('click', this.okFun.bind(this));
this.selector.$chosenCity.on('DOMNodeInserted', this.modifyInp.bind(this));
this.selector.$userPic.on('click', this.userPic.bind(this));
}
userPic() {
if (yoho.isApp) {
yoho.ready(function() {
yoho.invokeMethod('go.setAvatar', {}, (data) => {
alert(data);
});
});
}
}
cancelFun() {
... ...
... ... @@ -37,6 +37,7 @@ yoho = {
/**
* 判断是否是 APP
*/
isNowApp: /yohonow/i.test(navigator.userAgent || ''),
isMarsApp: /YohoMars/i.test(navigator.userAgent || ''),
isApp: /YohoMars/i.test(navigator.userAgent || '') ||
/YohoBuy/i.test(navigator.userAgent || '') ||
... ...
... ... @@ -39,7 +39,7 @@ input::-webkit-calendar-picker-indicator {
.main {
width: 450px;
float: left;
height: 90px;
min-height: 90px;
padding: 10px 0;
padding-right: 20px;
position: relative;
... ...