Authored by shuaiguo

Merge branch 'hotfix/change-xianyu-login' into 'master'

修改闲鱼登录链接,修改sdk版本



See merge request !17
... ... @@ -134,7 +134,7 @@ module.exports = {
notifyUrl: domains.service + 'payment/weixin_notify',
},
geetestJs: '//static.geetest.com/static/tools/gt.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.23/jssdk.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.24/jssdk.js',
redis: {
connect: {
host: '192.168.102.49',
... ...
... ... @@ -45,6 +45,24 @@
{{/ifand}}
</script>
<script>
// 闲鱼api
(function(w, d, s, j) {
if (/AliApp/i.test(navigator.userAgent)) {
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
a.src = j;
m.parentNode.insertBefore(a, m);
}
})(
window,
document,
'script',
(document.location.protocol === 'https:' ? 'https:' : 'http:') +
'//g.alicdn.com/mtb/lib-windvane/3.0.6/windvane.js',
);
</script>
{{!-- Android机器页面不再受到用户字体缩放强制改变大小 'http://m.blog.csdn.net/article/details?id=51275080' --}}
<script type="text/javascript">
... ...
{
"name": "yohobuywap-node-activity",
"version": "6.9.13-beta-11",
"version": "6.9.15-1",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -1198,6 +1198,12 @@ function miniProgramHandleInit() {
}
}
function xianyuAppHandleInit() {
if (/AliApp/i.test(navigator.userAgent)) {
require('./xianyu');
}
}
function formatTime(time) {
let date = new Date(time);
... ... @@ -1470,6 +1476,8 @@ $(function() {
miniProgramHandleInit();
}
xianyuAppHandleInit();
// 分享领券
initWebShare();
... ...
import $ from 'yoho-jquery';
function XianyuLinkHandle() {
const cookie = require('yoho-cookie');
cookie.set('aaa', '123');
$(document).delegate('a:not(.yoho-coin, .yoho-conpon, .web-share-button, .button-ok)',
'click',
event => {
let currentTarget = $(event.currentTarget);
let href = currentTarget.attr('href').replace('https', 'http');
let tag = href.indexOf('?') >= 0 ? '&' : '?';
href = href + tag + 'isNeedRefresh=false';
if (href.indexOf('#') !== 0) {
let args = {url: href};
if (window.WindVane) {
window.WindVane.call('Base', 'openWindow', args, () => {
console.log('open new window success');
}, () => {
window.open(args.url, '_blank');
});
} else {
window.open(args.url, '_blank');
}
}
event.preventDefault();
});
}
export default new XianyuLinkHandle();
... ...
... ... @@ -49,8 +49,13 @@ $(document).ajaxError((event, xhr) => {
if (yoho.isApp) {
yoho.goLogin(window.location.href);
} else {
if (/AliApp/i.test(navigator.userAgent)) {
window.location.href = '//xianyu.yohobuy.com/xianyu/passport/login/taobao';
} else {
window.location.href = `/signin.html?refer=${encodeURIComponent(window.location.href)}`;
}
}
}
} else if (xhr.status === 510) {
if (xhr.responseJSON.data && xhr.responseJSON.data.refer) {
... ...