wechat_user_type
Ge Hao 8 years ago
parent 79c965635f
commit 9add74e238
  1. 11
      pages/index/index.js
  2. 7
      pages/index/index.wxml

@ -42,8 +42,6 @@ Page({
product.getProducts(function(result) { product.getProducts(function(result) {
var data = app.store.sync(result.data) var data = app.store.sync(result.data)
if (app.globalData.featureManager.enableNewFlag) {
that.setData({ that.setData({
items: data, items: data,
popularity_products: data.filter(product => (product.flag === '最热' && product['promotion-url'])), popularity_products: data.filter(product => (product.flag === '最热' && product['promotion-url'])),
@ -51,15 +49,6 @@ if (app.globalData.featureManager.enableNewFlag) {
hot_products: data.filter(product => (product.flag === '火爆' && product['promotion-url'])), hot_products: data.filter(product => (product.flag === '火爆' && product['promotion-url'])),
}) })
wx.setStorageSync('products', data) wx.setStorageSync('products', data)
} else {
that.setData({
items: data,
popularity_products: data.filter(product => (product.id === "29")),
new_products: data.filter(product => (product.id === "30")),
hot_products: data.filter(product => (product.id === "32")),
})
wx.setStorageSync('products', data)
}
}) })
// wx.getNetworkType({ // wx.getNetworkType({

@ -20,7 +20,6 @@
<view class="separate"></view> <view class="separate"></view>
<view wx:if="{{hot_products[0]['promotion-url']}}">
<view class="cate-container"> <view class="cate-container">
<view class="category-title"> <view class="category-title">
<view class="icon"><image src="../../images/hot_small.png"></image></view> <view class="icon"><image src="../../images/hot_small.png"></image></view>
@ -32,10 +31,8 @@
</view> </view>
</block> </block>
</view> </view>
</view>
<view class="separate"></view> <view class="separate"></view>
<view wx:if="{{new_products[0]['promotion-url']}}">
<view class="cate-container"> <view class="cate-container">
<view class="category-title"> <view class="category-title">
<view class="icon"><image src="../../images/new_small.png"></image></view> <view class="icon"><image src="../../images/new_small.png"></image></view>
@ -47,10 +44,8 @@
</view> </view>
</block> </block>
</view> </view>
</view>
<view class="separate"></view> <view class="separate"></view>
<view wx:if="{{popularity_products[0]['promotion-url']}}">
<view class="cate-container"> <view class="cate-container">
<view class="category-title"> <view class="category-title">
<view class="icon"><image src="../../images/volume_small.png"></image></view> <view class="icon"><image src="../../images/volume_small.png"></image></view>
@ -62,5 +57,5 @@
</view> </view>
</block> </block>
</view> </view>
</view>
</scroll-view> </scroll-view>

Loading…
Cancel
Save