绚火健康
This commit is contained in:
53
pages/classify/index.js
Normal file
53
pages/classify/index.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
parentId : '',
|
||||
categorieArr : [],
|
||||
categorieindex : 0
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 获取商品分类
|
||||
this.categorieInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 商品分类信息
|
||||
*/
|
||||
categorieInfo() {
|
||||
wx.$api.mall.Categorie({
|
||||
parent_id: this.data.parentId
|
||||
}).then(res => {
|
||||
this.setData({
|
||||
categorieArr: res.data
|
||||
})
|
||||
}).catch(err =>{
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
// 一级分类
|
||||
categorieTap(e) {
|
||||
this.setData({
|
||||
categorieindex: e.currentTarget.dataset.index
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user