You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.1 KiB
JavaScript

2 years ago
// pages/mine/myJob/index.js
2 years ago
const app = getApp();
2 years ago
const commonUtil = require("../../../utils/commonUtil");
2 years ago
Page({
/**
* 页面的初始数据
*/
data: {
2 years ago
recordList:[],
2 years ago
inputVal:'',
2 years ago
},
/**
* 生命周期函数--监听页面加载
*/
2 years ago
onLoad(options) {
2 years ago
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
2 years ago
onReady() {
2 years ago
},
/**
* 生命周期函数--监听页面显示
*/
2 years ago
onShow() {
2 years ago
this.getList();
},
getList(){
var that = this;
wx.request({
url: app.globalData.ip + "/yishoudan/common/order/list",
method: "Post",
header: app.globalData.headers,
success: function (res) {
console.log(res);
2 years ago
res.data.data.forEach((item,index) => {
item['citys'] = commonUtil.setJobInfoPosition(item.customJob.storeDistrict);
// item['genderRestrict'] = commonUtil.getGenderByMinAge(item.customJob.customJob);
if (app.isNotEmptyCheck(item.customJob.minAge) && app.isNotEmptyCheck(item.customJob.maxAge)) {
item["age"] = item.customJob.minAge + "-" + item.customJob.maxAge + "岁";
} else if (app.isNotEmptyCheck(item.customJob.minAge)) {
item["age"] = item.customJob.minAge + "岁以上";
} else if (app.isNotEmptyCheck(item.customJob.maxAge)) {
item["age"] = item.customJob.maxAge + "岁以下";
}
})
2 years ago
that.setData({
recordList:res.data.data
})
}
})
2 years ago
},
2 years ago
goDetail (e) {
console.log(e.currentTarget.dataset.id);
var that = this;
wx.navigateTo({
url: "../../detail/index?storeJobId=" + e.currentTarget.dataset.id,
});
},
2 years ago
/**
* 生命周期函数--监听页面隐藏
*/
2 years ago
onHide() {
2 years ago
},
/**
* 生命周期函数--监听页面卸载
*/
2 years ago
onUnload() {
2 years ago
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
2 years ago
onPullDownRefresh() {
2 years ago
},
/**
* 页面上拉触底事件的处理函数
*/
2 years ago
onReachBottom() {
2 years ago
},
/**
* 用户点击右上角分享
*/
2 years ago
onShareAppMessage() {
2 years ago
}
})