部分接口

master
zsk 2 years ago
parent 4d384bc39b
commit 85793343fd

@ -55,234 +55,19 @@ Page({
name: "",
shortName: "",
},
iosDialog1: false,
phoneDialog: false,
triggered: false,
pageShow: false,
whichOneShow: "",
siv: "",
activez: "zuigao",
sexid: "-1", // 性别筛选的id
dialog1: false,
dialog2: false,
jobSpecialLabelList: [],
brandList: [],
firstMenu: "排序", // 工价筛选tab显示
secondMenu: "性别", // 性别筛选tab显示
selectBrandList: [], // 选中的品牌标签
selectJobList: [], // 选中的特色标签
tagArray0: [],
tagArray1: [],
tagArray2: [],
tagArray3: [],
tagArray4: [],
recordBillType: "", // 报名类型(拍照或者直接报名)
signType: 0, // 职位类型(自营 三方)
recordCount: 0,
totalPage: 0,
currPage: 0,
currentJobDrawer: {}, // 当前简版职位抽屉信息
drawerShow: false, // 简版职位抽屉显隐
choiceCollect: 0, //收藏的筛选
corpUserFlag: app.globalData.loginUserInfo.corpUserFlag, // 内部成员的判断
agencyStatus: app.globalData.loginUserInfo.agencyStatus, // 是否是代理的判断
serviceInfo: {}, // 代理信息
navigatorBarHeight: 0, // 头部整体高度信息
iosDialog: false, // 成为代理弹窗
isLoading: true, // 成为代理图片加载loading效果
isScrollTop: false, // 控制职位列表的滚动
swiperTextList: ["日结工", "18岁", "电子厂", "短期工", "47岁", "保底", "小时工"], // 关键词轮播的关键词列表
placeholderText: "", // 当前关键词
leftShow: false, // 左侧智能匹配抽屉显示
from:'',
/**
* 滑动相关变量
*/
lastX: 0, //滑动开始x轴位置
lastY: 0, //滑动开始y轴位置
text: "没有滑动",
currentGesture: 0, //标识手势
listPosition: null, // 存储列表当前位置
halfHide: true, // 智能匹配显示一半控制
topNum: 0,
scrollTo: "", // 列表滚动的控制
navList: [
{
img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/ztrt.png",
url: "/pages/hotList/index",
title: "主推/热推",
},
// { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/dtld.png",url:'/pages/hotList/index', title: "报名助手亮点" },
// { img: "http://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/zjzp.png",url:'/pages/hotList/index', title: "职教职培" },
{
img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/cwdl.png",
url: "/pages/tobeAgency/index",
title: "成为代理",
},
// { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/dzkf.png",url:'/pages/hotList/index', title: "定制开发" },
{
img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/xmhz.png",
url: "/pages/xiangmuhezuo/index",
title: "项目合作",
},
{
img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/xtxx.png",
url: "/pages/message/index",
title: "消息中心",
},
{
img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/lxwm.png",
url: "/pages/connectUs/index",
title: "联系我们",
},
// { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/jqqd.png",url:'/pages/hotList/index', title: "敬请期待" },
],
bannerList: [],
/**
* 筛选的相关变量
*
*
*/
filterData: {
yanba: [
{
name: "无",
id: 1,
active: 0,
},
{
name: "小面积",
id: 2,
active: 0,
},
{
name: "大面积",
id: 3,
active: 0,
},
],
area: [
{
name: "江浙沪",
id: 1,
active: 0,
},
{
name: "鄂豫皖",
id: 2,
active: 0,
},
{
name: "京津冀",
id: 3,
active: 0,
},
{
name: "晋西北",
id: 4,
active: 0,
},
{
name: "粤桂闽",
id: 5,
active: 0,
},
{
name: "鲁东南",
id: 6,
active: 0,
},
{
name: "黑吉辽",
id: 7,
active: 0,
},
{
name: "疆藏青",
id: 8,
active: 0,
},
{
name: "渝湘赣",
id: 9,
active: 0,
},
{
name: "陕甘宁",
id: 10,
active: 0,
},
{
name: "云贵川",
id: 11,
active: 0,
},
{
name: "港澳台",
id: 12,
active: 0,
},
],
price: [
{
name: "3000-4000",
id: 1,
active: 0,
},
{
name: "4000-5000",
id: 2,
active: 0,
},
{
name: "5000-6000",
id: 3,
active: 0,
},
{
name: "6000-7000",
id: 4,
active: 0,
},
{
name: "7000-8000",
id: 5,
active: 0,
},
{
name: "8000以上",
id: 6,
active: 0,
},
],
sex: [
{
name: "男",
id: 1,
active: 0,
},
{
name: "女",
id: 2,
active: 0,
},
{
name: "男女不限",
id: -1,
active: -1,
},
],
jobFilter: {
tagArray0: [],
tagArray1: [],
tagArray2: [],
tagArray3: [],
tagArray4: [],
},
classifyList: [],
},
copyList: {},
innerFilter: false,
},
goBack(){
wx.navigateBack({
@ -316,26 +101,6 @@ Page({
cc: function () {},
onShareAppMessage: function () {
var path = commonUtil.getCurrentPageUrlWithArgs();
if (app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {
//当前用户是代理人
path += (path.indexOf("?") >= 0 ? "&" : "?") + "agencyUserId=" + app.globalData.loginUserInfo.id;
}
console.log(path);
let img;
this.data.templateList.forEach((element) => {
if (element.title == "报名助手小程序首页卡片分享封面") {
img = element.img + "?" + new Date().getTime();
}
});
return {
title: " ",
path: path,
imageUrl: img,
};
},
/**
* 清除本地缓存
@ -370,12 +135,6 @@ Page({
from: 'baoming',
});
}
this.setData({
placeholderText: this.data.swiperTextList[0],
});
let arr = [];
arr.logResult();
@ -551,42 +310,10 @@ Page({
}
app.getLoginUserTokenInfo();
// this.getJobList();
if (wx.getStorageSync("FILTER_LIST")) {
let list = wx.getStorageSync("FILTER_LIST");
list.forEach((item) => {
item.active = 0;
if (item.typeClassify == "0") {
this.data.filterData.jobFilter["tagArray0"].push(item);
} else if (item.typeClassify == "1") {
this.data.filterData.jobFilter["tagArray1"].push(item);
} else if (item.typeClassify == "2") {
this.data.filterData.jobFilter["tagArray2"].push(item);
} else if (item.typeClassify == "3") {
this.data.filterData.jobFilter["tagArray3"].push(item);
} else if (item.typeClassify == "4") {
this.data.filterData.jobFilter["tagArray4"].push(item);
}
});
let jobFilter = "filterData.jobFilter";
this.setData({
[jobFilter]: this.data.filterData.jobFilter,
});
}
if (wx.getStorageSync("CLASSIFY_LIST")) {
this.data.filterData.classifyList = wx.getStorageSync("CLASSIFY_LIST");
this.data.filterData.classifyList.forEach((item) => {
item.active = 0;
});
let classifyList = "filterData.classifyList";
this.setData({
[classifyList]: this.data.filterData.classifyList,
});
}
this.setData({
copyList: JSON.parse(JSON.stringify(this.data.filterData)),
});
// that.getJobList();
},
@ -838,35 +565,7 @@ Page({
});
}
},
goEnroll(e) {
console.log(e);
// wx.navigateTo({
// url: "../newEnroll/index?applyType=0"
// });
var that = this;
wx.removeStorageSync("townsManInfo");
wx.removeStorageSync("townsManInfoJob");
wx.removeStorageSync("storeInfoJob");
// if(app.isNotEmptyCheck(wx.getStorage('townsManInfo'))){
// wx.removeStorageSync('townsManInfo')
// }
// if(app.isNotEmptyCheck(wx.getStorage('townsManInfoJob'))){
// wx.removeStorageSync('townsManInfoJob')
// }
// if(app.isNotEmptyCheck(wx.getStorage('storeInfoJob'))){
// wx.removeStorageSync('storeInfoJob')
// }
// wx.removeStorageSync('townsManInfoJob')
console.log(app.globalData.loginUserInfo.tel);
wx.setStorageSync("jobDetailStorage", that.data.recordList[e.currentTarget.dataset.idx]);
let argument;
argument = JSON.stringify(e.currentTarget.dataset.info).replace(/\=|\&/g, "3D");
wx.navigateTo({
url: `../newEnroll/enroll/index?applyType=1&info=${argument}`,
});
},
wxLogin() {
var that = this;
wx.login({
@ -1118,202 +817,5 @@ Page({
modalMove() {
return false;
},
/**
* 获取搜索轮播的关键字索引
*
*
*/
goList() {
wx.navigateTo({
url: "/pages/filterPage/index",
});
},
recordBill(e) {
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}`,
// });
},
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);
// 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 = "/user/collect/job/add";
if (collected - 1 == 0) {
url = "/user/collect/job/remove";
}
console.log(app.globalData.headers);
//发起网络请求
wx.request({
url: app.globalData.ip + url,
data: {
storeJobId: storeJobId,
},
header: app.globalData.headers,
method: "GET",
success: function (res) {
var txt;
if (collected - 1 == 0) {
//取消收藏
for (var i = 0; i != that.data.recordList.length; ++i) {
if (that.data.recordList[i].id - storeJobId == 0) {
that.data.recordList[i].collected = 2;
break;
}
}
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 {
//收藏
for (var i = 0; i != that.data.recordList.length; ++i) {
if (that.data.recordList[i].id - storeJobId == 0) {
that.data.recordList[i].collected = 1;
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",
title: txt,
});
},
fail: function (res) {
console.log("操作失败");
},
});
},
getUserInfoBtn: function (e) {
console.log(e);
let that = this;
let type = e.currentTarget.dataset.type;
var collected = e.currentTarget.dataset.collected;
var storeJobId = e.currentTarget.dataset.jobid;
let idx = e.currentTarget.dataset.idx;
console.log(type);
wx.getUserProfile({
desc: "用于完善会员资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res);
//发起网络请求
wx.request({
url: app.globalData.ip + "/updateUserWechatInfo",
data: {
nickName: res.userInfo.nickName,
avatarUrl: res.userInfo.avatarUrl,
gender: res.userInfo.gender,
country: res.userInfo.country,
province: res.userInfo.province,
city: res.userInfo.city,
},
method: "POST",
header: app.globalData.headers,
success: function (res) {
console.log(res);
app.globalData.hasUserInfo = 1;
that.setData({
hasUserInfo: 1,
});
that.doMenuClick(type, collected, storeJobId, idx);
},
fail: function (res) {
that.doMenuClick(type, collected, storeJobId, idx);
},
});
},
fail: (res) => {
console.log(res);
that.doMenuClick(type, collected, storeJobId, idx);
},
});
},
doMenuClick: function (_type, _collected, _storeJobId, _idx) {
let that = this;
if (_type - 1 == 0) {
//点击全国
that.goCity();
} else if (_type - 2 == 0) {
//搜索
} else if (_type - 3 == 0) {
//筛选
that.goScreen();
} else if (_type - 4 == 0) {
//收藏
that.doCollected(_collected, _storeJobId);
} else if (_type - 5 == 0) {
//报名
wx.setStorageSync("jobDetailStorage", that.data.recordList[_idx]);
wx.navigateTo({
url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel,
});
}
},
});

@ -140,28 +140,6 @@ Page({
});
},
renderToCanvas () {
const p1 = this.widget.renderToCanvas({ wxml: wxml(that.data.wxml), style });
p1.then((res) => {
console.log("container", res.layoutBox);
this.container = res;
console.log(res);
});
},
extraImage () {
var that = this;
// return new Promise(function (resolve, reject) {
that.widget.renderToCanvas({ wxml: wxml(that.data.wxml), style }).then((res1) => {
const p2 = that.widget.canvasToTempFilePath();
p2.then((res) => {
console.log(res);
that.setData({
src: res.tempFilePath,
});
});
});
// });
},
onLoad (query) {
var that = this;
this.data.searchForm.storeJobId = query.storeJobId;
@ -233,493 +211,6 @@ Page({
.exec();
},
getAgencyInfo (job) {
var that = this;
console.log(job);
console.log("打印基本信息");
let objAgency = {
returnFeeDesp: job.returnFeeDesp,
returnFeeType: job.returnFeeType,
transferFee: job.transferFee,
returnFee: job.returnFee != null ? new Number(job.returnFee).toFixed(2) : null,
};
let agencyStr = "";
if (app.isNotEmptyCheck(job.transferFee)) {
agencyStr = "伯才利润:" + job.transferFee + ";";
}
if (job.returnFeeType == 0) {
agencyStr += `\n服务费xxx元/时`;
} else if (job.returnFeeType == 1) {
agencyStr += `\n服务费xxx元/天`;
} else if (job.returnFeeType == 2) {
agencyStr += `\n服务费xxx元/月`;
} else if (job.returnFeeType == 3) {
agencyStr += `\n服务费xxx元/次`;
}
if (objAgency.returnFee > 0) {
agencyStr = agencyStr.replace("xxx", objAgency.returnFee);
} else if (app.isNotEmptyCheck(job.transferFee)) {
agencyStr = "伯才利润:" + job.transferFee + ";";
} else {
agencyStr = "-";
}
if (app.isEmptyCheck(objAgency.returnFeeDesp)) {
// return agencyStr
that.setData({
bclr: agencyStr,
});
} else {
that.setData({
bclr: agencyStr + "\n" + objAgency.returnFeeDesp,
});
// return agencyStr + '\n' + objAgency.returnFeeDesp;
}
},
toMapChoice (e) {
var that = this;
console.log(e);
try {
wx.setStorageSync("onSiteRemark", that.data.onSiteRemark);
wx.setStorageSync("addressList", e.currentTarget.dataset.address);
} catch (error) {
console.log(error);
}
wx.navigateTo({
url: "../mine/addressPage/index",
});
},
// openMap(e) {
// wx.showLoading({
// title: "加载中",
// });
// console.log(e);
// let address = e.currentTarget.dataset.address;
// let lat = e.currentTarget.dataset.lat;
// var formatted_addresses = "";
// qqmapsdk.reverseGeocoder({
// location: `${e.currentTarget.dataset.lat},${e.currentTarget.dataset.lng}`,
// success: function (res) {
// console.log(res);
// formatted_addresses = res.result.formatted_addresses.recommend;
// },
// });
// console.log(formatted_addresses);
// console.log(lat);
// wx.getLocation({
// type: "gcj02", //返回可以用于wx.openLocation的经纬度
// success(res) {
// wx.openLocation({
// latitude: e.currentTarget.dataset.lat - 0,
// longitude: e.currentTarget.dataset.lng - 0,
// name: formatted_addresses,
// address: address,
// scale: 8,
// });
// },
// complete(res) {
// wx.hideLoading();
// console.log(1123213);
// },
// });
// },
changeMenu (e) {
let currentIndex = parseInt(e.currentTarget.dataset.id);
this.setData({
currIndex: e.currentTarget.dataset.id,
});
},
getLocation () {
var that = this;
wx.getSetting({
success: (res) => {
console.log(res); // res.authSetting.location
if (res.authSetting.location) {
wx.getLocation({
success (res1) {
console.log("获取位置");
console.log(res1);
if (app.isNotEmptyCheck(res1.latitude) && app.isNotEmptyCheck(res1.longitude)) {
that.data.searchForm.lat = res1.latitude;
that.data.searchForm.lng = res1.longitude;
}
that.getStoreJobDetailById();
},
fail () {
that.getStoreJobDetailById();
},
});
} else {
that.getStoreJobDetailById();
}
},
}); // my.getLocation({
// success(res) {
// my.hideLoading();
// console.log(res)
// that.data.searchForm.lng = res.longitude;
// that.data.searchForm.lat = res.latitude;
// that.getStoreJobDetailById();
// },
// fail() {
// my.hideLoading();
// that.getStoreJobDetailById();
// },
// })
},
// onShareAppMessage1: function () {
// var path = commonUtil.getCurrentPageUrlWithArgs();
// if (app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {
// //当前用户是代理人
// path += "&agencyUserId=" + app.globalData.loginUserInfo.id;
// }
// var that = this;
// // const promise = new Promise(resolve => {
// // that.widget.renderToCanvas({ wxml:wxml(that.data.jobDetail), style }).then(res1 => {
// // const p2 = that.widget.canvasToTempFilePath()
// // p2.then(res => {
// // console.log(res);
// // resolve({
// // title:that.data.shareTitle,
// // imageUrl: res.tempFilePath,
// // })
// // })
// // });
// // });
// return this.getCanvas().then(()=>{
// return {
// title: that.data.shareTitle,
// imageUrl: that.data.canvasImg,
// path: path,
// // promise
// };
// })
// },
getCanvas () {
const that = this;
return new Promise((resolve) => {
var mycenter = 0; //文字左右居中显示
var myheight = 0; //文字高度
const query = wx.createSelectorQuery();
query
.select("#canvasId")
.fields({ node: true, size: true })
.exec((res) => {
console.log(res);
const canvas = res[0].node;
const ctx = canvas.getContext("2d");
new Promise(function (resolve) {
// 绘制背景图片
wx.getImageInfo({
src: that.data.img, //网络图片,如果不行请换一个
success (res) {
console.log(res);
var width = res.width;
var height = res.height;
mycenter = width / 2;
myheight = height;
canvas.width = width;
canvas.height = height;
const img = canvas.createImage();
console.log(ctx);
img.src = res.path;
img.onload = () => {
ctx.drawImage(img, 0, 0, width, height);
resolve(true);
};
},
});
})
.then(() => {
ctx.font = "500 70px Arial";
ctx.textAlign = "left";
// ctx.fillStyle = "#333";
ctx.fillStyle = "#fff";
// console.log(that.data.factoryBill.totalSalary.toString().length);
// let steNumber = that.data.factoryBill.totalSalary.toString().length
// ctx.fillRect(40, 168, steNumber * 30, 72);
ctx.fillText("职位详情", 40, 210);
})
.then(function () {
wx.canvasToTempFilePath({
canvas: canvas,
success (res) {
console.log(res);
that.setData({
canvasImg: res.tempFilePath,
// base64: canvas.toDataURL(),
});
resolve();
// console.log(that.data.canvasImg);
},
});
})
.catch((err) => { });
});
});
},
// onShareTimeline: function () {
// return {
// title: this.data.shareTitle,
// query: "?storeJobId=" + this.data.storeJobId,
// };
// },
getCanvas () {
const that = this;
return new Promise((resolve) => {
var mycenter = 0; //文字左右居中显示
var myheight = 0; //文字高度
const query = wx.createSelectorQuery();
query
.select("#canvasId")
.fields({ node: true, size: true })
.exec((res) => {
console.log(res);
const canvas = res[0].node;
const ctx = canvas.getContext("2d");
new Promise(function (resolve) {
// 绘制背景图片
wx.getImageInfo({
src: that.data.shareDetailImg, //网络图片,如果不行请换一个
success (res) {
console.log(res);
var width = res.width;
var height = res.height;
mycenter = width / 2;
myheight = height;
canvas.width = width;
canvas.height = height;
const img = canvas.createImage();
console.log(ctx);
img.src = res.path;
img.onload = () => {
ctx.drawImage(img, 0, 0, width, height);
resolve(true);
};
},
});
}).then(() => {
console.log(530);
const fillTextLineBreak = (ctx, text, x, y, lw, lh, color = "#333", font = "32", weight = "500") => {
var i = 0;
var n = 0;
var r = -1;
var initHeight = 0;
ctx.font = weight + " " + font + "px Arial"; //字体大小
ctx.fillStyle = color; //字体颜色
while (i < text.length) {
while (ctx.measureText(text.substring(n, i)).width < lw && i < text.length) {
i++;
}
r++;
ctx.fillText(text.substring(n, i), x, y + lh * r);
n = i;
}
initHeight = lh * r;
// wx.setStorageSync("initHeight", initHeight);
};
const roundRect = (ctx, img, bg_x, bg_y, bg_w, bg_h, bg_r) => {
// 开始绘制
ctx.save();
ctx.beginPath();
ctx.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5);
ctx.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2);
ctx.arc(bg_x + bg_w - bg_r, bg_y + bg_h - bg_r, bg_r, 0, Math.PI * 0.5);
ctx.arc(bg_x + bg_r, bg_y + bg_h - bg_r, bg_r, Math.PI * 0.5, Math.PI);
ctx.clip();
ctx.drawImage(img, bg_x, bg_y, bg_w, bg_h);
// 恢复之前保存的绘图上下文
ctx.restore();
};
const roundRect_yuan = (ctx, x, y, size) => {
// 开始绘制
ctx.save(); // 保存
ctx.beginPath(); // 开始绘制
// ctx.arc(100, 75, 50, 0, 2 * Math.PI)
ctx.arc(size / 2 + x, size / 2 + y, size / 2, 0, Math.PI * 2, false);
ctx.clip();
// 恢复之前保存的绘图上下文
ctx.restore();
};
function roundRect1 (ctx, x, y, w, h, r, color) {
//绘制圆角矩形(无填充色))
ctx.save();
ctx.fillStyle = color;
ctx.strokeStyle = color;
ctx.lineJoin = "round"; //交点设置成圆角
ctx.lineWidth = r;
ctx.strokeRect(x + r / 2, y + r / 2, w - r, h - r);
ctx.fillRect(x + r, y + r, w - r * 2, h - r * 2);
ctx.stroke();
ctx.closePath();
}
//使用:
new Promise((imgres) => {
// that.data.checkedList.forEach((item, index) => {
console.log(587);
let labelLeft = 0;
// ctx.arcTo()
let baseTop, logoLeft, logoSize, titleSize, ageTop, salaryClassifyValueLeft, salaryClassifyValueTop, monthlyPaySize, position, markTop, roundRectHeight;
logoLeft = 56 * 2;
let baseMiddle = 248 * 2;
// if (that.data.checkedList.length == 1) {
baseTop = 2 * 370;
logoSize = 2 * 96;
titleSize = 2 * 36;
roundRectHeight = 2 * 260;
ageTop = 2 * 110;
salaryClassifyValueLeft = 2 * 176;
salaryClassifyValueTop = 2 * 54;
monthlyPaySize = 2 * 28;
markTop = 2 * 145;
console.log(603);
// }
// else {
// baseTop = 2 * 294;
// logoSize = 2 * 80;
// titleSize = 2 * 32;
// roundRectHeight = 2 * 226;
// ageTop = 2 * 88;
// salaryClassifyValueLeft = 2 * 156;
// salaryClassifyValueTop = 2 * 48;
// monthlyPaySize = 2 * 24;
// markTop = 2 * 115;
// }
roundRect1(ctx, 24 * 2, baseTop - 100, 1104, roundRectHeight, 32, "#fff");
console.log(that.data.jobDetail.store);
that.data.jobDetail.jobSpecialLabelNames.forEach((item1, index) => {
// console.log(item1);
// console.log(ctx.measureText(item1).width);
if (index <= 2) {
fillTextLineBreak(ctx, item1, 60 * 2 + labelLeft, baseTop + markTop + 30 * 2, 400 * 2, 20, "#333", monthlyPaySize); // 标签字符
roundRect1(ctx, 52 * 2 + labelLeft, baseTop + markTop, ctx.measureText(item1).width + 16 * 2, 40 * 2, 32 * 2, "#00000008");
labelLeft += ctx.measureText(item1).width + 32 * 2;
}
});
console.log(that.data.jobDetail.store);
console.log(that.data.jobDetail);
fillTextLineBreak(ctx, that.data.jobDetail.store.aliasName, logoLeft, baseTop, 500 * 2, 20, "#333", titleSize, "600"); // 岗位标题
console.log(630);
fillTextLineBreak(ctx, that.data.jobDetail.hourlyPay, salaryClassifyValueLeft, baseTop + salaryClassifyValueTop, 400 * 2, 20, "#ff4400", titleSize, "600"); // 时薪
fillTextLineBreak(ctx, that.data.jobDetail.monthlyPay, salaryClassifyValueLeft + ctx.measureText(that.data.jobDetail.monthlyPay).width, baseTop + salaryClassifyValueTop, 400 * 2, 20, "#ff4400", monthlyPaySize, "400"); // 月工资
fillTextLineBreak(ctx, that.data.jobDetail.store.districtStr + "丨", salaryClassifyValueLeft, baseTop + ageTop, 300 * 2, 20, "#333", monthlyPaySize); // 省市年龄
fillTextLineBreak(ctx, that.data.jobDetail.age, salaryClassifyValueLeft + ctx.measureText(that.data.jobDetail.store.districtStr + "丨").width, baseTop + ageTop, 300 * 2, 20, "#333", monthlyPaySize); // 省市年龄
// let src
// src = that.data.jobDetail.store.logo.indexOf("https") > -1 ? that.data.jobDetail.store.logo : that.data.jobDetail.store.logo.replace("http", "https")
console.log(that.data.jobDetail.store.logo);
wx.downloadFile({
url: that.data.jobDetail.store.logo, //网络图片,如果不行请换一个
success (res) {
console.log(res);
const img = canvas.createImage();
img.src = res.tempFilePath;
img.onload = () => {
roundRect(ctx, img, logoLeft, baseTop + 40, logoSize, logoSize, 8);
// if (index == that.data.checkedList.length - 1) {
setTimeout(() => {
imgres();
}, 200);
// }
};
},
fail (err) {
console.log(err);
}
});
// });
// setTimeout(() => {
// },500);
})
.then(function () {
wx.canvasToTempFilePath({
canvas: canvas,
success (res) {
console.log(res);
that.setData({
canvasImg: res.tempFilePath,
});
resolve(res);
},
fail (res) {
wx.hideLoading();
wx.showToast({
title: res.errMsg,
icon: "error",
});
},
});
})
.catch((err) => {
console.log(err);
});
});
});
});
},
/**
* 分享海报生成海报图并转发
*
*
*/
sharePoster () {
wx.showLoading({
title: "生成中...",
});
this.getCanvas().then((res) => {
console.log(res);
wx.hideLoading();
this.setData({
posterImg: res.tempFilePath,
posterShow: true,
});
});
// this.setData({
// });
},
hidePoster () {
this.setData({
posterShow: false,
});
},
saveToalbum () {
let that = this;
wx.saveImageToPhotosAlbum({
filePath: that.data.posterImg,
success (res) {
console.log(res);
if (res.errMsg == "saveImageToPhotosAlbum:ok") {
wx.showToast({
title: "图片已保存",
icon: "none",
duration: 1500,
});
}
},
fail (res) {
console.log(res);
wx.showToast({
title: "图片保存失败",
icon: "none",
duration: 1500,
});
},
});
},
goBack () {
if (this.data.fromScene) {
wx.switchTab({
@ -952,29 +443,7 @@ Page({
// jobDetail['jobRequestLabelNames'] = that.getJobRequestLabelNamesArray(jobDetail.jobRequestLabelNames);
// }
},
getJobSpecialLabelNamesArray (jobSpecialLabelNames) {
if (app.isNotEmptyCheck(jobSpecialLabelNames)) {
return jobSpecialLabelNames.split(", ");
}
return [];
},
getJobRequestLabelNamesArray (jobRequestLabelNames) {
console.log(jobRequestLabelNames);
if (app.isNotEmptyCheck(jobRequestLabelNames)) {
return jobRequestLabelNames.split(", ");
}
return [];
},
goSimilar () {
var that = this;
console.log(that.data.jobDetail);
console.log(that.data.jobDetail.jobLabelId);
wx.navigateTo({
url: "../similar/index?brandId=" + that.data.jobDetail.store.brandId + "&jobLabelId=" + that.data.jobDetail.jobLabelId + "&classify=99",
});
},
makePhoneCall () {
console.log(1);
@ -1017,86 +486,7 @@ Page({
// });
// }
},
textPaste () {
var that = this;
wx.setClipboardData({
// data: that.data.jobDetail.assistantUserWechat,
data: "16619732648",
success: function (res) {
wx.getClipboardData({
success: function (res) {
wx.showToast({
icon: "none",
title: "已复制微信号,快去添加好友吧",
duration: 0,
});
wx.showModal({
title: "已复制微信号",
content: "快去搜索添加经纪人好友吧",
showCancel: false,
success (res) {
if (res.confirm) {
console.log("用户点击确定");
} else if (res.cancel) {
console.log("用户点击取消");
}
},
});
console.log(res.data); // data
},
});
},
});
},
/*collectPaste() {
var txt;
var that = this;
if(!this.data.isCollect){
that.setData({
isCollect: true
})
txt = '收藏成功'
}else{
that.setData({
isCollect: false
})
txt = '取消收藏'
}
wx.showToast({
icon: "none",
title: txt,
})
},*/
goNewEnroll (e) {
let that = this;
console.log(e);
// this.data.recordBillShow = true
this.setData({
recordBillShow: true
})
console.log(this.data.recordBillShow);
return
let argument;
argument = JSON.stringify(that.data.jobDetail).replace(/\=|\&/g, "3D");
if (!app.globalData.isLogin) {
wx.setStorageSync("comeFromPage", "detailBaoming");
wx.setStorageSync("baomingDetail", argument);
wx.navigateTo({
url: "/pages/login/index",
});
return;
}
// wx.navigateTo({
// url: `../newEnroll/enroll/index?applyType=1&info=${argument}`,
// });
// wx.navigateTo({
// url: `../newEnroll/enroll/index?applyType=1&info=${argument}`,
// });
},
emptyMethod () { },
wxLogin () {
var that = this;
@ -1261,38 +651,7 @@ Page({
}
return false;
},
setCopy (e) {
var that = this;
var contentInfo;
const query = wx.createSelectorQuery().in(this);
query
.select(".contactInfo")
.boundingClientRect(function (res) {
contentInfo = res.dataset.info;
wx.setClipboardData({
data: e.currentTarget.dataset.content + contentInfo,
success (res) {
wx.getClipboardData({
success (res) {
console.log(res.data); // data
wx.showToast({
title: "内容已复制",
icon: "none",
duration: 1500,
});
},
});
},
});
})
.exec();
},
changeContact () {
console.log(2123);
wx.navigateTo({
url: `/pages/configAnnunciate/index`,
});
},
collectPaste (e) {
var txt;
var that = this;
@ -1357,23 +716,8 @@ Page({
},
});
},
toggleprice (type) {
console.log(type);
if (type.target.dataset.index == 1) {
this.setData({
isServicePriceShow: false,
});
} else {
this.setData({
isServicePriceShow: true,
});
}
},
imageLoad () {
this.setData({
isLoading: false,
});
},
/**
* 阻止滑动穿透
*

@ -12,7 +12,7 @@ Page({
isLogin: app.globalData.isLogin,
// user:app.globalData.user,
serviceInfo: {},
map: { num10: "0", num20: "0", num25: "0", num30: "0", num40: "0", num999: "0", user999: "0", user40: "0", user48: "0", user50: "0", billStatus10Salary: "0", billStatus30Salary: "0" },
map: '0条',
motto: "Hello World",
userInfo: {},
hasUserInfo: false,
@ -56,17 +56,7 @@ Page({
onShow: function () {
console.log("isshow");
let that = this;
console.log(wx.getWindowInfo().screenTop)
wx.setStorageSync("comeFromPage", "me");
if (typeof this.getTabBar === "function" && this.getTabBar()) {
this.getTabBar().setData({
selected: 2,
isShow:true
});
}
wx.setStorageSync('BILLFROM','mine')
// wx.showTabBar({
// success(e) {},
// });
@ -83,7 +73,7 @@ Page({
// let serviceInfo = wx.getStorageSync('ServiceInfo')
setTimeout(() => {
if (app.globalData.isLogin) {
console.log(that.data.userInfo);
that.setData({
isLogin: app.globalData.isLogin,
hasUserInfo: app.globalData.hasUserInfo,
@ -261,13 +251,13 @@ Page({
getDataNum() {
let that = this;
wx.request({
url: app.globalData.ip + "/statistics/home",
url: app.globalData.ip + "/assistant/mine/info",
header: app.globalData.headers,
success(res) {
console.log(res);
if (res.data.status == 200) {
that.setData({
map: res.data.data,
map: res.data.data.applyNum+'条',
});
}
},

@ -57,7 +57,7 @@
<view class="c3 f16" hover-class="none" hover-stop-propagation="false">我的报名</view>
</view>
<view class hover-class="none" style="line-height:16px" hover-stop-propagation="false">
<view class="iconfont icon-gengduo11 f12 c9 ml4 mt2"></view>
{{map}}<view class="iconfont icon-gengduo11 f12 c9 ml4 mt2"></view>
</view>
</view>
</view>

Loading…
Cancel
Save