|
|
|
|
@ -3,6 +3,7 @@ const app = getApp();
|
|
|
|
|
const commonUtil = require("../../utils/commonUtil.js");
|
|
|
|
|
Page({
|
|
|
|
|
data: {
|
|
|
|
|
recordShow: false,
|
|
|
|
|
toped: "1",
|
|
|
|
|
recordList: [],
|
|
|
|
|
storeJobListSearchForm: {
|
|
|
|
|
@ -19,7 +20,7 @@ Page({
|
|
|
|
|
cityName: "",
|
|
|
|
|
brandIds: "",
|
|
|
|
|
jobCategoryLabelIds: "",
|
|
|
|
|
ucj: 1,
|
|
|
|
|
ujc: 1,
|
|
|
|
|
},
|
|
|
|
|
loading: true,
|
|
|
|
|
hasMoreData: false, //下拉是否还有更多数据
|
|
|
|
|
@ -45,8 +46,10 @@ Page({
|
|
|
|
|
onShow(){
|
|
|
|
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
|
|
|
|
// that.getJobList();
|
|
|
|
|
that.setData({
|
|
|
|
|
recordList: [],
|
|
|
|
|
});
|
|
|
|
|
that.getJobList();
|
|
|
|
|
},
|
|
|
|
|
goDetail(e){
|
|
|
|
|
console.log(e);
|
|
|
|
|
@ -60,33 +63,16 @@ Page({
|
|
|
|
|
getJobList() {
|
|
|
|
|
var that = this;
|
|
|
|
|
// debugger
|
|
|
|
|
// that.setData({
|
|
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
that.setData({
|
|
|
|
|
pageShow: false,
|
|
|
|
|
recordList: []
|
|
|
|
|
});
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
if (that.data.storeJobListSearchForm.sortTag == 2) {
|
|
|
|
|
//如果按照距离排序,拼接上坐标
|
|
|
|
|
that.data.storeJobListSearchForm.lng = app.globalData.lng;
|
|
|
|
|
that.data.storeJobListSearchForm.lat = app.globalData.lat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(that.data.inputVal);
|
|
|
|
|
that.data.storeJobListSearchForm.cityName = that.data.searchCityParamStorage.name;
|
|
|
|
|
if (app.isEmptyCheck(that.data.searchCityParamStorage.name)) {
|
|
|
|
|
that.data.storeJobListSearchForm.cityName = "全国";
|
|
|
|
|
}
|
|
|
|
|
that.data.storeJobListSearchForm.keys = that.data.inputVal == "搜索工作" ? "" : that.data.inputVal;
|
|
|
|
|
// debugger;
|
|
|
|
|
wx.showLoading({
|
|
|
|
|
title: "加载中...",
|
|
|
|
|
});
|
|
|
|
|
console.log(that.data.storeJobListSearchForm);
|
|
|
|
|
wx.request({
|
|
|
|
|
url: app.globalData.ip + "/overall/store/job/list",
|
|
|
|
|
url: app.globalData.ip + "/yishoudan/custom/job/listApp",
|
|
|
|
|
method: "POST",
|
|
|
|
|
header: app.globalData.headers,
|
|
|
|
|
data: that.data.storeJobListSearchForm,
|
|
|
|
|
@ -95,8 +81,8 @@ Page({
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
totalPage: res.data.data.pageCount,
|
|
|
|
|
currPage: res.data.data.currentPage,
|
|
|
|
|
totalPage: res.data.data.pageBean.pageCount,
|
|
|
|
|
currPage: res.data.data.pageBean.currentPage,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
@ -104,8 +90,8 @@ Page({
|
|
|
|
|
triggered: false,
|
|
|
|
|
});
|
|
|
|
|
}, 1000);
|
|
|
|
|
if (res.data.data.recordList == null || res.data.data.recordList.length == 0 || res.data.data.recordList.length < that.data.storeJobListSearchForm.pageSize) {
|
|
|
|
|
var jobListTemp = commonUtil.disposeJobListData(res.data.data.recordList);
|
|
|
|
|
if (res.data.data.pageBean.recordList == null || res.data.data.pageBean.recordList.length == 0 || res.data.data.pageBean.recordList.length < that.data.storeJobListSearchForm.pageSize) {
|
|
|
|
|
var jobListTemp = commonUtil.disposeJobListData(res.data.data.pageBean.recordList);
|
|
|
|
|
that.data.recordList = that.data.recordList.concat(jobListTemp);
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
@ -114,7 +100,7 @@ Page({
|
|
|
|
|
isTrigger: false,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
var jobListTemp = commonUtil.disposeJobListData(res.data.data.recordList);
|
|
|
|
|
var jobListTemp = commonUtil.disposeJobListData(res.data.data.pageBean.recordList);
|
|
|
|
|
that.data.recordList = that.data.recordList.concat(jobListTemp);
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
@ -125,7 +111,7 @@ Page({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wx.hideLoading({
|
|
|
|
|
success: (res) => {},
|
|
|
|
|
success: (res) => { },
|
|
|
|
|
});
|
|
|
|
|
that.setData({
|
|
|
|
|
loading: false,
|
|
|
|
|
@ -133,8 +119,11 @@ Page({
|
|
|
|
|
storeJobListSearchForm: that.data.storeJobListSearchForm,
|
|
|
|
|
});
|
|
|
|
|
resolve();
|
|
|
|
|
// that.getTag();
|
|
|
|
|
|
|
|
|
|
that.data.recordList.forEach((item, index) => {
|
|
|
|
|
console.log(item.storeDistrict);
|
|
|
|
|
item['citys'] = commonUtil.setJobInfoPosition(item.storeDistrict)
|
|
|
|
|
// console.log(item);
|
|
|
|
|
if (app.isNotEmptyCheck(item.returnFeeType) || item.returnFeeType == "0" || item.returnFee == "0") {
|
|
|
|
|
item["fuWuFei"] = commonUtil.getReturnFeeTypeName1ById(item.returnFeeType, item.returnFee);
|
|
|
|
|
@ -147,7 +136,8 @@ Page({
|
|
|
|
|
recordList: that.data.recordList,
|
|
|
|
|
currentJobDrawer: that.data.currentJobDrawer,
|
|
|
|
|
});
|
|
|
|
|
// if (that.data.recordList.length < res.data.data.recordCount) {
|
|
|
|
|
console.log(that.data.recordList)
|
|
|
|
|
// if (that.data.recordList.length < res.data.data.pageBean.recordCount) {
|
|
|
|
|
// that.setData({
|
|
|
|
|
// hasMoreData: true,
|
|
|
|
|
// });
|
|
|
|
|
@ -163,22 +153,13 @@ Page({
|
|
|
|
|
collectPaste(e) {
|
|
|
|
|
var txt;
|
|
|
|
|
var that = this;
|
|
|
|
|
if (!this.data.isLogin) {
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: "/pages/login/index",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
|
var storeJobId = e.currentTarget.dataset.jobid;
|
|
|
|
|
that.doCollected(collected, storeJobId);
|
|
|
|
|
},
|
|
|
|
|
doCollected(collected, storeJobId) {
|
|
|
|
|
var that = this;
|
|
|
|
|
var url = "/user/collect/job/add";
|
|
|
|
|
if (collected - 1 == 0) {
|
|
|
|
|
url = "/user/collect/job/remove";
|
|
|
|
|
}
|
|
|
|
|
var url = "/yishoudan/custom/job/collect/" + storeJobId;
|
|
|
|
|
console.log(app.globalData.headers);
|
|
|
|
|
//发起网络请求
|
|
|
|
|
wx.request({
|
|
|
|
|
@ -199,16 +180,10 @@ Page({
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
txt = "取消收藏";
|
|
|
|
|
that.data.currentJobDrawer.collected = 2;
|
|
|
|
|
|
|
|
|
|
if (that.data.choiceCollect == 1) {
|
|
|
|
|
if (that.data.drawerShow) {
|
|
|
|
|
that.data.drawerShow = false;
|
|
|
|
|
}
|
|
|
|
|
that.data.storeJobListSearchForm.pageNum = 1;
|
|
|
|
|
that.setData({
|
|
|
|
|
recordList: [],
|
|
|
|
|
drawerShow: that.data.drawerShow,
|
|
|
|
|
storeJobListSearchForm: that.data.storeJobListSearchForm,
|
|
|
|
|
});
|
|
|
|
|
that.getJobList();
|
|
|
|
|
@ -221,17 +196,10 @@ Page({
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
that.data.currentJobDrawer.collected = 1;
|
|
|
|
|
|
|
|
|
|
txt = "收藏成功";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(that.data.currentJobDrawer);
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
recordList: that.data.recordList,
|
|
|
|
|
currentJobDrawer: that.data.currentJobDrawer,
|
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
|
});
|
|
|
|
|
wx.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
@ -243,4 +211,58 @@ Page({
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
hidedrawershow (e) {
|
|
|
|
|
console.log(e);
|
|
|
|
|
this.setData({
|
|
|
|
|
[e.detail.type]: false
|
|
|
|
|
})
|
|
|
|
|
wx.showTabBar({
|
|
|
|
|
animation: false,
|
|
|
|
|
success: (result) => {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
fail: () => { },
|
|
|
|
|
complete: () => { }
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
recordBill (e) {
|
|
|
|
|
console.log(e.currentTarget.dataset.job);
|
|
|
|
|
this.setData({
|
|
|
|
|
recordShow: true,
|
|
|
|
|
currentInfo: e.currentTarget.dataset.job,
|
|
|
|
|
})
|
|
|
|
|
console.log(this.data.recordShow);
|
|
|
|
|
wx.hideTabBar({
|
|
|
|
|
animation: false,
|
|
|
|
|
success: (result) => {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
fail: () => { },
|
|
|
|
|
complete: () => { }
|
|
|
|
|
});
|
|
|
|
|
return
|
|
|
|
|
if (!this.data.isLogin) {
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: "/pages/login/index",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
console.log(e.currentTarget.dataset.job);
|
|
|
|
|
console.log(123);
|
|
|
|
|
let middleInfo = e.currentTarget.dataset.job;
|
|
|
|
|
let info = JSON.stringify({
|
|
|
|
|
id: middleInfo.id,
|
|
|
|
|
jobName: middleInfo.jobName,
|
|
|
|
|
storeName: middleInfo.storeName,
|
|
|
|
|
aliasName: middleInfo.aliasName,
|
|
|
|
|
storeId: middleInfo.storeId,
|
|
|
|
|
});
|
|
|
|
|
console.log(info);
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: `../newEnroll/enroll/index?applyType=1&info=${info}`,
|
|
|
|
|
});
|
|
|
|
|
// wx.navigateTo({
|
|
|
|
|
// url: `../newEnroll/enroll/index?applyType=1&info=${info}`,
|
|
|
|
|
// });
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|