Files
xuan_wechat/pages/classify/index.js
2023-08-15 17:18:15 +08:00

53 lines
917 B
JavaScript

/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
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
})
}
})