123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- $(function () {
- $("#copy_url").val(window.location.href)
- // 点击复制链接
- $(".copy").click(function (e) {
- var copyobject = document.getElementById("copy_url");
- copyobject.select();
- document.execCommand('copy');
- alert("提示:复制成功!");
- })
- var qrcode = new QRCode("qrcode");
- qrcode.makeCode(window.location.href);
- $.getUrlParam = function (name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
- var r = window.location.search.substr(1).match(reg);
- if (r != null) return unescape(r[2]);
- return null;
- }
- if ($.getUrlParam('type') == 1) {
- // $(".first_2").html("相关公告")
- $(".first_1").html("公告内容")
- } else {
- // $(".first_2").html("相关公示")
- $(".first_1").html("公示内容")
- }
- var keyid = $.getUrlParam('kid');
- var dataUrl = '/nx/n/w/' + keyid;
- //获取url后的参数
- $.ajax({
- url: getServerHttp() + dataUrl,
- type: 'post',
- cache: false,
- dataType: 'json',
- success: function (data) {
- var data = ajaxDataParames(data);
- var applyTime = data.apply_date_end;
- var noticeTime = data.notice_end_time;
- var releaseTime = new Date(data.notice_release_time);
- if (applyTime > noticeTime || applyTime === noticeTime) {
- var endTime = new Date(applyTime);
- } else if (applyTime < noticeTime) {
- var endTime = new Date(noticeTime);
- }
- var times = releaseTime.getFullYear() + '-' + (releaseTime.getMonth() + 1) + '-' + releaseTime.getDate();
- $('.detailed-content-box').html(data.notice_content);
- $('.detailed-title h1').html(data.notice_title);
- $('.times').html(times);
- $.ajax({
- url: getServerHttp() + '/current_time',
- type: 'post',
- cache: false,
- dataType: 'json',
- success: function (res) {
- var res = ajaxDataParames(res);
- if (res.current_time > data.apply_date_end) {
- $('.position-box').css({
- 'display': 'none'
- });
- }
- }
- });
- if (data.notice_nature === "变更公告" || data.notice_nature === "延期公告" || data.notice_nature === "补充公告" || data.notice_nature ===
- "控制价" || data.notice_type === "候选人公示" || data.notice_type === "中标公示") {
- $('.position-box').css({
- 'display': 'none'
- });
- $('.origin-url a').attr('href', '../page_detailed/list.html?kid=' + data.reference_notice_id + '&type=' + $.getUrlParam('type'))
- } else if (data.notice_nature === "撤销公告") {
- $('.position-box').css({
- 'display': 'none'
- });
- $('.origin-url a').css({
- 'display': 'none'
- })
- } else {
- $('.origin-url a').css({
- 'display': 'none'
- });
- if (data.is_login) {
- if (data.res) {
- $('.position-box').css({
- 'display': 'none'
- });
- } else {
- if (data.tender_fee_type === '线下') {
- if (data.is_signup) {
- $('.bid-process a').attr('href', '/web-back/view/task/tender/sign_up/sign_up_form.html?tender_id=' + data.tender_id);
- } else {
- $.ajax({
- url: getServerHttp() + '/back/tender/sign_up/sign_up_form',
- type: 'post',
- dataType: 'json',
- data: {
- tender_id: data.tender_id
- },
- success: function (res) {
- var res = ajaxDataParames(res);
- $('.bid-process a').attr('href',
- '/web-back/view/task/tender/sign_up/offline_pay_form.html?signup_id=' + res.signup_id);
- }
- });
- }
- } else if (data.tender_fee_type === '线上') {
- $('.bid-process a').attr('href', '/web-back/view/task/tender/sign_up/sign_up_form.html?tender_id=' + data.tender_id);
- }
- }
- } else {
- $('.bid-process a').attr('href', '/web-back?kid=' + keyid);
- }
- };
- // 判断来源是否登录页
- if ($.getUrlParam('source')) {
- $('.bid-process a').click();
- }
- },
- error: function (xml, info, errorobj) {
- // console.log(xml);
- // console.log(info);
- // console.log(errorobj);
- // console.log('请求错误');
- }
- });
- //更多公告
- $.ajax({
- url: getServerHttp() + '/nx/n/list/notice',
- type: 'post',
- cache: false,
- dataType: 'json',
- success: function (data) {
- var data = ajaxDataParames(data);
- var doms = '';
- for (var i = 0; i < 5; i++) {
- doms += '<li><a title="' + data.pagePackage.data[i].notice_title + '" href="../page_detailed/list.html?kid=' + data.pagePackage.data[i].kid + '" target="_blank">' + data.pagePackage.data[i].notice_title + '</a></li>'
- }
- $('.more-notice-content ul').html(doms);
- }
- })
- announcement($.getUrlParam('kid'), $.getUrlParam('type'));
- })
- // 获取相关公告
- function announcement(id, type) {
- if (type == 1) {
- var url = getServerHttp() + "/nx/n/list/refer_notice?notice_id=" + id;
- } else {
- var url = getServerHttp() + "/nx/n/list/refer_notice?publicity_id=" + id;
- }
- $.ajax({
- url: url,
- type: 'post',
- cache: false,
- dataType: 'json',
- success: function (data) {
- var data = ajaxDataParames(data);
- if (data.length == 0) {
- $(".more_content").html("无");
- } else {
- var doms = "";
- var iDom = "";
- for (var i in data) {
- var iconStyle = data[i].notice_nature;
- if (iconStyle === "正常公告" || iconStyle === "再次公告") {
- iDom = '<i class="icons greens">新</i>';
- } else if (iconStyle === "变更公告") {
- iDom = '<i class="icons blues">变更</i>';
- } else if (iconStyle === "延期公告") {
- iDom = '<i class="icons blues">延期</i>';
- } else if (iconStyle === "补充公告") {
- iDom = '<i class="icons blues">补充</i>';
- } else if (iconStyle === "控制价") {
- iDom = '<i class="icons blues">控价</i>';
- } else if (iconStyle === "撤销公告") {
- iDom = '<i class="icons reds">撤销</i>';
- }
- function type(name) {
- if (name == "中标公示" || name == "候选人公示") {
- return 2
- } else if (name = "招标公告") {
- return 1
- }
- }
- var porjectUrl = './list.html?kid=' + data[i].kid + '&type=' + type(data[i].notice_type);
- doms += '<li>' + iDom + '<a href="' + porjectUrl + '" class="names" target="_blank" title="' + data[i].notice_title +
- '">' + data[i].notice_title + '</a><span class="times_list">' + checkDateTime(data[i].notice_release_time) +
- '</span></li>';
- }
- $('.more_content').html(doms);
- }
- }
- })
- }
- function copy() {
- var createInput = document.createElement('input');
- createInput.value = window.location.href;
- document.body.appendChild(createInput);
- createInput.select(); // 选择对象
- document.execCommand("Copy"); // 执行浏览器复制命令
- createInput.className = 'createInput';
- createInput.style.display = 'none';
- layui.use(['layer', 'carousel'], function () {
- var layer = layui.layer;
- layer.msg('复制成功,可以粘贴了!'); //没有layui的可以改为alert
- })
- };
|