|
|
|
@ -3,6 +3,8 @@ const app = getApp();
|
|
|
|
const commonUtil = require("../../utils/commonUtil.js");
|
|
|
|
const commonUtil = require("../../utils/commonUtil.js");
|
|
|
|
Page({
|
|
|
|
Page({
|
|
|
|
data: {
|
|
|
|
data: {
|
|
|
|
|
|
|
|
currentInfo:{},
|
|
|
|
|
|
|
|
recordShow: false,
|
|
|
|
toped: "1",
|
|
|
|
toped: "1",
|
|
|
|
chaShowed: false,
|
|
|
|
chaShowed: false,
|
|
|
|
isTrigger: false,
|
|
|
|
isTrigger: false,
|
|
|
|
@ -45,7 +47,7 @@ Page({
|
|
|
|
jobSpecialLabelIds: "",
|
|
|
|
jobSpecialLabelIds: "",
|
|
|
|
cityName: "",
|
|
|
|
cityName: "",
|
|
|
|
brandIds: "",
|
|
|
|
brandIds: "",
|
|
|
|
ucj: 0,
|
|
|
|
ujc: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
loading: true,
|
|
|
|
loading: true,
|
|
|
|
topJobList: [],
|
|
|
|
topJobList: [],
|
|
|
|
@ -536,7 +538,7 @@ Page({
|
|
|
|
|
|
|
|
|
|
|
|
// var brandIdArray = that.data.storeJobListSearchForm.brandIds.split(",");
|
|
|
|
// var brandIdArray = that.data.storeJobListSearchForm.brandIds.split(",");
|
|
|
|
|
|
|
|
|
|
|
|
// res.data.data.forEach((item) => {
|
|
|
|
// res.data.data.pageBean.forEach((item) => {
|
|
|
|
// item["checked"] = false;
|
|
|
|
// item["checked"] = false;
|
|
|
|
// brandIdArray.forEach((item1) => {
|
|
|
|
// brandIdArray.forEach((item1) => {
|
|
|
|
// if (item.id == item1) {
|
|
|
|
// if (item.id == item1) {
|
|
|
|
@ -1158,13 +1160,13 @@ Page({
|
|
|
|
var that = this;
|
|
|
|
var that = this;
|
|
|
|
|
|
|
|
|
|
|
|
wx.request({
|
|
|
|
wx.request({
|
|
|
|
url: app.globalData.ip + "/store/job/collected/list?ucj=1",
|
|
|
|
url: app.globalData.ip + "/store/job/collected/list?ujc=1",
|
|
|
|
method: "GET",
|
|
|
|
method: "GET",
|
|
|
|
data: {},
|
|
|
|
data: {},
|
|
|
|
header: app.globalData.headers,
|
|
|
|
header: app.globalData.headers,
|
|
|
|
success: function (res) {
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
let collectList = res.data.data.recordList;
|
|
|
|
let collectList = res.data.data.pageBean.recordList;
|
|
|
|
let jobs = that.data.recordList;
|
|
|
|
let jobs = that.data.recordList;
|
|
|
|
if (collectList != null && collectList != "" && collectList != undefined && collectList.length != 0 && jobs != null && jobs != "" && jobs != undefined && jobs.length != 0) {
|
|
|
|
if (collectList != null && collectList != "" && collectList != undefined && collectList.length != 0 && jobs != null && jobs != "" && jobs != undefined && jobs.length != 0) {
|
|
|
|
for (var j = 0; j != jobs.length; ++j) {
|
|
|
|
for (var j = 0; j != jobs.length; ++j) {
|
|
|
|
@ -1367,7 +1369,7 @@ Page({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
console.log(that.data.storeJobListSearchForm);
|
|
|
|
console.log(that.data.storeJobListSearchForm);
|
|
|
|
wx.request({
|
|
|
|
wx.request({
|
|
|
|
url: app.globalData.ip + "/assistant/custom/job/v2/list",
|
|
|
|
url: app.globalData.ip + "/yishoudan/custom/job/listApp",
|
|
|
|
method: "POST",
|
|
|
|
method: "POST",
|
|
|
|
header: app.globalData.headers,
|
|
|
|
header: app.globalData.headers,
|
|
|
|
data: that.data.storeJobListSearchForm,
|
|
|
|
data: that.data.storeJobListSearchForm,
|
|
|
|
@ -1376,8 +1378,8 @@ Page({
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
that.setData({
|
|
|
|
totalPage: res.data.data.pageCount,
|
|
|
|
totalPage: res.data.data.pageBean.pageCount,
|
|
|
|
currPage: res.data.data.currentPage,
|
|
|
|
currPage: res.data.data.pageBean.currentPage,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
setTimeout(function () {
|
|
|
|
@ -1385,8 +1387,8 @@ Page({
|
|
|
|
triggered: false,
|
|
|
|
triggered: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, 1000);
|
|
|
|
}, 1000);
|
|
|
|
if (res.data.data.recordList == null || res.data.data.recordList.length == 0 || res.data.data.recordList.length < that.data.storeJobListSearchForm.pageSize) {
|
|
|
|
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.recordList);
|
|
|
|
var jobListTemp = commonUtil.disposeJobListData(res.data.data.pageBean.recordList);
|
|
|
|
that.data.recordList = that.data.recordList.concat(jobListTemp);
|
|
|
|
that.data.recordList = that.data.recordList.concat(jobListTemp);
|
|
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
that.setData({
|
|
|
|
@ -1395,7 +1397,7 @@ Page({
|
|
|
|
isTrigger: false,
|
|
|
|
isTrigger: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} 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.data.recordList = that.data.recordList.concat(jobListTemp);
|
|
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
that.setData({
|
|
|
|
@ -1442,7 +1444,7 @@ Page({
|
|
|
|
console.log(that.data.navigatorBarHeight);
|
|
|
|
console.log(that.data.navigatorBarHeight);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, 300);
|
|
|
|
}, 300);
|
|
|
|
// if (that.data.recordList.length < res.data.data.recordCount) {
|
|
|
|
// if (that.data.recordList.length < res.data.data.pageBean.recordCount) {
|
|
|
|
// that.setData({
|
|
|
|
// that.setData({
|
|
|
|
// hasMoreData: true,
|
|
|
|
// hasMoreData: true,
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
@ -1707,8 +1709,8 @@ Page({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
app.globalData.openId = res.data.data.openId;
|
|
|
|
app.globalData.openId = res.data.data.pageBean.openId;
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.pageBean.phoneNumber, null);
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
if (collected) {
|
|
|
|
if (collected) {
|
|
|
|
promise.then((res) => {
|
|
|
|
promise.then((res) => {
|
|
|
|
@ -1760,7 +1762,7 @@ Page({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.pageBean.phoneNumber, null);
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
if (collected) {
|
|
|
|
if (collected) {
|
|
|
|
promise.then((res) => {
|
|
|
|
promise.then((res) => {
|
|
|
|
@ -1773,7 +1775,7 @@ Page({
|
|
|
|
promise.then((res) => {
|
|
|
|
promise.then((res) => {
|
|
|
|
wx.navigateTo({
|
|
|
|
wx.navigateTo({
|
|
|
|
url: "../enroll/index?applyType=1",
|
|
|
|
url: "../enroll/index?applyType=1",
|
|
|
|
//url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber
|
|
|
|
//url: "../enroll/index?applyType=1&tel=" + res.data.data.pageBean.phoneNumber
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1837,7 +1839,7 @@ Page({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.pageBean.phoneNumber, null);
|
|
|
|
promise.then((res) => {
|
|
|
|
promise.then((res) => {
|
|
|
|
that.setData({
|
|
|
|
that.setData({
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
@ -1867,7 +1869,7 @@ Page({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.pageBean.phoneNumber, null);
|
|
|
|
promise.then((res) => {
|
|
|
|
promise.then((res) => {
|
|
|
|
that.setData({
|
|
|
|
that.setData({
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
@ -1936,7 +1938,7 @@ Page({
|
|
|
|
var txt;
|
|
|
|
var txt;
|
|
|
|
var that = this;
|
|
|
|
var that = this;
|
|
|
|
if (!this.data.isLogin) {
|
|
|
|
if (!this.data.isLogin) {
|
|
|
|
wx.redirectTo({
|
|
|
|
wx.navigateTo({
|
|
|
|
url: "/pages/login/index",
|
|
|
|
url: "/pages/login/index",
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@ -1960,17 +1962,18 @@ Page({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
doCollected (collected, storeJobId) {
|
|
|
|
doCollected (collected, storeJobId) {
|
|
|
|
var that = this;
|
|
|
|
var that = this;
|
|
|
|
var url = "/user/collect/job/add";
|
|
|
|
var url = "/yishoudan/custom/job/collect/" + storeJobId;
|
|
|
|
if (collected - 1 == 0) {
|
|
|
|
// if (collected - 1 == 0) {
|
|
|
|
url = "/user/collect/job/remove";
|
|
|
|
// url = "/user/collect/job/remove";
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
console.log(app.globalData.headers);
|
|
|
|
// console.log(app.globalData.headers);
|
|
|
|
//发起网络请求
|
|
|
|
//发起网络请求
|
|
|
|
wx.request({
|
|
|
|
wx.request({
|
|
|
|
url: app.globalData.ip + url,
|
|
|
|
url: app.globalData.ip + url,
|
|
|
|
data: {
|
|
|
|
// data: {
|
|
|
|
storeJobId: storeJobId,
|
|
|
|
// jobId: storeJobId,
|
|
|
|
},
|
|
|
|
// classify:0
|
|
|
|
|
|
|
|
// },
|
|
|
|
header: app.globalData.headers,
|
|
|
|
header: app.globalData.headers,
|
|
|
|
method: "GET",
|
|
|
|
method: "GET",
|
|
|
|
success: function (res) {
|
|
|
|
success: function (res) {
|
|
|
|
@ -1979,25 +1982,11 @@ Page({
|
|
|
|
//取消收藏
|
|
|
|
//取消收藏
|
|
|
|
for (var i = 0; i != that.data.recordList.length; ++i) {
|
|
|
|
for (var i = 0; i != that.data.recordList.length; ++i) {
|
|
|
|
if (that.data.recordList[i].id - storeJobId == 0) {
|
|
|
|
if (that.data.recordList[i].id - storeJobId == 0) {
|
|
|
|
that.data.recordList[i].collected = 2;
|
|
|
|
that.data.recordList[i].collected = 0;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
txt = "取消收藏";
|
|
|
|
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();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//收藏
|
|
|
|
//收藏
|
|
|
|
for (var i = 0; i != that.data.recordList.length; ++i) {
|
|
|
|
for (var i = 0; i != that.data.recordList.length; ++i) {
|
|
|
|
@ -2006,13 +1995,8 @@ Page({
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
that.data.currentJobDrawer.collected = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
txt = "收藏成功";
|
|
|
|
txt = "收藏成功";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log(that.data.currentJobDrawer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
that.setData({
|
|
|
|
recordList: that.data.recordList,
|
|
|
|
recordList: that.data.recordList,
|
|
|
|
currentJobDrawer: that.data.currentJobDrawer,
|
|
|
|
currentJobDrawer: that.data.currentJobDrawer,
|
|
|
|
@ -2134,7 +2118,7 @@ Page({
|
|
|
|
if (that.data.isLogin || (!that.data.isLogin && e.currentTarget.dataset.id == 0)) {
|
|
|
|
if (that.data.isLogin || (!that.data.isLogin && e.currentTarget.dataset.id == 0)) {
|
|
|
|
if (e.currentTarget.dataset.id) {
|
|
|
|
if (e.currentTarget.dataset.id) {
|
|
|
|
that.data.choiceCollect = e.currentTarget.dataset.id;
|
|
|
|
that.data.choiceCollect = e.currentTarget.dataset.id;
|
|
|
|
that.data.storeJobListSearchForm.ucj = e.currentTarget.dataset.id;
|
|
|
|
that.data.storeJobListSearchForm.ujc = e.currentTarget.dataset.id;
|
|
|
|
that.data.storeJobListSearchForm.pageNum = 1;
|
|
|
|
that.data.storeJobListSearchForm.pageNum = 1;
|
|
|
|
that.setData({
|
|
|
|
that.setData({
|
|
|
|
choiceCollect: that.data.choiceCollect,
|
|
|
|
choiceCollect: that.data.choiceCollect,
|
|
|
|
@ -2259,7 +2243,7 @@ Page({
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
that.data.storeJobListSearchForm.jobSpecialLabelIds = "";
|
|
|
|
that.data.storeJobListSearchForm.jobSpecialLabelIds = "";
|
|
|
|
// that.data.storeJobListSearchForm.ucj =
|
|
|
|
// that.data.storeJobListSearchForm.ujc =
|
|
|
|
// that.data.storeJobListSearchForm.brandIds = "";
|
|
|
|
// that.data.storeJobListSearchForm.brandIds = "";
|
|
|
|
that.data.storeJobListSearchForm.jobCategoryLabelIds = "";
|
|
|
|
that.data.storeJobListSearchForm.jobCategoryLabelIds = "";
|
|
|
|
that.data.storeJobListSearchForm.pageNum = 1;
|
|
|
|
that.data.storeJobListSearchForm.pageNum = 1;
|
|
|
|
@ -2320,7 +2304,57 @@ Page({
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
hidedrawershow (e) {
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
this.setData({
|
|
|
|
|
|
|
|
[e.detail.type]: false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
wx.showTabBar({
|
|
|
|
|
|
|
|
animation: false,
|
|
|
|
|
|
|
|
success: (result) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
fail: () => { },
|
|
|
|
|
|
|
|
complete: () => { }
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
hideDrawer () {
|
|
|
|
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
this.getTabBar().setData({
|
|
|
|
|
|
|
|
isShow: true,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
|
|
drawerShow: false,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// this.getJobList();
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// wx.showTabBar({
|
|
|
|
|
|
|
|
// success(e) {},
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }, 300);
|
|
|
|
|
|
|
|
},
|
|
|
|
recordBill (e) {
|
|
|
|
recordBill (e) {
|
|
|
|
|
|
|
|
// if (!this.data.isLogin) {
|
|
|
|
|
|
|
|
// wx.navigateTo({
|
|
|
|
|
|
|
|
// url: "/pages/login/index",
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
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
|
|
|
|
console.log(e.currentTarget.dataset.job);
|
|
|
|
console.log(e.currentTarget.dataset.job);
|
|
|
|
console.log(123);
|
|
|
|
console.log(123);
|
|
|
|
let middleInfo = e.currentTarget.dataset.job;
|
|
|
|
let middleInfo = e.currentTarget.dataset.job;
|
|
|
|
@ -2333,8 +2367,11 @@ Page({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
console.log(info);
|
|
|
|
console.log(info);
|
|
|
|
wx.navigateTo({
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `../newEnroll/enroll/index?applyType=1&info=${info}`,
|
|
|
|
url: `../../newEnroll/enroll/index?applyType=1&info=${info}`,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// wx.navigateTo({
|
|
|
|
|
|
|
|
// url: `../newEnroll/enroll/index?applyType=1&info=${info}`,
|
|
|
|
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
},
|
|
|
|
imageLoad() {
|
|
|
|
imageLoad() {
|
|
|
|
this.setData({
|
|
|
|
this.setData({
|
|
|
|
|