Commit 6c332600 by doszhang

dos

parent 67451c95
......@@ -109,17 +109,6 @@ $(document).ready(function () {
});
$('.btn-createposter').on('click', createPoster);
// $('.btn-retry').on('click', () => {
// $('input[name=btn-upload]').click()
// });
// //上传头像确认
// $('.page1 .btn-ok').on('click', confirmAvatar);
// //检查用户输入后生成海报
// $('.page1 .btn-go').on('click', checkInfo);
// //返回到首页
// $('.poster-page .btn-backtohome').on('click', backToHome);
// //换一句
// $('.poster-page .btn-change').on('click', changePoster);
});
function showIcon() {
......@@ -278,8 +267,8 @@ function createPoster() {
logoObj.src = '/Public/static/image2/logo.png';
logoObj.onload = function () {
txtDraw(posterCtx, username, '#464646', 522 * 2, 236 * 2, 45 * 2, 'bolder');
txtDraw(posterCtx, '中信保诚人寿', '#fff', 522 * 2, 268 * 2, 20 * 2);
txtDraw(posterCtx, company + '分公司', '#fff', 522 * 2, 295 * 2, 20 * 2);
txtDraw(posterCtx, '中信保诚人寿', '#464646', 522 * 2, 268 * 2, 20 * 2);
txtDraw(posterCtx, company + '分公司', '#464646', 522 * 2, 295 * 2, 20 * 2);
setTimeout(function () {
posterCtx.drawImage(logoObj, 52 * 2, 38 * 2, 243 * 2, 67 * 2);
var posterBottomObj = new Image();
......@@ -299,40 +288,6 @@ function createPoster() {
}, 500);
}
}
// var posterObj = new Image();
// posterObj.src = '/Public/static/image2/poster' + level + '.jpg';
// posterObj.onload = function () {
// posterCtx.drawImage(posterObj, 0, 0, posterCanvas.width, posterCanvas.height);
// $('#notification_area').remove();
// $('.upload-page').hide();
// $('.poster-page').show();
// // var headimgObj = new Image();
// // headimgObj.src = getManBase64(uploadCanvas);
// // headimgObj.onload = function () {
// // posterCtx.beginPath();
// // posterCtx.arc(214 * 2, 446 * 2, 46 * 2, 0, 2 * Math.PI);
// // posterCtx.fillStyle = "#fff"; //填充颜色,默认是黑色
// // posterCtx.fill(); //画实心圆
// // posterCtx.closePath();
// // posterCtx.drawImage(headimgObj, 170 * 2, 402 * 2, 88 * 2, 88 * 2);
// // drawUserInfo(name, business, 20, 'bolder');
// // setTimeout(function () {
// // drawNum();
// // }, 200);
// // setTimeout(function () {
// // $('.poster-canvas .posterimg').remove();
// // $('.poster-canvas').append('<img class="posterimg" />');
// // $('.posterimg').attr('src', getManBase64(posterCanvas));
// // $('.page1').hide();
// // $('.poster-page').show();
// // $('#notification_area').remove();
// // createPosterLock = false;
// // }, 500);
// // }
// }
}
function confirmAvatar() {
......@@ -530,7 +485,7 @@ function getX(name, business) {
function txtDraw(ctx, content, color, x, y, fontsize, fontWeight = 'normal') {
ctx.font = fontWeight + ' ' + fontsize + 'px zkkh';
var width = ctx.measureText(content).width;
var cx = x - width;
var cx = x - width / 2;
ctx.fillStyle = color;
ctx.fillText(content, cx, y);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment