Authored by zzzzzzz

下载页

  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,27 @@ var qrCheck = { @@ -10,19 +10,27 @@ 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 17
  18 + if (qr && this.getQuery('app_version')) {
  19 + location.href = '//m.yohobuy.com/passport/update';
  20 + }
  21 +
18 if (qr) { 22 if (qr) {
19 if (isiOS) { 23 if (isiOS) {
20 window.location = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr; 24 window.location = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
21 } else { 25 } 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); 26 + // 安卓跳下载
  27 + location.href = '//m.yohobuy.com/passport/update';
  28 +
  29 + // 安卓暂时不处理
  30 + // ifr = document.createElement('iframe');
  31 + // ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
  32 + // ifr.style.display = 'none';
  33 + // document.body.appendChild(ifr);
26 } 34 }
27 35
28 // time = Date.now(); 36 // 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 +
  5 + button {
  6 + position: absolute;
  7 + left: 50%;
  8 + bottom: 220px;
  9 + height: 90px;
  10 + width: 470px;
  11 + margin-left: -235px;
  12 + padding: 0;
  13 + background: #444;
  14 + color: #fff;
  15 + font-size: 30px;
  16 + border-radius: 10px;
  17 + }
  18 +}
@@ -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";