sbd-npm 1.3.62 → 1.3.63

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 +15 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.62",
3
+ "version": "1.3.63",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -1237,9 +1237,21 @@ const Util = {
1237
1237
  price_data.push(item["price"]);
1238
1238
  _html.push("<tr>");
1239
1239
  _html.push("<td>", Util.pack_html_link("https://data.eastmoney.com/zlsj/detail/" + date_format + "-1-" + code + ".html", date_format), "</td>");
1240
- _html.push("<td>", item["price"], "</td>");
1241
- _html.push("<td data-val='", item["stock_num"], "' title='", item["stock_num"], "'>", Util.to_unit(item["stock_num"], 3), "股</td>");
1242
- _html.push("<td>", item["fund_num"], "</td>");
1240
+ if (item["pre_price"]) {
1241
+ _html.push("<td>", Util.digit_compare_trend(item["price"], item["pre_price"]), "</td>");
1242
+ } else {
1243
+ _html.push("<td>", item["price"], "</td>");
1244
+ }
1245
+ let stock_num_rate = "";
1246
+ if (item["pre_stock_num"]) {
1247
+ stock_num_rate = "(" + Util.year_price_rate(item["stock_num"], item["pre_stock_num"], 1) + ")";
1248
+ }
1249
+ _html.push("<td data-val='", item["stock_num"], "' title='", item["stock_num"], "'>", Util.to_unit(item["stock_num"], 3), "股", stock_num_rate, "</td>");
1250
+ let fund_num_rate = "";
1251
+ if (item["pre_fund_num"]) {
1252
+ fund_num_rate = "(" + Util.year_price_rate(item["fund_num"], item["pre_fund_num"], 1) + ")";
1253
+ }
1254
+ _html.push("<td>", item["fund_num"], fund_num_rate, "</td>");
1243
1255
  let market_capital = item["price"] * item["stock_num"];
1244
1256
  _html.push("<td data-val='", market_capital, "' title='", market_capital, "'>", Util.to_unit(market_capital, 4), "</td>");
1245
1257
  _html.push("</tr>");