Commit 10b7dead by doszhang

Merge branch 'master' into 'release'

Master

See merge request !11
parents ef83003d 4c5df047
......@@ -13,8 +13,8 @@ return array(
'AUTH_CLIENT_ID' => 'zhida_app',
'AUTH_CLIENT_PASSWORD' => 'izhida',
/* CDN路径配置。配置之后可以在模版文件中使用__CDN__ */
'__CDN__' => 'https://static.iacode.cn/cdn/citic-fighting/tag/dc668d2755/Public/static',
// '__CDN__' => '/Public/static', // @readme <-- 上线时修改这里
// '__CDN__' => 'https://static.iacode.cn/cdn/citic-fighting/tag/dc668d2754/Public/static',
'__CDN__' => '/Public/static', // @readme <-- 上线时修改这里
'URL_MODEL' => 3,
'STORAGE_PATH' => WEB_ROOT_PATH . '/Data/Storage',
'DEFAULT_FILTER' => '', // 默认参数过滤方法 用于I函数...。注意这块不能修改!!!!
......
No preview for this file type
// new VConsole()
var loadedImages = {};
function preloadimages(obj, complete_cb, progress_cb) {
function preloadimages (obj, complete_cb, progress_cb) {
var loaded = 0;
var toload = 0;
var images = obj instanceof Array ? [] : {};
......@@ -21,7 +21,7 @@ function preloadimages(obj, complete_cb, progress_cb) {
complete_cb(images);
}
function load() {
function load () {
loadedImages[this.url] = this;
++loaded;
if (progress_cb) {
......@@ -85,7 +85,7 @@ preloadimages(preloadImageList, function () {
uploadCanvas = canvasinfo[0];
uploadCtx = canvasinfo[1];
}, function (progress) {});
}, function (progress) { });
// const originalHeight = document.documentElement.clientHeight || document.body.clientHeight;
......@@ -114,8 +114,8 @@ $(document).ready(function () {
$('.username,.company').show();
var mc = new Hammer($('.touch').get(0));
bindMc(mc, uploadCtx, uploadCanvas, img, imgInfo);
drawVerticalText(uploadCtx, username, '#595857',25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857',25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, username, '#595857', 25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857', 25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
}, imgInfo);
return false;
});
......@@ -134,14 +134,14 @@ $(document).ready(function () {
// $('.poster-page .btn-change').on('click', changePoster);
});
function toUploadPage() {
function toUploadPage () {
$('.page1').hide();
$('.upload-page').show();
$('.btn-createposter').hide();
// $('.btn-upload-block').css('left', 200);
}
function checkInfo() {
function checkInfo () {
let name = $('input[name=name]').val();
let code = $('input[name=job-number]').val();
if (name.match(/^\s*$/)) {
......@@ -190,7 +190,7 @@ function checkInfo() {
})
}
function setShare() {
function setShare () {
var link = location.origin;
var friend_title = '2021年度MDRT注册会员荣誉海报';
var friend_desc = '';
......@@ -210,19 +210,19 @@ function setShare() {
'imgUrl': link + '/Public/static/image2/share.jpg',
'title': friend_title,
'desc': friend_desc,
success: function () {}
success: function () { }
};
window.wxTimelineData = {
'link': link,
'imgUrl': link + '/Public/static/image2/share.jpg',
'title': timeline_desc,
success: function () {}
success: function () { }
};
wx.onMenuShareAppMessage(wxFriendData);
wx.onMenuShareTimeline(wxTimelineData);
}
function initPage() {
function initPage () {
const displacement = parseFloat(getTranslateDistance());
// const wrapHeight = parseFloat($('.wrap').css('height'));
canvasHeight = 1238;
......@@ -262,13 +262,13 @@ function initPage() {
// }
}
function changePoster() {
function changePoster () {
let name = $('input[name=name]').val();
let business = $('input[name=business]').val();
createPoster(name, business);
}
function backToHome() {
function backToHome () {
$('.poster-page').hide();
$('.page1').show();
}
......@@ -314,7 +314,7 @@ function backToHome() {
// }
// }
function createPoster() {
function createPoster () {
$('#notification_area').remove();
my_notify('正在生成海报,请稍候', 60000);
......@@ -329,6 +329,8 @@ function createPoster() {
photo.src = getManBase64(uploadCanvas);
photo.onload = function () {
posterCtx.fillStyle = '#ffffff';
posterCtx.fillRect(0, 0, posterCanvas.width, posterCanvas.height);
posterCtx.drawImage(photo, 0, 0, posterCanvas.width, posterCanvas.height);
var posterMask = new Image();
posterMask.src = '/Public/static/image2/poster-' + level + '.png?version=3'
......@@ -336,8 +338,8 @@ function createPoster() {
setTimeout(function () {
posterCtx.drawImage(posterMask, 0, 0, 640 * 2, 1238 * 2);
drawVerticalText(uploadCtx, username, '#595857',25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857',25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, username, '#595857', 25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857', 25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
$('#notification_area').remove();
$('.upload-page').hide();
......@@ -350,11 +352,11 @@ function createPoster() {
}
}
function filterCompanyName(str) {
function filterCompanyName (str) {
return str.includes('市') ? str.replace('市', '') : str;
}
function drawVerticalText(ctx, text, color, fontSize, x, y, isBold, letterSpacing) {
function drawVerticalText (ctx, text, color, fontSize, x, y, isBold, letterSpacing) {
ctx.save(); // 保存当前状态
// 设置字体样式,判断是否加粗
......@@ -383,13 +385,13 @@ function drawVerticalText(ctx, text, color, fontSize, x, y, isBold, letterSpacin
ctx.restore(); // 恢复之前的状态
}
function confirmAvatar() {
function confirmAvatar () {
$('.regulate-block').hide();
}
function inputLength() {}
function inputLength () { }
function bindMc(mc, ctx, myCanvas, img, imgInfo) {
function bindMc (mc, ctx, myCanvas, img, imgInfo) {
console.log(imgInfo.x, imgInfo.y)
mc.get('pan').set({
direction: Hammer.DIRECTION_ALL
......@@ -419,8 +421,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
imgInfo.y += movedY * 2;
drawImage(ctx, myCanvas, img, imgInfo);
drawVerticalText(uploadCtx, username, '#595857',25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857',25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, username, '#595857', 25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857', 25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
}
});
var oldScale = 1;
......@@ -436,8 +438,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
oldScale = event.scale;
imgInfo.scale *= nowScale;
drawImage(ctx, myCanvas, img, imgInfo);
drawVerticalText(uploadCtx, username, '#595857',25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857',25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, username, '#595857', 25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857', 25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
}
});
var oldRotation = 0;
......@@ -453,13 +455,13 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
oldRotation = event.rotation;
imgInfo.rotation += nowRotation;
drawImage(ctx, myCanvas, img, imgInfo);
drawVerticalText(uploadCtx, username, '#595857',25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857',25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, username, '#595857', 25 * 2, 82 * 2, 300 * 2, true, 5 * 2);
drawVerticalText(uploadCtx, company, '#595857', 25 * 2, 82 * 2, 440 * 2, true, 5 * 2);
}
});
}
function bindUpload(that, ctx, myCanvas, index, callback, imgInfo) {
function bindUpload (that, ctx, myCanvas, index, callback, imgInfo) {
imgInfo = {
x: 0,
y: 0,
......@@ -506,7 +508,7 @@ function bindUpload(that, ctx, myCanvas, index, callback, imgInfo) {
});
}
function drawImage(ctx, myCanvas, img, imgInfo) {
function drawImage (ctx, myCanvas, img, imgInfo) {
ctx.save();
ctx.clearRect(0, 0, myCanvas.width, myCanvas.height);
ctx.translate(myCanvas.width / 2, myCanvas.height / 2);
......@@ -517,7 +519,7 @@ function drawImage(ctx, myCanvas, img, imgInfo) {
ctx.restore();
}
function drawNum() {
function drawNum () {
posterCtx.font = 'normal ' + '48px normal';
let text1 = '已有';
let text2 = '人发起承诺';
......@@ -539,7 +541,7 @@ function drawNum() {
txtDraw(posterCtx, text2, '#fff', text2X, 557 * 2);
}
function drawUserInfo(name, business, fontsize, fontweight) {
function drawUserInfo (name, business, fontsize, fontweight) {
fontsize = fontsize * 2;
posterCtx.font = fontweight + ' ' + fontsize + 'px text';
let {
......@@ -562,7 +564,7 @@ function drawUserInfo(name, business, fontsize, fontweight) {
};
}
function getX(name, business) {
function getX (name, business) {
let nameWidth = posterCtx.measureText(name).width;
let businessWidth = posterCtx.measureText(business).width;
......@@ -581,7 +583,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';
var width = ctx.measureText(content).width;
var cx = x - width / 2;
......@@ -589,18 +591,18 @@ function txtDraw(ctx, content, color, x, y, fontsize, fontWeight = 'normal') {
ctx.fillText(content, cx, y);
}
function txtDrawLeft(ctx, content, color, x, y, fontsize, fontWeight = 'normal') {
function txtDrawLeft (ctx, content, color, x, y, fontsize, fontWeight = 'normal') {
ctx.font = fontWeight + ' ' + fontsize + 'px zkkh';
var cx = x;
ctx.fillStyle = color;
ctx.fillText(content, cx, y);
}
function getManBase64(canvas) {
function getManBase64 (canvas) {
return canvas.toDataURL('image/png');
}
function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) {
function initCanvas (target, id, canvasWidth, canvasHeight, useRem = false) {
if (useRem) {
canvasWidth = pxToRem(canvasWidth);
canvasHeight = pxToRem(canvasHeight);
......@@ -614,7 +616,7 @@ function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) {
return [canvas, ctx];
}
function getTranslateDistance(cardinal = 0, abs = false) {
function getTranslateDistance (cardinal = 0, abs = false) {
let wrapHeight = parseFloat($('.wrap').css('height'));
let wrapInnerHeight = parseFloat($('.wrap-inner').css('height'));
return (wrapHeight - wrapInnerHeight) / 2 + cardinal + 'px';
......@@ -623,7 +625,7 @@ function getTranslateDistance(cardinal = 0, abs = false) {
//获取随机数方法
//min 最小值
//max 最大值
function RandomNumBoth(Min, Max, exclude = '') {
function RandomNumBoth (Min, Max, exclude = '') {
var Range = Max - Min;
var Rand = Math.random();
var num = Min + Math.round(Rand * Range); //四舍五入
......@@ -636,7 +638,7 @@ function RandomNumBoth(Min, Max, exclude = '') {
}
}
function checkIt(bind, maxNum) {
function checkIt (bind, maxNum) {
var v = document.getElementById(bind).value;
if (v == "") {
return [];
......@@ -659,7 +661,7 @@ function checkIt(bind, maxNum) {
return true;
}
function timest() {
function timest () {
var tmp = Date.parse(new Date()).toString();
tmp = tmp.substr(0, 10);
return tmp;
......
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