使用新的 index 页面

wechat_user_type
Ge Hao 8 years ago
commit 2f945c12ad
  1. 6
      pages/index/index.js
  2. 6
      pages/index/index.wxml
  3. 1
      pages/index/index.wxss

@ -44,9 +44,9 @@ Page({
var data = app.store.sync(result.data)
that.setData({
items: data,
popularity_products: data.filter(product => product.flag === '最热'),
new_products: data.filter(product => product.flag === '新品'),
hot_products: data.filter(product => product.flag === '火爆'),
popularity_products: data.filter(product => (product.flag === '最热' && product['promotion-url'])),
new_products: data.filter(product => (product.flag === '新品' && product['promotion-url'])),
hot_products: data.filter(product => (product.flag === '火爆' && product['promotion-url'])),
})
wx.setStorageSync('products', data)
})

@ -27,7 +27,7 @@
</view>
<block wx:for="{{popularity_products}}" wx:for-item="item" wx:key="id">
<view class="item" bindtap="bindShowProduct" data-id="{{item.id}}">
<image class="head-img" src="{{item['image-url']}}" mode="aspectFill"></image>
<image class="head-img" src="{{item['promotion-url']}}" mode="aspectFit"></image>
</view>
</block>
</view>
@ -40,7 +40,7 @@
</view>
<block wx:for="{{new_products}}" wx:for-item="item" wx:key="id">
<view class="item" bindtap="bindShowProduct" data-id="{{item.id}}">
<image class="head-img" src="{{item['image-url']}}" mode="aspectFill"></image>
<image class="head-img" src="{{item['promotion-url']}}" mode="aspectFit"></image>
</view>
</block>
</view>
@ -53,7 +53,7 @@
</view>
<block wx:for="{{hot_products}}" wx:for-item="item" wx:key="id">
<view class="item" bindtap="bindShowProduct" data-id="{{item.id}}">
<image class="head-img" src="{{item['image-url']}}" mode="aspectFill"></image>
<image class="head-img" src="{{item['promotion-url']}}" mode="aspectFit"></image>
</view>
</block>
</view>

@ -53,6 +53,7 @@
image.head-img {
width: 100%;
height: 335rpx;
}
text {

Loading…
Cancel
Save