sbd-npm 1.3.40 → 1.3.42

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
@@ -39,11 +39,11 @@ const MenuList = [
39
39
  {'key': 'trend_price', 'name': '股价阶段涨跌幅度', 'url': '/0x84527c7c3487b39afd820f2b309355cd75c01653'},
40
40
  {'key': 'trend_day3_stabilize', 'name': '连续三日收涨', 'url': '/0x7e9df652521f334030e0be383f5fe10f01a67243'},
41
41
  {'key': 'trend_contra_trade', 'name': '反包', 'url': '/0xa3645ec3bf460f8c0c2ce35d22ab3f50bdd87c5f'},
42
+ {'key': 'trend_week_ma120', 'name': '突破周120均线', 'url': '/0xd14beb9f806809503d9ecceda8ecdab61051dd01'},
42
43
  {'key': 'trend_kdj', 'name': 'KDJ金叉', 'url': '/0x3382bdaec4e8715ce27ca2b538dce09a2f8f5e50'},
43
44
  {'key': 'trend_macd_cross', 'name': 'MACD金叉', 'url': '/0x277bc35fcd21059103dd7917c8bfe0c474880b85'},
44
45
  {'key': 'trend_bull_trend', 'name': '多头趋势', 'url': '/0x37b24777154ee090926e57bfa5602efa5c89b8a8'},
45
46
  {'key': 'trend_money_inflow', 'name': '资金流入历史最高', 'url': '/0xfbfc92be1eebe9ccf5b2f14b9a2ea25f2cc941b8'},
46
- {'key': 'trend_month', 'name': '月线趋势', 'url': '/0x9199702d80c49b940f774cdb275403f6bc293c78'},
47
47
  {'key': 'trend_boll', 'name': '布林线', 'url': '/0x7f2c6b9542ce7626669ab4910cbf7e8812883fea'},
48
48
  {'key': 'trend_holder_minimum', 'name': '股东数历史最少', 'url': '/0xf0c0c360a283689c83ae216c6bbb03777d8068ca'},
49
49
  {'key': 'trend_down_maximum', 'name': '历史高位最大跌幅', 'url': '/0x8d7b8abeec94e2ebe4b25115272d9d5899355c43'},
@@ -51,6 +51,7 @@ const MenuList = [
51
51
  {'key': 'trend_week_minimum', 'name': '周成交低点', 'url': '/0xa9dfc159b157ae3b694a12dc42fb8feaa75bcf51'},
52
52
  {'key': 'trend_margin', 'name': '融资融券余额涨幅', 'url': '/0x9a2c22255e4f87592b10432c8ab24b14c82692af'},
53
53
  {'key': 'trend_index_month', 'name': '指数每年月份涨跌', 'url': '/0xf59cc6347d851edfe836a6c1c23c518cb83e27de'},
54
+ {'key': 'trend_month', 'name': '月线趋势', 'url': '/0x9199702d80c49b940f774cdb275403f6bc293c78'},
54
55
  {'key': 'trend_ma20_60', 'name': '20、60日均线交叉', 'url': '/0x4f3b8625bcfcf0c4289b0a7df82d0afc1af4d026'},
55
56
  {'key': 'trend_doji', 'name': '十字星', 'url': '/0x60f986e9f89a1dfafc8ae792bf0b5fb8e0d1887c'},
56
57
  {'key': 'trend_ma510', 'name': '突破5、10日均线', 'url': '/0x46044beeaca896fe6acd86be3c94778f4c57e316'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.40",
3
+ "version": "1.3.42",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -107,7 +107,7 @@ let Stock = {
107
107
  Util.init_range_date("hist_start_end_date", Stock, "fetch_hist_data", 60);
108
108
  }
109
109
  if (Stock.hist_type) {
110
- $("#hist_type").find("option[value='" + Stock.hist_type + "']").attr("selected", true);
110
+ $("#hist_type").val(Stock.hist_type);
111
111
  }
112
112
  Util.init_table_skeleton({
113
113
  "element_id": "hist_table",
@@ -121,8 +121,8 @@ let Stock = {
121
121
  {"name": "涨跌幅", "sort_type": "p_change"},
122
122
  {"name": "成交均价"},
123
123
  {"name": "成交量", "sort_type": "volume"},
124
- {"name": "量比", "sort_type": "volume_ratio", "tooltip": "当日成交量与过去 5 日平均成交量的比"},
125
- {"name": "量比30", "sort_type": "volume_ratio30", "tooltip": "当日成交量与过去 30 日平均成交量的比"},
124
+ {"name": "量比", "sort_type": "volume_ratio", "tooltip": "当日成交量与过去5日平均成交量的比"},
125
+ {"name": "量比30", "sort_type": "volume_ratio30", "tooltip": "当日成交量与过去30日平均成交量的比"},
126
126
  {"name": "成交额", "sort_type": "amount"},
127
127
  {"name": "换手率", "sort_type": "turnover"},
128
128
  ]
@@ -514,20 +514,28 @@ let Stock = {
514
514
  pre_circulation_volume += item["volume"];
515
515
  }
516
516
  });
517
- if (circulation_volume > 0 && pre_circulation_volume > 0) {
518
- let price_tips = "";
517
+ let circulation_tips = "", main_tips = "";
518
+ if (circulation_volume > 0) {
519
+ circulation_tips += " [ 当前十大流通股东总持股数: <span class='label label-info'>" + Util.to_unit(circulation_volume, 3) + "</span>";
520
+ if (pre_circulation_volume > 0) {
521
+ circulation_tips += ", 上一季度是: <span class='label label-info'>" + Util.to_unit(pre_circulation_volume, 3) + "</span>,";
522
+ circulation_tips += " 持股数环比: " + Util.year_price_rate(circulation_volume, pre_circulation_volume, 1);
523
+ }
519
524
  if (j["date_price"]) {
520
- price_tips = ", 当时价: " + Util.digit_compare_trend1(Stock["price"], j["date_price"]);
525
+ circulation_tips += ", 当时价: " + Util.digit_compare_trend1(Stock["price"], j["date_price"]);
521
526
  }
522
- $("#circulation_holder_tips").html("(持股数环比: " + Util.year_price_rate(circulation_volume, pre_circulation_volume) + price_tips + ")");
523
- } else {
524
- $("#circulation_holder_tips").html("");
527
+ circulation_tips += " ]";
525
528
  }
526
- if (main_volume > 0 && pre_main_volume > 0) {
527
- $("#main_holder_tips").html("(持股数环比: " + Util.year_price_rate(main_volume, pre_main_volume) + ")");
528
- } else {
529
- $("#main_holder_tips").html("");
529
+ $("#circulation_holder_tips").html(circulation_tips);
530
+ if (main_volume > 0) {
531
+ main_tips += " [ 当前十大主要股东总持股数: <span class='label label-info'>" + Util.to_unit(main_volume, 3) + "</span>";
532
+ if (pre_main_volume > 0) {
533
+ main_tips += ", 上一季度是: <span class='label label-info'>" + Util.to_unit(pre_main_volume, 3) + "</span>,";
534
+ main_tips += " 持股数环比: " + Util.year_price_rate(main_volume, pre_main_volume, 1);
535
+ }
536
+ main_tips += " ]";
530
537
  }
538
+ $("#main_holder_tips").html(main_tips);
531
539
  let symbol = Util.code_to_symbol(Stock.code);
532
540
  Util.render_table_html("circulation_holder_table_body", circulation_html);
533
541
  $("#circulation_holder_url").attr("href", "https://xueqiu.com/snowman/S/" + symbol + "/detail#/LTGD");
package/util.js CHANGED
@@ -2789,21 +2789,25 @@ const Util = {
2789
2789
  * 年初至今的价格幅度
2790
2790
  * @param price
2791
2791
  * @param year_price
2792
+ * @param is_plus 正数是否有加号,1是0否
2792
2793
  * @returns {string}
2793
2794
  */
2794
- year_price_rate: function (price, year_price) {
2795
- let cls = "", rate_val = 0;
2795
+ year_price_rate: function (price, year_price, is_plus = 0) {
2796
+ let cls = "", plus_sign = "", rate_val = 0;
2796
2797
  if (price > 0 && year_price > 0) {
2797
2798
  if (price > year_price) {
2798
2799
  cls = "text-danger";
2799
2800
  rate_val = Math.round(((price - year_price) / year_price) * 10000) / 100;
2801
+ if (is_plus === 1) {
2802
+ plus_sign = "+";
2803
+ }
2800
2804
  } else if (price < year_price) {
2801
2805
  cls = "text-success";
2802
2806
  rate_val = Math.round(((year_price - price) / year_price) * 10000) / 100;
2803
2807
  rate_val = -rate_val
2804
2808
  }
2805
2809
  }
2806
- return "<b title='" + (year_price + " - " + price) + "' class='" + cls + "'>" + rate_val + "%</b>";
2810
+ return "<b title='" + (year_price + " - " + price) + "' class='" + cls + "'>" + plus_sign + rate_val + "%</b>";
2807
2811
  },
2808
2812
 
2809
2813
  /**