专栏名称: GiantPandaLLM
专注于机器学习、深度学习、计算机视觉、图像处理等多个方向技术分享。团队由一群热爱技术且热衷于分享的小伙伴组成。我们坚持原创,每天一到两篇原创技术分享。希望在传播知识、分享知识的同时能够启发你,大家一起共同进步(・ω<)☆
目录
相关文章推荐
51好读  ›  专栏  ›  GiantPandaLLM

Qwen3 一手实测! 附示例,涉及推理、创作、数学和代码、表现惊艳!

GiantPandaLLM  · 公众号  · 3D  · 2025-04-29 08:10

正文

请到「今天看啥」查看全文


大家好,我是刘聪NLP。

从Llama4陨落之后,国内开源模型是世界第一,谁赞成,谁反对!

反对无效!

应该也没人反对吧。

Qwen3这波开的时机,真是恰到好处,五一都别休假了,加班跑模型吧。

我在上一篇已经介绍了Qwen3的一些基本情况, Qwen3开源!悉数几大核心变动!

模型尺寸、榜单指标、首个混合推理模型 ,这篇就不重复介绍了,去看我上一篇内容吧。

这篇主要是针对Qwen3实测,看看真实测试效果到底如何!

测试可以在两个地方都可以

https://huggingface.co/spaces/Qwen/Qwen3-Demo

或者

https://chat.qwen.ai/

主要测试think和no think两种情况。

正式测试开始。

常规测试

将“I love Qwen3-235B-A22B”这句话的所有内容反过来写

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think
Qwen3-32B think
Qwen3-32B think
Qwen3-32B no-think
Qwen3-32B no-think

说明:结果正确。

依旧弱智吧

生蚝煮熟了叫什么?

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think
Qwen3-32B think
Qwen3-32B think
Qwen3-32B no-think
Qwen3-32B no-think

说明:结果正确,没有熟蚝就行。

用水来兑水,得到的是浓水还是稀水

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think
Qwen3-32B think
Qwen3-32B think
Qwen3-32B no-think
Qwen3-32B no-think

说明:结果正确,水还是水。

依旧小红,依旧老鹰

小红有2个兄弟,3个姐妹,那么小红的兄弟有几个姐妹

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

说明:4个,正确,小红在我这是女生。

未来的某天,李同学在实验室制作超导磁悬浮材料时,意外发现实验室的老鼠在空中飞,分析发现,是因为老鼠不小心吃了磁悬浮材料。第二天,李同学又发现实验室的蛇也在空中飞,分析发现,是因为蛇吃了老鼠。第三天,李同学又发现实验室的老鹰也在空中飞,你认为其原因是

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

说明:这题确实难,老鹰反正不会飞!市面上的大模型都答不对。

数学

2024年高考全国甲卷数学(理)试题

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

说明:对了。结果是

R1满血测试题:在平面四边形ABCD中,AB = AC = CD = 1,\angle ADC = 30^{\circ},\angle DAB = 120^{\circ}。将\triangle ACD沿AC翻折至\triangle ACP,其中P为动点。 求二面角A - CP - B的余弦值的最小值。

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

说明:think对了,no think 没对,答案是

一个长五点五米的竹竿,能否穿过一扇高四米,宽三米的门?请考虑立体几何

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

大数计算:178939247893 * 299281748617等于多少?

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

说明:没对,答案是53553251005627872913981。

伦理、数学、生物终极测试

有一天,一个女孩参加数学考试只得了 38 分。她心里对父亲的惩罚充满恐惧,于是偷偷把分数改成了 88 分。她的父亲看到试卷后,怒发冲冠,狠狠地给了她一巴掌,怒吼道:“你这 8 怎么一半是绿的一半是红的,你以为我是傻子吗?”女孩被打后,委屈地哭了起来,什么也没说。过了一会儿,父亲突然崩溃了。请问这位父亲为什么过一会崩溃了?

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

说明:think模式没对,no think模型竟然答对了两点,数学和色盲。

代码

卡片:生成一个打工人时钟的html页面

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

创建一个红白机风格的"贪吃蛇"游戏,包含自动演示AI功能,使用纯HTML/CSS/JavaScript实现为单文件

Qwen3-235B-A22B think
Qwen3-235B-A22B think
Qwen3-235B-A22B no-think
Qwen3-235B-A22B no-think

生成一个表情小游戏,提示词 来自 @甲木

请你扮演一个Web游戏开发者。设计并生成一个**表情符号反应堆 **的游戏。
1、核心创意: 一个快节奏的反应游戏。屏幕上会快速闪过一个目标表情符号(例如:笑脸😄),下方会同时出现3-4个选项表情符号,玩家需要在限定时间内(例如1-2秒)点击与目标匹配的那个表情符号。
2、玩法:
- 屏幕中央显示目标Emoji。
- 下方按钮区域快速刷新3-4个Emoji选项,其中一个是正确的。
- 玩家需在计时条走完前点击正确的Emoji。
- 点击正确得分,速度加快;点击错误或超时则游戏结束(或扣除生命值)。
- 显示最高分。
3、技术实现 (HTML/JS/CSS):
- HTML: 用于显示目标Emoji、选项按钮、计时条、得分。
- CSS: 设计简洁明快的界面,计时条动画。
- JavaScript:
存储一个Emoji列表。
随机选择目标Emoji和干扰项。
动态更新按钮内容。
实现计时器逻辑和倒计时动画。
处理点击事件,判断对错,更新得分/状态。
控制游戏节奏(逐渐加快)。
4、趣味点: 简单上手,考验反应速度,利用通用的Emoji增加亲和力和趣味性,适合碎片时间玩。
Qwen3-235B-A22B think
Qwen3-235B-A22B think

再来一个小游戏,提示词 来自 @甲木

请你扮演一个Web游戏开发者。设计并生成一个**单一的HTML文件**,使用HTML Canvas、CSS和JavaScript,制作一个简单的像素风格宠物收集小游戏。

**重点要求:**
1、一定要注意审美,做出来的网页要有美感。
2、页面要有设计感,有足够的传播度

**要求:**
1.  **游戏内容 (由你生成):**
    *   **游戏名称:** (例如:“像素爪爪接星星” 或 “方块萌宠大作战”)
    *   **宠物描述:** 描述一个简单的像素宠物形象(可以用文字描述其构成,例如“一个10x10像素的橙色方块身体,上方有两个小三角形耳朵”),并给它起个名字。
    *   **玩法说明:** 简要说明如何用左右箭头键移动宠物,目标是接住从上方掉落的“金元宝”(或其他像素物品),并显示得分。
2.  **HTML结构:**
    *   包含标题、宠物描述和玩法说明。
    *   一个 `` 元素 (`id="gameCanvas"`) 用于绘制游戏。
    *   一个区域 (`id="score"`) 显示当前得分。
3.  **CSS样式 (内部 ` '; showTitle = showTitle.replace(/——/g, replaceHtml); } if (dom) { dom.innerHTML = dom.innerHTML.replace(title, showTitle); } }; if (!window.__second_open__) { var title = 'Qwen3 一手实测! 附示例,涉及推理、创作、数学和代码、表现惊艳!'; __setTitle(title, document.getElementById('activity-name')); window.__setTitle = __setTitle; } return __setTitle; })(); ', 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:not([data-cardtype="2"])', genId: function genId(opt) { return opt.node.getAttribute('data-windowproduct') || ''; }, calW: function calW() { var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (opt.node.getAttribute('data-cardtype') === "0") { return Math.min(opt.parentWidth, 400) * 1 || '100%'; } 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 = parseInt(height, 10); var ratio; if (opt.node.getAttribute('data-cardtype') === "0") { ratio = Math.min(400, opt.parentWidth) / 350.0 || 1; } else { 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: '
' }, { querySelector: 'mpcps:not([data-templateid="video-play"]),mp-common-cpsad:not([data-templateid="video-play"])', genId: function genId(opt) { var node = opt.node; var planId = node.getAttribute('data-planid'); var goodId = node.getAttribute('data-pid'); var traceId = node.getAttribute('data-traceid'); return goodId || planId || traceId || ''; }, calW: function calW() { var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var node = opt.node; var templateId = node.getAttribute('data-templateid'); var adType = node.getAttribute('data-adtype'); var width = 0; if (templateId === 'list') { width = '100%'; } else if (templateId === 'card') { if (adType === AD_CONFIG.CPS_GOODS_TYPE.SHORT_PLAY || adType === AD_CONFIG.CPS_GOODS_TYPE.MINI_GAME) { width = opt.parentWidth ? opt.parentWidth * 0.65 : '100%'; } else { width = '100%'; } } return width; }, calH: function calH(opt) { var node = opt.node; var templateId = node.getAttribute('data-templateid'); var adType = node.getAttribute('data-adtype'); var height = 0; if (templateId === 'list') { if (adType === AD_CONFIG.CPS_GOODS_TYPE.MINI_GAME) { height = 79; } else { height = 120; } } else if (templateId === 'card') { if (adType === AD_CONFIG.CPS_GOODS_TYPE.SHORT_PLAY) { var width = opt.parentWidth * 0.65; height = Math.ceil(width * (4 / 3)) + 68; } else if (adType === AD_CONFIG.CPS_GOODS_TYPE.MINI_GAME) { var _width = opt.parentWidth * 0.65; height = Math.ceil(_width * (4 / 3)) + 64; } else { height = Math.ceil(opt.parentWidth + 111); } } return height; }, replaceContentCssText: '', appendContentCssText: 'diplay:block;', outerContainerLeft: '
', outerContainerRight: '
' } ] }; function preloadingInit() { var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (typeof document.querySelectorAll !== 'function') { return; } var g = { maxWith: document.getElementById('img-content').getBoundingClientRect().width, idAttr: 'data-preloadingid' }; for (var i = 0, il = opt.config.length; i < il; i++) { var a = opt.config[i]; var list = document.querySelectorAll(a.querySelector); for (var j = 0, jl = list.length; j < jl; j++) { var node = list[j]; var parentWidth = node.parentNode.getBoundingClientRect().width; parentWidth = Math.min(parentWidth, g.maxWith); if (node.getAttribute('has-insert-preloading')) { continue; } var nodeW = a.calW({ parentWidth: parentWidth, node: node }); var nodeH = a.calH({ parentWidth: parentWidth, node: node }); var nodeId = a.genId({ index: j, node: node }); var nodeBorderRadius = typeof a.getBorderRadius === 'function' ? a.getBorderRadius({ index: j, node: node }) : 8; if (typeof nodeW === 'number') { nodeW += 'px'; } var imgHtml = opt.defaultContentTpl.replace(/#height#/g, nodeH).replace(/#width#/g, nodeW).replace(/#borderRadius#/g, nodeBorderRadius); var tmpNode = document.createElement('div'); tmpNode.innerHTML = imgHtml; if (a.replaceContentCssText) { var replaceContentCssText = a.replaceContentCssText.replace(/#height#/g, nodeH).replace(/#width#/g, nodeW); tmpNode.firstChild.style.cssText = replaceContentCssText; } else if (a.appendContentCssText) { tmpNode.firstChild.style.cssText += a.appendContentCssText; } var html = (a.outerContainerLeft || '') + tmpNode.innerHTML + (a.outerContainerRight || ''); tmpNode.innerHTML = html; tmpNode.firstChild.setAttribute(g.idAttr, nodeId); node.parentNode.insertBefore(tmpNode.firstChild, node.nextSibling); node.setAttribute('has-insert-preloading', '1'); } } } function lotteryPreloading() { Array.from(document.getElementsByTagName('mp-common-bluepacket')).forEach(function (ele) { ele.setAttribute('data-customstyle', JSON.stringify({ height: '112px' })); }); } function init() { preloadingInit(g); lotteryPreloading(); } function decode(str) { var replace = ["`", "`", "'", "'", """, '"', " ", " ", ">", ">", "<", "<", "¥", "¥", "&", "&"]; for (var i = 0; i < replace.length; i += 2) { str = str.replace(new RegExp(replace[i], 'g'), replace[i + 1]); } return str; } function getQuery(url) { url = url || 'http://qq.com/s?a=b#rd'; var tmp = url.split('?'), query = (tmp[1] || '').split('#')[0].split('&'), params = {}; for (var i = 0; i < query.length; i++) { var eqIndex = query[i].indexOf('='); if (eqIndex > -1) { var arg = query[i].substring(0, eqIndex); params[arg] = query[i].substring(eqIndex + 1); } } if (params['pass_ticket']) { params['pass_ticket'] = encodeURIComponent(decode(params['pass_ticket']).replace(/\s/g, '+')); } return params; } function insertAfter(dom, afterDom) { var _p = afterDom.parentNode; if (!_p) { return; } if (_p.lastChild === afterDom) { _p.appendChild(dom); } else { _p.insertBefore(dom, afterDom.nextSibling); } } if (typeof getComputedStyle === 'undefined') { if (document.body.currentStyle) { window.getComputedStyle = function (el) { return el.currentStyle; }; } else { window.getComputedStyle = {}; } } function getMaxWith() { var container = document.getElementById('img-content'); var max_width = container.offsetWidth; var container_padding = 0; var container_style = getComputedStyle(container); container_padding = parseFloat(container_style.paddingLeft) + parseFloat(container_style.paddingRight); max_width -= container_padding; if (!max_width) { max_width = window.innerWidth - 32; } return max_width; } function getParentWidth(dom) { var parent_width = 0; var parent = dom.parentNode; var outerWidth = 0; while (true) { if (!parent || parent.nodeType !== 1) break; var parent_style = getComputedStyle(parent); if (!parent_style) break; parent_width = parent.clientWidth - parseFloat(parent_style.paddingLeft) - parseFloat(parent_style.paddingRight) - outerWidth; if (parent_width > 16) break; outerWidth += parseFloat(parent_style.paddingLeft) + parseFloat(parent_style.paddingRight) + parseFloat(parent_style.marginLeft) + parseFloat(parent_style.marginRight) + parseFloat(parent_style.borderLeftWidth) + parseFloat(parent_style.borderRightWidth); parent = parent.parentNode; } if (parent_width < 0) { return 0; } return parent_width; } function getOuterW(dom) { var style = getComputedStyle(dom); var w = 0; if (!!style) { w = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth); } return w; } function getOuterH(dom) { var style = getComputedStyle(dom); var h = 0; if (!!style) { h = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); } return h; } function getVideoWh(dom, vid, data) { var max_width = getMaxWith(); var width = max_width; var ratio_ = dom.getAttribute('data-ratio') * 1 || 4 / 3; if (data.video_page_infos && Array.isArray(data.video_page_infos) && data.video_page_infos.some(function (x) { return x.video_id === vid; })) { var videoData = data.video_page_infos.find(function (x) { return x.video_id === vid; }); if (Array.isArray(videoData.mp_video_trans_info) && videoData.mp_video_trans_info.length) { var transInfo = videoData.mp_video_trans_info[0]; if (!!transInfo.width && !!transInfo.height) { ratio_ = transInfo.width / transInfo.height; } } } var arr = [4 / 3, 16 / 9]; var ret = arr[0]; var abs = Math.abs(ret - ratio_); for (var j = 1, jl = arr.length; j < jl; j++) { var _abs = Math.abs(arr[j] - ratio_); if (_abs < abs) { abs = _abs; ret = arr[j]; } } ratio_ = ret; var parent_width = getParentWidth(dom) || max_width; var rwidth = width > parent_width ? parent_width : width; var outerW = getOuterW(dom) || 0; var outerH = getOuterH(dom) || 0; var videoW = rwidth - outerW; var videoH = videoW / ratio_; var speedDotH = 12; var rheight = videoH + outerH + speedDotH; return { w: Math.ceil(rwidth), h: Math.ceil(rheight), vh: videoH, vw: videoW, ratio: ratio_, sdh: speedDotH }; } function setImgSize(item, widthNum, widthUnit, ratio, breakParentWidth) { var imgPaddingBorder = getOuterW(item) || 0; var imgPaddingBorderTopBottom = getOuterH(item) || 0; if (widthNum > getParentWidth(item) && !breakParentWidth) { widthNum = getParentWidth(item); } var heightNum = (widthNum - imgPaddingBorder) * ratio + imgPaddingBorderTopBottom; widthNum !== 'auto' && (item.style.cssText += ";width: ".concat(widthNum).concat(widthUnit, " !important;")); widthNum !== 'auto' && (item.style.cssText += ";height: ".concat(heightNum).concat(widthUnit, " !important;")); } var isAccessibilityKey = 'isMpUserAccessibility'; var imgPlaceholderClass = 'js_img_placeholder'; var isAccessMode = window.localStorage.getItem(isAccessibilityKey); var imgSizeData; var validArr = ',' + [0.875, 1, 1.125, 1.25, 1.375].join(',') + ','; var match = window.location.href.match(/winzoom=(\d+(?:\.\d+)?)/); if (match && match[1]) { var winzoom = parseFloat(match[1]); if (validArr.indexOf(',' + winzoom + ',') >= 0) ; } function getImgSrcMainInfo(src) { var pathName = new URL(src).pathname; var lastIndex = pathName.lastIndexOf('/'); return lastIndex > 0 ? pathName.slice(0, lastIndex) : pathName; } function setSize(images, videos, data) { var bypassPreloading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; var noWidth = !document.body.clientWidth || !document.getElementById('img-content') || !document.getElementById('img-content').offsetWidth; var _loop = function _loop() { if (noWidth) { return 0; } if (window.__second_open__ && videos[vi].getAttribute('__sec_open_place_holder__')) { return 1; } var a = videos[vi]; var src_ = a.getAttribute('src') || a.getAttribute('data-src') || ''; var vid = getQuery(src_).vid || a.getAttribute('data-mpvid'); if (!vid) { return 1; } vid = vid.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); a.removeAttribute('src'); a.style.display = 'none'; var obj = getVideoWh(a, vid, data); var videoPlaceHolderSpan = document.createElement('span'); videoPlaceHolderSpan.className = "".concat(imgPlaceholderClass, " wx_widget_placeholder"); videoPlaceHolderSpan.setAttribute('data-vid', vid); videoPlaceHolderSpan.innerHTML = ''; videoPlaceHolderSpan.style.cssText = "width: " + obj.w + "px !important;"; insertAfter(videoPlaceHolderSpan, a); a.style.cssText += ';width: ' + obj.w + 'px !important;'; a.setAttribute('width', obj.w); { videoPlaceHolderSpan.style.cssText += 'height: ' + (obj.h - obj.sdh) + 'px !important;margin-bottom: ' + obj.sdh + 'px !important;'; a.style.cssText += 'height: ' + obj.h + 'px !important;'; a.setAttribute('height', obj.h); } a.setAttribute('data-vh', obj.vh); a.setAttribute('data-vw', obj.vw); a.setAttribute('data-src', 'https://v.qq.com/iframe/player.html?vid=' + vid + '&width=' + obj.vw + '&height=' + obj.vh + '&auto=0'); a.setAttribute('__sec_open_place_holder__', true); var index = vi; (function setHitStyle() { var hitInfos = data.video_page_infos; var ret = (hitInfos || []).find(function (info) { return info.video_id === vid; }); if (!ret) return; var ori = ret.ori_status; var hit_biz_headimg = ret.hit_biz_headimg, hit_nickname = ret.hit_nickname, hit_username = ret.hit_username; var sourceBiz = ret.hit_bizuin; var selfUserName = data.user_name; if (ori === 2 && selfUserName !== hit_username) { var videoBar = document.createElement('div'); var videoBarHtml = "\n "); videoBar.innerHTML = videoBarHtml; document.querySelectorAll('.video_iframe').forEach(function (item) { if (item.getAttribute('data-mpvid') === vid && item.getAttribute('data-hasSource') !== '1') { item.setAttribute('data-hasSource', 1); item.parentNode.insertBefore(videoBar, item); } }); var avatorEle = document.getElementById(hit_biz_headimg + index); var avatorSrc = avatorEle.dataset.src; if (ret.hit_biz_headimg) avatorEle.style.backgroundImage = "url(".concat(avatorSrc, ")"); } })(); }, _ret; for (var vi = 0, viLen = videos.length; vi < viLen; vi++) { _ret = _loop(); if (_ret === 0) break; if (_ret === 1) continue; } var isCarton = data.copyright_info.is_cartoon_copyright * 1 || data.user_info.is_care_mode * 1 || isAccessMode === '1'; var max_width = getMaxWith(); if (!imgSizeData) { imgSizeData = {}; data.picture_page_info_list = data.picture_page_info_list || []; var noWidthHeightCount = 0; var hasWidthHeightCount = 0; data.picture_page_info_list.forEach(function (imgData) { try { var width = Number(imgData.width); var height = Number(imgData.height); if (width && height) { imgSizeData[getImgSrcMainInfo(imgData.cdn_url)] = { ratio: height / width, width: width }; hasWidthHeightCount++; } else { noWidthHeightCount++; } } catch (err) { console.error(err); } }); if (Math.random() < 0.01 && Number(data.create_timestamp) > 1682352000) { hasWidthHeightCount && (new Image().src = "//mp.weixin.qq.com/mp/jsmonitor?idkey=330742_20_".concat(hasWidthHeightCount, "&r=").concat(Math.random())); noWidthHeightCount && (new Image().src = "//mp.weixin.qq.com/mp/jsmonitor?idkey=330742_21_".concat(noWidthHeightCount, "&r=").concat(Math.random())); if (!data.picture_page_info_list.length) { setTimeout(function () { noWidthHeightCount = document.querySelectorAll('#js_content img').length; noWidthHeightCount && (new Image().src = "//mp.weixin.qq.com/mp/jsmonitor?idkey=330742_21_".concat(noWidthHeightCount, "&r=").concat(Math.random())); }, 300); } } } for (var im = 0, imLen = images.length; im < imLen; im++) { if (window.__second_open__ && images[im].getAttribute('__sec_open_place_holder__')) { continue; } var img = images[im]; var imgDataSrc = img.getAttribute('data-src'); var realSrc = img.getAttribute('src'); if (!imgDataSrc || realSrc) continue; var imgStyle = img.getAttribute('style'); img.setAttribute('data-original-style', imgStyle); var width_ = img.dataset.w; var imgRatio = 1 * img.dataset.ratio; img.setAttribute('data-index', im); var width_num = 0; var width_unit = 'px'; try { var imgSizeFromBackend = imgSizeData[getImgSrcMainInfo(imgDataSrc)]; if (imgSizeFromBackend) { if (imgSizeFromBackend.ratio) { imgRatio = imgSizeFromBackend.ratio; img.setAttribute('data-ratio', imgSizeFromBackend.ratio); } if (imgSizeFromBackend.width) { width_ = imgSizeFromBackend.width; img.setAttribute('data-w', imgSizeFromBackend.width); } } } catch (err) { console.error(err); } if (imgRatio && imgRatio > 0) { if (!isCarton) { img.src = "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E"; if (noWidth) { var fallbackWidth = img.style.width || img.getAttribute('width') || width_; var fallbackMaxWidth = 360; fallbackWidth = parseFloat(fallbackWidth, 10) > fallbackMaxWidth ? fallbackMaxWidth : fallbackWidth; if (fallbackWidth === 'inherit') { fallbackWidth = fallbackMaxWidth; } if (fallbackWidth) { img.setAttribute('_width', !isNaN(fallbackWidth * 1) ? fallbackWidth + 'px' : fallbackWidth); } if (typeof fallbackWidth === 'string' && fallbackWidth.indexOf('%') !== -1) { fallbackWidth = parseFloat(fallbackWidth.replace('%', ''), 10) / 100 * fallbackMaxWidth; } if (fallbackWidth === 'auto') { fallbackWidth = width_; if (width_ === 'auto' || !width_) { fallbackWidth = fallbackMaxWidth; } else { fallbackWidth = width_; } } var fallbackRes = /^(\d+(?:\.\d+)?)([a-zA-Z%]+)?$/.exec(fallbackWidth); var fallbackLastWidth = fallbackRes && fallbackRes.length >= 2 ? fallbackRes[1] : 0; var fallbackUnit = fallbackRes && fallbackRes.length >= 3 && fallbackRes[2] ? fallbackRes[2] : 'px'; setImgSize(img, fallbackLastWidth, fallbackUnit, imgRatio, true); img.classList.add(imgPlaceholderClass, "wx_img_placeholder"); continue; } img.classList.add(imgPlaceholderClass, "wx_img_placeholder"); } var parent_width = getParentWidth(img) || max_width; var init_width = img.style.width || img.getAttribute('width') || width_ || parent_width; init_width = parseFloat(init_width, 10) > max_width ? max_width : init_width; if (init_width === 'inherit') { init_width = parent_width; } if (init_width) { img.setAttribute('_width', !isNaN(init_width * 1) ? init_width + 'px' : init_width); } if (typeof init_width === 'string' && init_width.indexOf('%') !== -1) { setImgSize(img, width_, 'px', imgRatio, true); parent_width = getParentWidth(img) || max_width; init_width = parseFloat(init_width.replace('%', ''), 10) / 100 * parent_width; } if (init_width === 'auto') { init_width = width_; if (width_ === 'auto' || !width_) { init_width = parent_width; } else { init_width = width_; } } var res = /^(\d+(?:\.\d+)?)([a-zA-Z%]+)?$/.exec(init_width); width_num = res && res.length >= 2 ? res[1] : 0; width_unit = res && res.length >= 3 && res[2] ? res[2] : 'px'; var imgWidth = width_num; if (isCarton) { img.src = imgDataSrc; img.style.height = 'auto'; } else { setImgSize(img, imgWidth, width_unit, imgRatio, true); setImgSize(img, imgWidth, width_unit, imgRatio, false); } } if (!data.is_h5_render) { img.setAttribute('__sec_open_place_holder__', true); } } if (!bypassPreloading) init(); } var ua = navigator.userAgent; /mac\sos/i.test(ua) && !/(iPhone|iPad|iPod|iOS)/i.test(ua) || /windows\snt/i.test(ua); var images = document.getElementsByTagName('img'); var videos = []; var user_name = "gh_f24964232d76"; var isCartoonCopyright = '0'; var is_care_mode = ''; var createTimestamp = '1745885473'; var picturePageInfoList = "[{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRk5F0IsB1WHV5TyicqmrhQgyHZ4hyYcCAYHQico0v45ibgv7VjdACSicwug/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'328'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDREU1AibNGhrYhL2qW1LFMdEmzqvBRf8fkictAt43FmRD0IbCvNkBYb3Zw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'574'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRwseRbcW6Miay6XrCc7ERPFaaicJiaSRQibCialo23icLrj78NnYWVR9YAOTw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'308'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRFkbSSiawEUyBiaicrhtheETnbl1WXVoIBibiaOSr4omcUCV9JriawEbrM0jA/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'349'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRsmwyW4KhQiaWW8UPmY0eCngicZUgY1ice7micuoIADDBbU90KvnIG4JN6Q/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'451'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRAMEOQYB3zI16AmCoqzBAiaM8PKDdbVrGzsPgUI1mMLDIIpyqia722QJw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'320'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRyMg8DSCFZK6z2PK7IBNUPhxSTDHC6dFMykhmoszAYPjoc5u0PnnYdA/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'540'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRmwzUeAib1gkkFSIZRaVx9bLCwSfruAdCTPqU0QpRia2J1W9xdeNQWZdQ/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'316'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDR9DWugkj81JnvsW9bqxnTIsQFCKYnBmQBcxG4RVKbnhPTc1046l3bWw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'542'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRH7WDMmkDxZ6IAQmJ6pyYO7XRs5rH6B5uRSiaVjfia8qBLIr7kYVVyZJQ/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'362'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRIlgsDVGEH7Io9nr6UuTcvRC11IkxeWj8vfibdFUIGNlm0o2qgoG19Aw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'514'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRL42WVwrk5mDJia4VtrrRJiag3qzUV6WiaPtsCv69Qz28D3oMNwtmLzazg/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'318'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRZEbI6jYFNhiafic13QkibFFk0hcJwo18mTfduNa6KtU7GXlEr1O3JStqQ/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'421'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRBjSfZNt6BR24SgX9G2VfuqiahJmBibljFF7QxetqbibyoficbMibvz7l6AA/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'629'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRQIM0BFcCBX0TJGoNOxH0AFFxSvBzFjCtZgEkEbSaAsJlAkic95hFrvA/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'437'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRiaz62NZBr5eaSZWdXAwvvibzkWfuZeB3pMjy3kuexVhrvrIiaKEtHQAAg/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'657'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRSWArBEAt5ZxDC06ETfGIAHgSYMTRgVNVQlNE4Or8sibXqf7c3SVLtaQ/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'874','height':'132'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRfACKGGwzslud4ZvQxG7b4o3TXlgDlC0FsIoFrDcTy8Uo35rHChTuLQ/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'416'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRtTJSmWecHajwVWos39AJ2cI6eYerZ2015HP0sRo8icJ4vCmg1xXcrCA/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'261'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRV42At1OwmESw1fiaiabFLMUDNOMltibib5NFQHaF2bLnYDX8xIRZr6tsGw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'361'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDR2CqN8wx1IEes3pMEQfrmahnRYgMfVNWYtI6icV4aUNSdiaBpNaPicXFEw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'512'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRU73oR84Qnv5zO4vdec5xFiactHM0ibC6yspYbxbKbsCXmK67HOLmyZ0w/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'526'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDR0acsAorzvsr8iclIdILE5dic1CUqRm6fpydlGklGBicWbFT2KicDFMMTNw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'436'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRUw3ZuGRbNI5ticD83pCPia2VzlyYMcRqyX7Yxiceb5xiaFl9kbIZ5glGmw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'743'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRA0aKg1Ye9BzMDCcOOibYASJiayicRFbaIdEicso1elht12Uhibbg94jobfQ/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'197'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRqtsdn3Gl9P4IEVPTVK3KpeHNJ0nGKACg30bTI4glGoCgQyXFxbqSsw/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'553'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRBprRNlVv1xsdusWOgTIm8SdfSn2CYpwnU5eO70m061dnWH98s6k1xA/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'606'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRXiaIgdOcLfx0gWVkYu5BRbtsfX6U6icjaU4MJ2U3XngtRx6rR3ts0vsg/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'880','height':'436'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRgEozhSKhlsFSY4pGFes8I6JopdxxKhXs2G46EFToPKaNmsGGXHQIhQ/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'459'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_gif/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRk7mcpQ087VuhbPa5faYQp15syIu3iaLYyB2Aof09EoMtopzic66xiasibg/640?wx_fmt=gif\x26amp;amp;from=appmsg','width':'696','height':'750'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_gif/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRolpWKmib8A18icWBPNialncJ9tID6NyqsF07TjWUV7iaQbnUYTe250tsGQ/640?wx_fmt=gif\x26amp;amp;from=appmsg','width':'546','height':'720'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_svg/JiavaWZxX4YtuonHKajwDkVtJcqhraibUH1mvnCmSeG2FagGtLFIsLrnI63BgYctMRaL65kDgBjibIt56f4yjM8xZktOJh3m2qp/640?wx_fmt=svg\x26amp;amp;from=appmsg','width':'0','height':'0'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_gif/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRExuoZ1Jt2FlcCQ69rQAftLII1usnMPr08gO635SUiaukKjh2t0TOqOA/640?wx_fmt=gif\x26amp;amp;from=appmsg','width':'1000','height':'762'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_svg/JiavaWZxX4YtuonHKajwDkVtJcqhraibUH1mvnCmSeG2FagGtLFIsLrnI63BgYctMRaL65kDgBjibIt56f4yjM8xZktOJh3m2qp/640?wx_fmt=svg\x26amp;amp;from=appmsg','width':'0','height':'0'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_gif/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRaEUyfNibPW6ibxkA6lrTEibXbiaYyX1OS3Z17XUbXria4uCeSMqticHP4d4g/640?wx_fmt=gif\x26amp;amp;from=appmsg','width':'800','height':'1174'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_svg/JiavaWZxX4YtuonHKajwDkVtJcqhraibUH1mvnCmSeG2FagGtLFIsLrnI63BgYctMRaL65kDgBjibIt56f4yjM8xZktOJh3m2qp/640?wx_fmt=svg\x26amp;amp;from=appmsg','width':'0','height':'0'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDReLvVmvPiaOJWGUh4RgVnQcDm304yqapzUSpPOiaKXvFwzblNIe3gzD6g/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'537'},{'cdn_url':'https://mmbiz.qpic.cn/mmbiz_png/iceGibVicRfib5npic9eib1EKH16Fdf3K48dDRHZPI1ibuEiaTqV4LxMicyD7YO7uyDNJBlF8rDwTd3Ij5tBNIxia7PBzfUA/640?wx_fmt=png\x26amp;amp;from=appmsg','width':'1080','height':'327'},]"; picturePageInfoList = picturePageInfoList.includes(',]') ? picturePageInfoList.replace(',]', ']') : picturePageInfoList; try { picturePageInfoList = JSON.parse(picturePageInfoList.replace(/'/g, '"')); } catch (err) { picturePageInfoList = []; console.error(err); } var data = { is_h5_render: true, user_name: user_name, copyright_info: { is_cartoon_copyright: isCartoonCopyright }, picture_page_info_list: picturePageInfoList, create_timestamp: createTimestamp, user_info: { is_care_mode: is_care_mode } }; setSize(images, videos, data); })(); ', 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:not([data-cardtype="2"])', genId: function genId(opt) { return opt.node.getAttribute('data-windowproduct') || ''; }, calW: function calW() { var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (opt.node.getAttribute('data-cardtype') === "0") { return Math.min(opt.parentWidth, 400) * 1 || '100%'; } 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 = parseInt(height, 10); var ratio; if (opt.node.getAttribute('data-cardtype') === "0") { ratio = Math.min(400, opt.parentWidth) / 350.0 || 1; } else { 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: '
' }, { querySelector: 'mpcps:not([data-templateid="video-play"]),mp-common-cpsad:not([data-templateid="video-play"])', genId: function genId(opt) { var node = opt.node; var planId = node.getAttribute('data-planid'); var goodId = node.getAttribute('data-pid'); var traceId = node.getAttribute('data-traceid'); return goodId || planId || traceId || ''; }, calW: function calW() { var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var node = opt.node; var templateId = node.getAttribute('data-templateid'); var adType = node.getAttribute('data-adtype'); var width = 0; if (templateId === 'list') { width = '100%'; } else if (templateId === 'card') { if (adType === AD_CONFIG.CPS_GOODS_TYPE.SHORT_PLAY || adType === AD_CONFIG.CPS_GOODS_TYPE.MINI_GAME) { width = opt.parentWidth ? opt.parentWidth * 0.65 : '100%'; } else { width = '100%'; } } return width; }, calH: function calH(opt) { var node = opt.node; var templateId = node.getAttribute('data-templateid'); var adType = node.getAttribute('data-adtype'); var height = 0; if (templateId === 'list') { if (adType === AD_CONFIG.CPS_GOODS_TYPE.MINI_GAME) { height = 79; } else { height = 120; } } else if (templateId === 'card') { if (adType === AD_CONFIG.CPS_GOODS_TYPE.SHORT_PLAY) { var width = opt.parentWidth * 0.65; height = Math.ceil(width * (4 / 3)) + 68; } else if (adType === AD_CONFIG.CPS_GOODS_TYPE.MINI_GAME) { var _width = opt.parentWidth * 0.65; height = Math.ceil(_width * (4 / 3)) + 64; } else { height = Math.ceil(opt.parentWidth + 111); } } return height; }, replaceContentCssText: '', appendContentCssText: 'diplay:block;', outerContainerLeft: '
', outerContainerRight: '
' } ] }; function preloadingInit() { var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (typeof document.querySelectorAll !== 'function') { return; } var g = { maxWith: document.getElementById('img-content').getBoundingClientRect().width, idAttr: 'data-preloadingid' }; for (var i = 0, il = opt.config.length; i < il; i++) { var a = opt.config[i]; var list = document.querySelectorAll(a.querySelector); for (var j = 0, jl = list.length; j < jl; j++) { var node = list[j]; var parentWidth = node.parentNode.getBoundingClientRect().width; parentWidth = Math.min(parentWidth, g.maxWith); if (node.getAttribute('has-insert-preloading')) { continue; } var nodeW = a.calW({ parentWidth: parentWidth, node: node }); var nodeH = a.calH({ parentWidth: parentWidth, node: node }); var nodeId = a.genId({ index: j, node: node }); var nodeBorderRadius = typeof a.getBorderRadius === 'function' ? a.getBorderRadius({ index: j, node: node }) : 8; if (typeof nodeW === 'number') { nodeW += 'px'; } var imgHtml = opt.defaultContentTpl.replace(/#height#/g, nodeH).replace(/#width#/g, nodeW).replace(/#borderRadius#/g, nodeBorderRadius); var tmpNode = document.createElement('div'); tmpNode.innerHTML = imgHtml; if (a.replaceContentCssText) { var replaceContentCssText = a.replaceContentCssText.replace(/#height#/g, nodeH).replace(/#width#/g, nodeW); tmpNode.firstChild.style.cssText = replaceContentCssText; } else if (a.appendContentCssText) { tmpNode.firstChild.style.cssText += a.appendContentCssText; } var html = (a.outerContainerLeft || '') + tmpNode.innerHTML + (a.outerContainerRight || ''); tmpNode.innerHTML = html; tmpNode.firstChild.setAttribute(g.idAttr, nodeId); node.parentNode.insertBefore(tmpNode.firstChild, node.nextSibling); node.setAttribute('has-insert-preloading', '1'); } } } function lotteryPreloading() { Array.from(document.getElementsByTagName('mp-common-bluepacket')).forEach(function (ele) { ele.setAttribute('data-customstyle', JSON.stringify({ height: '112px' })); }); } function init() { preloadingInit(g); lotteryPreloading(); } init(); })();






请到「今天看啥」查看全文