You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
1.8 KiB
98 lines
1.8 KiB
3 years ago
|
// pages/user/profession/index.js
|
||
|
const app = getApp()
|
||
|
Page({
|
||
|
|
||
|
/**
|
||
|
* 页面的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
activeName: '1',
|
||
|
professionList:[]
|
||
|
},
|
||
|
onChange(event) {
|
||
|
this.setData({
|
||
|
activeName: event.detail
|
||
|
});
|
||
|
},
|
||
|
getProfessionList(){
|
||
|
app.http('post','api/industry/listIndustry').then((res)=>{
|
||
|
console.log(res)
|
||
|
if(res.data.success){
|
||
|
this.setData({
|
||
|
professionList: res.data.data
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
sonItemClick(e){
|
||
|
console.log(e)
|
||
|
let name = e.currentTarget.dataset.name;
|
||
|
let pages = getCurrentPages();
|
||
|
//获取当前页面js里面的pages里的所有信息。
|
||
|
let prevPage = pages[ pages.length - 2 ];
|
||
|
//prevPage 是获取上一个页面的js里面的pages的所有信息。 -2 是上一个页面,-3是上上个页面以此类推。
|
||
|
|
||
|
//也可以直接给页面上的参数赋值
|
||
|
prevPage.setData({
|
||
|
['form.profession']: name
|
||
|
})
|
||
|
wx.navigateBack({
|
||
|
delta: 1,
|
||
|
})
|
||
|
},
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad: function (options) {
|
||
|
this.getProfessionList()
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面初次渲染完成
|
||
|
*/
|
||
|
onReady: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面显示
|
||
|
*/
|
||
|
onShow: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面隐藏
|
||
|
*/
|
||
|
onHide: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 生命周期函数--监听页面卸载
|
||
|
*/
|
||
|
onUnload: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||
|
*/
|
||
|
onPullDownRefresh: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 页面上拉触底事件的处理函数
|
||
|
*/
|
||
|
onReachBottom: function () {
|
||
|
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 用户点击右上角分享
|
||
|
*/
|
||
|
// onShareAppMessage: function () {
|
||
|
|
||
|
// }
|
||
|
})
|