Merge branch 'hotfix/change-xianyu-login' into 'master'
修改闲鱼登录链接,修改sdk版本 See merge request !17
Showing
6 changed files
with
71 additions
and
3 deletions
@@ -134,7 +134,7 @@ module.exports = { | @@ -134,7 +134,7 @@ module.exports = { | ||
134 | notifyUrl: domains.service + 'payment/weixin_notify', | 134 | notifyUrl: domains.service + 'payment/weixin_notify', |
135 | }, | 135 | }, |
136 | geetestJs: '//static.geetest.com/static/tools/gt.js', | 136 | geetestJs: '//static.geetest.com/static/tools/gt.js', |
137 | - jsSdk: '//cdn.yoho.cn/js-sdk/1.3.23/jssdk.js', | 137 | + jsSdk: '//cdn.yoho.cn/js-sdk/1.3.24/jssdk.js', |
138 | redis: { | 138 | redis: { |
139 | connect: { | 139 | connect: { |
140 | host: '192.168.102.49', | 140 | host: '192.168.102.49', |
@@ -45,6 +45,24 @@ | @@ -45,6 +45,24 @@ | ||
45 | 45 | ||
46 | {{/ifand}} | 46 | {{/ifand}} |
47 | </script> | 47 | </script> |
48 | + <script> | ||
49 | + // 闲鱼api | ||
50 | + (function(w, d, s, j) { | ||
51 | + if (/AliApp/i.test(navigator.userAgent)) { | ||
52 | + var a = d.createElement(s); | ||
53 | + var m = d.getElementsByTagName(s)[0]; | ||
54 | + | ||
55 | + a.src = j; | ||
56 | + m.parentNode.insertBefore(a, m); | ||
57 | + } | ||
58 | + })( | ||
59 | + window, | ||
60 | + document, | ||
61 | + 'script', | ||
62 | + (document.location.protocol === 'https:' ? 'https:' : 'http:') + | ||
63 | + '//g.alicdn.com/mtb/lib-windvane/3.0.6/windvane.js', | ||
64 | + ); | ||
65 | + </script> | ||
48 | 66 | ||
49 | {{!-- Android机器页面不再受到用户字体缩放强制改变大小 'http://m.blog.csdn.net/article/details?id=51275080' --}} | 67 | {{!-- Android机器页面不再受到用户字体缩放强制改变大小 'http://m.blog.csdn.net/article/details?id=51275080' --}} |
50 | <script type="text/javascript"> | 68 | <script type="text/javascript"> |
1 | { | 1 | { |
2 | "name": "yohobuywap-node-activity", | 2 | "name": "yohobuywap-node-activity", |
3 | - "version": "6.9.13-beta-11", | 3 | + "version": "6.9.15-1", |
4 | "private": true, | 4 | "private": true, |
5 | "description": "A New Yohobuy Project With Express", | 5 | "description": "A New Yohobuy Project With Express", |
6 | "repository": { | 6 | "repository": { |
@@ -1198,6 +1198,12 @@ function miniProgramHandleInit() { | @@ -1198,6 +1198,12 @@ function miniProgramHandleInit() { | ||
1198 | } | 1198 | } |
1199 | } | 1199 | } |
1200 | 1200 | ||
1201 | +function xianyuAppHandleInit() { | ||
1202 | + if (/AliApp/i.test(navigator.userAgent)) { | ||
1203 | + require('./xianyu'); | ||
1204 | + } | ||
1205 | +} | ||
1206 | + | ||
1201 | function formatTime(time) { | 1207 | function formatTime(time) { |
1202 | let date = new Date(time); | 1208 | let date = new Date(time); |
1203 | 1209 | ||
@@ -1470,6 +1476,8 @@ $(function() { | @@ -1470,6 +1476,8 @@ $(function() { | ||
1470 | miniProgramHandleInit(); | 1476 | miniProgramHandleInit(); |
1471 | } | 1477 | } |
1472 | 1478 | ||
1479 | + xianyuAppHandleInit(); | ||
1480 | + | ||
1473 | // 分享领券 | 1481 | // 分享领券 |
1474 | initWebShare(); | 1482 | initWebShare(); |
1475 | 1483 |
public/js/activity/xianyu/index.js
0 → 100644
1 | +import $ from 'yoho-jquery'; | ||
2 | + | ||
3 | +function XianyuLinkHandle() { | ||
4 | + const cookie = require('yoho-cookie'); | ||
5 | + | ||
6 | + cookie.set('aaa', '123'); | ||
7 | + | ||
8 | + $(document).delegate('a:not(.yoho-coin, .yoho-conpon, .web-share-button, .button-ok)', | ||
9 | + 'click', | ||
10 | + event => { | ||
11 | + let currentTarget = $(event.currentTarget); | ||
12 | + | ||
13 | + let href = currentTarget.attr('href').replace('https', 'http'); | ||
14 | + | ||
15 | + let tag = href.indexOf('?') >= 0 ? '&' : '?'; | ||
16 | + | ||
17 | + href = href + tag + 'isNeedRefresh=false'; | ||
18 | + | ||
19 | + if (href.indexOf('#') !== 0) { | ||
20 | + let args = {url: href}; | ||
21 | + | ||
22 | + if (window.WindVane) { | ||
23 | + window.WindVane.call('Base', 'openWindow', args, () => { | ||
24 | + console.log('open new window success'); | ||
25 | + }, () => { | ||
26 | + window.open(args.url, '_blank'); | ||
27 | + }); | ||
28 | + } else { | ||
29 | + window.open(args.url, '_blank'); | ||
30 | + } | ||
31 | + } | ||
32 | + | ||
33 | + event.preventDefault(); | ||
34 | + }); | ||
35 | +} | ||
36 | + | ||
37 | +export default new XianyuLinkHandle(); |
@@ -49,7 +49,12 @@ $(document).ajaxError((event, xhr) => { | @@ -49,7 +49,12 @@ $(document).ajaxError((event, xhr) => { | ||
49 | if (yoho.isApp) { | 49 | if (yoho.isApp) { |
50 | yoho.goLogin(window.location.href); | 50 | yoho.goLogin(window.location.href); |
51 | } else { | 51 | } else { |
52 | - window.location.href = `/signin.html?refer=${encodeURIComponent(window.location.href)}`; | 52 | + if (/AliApp/i.test(navigator.userAgent)) { |
53 | + window.location.href = '//xianyu.yohobuy.com/xianyu/passport/login/taobao'; | ||
54 | + } else { | ||
55 | + window.location.href = `/signin.html?refer=${encodeURIComponent(window.location.href)}`; | ||
56 | + } | ||
57 | + | ||
53 | } | 58 | } |
54 | } | 59 | } |
55 | } else if (xhr.status === 510) { | 60 | } else if (xhr.status === 510) { |
-
Please register or login to post a comment