Files
kelfy-mini/pages/department/department.js
2025-11-13 13:39:24 +08:00

94 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// pages/department/department.js
Page({
/**
* 页面的初始数据
*/
data: {
curNav:1,
curIndex:0,
scrollTop:0,
},
changeTab:function(e){
let id = e.target.dataset.id,
index = parseInt(e.target.dataset.index);
// 把点击到的某一项设为当前index
this.setData({
curNav: id,
curIndex: index,
})
},
toDetail:function(e){
console.log(e)
const id = e.target.id;
const title = e.target.dataset.title;
wx.navigateTo({
url: '../register/register?id='+id+'&title='+title,
success: function(res) {
console.log(111)
},
fail:function(res){
console.log(res)
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})