Authored by 李奇

部分多余商品展示删除

... ... @@ -79,7 +79,6 @@ Page(Object.assign({
]
},
shopRecList: [],
preferList: [],
showMenu: false,
... ... @@ -200,37 +199,6 @@ Page(Object.assign({
showSnapshootShare: false
});
},
shopRecList: function() {
detailModel.shopRecommend({
page: 1,
limit: 20,
shopId: app.getShopId(),
product_skn: this.data.productSkn
}).then(res => {
if (res.code === 200) {
const keyAdapter = {
skn: 'product_skn',
salesPrice: 'sales_price',
marketPrice: 'market_price',
productName: 'product_name',
defaultImages: 'default_images'
};
let list = [];
(res.data.product_list || []).forEach(product => {
let item = {};
Object.keys(keyAdapter).forEach(key => {
item[key] = product[keyAdapter[key]];
});
list.push(item);
});
this.setData({
shopRecList: list
});
}
});
},
preferList: function() {
detailModel.preference({
page: 1,
... ... @@ -357,8 +325,6 @@ Page(Object.assign({
productNotForSale: res.data.attribute === 2,
showBottomTipView: true
});
this.shopRecList(res.data.shop_id);
}
});
},
... ...
... ... @@ -94,16 +94,6 @@
<image class="intro-image" src="{{item}}" mode="widthFix"></image>
</view>
</view>
<block wx:if="{{shopRecList.length}}">
<view class="gap"></view>
<view class='title-container'>
<view class='title-line'></view>
<view class='title-desc'> 店铺推荐商品</view>
</view>
<view class="product-list shop-rec">
<product-list list="{{shopRecList}}"></product-list>
</view>
</block>
<block wx:if="{{preferList.length}}">
<view class="gap"></view>
<view class='title-container'>
... ...
... ... @@ -13,7 +13,6 @@ let yas;
Page({
data: {
productList: [],
userInfo: {},
isLogin: false,
hasUnionID: false,
... ... @@ -52,7 +51,6 @@ Page({
loginSucess: function() {
this.showUserInfo();
this.getInfoNum();
this.chooseForYouList();
},
getInfoNum: function() {
if (app.getUid()) {
... ... @@ -67,37 +65,6 @@ Page({
});
}
},
chooseForYouList: function() {
homeModel.productList({
page: 1,
limit: 20,
shop_id: app.getShopId()
}).then(res => {
if (res.code === 200) {
const keyAdapter = {
skn: 'product_skn',
salesPrice: 'sales_price',
marketPrice: 'market_price',
productName: 'product_name',
defaultImages: 'default_images'
};
let list = [];
(res.data.product_list || []).forEach(product => {
let item = {};
Object.keys(keyAdapter).forEach(key => {
item[key] = product[keyAdapter[key]];
});
list.push(item);
});
this.setData({
productList: list
});
}
});
},
toOrdersTap: function(e) {
if (!this.data.isLogin) {
return wx.showToast({
... ...
... ... @@ -71,14 +71,6 @@
<view class="address-title">服务与反馈</view>
</view>
</view>
<view class="view-splite clearfix"/>
<view class='title-container'>
<view class='title-line'></view>
<view class='title-desc'>为你优选</view>
</view>
<view class="product-list">
<product-list list="{{productList}}"></product-list>
</view>
</view>
</view>
</scroll-view>
... ...