sbd-npm 1.4.21 → 1.4.23
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 +2 -1
- package/package.json +2 -2
- package/status.js +85 -85
- package/stock_basics.js +143 -143
- package/summary_daily.js +56 -56
- package/util.js +295 -293
package/stock_basics.js
CHANGED
@@ -139,7 +139,7 @@ let Stock = {
|
|
139
139
|
},
|
140
140
|
|
141
141
|
fetch_base: function () {
|
142
|
-
let
|
142
|
+
let html = [];
|
143
143
|
let code_obj = $("#code");
|
144
144
|
code_obj.html(Util.snowball_url(code_obj.text()));
|
145
145
|
|
@@ -150,21 +150,21 @@ let Stock = {
|
|
150
150
|
let concept_obj = $("#concept");
|
151
151
|
if (concept_obj.length > 0) {
|
152
152
|
let concept_arr = concept_obj.html().split(",");
|
153
|
-
|
153
|
+
html = [];
|
154
154
|
concept_arr.forEach(function (item) {
|
155
|
-
|
155
|
+
html.push('<a target="_blank" rel="noopener noreferrer nofollow" href="', Util.get_url("query_list"), '?concept=', item, '" class="btn btn-xs btn-warning">', item, '</a> ');
|
156
156
|
});
|
157
|
-
concept_obj.html(
|
157
|
+
concept_obj.html(html.join(""));
|
158
158
|
}
|
159
159
|
|
160
160
|
let location_obj = $("#location");
|
161
161
|
if (location_obj.length > 0) {
|
162
162
|
let location_arr = location_obj.text().split(",");
|
163
|
-
|
163
|
+
html = [];
|
164
164
|
location_arr.forEach(function (location) {
|
165
|
-
|
165
|
+
html.push(Util.map_url(location, location) + ' ');
|
166
166
|
});
|
167
|
-
location_obj.html(
|
167
|
+
location_obj.html(html.join(""));
|
168
168
|
}
|
169
169
|
let cf_obj = $("#currency_funds");
|
170
170
|
cf_obj.html(Util.to_unit(cf_obj.attr("title"), 2, 0));
|
@@ -258,7 +258,7 @@ let Stock = {
|
|
258
258
|
// 日均线/抵扣价数据
|
259
259
|
Util.render_ma_deduction(item, "ma_deduction");
|
260
260
|
if (item["boll_up"] && item["boll_up"] > 0 && item["boll_down"] && item["boll_down"] > 0) {
|
261
|
-
$("#boll").html("<a title='当前上轨线 / 当前下轨线' target='_blank' rel='noopener noreferrer nofollow' href='" + Util.get_url("
|
261
|
+
$("#boll").html("<a title='当前上轨线 / 当前下轨线' target='_blank' rel='noopener noreferrer nofollow' href='" + Util.get_url("trend_boll_lower_band") + "'><b class='text-danger'>" + Util.to_float(item["boll_up"], 2) + "</b> / <b class='text-success'>" + Util.to_float(item["boll_down"], 2) + "</b></a>");
|
262
262
|
}
|
263
263
|
if (item["usd_exchange_rate"] && item["usd_exchange_rate"] > 0) {
|
264
264
|
let market_capital = $("#market_capital").attr("data-val");
|
@@ -291,7 +291,7 @@ let Stock = {
|
|
291
291
|
};
|
292
292
|
Util.post("/stock/" + Stock["code"], payload, function (j) {
|
293
293
|
Stock.hist_type = "";
|
294
|
-
let
|
294
|
+
let html = [], hist_low_price = 0, hist_high_price = 0, total_amount = 0, total_volume = 0;
|
295
295
|
j["data"].forEach(function (item) {
|
296
296
|
if (hist_low_price === 0 || hist_low_price > item["low"]) {
|
297
297
|
hist_low_price = item["low"];
|
@@ -299,25 +299,25 @@ let Stock = {
|
|
299
299
|
hist_high_price = Math.max(hist_high_price, item["high"]);
|
300
300
|
total_amount += item["amount"];
|
301
301
|
total_volume += item["volume"] * 100;
|
302
|
-
|
302
|
+
html.push("<tr>");
|
303
303
|
let tick_time = Util.seconds_to_format(item["date"], "%Y%m%d");
|
304
304
|
let tick_url = "/tick?c=" + Stock.code + "&s=" + tick_time + "&e=" + tick_time;
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
305
|
+
html.push("<td><a href='", tick_url, "'>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</a></td>");
|
306
|
+
html.push("<td>", item["open"], "</td>");
|
307
|
+
html.push("<td class='price_low'>", item["low"], "</td>");
|
308
|
+
html.push("<td class='price_high'>", item["high"], "</td>");
|
309
309
|
let cls = Util.text_color(item["p_change"]);
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
310
|
+
html.push("<td><b class='", cls, "'>", item["close"], "</b></td>");
|
311
|
+
html.push("<td><b class='", cls, "'>", item["p_change"], "%</b></td>");
|
312
|
+
html.push("<td>", Util.to_float(item["amount"] / (item["volume"] * 100), 2), "</td>");
|
313
|
+
html.push("<td class='volume-td'>", Util.to_float(item["volume"] / 10000, 2), "万手</td>");
|
314
|
+
html.push("<td class='volume_ratio-td'>", item["volume_ratio"], "</td>");
|
315
|
+
html.push("<td class='volume_ratio30-td'>", (item["volume_ratio30"] ? item["volume_ratio30"] : "--"), "</td>");
|
316
|
+
html.push("<td class='amount-td'>", Util.to_hundred_million(item["amount"]), "亿</td>");
|
317
|
+
html.push("<td>", (item["turnover"] > 0 ? (item["turnover"] + "%") : "--"), "</td>");
|
318
|
+
html.push("</tr>");
|
319
319
|
});
|
320
|
-
Util.render_table_html("hist_table_body",
|
320
|
+
Util.render_table_html("hist_table_body", html);
|
321
321
|
$(".price_low").each(function () {
|
322
322
|
if (parseFloat($(this).text()) === hist_low_price) {
|
323
323
|
$(this).html("<span class='label label-success'>" + hist_low_price + "</span>");
|
@@ -394,7 +394,7 @@ let Stock = {
|
|
394
394
|
//Stock.pack_big_deal("big_deal1", j["data"], "最近一天", date, date);
|
395
395
|
}
|
396
396
|
if (j["money_net_inflow"]) {
|
397
|
-
let
|
397
|
+
let html = [], i = 0, total_net_inflow = 0;
|
398
398
|
let day3_net_inflow = 0, day5_net_inflow = 0, day10_net_inflow = 0, day20_net_inflow = 0, day60_net_inflow = 0;
|
399
399
|
j["money_net_inflow"].forEach(function (item) {
|
400
400
|
i++;
|
@@ -414,29 +414,29 @@ let Stock = {
|
|
414
414
|
if (i <= 60) {
|
415
415
|
day60_net_inflow += item["main_net_inflow"];
|
416
416
|
}
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
417
|
+
html.push("<tr>");
|
418
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
419
|
+
html.push("<td><b class='", Util.text_color(item["price_change"]), "'>", item["price"], "(", item["price_change"], "%)</b></td>");
|
420
|
+
html.push("<td data-val='", item["main_net_inflow"], "'><b class='", Util.text_color(item["main_net_inflow"]), "'>", Util.to_unit(item["main_net_inflow"]), "</b></td>");
|
421
|
+
html.push("<td data-val='", item["large_net_inflow"], "'><b class='", Util.text_color(item["large_net_inflow"]), "'>", Util.to_unit(item["large_net_inflow"]), "</b></td>");
|
422
|
+
html.push("<td data-val='", item["big_net_inflow"], "'><b class='", Util.text_color(item["big_net_inflow"]), "'>", Util.to_unit(item["big_net_inflow"]), "</b></td>");
|
423
|
+
html.push("<td data-val='", item["middle_net_inflow"], "'><b class='", Util.text_color(item["middle_net_inflow"]), "'>", Util.to_unit(item["middle_net_inflow"]), "</b></td>");
|
424
|
+
html.push("<td data-val='", item["small_net_inflow"], "'><b class='", Util.text_color(item["small_net_inflow"]), "'>", Util.to_unit(item["small_net_inflow"]), "</b></td>");
|
425
|
+
html.push("<td class='volume-td'>", Util.to_float(item["volume"] / 10000, 2), "万手</td>");
|
426
|
+
html.push("<td class='amount-td'>", Util.to_hundred_million(item["amount"]), "亿</td>");
|
427
|
+
html.push("</tr>");
|
428
428
|
});
|
429
|
-
Util.render_table_html("big_deal_table_body",
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
Util.render_table_html("big_deal_summary_table_body",
|
429
|
+
Util.render_table_html("big_deal_table_body", html);
|
430
|
+
html = [];
|
431
|
+
html.push("<tr>");
|
432
|
+
html.push("<td><b class='", Util.text_color(total_net_inflow), "'>", Util.to_unit(total_net_inflow, 3), "</b></td>");
|
433
|
+
html.push("<td><b class='", Util.text_color(day60_net_inflow), "'>", Util.to_unit(day60_net_inflow, 3), "</b></td>");
|
434
|
+
html.push("<td><b class='", Util.text_color(day20_net_inflow), "'>", Util.to_unit(day20_net_inflow, 3), "</b></td>");
|
435
|
+
html.push("<td><b class='", Util.text_color(day10_net_inflow), "'>", Util.to_unit(day10_net_inflow, 3), "</b></td>");
|
436
|
+
html.push("<td><b class='", Util.text_color(day5_net_inflow), "'>", Util.to_unit(day5_net_inflow, 3), "</b></td>");
|
437
|
+
html.push("<td><b class='", Util.text_color(day3_net_inflow), "'>", Util.to_unit(day3_net_inflow, 3), "</b></td>");
|
438
|
+
html.push("</tr>");
|
439
|
+
Util.render_table_html("big_deal_summary_table_body", html);
|
440
440
|
}
|
441
441
|
Util.hide_tips();
|
442
442
|
});
|
@@ -629,29 +629,29 @@ let Stock = {
|
|
629
629
|
});
|
630
630
|
Util.post("/stock/" + Stock["code"], {action: "finance"}, function (j) {
|
631
631
|
// 现金流量表
|
632
|
-
let
|
632
|
+
let html = [], total_ncf_from_oa = 0, total_cash_paid_for_assets = 0, total_free_cash_flow = 0, total_ncf_from_fa = 0;
|
633
633
|
j["cash_flow_data"].forEach(function (item) {
|
634
634
|
total_ncf_from_oa += item["ncf_from_oa"];
|
635
635
|
total_cash_paid_for_assets += item["cash_paid_for_assets"];
|
636
636
|
let free_cash_flow = item["ncf_from_oa"] - item["cash_paid_for_assets"];
|
637
637
|
total_free_cash_flow += free_cash_flow;
|
638
638
|
total_ncf_from_fa += item["ncf_from_fa"];
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
639
|
+
html.push("<tr>");
|
640
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y"), "</td>");
|
641
|
+
html.push("<td>", Util.to_unit(item["ncf_from_oa"]), "</td>");
|
642
|
+
html.push("<td>", Util.to_unit(item["cash_paid_for_assets"]), "</td>");
|
643
|
+
html.push("<td>", Util.to_unit(free_cash_flow), "</td>");
|
644
|
+
html.push("<td>", Util.to_unit(item["ncf_from_fa"]), "</td>");
|
645
|
+
html.push("</tr>");
|
646
646
|
});
|
647
647
|
total_ncf_from_oa = total_ncf_from_oa >= 0 ? (Util.to_hundred_million(total_ncf_from_oa) + "亿") : ("<b class='text-danger'>" + Util.to_hundred_million(total_ncf_from_oa) + "亿</b>");
|
648
648
|
total_cash_paid_for_assets = total_cash_paid_for_assets >= 0 ? (Util.to_hundred_million(total_cash_paid_for_assets) + "亿") : ("<b class='text-danger'>" + Util.to_hundred_million(total_cash_paid_for_assets) + "亿</b>");
|
649
649
|
total_free_cash_flow = total_free_cash_flow >= 0 ? (Util.to_hundred_million(total_free_cash_flow) + "亿") : ("<b class='text-danger'>" + Util.to_hundred_million(total_free_cash_flow) + "亿</b>");
|
650
650
|
total_ncf_from_fa = total_ncf_from_fa >= 0 ? (Util.to_hundred_million(total_ncf_from_fa) + "亿") : ("<b class='text-danger'>" + Util.to_hundred_million(total_ncf_from_fa) + "亿</b>");
|
651
|
-
|
652
|
-
Util.render_table_html("cash_flow_table_body",
|
651
|
+
html.push("<tr><td>总计</td><td>" + total_ncf_from_oa + "</td><td>" + total_cash_paid_for_assets + "</td><td>" + total_free_cash_flow + "</td><td>" + total_ncf_from_fa + "</td></tr>");
|
652
|
+
Util.render_table_html("cash_flow_table_body", html);
|
653
653
|
// 资产负债表
|
654
|
-
|
654
|
+
html = [];
|
655
655
|
j["assets_liabilities_data"].forEach(function (item) {
|
656
656
|
let net_assets = item["total_assets"] - item["total_liabilities"];
|
657
657
|
let goodwill = "--";
|
@@ -664,26 +664,26 @@ let Stock = {
|
|
664
664
|
if (item["debt_asset_ratio"] > 0) {
|
665
665
|
debt_asset_ratio = Util.to_float(item["debt_asset_ratio"], 2) + "%";
|
666
666
|
}
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
667
|
+
html.push("<tr>");
|
668
|
+
html.push("<td>", item["year"], "(", item["quarter"], ")</td>");
|
669
|
+
html.push("<td>", Util.to_unit(item["total_assets"]), "</td>");
|
670
|
+
html.push("<td>", Util.to_unit(item["total_liabilities"]), "</td>");
|
671
|
+
html.push("<td>", Util.to_unit(net_assets), "</td>");
|
672
|
+
html.push("<td>", debt_asset_ratio, "</td>");
|
673
|
+
html.push("<td>", Util.to_unit(item["currency_funds"]), "</td>");
|
674
|
+
html.push("<td>", Util.to_unit(item["short_term_loan"]), "</td>");
|
675
|
+
html.push("<td>", Util.to_unit(item["noncurrent_liab_due_in1y"]), "</td>");
|
676
676
|
let flr = "--";
|
677
677
|
if (item["short_term_loan"] > 0 && item["noncurrent_liab_due_in1y"] > 0) {
|
678
678
|
flr = Util.to_float(item["currency_funds"] / (item["short_term_loan"] + item["noncurrent_liab_due_in1y"]), 2);
|
679
679
|
flr = flr >= 1 ? flr : ("<b class='text-danger'>" + flr + "</br>");
|
680
680
|
}
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
681
|
+
html.push("<td>", flr, "</td>");
|
682
|
+
html.push("<td>", goodwill, "</td>");
|
683
|
+
html.push("<td>", goodwill_rate, "</td>");
|
684
|
+
html.push("</tr>");
|
685
685
|
});
|
686
|
-
Util.render_table_html("assets_liabilities_table_body",
|
686
|
+
Util.render_table_html("assets_liabilities_table_body", html);
|
687
687
|
Stock.income_statement_data = j["income_statement_data"] ? j["income_statement_data"] : [];
|
688
688
|
Stock.render_income_statement_data();
|
689
689
|
$("#quarter").change(function () {
|
@@ -697,70 +697,70 @@ let Stock = {
|
|
697
697
|
* 利润表
|
698
698
|
*/
|
699
699
|
render_income_statement_data: function () {
|
700
|
-
let
|
700
|
+
let html = [];
|
701
701
|
let quarter = parseInt($("#quarter").val());
|
702
702
|
Stock["income_statement_data"].forEach(function (item) {
|
703
703
|
item["quarter"] = Util.get_quarter(item["date"]);
|
704
704
|
if (quarter === 0 || quarter === item["quarter"]) {
|
705
705
|
let tr_cls = (quarter === 0 && item["quarter"] === 4) ? "success" : "";
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
706
|
+
html.push("<tr class='", tr_cls, "'>");
|
707
|
+
html.push("<td>", Util.get_year(item["date"]), "-", item["quarter"], "</td>");
|
708
|
+
html.push("<td>", item["net_profit_rate"], "%</td>");
|
709
|
+
html.push("<td>", Util.to_float(item["gross_profit_rate"], 2), "%</td>");
|
710
|
+
html.push("<td>", Util.to_float(item["eps"], 2), "元</td>");
|
711
|
+
html.push("<td>", item["roe"], "%</td>");
|
712
712
|
let total_revenue = Util.to_unit(item["total_revenue"], 3);
|
713
|
-
|
713
|
+
html.push("<td>", total_revenue, "</td>");
|
714
714
|
let total_revenue_yoy_title = "", total_revenue_yoy_ratio = "--";
|
715
715
|
if (item["yoy_total_revenue"]) {
|
716
716
|
total_revenue_yoy_title = " title='" + Util.to_unit(item["yoy_total_revenue"], 2, 0) + " - " + Util.strip_html(total_revenue) + "'";
|
717
717
|
total_revenue_yoy_ratio = Util.to_float(((item["total_revenue"] - item["yoy_total_revenue"]) / item["yoy_total_revenue"]) * 100, 2);
|
718
718
|
total_revenue_yoy_ratio = Util.parse_ratio(total_revenue_yoy_ratio);
|
719
719
|
}
|
720
|
-
|
720
|
+
html.push("<td", total_revenue_yoy_title, ">", total_revenue_yoy_ratio, "</td>");
|
721
721
|
let total_revenue_qoq_title = "", total_revenue_qoq_ratio = "--";
|
722
722
|
if (item["qoq_total_revenue"]) {
|
723
723
|
total_revenue_qoq_title = " title='" + Util.to_unit(item["qoq_total_revenue"], 2, 0) + " - " + Util.to_unit(item["total_revenue_add"], 2, 0) + "'";
|
724
724
|
total_revenue_qoq_ratio = Util.to_float(((item["total_revenue_add"] - item["qoq_total_revenue"]) / item["qoq_total_revenue"]) * 100, 2);
|
725
725
|
total_revenue_qoq_ratio = Util.parse_ratio(total_revenue_qoq_ratio);
|
726
726
|
}
|
727
|
-
|
727
|
+
html.push("<td", total_revenue_qoq_title, ">", total_revenue_qoq_ratio, "</td>");
|
728
728
|
let net_profit = Util.to_unit(item["net_profit"], 3);
|
729
|
-
|
729
|
+
html.push("<td>", net_profit, "</td>");
|
730
730
|
let net_profit_yoy_title = "", net_profit_yoy_ratio = "--";
|
731
731
|
if (item["yoy_net_profit"]) {
|
732
732
|
net_profit_yoy_title = " title='" + Util.to_unit(item["yoy_net_profit"], 2, 0) + " - " + Util.strip_html(net_profit) + "'";
|
733
733
|
net_profit_yoy_ratio = Util.to_float(((item["net_profit"] - item["yoy_net_profit"]) / item["yoy_net_profit"]) * 100, 2);
|
734
734
|
net_profit_yoy_ratio = Util.parse_ratio(net_profit_yoy_ratio);
|
735
735
|
}
|
736
|
-
|
736
|
+
html.push("<td", net_profit_yoy_title, ">", net_profit_yoy_ratio, "</td>");
|
737
737
|
let net_profit_qoq_title = "", net_profit_qoq_ratio = "--";
|
738
738
|
if (item["qoq_net_profit"]) {
|
739
739
|
net_profit_qoq_title = " title='" + Util.to_unit(item["qoq_net_profit"], 2, 0) + " - " + Util.to_unit(item["net_profit_add"], 2, 0) + "'";
|
740
740
|
net_profit_qoq_ratio = Util.to_float(((item["net_profit_add"] - item["qoq_net_profit"]) / item["qoq_net_profit"]) * 100, 2);
|
741
741
|
net_profit_qoq_ratio = Util.parse_ratio(net_profit_qoq_ratio);
|
742
742
|
}
|
743
|
-
|
743
|
+
html.push("<td", net_profit_qoq_title, ">", net_profit_qoq_ratio, "</td>");
|
744
744
|
let adjusted_net_profit = Util.to_unit(item["adjusted_net_profit"], 3);
|
745
|
-
|
745
|
+
html.push("<td>", adjusted_net_profit, "</td>");
|
746
746
|
let adjusted_net_profit_yoy_title = "", adjusted_net_profit_yoy_ratio = "--";
|
747
747
|
if (item["yoy_adjusted_net_profit"]) {
|
748
748
|
adjusted_net_profit_yoy_title = " title='" + Util.to_unit(item["yoy_adjusted_net_profit"], 2, 0) + " - " + Util.strip_html(adjusted_net_profit) + "'";
|
749
749
|
adjusted_net_profit_yoy_ratio = Util.to_float(((item["adjusted_net_profit"] - item["yoy_adjusted_net_profit"]) / item["yoy_adjusted_net_profit"]) * 100, 2);
|
750
750
|
adjusted_net_profit_yoy_ratio = Util.parse_ratio(adjusted_net_profit_yoy_ratio);
|
751
751
|
}
|
752
|
-
|
752
|
+
html.push("<td", adjusted_net_profit_yoy_title, ">", adjusted_net_profit_yoy_ratio, "</td>");
|
753
753
|
let adjusted_net_profit_qoq_title = "", adjusted_net_profit_qoq_ratio = "--";
|
754
754
|
if (item["qoq_adjusted_net_profit"]) {
|
755
755
|
adjusted_net_profit_qoq_title = " title='" + Util.to_unit(item["qoq_adjusted_net_profit"], 2, 0) + " - " + Util.to_unit(item["adjusted_net_profit_add"], 2, 0) + "'";
|
756
756
|
adjusted_net_profit_qoq_ratio = Util.to_float(((item["adjusted_net_profit_add"] - item["qoq_adjusted_net_profit"]) / item["qoq_adjusted_net_profit"]) * 100, 2);
|
757
757
|
adjusted_net_profit_qoq_ratio = Util.parse_ratio(adjusted_net_profit_qoq_ratio);
|
758
758
|
}
|
759
|
-
|
760
|
-
|
759
|
+
html.push("<td", adjusted_net_profit_qoq_title, ">", adjusted_net_profit_qoq_ratio, "</td>");
|
760
|
+
html.push("</tr>");
|
761
761
|
}
|
762
762
|
});
|
763
|
-
Util.render_table_html("profit_table_body",
|
763
|
+
Util.render_table_html("profit_table_body", html);
|
764
764
|
},
|
765
765
|
|
766
766
|
fetch_holder_num_data: function () {
|
@@ -777,7 +777,7 @@ let Stock = {
|
|
777
777
|
});
|
778
778
|
Util.post("/stock/" + Stock["code"], {action: "holder_num"}, function (j) {
|
779
779
|
Stock["holder_chart"].hideLoading();
|
780
|
-
let
|
780
|
+
let html = [], date_data = [], holder_data = [], price_data = [];
|
781
781
|
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;
|
782
782
|
j["data"].forEach(function (item) {
|
783
783
|
let date_format = Util.seconds_to_format(item["date"], "%Y-%m-%d");
|
@@ -793,13 +793,13 @@ let Stock = {
|
|
793
793
|
date_data.push(date_format);
|
794
794
|
holder_data.push(item["holder_num"]);
|
795
795
|
price_data.push(item["price"]);
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
796
|
+
html.push("<tr>");
|
797
|
+
html.push("<td>", date_format, "</td>");
|
798
|
+
html.push("<td>", Util.digit_compare_trend(item["holder_num"], item["pre_holder_num"]), "</td>");
|
799
|
+
html.push("<td><b class='", Util.text_color(item["price_change"]), "'>", item["price"], "(", item["price_change"], "%)</b></td>");
|
800
|
+
html.push("<td>", item["avg_num"], "</td>");
|
801
|
+
html.push("<td>", Util.to_unit(item["avg_num"] * item["price"]), "</td>");
|
802
|
+
html.push("</tr>");
|
803
803
|
});
|
804
804
|
let holder_num_summary = "";
|
805
805
|
if (j["latest_date"]) {
|
@@ -832,7 +832,7 @@ let Stock = {
|
|
832
832
|
holder_data = holder_data.reverse();
|
833
833
|
price_data = price_data.reverse();
|
834
834
|
Stock["holder_chart"] = Util.multi_axis_line(Stock["holder_chart"], "holder_data_line_canvas", date_data, '股东数', holder_data, '股价', price_data);
|
835
|
-
Util.render_table_html("holder_data_table_body",
|
835
|
+
Util.render_table_html("holder_data_table_body", html);
|
836
836
|
Util.hide_tips();
|
837
837
|
});
|
838
838
|
},
|
@@ -850,27 +850,27 @@ let Stock = {
|
|
850
850
|
let symbol = Util.code_to_symbol(Stock.code).toLowerCase();
|
851
851
|
$("#notice_url").attr("href", "https://vip.stock.finance.sina.com.cn/corp/view/vCB_BulletinGather.php?stock_str=" + symbol);
|
852
852
|
Util.post("/stock/" + Stock["code"], {action: "notice"}, function (j) {
|
853
|
-
let
|
853
|
+
let html = [];
|
854
854
|
j["data"].forEach(function (item, index) {
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
855
|
+
html.push("<tr title='", item["title"], "'>");
|
856
|
+
html.push("<td>", (index + 1), "</td>");
|
857
|
+
html.push("<td>", Util.pack_html_link(item["url"], Util.substring(item["title"], 70)), "</td>");
|
858
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
859
|
+
html.push("</tr>");
|
860
860
|
});
|
861
|
-
Util.render_table_html("notice_table_body",
|
861
|
+
Util.render_table_html("notice_table_body", html);
|
862
862
|
//年报数据
|
863
863
|
let now = Util.now();
|
864
864
|
let dist_time = Util.one_day_second * 400;
|
865
865
|
if ((now - Stock.ttm_second) > dist_time) {
|
866
866
|
Util.post(Util.get_url("notice_report_annual"), {action: "report", code: Stock.code}, function (j) {
|
867
|
-
let
|
868
|
-
|
867
|
+
let html = [];
|
868
|
+
html.push("<option value=''>年度报告</option>");
|
869
869
|
j["data"].forEach(function (item) {
|
870
|
-
|
870
|
+
html.push("<option value='", item["url"], "'>", item["year"], "年度报告</option>");
|
871
871
|
});
|
872
872
|
let report_obj = $("#report");
|
873
|
-
report_obj.html(
|
873
|
+
report_obj.html(html.join(""));
|
874
874
|
report_obj.change(function () {
|
875
875
|
let url = $(this).val();
|
876
876
|
if (url) {
|
@@ -898,18 +898,18 @@ let Stock = {
|
|
898
898
|
]
|
899
899
|
});
|
900
900
|
Util.post("/stock/" + Stock["code"], {action: "report_organization"}, function (j) {
|
901
|
-
let
|
901
|
+
let html = [];
|
902
902
|
j["data"].forEach(function (item, i) {
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
903
|
+
html.push("<tr title='", item["title"], "'>");
|
904
|
+
html.push("<td>", i + 1, "</td>");
|
905
|
+
html.push("<td>", Util.pack_html_link("https://data.eastmoney.com/report/info/" + item["id"] + ".html", Util.substring(item["title"], 70)), "</td>");
|
906
|
+
html.push("<td>", item["organization"], "</td>");
|
907
|
+
html.push("<td>", item["analysts"], "</td>");
|
908
|
+
html.push("<td>", Util.seconds_to_format(item["ctime"], "%Y-%m-%d"), "</td>");
|
909
|
+
html.push("<td>", Util.digit_compare_trend1(Stock["price"], item["day_price"]), "</td>");
|
910
|
+
html.push("</tr>");
|
911
911
|
});
|
912
|
-
Util.render_table_html("report_organization_table_body",
|
912
|
+
Util.render_table_html("report_organization_table_body", html);
|
913
913
|
Util.hide_tips();
|
914
914
|
});
|
915
915
|
},
|
@@ -1153,13 +1153,13 @@ let Stock = {
|
|
1153
1153
|
]
|
1154
1154
|
});
|
1155
1155
|
Util.post("/stock/" + Stock["code"], {action: "margin_detail"}, function (j) {
|
1156
|
-
let
|
1156
|
+
let html = [];
|
1157
1157
|
j["data"].forEach(function (item, index) {
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1158
|
+
html.push("<tr>");
|
1159
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
1160
|
+
html.push("<td title='", item["rzye"], "' data-val='", item["rzye"], "'>", Util.to_unit(item["rzye"], 3), "</td>");
|
1161
|
+
html.push("<td title='", item["rzmre"], "' data-val='", item["rzmre"], "'>", Util.to_unit(item["rzmre"], 3), "</td>");
|
1162
|
+
html.push("<td title='", item["rzche"], "' data-val='", item["rzche"], "'>", Util.to_unit(item["rzche"], 3), "</td>");
|
1163
1163
|
let net_rzye = "--", gap_rzye = 0;
|
1164
1164
|
if (j["data"][index + 1] && j["data"][index + 1]["rzye"]) {
|
1165
1165
|
gap_rzye = item["rzye"] - j["data"][index + 1]["rzye"];
|
@@ -1169,16 +1169,16 @@ let Stock = {
|
|
1169
1169
|
net_rzye = "<b class='text-success'>" + Util.to_unit(gap_rzye, 3) + "</b>";
|
1170
1170
|
}
|
1171
1171
|
}
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1172
|
+
html.push("<td title='", gap_rzye, "' data-val='", gap_rzye, "'>", net_rzye, "</td>");
|
1173
|
+
html.push("<td title='", item["rqye"], "' data-val='", item["rqye"], "'>", (item["rqye"] > 0 ? Util.to_unit(item["rqye"], 3) : "--"), "</td>");
|
1174
|
+
html.push("<td title='", item["rqyl"], "' data-val='", item["rqyl"], "'>", Util.to_unit(item["rqyl"], 3), "</td>");
|
1175
1175
|
let text_color = Util.text_color(item["p_change"]);
|
1176
|
-
|
1176
|
+
html.push("<td><b class='", text_color, "'>", item["close"], "</b></td>");
|
1177
1177
|
item["p_change"] = item["p_change"] > 0 ? ("+" + Util.to_float(item["p_change"], 2)) : Util.to_float(item["p_change"], 2);
|
1178
|
-
|
1179
|
-
|
1178
|
+
html.push("<td><b class='", text_color, "'>", item["p_change"], "%</b></td>");
|
1179
|
+
html.push("</tr>");
|
1180
1180
|
});
|
1181
|
-
Util.render_table_html("margin_modal_body_body",
|
1181
|
+
Util.render_table_html("margin_modal_body_body", html);
|
1182
1182
|
if (j["data"].length > 1) {
|
1183
1183
|
let margin_modal_summary = " [当前最新(" + Util.seconds_to_format(j["data"][0]["date"], "%Y-%m-%d") + ")的融资余额: <b class='text-info'>" + Util.to_unit(j["data"][0]["rzye"]) + "</b>";
|
1184
1184
|
let gap_rzye = j["data"][0]["rzye"] - j["data"][1]["rzye"];
|
@@ -1270,11 +1270,11 @@ let Stock = {
|
|
1270
1270
|
]
|
1271
1271
|
});
|
1272
1272
|
Util.post("/stock/" + Stock["code"], {action: "hk_mutual"}, function (j) {
|
1273
|
-
let
|
1273
|
+
let html = [];
|
1274
1274
|
j["data"].forEach(function (item, index) {
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1275
|
+
html.push("<tr>");
|
1276
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
1277
|
+
html.push("<td title='", item["volume"], "' data-val='", item["volume"], "'>", Util.to_ten_thousand(item["volume"], 4), "万股</td>");
|
1278
1278
|
let net_volume = "--", gap_volume = 0;
|
1279
1279
|
if (j["data"][index + 1] && j["data"][index + 1]["volume"]) {
|
1280
1280
|
gap_volume = item["volume"] - j["data"][index + 1]["volume"];
|
@@ -1284,13 +1284,13 @@ let Stock = {
|
|
1284
1284
|
net_volume = "<b class='text-success'>" + Util.to_ten_thousand(gap_volume, 4) + "万股</b>";
|
1285
1285
|
}
|
1286
1286
|
}
|
1287
|
-
|
1287
|
+
html.push("<td data-val='", gap_volume, "'>", net_volume, "</td>");
|
1288
1288
|
let text_color = Util.text_color(item["p_change"]);
|
1289
|
-
|
1289
|
+
html.push("<td><b class='", text_color, "'>", item["close"], "</b></td>");
|
1290
1290
|
item["p_change"] = item["p_change"] > 0 ? ("+" + item["p_change"]) : item["p_change"];
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1291
|
+
html.push("<td><b class='", text_color, "'>", item["p_change"], "%</b></td>");
|
1292
|
+
html.push("<td>", item["ratio"], "%</td>");
|
1293
|
+
html.push("</tr>");
|
1294
1294
|
});
|
1295
1295
|
if (j["data"].length > 1) {
|
1296
1296
|
let hkex_holding_modal_summary = " [当前最新(" + Util.seconds_to_format(j["data"][0]["date"], "%Y-%m-%d") + ")的持股比例: <b class='text-info'>" + j["data"][0]["ratio"] + "%</b>";
|
@@ -1303,7 +1303,7 @@ let Stock = {
|
|
1303
1303
|
hkex_holding_modal_summary += "]";
|
1304
1304
|
$("#hkex_holding_modal_summary").html(hkex_holding_modal_summary);
|
1305
1305
|
}
|
1306
|
-
Util.render_table_html("hkex_holding_modal_body_body",
|
1306
|
+
Util.render_table_html("hkex_holding_modal_body_body", html);
|
1307
1307
|
Util.hide_tips();
|
1308
1308
|
});
|
1309
1309
|
});
|