Authored by ccbikai(👎🏻🍜)

Merge remote-tracking branch 'origin/hotfix/qrlogin'

  1 +'use strict';
  2 +
  3 +exports.index = (req, res) => {
  4 + res.render('app-update', {
  5 + width750: true,
  6 + });
  7 +};
@@ -13,6 +13,7 @@ const back = require(cRoot + '/back'); @@ -13,6 +13,7 @@ const back = require(cRoot + '/back');
13 const bind = require(cRoot + '/bind'); 13 const bind = require(cRoot + '/bind');
14 const reg = require(cRoot + '/reg'); 14 const reg = require(cRoot + '/reg');
15 const smsLogin = require(cRoot + '/sms'); 15 const smsLogin = require(cRoot + '/sms');
  16 +const update = require(cRoot + '/update');
16 17
17 18
18 const router = express.Router(); // eslint-disable-line 19 const router = express.Router(); // eslint-disable-line
@@ -107,4 +108,9 @@ router.get('/passport/back/backcode', back.setNewPasswordByMobilePage);// 设置 @@ -107,4 +108,9 @@ router.get('/passport/back/backcode', back.setNewPasswordByMobilePage);// 设置
107 router.post('/passport/back/passwordbyemail', back.setNewPasswordByEmailAPI);// 依据邮箱验证码修改密码 108 router.post('/passport/back/passwordbyemail', back.setNewPasswordByEmailAPI);// 依据邮箱验证码修改密码
108 router.post('/passport/back/passwordbymobile', back.setNewPasswordByMobileAPI);// 依据手机验证码修改密码 109 router.post('/passport/back/passwordbymobile', back.setNewPasswordByMobileAPI);// 依据手机验证码修改密码
109 110
  111 +/**
  112 + * 提示升级app
  113 + */
  114 +router.get('/passport/update', update.index);
  115 +
110 module.exports = router; 116 module.exports = router;
  1 +<section class='app_update'>
  2 + <button>立即升级</button>
  3 +</section>
@@ -10,19 +10,28 @@ var qrCheck = { @@ -10,19 +10,28 @@ var qrCheck = {
10 }, 10 },
11 11
12 init: function() { 12 init: function() {
13 - var ifr, 13 + var // ifr,
14 u = navigator.userAgent.toLowerCase(), 14 u = navigator.userAgent.toLowerCase(),
15 isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1, 15 isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1,
16 - qr = this.getQuery('qr'); 16 + qr = this.getQuery('qr'),
  17 + isApp = this.getQuery('app_version');
17 18
18 - if (qr) { 19 + if (qr && isApp) {
  20 + location.href = '//m.yohobuy.com/passport/update';
  21 + }
  22 +
  23 + if (qr && !isApp) {
19 if (isiOS) { 24 if (isiOS) {
20 window.location = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr; 25 window.location = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
21 } else { 26 } else {
22 - ifr = document.createElement('iframe');  
23 - ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;  
24 - ifr.style.display = 'none';  
25 - document.body.appendChild(ifr); 27 + // 安卓跳下载
  28 + location.href = '//m.yohobuy.com/passport/update';
  29 +
  30 + // 安卓暂时不处理
  31 + // ifr = document.createElement('iframe');
  32 + // ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
  33 + // ifr.style.display = 'none';
  34 + // document.body.appendChild(ifr);
26 } 35 }
27 36
28 // time = Date.now(); 37 // time = Date.now();
  1 +var $ = require('yoho-jquery');
  2 +
  3 +// $('body').height($(window).height());
  4 +// $('.app_update').height($(window).height()).width($(window).width());
  5 +
  6 +$('button').on('click', function() {
  7 + window.location = 'http://www.yohoshow.com/about/index/yohobuyqr';
  8 +});
  1 +.app_update {
  2 + background: resolve("./app-update.png");
  3 + background-size: 100% 100%;
  4 + width: 100%;
  5 + height: height("./app-update.png");
  6 +
  7 + button {
  8 + position: absolute;
  9 + left: 50%;
  10 + bottom: 220px;
  11 + height: 90px;
  12 + width: 470px;
  13 + margin-left: -235px;
  14 + padding: 0;
  15 + background: #444;
  16 + color: #fff;
  17 + font-size: 30px;
  18 + border-radius: 10px;
  19 + }
  20 +}
@@ -6,3 +6,4 @@ @@ -6,3 +6,4 @@
6 @import "code"; 6 @import "code";
7 @import "bind"; 7 @import "bind";
8 @import "success"; 8 @import "success";
  9 +@import "app-update";