首页 > 金融为民 > 新闻详情

【金融教育宣传周】非遗话消保·闽剧破局护权益

2025-09-17 来源:智慧海都

责任编辑: 管理员

相关推荐
文章不错,点个赞吧!
网友评论: 已有条评论
返回顶部
海峡都市报官网归海峡都市报社版权所有,未经海峡都市报社书面授权,
不得转载、摘编或以其他方式使用和传播,违者将依法追究法律责任。
[闽ICP备07502384号]
Copyright © 2022 海峡都市报社, All Rights Reserved
//评论 var laypage = layui.laypage; var util = layui.util var infoId = $("#infoId").val(); var form = layui.form; var token = $.cookie('token'); var cryptonymTf = 'off'; //设置默认为不匿名 $("#cryptonymTf").on('click', function () { if (cryptonymTf == 'on') { cryptonymTf = 'off' } else { cryptonymTf = 'on' } }) // $(document).ready(function(){ // $("#ip").val() // }) //提交 function sendCode(callback) { // debugger; // var ip =$("#ip").val() // console.log(789876,returnCitySN["cip"]) // var ip = returnCitySN["cip"]; // console.log(7777,ip); var validCode = $("#validCode").val() var content = $("#content").val() // var cryptonymTf = $("#cryptonymTf").val() // 评论新闻:在评论提交时请求,cryptonymTf(是否匿名:0否,1是) $.ajax({ url: BASE_URL + "/api-user/userReview/review?accessToken=" + token, type: 'post', data: { "content": content, "cryptonymTf": cryptonymTf == 'on' ? 1 : 0, "infoId": infoId, "deviceId": randCode, "validCode": validCode }, dataType: 'json', }).done(function (r) { form.val("myform", r.data); console.log("提交后", form.val("myform")) if (r.success) { layer.msg(r.msg || '未知错误', { time: 1500 }, function () { $('#content').val('');//清空输入框值 callback && callback(); }); } else { $('#randcodeimg').click(); //刷新验证码 $('#validCode').val(''); //清空输入框值 layer.msg(r.msg || '请求异常', { time: 1500 }, null); } }); return false; } form.on('submit(discussForm)', function (data) { openCodelayer(); return false; }); var loadInfo = function (pageNum) { $.ajax({ url: BASE_URL + "/api-information/news/reviewList", type: 'get', data: { infoId: infoId, pageNum: pageNum, pageSize: '5', }, dataType: 'json', }).done(function (r) { if (r.success) { console.log(r.data.total) var total = r.data.total var discussList = r.data.rows; var discussHtml = ''; discussList.forEach(function (element) { discussHtml += '
\ \
\ '+ element.mobile + '' + element.address + '\
'+ element.content + '
\
'+ util.toDateString(element.createTime, 'yyyy-MM-dd HH:mm') + '
\
\
'; // getTs(time); // var createTime = element.createTime // getDateDiff(createTime); }); $("#discussList").html(discussHtml); $("#discussNum").html(r.data.total); laypage.render({ elem: 'page', count: total, limit: 5, curr: pageNum, jump: function (obj, first) { if (!first) { loadInfo(obj.curr) } } }) } else { layer.msg(r.msg || '请求异常', { time: 1500 }, null); } }).fail(function (r) { layer.msg(r.msg || '请求失败', { time: 1500 }, null); }); } // function getTs(time) { // var arr = time.split(/[- :]/), // _date = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]), // timeStr = Date.parse(_date) // return timeStr // } // function getDateDiff(createTime) { // // 拿到当前时间戳和发布时的时间戳,然后得出时间戳差 // var curTime = new Date(); // var createTime = new Date(post_modified); // //部分浏览器不兼容此转换建议所以对此进行补充(指定调用自己定义的函数进行生成发布时间的时间戳) // //var timeDiff = curTime.getTime() - postTime.getTime(); // //上面一行代码可以换成以下(兼容性的解决) // var timeDiff = curTime.getTime() - getTs(post_modified); // // 单位换算 // var min = 60 * 1000; // var hour = min * 60; // var day = hour * 24; // var week = day * 7; // var month = week * 4; // var year = month * 12; // // 计算发布时间距离当前时间的周、天、时、分 // var exceedyear = Math.floor(timeDiff / year); // var exceedmonth = Math.floor(timeDiff / month); // var exceedWeek = Math.floor(timeDiff / week); // var exceedDay = Math.floor(timeDiff / day); // var exceedHour = Math.floor(timeDiff / hour); // var exceedMin = Math.floor(timeDiff / min); // // 最后判断时间差到底是属于哪个区间,然后return // if (exceedyear < 100 && exceedyear > 0) { // return '发表于' + exceedyear + '年前'; // } else { // if (exceedmonth < 12 && exceedmonth > 0) { // return exceedmonth + '月前'; // } else { // if (exceedWeek < 4 && exceedWeek > 0) { // return exceedWeek + '星期前'; // } else { // if (exceedDay < 7 && exceedDay > 0) { // return exceedDay + '天前'; // } else { // if (exceedHour < 24 && exceedHour > 0) { // return exceedHour + '小时前'; // } else { // if (exceedMin == 0) { // return '刚刚发表'; // } else { // return exceedMin + '分钟前'; // } // } // } // } // } // } // } /**打开验证码窗口**/ function openCodelayer() { var content = $("#content").val() if (!content) { layer.msg('评论内容不能为空!且不能超过150字', { time: 1000, }, function () { }) return false } var cryptonymTf = $("#cryptonymTf").val() layer.open({ title: '请填写验证码', //弹出层标题 type: 1, offset: '300px', content: '
\ \ \
', btn: ['确定', '关闭'], success: function () { randCode = Math.random() var imageUrl = BASE_URL + '/api-auth/validata/code/' + randCode $("#randcodeimg").attr("src", imageUrl) $("#randcodeimg").on('click', function () { randCode = Math.random() imageUrl = BASE_URL + '/api-auth/validata/code/' + randCode $("#randcodeimg").attr("src", imageUrl) }) }, yes: function (index, layero) { var validCode = layero.find("#validCode").val(); if (validCode == "" || validCode == undefined) { layer.msg('验证码不能为空!', { time: 1500 }, null); return false; } sendCode(function () { //输入验证码确定后执行的代码 loadInfo(1) //把第一页的刷新出来 btnTimer.SetTime("sendCode"); layer.close(index); //关闭弹出层 }) }, cancel: function () { } }); return false } //评论列表 function discuss() { loadInfo(); } $(function () { var classId = $("#className").val(); var infoId = $("#infoId").val(); discuss(); // 简单调试 - 页面加载后显示分享信息 setTimeout(function() { console.log('📱 页面加载完成,分享功能已就绪'); console.log('💡 如需调试,请在控制台输入:debugShare()'); // 全局调试函数 window.debugShare = debugShare; // 如果是微信环境,自动执行一次调试 if (navigator.userAgent.indexOf('MicroMessenger') > -1) { console.log('🔍 检测到微信环境,自动执行调试:'); debugShare(); } }, 1000); $.ajax({ url: BASE_URL + "/api-information/news/addNewsVisit", type: 'post', data: { classId: classId, infoId: infoId }, dataType: 'json', }).done(function (res) { var praiseTf = res.data.praiseTf if (praiseTf == 1) { $(".endorse--noendorse").hide().siblings().show() } }) //点赞新闻 var endorseCanClick = true $("#edor .endorse").on('click', function () { var self = this if (!endorseCanClick) return endorseCanClick = false $.ajax({ url: BASE_URL + "/api-information/userPraise/praise", type: 'post', data: { infoId: infoId }, dataType: 'json', success: function (formData) { console.log(formData); }, }) .done(function (res) { if (res.success) { $(self).hide().siblings(".endorse").show() $("#thankEndor").show().delay(1500).fadeOut(); $("#endorNum").hide(); setTimeout(function () { $("#endorNum").show(); }, 1500); if ($(self).hasClass("endorse--noendorse")) { layer.msg("点赞成功!", { time: 1500 }) } else { layer.msg("取消点赞成功", { time: 1500 }) } } else { layer.msg(r.msg || "异常", { time: 1500 }) } endorseCanClick = true }).fail(function () { endorseCanClick = true }); return false; }); }); //登录后进行评论 function logined(data) { //判断为登录后执行的方法 $("#discussLogin").hide().siblings().show() //已登录状态隐藏 登录并评论 按钮,显示 发送 按钮 } // 返回顶部 $(document).ready(function () { $(document).scroll(function () { var topbt = $(this).scrollTop(); if (topbt > 200) { $(".topb-modile").show() } else { $(".topb-modile").hide() } }) $(".topb-modile").click(function () { $('html , body').animate({ scrollTop: 0 }, 1000); }); });