sbd-npm 1.2.39 → 1.2.40

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 +20 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.39",
3
+ "version": "1.2.40",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -2092,9 +2092,7 @@ const Util = {
2092
2092
  //获取股票详情数据
2093
2093
  Util.post("/action", {action: "code_detail", code_list: code_list.join("-")}, function (j) {
2094
2094
  let valid_code_list = [];
2095
- let total_change_percent = 0;
2096
- let total_year_change_percent = 0;
2097
- let total_d5_change_percent = 0;
2095
+ let total_change_percent = 0, total_year_change_percent = 0, total_d5_change_percent = 0;
2098
2096
  $.each(j, function (code, item) {
2099
2097
  if (item["price"] && item["previous_price"] && item["price"] > 0 && item["previous_price"] > 0) {
2100
2098
  valid_code_list.push(item["code"]);
@@ -2113,6 +2111,12 @@ const Util = {
2113
2111
  $(this).attr("data-val", item["holder_num"]);
2114
2112
  });
2115
2113
  }
2114
+ if (item["cur_fund_num"] && item["cur_fund_num"] > 0) {
2115
+ $(".fund_" + code).each(function () {
2116
+ $(this).html(Util.pack_fund_num(item));
2117
+ $(this).attr("data-val", item["cur_fund_num"]);
2118
+ });
2119
+ }
2116
2120
  if (item["money_net_inflow"] && item["money_net_inflow"] !== 0) {
2117
2121
  $(".money_inflow_" + code).each(function () {
2118
2122
  Util.render_money_inflow($(this), item);
@@ -2397,6 +2401,19 @@ const Util = {
2397
2401
  return "--";
2398
2402
  },
2399
2403
 
2404
+ /**
2405
+ * 组装基金数据
2406
+ * @param item
2407
+ * @returns {string}
2408
+ */
2409
+ pack_fund_num: function (item) {
2410
+ if (item["cur_fund_num"] && item["cur_fund_num"] > 0) {
2411
+ let fund_num = Util.digit_compare_trend(item["cur_fund_num"], item["pre_fund_num"]);
2412
+ return Util.pack_html_link("/stock/" + item["code"] + "?tab=public_fund", fund_num);
2413
+ }
2414
+ return "--";
2415
+ },
2416
+
2400
2417
  /**
2401
2418
  * 雪球人数关注排名数据
2402
2419
  * @param item