bot.gif
取消
选择语言
确认
简体中文
繁体中文
English
close
正在加载
全部 数字货币专题 区块链专题 钱包专题 空投专题
空投专题
加密货币空投趋势分析:2024年五大空投项目的机遇与挑战​
摘要
2024年,加密货币空投成为开发者吸引用户的利器,其成功与否取决于代币分配策略及市场环境。 例如,Jupiter向早期用户空投了10亿JUP,推动了Solana生态的繁荣。 Starknet向130万个地址分发数亿美元,但STRK代币全年价格下跌75%,暴露出L2项目投资机会的饱和和缺乏杀手级应用的问题。 这些案例展现了代币分配策略对项目成败的关键作用,也反映了加密市场瞬息万变的特点。
@yiboyun6
更新时间: 2025-07-17 14:06
关注
</div> <!-- 打分 --> <!-- <div class="special_scoring"> <p>告诉我们您有多喜欢这篇文章!</p> <div class="scoring_img_box f-c-c"> <img src="/web-v2/img/special/difference.png" alt=""> <img src="/web-v2/img/special/commonly.png" alt=""> <img src="/web-v2/img/special/good.png" alt=""> <img src="/web-v2/img/special/better.png" alt=""> <img src="/web-v2/img/special/nice.png" alt=""> </div> <div class="scoring_vote_num">投票数:147</div> </div> --> <!-- 点赞收藏 --> <div class="special_option f-sb-c"> <div class="option_item f-c-c option_collect" onclick="collectArt()"> <img src="/web-v2/img/special/start.png" alt="" /> <div class="option_txt">收藏</div> <div class="collect_num num">0</div> </div> <div class="option_item f-c-c option_like" onclick="likeArt()"> <img src="/web-v2/img/special/like.png" alt="" /> <div class="option_txt">点赞</div> <div class="like_num num">0</div> </div> </div> <!-- 最新文章 --> <div class="latest_articles"> <div class="latest_articles_title">最新文章</div> <div class="latest_art_box"> <div class="swiper-container latest_art_container"> <div class="swiper-wrapper"> <a href="/news/116297862.html" class="latest_art_item swiper-slide" > <img src="http://img.528btc.com.cn/pro/2025-07-17/img/175273035200673j85jjb88h6j1456b91461bx0742396.jpg" class="latest_art_img" /> <div class="latest_art_title"> 纽约联储主席威廉姆斯称紧缩政策完全合适 </div> </a> <a href="/news/129297861.html" class="latest_art_item swiper-slide" > <img src="https://img.528btc.com.cn/2025/07/17/32ea0799e6afde50f3545182d09c0255.jpg?x-oss-process=image/watermark,image_MjAyNC93YXRlcm1hcmsucG5n" class="latest_art_img" /> <div class="latest_art_title"> 链上指标:比特币能否突破13万美元大关? </div> </a> <a href="/news/116297860.html" class="latest_art_item swiper-slide" > <img src="http://img.528btc.com.cn/pro/2025-07-17/img/17527298207680c590c32230ac60528c412ba166c8916.jpg" class="latest_art_img" /> <div class="latest_art_title"> 美国银行首席执行官表示,由于美国在关键加密货币规则上停滞不前,稳定币计划仍为时过早 </div> </a> </div> </div> <div class="swiper-pagination"></div> </div> </div> <!-- 上一篇下一篇 --> <div class="special_button_box f-sb-c"> <a class="special_button" href="/zhuanti/13410427.html" > <div class="special_button_txt"> 了解 <span> 空投 </span> 的知识 </div> <div class="special_button_title"> 深度解析:FDV和代币经济学如何影响空投代币价格 </div> <div class="button_box">上一篇</div> </a> <a class="special_button" href="/zhuanti/13410444.html" > <div class="special_button_txt"> 了解 <span> 空投 </span> 的知识 </div> <div class="special_button_title"> 空投数据全解析:DeFi、L2、NFT项目空投金额占比曝光​ </div> <div class="button_box">下一篇</div> </a> </div> <!-- 评论 --> <div class="comment_box"> <div class="comment_box_head f-fs-c"> <div class="comment_left">评论</div> <div class="comment_right"> 已发布 <span id="commentTotalNum"></span> 条 </div> </div> <div class="comment_push_box login_status_box"> <div class="comment_push_head f-fs-fs"> <img src="/web-v2/img/special/adv.jpg" alt="" class="comment_push_adv" id="userAdv" /> <div class="textarea_box"> <textarea id="pushText" class="comment_textarea" placeholder="说点什么~" ></textarea> <div class="comment_push_btn" onclick="pushComment();"> 发布评论 </div> </div> </div> </div> <div class="comment_push_box nologin_status_box" style="display: none"> <div class="comment_push_head f-fs-fs"> <img src="/web-v2/img/user.png" alt="" class="comment_push_adv" /> <div class="textarea_box"> <div class="comment_login_box f-c-c"> <div class="comment_login_btn" onclick="handleLoginH5()"> 登录 </div> <div class="comment_login_tips">评论你的想法~</div> </div> <div class="f-fe-fs"> <div class="comment_nologin_btn">发布评论</div> </div> </div> </div> </div> <div class="comment_list_box" id="commentList"></div> <div class="comment_nocomment_box">成为第一个评论的人</div> <div class="comment_more_box f-c-c" onclick="moreCommentList()"> 查看更多评论<img src="/web-v2/img/special/right_arrow.png" class="comment_more_icon" /> </div> <div class="comment_nomore_box">没有更多评论了</div> </div> <!-- 更多文章 --> <div class="more_special"> <div class="more_special_title">阅读更多专题</div> <!-- 展示的四篇文章 --> <div class="more_special_box"> <a class="more_special_item extend_special" href="/zhuanti/13410448.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/20250411/1744365148625934.png" alt="Hyperliquid空投创纪录,用户最高获利超10万美元!" class="special_cover" /> <!-- 标题 --> <div class="special_title"> Hyperliquid空投创纪录,用户最高获利超10万美元! </div> <!-- 文章 --> <div class="special_content"> ​Hyperliquid在2024年11月向用户空投了3100万枚HYPE代币,初始价值16亿美元,短短几周内飙升至超过108亿美元。本文详细介绍该空投的参与条件、分发机制及市场反响。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-11 17:49 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> <a class="more_special_item extend_special" href="/zhuanti/13410447.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/20250411/1744364862533201.png" alt="Binance HODLer空投新宠Bubblemaps上线,如何抢占先机?​" class="special_cover" /> <!-- 标题 --> <div class="special_title"> Binance HODLer空投新宠Bubblemaps上线,如何抢占先机?​ </div> <!-- 文章 --> <div class="special_content"> ​Binance HODLer空投计划最新项目Bubblemaps(BMT)已上线,4000万枚代币无锁仓即时交易。本文解析BMT的技术优势、空投规则及参与策略,助您把握投资良机。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-11 17:45 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> <a class="more_special_item extend_special" href="/zhuanti/13410446.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/20250411/1744364639942638.png" alt="加密货币空投的未来:技术进步与用户参与的结合" class="special_cover" /> <!-- 标题 --> <div class="special_title"> 加密货币空投的未来:技术进步与用户参与的结合 </div> <!-- 文章 --> <div class="special_content"> 随着区块链技术的不断进步,加密货币空投也在不断演化。项目方通过结合先进技术和用户参与机制,提升空投的精准性、公平性和社区粘性,不仅增强了用户体验,也为项目增长注入了新的活力。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-11 17:39 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> <a class="more_special_item extend_special" href="/zhuanti/13410445.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/20250411/1744364287955364.png" alt="加密货币空投新趋势:从简单赠送到复杂任务的演变" class="special_cover" /> <!-- 标题 --> <div class="special_title"> 加密货币空投新趋势:从简单赠送到复杂任务的演变 </div> <!-- 文章 --> <div class="special_content"> 随着加密市场的发展,空投策略也在不断演变。​从最初的简单赠送代币到现在的复杂任务和积分系统,项目方通过多样化的方式吸引用户参与。​本文将探讨这种趋势的演变及其对用户和市场的影响。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-11 17:36 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> <a class="more_special_item extend_special" href="/zhuanti/13410444.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/20250411/1744363720645388.png" alt="空投数据全解析:DeFi、L2、NFT项目空投金额占比曝光​" class="special_cover" /> <!-- 标题 --> <div class="special_title"> 空投数据全解析:DeFi、L2、NFT项目空投金额占比曝光​ </div> <!-- 文章 --> <div class="special_content"> 根据Dropstab的链上分析,2024年通过一系列空投活动,各项目向加密用户发放了149.1亿美元。 其中,42.2亿美元(28.3%)用于二层项目,33.1亿美元(22.2%)用于去中心化金融(DeFi)项目,26.3亿美元(17.6%)用于一层项目。 此外,游戏和迷因币、流动质押以及人工智能(AI)项目分别发放了价值22.8亿美元、12.7亿美元和3.73亿美元的代币,展示了空投在不同领域的广泛应用。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-11 17:24 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> <a class="more_special_item extend_special" href="/zhuanti/13410427.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/20250410/1744287070639927.png" alt="深度解析:FDV和代币经济学如何影响空投代币价格" class="special_cover" /> <!-- 标题 --> <div class="special_title"> 深度解析:FDV和代币经济学如何影响空投代币价格 </div> <!-- 文章 --> <div class="special_content"> 探讨全流通市值(FDV)和代币经济学对空投代币价格的影响,分析高FDV、低流通量代币可能带来的估值偏差。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-10 20:05 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> <a class="more_special_item extend_special" href="/zhuanti/13410426.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/2025-04-10/b5a7b4dec27c8b5535407eec430f9535.png" alt="加密货币融资新纪元:从ICO到空投的演变与未来趋势" class="special_cover" /> <!-- 标题 --> <div class="special_title"> 加密货币融资新纪元:从ICO到空投的演变与未来趋势 </div> <!-- 文章 --> <div class="special_content"> 探讨加密货币如何重构现代金融融资策略,分析首次代币发行(ICO)与空投等方式的优势,并提出优化空投设计的机制。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-10 20:01 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> <a class="more_special_item extend_special" href="/zhuanti/13410425.html" > <!-- 封面 --> <img src="https://www.528btc.com/d/file/20250410/1744286425541065.png" alt="Web3时代的空投:如何通过空投赚取收益并参与新兴加密项目" class="special_cover" /> <!-- 标题 --> <div class="special_title"> Web3时代的空投:如何通过空投赚取收益并参与新兴加密项目 </div> <!-- 文章 --> <div class="special_content"> Web3时代的加密货币项目越来越依赖空投作为用户吸引的工具。2024年,多个Web3项目通过空投为用户带来丰厚奖励,从去中心化应用(dApp)到新的代币发放,用户只需参与简单的任务、质押或推荐,即可获得免费代币。本文将深入探讨如何通过参与这些空投活动来赚取收益,以及空投在新兴加密项目中的重要作用。了解空投的规则和技巧,让你在Web3时代的加密世界中占得先机。 </div> <!-- 作者 --> <div class="special_bottom f-sb-c"> <div class="special_list_author"> 2025-04-10 19:56 </div> <div class="special_list_tab"> 空投专题 </div> </div> </a> </div> <div class="more_recommendations"> 还有 32586篇更精彩 </div> <div class="more_recommendations_btn">继续阅读更多专题</div> </div> </div> </body> <script> document.addEventListener("DOMContentLoaded", () => { const aiBtn = document.querySelector(".ai_btn"); // 速看按钮 const aiContent = document.querySelector(".ai_content"); // 包含内容的容器 const titleRight = document.querySelector(".ai_title_right"); // 收起按钮 const aiDetails = document.querySelector("#ai-details"); // 动态插入内容的容器 const abstractDetailsAi = document.querySelector(".Abstract_details_ai"); // 顶部速看容器 const smallText = `[!--ai_intro--]`; console.log(smallText, "smallText"); const tempElement = document.createElement("div"); // 清理和提取 smallText 中的纯文本 tempElement.innerHTML = smallText; const cleanText = tempElement.textContent.trim(); // 去掉首尾空格 let animationCompleted = false; // 标记动画是否完成 if (!smallText || smallText.trim() === "") { if (abstractDetailsAi) { abstractDetailsAi.style.display = "none"; // 隐藏 .Abstract_details_ai } } else { if (abstractDetailsAi) { abstractDetailsAi.style.display = "flex"; // 隐藏 .Abstract_details_ai } } if ( !aiBtn || !aiContent || !titleRight || !aiDetails || !abstractDetailsAi ) { return; } // 逐字动画函数 function typeWriterEffect(content, element, callback) { element.innerHTML = ""; // 清空内容 let index = 0; const interval = setInterval(() => { if (index < content.length) { element.innerHTML += content[index++]; // 逐字插入到元素中 } else { clearInterval(interval); // 停止动画 animationCompleted = true; // 标记动画完成 titleRight.style.pointerEvents = "auto"; // 启用收起按钮 if (callback) callback(); // 动画完成后的回调 } }, 50); // 每50ms显示一个字符 } // 点击“速看”按钮 aiBtn.addEventListener("click", () => { abstractDetailsAi.style.display = "none"; // 隐藏顶部速看容器 aiContent.style.display = "block"; // 显示 ai_content if (!animationCompleted) { titleRight.style.pointerEvents = "none"; // 禁用收起按钮 typeWriterEffect(cleanText, aiDetails, () => { // console.log("动画完成"); }); } else { aiDetails.innerHTML = cleanText; // 直接显示完整内容 } }); // 点击“收起”按钮 titleRight.addEventListener("click", () => { if (animationCompleted) { aiContent.style.display = "none"; // 隐藏内容 abstractDetailsAi.style.display = "flex"; // 恢复顶部速看容器 } }); }); </script> <!-- 公共 --> <script> let commentLoginStatus = false; let commentList = $('#commentList'); function isLogin() { let url = '/e/extend/api/index.php?m=v2&c=app' $.ajax({ url: url, data: { action: "getUserInfo", data: {}, }, type: 'POST', success: function (res) { let resData = JSON.parse(res) commentLoginStatus = resData.data != ""; if (commentLoginStatus) { $('.login_status_box').show(); $('.nologin_status_box').hide(); $('#userAdv').attr('src', resData.data.header); getFollowStatus(); } else { $('.login_status_box').hide(); $('.nologin_status_box').show(); } }, error: function (e) { console.log('resdata e', e); } }) } $(document).ready(function () { isLogin(); var myArtSwiper = new Swiper('.latest_art_container', { slidesPerView: 1, centeredSlides: true, // active slide 居中 // 设置指示器 pagination: { el: '.swiper-pagination', clickable: true, // 允许点击小点进行切换 }, }); }) let categoryId = 134; if (categoryId == '131') { $(".special_tab_box").scrollLeft(400); } if (categoryId == '134') { $(".special_tab_box").scrollLeft(500); } </script> <!-- 关注作者 --> <script> let followStatus = false; function getFollowStatus() { let id = 114; $.ajax({ url: "/e/extend/api/index.php?m=user&c=followStatus", type: 'post', data: JSON.stringify({ ids: [id], }), success: function (res) { if (res.code === 200) { followStatus = res.data[id].status; if (followStatus) { $('.special_follow_btn').hide(); $('.special_unfollow_btn').show(); } else { $('.special_follow_btn').show(); $('.special_unfollow_btn').hide(); } } }, error: function (err) { console.error("请求失败:", err); }, }); } function followAuthor() { let id = 114; $.ajax({ url: "/e/extend/api/index.php?m=user&c=follow", type: 'post', data: JSON.stringify({ id: id, status: !followStatus, }), success: function (res) { if (res.code === 200) { followStatus = !followStatus if (followStatus) { $('.special_follow_btn').hide(); $('.special_unfollow_btn').show(); } else { $('.special_follow_btn').show(); $('.special_unfollow_btn').hide(); } layer.msg('操作成功', { icon: 1 }) } }, error: function (err) { console.error("请求失败:", err); }, }); } </script> <!-- 文章详情相关 --> <script> // 点赞收藏状态数量 let specialLikeSatus = false; let specialCollected = false; let collectNum = 0; let likeNum = 0; requestOptions(); function requestOptions() { let id = "10443"; $.ajax({ url: "/e/extend/api/index.php?m=news&c=listData", type: "post", data: JSON.stringify({ ids: [id], type: 4, }), success: function (res) { if (res.code === 200) { listData = res.data[id]; $(".special_option .collect_num").html(listData.collectCount); $(".special_option .like_num").html(listData.likeCount); specialLikeSatus = listData.isLiked; specialCollected = listData.isCollected; collectNum = listData.collectCount; likeNum = listData.likeCount; if (listData.isCollected) { $(".special_option .option_collect").addClass("active"); } else { $(".special_option .option_collect").removeClass("active"); } if (listData.isLiked) { $(".special_option .option_like").addClass("active"); } else { $(".special_option .option_like").removeClass("active"); } } }, error: function (err) { console.error("请求失败:", err); }, }); } // 收藏 function collectArt() { let id = "10443"; $.ajax({ url: "/e/extend/api/index.php?m=user&c=collect", type: "post", data: JSON.stringify({ id: id, status: !specialCollected, type: 4, }), success: function (res) { if (res.code == 200) { specialCollected = !specialCollected; let currentNum = specialCollected ? collectNum + 1 : collectNum - 1; collectNum = currentNum; $(".special_option .collect_num").html(currentNum); if (specialCollected) { $(".special_option .option_collect").addClass("active"); } else { $(".special_option .option_collect").removeClass("active"); } layer.msg("操作成功", { icon: 1 }); } }, error: function (err) { console.error("请求失败:", err); }, }); } // 点赞 function likeArt() { let id = "10443"; $.ajax({ url: "/e/extend/api/index.php?m=user&c=like", type: "post", data: JSON.stringify({ id: id, status: !specialLikeSatus, type: 4, }), success: function (res) { if (res.code == 200) { specialLikeSatus = !specialLikeSatus; let currentNum = specialLikeSatus ? likeNum + 1 : likeNum - 1; likeNum = currentNum; $(".special_option .like_num").html(currentNum); if (specialLikeSatus) { $(".special_option .option_like").addClass("active"); } else { $(".special_option .option_like").removeClass("active"); } layer.msg("操作成功", { icon: 1 }); } }, error: function (err) { console.error("请求失败:", err); }, }); } </script> <!-- 评论相关 --> <script> // 获取评论列表 let commentPage = 0; let pid; let commentTotal = 0; let allCommentConut = 0; let allCommentList = []; let pageSize = 5; getCommentList(); function getCommentList() { $(".comment_nomore_box").hide(); $(".comment_more_box").hide(); let id = "10443"; commentPage++; $.ajax({ url: `/e/extend/api/index.php?m=comment&c=list&id=${id}&pageSize=${pageSize}&page=${commentPage}&type=4&subpageSize=5`, type: "GET", success: function (res) { if (res.code === 200) { commentTotal = res.data.total; allCommentConut = res.data.count; $("#commentTotalNum").html(allCommentConut); $(".op_b_comment .op_bottom_num").html(allCommentConut); if (commentPage == 1) { //首次加载判断有没有评论 if (res.data.list.length > 0) { commentList.show(); $(".comment_nocomment_box").hide(); commentListShow(res.data.list); } else { commentList.hide(); $(".comment_nocomment_box").show(); } //首次加载判断有没有更多 if (res.data.total > 5) { $(".comment_more_box").css("display", "flex"); } else if (res.data.total > 0 && res.data.total < 5) { $(".comment_nomore_box").show(); } else { $(".comment_more_box").hide(); $(".comment_nomore_box").hide(); } } else { commentListShow(res.data.list); } } }, error: function (err) { console.error("请求失败:", err); }, }); } //处理评论列表逻辑 function commentListShow(list) { if (commentPage == 1) { commentList.empty(); } $.each(list, function (index, item) { allCommentList.push(item); let html = ` <div class="comment_list_item f-fs-fs" data-id="${item.id}" > <img src="${item.avatar}" class="comment_list_adv"> <div class="comment_item" id="CommentList_${item.id}"> <div class="comment_item_head f-fs-c"> <div class="comment_username f-fs-c"> <div class="username">${item.username}</div> <div class="comment_author" style="display:${ item.isAuthor ? "bolck" : "none" }">作者</div> </div> <div class="comment_item_time">${timeAgo( dayjs(item.created_at).valueOf() )}</div> </div> <div class="comment_item_content"> ${item.content} </div> <div class="comment_item_bottom f-sb-c"> <div class="comment_reply father_reply f-c-c">回复</div> <div class="comment_option_box f-fs-c"> <img src="/web-v2/img/special/${ item.isLiked ? "comment_like" : "like_comment" }.png" class="comment_like_icon fatherlike" data-status="${ item.isLiked }"> <div class="comment_likenum">${ item.likeCount }</div> </div> </div> <div class="reply_comment_box"> <textarea class="replay_textarea" placeholder="回复:" ></textarea> <div class="reply_btn_box f-fe-fs"> <div class="ready_btn">回复</div> </div> </div> <div class="comment_subitem_list" style="display:${ item.sub.total ? "bolck" : "none" }" id="subCommentList_${item.id}"> </div> </div> </div> `; commentList.append(html); if (item.sub.list && item.sub.list.length > 0) { let list = item.sub.list; $.each(list, function (subIdx, subItem) { let html = ` <div class="subitem_box f-fs-fs" data-id="${ subItem.id }"> <img src="${subItem.avatar}" class="subitem_adv"> <div class="comment_subitem"> <div class="comment_subitem_head f-fs-c"> <div class="subitem_username f-fs-c"> <div class="username">${ subItem.username }</div> <div class="subitem_author" style="display:${ subItem.isAuthor ? "block" : "none" }">作者</div> <div class="reply" style="display:${ subItem.commentTo ? "block" : "none" }">回复</div> <div class="username" style="display:${ subItem.commentTo ? "block" : "none" }">${subItem.commentTo}</div> </div> <div class="comment_subitem_time">${timeAgo( dayjs(subItem.created_at).valueOf() )}</div> </div> <div class="comment_subitem_content"> ${subItem.content} </div> <div class="comment_item_bottom f-sb-c"> <div class="comment_reply sub_replay f-c-c">回复</div> <div class="comment_option_box f-fs-c"> <img src="/web-v2/img/special/${ subItem.isLiked ? "comment_like" : "like_comment" }.png" class="comment_like_icon sublike" data-status="${ subItem.isLiked }"> <div class="comment_likenum">${ subItem.likeCount }</div> </div> </div> <div class="subreply_comment_box"> <textarea class="subreplay_textarea" placeholder="回复:" ></textarea> <div class="subreply_btn_box f-fe-fs"> <div class="subready_btn">回复</div> </div> </div> </div> </div> `; $(`#subCommentList_${item.id}`).append(html); }); } if (item.sub.total > 5) { let moreHtml = ` <div class="show_more_btn">展开更多评论</div>`; $(`#CommentList_${item.id}`).append(moreHtml); } }); if (commentPage > 1) { if (commentTotal == allCommentList.length) { $(".comment_more_box").hide(); $(".comment_nomore_box").show(); } else { $(".comment_more_box").css("display", "flex"); $(".comment_nomore_box").hide(); } } } //时间戳处理 function timeAgo(timestamp) { const now = new Date().getTime(); const then = new Date(timestamp).getTime(); const diff = now - then; const seconds = Math.floor(diff / 1000); const minutes = Math.floor(seconds / 60); const hours = Math.floor(minutes / 60); const days = Math.floor(hours / 24); if (seconds < 60) { return "刚刚"; } else if (minutes < 60) { return `${minutes}分钟前`; } else if (hours < 24) { return `${hours}小时前`; } else { const date = new Date(timestamp); const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, "0"); const day = String(date.getDate()).padStart(2, "0"); return `${year}-${month}-${day}`; } } //展开更多回复 let pageListMap = new Map(); $(document).on("click", ".show_more_btn", function () { const parentComment = $(this).closest(".comment_list_item"); // 获取当前评论项 pid = parentComment.data("id"); // 获取评论的ID let _this = $(this); //存入每一个评论的子回复页数 let page; if (!pageListMap.get(pid)) { page = 1; pageListMap.set(pid, page); } else { page = pageListMap.get(pid); } let id = "10443"; page++; pageListMap.set(pid, page); $.ajax({ url: `/e/extend/api/index.php?m=comment&c=list&pid=${pid}&subpageSize=5&page=${page}&type=4`, type: "GET", success: function (res) { let list = res.data.list; let maxPage = Math.ceil(res.data.total / 5); $.each(list, function (subIdx, subItem) { let html = ` <div class="subitem_box f-fs-fs" data-id="${ subItem.id }"> <img src="${subItem.avatar}" class="subitem_adv"> <div class="comment_subitem"> <div class="comment_subitem_head f-fs-c"> <div class="subitem_username f-fs-c"> <div class="username">${ subItem.username }</div> <div class="subitem_author" style="display:${ subItem.isAuthor ? "block" : "none" }">作者</div> <div class="reply" style="display:${ subItem.commentTo ? "block" : "none" }">回复</div> <div class="username" style="display:${ subItem.commentTo ? "block" : "none" }">${subItem.commentTo}</div> </div> <div class="comment_subitem_time">${timeAgo( dayjs(subItem.created_at).valueOf() )}</div> </div> <div class="comment_subitem_content"> ${subItem.content} </div> <div class="comment_item_bottom f-sb-c"> <div class="comment_reply sub_replay f-c-c">回复</div> <div class="comment_option_box f-fs-c"> <img src="/web-v2/img/special/${ subItem.isLiked ? "comment_like" : "like_comment" }.png" class="comment_like_icon sublike" data-status="${ subItem.isLiked }"> <div class="comment_likenum">${ subItem.likeCount }</div> </div> </div> <div class="subreply_comment_box"> <textarea class="subreplay_textarea" placeholder="回复:" ></textarea> <div class="subreply_btn_box f-fe-fs"> <div class="subready_btn">回复</div> </div> </div> </div> </div> `; $(`#subCommentList_${pid}`).append(html); }); if (page >= maxPage) { _this.remove(); } }, error: function (err) { console.error("请求失败:", err); }, }); console.log(pid); }); //发表评论 function pushComment() { const commentText = $("#pushText").val(); if (!commentText) { layer.msg("请输入内容", { icon: 2 }); return; } let id = "10443"; $.ajax({ url: "/e/extend/api/index.php?m=comment&c=add", type: "post", data: JSON.stringify({ id: id, type: 4, content: commentText, }), success: function (res) { if (res.code === 200) { commentPage = 0; allCommentList = []; commentList.empty(); $("#pushText").val(""); layer.msg("评论成功", { icon: 1 }); getCommentList(); } }, error: function (err) { console.error("请求失败:", err); }, }); } //点击评论按钮 $(document).on("click", ".father_reply", function () { if (!commentLoginStatus) { handleLoginH5(); return; } const parentComment = $(this).closest(".comment_list_item"); // 获取当前评论项 parentComment.find(".reply_comment_box").show(); const replyUsername = parentComment .find(".comment_item_head .username") .text(); // 获取主评论的用户名 parentComment .find(".replay_textarea") .attr("placeholder", `回复 ${replyUsername}:`); pid = parentComment.data("id"); // 获取评论的ID }); function subPushComment(commentText, commentPid) { $.ajax({ url: "/e/extend/api/index.php?m=comment&c=add", type: "post", data: JSON.stringify({ pid: commentPid, type: 4, content: commentText, }), success: function (res) { if (res.code === 200) { pageSize = allCommentList.length < 5 ? 5 : allCommentList.length; allCommentList = []; commentPage = 0; layer.msg("评论成功", { icon: 1 }); pageListMap.clear(); getCommentList(); } }, error: function (err) { console.error("请求失败:", err); }, }); } //回复一级评论 $(document).on("click", ".ready_btn", function () { if (!commentLoginStatus) { handleLoginH5(); return; } const parentComment = $(this).closest(".comment_list_item"); // 获取当前评论项 let commentPid = parentComment.data("id"); // 获取评论的ID const commentText = parentComment.find(".replay_textarea").val(); // 获取评论内容 console.log("commentText", commentText); if (!commentText) { layer.msg("请输入内容", { icon: 2 }); return; } subPushComment(commentText, commentPid); }); //二级评论按钮 $(document).on("click", ".sub_replay", function () { if (!commentLoginStatus) { handleLoginH5(); return; } const parentComment = $(this).closest(".subitem_box"); // 获取当前评论项 parentComment.find(".subreply_comment_box").show(); const replyUsername = parentComment .find(".comment_subitem_head .username:first") .text(); // 获取主评论的用户名 parentComment .find(".subreplay_textarea") .attr("placeholder", `回复 ${replyUsername}:`); }); //回复二级评论 $(document).on("click", ".subready_btn", function () { if (!commentLoginStatus) { handleLoginH5(); return; } const parentComment = $(this).closest(".subitem_box"); // 获取当前评论项 let commentPid = parentComment.data("id"); // 获取评论的ID const commentText = parentComment.find(".subreplay_textarea").val(); // 获取评论内容 console.log("commentText", commentText); if (!commentText) { layer.msg("请输入内容", { icon: 2 }); return; } subPushComment(commentText, commentPid); }); // 点赞 function likeCommentOption(id, status) { $.ajax({ url: "/e/extend/api/index.php?m=comment&c=like", type: "post", data: JSON.stringify({ id: id, status: !status, }), success: function (res) { if (res.code === 200) { allCommentList.length < 5 ? 5 : allCommentList.length; allCommentList = []; commentPage = 0; layer.msg("操作成功", { icon: 1 }); pageListMap.clear(); getCommentList(); } }, error: function (err) { console.error("请求失败:", err); }, }); } //一级评论点赞 $(document).on("click", ".fatherlike", function () { if (!commentLoginStatus) { handleLoginH5(); return; } const parentComment = $(this).closest(".comment_list_item"); // 获取当前评论项 let commentPid = parentComment.data("id"); // 获取评论的ID let status = $(this).data("status"); likeCommentOption(commentPid, status); }); //二级评论点赞 $(document).on("click", ".sublike", function () { if (!commentLoginStatus) { handleLoginH5(); return; } const parentComment = $(this).closest(".subitem_box"); // 获取当前评论项 let commentPid = parentComment.data("id"); // 获取评论的ID let status = $(this).data("status"); likeCommentOption(commentPid, status); }); //获取更多评论 function moreCommentList() { // pageSize = 5; getCommentList(); } </script> <!-- 跳转更多专题 --> <script> let firstSumbit = true; $(".more_recommendations_btn").click(function () { if (firstSumbit) { firstSumbit = false; $(".more_special_item").removeClass("extend_special"); $(".more_recommendations_btn").html("返回专题首页"); $(".more_recommendations").html("百万币友都在看"); } else { window.location.href = "/zhuanti/"; } }); </script> </html>