Commit 959a1fa1 by dos

init

parent 437153ac
...@@ -174,11 +174,11 @@ function checkInfo() { ...@@ -174,11 +174,11 @@ function checkInfo() {
$('.tip').hide(); $('.tip').hide();
$('.tip' + phase).show() $('.tip' + phase).show()
$('.company').html('中信保诚人寿  ' + company + ''); $('.company').html('中信保诚人寿  ' + company + '');
if (fyp == 0) { // if (fyp == 0) {
$('.perf').html('<span>个人累计承保</span><br/>' + perf + '件') // $('.perf').html('<span>个人累计承保</span><br/>' + perf + '件')
} else { // } else {
$('.perf').html('<span>个人累计承保</span><br/>FYP' + perf + '元') // $('.perf').html('<span>个人累计承保</span><br/>FYP' + perf + '元')
} // }
// setShare(); // setShare();
...@@ -248,8 +248,10 @@ function initPage() { ...@@ -248,8 +248,10 @@ function initPage() {
top: 'auto', top: 'auto',
bottom: -displacement - 5 + 'px' bottom: -displacement - 5 + 'px'
}); });
$('.username').css('top', 'auto').css('bottom', 352 + (-displacement - 5) + 'px') username_bottom = 352 + (-displacement - 5)
$('.company').css('top', 'auto').css('bottom', 318 + (-displacement - 5) + 'px') company_bottom = 318 + (-displacement - 5)
$('.username').css('top', 'auto').css('bottom', username_bottom + 'px')
$('.company').css('top', 'auto').css('bottom', company_bottom + 'px')
} }
} }
...@@ -327,9 +329,9 @@ function createPoster() { ...@@ -327,9 +329,9 @@ function createPoster() {
// txtDraw(posterCtx, username, '#464646', 215 * 2, 360 * 2, 45 * 2, 'bolder'); // txtDraw(posterCtx, username, '#464646', 215 * 2, 360 * 2, 45 * 2, 'bolder');
// txtDraw(posterCtx, '中信保诚人寿', '#464646', 215 * 2, 390 * 2, 20 * 2); // txtDraw(posterCtx, '中信保诚人寿', '#464646', 215 * 2, 390 * 2, 20 * 2);
// txtDraw(posterCtx, company + '', '#464646', 215 * 2, 413 * 2, 20 * 2); // txtDraw(posterCtx, company + '', '#464646', 215 * 2, 413 * 2, 20 * 2);
txtDraw(posterCtx, username, '#ffffff', 215 * 2, 240 * 2, 45 * 2, 'bolder'); txtDraw(posterCtx, username, '#ffffff', 350 * 2, canvasHeight - username_bottom * 2, 45 * 2, 'bolder');
txtDraw(posterCtx, '中信保诚人寿', '#ffffff', 215 * 2, 280 * 2, 20 * 2); txtDraw(posterCtx, '中信保诚人寿 ' + company, '#ffffff', 350 * 2, canvasHeight - company_bottom * 2, 20 * 2);
txtDraw(posterCtx, company + '', '#ffffff', 215 * 2, 308 * 2, 20 * 2); // txtDraw(posterCtx, company + '', '#ffffff', 215 * 2, 308 * 2, 20 * 2);
setTimeout(function () { setTimeout(function () {
...@@ -586,7 +588,7 @@ function getX(name, business) { ...@@ -586,7 +588,7 @@ function getX(name, business) {
function txtDraw(ctx, content, color, x, y, fontsize, fontWeight = 'normal') { function txtDraw(ctx, content, color, x, y, fontsize, fontWeight = 'normal') {
ctx.font = fontWeight + ' ' + fontsize + 'px zkkh'; ctx.font = fontWeight + ' ' + fontsize + 'px zkkh';
var width = ctx.measureText(content).width; var width = ctx.measureText(content).width;
var cx = x - width; var cx = x - width / 2;
ctx.fillStyle = color; ctx.fillStyle = color;
ctx.fillText(content, cx, y); 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