sbd-npm 1.1.73 → 1.1.77

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 +12 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.1.73",
3
+ "version": "1.1.77",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -238,7 +238,7 @@ const Util = {
238
238
  html.push("<td>", (item["pe_ttm"] ? item["pe_ttm"] : item["pe"]), "</td>");
239
239
  html.push("<td>", (item["market_capital"] ? (Util.to_float(item["market_capital"], 2) + "亿") : "--"), "</td>");
240
240
  html.push("<td>", Util.industry_url(item["code"], item["industry"]), "</td>");
241
- html.push("<td>", Util.map_url(item["province_city"] ? item["province_city"] : item["area"]), "</td>");
241
+ html.push("<td>", Util.map_url((item["province_city"] && item["province_city"] !== "None") ? item["province_city"] : item["area"]), "</td>");
242
242
  let price = item["stock_price"] ? item["stock_price"] : item["price"];
243
243
  let pre_price = item["pre_price"] ? item["pre_price"] : (item["previous_price"] ? item["previous_price"] : 0)
244
244
  if (pre_price > 0) {
@@ -391,15 +391,11 @@ const Util = {
391
391
  $("#average_" + code).html(Util.to_float(item["amount"] / item["volume"], 2));
392
392
  }
393
393
  let remark_obj = $("#remark_" + code);
394
- if (remark_obj.length > 0) {
394
+ if (remark_obj.length > 0 && ((item["buy"] && item["buy"] > 0) || (item["sell"] && item["sell"] > 0))) {
395
395
  remark_obj.removeClass("success");
396
396
  remark_obj.removeClass("danger");
397
- if ((item["buy"] && item["buy"] > 0) || (item["sell"] && item["sell"] > 0)) {
398
- remark_obj.addClass(item["buy"] > item["sell"] ? "danger" : "success");
399
- remark_obj.attr("title", "五档卖出: " + Util.to_hundred_million(item["sell"]) + "亿\n 五档买入: " + Util.to_hundred_million(item["buy"]) + "亿");
400
- } else {
401
- remark_obj.attr("title", "");
402
- }
397
+ remark_obj.addClass(item["buy"] > item["sell"] ? "danger" : "success");
398
+ remark_obj.attr("title", "五档卖出: " + Util.to_hundred_million(item["sell"]) + "亿\n 五档买入: " + Util.to_hundred_million(item["buy"]) + "亿");
403
399
  }
404
400
  },
405
401
 
@@ -730,7 +726,7 @@ const Util = {
730
726
  } else {
731
727
  tz_obj.html(_html.join(""));
732
728
  }
733
- if (Util.is_mobile() && !tz_obj.hasClass("table-responsive")) {
729
+ if ((Util.is_mobile() || Util.is_small_screen()) && !tz_obj.hasClass("table-responsive")) {
734
730
  let tz_obj_parent = tz_obj.parent();
735
731
  if (!tz_obj_parent.hasClass("table-responsive")) {
736
732
  if (tz_obj_parent.hasClass("row")) {
@@ -929,16 +925,16 @@ const Util = {
929
925
  let public_date = j["public_date"] > 0 ? Util.seconds_to_format(j["public_date"], "%Y-%m-%d") : "--";
930
926
  let issue_date = j["issue_date"] > 0 ? Util.seconds_to_format(j["issue_date"], "%Y-%m-%d") : "--";
931
927
  _html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j["update_time"], "%Y-%m-%d"), "' class='info'><th colspan='12' text-align='center'>基金概况</th></tr>");
932
- _html.push("<tr><td colspan='3'>基金代码</td><td colspan='3'>", Util.pack_html_link('https://fund.jrj.com.cn/archives,' + j["fund_code"] + '.shtml', j["fund_code"]), "</td><td colspan='2'>基金名</td><td colspan='4'>", Util.pack_html_link('https://fund.jrj.com.cn/archives,' + j["fund_code"] + ',jjgk.shtml', j["fund_name"]), "</td></tr>");
928
+ _html.push("<tr><td colspan='3'>基金代码</td><td colspan='3'>", Util.pack_html_link('https://fund.eastmoney.com/' + j["fund_code"] + '.html', j["fund_code"]), "</td><td colspan='2'>基金名</td><td colspan='4'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + j["fund_code"] + '.html', j["fund_name"]), "</td></tr>");
933
929
  _html.push("<tr><td colspan='3'>基金类型</td><td colspan='3'>", j["fund_type"], "</td><td colspan='2'>投资类型</td><td colspan='4'>", j["invest_type"], "</td></tr>");
934
930
  _html.push("<tr><td colspan='3'>单位净值</td><td colspan='3'>", net, "</td><td colspan='2'>资产规模</td><td colspan='4'>", assets, "</td></tr>");
935
931
  _html.push("<tr><td colspan='3'>成立日期</td><td colspan='3'>", public_date, "</td><td colspan='2'>发行日期</td><td colspan='4'>", issue_date, "</td></tr>");
936
- _html.push("<tr><td colspan='3'>基金管理人</td><td colspan='3'>", j["administrator"], "</td><td colspan='2'>基金经理</td><td colspan='4'>", j["managers"], "</td></tr>");
932
+ _html.push("<tr><td colspan='3'>基金管理公司</td><td colspan='3'>", j["administrator"], "</td><td colspan='2'>基金经理</td><td colspan='4'>", j["managers"], "</td></tr>");
937
933
  _html.push("<tr><td colspan='4'>基金托管人</td><td colspan='8'>", j["custodian"], "</td></tr>");
938
934
  _html.push("<tr><td colspan='4'>经办律师事务所</td><td colspan='8'>", j["lawyer"], "</td></tr>");
939
935
  _html.push("<tr><td colspan='4'>会计师事务所</td><td colspan='8'>", j["accounting"], "</td></tr>");
940
936
  _html.push("<tr><td colspan='4'>注册地址</td><td colspan='8'>", Util.map_url(j["location"], j["location"]), "</td></tr>");
941
- let fund_stock_url = "https://fund.jrj.com.cn/archives," + j["fund_code"] + ".shtml";
937
+ let fund_stock_url = "https://fund.eastmoney.com/" + j["fund_code"] + ".html";
942
938
  if (j["type"] === 2) {
943
939
  fund_stock_url = "http://fund.eastmoney.com/f10/ccmx_" + j["fund_code"] + ".html";
944
940
  }
@@ -2653,6 +2649,10 @@ const Util = {
2653
2649
  element.style.height = height;
2654
2650
  }
2655
2651
  }
2652
+ let jq_obj = $("#" + element_id);
2653
+ if ((Util.is_mobile() || Util.is_small_screen()) && !jq_obj.hasClass("table-responsive")) {
2654
+ jq_obj.addClass("table-responsive");
2655
+ }
2656
2656
  return echarts.init(element);
2657
2657
  },
2658
2658