sbd-npm 1.2.27 → 1.2.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.27",
3
+ "version": "1.2.30",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -357,13 +357,15 @@ let Stock = {
357
357
  Util.init_table_skeleton({
358
358
  "element_id": "big_deal_table",
359
359
  "head_cols": [
360
- {"name": "时间", "table_sort": 1},
360
+ {"name": "时间", "table_sort": 1, "class": "info"},
361
361
  {"name": "收盘价", "table_sort": 1},
362
362
  {"name": "主力净流入", "table_sort": 1, "title": "超大单净流入 + 大单净流入"},
363
363
  {"name": "超大单净流入", "table_sort": 1},
364
364
  {"name": "大单净流入", "table_sort": 1},
365
365
  {"name": "中单净流入", "table_sort": 1},
366
366
  {"name": "小单净流入", "table_sort": 1},
367
+ {"name": "成交量", "table_sort": 1},
368
+ {"name": "成交额", "table_sort": 1},
367
369
  ]
368
370
  });
369
371
  Util.post("/stock/" + Stock.code, {action: "big_deal"}, function (j) {
@@ -400,6 +402,8 @@ let Stock = {
400
402
  _html.push("<td data-val='", item["big_net_inflow"], "'><b class='", Util.text_color(item["big_net_inflow"]), "'>", Util.to_unit(item["big_net_inflow"]), "</b></td>");
401
403
  _html.push("<td data-val='", item["middle_net_inflow"], "'><b class='", Util.text_color(item["middle_net_inflow"]), "'>", Util.to_unit(item["middle_net_inflow"]), "</b></td>");
402
404
  _html.push("<td data-val='", item["small_net_inflow"], "'><b class='", Util.text_color(item["small_net_inflow"]), "'>", Util.to_unit(item["small_net_inflow"]), "</b></td>");
405
+ _html.push("<td class='volume-td'>", Util.to_float(item["volume"] / 10000, 2), "万手</td>");
406
+ _html.push("<td class='amount-td'>", Util.to_hundred_million(item["amount"]), "亿</td>");
403
407
  _html.push("</tr>");
404
408
  });
405
409
  Util.render_table_html("big_deal_table_body", _html);
package/util.js CHANGED
@@ -481,6 +481,17 @@ const Util = {
481
481
  return html;
482
482
  },
483
483
 
484
+ /**
485
+ * 美股 LOGO
486
+ * @param code
487
+ * @returns {*}
488
+ */
489
+ us_logo_html: function(code) {
490
+ code = code.toUpperCase();
491
+ let logo_url = "https://storage.googleapis.com/iex/api/logos/" + code + ".png";
492
+ return '<a rel="noopener noreferrer nofollow" href="' + logo_url + '" target="_blank"><img alt="' + code + '" width="20px" src="' + logo_url + '"/><a>';
493
+ },
494
+
484
495
  /**
485
496
  * 随机一股
486
497
  * @param rand_btn_id
@@ -865,6 +876,8 @@ const Util = {
865
876
  head_cols.push({"name": "成交均价", "table_sort": 1});
866
877
  head_cols.push({"name": "股东数", "table_sort": 1});
867
878
  head_cols.push({"name": "备注", "id": "stock_category_remark_title"});
879
+ } else {
880
+ head_cols.unshift({"name": ""});
868
881
  }
869
882
  let table_options = {
870
883
  "element_id": table_id,
@@ -893,17 +906,19 @@ const Util = {
893
906
 
894
907
  render_stock_category_html: function () {
895
908
  if (Util["stock_category_table_id"]) {
896
- let _html = [];
897
- let total_num = 0;
909
+ let _html = [], total_num = 0;
910
+ let is_us = $("#stock_category_remark_title").length === 0 ? 1 : 0;
898
911
  if (Util["stock_category_data"]) {
899
912
  let industry = $("#stock_category_industry").val();
900
913
  let area = $("#stock_category_area").val();
901
- let is_us = $("#stock_category_remark_title").length === 0 ? 1 : 0;
902
914
  Util["stock_category_data"].forEach(function (item) {
903
915
  if (Util.is_industry_area(item, industry, area)) {
904
916
  total_num++;
905
917
  _html.push("<tr>");
906
918
  item["code"] = item["code"].toLowerCase();
919
+ if (is_us === 1) {
920
+ _html.push('<td>', Util.us_logo_html(item["code"]), '</td>');
921
+ }
907
922
  _html = Util.stock_basics_html(_html, item);
908
923
  _html.push("<td id='high_", item["code"], "'>0</td>");
909
924
  _html.push("<td id='low_", item["code"], "'>0</td>");
@@ -921,6 +936,11 @@ const Util = {
921
936
  });
922
937
  }
923
938
  Util.render_table_html(Util["stock_category_table_id"] + "_body", _html);
939
+ if (is_us === 1) {
940
+ $("img").on("error", function () {
941
+ $(this).attr("src", "https://storage.googleapis.com/iex/api/logos/LI.png");
942
+ });
943
+ }
924
944
  $("#" + Util["stock_category_table_id"] + "_body_tips").html('共 <span class="label label-info">' + total_num + '</span> 家');
925
945
  }
926
946
  },
@@ -1450,7 +1470,7 @@ const Util = {
1450
1470
  _html.push('<option value="2">这月</option>');
1451
1471
  _html.push('<option value="3">上一周</option>');
1452
1472
  _html.push('<option value="4">上一月</option>');
1453
- _html.push('<option value="5">今年以来</option>');
1473
+ _html.push('<option value="5">年初至今</option>');
1454
1474
  _html.push('<option value="6">最近7日</option>');
1455
1475
  _html.push('<option value="7">最近30日</option>');
1456
1476
  _html.push('<option value="8">最近60日</option>');
@@ -1499,7 +1519,7 @@ const Util = {
1499
1519
  sd_obj.val(year + "-" + month + "-01");
1500
1520
  ed_obj.val(Util.seconds_to_format(pre_month_end_second, "%Y-%m-%d"));
1501
1521
  break;
1502
- case "5": // 今年以来
1522
+ case "5": // 年初至今
1503
1523
  sd_obj.val(year + "-01-01");
1504
1524
  ed_obj.val(Util.seconds_to_format(midnight_second, "%Y-%m-%d"));
1505
1525
  break;