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