Browse Source

优化首页和分类商品列表页

master
邓平艺 4 years ago
parent
commit
e71b876bab
  1. 16
      pages/index/index/index.vue
  2. 8
      pages/index/onlineMall/onlineMall.vue

16
pages/index/index/index.vue

@ -153,7 +153,8 @@
ad_modal_list: [], // ad广 ad_modal_list: [], // ad广
nav_bg_color: 'rgba(255,255,255,0)' ,// nav_bg_color: 'rgba(255,255,255,0)' ,//
car_num: 0, car_num: 0,
live_roomid: 0
live_roomid: 0,
page_options: {}
}; };
}, },
// //
@ -243,7 +244,8 @@
this.screenWidth = String(res.screenWidth); this.screenWidth = String(res.screenWidth);
} }
}); });
this.queryMicroData();
this.page_options = e;
this.queryMicroData(e);
this.init(e); this.init(e);
}, },
@ -365,10 +367,16 @@
}); });
}, },
// //
queryMicroData() {
queryMicroData(e) {
let par = {};
if(typeof this.page_options.id != 'undefined'){
par.id = this.page_options.id;
}
this.$http this.$http
.get({ .get({
api: 'api/micro/page/index'
api: 'api/micro/page/index',
data: par
}) })
.then(res => { .then(res => {
if (res.statusCode == 200) { if (res.statusCode == 200) {

8
pages/index/onlineMall/onlineMall.vue

@ -150,7 +150,6 @@
this.getBrandList(); this.getBrandList();
let data_list = res.data.data || []; let data_list = res.data.data || [];
let list = data_list.map(item => { let list = data_list.map(item => {
console.log('当前的图片',item.img)
return { return {
id: item.id, id: item.id,
original_price: item.market_price, original_price: item.market_price,
@ -162,9 +161,10 @@
title: item.name title: item.name
} }
}) })
if(data_list[0] && data_list[0].tags){
this.title = data_list[0].tags[0];
this.filter_tabs[1].name = data_list[0].tags[0];
let categorys = res.data.meta.categorys || {};
if(this.$isRight(categorys)){
this.title = categorys.name;
this.filter_tabs[1].name = categorys.name;
} }
this.list = list; this.list = list;
}) })

Loading…
Cancel
Save