sbd-npm 1.3.45 → 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/package.json +1 -1
- package/stock_basics.js +7 -13
package/package.json
CHANGED
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;
|