|
|
|
|
|
const app = getApp();
|
|
|
|
|
|
const commonUtil = require("../../utils/commonUtil");
|
|
|
|
|
|
const dateUtil = require("../../utils/dateUtil");
|
|
|
|
|
|
const { wxml, style } = require("./demo.js");
|
|
|
|
|
|
var QQMapWX = require("../../utils/qqmap-wx-jssdk.min.js");
|
|
|
|
|
|
var qqmapsdk;
|
|
|
|
|
|
|
|
|
|
|
|
Page({
|
|
|
|
|
|
data: {
|
|
|
|
|
|
isLogin: false,
|
|
|
|
|
|
statusBarHeight: wx.getStorageSync("statusBarHeight"), // 状态栏高度
|
|
|
|
|
|
|
|
|
|
|
|
navigationBarHeight: wx.getStorageSync("navigationBarHeight"), // 导航栏高度
|
|
|
|
|
|
|
|
|
|
|
|
menuButtonHeight: wx.getStorageSync("menuButtonHeight"), // 胶囊按钮高度
|
|
|
|
|
|
|
|
|
|
|
|
menuButton: wx.getStorageSync("menuButtonInfo"), // 胶囊信息
|
|
|
|
|
|
backHeight: wx.getMenuButtonBoundingClientRect().top + (wx.getMenuButtonBoundingClientRect().height / 2) + 'px',
|
|
|
|
|
|
storeJobId: "",
|
|
|
|
|
|
iosDialog: false,
|
|
|
|
|
|
//职位ID
|
|
|
|
|
|
searchForm: {
|
|
|
|
|
|
storeJobId: "",
|
|
|
|
|
|
},
|
|
|
|
|
|
fullScreen: false,
|
|
|
|
|
|
bclr: "",
|
|
|
|
|
|
djxx: "",
|
|
|
|
|
|
currIndex: "1",
|
|
|
|
|
|
jobDetail: {}, //详情
|
|
|
|
|
|
wxCode: "",
|
|
|
|
|
|
pbtm: 0,
|
|
|
|
|
|
shareTitle: "",
|
|
|
|
|
|
isCollect: false,
|
|
|
|
|
|
src: "",
|
|
|
|
|
|
word: "woca",
|
|
|
|
|
|
phoneDialog: false,
|
|
|
|
|
|
isImg: true,
|
|
|
|
|
|
labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"],
|
|
|
|
|
|
bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"],
|
|
|
|
|
|
wxml: {
|
|
|
|
|
|
text: "啊啊按",
|
|
|
|
|
|
},
|
|
|
|
|
|
addressNew: "",
|
|
|
|
|
|
citys: "",
|
|
|
|
|
|
showSexAgeText: "",
|
|
|
|
|
|
fuWuFei: "",
|
|
|
|
|
|
isServicePriceShow: true,
|
|
|
|
|
|
isAgency: true,
|
|
|
|
|
|
isShareShow: false,
|
|
|
|
|
|
managerRoleClassify: false, // 管理员权限
|
|
|
|
|
|
serviceInfo: app.globalData.serviceInfo,
|
|
|
|
|
|
isMaskShow: false,
|
|
|
|
|
|
onSiteRemark: "",
|
|
|
|
|
|
img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/bg.png",
|
|
|
|
|
|
canvasImg: "",
|
|
|
|
|
|
isLoading: true,
|
|
|
|
|
|
iosDialogTobe: false, // 成为代理弹窗显示
|
|
|
|
|
|
userInfo: {},
|
|
|
|
|
|
shareListImg: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/detail830-1.png",
|
|
|
|
|
|
shareDetailImg: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/posterbg1.1.png",
|
|
|
|
|
|
posterImg: "",
|
|
|
|
|
|
safeBottom: wx.getWindowInfo().screenHeight - wx.getWindowInfo().safeArea.height + 'px',
|
|
|
|
|
|
fromScene: false,
|
|
|
|
|
|
fromShoucangOrBaoming: '',
|
|
|
|
|
|
recordBillShow: false
|
|
|
|
|
|
},
|
|
|
|
|
|
showdialog () {
|
|
|
|
|
|
this.setData({
|
|
|
|
|
|
iosDialog: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
closeDialog () {
|
|
|
|
|
|
this.setData({
|
|
|
|
|
|
iosDialog: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onShow () {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
|
|
|
|
|
|
console.log(that.data.safeBottom);
|
|
|
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
|
|
// backHeight:wx.getMenuButtonBoundingClientRect().top,
|
|
|
|
|
|
isLoading: true,
|
|
|
|
|
|
// userInfo:{...app.globalData.loginUserInfo, agencyStatus:0},
|
|
|
|
|
|
});
|
|
|
|
|
|
if (app.globalData.isLogin) {
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
// agencyStatus: app.globalData.agencyStatus,
|
|
|
|
|
|
userInfo: app.globalData.loginUserInfo,
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.wxLogin();
|
|
|
|
|
|
}
|
|
|
|
|
|
that.searchAnimate();
|
|
|
|
|
|
|
|
|
|
|
|
console.log(that.data.userInfo);
|
|
|
|
|
|
},
|
|
|
|
|
|
showphone: function () {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
wx.makePhoneCall({
|
|
|
|
|
|
// number: that.data.jobDetail.assistantUserTel + ""
|
|
|
|
|
|
phoneNumber: that.data.serviceInfo.workPhone || "0371-6611 3723",
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
close: function () {
|
|
|
|
|
|
this.setData({
|
|
|
|
|
|
phoneDialog: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
wxLogin () {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
wx.login({
|
|
|
|
|
|
success (res) {
|
|
|
|
|
|
if (res.code) {
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
wxCode: res.code,
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.log("获取code失败!" + res.errMsg);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
showImage (e) {
|
|
|
|
|
|
let resImg = e.currentTarget.dataset.src;
|
|
|
|
|
|
var imgArr = [];
|
|
|
|
|
|
|
|
|
|
|
|
this.data.jobDetail.storeImage.forEach((item) => {
|
|
|
|
|
|
// let regs = /\.(jpg|jpeg|png)(\?.*)?$/;
|
|
|
|
|
|
// item.isImg = regs.test(item.url.toLowerCase());
|
|
|
|
|
|
if (item.isImg) {
|
|
|
|
|
|
imgArr.push(item.url);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
wx.previewImage({
|
|
|
|
|
|
current: e.currentTarget.dataset.src, // 当前显示图片的http链接
|
|
|
|
|
|
urls: imgArr,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onLoad (query) {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
this.data.searchForm.storeJobId = query.storeJobId;
|
|
|
|
|
|
this.getStoreJobDetailById();
|
|
|
|
|
|
// that.setData({
|
|
|
|
|
|
// wxCode: that.data.wxCode
|
|
|
|
|
|
// })
|
|
|
|
|
|
wx.setStorageSync({
|
|
|
|
|
|
key: "storeJobId",
|
|
|
|
|
|
data: query.storeJobId,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
backIndex () {
|
|
|
|
|
|
wx.switchTab({
|
|
|
|
|
|
url: '../index/index',
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
searchAnimate () {
|
|
|
|
|
|
let that = this;
|
|
|
|
|
|
wx.createSelectorQuery()
|
|
|
|
|
|
.select("#listBox")
|
|
|
|
|
|
.fields(
|
|
|
|
|
|
{
|
|
|
|
|
|
scrollOffset: true,
|
|
|
|
|
|
size: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
(res) => {
|
|
|
|
|
|
this.animate(
|
|
|
|
|
|
".navigatorBar",
|
|
|
|
|
|
[
|
|
|
|
|
|
{
|
|
|
|
|
|
opacity: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
opacity: 1
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
800,
|
|
|
|
|
|
{
|
|
|
|
|
|
scrollSource: "#listBox",
|
|
|
|
|
|
timeRange: 1000,
|
|
|
|
|
|
startScrollOffset: 0,
|
|
|
|
|
|
endScrollOffset: 120,
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
this.animate(
|
|
|
|
|
|
".noBack",
|
|
|
|
|
|
[
|
|
|
|
|
|
{
|
|
|
|
|
|
opacity: 1
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
opacity: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
800,
|
|
|
|
|
|
{
|
|
|
|
|
|
scrollSource: "#listBox",
|
|
|
|
|
|
timeRange: 1000,
|
|
|
|
|
|
startScrollOffset: 0,
|
|
|
|
|
|
endScrollOffset: 1,
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
|
|
|
|
|
.exec();
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
goBack () {
|
|
|
|
|
|
if (this.data.fromScene) {
|
|
|
|
|
|
wx.switchTab({
|
|
|
|
|
|
url: '../index/index',
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
wx.navigateBack({
|
|
|
|
|
|
delta: -1,
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
getStoreJobDetailById () {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
wx.showLoading({
|
|
|
|
|
|
title: "加载中...",
|
|
|
|
|
|
});
|
|
|
|
|
|
wx.request({
|
|
|
|
|
|
// url: app.globalData.ip + "/store/job/getStoreJobDetailById?storeJobId=" + that.data.searchForm.storeJobId,
|
|
|
|
|
|
url: app.globalData.ip + "/assistant/job/get/" + that.data.searchForm.storeJobId,
|
|
|
|
|
|
method: "get",
|
|
|
|
|
|
header: app.globalData.headers,
|
|
|
|
|
|
data: that.data.searchForm,
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
if (res.data.status == 200) {
|
|
|
|
|
|
var result = res.data.data;
|
|
|
|
|
|
var title = result.job.jobName;
|
|
|
|
|
|
|
|
|
|
|
|
console.log(title)
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
shareTitle: title,
|
|
|
|
|
|
onSiteRemark: result.job.onSiteRemark,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
let regs = /\.(jpg|jpeg|png)(\?.*)?$/;
|
|
|
|
|
|
// res.data.data.storeImage.forEach((item) => {
|
|
|
|
|
|
// item.isImg = regs.test(item.url.toLowerCase());
|
|
|
|
|
|
// });
|
|
|
|
|
|
result.job.genderRestrict = commonUtil.getGenderByMinAge(result.job);
|
|
|
|
|
|
result.job.updateTime = dateUtil.timeShowXXX(result.job.updateTime)
|
|
|
|
|
|
// if (app.isNotEmptyCheck(title)) {
|
|
|
|
|
|
// title = result.storeJob.jobName;
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// title = result.store.aliasName;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// // wx.setNavigationBarTitle({
|
|
|
|
|
|
// // title,
|
|
|
|
|
|
// // });
|
|
|
|
|
|
|
|
|
|
|
|
// result.storeJob.workType = commonUtil.getWorkTypeById(result.storeJob.workTypeMulti);
|
|
|
|
|
|
|
|
|
|
|
|
// if (app.isNotEmptyCheck(result.storeJob.calculationSalaryType)) {
|
|
|
|
|
|
// result.storeJob.calculationSalaryType = result.storeJob.calculationSalaryType.split("#")[0];
|
|
|
|
|
|
// }
|
|
|
|
|
|
if (app.isNotEmptyCheck(result.job.jobDesp)) {
|
|
|
|
|
|
result.job.jobDesp = result.job.jobDesp.replaceAll("*****", "").split("————————")[0].replace("⚠", "<i class='t-icon t-icon-zhuyi' style='margin-bottom:-2px;width:17px;height:17px;background-repeat:no-repeat;background-size:100% 100%'></i>").replace("[红包]", "<i class='t-icon t-icon-hongbao' style='margin-bottom:-2px;width:17px;height:17px;background-repeat:no-repeat;background-size:100% 100%'></i>");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(result.job)
|
|
|
|
|
|
that.disposeJobListData(result.job);
|
|
|
|
|
|
// if (app.isNotEmptyCheck(result.job.logo)) {
|
|
|
|
|
|
// result.job["logo2"] = result.job.logo.replace("http:", "https:");
|
|
|
|
|
|
// result.job.logo.indexOf("https") > -1 ? result.job.logo : result.logo.replace("http", "https")
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// result.job["logo2"] = "";
|
|
|
|
|
|
// }
|
|
|
|
|
|
// console.log(commonUtil.getReturnFeeTypeName1ById(result.storeJob.returnFeeType, result.storeJob.returnFee));
|
|
|
|
|
|
console.log("isout");
|
|
|
|
|
|
if (app.isNotEmptyCheck(result.job.returnFeeType) || result.job.returnFeeType == "0" || result.job.returnFee == "0") {
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
fuWuFei: commonUtil.getReturnFeeTypeName1ById(result.job.returnFeeType, result.job.returnFee),
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
// else if (result.storeJob.returnFeeType == 7) {
|
|
|
|
|
|
// that.setData({
|
|
|
|
|
|
// fuWuFei: commonUtil.getReturnFeeTypeNameById(result.storeJob.returnFeeType),
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
|
|
|
|
|
else {
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
fuWuFei: "-",
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log(res.data.data.collected);
|
|
|
|
|
|
console.log(commonUtil);
|
|
|
|
|
|
result.job['collected'] = result.collected ? 1 : 2
|
|
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
jobDetail: result.job,
|
|
|
|
|
|
// isMaskShow: !(result.storeJob.recruitment == "1"),
|
|
|
|
|
|
// citys: citys || "-",
|
|
|
|
|
|
// addressNew: result.store.district.replace(/,/g, "") + result.store.detailPosition,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
that.showSexAge();
|
|
|
|
|
|
|
|
|
|
|
|
console.log(that.data.jobDetail);
|
|
|
|
|
|
}
|
|
|
|
|
|
wx.hideLoading();
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
showSexAge () {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
var manStr = "";
|
|
|
|
|
|
var womanStr = "";
|
|
|
|
|
|
|
|
|
|
|
|
if (app.isNotEmptyCheck(that.data.jobDetail.minAgeMan) || app.isNotEmptyCheck(that.data.jobDetail.maxAgeMan)) {
|
|
|
|
|
|
manStr = "男 ";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (app.isNotEmptyCheck(that.data.jobDetail.minAgeMan)) {
|
|
|
|
|
|
manStr = manStr + that.data.jobDetail.minAgeMan;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (app.isNotEmptyCheck(that.data.jobDetail.maxAgeMan)) {
|
|
|
|
|
|
manStr = manStr + "-" + that.data.jobDetail.maxAgeMan;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (app.isNotEmptyCheck(that.data.jobDetail.minAgeWoman) || app.isNotEmptyCheck(that.data.jobDetail.maxAgeWoman)) {
|
|
|
|
|
|
womanStr = "女 ";
|
|
|
|
|
|
}
|
|
|
|
|
|
if (app.isNotEmptyCheck(that.data.jobDetail.minAgeWoman)) {
|
|
|
|
|
|
womanStr = womanStr + that.data.jobDetail.minAgeWoman;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (app.isNotEmptyCheck(that.data.jobDetail.maxAgeWoman)) {
|
|
|
|
|
|
womanStr = womanStr + "-" + that.data.jobDetail.maxAgeWoman;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (womanStr != "") {
|
|
|
|
|
|
manStr = manStr + `${manStr == "" ? "" : ";"}` + womanStr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
showSexAgeText: manStr,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 处理后台返回的职位列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
disposeJobListData (jobDetail) {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
|
|
|
|
|
|
// item["workType"] = commonUtil.getWorkTypeById(
|
|
|
|
|
|
// item.workTypeMulti
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
|
|
// if (app.isNotEmptyCheck(item.distance)) {
|
|
|
|
|
|
// item["distanceKm"] = commonUtil.getDistanceName(
|
|
|
|
|
|
// item.distance
|
|
|
|
|
|
// );
|
|
|
|
|
|
// }
|
|
|
|
|
|
//年龄
|
|
|
|
|
|
var ageStr = "";
|
|
|
|
|
|
if (app.isNotEmptyCheck(jobDetail.minAge) && app.isNotEmptyCheck(jobDetail.maxAge)) {
|
|
|
|
|
|
ageStr = jobDetail.minAge + "-" + jobDetail.maxAge + "岁";
|
|
|
|
|
|
} else if (app.isNotEmptyCheck(jobDetail.minAge)) {
|
|
|
|
|
|
ageStr = jobDetail.minAge + "岁以上";
|
|
|
|
|
|
} else if (app.isNotEmptyCheck(jobDetail.maxAge)) {
|
|
|
|
|
|
ageStr = jobDetail.maxAge + "岁以下";
|
|
|
|
|
|
}
|
|
|
|
|
|
jobDetail["age"] = ageStr;
|
|
|
|
|
|
//时薪
|
|
|
|
|
|
// var hourlyPayStr = "";
|
|
|
|
|
|
var hasHourlyPay = true;
|
|
|
|
|
|
console.log(jobDetail);
|
|
|
|
|
|
// if (app.isNotEmptyCheck(jobDetail.hourlyPay)) {
|
|
|
|
|
|
// hourlyPayStr = jobDetail.hourlyPay + "元/小时";
|
|
|
|
|
|
// hasHourlyPay = true;
|
|
|
|
|
|
// } else if (app.isNotEmptyCheck(jobDetail.dayPay)) {
|
|
|
|
|
|
// hourlyPayStr = jobDetail.dayPay + "元/日";
|
|
|
|
|
|
// hasHourlyPay = true;
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// if (app.isNotEmptyCheck(jobDetail.minMonthlyPay) && app.isNotEmptyCheck(jobDetail.maxMonthlyPay)) {
|
|
|
|
|
|
// if (jobDetail.minMonthlyPay == jobDetail.maxMonthlyPay) {
|
|
|
|
|
|
// hourlyPayStr = jobDetail.minMonthlyPay;
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// hourlyPayStr = jobDetail.minMonthlyPay + "-" + jobDetail.maxMonthlyPay;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// } else if (app.isNotEmptyCheck(jobDetail.minMonthlyPay)) {
|
|
|
|
|
|
// hourlyPayStr = jobDetail.minMonthlyPay;
|
|
|
|
|
|
// } else if (app.isNotEmptyCheck(jobDetail.maxMonthlyPay)) {
|
|
|
|
|
|
// hourlyPayStr = jobDetail.maxMonthlyPay;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (app.isNotEmptyCheck(jobDetail.dayPay)){
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (app.isNotEmptyCheck(jobDetail.salaryClassify) && app.isNotEmptyCheck(jobDetail.salaryClassifyValue)) {
|
|
|
|
|
|
|
|
|
|
|
|
jobDetail["hourlyPay"] = commonUtil.getSalaryClassifyValue(jobDetail.salaryClassify, jobDetail.salaryClassifyValue);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//月薪
|
|
|
|
|
|
var monthlyPayStr = "";
|
|
|
|
|
|
if (hasHourlyPay) {
|
|
|
|
|
|
if (app.isNotEmptyCheck(jobDetail.minMonthlyPay) && app.isNotEmptyCheck(jobDetail.maxMonthlyPay)) {
|
|
|
|
|
|
if (jobDetail.minMonthlyPay == jobDetail.maxMonthlyPay) {
|
|
|
|
|
|
monthlyPayStr = jobDetail.minMonthlyPay/100;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
monthlyPayStr = jobDetail.minMonthlyPay/100 + "-" + jobDetail.maxMonthlyPay/100;
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (app.isNotEmptyCheck(jobDetail.minMonthlyPay)) {
|
|
|
|
|
|
monthlyPayStr = jobDetail.minMonthlyPay/100;
|
|
|
|
|
|
} else if (app.isNotEmptyCheck(jobDetail.maxMonthlyPay)) {
|
|
|
|
|
|
monthlyPayStr = jobDetail.maxMonthlyPay/100;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
jobDetail["monthlyPay"] = monthlyPayStr;
|
|
|
|
|
|
//地址深圳丨龙岗区丨
|
|
|
|
|
|
// var districtStr = "";
|
|
|
|
|
|
// if (app.isNotEmptyCheck(jobDetail.store.district)) {
|
|
|
|
|
|
// var districtArr = jobDetail.store.district.split(",");
|
|
|
|
|
|
// if (districtArr.length < 3) {
|
|
|
|
|
|
// districtStr = districtArr[districtArr.length - 1];
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// districtStr = districtArr[1] + "丨" + districtArr[2];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// //districtStr = districtArr[1] + '丨' + districtArr[2];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// jobDetail.store["districtStr"] = districtStr;
|
|
|
|
|
|
// jobDetail["districtDetail"] = commonUtil.getStoreAddress(jobDetail.district, jobDetail.detailPosition);
|
|
|
|
|
|
// //职位特色
|
|
|
|
|
|
if (app.isNotEmptyCheck(jobDetail.jobSpecialLabelNames)) {
|
|
|
|
|
|
jobDetail["jobSpecialLabelNames"] = that.getJobSpecialLabelNamesArray(jobDetail.jobSpecialLabelNames);
|
|
|
|
|
|
}
|
|
|
|
|
|
// if (app.isNotEmptyCheck(jobDetail.jobRequestLabelNames)) {
|
|
|
|
|
|
// jobDetail['jobRequestLabelNames'] = that.getJobRequestLabelNamesArray(jobDetail.jobRequestLabelNames);
|
|
|
|
|
|
// }
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
makePhoneCall () {
|
|
|
|
|
|
console.log(1);
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
wx.makePhoneCall({
|
|
|
|
|
|
// number: that.data.jobDetail.assistantUserTel + ""
|
|
|
|
|
|
phoneNumber: that.data.serviceInfo.workPhone || "0371-6611 3723",
|
|
|
|
|
|
});
|
|
|
|
|
|
// var that = this;
|
|
|
|
|
|
|
|
|
|
|
|
// let res = wx.getStorageSync({
|
|
|
|
|
|
// key: "assistantUserTel"
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(res);
|
|
|
|
|
|
// console.log("缓存获取电话号:" + res.data);
|
|
|
|
|
|
|
|
|
|
|
|
// if (app.isNotEmptyCheck(res.data)) {
|
|
|
|
|
|
// wx.makePhoneCall({
|
|
|
|
|
|
// number: res.data
|
|
|
|
|
|
// });
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// wx.request({
|
|
|
|
|
|
// url: app.globalData.ip + "/store/job/getOneAssistantUser",
|
|
|
|
|
|
// method: "POST",
|
|
|
|
|
|
// header: app.globalData.headers,
|
|
|
|
|
|
// data: {},
|
|
|
|
|
|
// success: function (res) {
|
|
|
|
|
|
// console.log(res.data.data.tel);
|
|
|
|
|
|
|
|
|
|
|
|
// wx.setStorageSync({
|
|
|
|
|
|
// key: "assistantUserTel",
|
|
|
|
|
|
// data: res.data.data.tel
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// wx.makePhoneCall({
|
|
|
|
|
|
// number: res.data.data.tel + ""
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
emptyMethod () { },
|
|
|
|
|
|
wxLogin () {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
wx.login({
|
|
|
|
|
|
success (res) {
|
|
|
|
|
|
if (res.code) {
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
wxCode: res.code,
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.log("获取code失败!" + res.errMsg);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
getPhoneNumber (e) {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
console.log(e.detail.errMsg);
|
|
|
|
|
|
console.log(that.data.jobDetail);
|
|
|
|
|
|
/*wx.setStorageSync({
|
|
|
|
|
|
key: "jobDetailStorage",
|
|
|
|
|
|
data: that.data.jobDetail,
|
|
|
|
|
|
});*/
|
|
|
|
|
|
wx.setStorageSync("jobDetailStorage", that.data.jobDetail);
|
|
|
|
|
|
// console.log(e);
|
|
|
|
|
|
// console.log(e.detail.errMsg)
|
|
|
|
|
|
console.log(e.detail.iv);
|
|
|
|
|
|
// console.log(e.detail.encryptedData)
|
|
|
|
|
|
if ("getPhoneNumber:ok" == e.detail.errMsg) {
|
|
|
|
|
|
//同意
|
|
|
|
|
|
var iv = e.detail.iv;
|
|
|
|
|
|
var encryptedData = e.detail.encryptedData;
|
|
|
|
|
|
wx.checkSession({
|
|
|
|
|
|
success () {
|
|
|
|
|
|
//session_key 未过期,并且在本生命周期一直有效
|
|
|
|
|
|
wx.request({
|
|
|
|
|
|
url: app.globalData.ip + "/getWechatTel",
|
|
|
|
|
|
data: {
|
|
|
|
|
|
code: that.data.wxCode,
|
|
|
|
|
|
iv: iv,
|
|
|
|
|
|
encryptedData: encryptedData,
|
|
|
|
|
|
type: "yishoudan",
|
|
|
|
|
|
appId: app.globalData.appId
|
|
|
|
|
|
},
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
app.globalData.openId = res.data.data.openId;
|
|
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
|
|
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
|
|
|
|
|
|
|
|
console.log(that.data.isAgency);
|
|
|
|
|
|
if (collected) {
|
|
|
|
|
|
promise.then((res) => {
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
|
|
});
|
|
|
|
|
|
that.doCollected(collected, e.currentTarget.dataset.jobid);
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
/*wx.navigateTo({
|
|
|
|
|
|
url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber
|
|
|
|
|
|
});*/
|
|
|
|
|
|
promise.then((res) => {
|
|
|
|
|
|
let argument;
|
|
|
|
|
|
argument = JSON.stringify(that.data.jobDetail).replace(/\=|\&/g, "3D");
|
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
|
url: `../newEnroll/enroll/index?applyType=1&info=${argument}`,
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
promise.then(() => {
|
|
|
|
|
|
console.log(app.globalData.loginUserInfo.agencyStatus);
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
isAgency: app.globalData.loginUserInfo.agencyStatus == 1 ? true : false,
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
// wx.navigateTo({
|
|
|
|
|
|
// url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber
|
|
|
|
|
|
// });
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: function (res) {
|
|
|
|
|
|
console.log("获取用户手机号错误");
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
fail () {
|
|
|
|
|
|
// session_key 已经失效,需要重新执行登录流程
|
|
|
|
|
|
wx.login({
|
|
|
|
|
|
success (res) {
|
|
|
|
|
|
if (res.code) {
|
|
|
|
|
|
console.log(res.code);
|
|
|
|
|
|
//发起网络请求
|
|
|
|
|
|
wx.request({
|
|
|
|
|
|
url: app.globalData.ip + "/getWechatTel",
|
|
|
|
|
|
data: {
|
|
|
|
|
|
code: res.code,
|
|
|
|
|
|
iv: iv,
|
|
|
|
|
|
encryptedData: encryptedData,
|
|
|
|
|
|
type: "yishoudan",
|
|
|
|
|
|
appId: app.globalData.appId
|
|
|
|
|
|
},
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
|
|
|
|
let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
|
|
|
|
|
|
|
|
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
|
|
if (collected) {
|
|
|
|
|
|
promise.then((res) => {
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
|
|
});
|
|
|
|
|
|
that.doCollected(collected, e.currentTarget.dataset.jobid);
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
promise.then((res) => {
|
|
|
|
|
|
let argument;
|
|
|
|
|
|
argument = JSON.stringify(that.data.jobDetail).replace(/\=|\&/g, "3D");
|
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
|
url: `../newEnroll/enroll/index?applyType=1&info=${argument}`,
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
promise.then(() => {
|
|
|
|
|
|
console.log(app.globalData.loginUserInfo.agencyStatus);
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
isAgency: app.globalData.loginUserInfo.agencyStatus == 1 ? true : false,
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: function (res) {
|
|
|
|
|
|
console.log("获取用户手机号错误");
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.log("获取手机号失败!" + res.errMsg);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//拒绝
|
|
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
|
|
if (collected) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
wx.setStorageSync("comeFromPage", "detail");
|
|
|
|
|
|
wx.setStorageSync("comeFromPageParam", { storeJobId: that.data.searchForm.storeJobId });
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.log("detail-页面跳转,设置参数错误:", e);
|
|
|
|
|
|
}
|
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
|
url: "/pages/login/index",
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
|
//url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber
|
|
|
|
|
|
url: "../enroll/index?applyType=1",
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
collectPaste (e) {
|
|
|
|
|
|
var txt;
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
if (!this.data.isLogin) {
|
|
|
|
|
|
wx.setStorageSync("comeFromPage", "detail");
|
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
|
url: "/pages/login/index",
|
|
|
|
|
|
});
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
var collected = e.currentTarget.dataset.collected;
|
|
|
|
|
|
var storeJobId = e.currentTarget.dataset.jobid;
|
|
|
|
|
|
that.doCollected(collected, storeJobId);
|
|
|
|
|
|
// console.log(collected);
|
|
|
|
|
|
// if(!this.data.isCollect){
|
|
|
|
|
|
// that.setData({
|
|
|
|
|
|
// isCollect: true,
|
|
|
|
|
|
// collectTxt:'已收藏'
|
|
|
|
|
|
// })
|
|
|
|
|
|
// txt = '收藏成功'
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
// that.setData({
|
|
|
|
|
|
// isCollect: false,
|
|
|
|
|
|
// collectTxt:'收藏'
|
|
|
|
|
|
// })
|
|
|
|
|
|
// }
|
|
|
|
|
|
},
|
|
|
|
|
|
doCollected (collected, storeJobId) {
|
|
|
|
|
|
var that = this;
|
|
|
|
|
|
var url = "/assistant/job/collect/"+storeJobId;
|
|
|
|
|
|
//发起网络请求
|
|
|
|
|
|
wx.request({
|
|
|
|
|
|
url: app.globalData.ip + url,
|
|
|
|
|
|
header: app.globalData.headers,
|
|
|
|
|
|
method: "GET",
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
|
|
|
|
var txt;
|
|
|
|
|
|
if (collected - 1 == 0) {
|
|
|
|
|
|
//取消收藏
|
|
|
|
|
|
that.data.jobDetail.collected = 2;
|
|
|
|
|
|
txt = "取消收藏";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//收藏
|
|
|
|
|
|
that.data.jobDetail.collected = 1;
|
|
|
|
|
|
txt = "收藏成功";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
jobDetail: that.data.jobDetail,
|
|
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(that.data.jobDetail);
|
|
|
|
|
|
wx.showToast({
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
title: txt,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: function (res) {
|
|
|
|
|
|
console.log("操作失败");
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 阻止滑动穿透
|
|
|
|
|
|
*
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
modalMove () {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
},
|
|
|
|
|
|
showTobe () {
|
|
|
|
|
|
this.setData({
|
|
|
|
|
|
iosDialogTobe: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
closeTobe () {
|
|
|
|
|
|
this.setData({
|
|
|
|
|
|
iosDialogTobe: false,
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
// menu:[‘shareAppMessage’,‘shareTimeline’]
|
|
|
|
|
|
// return custom share data when user share.
|
|
|
|
|
|
},
|
|
|
|
|
|
onShareTimeline: function () {},
|
|
|
|
|
|
share(){
|
|
|
|
|
|
this.onShareAppMessage()
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|