sbd-npm 1.5.43 → 1.5.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/constant.js CHANGED
@@ -162,8 +162,8 @@ const MenuList = [
162
162
  'menu': [
163
163
  {'key': 'portfolio_recommend', 'name': '特别关注', 'url': '/0x2da99e58e28de94b670c4200657ac7e26dd8dceb'},
164
164
  {'key': 'portfolio_gao', 'name': '高大侠', 'url': '/0x44fe5ef98b6802a9e7a893a1dcc231031ef8683d'},
165
- {'key': 'portfolio_uestc', 'name': '独钓寒江雪', 'url': '/0x7cbaee9df4ea09cc2ad0d001f4b948109b75f39f'},
166
165
  {'key': 'portfolio_stratagem', 'name': '上兵伐谋zgz', 'url': '/0x622a4a04d7a04e3b28c85a36500371ba28edea83'},
166
+ {'key': 'portfolio_uestc', 'name': '独钓寒江雪', 'url': '/0x7cbaee9df4ea09cc2ad0d001f4b948109b75f39f'},
167
167
  {'key': 'portfolio_ning', 'name': '宁湖', 'url': '/0x69717049aefea13348d702755a4ed38a2f0e40ad'},
168
168
  {'key': 'portfolio_two', 'name': '两瓢(彭波)', 'url': '/0x376350389c657c5153d59959b6351935c9357651'},
169
169
  {'key': 'portfolio_li', 'name': '力氏周期', 'url': '/0xe639df667bcb74829d1db04e48c0d6c10ea5a1f9'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.5.43",
3
+ "version": "1.5.46",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/snowball_tool.js CHANGED
@@ -42,8 +42,8 @@ $(function () {
42
42
  if (j.user) {
43
43
  $("#snowball-data").removeClass("hide");
44
44
 
45
- $("#user_id").html(Util.pack_html_link("https://xueqiu.com/u/" + j.user.id, j.user.id));
46
- let user_api_url = "https://xueqiu.com/user/show.json?id=" + j.user.id + "&_=" + Util.now();
45
+ $("#user_id").html(Util.pack_html_link("https://www.xueqiu.com/u/" + j.user.id, j.user.id));
46
+ let user_api_url = "https://www.xueqiu.com/user/show.json?id=" + j.user.id + "&_=" + Util.now();
47
47
  j.user.screen_name = j.user.screen_name ? j.user.screen_name : "--";
48
48
  let name_html = Util.pack_html_link(user_api_url, j.user.screen_name);
49
49
  if (j.user.name_list) {
@@ -65,17 +65,17 @@ $(function () {
65
65
  $("#ip_location").html(j.user.ip_location ? Util.map_url(j.user.ip_location) : "--");
66
66
  $("#gender").html(j.user.gender === "f" ? "女" : "男");
67
67
  if (j.user.friends_count) {
68
- $("#friends_count").html(Util.pack_html_link("https://xueqiu.com/u/" + j.user.id + "#/follow", j.user.friends_count));
68
+ $("#friends_count").html(Util.pack_html_link("https://www.xueqiu.com/u/" + j.user.id + "#/follow", j.user.friends_count));
69
69
  } else {
70
70
  $("#friends_count").html(j.user.friends_count);
71
71
  }
72
72
  if (j.user.followers_count) {
73
- $("#followers_count").html(Util.pack_html_link("https://xueqiu.com/u/" + j.user.id + "#/fans", j.user.followers_count));
73
+ $("#followers_count").html(Util.pack_html_link("https://www.xueqiu.com/u/" + j.user.id + "#/fans", j.user.followers_count));
74
74
  } else {
75
75
  $("#followers_count").html(j.user.followers_count);
76
76
  }
77
77
  if (j.user.status_count) {
78
- $("#status_count").html(Util.pack_html_link("https://xueqiu.com/v4/statuses/user_timeline.json?&user_id=" + j.user.id + "&type=0&count=20", j.user.status_count));
78
+ $("#status_count").html(Util.pack_html_link("https://www.xueqiu.com/v4/statuses/user_timeline.json?&user_id=" + j.user.id + "&type=0&count=20", j.user.status_count));
79
79
  } else {
80
80
  $("#status_count").html(0);
81
81
  }
@@ -129,7 +129,7 @@ $(function () {
129
129
  }
130
130
  }
131
131
  if (j.stocks) {
132
- $("#total_stock_num").html(j.stocks.length > 0 ? Util.pack_html_link("https://xueqiu.com/u/" + j.user.id + "#/stock", j.stocks.length) : "--");
132
+ $("#total_stock_num").html(j.stocks.length > 0 ? Util.pack_html_link("https://www.xueqiu.com/u/" + j.user.id + "#/stock", j.stocks.length) : "--");
133
133
  SnowballTool.init_stock_data(j.stocks);
134
134
  }
135
135
  SnowballTool.render_snowball_html();
package/snowball_tweet.js CHANGED
@@ -196,14 +196,14 @@ $(function () {
196
196
  } else {
197
197
  if (item.uid > 0) {
198
198
  if (item.mark.includes("/")) {
199
- url = "https://xueqiu.com/" + item.mark;
199
+ url = "https://www.xueqiu.com/" + item.mark;
200
200
  } else {
201
- url = "https://xueqiu.com/" + item.uid + "/" + item.id;
201
+ url = "https://www.xueqiu.com/" + item.uid + "/" + item.id;
202
202
  }
203
- user_url = "https://xueqiu.com/u/" + item.uid;
203
+ user_url = "https://www.xueqiu.com/u/" + item.uid;
204
204
  } else {
205
- url = "https://xueqiu.com/S/" + item.mark + "/" + item.id;
206
- user_url = "https://xueqiu.com/S/" + item.mark;
205
+ url = "https://www.xueqiu.com/S/" + item.mark + "/" + item.id;
206
+ user_url = "https://www.xueqiu.com/S/" + item.mark;
207
207
  item.user_name = (item.content.includes("公告及通告") || item.content.includes("自愿公告")) ? "公告" : "资讯";
208
208
  }
209
209
  }
@@ -245,7 +245,7 @@ $(function () {
245
245
  }
246
246
  let user_name = "";
247
247
  if (item.mark && SnowballTweet.user_data[item.mark]) {
248
- user_name = Util.pack_html_link("https://xueqiu.com/S/" + item.mark, SnowballTweet.user_data[item.mark]) + " - ";
248
+ user_name = Util.pack_html_link("https://www.xueqiu.com/S/" + item.mark, SnowballTweet.user_data[item.mark]) + " - ";
249
249
  if (item.user_name) {
250
250
  user_name += Util.pack_html_link(user_url, item.user_name);
251
251
  } else if (SnowballTweet.user_data[item.uid]) {
package/stock_basics.js CHANGED
@@ -574,9 +574,9 @@ let Stock = {
574
574
  $("#main_holder_tips").html(main_tips);
575
575
  let symbol = Util.code_to_symbol(Stock.code);
576
576
  Util.render_table_html("circulation_holder_table_body", circulation_html);
577
- $("#circulation_holder_url").attr("href", "https://xueqiu.com/snowman/S/" + symbol + "/detail#/LTGD");
577
+ $("#circulation_holder_url").attr("href", "https://www.xueqiu.com/snowman/S/" + symbol + "/detail#/LTGD");
578
578
  Util.render_table_html("main_holder_table_body", main_html);
579
- $("#main_holder_url").attr("href", "https://xueqiu.com/snowman/S/" + symbol + "/detail#/SDGD");
579
+ $("#main_holder_url").attr("href", "https://www.xueqiu.com/snowman/S/" + symbol + "/detail#/SDGD");
580
580
  if (j.date_list) {
581
581
  let date_html = [];
582
582
  j.date_list.forEach(function (date) {
package/summary_daily.js CHANGED
@@ -30,7 +30,7 @@ $(function () {
30
30
  key_cache: "SBD_CACHE",
31
31
  index_hist_data: [
32
32
  {"code": "ths_all_a", "name": "同花顺全A指数", "url": "https://m.10jqka.com.cn/stockpage/48_883957/"},
33
- {"code": "000902", "name": "中证流通", "url": "https://xueqiu.com/S/SH000902"},
33
+ {"code": "000902", "name": "中证流通", "url": "https://www.xueqiu.com/S/SH000902"},
34
34
  ],
35
35
 
36
36
  get_cache: function () {
package/util.js CHANGED
@@ -160,7 +160,7 @@ const Util = {
160
160
  let html = [];
161
161
  html.push('<div class="menu_section">');
162
162
  html.push('<ul class="nav side-menu">');
163
- if (typeof MenuList != "undefined") {
163
+ if (typeof MenuList === "object") {
164
164
  MenuList.forEach(function (menu) {
165
165
  html.push('<li><a><i class="fa fa-', menu["icon"], '"></i> ', menu["name"], ' <span class="fa fa-chevron-down"></span></a>');
166
166
  html.push('<ul class="nav child_menu">');
@@ -175,7 +175,7 @@ const Util = {
175
175
  }
176
176
  html.push('</div>');
177
177
  html.push('</div>');
178
- $("#sidebar-menu").html(html.join(""));
178
+ document.getElementById("sidebar-menu").innerHTML = html.join("");
179
179
  },
180
180
 
181
181
  /**
@@ -195,6 +195,8 @@ const Util = {
195
195
  let upper_code = item.code.toUpperCase();
196
196
  if (item.type && item.type === 1) {
197
197
  href = Util.get_url("fund_public") + "?fund_code=" + upper_code;
198
+ } else if (item.type && item.type === 2) {
199
+ href = Util.get_url("snowball_user") + "?uid=" + upper_code;
198
200
  } else {
199
201
  href = "/stock/" + upper_code;
200
202
  }
@@ -360,7 +362,7 @@ const Util = {
360
362
  } else {
361
363
  stock_symbol = Util.code_to_symbol(code);
362
364
  }
363
- let snowball_url = "https://xueqiu.com/S/" + stock_symbol;
365
+ let snowball_url = "https://www.xueqiu.com/S/" + stock_symbol;
364
366
  return "<a class='code_item' target='_blank' rel='noopener noreferrer nofollow' href='" + snowball_url + "'>" + code_name + "</a>";
365
367
  },
366
368
 
@@ -1587,7 +1589,7 @@ const Util = {
1587
1589
  let public_date = j.public_date > 0 ? Util.seconds_to_format(j.public_date, "%Y-%m-%d") : "--";
1588
1590
  let issue_date = j.issue_date > 0 ? Util.seconds_to_format(j.issue_date, "%Y-%m-%d") : "--";
1589
1591
  html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j.update_time, "%Y-%m-%d"), "' class='info'><th colspan='15' style='text-align: center;'>基金概况</th></tr>");
1590
- html.push("<tr><td colspan='3'>基金代码</td><td colspan='4'>", Util.pack_html_link('https://xueqiu.com/S/' + Util.code_to_fund_symbol(j.fund_code), j.fund_code), "</td><td colspan='3'>基金名</td><td colspan='5'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + j.fund_code + '.html', j.fund_name), "</td></tr>");
1592
+ html.push("<tr><td colspan='3'>基金代码</td><td colspan='4'>", Util.pack_html_link('https://www.xueqiu.com/S/' + Util.code_to_fund_symbol(j.fund_code), j.fund_code), "</td><td colspan='3'>基金名</td><td colspan='5'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + j.fund_code + '.html', j.fund_name), "</td></tr>");
1591
1593
  html.push("<tr><td colspan='3'>基金类型</td><td colspan='4'>", (j.fund_type ? j.fund_type : "--"), "</td><td colspan='3'>投资类型</td><td colspan='5'>", (j.invest_type ? j.invest_type : "--"), "</td></tr>");
1592
1594
  html.push("<tr><td colspan='3'>单位净值</td><td colspan='4'>", net, "</td><td colspan='3'>资产规模</td><td colspan='5'>", assets, "</td></tr>");
1593
1595
  html.push("<tr><td colspan='3'>成立日期</td><td colspan='4'>", public_date, "</td><td colspan='3'>发行日期</td><td colspan='5'>", issue_date, "</td></tr>");
@@ -1813,7 +1815,7 @@ const Util = {
1813
1815
  } else if (category_top_type === 3) {
1814
1816
  cole_url = "https://www.swsresearch.com/institute_sw/allIndex/releasedIndex/releasedetail?code=" + item.code + "&name=" + item.code;
1815
1817
  } else {
1816
- cole_url = "https://xueqiu.com/S/" + Util.code_to_fund_symbol(item.code);
1818
+ cole_url = "https://www.xueqiu.com/S/" + Util.code_to_fund_symbol(item.code);
1817
1819
  }
1818
1820
  html.push("<td>", Util.pack_html_link(cole_url, item.name), "</td>");
1819
1821
  html.push("<td>", item.num, "</td>");
@@ -4695,14 +4697,14 @@ const Util = {
4695
4697
  cursor: pointer;
4696
4698
  font-size: 14px;
4697
4699
  `;
4698
- copyButton.addEventListener('click', function() {
4700
+ copyButton.addEventListener('click', () => {
4699
4701
  navigator.clipboard.writeText(message).then(
4700
4702
  function() {
4701
4703
  // 复制成功,临时改变按钮文字
4702
4704
  const originalText = copyButton.textContent;
4703
4705
  copyButton.textContent = '已复制';
4704
4706
  copyButton.style.backgroundColor = '#45a049';
4705
- setTimeout(function() {
4707
+ setTimeout(() => {
4706
4708
  copyButton.textContent = originalText;
4707
4709
  copyButton.style.backgroundColor = '#4CAF50';
4708
4710
  }, 2000);
@@ -4725,7 +4727,7 @@ const Util = {
4725
4727
  cursor: pointer;
4726
4728
  font-size: 14px;
4727
4729
  `;
4728
- closeButton.addEventListener('click', function() {
4730
+ closeButton.addEventListener('click', () => {
4729
4731
  document.body.removeChild(modal);
4730
4732
  });
4731
4733
  // 组装按钮容器