Authored by lijing

app跳转

... ... @@ -19,7 +19,7 @@ exports.index = (req, res, next) => {
let params = {
page: 1,
limit: 10,
isApp: req.query.app_version || req.query.appVersion ? true : false,
isApp: req.yoho.isApp
};
if (req.user.uid || req.query.uid) {
... ... @@ -43,7 +43,7 @@ exports.moreGoods = (req, res, next) => {
let params = {
page: req.query.page || 1,
limit: 10,
isApp: req.query.isApp
isApp: req.yoho.isApp
};
if (req.user.uid || req.query.uid) {
... ...
... ... @@ -123,7 +123,7 @@ module.exports = class extends global.yoho.BaseModel {
let discount = this.getDiscound(val.sales_price, val.market_price);
let url = `//m.yohobuy.com/product/${val.product_skn}.html`;
if (params.isApp === 'true') {
if (params.isApp) {
url += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${val.product_skn}"}}`; // eslint-disable-line
}
... ...
... ... @@ -50,7 +50,7 @@ module.exports = () => {
// 判断请求是否来自app
yoho.isApp = (req.query.app_version && req.query.app_version !== 'false') ||
(req.query.appVersion && req.query.appVersion !== 'false') ||
req.cookies.app_version;
req.cookies.app_version || /YohoBuy/i.test(req.get('User-Agent') || '');
yoho.isWechat = /micromessenger/i.test(req.get('User-Agent') || '');
yoho.isWeibo = ua.indexOf('weibo') !== -1;
yoho.isqq = /MQQBrowser/i.test(req.get('User-Agent') || '');
... ...
... ... @@ -36,9 +36,8 @@ class ActController extends Controller {
moreGood(page) {
this.loading = true;
this.isApp = window.queryString.app_version || window.queryString.appVersion ? true : false;
$('.gdt-c').append('<p class="show-more">加载更多...</p>');
getMore('//m.yohobuy.com/activity/user-recommend/moreGoods', {page: page, isApp: this.isApp}).then(data => {
getMore('//m.yohobuy.com/activity/user-recommend/moreGoods', {page: page}).then(data => {
if (data.goodList.length > 0) {
$('.goods').append(goodContent(data));
... ...