Authored by 郝肖肖

'微信返回下载注册事件'

... ... @@ -21,6 +21,12 @@ const miniapp = (req, res) => {
}).pipe(res); // eslint-disable-line
};
// 微信返回下载页
const download = (req, res) => {
return res.redirect(301, `//union.yoho.cn/union/app-downloads.html?union_type=100000000010599`);
};
module.exports = {
miniapp
miniapp,
download
};
... ...
... ... @@ -25,5 +25,6 @@ router.post('/rn/v1', rn.v1);
router.get('/.well-known/apple-app-site-association', apple.appSiteAssociation);
router.get('/api/wechat/miniapp.jpg', forward.miniapp);
router.get('/api/wechat/download', forward.download);
module.exports = router;
... ...
... ... @@ -436,6 +436,32 @@ function givePoint(parameter) {
}, true);
}
function pushHistory() {
var pages = ['yh_download', 'yh_forward'];
var state = {
title: '下载页面',
page: pages[0],
url: '//m.yohobuy.com/api/wechat/download'
};
var url = location.href;
window.addEventListener('popstate', function(e) {
var temp = e.state;
if (temp && pages.indexOf(temp.page) > -1) {
location.reload();
}
});
if (!window.history.pushState || window.history.length > 1) {
return false;
}
window.history.replaceState(state, null, state.url);
window.history.pushState({page: pages[1]}, null, url);
}
pushHistory();
/**
* 页面头颜色修正
... ...