sbd-npm 1.3.44 → 1.3.46

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.
package/constant.js CHANGED
@@ -139,9 +139,10 @@ const MenuList = [
139
139
  'icon': 'retweet',
140
140
  'menu': [
141
141
  {'key': 'portfolio_recommend', 'name': '关注', 'url': '/0x2da99e58e28de94b670c4200657ac7e26dd8dceb'},
142
- {'key': 'portfolio_cloud', 'name': '心似白云常自在', 'url': '/0x9ea6081b57418a7f987775631043f7f924e25cff'},
142
+ {'key': 'portfolio_chen', 'name': '陈营长极品投资', 'url': '/0x3f8cbeeeb38138a626e935017a4cc25f47ce3dbe'},
143
143
  {'key': 'portfolio_vegetable', 'name': 'Veget', 'url': '/0x671dd9dcfca7dbc220c8164c92a74d2c561c6464'},
144
144
  {'key': 'portfolio_follow', 'name': '跟我走吧14', 'url': '/0x4aa68e74a66297c0ece1bb05fad20c32ee1db9e4'},
145
+ {'key': 'portfolio_cloud', 'name': '心似白云常自在', 'url': '/0x9ea6081b57418a7f987775631043f7f924e25cff'},
145
146
  {'key': 'portfolio_tianjin', 'name': '天津股侠', 'url': '/0xb8428e42237a7485a787e2ab1b5ae0f057258f18'},
146
147
  {'key': 'portfolio_zan', 'name': 'zangyn', 'url': '/0xccb07ddaf4f1219b7b5ae64780e7905206927873'},
147
148
  {'key': 'portfolio_peng', 'name': '吴小朋同学', 'url': '/0x4f1a316c05731e365ec1b7ef454d98206fa973f6'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.44",
3
+ "version": "1.3.46",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -721,8 +721,7 @@ let Stock = {
721
721
  Util.post("/stock/" + Stock["code"], {action: "holder_num"}, function (j) {
722
722
  Stock["holder_chart"].hideLoading();
723
723
  let _html = [], date_data = [], holder_data = [], price_data = [];
724
- let latest_date = 0, max_holder_num = 0, max_holder_num_date = 0, min_holder_num_date = 0;
725
- let min_holder_num = Util.one_year_second;
724
+ let latest_date = 0, max_holder_num = 0, max_holder_num_date = 0, min_holder_num = Util.max_32bit_integer, min_holder_num_date = 0;
726
725
  j["data"].forEach(function (item) {
727
726
  let date_format = Util.seconds_to_format(item["date"], "%Y-%m-%d");
728
727
  latest_date = Math.max(latest_date, item["date"]);
@@ -743,21 +742,16 @@ let Stock = {
743
742
  _html.push("<td><b class='", Util.text_color(item["price_change"]), "'>", item["price"], "(", item["price_change"], "%)</b></td>");
744
743
  _html.push("<td>", item["avg_num"], "</td>");
745
744
  _html.push("<td>", Util.to_unit(item["avg_num"] * item["price"]), "</td>");
746
- _html.push("<td>", item["circulation_stock"], "</td>");
747
- _html.push("<td>", item["circulation_stock_ratio"], "%</td>");
748
- _html.push("<td>", item["main_stock"], "</td>");
749
- _html.push("<td>", item["main_stock_ratio"], "%</td>");
750
- _html.push("<td>", item["fund_stock"], "</td>");
751
- _html.push("<td>", item["fund_stock_ratio"], "%</td>");
745
+ _html.push("<td>", (item["circulation_stock"] ? item["circulation_stock"] : 0), "</td>");
746
+ _html.push("<td>", (item["circulation_stock_ratio"] ? item["circulation_stock_ratio"] : 0), "%</td>");
747
+ _html.push("<td>", (item["main_stock"] ? item["main_stock"] : 0), "</td>");
748
+ _html.push("<td>", (item["main_stock_ratio"] ? item["main_stock_ratio"] : 0), "%</td>");
749
+ _html.push("<td>", (item["fund_stock"] ? item["fund_stock"] : 0), "</td>");
750
+ _html.push("<td>", (item["fund_stock_ratio"] ? item["fund_stock_ratio"] : 0), "%</td>");
752
751
  _html.push("</tr>");
753
752
  });
754
753
  let holder_num_summary = "";
755
754
  if (j["latest_date"]) {
756
- if (j["previous_date"] > latest_date) {
757
- date_data.unshift(Util.seconds_to_format(j["previous_date"], "%Y-%m-%d")); // 将新项添加到数组的开头
758
- holder_data.unshift(j["previous_holder_num"]);
759
- price_data.unshift(j["previous_day_price"]);
760
- }
761
755
  let latest_date_format = Util.seconds_to_format(j["latest_date"], "%Y-%m-%d");
762
756
  if (j["latest_date"] > latest_date) {
763
757
  latest_date = latest_date_format;
@@ -1155,19 +1149,15 @@ let Stock = {
1155
1149
  };
1156
1150
  Util.post("/stock/" + Stock["code"], payload, function (j) {
1157
1151
  Stock["rzye_chart"].hideLoading();
1158
- let date_data = [], rzye_data = [], rqye_data = [], price_data = [], rqye_color_data = [], rzye_low = 0, rzye_high = 0, rqye_low = 0, rqye_high = 0;
1152
+ let date_data = [], rzye_data = [], rqye_data = [], price_data = [], rqye_color_data = [], rzye_low = Number.MAX_SAFE_INTEGER, rzye_high = 0, rqye_low = Number.MAX_SAFE_INTEGER, rqye_high = 0;
1159
1153
  j["data"].forEach(function (item) {
1160
1154
  date_data.push(Util.seconds_to_format(item["date"], "%Y-%m-%d"));
1161
- if (rzye_low === 0 || item["rzye"] < rzye_low) {
1162
- rzye_low = item["rzye"];
1163
- }
1155
+ rzye_low = Math.min(rzye_low, item["rzye"]);
1164
1156
  rzye_high = Math.max(rzye_high, item["rzye"]);
1165
1157
  rzye_data.push(Util.to_hundred_million(item["rzye"], 3));
1166
- if (rqye_low === 0 || item["rqye"] < rqye_low) {
1167
- rqye_low = item["rqye"];
1168
- }
1158
+ rqye_low = Math.min(rqye_low, item["rqye"]);
1169
1159
  rqye_high = Math.max(rqye_high, item["rqye"]);
1170
- rqye_data.push(Util.to_ten_thousand(item["rqye"], 2));
1160
+ rqye_data.push(Util.to_ten_thousand(item["rqye"], 3));
1171
1161
  price_data.push(item["price"]);
1172
1162
  rqye_color_data.push("#E74C3C");
1173
1163
  });
package/util.js CHANGED
@@ -37,6 +37,8 @@ const Util = {
37
37
  one_week_second: 604800,
38
38
  // 1年的秒数(365 * 86400)
39
39
  one_year_second: 31536000,
40
+ // 32位最大数字(Number.MAX_SAFE_INTEGER:2^53 - 1,即 9007199254740991,Number.MAX_VALUE:1.7976931348623157e+308)
41
+ max_32bit_integer: 4294967295,
40
42
 
41
43
  // https://omnipotent.net/jquery.sparkline/
42
44
  SparkOptions: {