国际化专家团队
2024-05-14 14:00
',
config: [{
querySelector: 'redpacketcover',
genId: function genId() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return decodeURIComponent(opt.node.getAttribute('data-coveruri') || '');
},
calW: function calW() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return opt.parentWidth * 0.7854;
},
calH: function calH() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return this.calW({
parentWidth: opt.parentWidth
}) / 0.73346 + 27 + 37;
},
replaceContentCssText: '',
outerContainerLeft: '',
outerContainerRight: ''
},
{
querySelector: 'mppoi',
genId: function genId() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return opt.node.getAttribute('data-id') || '';
},
calW: function calW() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return opt.parentWidth * 1;
},
calH: function calH() {
return 219;
},
replaceContentCssText: '',
appendContentCssText: 'diplay:block;',
outerContainerLeft: '',
outerContainerRight: ''
},
{
querySelector: 'mpsearch',
genId: function genId() {
return decodeURIComponent('mp-common-search');
},
calW: function calW() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return opt.parentWidth * 1;
},
calH: function calH() {
return 100;
},
replaceContentCssText: '',
appendContentCssText: 'diplay:block;',
outerContainerLeft: '',
outerContainerRight: ''
},
{
querySelector: 'mpvideosnap',
genId: function genId() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var type = opt.node.getAttribute('data-type') || 'video';
if (type === 'live') {
return decodeURIComponent(opt.node.getAttribute('data-noticeid') || '');
}
return decodeURIComponent(opt.node.getAttribute('data-id') || '');
},
calW: function calW() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var type = opt.node.getAttribute('data-type') || 'video';
var width = opt.node.getAttribute('data-width') || '';
var height = opt.node.getAttribute('data-height') || '';
if (type === 'live' || type === 'topic') {
return opt.parentWidth;
}
var ratio = 1;
ratio = width / height;
var computedHeight = 0;
var computedWidth = 0;
var isHorizontal = false;
if (ratio === 1 || ratio === 3 / 4) ; else if (ratio === 4 / 3 || ratio === 16 / 9) {
isHorizontal = true;
} else if (ratio < 3 / 4) {
ratio = 3 / 4;
} else if (ratio > 1 && ratio < 4 / 3) {
ratio = 1;
} else if (ratio > 4 / 3) {
isHorizontal = true;
} else if (typeof ratio === 'number' && !Object.is(ratio, NaN)) ; else {
ratio = 1;
}
opt.node.setAttribute('data-ratio', ratio);
opt.node.setAttribute('data-isHorizontal', isHorizontal);
if (isHorizontal === true) {
computedWidth = opt.parentWidth;
} else {
if (window.innerWidth < 1024) {
computedWidth = window.innerWidth * 0.65;
} else {
computedWidth = opt.parentWidth * 0.65;
}
}
computedHeight = computedWidth / ratio;
computedHeight = Math.round(computedHeight);
computedWidth = Math.round(computedWidth);
opt.node.setAttribute('data-computedWidth', computedWidth);
opt.node.setAttribute('data-computedHeight', computedHeight);
return computedWidth;
},
calH: function calH() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var desc = opt.node.getAttribute('data-desc') || '';
var type = opt.node.getAttribute('data-type') || 'video';
var computedHeight = opt.node.getAttribute('data-computedHeight') || '';
switch (type) {
case 'live':
return desc ? 152 : 116;
case 'topic':
return 201;
case 'image':
case 'video':
return parseFloat(computedHeight);
}
},
getBorderRadius: function getBorderRadius() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var type = opt.node.getAttribute('data-type') || 'video';
if (type === 'video') {
return 4;
}
return 8;
},
replaceContentCssText: '',
appendContentCssText: 'display:flex;margin:0px auto;',
outerContainerLeft: '',
outerContainerRight: ''
}, {
querySelector: 'mp-wxaproduct',
genId: function genId() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return decodeURIComponent(opt.node.getAttribute('data-wxaproduct-productid') || '');
},
calW: function calW() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return opt.parentWidth * 1 || '100%';
},
calH: function calH() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var cardtype = opt.node.getAttribute('data-wxaproduct-cardtype') || '';
return cardtype === 'mini' ? 124 : 466;
},
replaceContentCssText: '',
outerContainerLeft: '',
outerContainerRight: ''
}, {
querySelector: 'mpprofile',
genId: function genId(opt) {
return opt.node.getAttribute('data-id') || '';
},
calW: function calW() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return opt.parentWidth * 1;
},
calH: function calH() {
return 143;
},
replaceContentCssText: '',
appendContentCssText: 'diplay:block;',
outerContainerLeft: '',
outerContainerRight: ''
},
{
querySelector: 'mp-common-product',
genId: function genId(opt) {
return opt.node.getAttribute('data-windowproduct') || '';
},
calW: function calW() {
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return opt.parentWidth * 1 || '100%';
},
calH: function calH(opt) {
var customstyle = opt.node.getAttribute('data-customstyle') || '{}';
if (customstyle) {
try {
var _JSON$parse = JSON.parse(customstyle),
display = _JSON$parse.display,
height = _JSON$parse.height;
if (display !== 'none') {
var customHeight = height.split('px')[0];
var ratio = opt.parentWidth / 350.0 || 1;
customHeight = Math.round(customHeight * ratio);
return customHeight;
}
return 0;
} catch (err) {
console.error(err);
}
}
return 0;
},
replaceContentCssText: '',
appendContentCssText: 'diplay:block;',
outerContainerLeft: '',
outerContainerRight: '