PageSourceSearch

https://toumeiw.cn/static/k2023/js/package.js?v=0

js toumeiw.cn collected 2026-10-07 17:21:53 UTC 7,723 bytes, 248 lines download raw bytes

1$(function () {
2  // var arr = ['入门发稿套餐', '初级发稿套餐', '中级发稿套餐', '高级发稿套餐', '豪华发稿套餐'];
3  // 152463
4  var arr1 = [
5    {
6      title: "包收录套餐",
7      price: 499,
8      adesc:
9        "20家包收录媒体打包,出稿快、收录稳定,可带联系方式,推广首选。(不收录按比例退)",
10    },
11    {
12      title: "教育培训套餐",
13      price: 988,
14      adesc:
15        "15家教育类门户站,出稿快,高权重,收录稳定,部分网站不能带联系方式。",
16    },
17    {
18      title: "房产家居套餐",
19      price: 1888,
20      adesc:
21        "20家房产家居垂直精品媒体打包发布,出稿快,高权重,收录好,部分媒体可带联系方式。",
22    },
23    {
24      title: "医疗健康套餐",
25      price: 1388,
26      adesc: "20家健康门户媒体精选发布,部分可带外链、联系方式,收录快效果好",
27    },
28    {
29      title: "时尚女性套餐",
30      price: 688,
31      adesc:
32        "10家时尚女性行业知名门户媒体发布,部分可带外链、联系方式,收录快效果好。",
33    },
34    {
35      title: "商业财经套餐",
36      price: 1588,
37      adesc:
38        "20家金融财经行业知名门户媒体发布,部分可带外链、联系方式,收录快效果好。",
39    },
40  ];
41  $(".dialog .close").click(function () {
42    $(".dialog").hide();
43    $(".packages").css("overflowY", "auto");
44    $(".home-page").css("overflowY", "auto");
45    
46  });
47  layui.use(["table"], function () {
48    var table = layui.table;
49    $(".dialog-package").click(function () {
50      $(".dialog").show();
51      $(".packages").css("overflowY", "hidden");
52      $(".home-page").css("overflowY", "hidden");
53      var index = $(this).attr("index");
54      $(".dialog .package-msg .name").text(arr1[index - 1].title);
55      $(".dialog .package-msg .adesc").text(arr1[index - 1].adesc);
56      $(".dialog .consult .price span").text(arr1[index - 1].price);
57      var dataTable = table.render({
58        elem: "#dataTable",
59        url: url,
60        where: { type: index },
61        method: "POST",
62        cols: [
63          [
64            {
65              field: "media_name",
66              align: "center",
67              title: "媒体名称",
68              width: 200,
69              templet: "#nameTpl",
70            },
71            {
72              field: "publish_rate",
73              align: "center",
74              title: "出稿率",
75              width: 100,
76              templet:
77                "<span>{{# if(d.publish_rate){}} {{d.publish_rate}}%{{#}}}</span>",
78            },
79            {
80              field: "pc_weight",
81              align: "center",
82              title: "	电脑权重",
83              width: 110,
84            },
85            {
86              field: "m_weight",
87              align: "center",
88              title: "移动权重",
89              width: 110,
90            },
91            {
92              field: "news_resource_str",
93              align: "center",
94              title: "新闻源",
95              width: 150,
96              templet: "#news_resourceTpl",
97            },
98            {
99              field: "link_type_str",
100              align: "center",
101              title: "链接情况",
102              minWidth: 100,
103              templet: "#link_typeTpl",
104            },
105          ],
106        ],
107      });
108      function reloadTable(type) {
109        dataTable.reload({
110          where: {
111            type: type,
112          },
113        });
114      }
115    });
116  });
117  // 监听屏幕宽度
118
119  window.addEventListener("load", function () {
120    var sHeight = window.innerHeight;
121    if (sHeight <= 900) {
122      $(".table").css("height", "520px");
123      $(".data tbody").addClass('screenHeight');
124    } else {
125      $(".table").css("height", "700px");
126      $(".data tbody").removeClass('screenHeight');
127    }
128    window.addEventListener("resize", function () {
129      var rHeight = window.innerHeight;
130      if (rHeight <= 900) {
131        $(".table").css("height", "500px");
132        $(".data tbody").addClass('screenHeight');
133      } else {
134        $(".table").css("height", "700px");
135        $(".data tbody").removeClass('screenHeight');
136      }
137    });
138  });
139  
140  
141  
142  // 确保DOM加载完成后再执行JS
143  document.addEventListener('DOMContentLoaded', function() {
144      // 获取元素
145      const menuItems = document.querySelectorAll('.sideMenu_li');
146      // 初始化sections对象,增加空值判断
147      const sections = {};
148      menuItems.forEach(item => {
149          const targetId = item.dataset.target;
150          if (targetId) {
151              sections[targetId] = document.getElementById(targetId);
152          }
153      });
154      
155      // 滚动偏移量(可根据实际需求调整)
156      const offsetTop = 100;
157      
158      // 移除所有激活状态
159      function removeAllActive() {
160          menuItems.forEach(item => {
161              item.classList.remove('sideMenu_li_active');
162          });
163      }
164      
165      // 设置激活状态
166      function setActive(targetId) {
167          removeAllActive();
168          menuItems.forEach(item => {
169              if (item.dataset.target === targetId) {
170                  item.classList.add('sideMenu_li_active');
171              }
172          });
173      }
174      
175      // 点击锚点滚动到对应区域
176      menuItems.forEach(item => {
177          item.addEventListener('click', function() {
178              const targetId = this.dataset.target;
179              const targetElement = sections[targetId];
180              
181              // 增加空值判断,避免读取null的属性
182              if (!targetElement) {
183                  console.warn(`未找到ID为${targetId}的元素`);
184                  return;
185              }
186              
187              // 平滑滚动到目标位置
188              window.scrollTo({
189                  top: targetElement.offsetTop - offsetTop,
190                  behavior: 'smooth'
191              });
192              
193              // 设置激活状态
194              setActive(targetId);
195          });
196      });
197      
198      // 监听滚动事件,更新锚点激活状态
199      function handleScroll() {
200          const scrollPosition = window.scrollY + offsetTop + 100;
201          let activeId = 'specialPackage'; // 默认激活第一个
202          
203          // 遍历所有区域,判断当前可视区域(增加空值判断)
204          Object.entries(sections).forEach(([key, section]) => {
205              if (!section) return; // 跳过null元素
206              
207              const sectionTop = section.offsetTop;
208              const sectionBottom = sectionTop + section.offsetHeight;
209              
210              // 判断是否在当前区域范围内
211              if (scrollPosition >= sectionTop && scrollPosition < sectionBottom) {
212                  activeId = key;
213              }
214          });
215          
216          // 设置最终激活的锚点
217          setActive(activeId);
218      }
219      
220      // 防抖函数,优化滚动性能
221      function debounce(func, wait = 10) {
222          let timeout;
223          return function() {
224              clearTimeout(timeout);
225              timeout = setTimeout(() => {
226                  func.apply(this, arguments);
227              }, wait);
228          };
229      }
230      
231      // 安全添加事件监听
232      if (window.addEventListener) {
233          window.addEventListener('scroll', debounce(handleScroll));
234          window.addEventListener('resize', debounce(handleScroll));
235      }
236      
237      // 初始化执行一次(增加异常捕获)
238      try {
239          handleScroll();
240      } catch (e) {
241          console.error('初始化滚动监听失败:', e);
242      }
243  });
244  
245  
246});
247
248

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.