parent
bc540e3233
commit
f606f907be
7 changed files with 5 additions and 57 deletions
@ -1,52 +0,0 @@ |
|||||||
const product = require('../../utils/product.js') |
|
||||||
Page({ |
|
||||||
data: { |
|
||||||
items: [], |
|
||||||
slides: [], |
|
||||||
navs: [{icon: "../../images/asset.png", name: "资产"}, |
|
||||||
{icon: "../../images/direct_sale.png", name: "直销"}, |
|
||||||
{icon: "../../images/our_select.png", name: "甄选"}, |
|
||||||
{icon: "../../images/packing.png", name: "包装"}], |
|
||||||
|
|
||||||
popularity_products: [], |
|
||||||
new_products: [], |
|
||||||
hot_products: [], |
|
||||||
promotions: [] |
|
||||||
}, |
|
||||||
|
|
||||||
bindShowProduct: function (e) { |
|
||||||
wx.navigateTo({ |
|
||||||
url: `../show_product/show_product?id=${e.currentTarget.dataset.id}` |
|
||||||
}) |
|
||||||
}, |
|
||||||
|
|
||||||
catchTapCategory: function (e) { |
|
||||||
wx.navigateTo({ |
|
||||||
url: `../category/category?type=${e.currentTarget.dataset.type}` |
|
||||||
}) |
|
||||||
}, |
|
||||||
|
|
||||||
onLoad: function() { |
|
||||||
var that = this |
|
||||||
|
|
||||||
product.getSlides(function(result) { |
|
||||||
var data = getApp().store.sync(result.data) |
|
||||||
that.setData({'slides': data}) |
|
||||||
wx.setStorage({ |
|
||||||
key:"indexSlides", |
|
||||||
data:data |
|
||||||
}) |
|
||||||
}) |
|
||||||
|
|
||||||
product.getProducts(function(result) { |
|
||||||
var data = getApp().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 === '火爆'), |
|
||||||
}) |
|
||||||
wx.setStorageSync('products', data) |
|
||||||
}) |
|
||||||
} |
|
||||||
}) |
|
@ -1,3 +0,0 @@ |
|||||||
<view> |
|
||||||
<view>my_assets</view> |
|
||||||
</view> |
|
@ -0,0 +1,3 @@ |
|||||||
|
<view> |
||||||
|
<view>show</view> |
||||||
|
</view> |
Loading…
Reference in new issue