sbd-npm 1.2.0 → 1.2.3

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/.npmignore ADDED
@@ -0,0 +1 @@
1
+ sbd-npm.md
package/custom.js CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (C) 2015-present dhq <dhq314@gmail.com>
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
  function init_sidebar() {
2
17
  var a = function () {
3
18
  $RIGHT_COL.css("min-height", $(window).height());
package/menu.js CHANGED
@@ -8,8 +8,8 @@ const MenuList = [
8
8
  {'key': 'summary_breadth', 'name': '市场宽度', 'url': '/6263b0820aa0c1b0b27e10e855b8ea1b'},
9
9
  {'key': 'summary_dashboard', 'name': '市场全景', 'url': '/dffbe86a3353af37e3471cc6a72266e9'},
10
10
  {'key': 'summary_market', 'name': '市场概要', 'url': '/1251bb015654040ba8dc38b563817586'},
11
- {'key': 'summary_etf', 'name': 'ETF分析', 'url': '/5e7eb433adbda09db931b9a4a3371fd5'},
12
11
  {'key': 'summary_industry', 'name': '板块涨跌', 'url': '/ce5c0a4d19ebf14830d0a05cdf7c0eb9'},
12
+ {'key': 'summary_etf', 'name': 'ETF分析', 'url': '/5e7eb433adbda09db931b9a4a3371fd5'},
13
13
  {'key': 'summary_repurchase', 'name': '闲钱流向', 'url': '/8d810d466cca69c6a91afb7fd468df93'},
14
14
  {'key': 'summary_margin_lever', 'name': '融资杠杠率', 'url': '/c0e5faf52d3f6a8a0a85100957420be0'},
15
15
  {'key': 'summary_momentum', 'name': '板块动量', 'url': '/6bde52a3162b3973ed96f52ef0a57d0e'},
@@ -38,6 +38,7 @@ const MenuList = [
38
38
  'menu': [
39
39
  {'key': 'trend_price', 'name': '股价阶段涨跌幅度', 'url': '/43ef6aeb36475f8f8f44d477b1990390'},
40
40
  {'key': 'trend_money_inflow', 'name': '资金流入历史最高', 'url': '/dc1303ba221de0c4fb85cd3cb513c547'},
41
+ {'key': 'trend_month', 'name': '月线趋势', 'url': '/218cd8e3c5ea55629cac28ee0e543233'},
41
42
  {'key': 'trend_boll', 'name': '布林线', 'url': '/0c9b231a72e40475d6f985fd67bdb718'},
42
43
  {'key': 'trend_ma20_60', 'name': '20、60日均线交叉', 'url': '/4bf72713d83469ad6ec1d9fc3be8886f'},
43
44
  {'key': 'trend_macd_down', 'name': 'MACD下行', 'url': '/ff97a31b4ffbabe71315e75c4fd62047'},
@@ -213,16 +214,6 @@ const MenuList = [
213
214
  {'key': 'rank_goodwill', 'name': '商誉占比', 'url': '/81e1e604b6fd26be1ab3f496e5edd742'},
214
215
  ]
215
216
  },
216
- {
217
- 'name': '科创板',
218
- 'icon': 'try',
219
- 'menu': [
220
- {'key': 'science_trade', 'name': '交易情况', 'url': '/701357fa3aa407afd99651d5492f4ca3'},
221
- {'key': 'science_list', 'name': '受理情况', 'url': '/125f28b2503fe3b3b2c1b5e182a32a6c'},
222
- {'key': 'science_news', 'name': '公司介绍', 'url': '/a98e892eb1b2b196c617e7630338c878'},
223
- {'key': 'science_star50', 'name': '科创50', 'url': '/65ce1ec48e1a443e69c457bc1c909767'},
224
- ]
225
- },
226
217
  {
227
218
  'name': '其他',
228
219
  'icon': 'remove',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.0",
3
+ "version": "1.2.3",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (C) 2015-present dhq <dhq314@gmail.com>
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
  let Stock = {
2
17
 
3
18
  code: "",
@@ -216,17 +231,11 @@ let Stock = {
216
231
  if (item["price"] > 0 && item["price"] < item["block_trade_price"]) {
217
232
  remark_html.push("<b class='text-danger'>当前价小于最近<a href='" + Util.get_url("daily_block") + "?code=" + item["code"] + "'>大宗交易价(" + item["block_trade_price"] + ")</a></b>");
218
233
  }
219
- if (item["is_hkscc"] === 1) {
220
- remark_html.push("<b class='text-danger'>港交所成份股</b>");
221
- }
222
- if (item["is_hs300s"] === 1) {
223
- remark_html.push("<b class='text-danger'>沪深300成份股</b>");
224
- }
225
234
  if (item["desc"]) {
226
235
  remark_html.push("<br><br><p>" + item["desc"] + "</p>");
227
236
  }
228
237
  remark_html = remark_html.join(", ");
229
- if (item["industry_data"]) {
238
+ if (item["industry_data"] && item["industry_data"].length > 0) {
230
239
  if (remark_html.length > 0) {
231
240
  remark_html += "<br><br>";
232
241
  }
package/summary_daily.js CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (C) 2015-present dhq <dhq314@gmail.com>
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
  $(document).ready(function () {
2
17
 
3
18
  let DailySummary = {
package/util.js CHANGED
@@ -1,8 +1,24 @@
1
1
  /**
2
2
  * 通用工具函数
3
3
  * Theme https://colorlib.com/polygon/gentelella/index.html
4
+ * [20 个杀手级 JavaScript 单行代码](https://segmentfault.com/a/1190000040721650)
5
+ */
6
+
7
+ /**
8
+ * Copyright (C) 2015-present dhq <dhq314@gmail.com>
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
4
21
  */
5
- // [20 个杀手级 JavaScript 单行代码](https://segmentfault.com/a/1190000040721650)
6
22
  const Util = {
7
23
 
8
24
  tips_token: "util-tips-div",
@@ -1949,6 +1965,11 @@ const Util = {
1949
1965
  $(this).attr("data-val", item["holder_num"]);
1950
1966
  });
1951
1967
  }
1968
+ if (item["money_net_inflow"] && item["money_net_inflow"] !== 0) {
1969
+ $(".money_inflow_" + code).each(function () {
1970
+ Util.render_money_inflow($(this), item);
1971
+ });
1972
+ }
1952
1973
  if ($("#remark_" + code).length) {
1953
1974
  let remark = "";
1954
1975
  if (parseInt(item["down_day"]) > 0) {
@@ -1964,15 +1985,6 @@ const Util = {
1964
1985
  if (parseInt(item["is_down_macd"]) > 0) {
1965
1986
  remark += "<b>MACD 下行</b><br />";
1966
1987
  }
1967
- if (item["is_msci"] === 1) {
1968
- remark += "<b>MSCI 成份股</b><br />";
1969
- }
1970
- if (item["is_hkscc"] === 1) {
1971
- remark += "<b>港交所成份股</b><br />";
1972
- }
1973
- if (item["is_hs300s"] === 1) {
1974
- remark += "<b>沪深300成份股</b><br />";
1975
- }
1976
1988
  $("#remark_" + code).html(remark);
1977
1989
  }
1978
1990
  });
@@ -1982,7 +1994,7 @@ const Util = {
1982
1994
  Util.refresh_index_price(element_id, index_list.join("-"), is_us, 0);
1983
1995
  }
1984
1996
  let total_num = valid_code_list.length;
1985
- if (total_num > 0 && total_num < 100) { // 涨跌统计
1997
+ if (total_num > 0) { // 涨跌统计
1986
1998
  if ($("#" + element_id + "_tips").length) {
1987
1999
  let average_change_percent = Math.round((total_change_percent / total_num) * 10000) / 100;
1988
2000
  let average_year_change_percent = Math.round((total_year_change_percent / total_num) * 10000) / 100;
@@ -2229,6 +2241,22 @@ const Util = {
2229
2241
  return "--";
2230
2242
  },
2231
2243
 
2244
+ /**
2245
+ * 组装主力资金数据
2246
+ * @param obj
2247
+ * @param item
2248
+ * @returns {string}
2249
+ */
2250
+ render_money_inflow: function (obj, item) {
2251
+ if (item["money_net_inflow"] && item["money_net_inflow"] !== 0) {
2252
+ let money_net_inflow = "<b>" + Util.to_unit(item["money_net_inflow"]) + "</b>";
2253
+ money_net_inflow = Util.pack_html_link("/stock/" + item["code"] + "?tab=big_deal", money_net_inflow);
2254
+ obj.html(Util.pack_html_link("/stock/" + item["code"] + "?tab=big_deal", money_net_inflow));
2255
+ obj.attr("data-val", item["money_net_inflow"]);
2256
+ obj.find("span").first().addClass(Util.text_color(item["money_net_inflow"]));
2257
+ }
2258
+ },
2259
+
2232
2260
  /**
2233
2261
  * 获取股东数据
2234
2262
  * @param element_id