主要观点总结
该脚本是一个微信小程序的页面渲染和数据处理脚本,主要用于提取和处理页面上的特定数据,并生成报告。它包含多个函数,如处理关键字渲染、处理特定数据、生成报告等。
关键观点总结
关键观点1: 处理关键字渲染
脚本中包含一个名为`__setDesc`的函数,用于处理页面中关键字的渲染,支持编码和不编码两种模式,用于不同的页面类型。
关键观点2: 处理特定数据
脚本提供了`addReport`和`addSpecificReport`函数,用于向报告数据中添加特定的数据和报告字段。
关键观点3: 生成报告
脚本通过`reportNow`函数生成报告,包括特定数据和请求列表,并将报告数据发送给微信服务器。
关键观点4: 页面渲染
脚本支持根据不同的页面类型,使用不同的渲染模式,包括编码和不编码的文本渲染,以及处理包含链接和特定标签的文本。
正文
";
i += 3;
continue;
}
} else if (valid) {
r += ' class="js_common_share_desc_link"';
var _itemShowType = getAttr(str[i], 'data-itemshowtype');
_itemShowType && (r += ' data-itemshowtype="' + _itemShowType + '"');
}
str[i] = valid ? r + '>' : '';
} else if (i % 4 === 3) {
!valid && (str[i] = '');
} else {
str[i] = str[i].replace(/<.*?>/g, '');
}
}
str = str.join('');
enableTagReg && (str = str.replace(ltReplaceCharReg, '<'));
enableTagReg && (str = str.replace(gtReplaceCharReg, '>'));
if (preserveS1SReg && s1sMatches.length > 0) {
str = str.replace(/__S1S_PLACEHOLDER_(\d+)__/g, function (_, index) {
return s1sMatches[parseInt(index, 10)];
});
}
return str;
}
if (isNoEncode) {
if (itemShowType * 1 === 8) {
desc = desc.html(false);
if (extData.searchKeywordsData && window.cgiData) {
window.cgiData.search_keywords = extData.searchKeywordsData;
}
if (window.cgiData && window.cgiData.search_keywords && isAllowRender) {
desc = addKeywordToHtml(desc, window.cgiData.search_keywords);
}
}
var searchKeywordsFilterReg;
if (window.cgiData && window.cgiData.search_keywords && isImagePage(itemShowType)) {
searchKeywordsFilterReg = window.cgiData.search_keywords.length > 0 ? /([\s\S]*?)<\/i><\/span>/g : undefined;
}
desc = filterContentWithLinkNWeapp(desc, isAudioPage(itemShowType) ? /<(span[^>]+?textstyle[^>]+?)>([\s\S]+?)<(\/span)>/g : undefined, searchKeywordsFilterReg);
desc = window.__emojiFormat(desc.replace(/\r/g, '').replace(/\n/g, '
'));
} else {
desc = desc.replace(/\r/g, '').replace(/\n/g, '
').replace(/\s/g, ' ');
}
if (itemShowType * 1 === 8) {
var descDom = document.getElementById('js_image_desc');
descDom && (descDom.innerHTML = desc);
if (location.href.indexOf('immerse_style=1') > -1 && descDom) {
var r = window.innerHeight - descDom.getBoundingClientRect().y - document.getElementById('wx_expand_bottom').offsetHeight;
var l = window.getComputedStyle(descDom).lineHeight;
window.__immersiveFullDesc = desc;
window.__immersiveOmited = 1;
textOverflow(descDom, {
value: {
lineClamp: Math.floor(r / parseFloat(l)),
html: '... 展开'
}
});
}
} else if (itemShowType * 1 === 10) {
var dom = document.querySelector('.js_share_notice_dom');
var _descDom = document.getElementById('js_text_desc');
_descDom && (_descDom.innerHTML = desc);
if (extData.superVoteId) dom && dom.classList.add('no_min_height');
var titleDom = document.getElementById('js_text_title');
var titleRect = titleDom ? titleDom.getBoundingClientRect() : undefined;
var descRect = _descDom ? _descDom.getBoundingClientRect() : undefined;
if (titleRect && titleRect.height > 17 * 1.4 + 2 || descRect && descRect.height > 17 * 1.6 + 2 || extData.superVoteId) {
dom && dom.classList.add('text_align_left');
}
} else if (isAudioPage(itemShowType)) {
document.querySelector('#js_audio_desc') && (document.querySelector('#js_audio_desc').innerHTML = desc);
} else {
var _descDom2 = document.getElementById('js_common_share_desc');
var descDomWrap = document.getElementById('js_common_share_desc_wrap');
if (!_descDom2 || !descDomWrap) {
return;
}
_descDom2.innerHTML = desc;
if (itemShowType * 1 !== 5) {
setTimeout(function () {
var folderSwitcher = document.getElementById('js_folder_text_switch');
if (_descDom2.offsetHeight - descDomWrap.offsetHeight > 1) {
descDomWrap.className += ' weui-ellipsis_multi';
folderSwitcher.style.display = 'block';
} else {
folderSwitcher.style.display = 'none';
}
}, 300);
}
}
};
if (!window.__second_open__) {
var videoContentNoEncode = window.a_value_which_never_exists || '\x3ca href=\x22https://mp.weixin.qq.com/s?__biz=MzAwOTczMjcwNw==\x26amp;mid=2651258355\x26amp;idx=5\x26amp;sn=555d1a6b722c0f1ef585f3e37a6bf5fd\x26amp;scene=142#wechat_redirect\x22 target=\x22_blank\x22 data-itemshowtype=\x220\x22\x3e【试题与操作】山西2024年初二信考操作手册(11-20)\x3c/a\x3e';
var TextContentNoEncode = window.a_value_which_never_exists || '';
var ContentNoEncode = window.a_value_which_never_exists || '\x3ca href=\x22https://mp.weixin.qq.com/s?__biz=MzAwOTczMjcwNw==\x26amp;mid=2651258355\x26amp;idx=5\x26amp;sn=555d1a6b722c0f1ef585f3e37a6bf5fd\x26amp;scene=142#wechat_redirect\x22 target=\x22_blank\x22 data-itemshowtype=\x220\x22\x3e【试题与操作】山西2024年初二信考操作手册(11-20)\x3c/a\x3e';
var itemShowType = window.a_value_which_never_exists || '5';
var content = window.a_value_which_never_exists || '';
var desc = window.a_value_which_never_exists || '\x26lt;a href=\x26quot;https://mp.weixin.qq.com/s?__biz=MzAwOTczMjcwNw==\x26amp;amp;mid=2651258355\x26amp;amp;idx=5\x26amp;amp;sn=555d1a6b722c0f1ef585f3e37a6bf5fd\x26amp;amp;scene=142#wechat_redirect\x26quot; target=\x26quot;_blank\x26quot; data-itemshowtype=\x26quot;0\x26quot;\x26gt;【试题与操作】山西2024年初二信考操作手册(11-20)\x26lt;/a\x26gt;';
var superVoteId = window.a_value_which_never_exists || '';
var extData = {
superVoteId: superVoteId
};
if (videoContentNoEncode) {
__setDesc(videoContentNoEncode, true, itemShowType, extData);
} else if (itemShowType * 1 === 10 && (ContentNoEncode || superVoteId) || isAudioPage(itemShowType) && ContentNoEncode) {
__setDesc(ContentNoEncode, true, itemShowType, extData);
} else if (TextContentNoEncode) {
__setDesc(TextContentNoEncode, true, itemShowType, extData);
} else if (itemShowType * 1 === 8) {
__setDesc(content || desc, true, itemShowType, extData);
} else {
__setDesc(desc, false, itemShowType, extData);
}
window.__setDesc = __setDesc;
}
return __setDesc;
})();
\x26lt;a href=\x26quot;https://mp.weixin.qq.com/s?__biz=MzAwOTczMjcwNw==\x26amp;amp;mid=2651258355\x26amp;amp;idx=5\x26amp;amp;sn=555d1a6b722c0f1ef585f3e37a6bf5fd\x26amp;amp;scene=142#wechat_redirect\x26quot; target=\x26quot;_blank\x26quot; data-itemshowtype=\x26quot;0\x26quot;\x26gt;【试题与操作】山西2024年初二信考操作手册(11-20)\x26lt;/a\x26gt;