sbd-npm 1.2.13 → 1.2.16

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.
@@ -228,3 +228,19 @@ const MenuList = [
228
228
  ]
229
229
  },
230
230
  ];
231
+
232
+ const ClassifyList = [
233
+ '上证50',
234
+ '沪深300',
235
+ '中证800',
236
+ '中证1000',
237
+ '中证500',
238
+ '中证100',
239
+ '科创50',
240
+ '科创',
241
+ '中小板',
242
+ '创业板',
243
+ '创业板50',
244
+ '创业板指',
245
+ '新股',
246
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.13",
3
+ "version": "1.2.16",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -613,11 +613,11 @@ let Stock = {
613
613
  "element_id": "profit_table",
614
614
  "head_cols": [
615
615
  {"name": "年份季度"},
616
- {"name": "净资产收益率(ROE)", "tooltip": "Return On Equity"},
616
+ {"name": "ROE", "tooltip": "净资产收益率(Return On Equity)"},
617
617
  {"name": "净利率(%)"},
618
618
  {"name": "毛利率"},
619
619
  {"name": "净利润"},
620
- {"name": "每股收益(EPS)", "tooltip": "Earnings Per Share"},
620
+ {"name": "EPS", "tooltip": "每股收益(Earnings Per Share)"},
621
621
  {"name": "营业收入"},
622
622
  {"name": "每股主营业务收入"},
623
623
  ]
@@ -1226,11 +1226,8 @@ let Stock = {
1226
1226
  },
1227
1227
 
1228
1228
  fetch_hkex_holding: function () {
1229
+ let is_summary = Stock.hkex_holding_chart ? 0 : 1;
1229
1230
  Stock["hkex_holding_chart"] = Util.show_chart_loading(Stock["hkex_holding_chart"], "hkex_holding_line_canvas");
1230
- let is_summary = 0;
1231
- if (!Stock.hkex_holding_chart) {
1232
- is_summary = 1;
1233
- }
1234
1231
  let payload = {
1235
1232
  action: "hkex_holding",
1236
1233
  is_summary: is_summary,
@@ -1248,33 +1245,35 @@ let Stock = {
1248
1245
  volume_data.push(item["volume"]);
1249
1246
  price_data.push(item["price"]);
1250
1247
  });
1251
- let hhs_obj = $("#hkex_holding_summary");
1252
- let hkex_holding_summary = "[" + Util.pack_html_link(j["url"], hhs_obj.text()) + "]";
1253
- if (!Stock.hkex_holding_chart && j["latest"].length > 0) {
1254
- let circulation_stock = $("#circulation_stock").attr("data-val");
1255
- let latest_html = "";
1256
- if (j["latest"].length === 1) {
1257
- let holding_num = Util.to_hundred_million(j["latest"][0]["volume"]);
1258
- let holding_rate = Math.round((holding_num / circulation_stock) * 10000) / 100;
1259
- latest_html = "最新(" + Util.seconds_to_format(j["latest"][0]["date"], "%Y-%m-%d") + "): " + holding_num + "亿股, 占 <b>" + holding_rate + "%</b> 流通股, ";
1260
- } else if (j["latest"].length === 2) {
1261
- let d1 = j["latest"][0];
1262
- let d2 = j["latest"][1];
1263
- let difference = d1["volume"] - d2["volume"];
1264
- let dist_tips = "";
1265
- if (difference > 0) {
1266
- dist_tips = "(<b title='" + Util.strip_html(Util.to_unit(d2["volume"])) + "股' style='color: #a94442;'>+" + Util.strip_html(Util.to_unit(difference)) + "股</b>)";
1267
- } else if (difference < 0) {
1268
- dist_tips = "(<b title='" + Util.strip_html(Util.to_unit(d2["volume"])) + "股' style='color: #3c763d;'>" + Util.strip_html(Util.to_unit(difference)) + "股</b>)";
1248
+ if (is_summary === 1) {
1249
+ let hhs_obj = $("#hkex_holding_summary");
1250
+ let hkex_holding_summary = "[" + Util.pack_html_link(j["url"], hhs_obj.text()) + "]";
1251
+ if (j["latest"].length > 0) {
1252
+ let circulation_stock = $("#circulation_stock").attr("data-val");
1253
+ let latest_html = "";
1254
+ if (j["latest"].length === 1) {
1255
+ let holding_num = Util.to_hundred_million(j["latest"][0]["volume"]);
1256
+ let holding_rate = Math.round((holding_num / circulation_stock) * 10000) / 100;
1257
+ latest_html = "最新(" + Util.seconds_to_format(j["latest"][0]["date"], "%Y-%m-%d") + "): " + holding_num + "亿股, 占 <b>" + holding_rate + "%</b> 流通股, ";
1258
+ } else if (j["latest"].length === 2) {
1259
+ let d1 = j["latest"][0];
1260
+ let d2 = j["latest"][1];
1261
+ let difference = d1["volume"] - d2["volume"];
1262
+ let dist_tips = "";
1263
+ if (difference > 0) {
1264
+ dist_tips = "(<b title='" + Util.strip_html(Util.to_unit(d2["volume"])) + "股' style='color: #a94442;'>+" + Util.strip_html(Util.to_unit(difference)) + "股</b>)";
1265
+ } else if (difference < 0) {
1266
+ dist_tips = "(<b title='" + Util.strip_html(Util.to_unit(d2["volume"])) + "股' style='color: #3c763d;'>" + Util.strip_html(Util.to_unit(difference)) + "股</b>)";
1267
+ }
1268
+ let holding_num = Util.to_hundred_million(d1["volume"]);
1269
+ let holding_rate = Math.round((holding_num / circulation_stock) * 10000) / 100;
1270
+ latest_html = "最新(" + Util.seconds_to_format(d1["date"], "%Y-%m-%d") + "): " + holding_num + "亿股" + dist_tips + ", 占 <b>" + holding_rate + "%</b> 流通股, ";
1269
1271
  }
1270
- let holding_num = Util.to_hundred_million(d1["volume"]);
1271
- let holding_rate = Math.round((holding_num / circulation_stock) * 10000) / 100;
1272
- latest_html = "最新(" + Util.seconds_to_format(d1["date"], "%Y-%m-%d") + "): " + holding_num + "亿股" + dist_tips + ", 占 <b>" + holding_rate + "%</b> 流通股, ";
1272
+ hkex_holding_summary += (latest_html + ' 最高: ' + Util.to_unit(j["high"]["volume"]) + '股(' + Util.seconds_to_format(j["high"]["date"], "%Y-%m-%d") +
1273
+ ') 最低: ' + Util.to_unit(j["low"]["volume"]) + '股(' + Util.seconds_to_format(j["low"]["date"], "%Y-%m-%d") + ')');
1273
1274
  }
1274
- hkex_holding_summary += (latest_html + ' 最高: ' + Util.to_unit(j["high"]["volume"]) + '股(' + Util.seconds_to_format(j["high"]["date"], "%Y-%m-%d") +
1275
- ') 最低: ' + Util.to_unit(j["low"]["volume"]) + '股(' + Util.seconds_to_format(j["low"]["date"], "%Y-%m-%d") + ')');
1275
+ hhs_obj.html(hkex_holding_summary);
1276
1276
  }
1277
- hhs_obj.html(hkex_holding_summary);
1278
1277
  Stock["hkex_holding_chart"] = Util.multi_axis_line(Stock["hkex_holding_chart"], "hkex_holding_line_canvas", date_data, '持股数', volume_data, '股价', price_data);
1279
1278
  let flow_data = [];
1280
1279
  date_data = [];
package/util.js CHANGED
@@ -577,6 +577,13 @@ const Util = {
577
577
  return /(iPhone|iPad|iPod|iOS|Android|Mobile)/i.test(navigator.userAgent);
578
578
  },
579
579
 
580
+ /**
581
+ * 是否苹果系的设备
582
+ */
583
+ is_macintosh: function () {
584
+ return /(Mac|iPhone|iPod|iPad)/i.test(navigator.userAgent);
585
+ },
586
+
580
587
  /**
581
588
  * 分页函数
582
589
  * @param data_id
package/.npmignore DELETED
@@ -1 +0,0 @@
1
- sbd-npm.md