|
|
|
|
@ -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,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 阻止滑动穿透
|
|
|
|
|
*
|
|
|
|
|
|