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.

106 lines
2.3 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
const dateUtil = require("../../../utils/dateUtil");
2 years ago
Page({
/**
* 页面的初始数据
*/
data: {
2 years ago
recordList:[],
2 years ago
inputVal:'',
2 years ago
jobListSearchForm:{
pageNum: 1,
pageSize: 50,
}
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",
2 years ago
data:that.data.jobListSearchForm,
2 years ago
header: app.globalData.headers,
success: function (res) {
console.log(res);
2 years ago
res.data.data.forEach((item,index) => {
2 years ago
item['citys'] = commonUtil.setJobInfoPosition(item.storeDistrict);
2 years ago
// item['genderRestrict'] = commonUtil.getGenderByMinAge(item.customJob.customJob);
2 years ago
if (app.isNotEmptyCheck(item.minAge) && app.isNotEmptyCheck(item.maxAge)) {
item["age"] = item.minAge + "-" + item.maxAge + "岁";
} else if (app.isNotEmptyCheck(item.minAge)) {
item["age"] = item.minAge + "岁以上";
} else if (app.isNotEmptyCheck(item.maxAge)) {
item["age"] = item.maxAge + "岁以下";
2 years ago
}
2 years ago
item["createTime"] = dateUtil.formatDateYMDHM(item.createTime)
2 years ago
})
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
}
})