PageSourceSearch

https://www.starmask.cn/js/web.js

js starmask.cn collected 2026-10-04 18:54:57 UTC 15,307 bytes, 325 lines download raw bytes

1function layeralert(title, text) { layui.use('layer', function () { var layer = layui.layer; layer.open({ title: title, content: text }) }) }
2function layeralert2(title, text, url) { layui.use('layer', function () { var layer = layui.layer; layer.open({ title: title, content: text, yes: function () { linkto(url); } }) }) }
3
4var emailRule = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
5var phoneRule = /^(13|14|15|16|17|18|19)[0-9]{9}$/;
6var telRule = /^0\d{2,3}-?\d{7,8}$/;
7
8
9function linkto(url) { location.href = url; }
10
11
12
13function buildding() {
14    layeralert("提示", "此项暂未上传附件!");
15}
16
17
18function addbookvisit() {
19    var name = $("#names1").val();
20    var tel = $("#Tel1").val();
21    var time = $("#Intro1").val();
22   var codeval = $("#codeval").val();
23    if (name == "") {
24        layeralert("提示", "请输入您的姓名!");
25        return
26    }
27
28    if (tel == "") {
29        layeralert("提示", "请输入您的手机号码!");
30        return
31    }
32
33    if (!phoneRule.test(tel) && !telRule.test(tel)) {
34        layeralert("提示", "您提交的手机号码有误!");
35        return
36    }
37
38    if (time == "") {
39        layeralert("提示", "请输入您的留言内容!");
40        return
41    }
42    
43    if (codeval == "") {
44       
45        layeralert("提示", "请输入验证码!");
46        document.getElementById("codeval").focus();
47        return false;
48    }
49
50    if (!(codeval == getCookie("CheckCode"))) {
51        layeralert("提示", "验证码不正确!");
52        $("#codeval").val("");
53        return false;
54    }
55
56
57    
58    $.ajax({
59        type: "post",
60
61        url: "/AjaxAction/tj.ashx?action=recruit&name=" + $("#names1").val() + "&Tel=" + $("#Tel1").val() + "&comname=" + $("#comname").val() + "&Intro=" + $("#Intro1").val(),
62        data: "",
63        success: function (data) {
64
65            if (data == "1") {
66                layeralert("提示", "恭喜,您的留言已提交成功,我们会尽快联系您");
67
68                setTimeout("location.href = document.URL", 1000);//延时2秒
69            }
70            else {
71                layeralert("提示", "抱歉,您的留言提交失败,请重新尝试!");
72            }
73        }
74
75    });
76
77}
78
79function getCookie(str){
80    var tmp,reg=new RegExp("(^| )"+str+"=([^;]*)(;|$)","gi");
81    if(tmp=reg.exec(document.cookie))return(tmp[2]);
82    return null;
83}
84function setCookie(cookieName,cookieValue,DayValue)
85{
86    var expire = "";
87    var day_value=1;
88    if(DayValue!=null)
89    {
90        day_value=DayValue;
91    }
92    expire = new Date((new Date()).getTime() + day_value * 864000000);
93    expire = "; expires=" + expire.toGMTString();
94    document.cookie =  cookieName + "=" + cookieValue +";path=/"+ expire;
95}
96
97function delCookie(cookieName)
98{
99    var expire = "";
100    expire = new Date((new Date()).getTime() - 1 );
101    expire = "; expires=" + expire.toGMTString();
102    document.cookie = cookieName + "=" + escape("") +";path=/"+ expire;
103    //path=/
104}
105
106
107
108
109
110
111$(function () {
112    $("#searchval_").keyup(function (event) {
113        if (event.keyCode == 13) {
114            window.location.href = "/search.html?k=" + $("#searchval_").val();
115        }
116    })
117    $("#search_").click(function () {
118        window.location.href = "/search.html?k=" + $("#searchval_").val();
119    })
120})
121
122
123function demand() {
124    var cods = $("#cods").val();
125    if (cods == "") {
126        layeralert("提示", "请输入核验码!");
127        return
128    }
129   
130    $(".resultBox").hide();
131    $.ajax({
132        type: "post",
133        dataType: "json",
134        url: "/AjaxAction/demand.ashx?cods=" + $("#cods").val(),
135        data: "",
136        success: function (data) {
137          
138          //  layeralert("提示", "" + JSON.stringify(data) + "");
139            if (data==0) {
140              
141                layeralert("提示", "核验码已失效或不存在,请输入正确的核验码");
142            }
143            else{
144                var evidence = data.evidence, shareInfo = data.shareInfo;
145                var blockInfo = evidence.blockInfo, history = evidence.history;
146                var types = evidence.type;//存证形式
147                console.log()
148
149                if (types == "TextEvidence") {
150                    types = "文本存证";
151                    $(".nofile").show()
152                    $(".file").hide()
153                    $(".resultPart4.nofile .l7Div textarea").html(evidence.content)
154                    //文本核验按钮事件
155                    //$(".btnGroup .checkBtn a").click(function () {
156                    //    checkcontent()
157                    //})
158                    $("#checkBtn").click(function () {
159                        checkcontent()
160                    })
161                }
162                else {
163                    types = "文件存证";
164                    $(".file").show()
165                    $(".nofile").hide()
166                    if (evidence.persist == true && evidence.downloadUrl != undefined) {
167                        $(".resultPart4.file").show()
168                        $(".resultPart4.file .boxbox .name").html(evidence.fileName)
169                       // $(".resultPart4.file .boxbox .btnDiv a").attr("href", evidence.downloadUrl)
170                        $(".resultPart4.file .boxbox .btnDiv").html("<a href='"+evidence.downloadUrl+"' download=\"\" > <img src='/images/nimg26_5.png' alt=''>下载</a>")
171                    } else {
172                        $(".resultPart4.file").hide()
173                    }
174                    //文件核验按钮事件
175                    //$(".btnGroup .checkBtn a").click(function () {
176                    //    checkfile()
177                    //});
178                    $("#checkBtn").click(function () {
179                        checkfile()
180                    })
181                }
182                //存证信息
183                document.getElementById("times").innerHTML = "<img src=\"/images/nimg14_2.jpg\">该存证分享于" + transformTimestamp(shareInfo.createdAt) + ",区块高度为" + blockInfo.height+"。";//分享时间 高度
184                document.getElementById("evidenceId").innerHTML = "" + evidence.evidenceId + "  <div class=\"lalala\"><img src=\"/images/nimg14_22.png\"><div class=\"layer2\"><div class=\"con\">存证内容存储成功后,产生的唯一编号。</div><div class=\"bg\"></div> </div></div>";//存证编号
185                document.getElementById("title").innerHTML = evidence.title;//存证名称
186                document.getElementById("createdBy").innerHTML = evidence.createdBy.substring(evidence.createdBy.indexOf("#")+1);//用户ID
187                document.getElementById("type").innerHTML = "" + types + "";//存证类型
188
189                //区块信息
190                document.getElementById("dataHash").innerHTML = "" + evidence.dataHash+ "";//存证哈希
191                document.getElementById("createdAt").innerHTML = transformTimestamp(evidence.createdAt);//存证时间
192                //var qukai = null;
193                //qukai = data[0].blockInfo;
194                //alert(qukai);
195
196                $("#height").html(""+blockInfo.height+"   <div class=\"lalala\"><img src=\"/images/nimg14_22.png\"><div class=\"layer2\"><div class=\"con\">该存证创建分享链接时所在区块的高度。</div><div class=\"bg\"></div> </div></div>")
197                $("#submittedAt").html(transformTimestamp(evidence.submittedAt))
198                $("#blockHash").html(""+blockInfo.blockHash+"   <div class=\"lalala\"><img src=\"/images/nimg14_22.png\"><div class=\"layer2\"><div class=\"con\">该存证所在区块的哈希值,区块哈希不可篡改。</div><div class=\"bg\"></div> </div></div>")
199                $("#dataHasht").html(""+evidence.dataHash+"   <div class=\"lalala\"><img src=\"/images/nimg14_22.png\"><div class=\"layer2\"><div class=\"con\">根据存证内容计算出的哈希值,该哈希值存储在区块链上,不可篡改。</div><div class=\"bg\"></div> </div></div>")
200                $("#dataHash").html(evidence.dataHash)
201                
202                if (history != undefined && history.length > 0) {
203                    $(".resultPart3").show();
204
205                    var list = '<li><span>区块高度</span><span> ' + history[0].blockInfo.height + ' <div class=\"lalala\"><img src=\"/images/nimg14_22.png\"><div class=\"layer2\"><div class=\"con\">该存证创建时所在的区块高度,该区块记录了存证的原始数据。</div><div class=\"bg\"></div> </div></div></span></li>';
206                    list += '<li><span>区块哈希</span><span> ' + history[0].blockInfo.blockHash + ' <div class=\"lalala\"><img src=\"/images/nimg14_22.png\"><div class=\"layer2\"><div class=\"con\">
206该区块所有数据的哈希值,区块哈希不可篡改。</div><div class=\"bg\"></div> </div></div></span></li>';
207                    list += '<li><span>存证时间</span><span> ' + transformTimestamp(evidence.submittedAt) + '</span></li>'
208                    $(".resultPart3 .conDiv .msgList ul").html(list)
209
210                    var list1 = "";
211                    list1 += '<span class="cur">01/</span><span>' + formatZero(history.length, 2) + '</span>'
212                    $(".resultPart3 .mxfDiv .hala").html(list1)
213
214                    var list2 = "";
215                    for (var i = 0; i < history.length; i++) {
216                        list2 += '<li onclick="checkClick(this)">';
217                        list2 += '<div class="layer"><div class="icon"><img src="/images/nimg24_3.jpg" alt=""><img src="/images/nimg24_2.jpg" class="img1" alt=""></div><div class="hala"><span class="cur">' + formatZero(i + 1, 2) + '/</span><span>' + formatZero(history.length, 2) + '</span></div><div class="oo">o<div class="line"></div></div></div>';
218                        if (i == 0) {
219                            list2 += '<div class="conDiv"><div class="num">' + formatZero(i + 1, 2) + '</div><div class="msgList"><dl><dd><span>区块高度</span><span>   ' + history[i].blockInfo.height + '  <div class=\"lalala\"><img src=\"/images/nimg14_2.jpg\"><div class=\"layer2\"><div class=\"con\">该存证创建时所在的区块高度,该区块记录了存证的原始数据。</div><div class=\"bg\"></div> </div></div></span></dd><dd><span>区块哈希</span><span>   ' + history[i].blockInfo.blockHash + ' <div class=\"lalala\"><img src=\"/images/nimg14_2.jpg\"><div class=\"layer2\"><div class=\"con\">该区块所有数据的哈希值,区块哈希不可篡改。</div><div class=\"bg\"></div> </div></div></span></dd><dd><span>存证时间</span><span>   ' + transformTimestamp(evidence.submittedAt) + '</span></dd></dl></div><div class="btnDiv">查看详情</div></div>';
220                            //list2 += '<div class="detailBox"><div class="arrow"></div><div class="lie"><dl><dd><em>自定义信息</em></dd><dd><em>标签</em></dd></dl></div></div>';
221
222                        } else {
223                            list2 += '<div class="conDiv"><div class="num">' + formatZero(i + 1, 2) + '</div><div class="msgList"><dl><dd><span>区块高度</span><span>   ' + history[i].blockInfo.height + ' <div class=\"lalala\"><img src=\"/images/nimg14_2.jpg\"><div class=\"layer2\"><div class=\"con\">该存证更新时所在的区块高度,该区块记录了存证的更新状态。</div><div class=\"bg\"></div> </div></div></span></dd><dd><span>区块哈希</span><span>   ' + history[i].blockInfo.blockHash + '<div class=\"lalala\"><img src=\"/images/nimg14_2.jpg\"><div class=\"layer2\"><div class=\"con\">该区块所有数据的哈希值,区块哈希不可篡改。</div><div class=\"bg\"></div> </div></div></span></dd><dd><span>存证时间</span><span>   '  + transformTimestamp(history[i].updatedAt) + '</span></dd></dl></div><div class="btnDiv">查看详情</div></div>';
224
225                        }
226
227                        list2 += '<div class="detailBox"><div class="arrow"></div><div class="lie"><dl><dd><em>自定义信息</em>' + (history[i].metadata != undefined ? JSON.stringify(history[i].metadata) : "") + '</dd><dd><em>标签</em>' + (history[i].labels != undefined ? JSON.stringify(history[i].labels) : "") + '</dd></dl></div></div>';
228                        list2 += '</li>';
229                    }
230
231                    $(".hideDiv .resultPartH .list ul").html(list2)
232                } else {
233                    $(".resultPart3").hide();
234                }
235
236               
237                
238                $(".resultBox").show();
239         //   $(".yqts").hide();
240            }
241           
242
243        }
244
245    });
246}
247
248
249//文本核验按钮事件
250function checkcontent() {
251    var v = $("#Textarea1").val()
252    if (v == '') {
253        layeralert("提示", "请输入您要检验的原文!");
254        retrun;
255    }
256
257    if ($("#dataHash").html() == sha256_digest(v)) {
258        layeralert("提示", "核验通过!");
259     
260        $("#checkBtn").html("<a href=\"javascript:checks();\">重新核验</a>");
261    } else {
262        layeralert("提示", "核验未通过,您所核验的文件与链上存证哈希校验失败,请重新选择!");
263     
264        $("#checkBtn").html("<a href=\"javascript:checks();\">重新核验</a>");
265    }
266    
267}
268//文件核验按钮事件
269function checkfile() {
270    var v = $("#filevalue").val();
271    if (v == '') {
272        layeralert("提示", "请上传您要检验的原文件!");
273        retrun;
274    }
275
276    if ($("#dataHash").html() == v) {
277        layeralert("提示", "文件检验成功!");
278        $("#checkBtn").html("<a href=\"javascript:;\">重新核验</a>");
279
280    } else {
281        layeralert("提示", "文件检验失败!");
282     $("#checkBtn").html("<a href=\"javascript:;\">重新核验</a>");
283    }
284
285}
286
287//文本重新核验
288function checks() {
289
290   // alert( $("#Textarea1").val());
291    $("#cunzhen").html("<textarea name=\"\" id=\"Textarea1\" cols=\"30\" rows=\"10\" placeholder=\"您可以输入您获取的原文进行核验\"></textarea>");
292  
293}
294
295//重新查询
296function loadser() {
297    $(".resultBox").hide();
298 
299    document.getElementById("cods").value = "";
300 location.href = document.URL;
301}
302//时间转换
303function transformTimestamp(timestamp){
304    let a = new Date(timestamp).getTime();
305    const date = new Date(a);
306    const Y = date.getFullYear() + '-';
307    const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
308    const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
309    const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
310    const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
311    // const s = date.getSeconds(); // 秒
312    const dateString = Y + M + D + h + m;
313    // console.log('dateString', dateString); // > dateString 2021-07-06 14:23
314    return dateString;
315}
316
317function formatZero(num, len) {
318    if (String(num).length > len) return num;
319    return (Array(len).join(0) + num).slice(-len);
320}
321
322
323
324
325

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.