sbd-npm 1.1.60 → 1.1.61

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +16 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.1.60",
3
+ "version": "1.1.61",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -364,12 +364,9 @@ const Util = {
364
364
  $(this).html(Util.year_price_rate(item["price"], item["high_52week"]));
365
365
  });
366
366
  }
367
- if (item["holder_num"] && item["holder_num"] > 0 && item["pre_holder_num"]) {
368
- $(".holder_" + code).each(function () {
369
- let url = Util.get_url("holder_num") + "?code=" + item["code"];
370
- $(this).html(Util.pack_html_link(url, Util.digit_compare_trend(item["holder_num"], item["pre_holder_num"])));
371
- });
372
- }
367
+ $(".holder_" + code).each(function () {
368
+ $(this).html(Util.pack_holder_num(item));
369
+ });
373
370
  }
374
371
  if (item["high"]) {
375
372
  let high_price = Util.digit_compare_trend(item["high"], item["previous_price"]);
@@ -2077,6 +2074,19 @@ const Util = {
2077
2074
  return index_html;
2078
2075
  },
2079
2076
 
2077
+ /**
2078
+ * 组装股东数据
2079
+ * @param item
2080
+ * @returns {string}
2081
+ */
2082
+ pack_holder_num: function(item) {
2083
+ if (item["holder_num"] && item["holder_num"] > 0 && item["pre_holder_num"]) {
2084
+ let url = Util.get_url("holder_num") + "?code=" + item["code"];
2085
+ return Util.pack_html_link(url, Util.digit_compare_trend(item["holder_num"], item["pre_holder_num"]));
2086
+ }
2087
+ return "--";
2088
+ },
2089
+
2080
2090
  /**
2081
2091
  * 组装 HTML 超链接
2082
2092
  * @param url