Authored by 毕凯

Merge branch 'feature/goodsList' into 'release/5.8'

union_type参数



See merge request !661
... ... @@ -19,7 +19,8 @@ exports.list = (req, res, next) => {
let params = {
uid: req.user.uid,
page: 1,
isApp: req.yoho.isApp
isApp: req.yoho.isApp,
unionType: req.query.union_type
};
req.ctx(materialModel).canLogin(params).then(result => {
... ... @@ -36,7 +37,8 @@ exports.list = (req, res, next) => {
exports.moreGoods = (req, res, next) => {
let params = {
page: req.query.page || 2,
isApp: req.yoho.isApp
isApp: req.yoho.isApp,
unionType: req.query.union_type
};
req.ctx(materialModel).list(params).then(result => {
... ...
... ... @@ -41,6 +41,9 @@ class materialModel extends global.yoho.BaseModel {
if (imgUrl.split('?')[0]) {
imgUrl = imgUrl.split('?')[0] + '?imageView2/0/w/323/h/431';
}
if (params.unionType) {
url = `//m.yohobuy.com/product/${val.productSkn}.html?union_type=${params.unionType}`;
}
if (params.isApp) {
url = `http:${url}?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${val.productSkn}"}}`; // eslint-disable-line
}
... ...
... ... @@ -35,7 +35,10 @@ class MaterialController extends Controller {
moreGood(page) {
this.loading = true;
$('.material-c').append('<p class="show-more good-more">加载更多...</p>');
getMore('//m.yohobuy.com/3party/material/moreGoods', {page: page}).then(data => {
getMore('//m.yohobuy.com/3party/material/moreGoods', {
page: page,
union_type: window.queryString.union_type
}).then(data => {
if (data.goods.length > 0) {
$('.goods-list').append(goodContent(data));
... ...