sbd-npm 1.4.95 → 1.4.97
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/status.js +175 -177
- package/stock_basics.js +232 -232
- package/summary_daily.js +73 -73
- package/util.js +351 -352
package/util.js
CHANGED
|
@@ -85,8 +85,8 @@ const Util = {
|
|
|
85
85
|
}
|
|
86
86
|
} else {
|
|
87
87
|
Util.post("/action", {action: "rand_stock", stock_type: "cn"}, function (j) {
|
|
88
|
-
if (j
|
|
89
|
-
window.open("/stock/" + j
|
|
88
|
+
if (j.code) {
|
|
89
|
+
window.open("/stock/" + j.code, "_blank");
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
}
|
|
@@ -186,13 +186,13 @@ const Util = {
|
|
|
186
186
|
Util.post("/action", {action: "search", key_word: $("#stock").val()}, function (j) {
|
|
187
187
|
let key_word = $("#stock").val().trim();
|
|
188
188
|
if (key_word) {
|
|
189
|
-
if (key_word === j
|
|
189
|
+
if (key_word === j.key_word) {
|
|
190
190
|
let html = [];
|
|
191
191
|
html.push('<div class="list-group">');
|
|
192
|
-
if (j
|
|
193
|
-
j
|
|
194
|
-
let upper_code = item
|
|
195
|
-
html.push('<a target="_blank" rel="noopener noreferrer nofollow" class="list-group-item" href="/stock/', upper_code, '">', (item
|
|
192
|
+
if (j.data && j.data.length > 0) {
|
|
193
|
+
j.data.forEach(function (item) {
|
|
194
|
+
let upper_code = item.code.toUpperCase();
|
|
195
|
+
html.push('<a target="_blank" rel="noopener noreferrer nofollow" class="list-group-item" href="/stock/', upper_code, '">', (item.name ? item.name : upper_code), '(', upper_code, ')</a>');
|
|
196
196
|
});
|
|
197
197
|
} else {
|
|
198
198
|
html.push('<a href="#" class="list-group-item disabled">无数据</a>');
|
|
@@ -385,18 +385,18 @@ const Util = {
|
|
|
385
385
|
* @returns {*}
|
|
386
386
|
*/
|
|
387
387
|
stock_basics_html: function (html, item) {
|
|
388
|
-
let symbol = Util.is_alphabet(item
|
|
388
|
+
let symbol = Util.is_alphabet(item.code) ? item.code.toUpperCase() : item.code;
|
|
389
389
|
let name = symbol;
|
|
390
|
-
if (item
|
|
391
|
-
if (Util.is_us(item
|
|
392
|
-
name = item
|
|
390
|
+
if (item.cname) {
|
|
391
|
+
if (Util.is_us(item.code)) {
|
|
392
|
+
name = item.cname.replace("有限公司", "").replace("公司", "").replace("•", "").replace("•", "");
|
|
393
393
|
} else {
|
|
394
|
-
name = item
|
|
394
|
+
name = item.cname;
|
|
395
395
|
}
|
|
396
|
-
} else if (item
|
|
397
|
-
name = item
|
|
398
|
-
if (Util.is_us(item
|
|
399
|
-
if (name.
|
|
396
|
+
} else if (item.name) {
|
|
397
|
+
name = item.name;
|
|
398
|
+
if (Util.is_us(item.code)) {
|
|
399
|
+
if (name.includes(' ')) {
|
|
400
400
|
let name_array = name.split(' ');
|
|
401
401
|
name = name_array[0] ? name_array[0] : name;
|
|
402
402
|
} else {
|
|
@@ -406,21 +406,21 @@ const Util = {
|
|
|
406
406
|
name = name.substring(0, 10);
|
|
407
407
|
}
|
|
408
408
|
html.push("<td>", Util.snowball_url(symbol), "</td>");
|
|
409
|
-
html.push("<td>", Util.stock_url(item
|
|
410
|
-
html.push("<td>", Util.to_float((item
|
|
411
|
-
html.push("<td>", (item
|
|
412
|
-
html.push("<td>", Util.industry_url(item
|
|
413
|
-
html.push("<td>", Util.map_url((item
|
|
414
|
-
let price = item
|
|
415
|
-
let pre_price = item
|
|
409
|
+
html.push("<td>", Util.stock_url(item.code, name), "</td>");
|
|
410
|
+
html.push("<td>", Util.to_float((item.pe_ttm ? item.pe_ttm : item.pe), 2), "</td>");
|
|
411
|
+
html.push("<td>", (item.market_capital ? (Util.to_float(item.market_capital, 2) + "亿") : "--"), "</td>");
|
|
412
|
+
html.push("<td>", Util.industry_url(item.code, item.industry), "</td>");
|
|
413
|
+
html.push("<td>", Util.map_url((item.province_city && item.province_city !== "None") ? item.province_city : item.area), "</td>");
|
|
414
|
+
let price = item.stock_price ? item.stock_price : item.price;
|
|
415
|
+
let pre_price = item.pre_price ? item.pre_price : (item.previous_price ? item.previous_price : 0);
|
|
416
416
|
if (pre_price > 0) {
|
|
417
|
-
if (item
|
|
418
|
-
html.push("<td>", Util.digit_compare_trend(item
|
|
417
|
+
if (item.no_refresh_price && item.no_refresh_price > 0) {
|
|
418
|
+
html.push("<td>", Util.digit_compare_trend(item.no_refresh_price, pre_price), "</td>");
|
|
419
419
|
} else {
|
|
420
|
-
html.push("<td class='price_", item
|
|
420
|
+
html.push("<td class='price_", item.code.toLowerCase(), "'>", Util.digit_compare_trend(price, pre_price), "</td>");
|
|
421
421
|
}
|
|
422
422
|
} else {
|
|
423
|
-
html.push("<td class='price_", item
|
|
423
|
+
html.push("<td class='price_", item.code.toLowerCase(), "'>", price, "</td>");
|
|
424
424
|
}
|
|
425
425
|
return html;
|
|
426
426
|
},
|
|
@@ -513,24 +513,24 @@ const Util = {
|
|
|
513
513
|
* @param item
|
|
514
514
|
*/
|
|
515
515
|
render_price: function (item) {
|
|
516
|
-
let code = item
|
|
517
|
-
if (item
|
|
516
|
+
let code = item.code;
|
|
517
|
+
if (item.price) {
|
|
518
518
|
if ($("#price_change_" + code).length) {
|
|
519
|
-
let price_cls = Util.text_color(item
|
|
519
|
+
let price_cls = Util.text_color(item.price, item.previous_price);
|
|
520
520
|
$(".price_" + code).each(function () {
|
|
521
|
-
$(this).html("<b class='" + price_cls + "'>" + Util.to_float(item
|
|
521
|
+
$(this).html("<b class='" + price_cls + "'>" + Util.to_float(item.price, 2) + "</b>");
|
|
522
522
|
});
|
|
523
|
-
$("#price_change_" + code).html(Util.year_price_rate(item
|
|
523
|
+
$("#price_change_" + code).html(Util.year_price_rate(item.price, item.previous_price));
|
|
524
524
|
} else {
|
|
525
|
-
let price = Util.digit_compare_trend(item
|
|
526
|
-
let price_change_rate = Util.calc_change_rate(item
|
|
525
|
+
let price = Util.digit_compare_trend(item.price, item.previous_price);
|
|
526
|
+
let price_change_rate = Util.calc_change_rate(item.price, item.previous_price, 4);
|
|
527
527
|
$(".price_" + code).each(function () {
|
|
528
528
|
if ($(this).attr("data-color")) {
|
|
529
529
|
let pre_price = parseFloat(Util.strip_bracket_string($(this).text()));
|
|
530
|
-
if (item
|
|
530
|
+
if (item.price > pre_price && pre_price > 0) {
|
|
531
531
|
$(this).css("background-color", "#FF7B7B");
|
|
532
532
|
$(this).animate({backgroundColor: $(this).attr("data-color")}, 2000);
|
|
533
|
-
} else if (item
|
|
533
|
+
} else if (item.price > 0 && item.price < pre_price) {
|
|
534
534
|
$(this).css("background-color", "#ADFFAD");
|
|
535
535
|
$(this).animate({backgroundColor: $(this).attr("data-color")}, 2000);
|
|
536
536
|
}
|
|
@@ -542,54 +542,54 @@ const Util = {
|
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
544
|
$(".year_price_" + code).each(function () {
|
|
545
|
-
if (item
|
|
546
|
-
$(this).html(Util.year_price_rate(item
|
|
545
|
+
if (item.year_price) {
|
|
546
|
+
$(this).html(Util.year_price_rate(item.price, item.year_price));
|
|
547
547
|
} else {
|
|
548
548
|
let year_price = $(this).attr("data-val");
|
|
549
549
|
if (year_price) {
|
|
550
|
-
$(this).html(Util.year_price_rate(item
|
|
550
|
+
$(this).html(Util.year_price_rate(item.price, Util.to_float(year_price)));
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
554
|
$(".d5_price_" + code).each(function () {
|
|
555
|
-
if (item
|
|
556
|
-
$(this).html(Util.year_price_rate(item
|
|
555
|
+
if (item.d5_price) {
|
|
556
|
+
$(this).html(Util.year_price_rate(item.price, item.d5_price));
|
|
557
557
|
} else {
|
|
558
558
|
let d5_price = $(this).attr("data-val");
|
|
559
559
|
if (d5_price) {
|
|
560
|
-
$(this).html(Util.year_price_rate(item
|
|
560
|
+
$(this).html(Util.year_price_rate(item.price, Util.to_float(d5_price)));
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
});
|
|
564
|
-
if (item
|
|
564
|
+
if (item.high_52week) {
|
|
565
565
|
$(".high_52week_" + code).each(function () {
|
|
566
|
-
$(this).html(Util.year_price_rate(item
|
|
566
|
+
$(this).html(Util.year_price_rate(item.price, item.high_52week));
|
|
567
567
|
});
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
if (item
|
|
571
|
-
let high_price = Util.digit_compare_trend(item
|
|
572
|
-
let limit_up_price = Math.floor((item
|
|
570
|
+
if (item.high) {
|
|
571
|
+
let high_price = Util.digit_compare_trend(item.high, item.previous_price);
|
|
572
|
+
let limit_up_price = Math.floor((item.previous_price * 1.1) * 100) / 100;
|
|
573
573
|
high_price = high_price.replace(/title='(.*?)'/, "title='" + limit_up_price + "'");
|
|
574
574
|
$("#high_" + code).html(high_price);
|
|
575
575
|
}
|
|
576
|
-
if (item
|
|
577
|
-
let low_price = Util.digit_compare_trend(item
|
|
578
|
-
let down_limit_price = Math.ceil((item
|
|
576
|
+
if (item.low) {
|
|
577
|
+
let low_price = Util.digit_compare_trend(item.low, item.previous_price);
|
|
578
|
+
let down_limit_price = Math.ceil((item.previous_price * 0.9) * 100) / 100;
|
|
579
579
|
low_price = low_price.replace(/title='(.*?)'/, "title='" + down_limit_price + "'");
|
|
580
580
|
$("#low_" + code).html(low_price);
|
|
581
581
|
}
|
|
582
|
-
if (item
|
|
583
|
-
let amount = "<span title='" + item
|
|
582
|
+
if (item.amount) {
|
|
583
|
+
let amount = "<span title='" + item.amount + "'>" + Util.to_hundred_million(item.amount) + "亿</span>";
|
|
584
584
|
$("#amount_" + code).html(amount);
|
|
585
|
-
$("#average_" + code).html(Util.to_float(item
|
|
585
|
+
$("#average_" + code).html(Util.to_float(item.amount / item.volume, 2));
|
|
586
586
|
}
|
|
587
587
|
let remark_obj = $("#remark_" + code);
|
|
588
|
-
if (remark_obj.length > 0 && ((item
|
|
588
|
+
if (remark_obj.length > 0 && ((item.buy && item.buy > 0) || (item.sell && item.sell > 0))) {
|
|
589
589
|
remark_obj.removeClass("success");
|
|
590
590
|
remark_obj.removeClass("danger");
|
|
591
|
-
remark_obj.addClass(item
|
|
592
|
-
remark_obj.attr("title", "五档卖出: " + Util.to_hundred_million(item
|
|
591
|
+
remark_obj.addClass(item.buy > item.sell ? "danger" : "success");
|
|
592
|
+
remark_obj.attr("title", "五档卖出: " + Util.to_hundred_million(item.sell) + "亿\n 五档买入: " + Util.to_hundred_million(item.buy) + "亿");
|
|
593
593
|
}
|
|
594
594
|
},
|
|
595
595
|
|
|
@@ -600,22 +600,22 @@ const Util = {
|
|
|
600
600
|
* @returns {*}
|
|
601
601
|
*/
|
|
602
602
|
stock_hk_html: function (html, item) {
|
|
603
|
-
html.push("<td>", Util.snowball_url(item
|
|
604
|
-
if (item
|
|
605
|
-
item
|
|
603
|
+
html.push("<td>", Util.snowball_url(item.code), "</td>");
|
|
604
|
+
if (item.name && item.name.length > 5) {
|
|
605
|
+
item.name = item.name.replace("有限公司", "").replace("集团", "").replace("股份", "");
|
|
606
606
|
}
|
|
607
|
-
html.push("<td>", Util.stock_url(item
|
|
608
|
-
html.push("<td class='hk_industry'>", item
|
|
609
|
-
html.push("<td>", Util.map_url(item
|
|
610
|
-
html.push("<td>", Util.to_float((item
|
|
611
|
-
html.push("<td>", Util.to_float(item
|
|
612
|
-
html.push("<td>", Util.to_float(item
|
|
613
|
-
html.push("<td>", Util.to_float(item
|
|
614
|
-
html.push("<td class='price_", item
|
|
615
|
-
html.push("<td>", Util.year_price_rate(item
|
|
616
|
-
html.push("<td>", Util.year_price_rate(item
|
|
617
|
-
html.push("<td>", Util.digit_compare_trend(item
|
|
618
|
-
html.push("<td>", Util.digit_compare_trend(item
|
|
607
|
+
html.push("<td>", Util.stock_url(item.code, item.name), "</td>");
|
|
608
|
+
html.push("<td class='hk_industry'>", item.industry, "</td>");
|
|
609
|
+
html.push("<td>", Util.map_url(item.province_city), "</td>");
|
|
610
|
+
html.push("<td>", Util.to_float((item.pe_ttm ? item.pe_ttm : item.pe), 2), "</td>");
|
|
611
|
+
html.push("<td>", Util.to_float(item.pb, 2), "</td>");
|
|
612
|
+
html.push("<td>", Util.to_float(item.total_shares, 2), "亿</td>");
|
|
613
|
+
html.push("<td>", Util.to_float(item.market_capital, 3), "亿</td>");
|
|
614
|
+
html.push("<td class='price_", item.code, "'>", item.price, "</td>");
|
|
615
|
+
html.push("<td>", Util.year_price_rate(item.price, item.year_price), "</td>");
|
|
616
|
+
html.push("<td>", Util.year_price_rate(item.price, item.d5_price), "</td>");
|
|
617
|
+
html.push("<td>", Util.digit_compare_trend(item.high_52week, item.price), "</td>");
|
|
618
|
+
html.push("<td>", Util.digit_compare_trend(item.low_52week, item.price), "</td>");
|
|
619
619
|
return html;
|
|
620
620
|
},
|
|
621
621
|
|
|
@@ -626,21 +626,21 @@ const Util = {
|
|
|
626
626
|
* @returns {*}
|
|
627
627
|
*/
|
|
628
628
|
stock_us_html: function (html, item) {
|
|
629
|
-
let code = item
|
|
630
|
-
let name = item
|
|
629
|
+
let code = item.code.toUpperCase();
|
|
630
|
+
let name = item.cname ? item.cname : (item.name ? item.name.substring(0, 10) : code);
|
|
631
631
|
html.push("<td>", Util.snowball_url(code), "</td>");
|
|
632
|
-
html.push("<td>", Util.stock_url(item
|
|
633
|
-
html.push("<td>", (item
|
|
634
|
-
html.push("<td>", Util.industry_url(item
|
|
635
|
-
html.push("<td>", Util.google_map_url(item
|
|
636
|
-
html.push("<td>", Util.to_float((item
|
|
637
|
-
html.push("<td>", Util.to_float(item
|
|
638
|
-
html.push("<td>", Util.to_float(item
|
|
639
|
-
html.push("<td class='price_", item
|
|
640
|
-
html.push("<td>", item
|
|
641
|
-
html.push("<td>", Util.year_price_rate(item
|
|
642
|
-
html.push("<td>", Util.digit_compare_trend(item
|
|
643
|
-
html.push("<td>", Util.digit_compare_trend(item
|
|
632
|
+
html.push("<td>", Util.stock_url(item.code, name), "</td>");
|
|
633
|
+
html.push("<td>", (item.sector ? item.sector : "--"), "</td>");
|
|
634
|
+
html.push("<td>", Util.industry_url(item.code, item.industry), "</td>");
|
|
635
|
+
html.push("<td>", Util.google_map_url(item.registered), "</td>");
|
|
636
|
+
html.push("<td>", Util.to_float((item.pe_ttm ? item.pe_ttm : item.pe), 2), "</td>");
|
|
637
|
+
html.push("<td>", Util.to_float(item.total_shares, 2), "亿</td>");
|
|
638
|
+
html.push("<td>", Util.to_float(item.market_capital, 3), "亿</td>");
|
|
639
|
+
html.push("<td class='price_", item.code.toLowerCase(), "'>", item.price, "</td>");
|
|
640
|
+
html.push("<td>", item.market, "</td>");
|
|
641
|
+
html.push("<td>", Util.year_price_rate(item.price, item.year_price), "</td>");
|
|
642
|
+
html.push("<td>", Util.digit_compare_trend(item.high_52week, item.price), "</td>");
|
|
643
|
+
html.push("<td>", Util.digit_compare_trend(item.low_52week, item.price), "</td>");
|
|
644
644
|
return html;
|
|
645
645
|
},
|
|
646
646
|
|
|
@@ -666,8 +666,8 @@ const Util = {
|
|
|
666
666
|
$(this).attr("disabled", true);
|
|
667
667
|
Util.post("/action", {action: "rand_stock", stock_type: stock_type}, function (j) {
|
|
668
668
|
$("#" + rand_btn_id).attr("disabled", false);
|
|
669
|
-
if (j
|
|
670
|
-
window.open("/stock/" + j
|
|
669
|
+
if (j.code) {
|
|
670
|
+
window.open("/stock/" + j.code, "_blank");
|
|
671
671
|
}
|
|
672
672
|
});
|
|
673
673
|
return false;
|
|
@@ -1118,9 +1118,9 @@ const Util = {
|
|
|
1118
1118
|
let code_list = Util.get_code_list(code_zone_id);
|
|
1119
1119
|
code_list = code_list.length > 0 ? code_list.join("-") : "all";
|
|
1120
1120
|
Util.post("/action", {action: "classify_num", code_list: code_list}, function (j) {
|
|
1121
|
-
if (j
|
|
1121
|
+
if (j.data) {
|
|
1122
1122
|
let classify_val = $("#" + classify_id).val();
|
|
1123
|
-
Util.render_classify_html(classify_id, j
|
|
1123
|
+
Util.render_classify_html(classify_id, j.data, callback_func);
|
|
1124
1124
|
if (classify_val && classify_val !== "0") {
|
|
1125
1125
|
$("#" + classify_id).val(classify_val);
|
|
1126
1126
|
}
|
|
@@ -1161,15 +1161,15 @@ const Util = {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
Util.post("/stock/" + code, {action: "rps"}, function (j) {
|
|
1163
1163
|
let html = [];
|
|
1164
|
-
j
|
|
1164
|
+
j.data.forEach(function (item) {
|
|
1165
1165
|
html.push("<tr>");
|
|
1166
|
-
html.push("<td>", Util.seconds_to_format(item
|
|
1167
|
-
html.push("<td style='background-color: ", item
|
|
1168
|
-
html.push("<td>", Util.parse_ratio(item
|
|
1169
|
-
html.push("<td style='background-color: ", item
|
|
1170
|
-
html.push("<td>", Util.parse_ratio(item
|
|
1171
|
-
html.push("<td style='background-color: ", item
|
|
1172
|
-
html.push("<td>", Util.parse_ratio(item
|
|
1166
|
+
html.push("<td>", Util.seconds_to_format(item.date, "%Y-%m-%d"), "</td>");
|
|
1167
|
+
html.push("<td style='background-color: ", item.rps20_color, "'>", item.rps20, "</td>");
|
|
1168
|
+
html.push("<td>", Util.parse_ratio(item.change_percent20 * 100, 2), "</td>");
|
|
1169
|
+
html.push("<td style='background-color: ", item.rps60_color, "'>", item.rps60, "</td>");
|
|
1170
|
+
html.push("<td>", Util.parse_ratio(item.change_percent60 * 100, 2), "</td>");
|
|
1171
|
+
html.push("<td style='background-color: ", item.rps120_color, "'>", item.rps120, "</td>");
|
|
1172
|
+
html.push("<td>", Util.parse_ratio(item.change_percent120 * 100, 2), "</td>");
|
|
1173
1173
|
html.push("</tr>");
|
|
1174
1174
|
});
|
|
1175
1175
|
Util.render_table_html("rps_table_body", html);
|
|
@@ -1207,16 +1207,15 @@ const Util = {
|
|
|
1207
1207
|
};
|
|
1208
1208
|
Util.post("/stock/" + code, payload, function (j) {
|
|
1209
1209
|
Util.render_public_fund(j);
|
|
1210
|
-
if (j
|
|
1210
|
+
if (j.date && j.date > 0) {
|
|
1211
1211
|
$("#public_fund_title").find("a").each(function() {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
$(this).attr("href", "https://data.eastmoney.com/zlsj/detail/" + Util.seconds_to_format(j["date"], "%Y-%m-%d") + "-1-" + code + ".html");
|
|
1212
|
+
if ($(this).text().includes("基金明细")) {
|
|
1213
|
+
$(this).attr("href", "https://data.eastmoney.com/zlsj/detail/" + Util.seconds_to_format(j.date, "%Y-%m-%d") + "-1-" + code + ".html");
|
|
1215
1214
|
}
|
|
1216
1215
|
});
|
|
1217
1216
|
}
|
|
1218
1217
|
if ($("#public_fund_date").length === 0) {
|
|
1219
|
-
let fund_len = j
|
|
1218
|
+
let fund_len = j.data ? j.data.length : 0;
|
|
1220
1219
|
let payload = {
|
|
1221
1220
|
action: "public_fund_date",
|
|
1222
1221
|
is_fund_rank10: $("#is_fund_rank10").prop("checked") ? 1 : 0
|
|
@@ -1224,10 +1223,10 @@ const Util = {
|
|
|
1224
1223
|
Util.post("/stock/" + code, payload, function (j) {
|
|
1225
1224
|
let html = [], date_len = 0;
|
|
1226
1225
|
html.push('<select id="public_fund_date">');
|
|
1227
|
-
j
|
|
1226
|
+
j.data.forEach(function (item) {
|
|
1228
1227
|
date_len ++;
|
|
1229
|
-
let date_format = Util.seconds_to_format(item
|
|
1230
|
-
html.push('<option value="', date_format, '">', date_format, '(', item
|
|
1228
|
+
let date_format = Util.seconds_to_format(item.date, "%Y-%m-%d");
|
|
1229
|
+
html.push('<option value="', date_format, '">', date_format, '(', item.num, ')</option>');
|
|
1231
1230
|
});
|
|
1232
1231
|
html.push('</select>');
|
|
1233
1232
|
$("#public_fund_date_zone").html(html.join(""));
|
|
@@ -1278,33 +1277,33 @@ const Util = {
|
|
|
1278
1277
|
*/
|
|
1279
1278
|
render_public_fund: function(j) {
|
|
1280
1279
|
let html = [], total_public_fund = 0, total_stock_num = 0, total_market_capital = 0;
|
|
1281
|
-
j
|
|
1282
|
-
j
|
|
1280
|
+
j.data = j.data ? j.data : [];
|
|
1281
|
+
j.data.forEach(function (item) {
|
|
1283
1282
|
total_public_fund++;
|
|
1284
|
-
total_stock_num += item
|
|
1285
|
-
total_market_capital += item
|
|
1283
|
+
total_stock_num += item.stock_num;
|
|
1284
|
+
total_market_capital += item.market_capital;
|
|
1286
1285
|
let public_date = "--";
|
|
1287
|
-
if (item
|
|
1288
|
-
public_date = Util.seconds_to_format(item
|
|
1286
|
+
if (item.public_date > 0) {
|
|
1287
|
+
public_date = Util.seconds_to_format(item.public_date, "%Y-%m-%d");
|
|
1289
1288
|
}
|
|
1290
|
-
let net = item
|
|
1291
|
-
let cls = Util.text_color(item
|
|
1289
|
+
let net = item.net;
|
|
1290
|
+
let cls = Util.text_color(item.change_percent)
|
|
1292
1291
|
if (cls !== "") {
|
|
1293
|
-
net = "<b class='" + cls + "'>" + net + "(" + Util.to_float(item
|
|
1292
|
+
net = "<b class='" + cls + "'>" + net + "(" + Util.to_float(item.change_percent, 2) + "%)</b>";
|
|
1294
1293
|
}
|
|
1295
|
-
html.push("<tr class='", ((
|
|
1294
|
+
html.push("<tr class='", (j.etf_code_list.includes(item.fund_code) ? "danger" : ""), "'>");
|
|
1296
1295
|
html.push("<td>", total_public_fund, "</td>");
|
|
1297
|
-
html.push("<td>", Util.pack_html_link('https://fund.eastmoney.com/' + item
|
|
1298
|
-
html.push("<td title='基金概况'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + item
|
|
1296
|
+
html.push("<td>", Util.pack_html_link('https://fund.eastmoney.com/' + item.fund_code + '.html', item.fund_code), "</td>");
|
|
1297
|
+
html.push("<td title='基金概况'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + item.fund_code + '.html', item.fund_name), "</td>");
|
|
1299
1298
|
html.push("<td>", net, "</td>");
|
|
1300
|
-
html.push("<td>", item
|
|
1301
|
-
html.push("<td>", item
|
|
1302
|
-
html.push("<td>", item
|
|
1299
|
+
html.push("<td>", item.assets, "亿</td>");
|
|
1300
|
+
html.push("<td>", item.fund_type, "</td>");
|
|
1301
|
+
html.push("<td>", item.invest_type, "</td>");
|
|
1303
1302
|
html.push("<td>", Util.pack_fund_manager(item), "</td>");
|
|
1304
1303
|
html.push("<td>", public_date, "</td>");
|
|
1305
|
-
html.push("<td data-val='", item
|
|
1306
|
-
html.push("<td data-val='", item
|
|
1307
|
-
html.push("<td><a class='link_cls' data-toggle='modal' data-target='.public_fund_modal' data-val='", item
|
|
1304
|
+
html.push("<td data-val='", item.stock_num, "' title='", item.stock_num, "'>", Util.to_unit(item.stock_num, 3), "股</td>");
|
|
1305
|
+
html.push("<td data-val='", item.market_capital, "' title='", item.market_capital, "'>", Util.to_unit(item.market_capital, 3), "</td>");
|
|
1306
|
+
html.push("<td><a class='link_cls' data-toggle='modal' data-target='.public_fund_modal' data-val='", item.fund_code, "'>详细</a></td>");
|
|
1308
1307
|
html.push("</tr>");
|
|
1309
1308
|
});
|
|
1310
1309
|
Util.render_table_html("public_fund_table_body", html);
|
|
@@ -1368,41 +1367,41 @@ const Util = {
|
|
|
1368
1367
|
if ($("#is_fund10_num").length > 0) {
|
|
1369
1368
|
is_fund10_num = $("#is_fund10_num").prop("checked") ? 1 : 0;
|
|
1370
1369
|
}
|
|
1371
|
-
j
|
|
1372
|
-
let date_format = Util.seconds_to_format(item
|
|
1370
|
+
j.data.forEach(function (item) {
|
|
1371
|
+
let date_format = Util.seconds_to_format(item.date, "%Y-%m-%d");
|
|
1373
1372
|
date_data.push(date_format);
|
|
1374
1373
|
if (is_fund10_num === 1) {
|
|
1375
|
-
fund_num_data.push(item
|
|
1374
|
+
fund_num_data.push(item.fund_rank_num);
|
|
1376
1375
|
} else {
|
|
1377
|
-
fund_num_data.push(item
|
|
1376
|
+
fund_num_data.push(item.fund_num);
|
|
1378
1377
|
}
|
|
1379
|
-
stock_num_data.push(item
|
|
1380
|
-
let hold_value = Util.to_hundred_million(item
|
|
1378
|
+
stock_num_data.push(item.stock_num);
|
|
1379
|
+
let hold_value = Util.to_hundred_million(item.hold_value, 3);
|
|
1381
1380
|
value_data.push(hold_value);
|
|
1382
|
-
price_data.push(item
|
|
1381
|
+
price_data.push(item.price);
|
|
1383
1382
|
html.push("<tr>");
|
|
1384
1383
|
html.push("<td>", Util.pack_html_link("https://data.eastmoney.com/zlsj/detail/" + date_format + "-1-" + code + ".html", date_format), "</td>");
|
|
1385
|
-
if (item
|
|
1386
|
-
html.push("<td>", Util.digit_compare_trend(item
|
|
1384
|
+
if (item.pre_price) {
|
|
1385
|
+
html.push("<td>", Util.digit_compare_trend(item.price, item.pre_price), "</td>");
|
|
1387
1386
|
} else {
|
|
1388
|
-
html.push("<td>", item
|
|
1387
|
+
html.push("<td>", item.price, "</td>");
|
|
1389
1388
|
}
|
|
1390
1389
|
let stock_num_rate = "";
|
|
1391
|
-
if (item
|
|
1392
|
-
stock_num_rate = "(" + Util.year_price_rate(item
|
|
1390
|
+
if (item.pre_stock_num) {
|
|
1391
|
+
stock_num_rate = "(" + Util.year_price_rate(item.stock_num, item.pre_stock_num, 1) + ")";
|
|
1393
1392
|
}
|
|
1394
|
-
html.push("<td data-val='", item
|
|
1393
|
+
html.push("<td data-val='", item.stock_num, "' title='", item.stock_num, "'>", Util.to_unit(item.stock_num, 3), "股", stock_num_rate, "</td>");
|
|
1395
1394
|
let fund_num_rate = "";
|
|
1396
|
-
if (item
|
|
1397
|
-
fund_num_rate = "(" + Util.year_price_rate(item
|
|
1395
|
+
if (item.pre_fund_num) {
|
|
1396
|
+
fund_num_rate = "(" + Util.year_price_rate(item.fund_num, item.pre_fund_num, 1) + ")";
|
|
1398
1397
|
}
|
|
1399
|
-
html.push("<td data-val='", item
|
|
1398
|
+
html.push("<td data-val='", item.fund_num, "'>", item.fund_num, fund_num_rate, "</td>");
|
|
1400
1399
|
let fund_rank_num_rate = "";
|
|
1401
|
-
if (item
|
|
1402
|
-
fund_rank_num_rate = "(" + Util.year_price_rate(item
|
|
1400
|
+
if (item.pre_fund_rank_num) {
|
|
1401
|
+
fund_rank_num_rate = "(" + Util.year_price_rate(item.fund_rank_num, item.pre_fund_rank_num, 1) + ")";
|
|
1403
1402
|
}
|
|
1404
|
-
html.push("<td data-val='", item
|
|
1405
|
-
html.push("<td data-val='", item
|
|
1403
|
+
html.push("<td data-val='", item.fund_rank_num, "'>", item.fund_rank_num, fund_rank_num_rate, "</td>");
|
|
1404
|
+
html.push("<td data-val='", item.hold_value, "' title='", item.hold_value, "'>", hold_value, "亿</td>");
|
|
1406
1405
|
html.push("</tr>");
|
|
1407
1406
|
});
|
|
1408
1407
|
date_data = date_data.reverse();
|
|
@@ -1413,19 +1412,19 @@ const Util = {
|
|
|
1413
1412
|
Util["pfc_stock_chart"] = Util.multi_axis_line(Util["pfc_stock_chart"], "pfc_stock_line_canvas", date_data, '总持股数', stock_num_data, '股价', price_data);
|
|
1414
1413
|
Util["pfc_fund_chart"] = Util.multi_axis_line(Util["pfc_fund_chart"], "pfc_fund_line_canvas", date_data, '持仓家数', fund_num_data, '股价', price_data);
|
|
1415
1414
|
Util["pfc_value_chart"] = Util.multi_axis_line(Util["pfc_value_chart"], "pfc_value_line_canvas", date_data, '持仓市值', value_data, '股价', price_data);
|
|
1416
|
-
if (j
|
|
1417
|
-
let cur_stock_num = j
|
|
1418
|
-
let pre_stock_num = j
|
|
1415
|
+
if (j.data.length > 1) {
|
|
1416
|
+
let cur_stock_num = j.data[0]["stock_num"];
|
|
1417
|
+
let pre_stock_num = j.data[1]["stock_num"];
|
|
1419
1418
|
if (cur_stock_num > 0 && pre_stock_num > 0) {
|
|
1420
1419
|
$("#pfc_stock_tips").html("(当前持股数: <b class='text-info'>" + Util.to_unit(cur_stock_num, 4) + "</b>, 环比: " + Util.year_price_rate(cur_stock_num, pre_stock_num) + ")");
|
|
1421
1420
|
}
|
|
1422
|
-
let cur_fund_num = j
|
|
1423
|
-
let pre_fund_num = j
|
|
1421
|
+
let cur_fund_num = j.data[0]["fund_num"];
|
|
1422
|
+
let pre_fund_num = j.data[1]["fund_num"];
|
|
1424
1423
|
if (cur_fund_num > 0 && pre_fund_num > 0) {
|
|
1425
1424
|
$("#pfc_fund_tips").html("(当前基金数: <b class='text-info'>" + cur_fund_num + "</b>, 环比: " + Util.year_price_rate(cur_fund_num, pre_fund_num) + ")");
|
|
1426
1425
|
}
|
|
1427
|
-
let cur_value_num = j
|
|
1428
|
-
let pre_value_num = j
|
|
1426
|
+
let cur_value_num = j.data[0]["hold_value"];
|
|
1427
|
+
let pre_value_num = j.data[1]["hold_value"];
|
|
1429
1428
|
if (cur_value_num > 0 && pre_value_num > 0) {
|
|
1430
1429
|
$("#pfc_value_tips").html("(当前持仓市值: <b class='text-info'>" + Util.to_unit(cur_value_num) + "</b>, 环比: " + Util.year_price_rate(cur_value_num, pre_value_num) + ")");
|
|
1431
1430
|
}
|
|
@@ -1477,10 +1476,10 @@ const Util = {
|
|
|
1477
1476
|
Util.init_table_skeleton(table_options);
|
|
1478
1477
|
Util["portfolio_table_id"] = table_id;
|
|
1479
1478
|
Util.post(location.pathname, {active_div: portfolio}, function (j) {
|
|
1480
|
-
Util["portfolio_data"] = j
|
|
1479
|
+
Util["portfolio_data"] = j.data ? j.data : [];
|
|
1481
1480
|
Util["portfolio_index"] = j["index_list"] ? j["index_list"] : [];
|
|
1482
|
-
Util.render_type_option($("#portfolio_industry"), j
|
|
1483
|
-
Util.render_type_option($("#portfolio_area"), j
|
|
1481
|
+
Util.render_type_option($("#portfolio_industry"), j.data, "industry", Util.render_portfolio_html);
|
|
1482
|
+
Util.render_type_option($("#portfolio_area"), j.data, "area", Util.render_portfolio_html);
|
|
1484
1483
|
Util.render_portfolio_html();
|
|
1485
1484
|
if (j["portfolio_url"]) {
|
|
1486
1485
|
$("#portfolio_remark_title").html(Util.pack_html_link(j["portfolio_url"], "备注<i class='glyphicon glyphicon-link'></i>"));
|
|
@@ -1500,22 +1499,22 @@ const Util = {
|
|
|
1500
1499
|
if (Util.is_industry_area(item, industry, area)) {
|
|
1501
1500
|
total_num++;
|
|
1502
1501
|
html.push("<tr>");
|
|
1503
|
-
item
|
|
1502
|
+
item.code = item.code.toLowerCase();
|
|
1504
1503
|
if (is_us === 1) {
|
|
1505
|
-
html.push('<td>', Util.us_logo_html(item
|
|
1504
|
+
html.push('<td>', Util.us_logo_html(item.code), '</td>');
|
|
1506
1505
|
}
|
|
1507
1506
|
html = Util.stock_basics_html(html, item);
|
|
1508
|
-
html.push("<td id='high_", item
|
|
1509
|
-
html.push("<td id='low_", item
|
|
1510
|
-
html.push("<td class='year_price_", item
|
|
1511
|
-
html.push("<td class='d5_price_", item
|
|
1512
|
-
html.push("<td class='high_52week_", item
|
|
1507
|
+
html.push("<td id='high_", item.code, "'>0</td>");
|
|
1508
|
+
html.push("<td id='low_", item.code, "'>0</td>");
|
|
1509
|
+
html.push("<td class='year_price_", item.code, "'>", (item.stock_price ? Util.year_price_rate(item.stock_price, item.year_price) : "--"), "</td>");
|
|
1510
|
+
html.push("<td class='d5_price_", item.code, "'>", (item.stock_price ? Util.year_price_rate(item.stock_price, item.d5_price) : "--"), "</td>");
|
|
1511
|
+
html.push("<td class='high_52week_", item.code, "'>--</td>");
|
|
1513
1512
|
if (is_us === 0) {
|
|
1514
|
-
html.push("<td id='amount_", item
|
|
1515
|
-
html.push("<td id='average_", item
|
|
1516
|
-
html.push("<td class='holder_", item
|
|
1517
|
-
html.push("<td class='fund_", item
|
|
1518
|
-
html.push("<td id='remark_", item
|
|
1513
|
+
html.push("<td id='amount_", item.code, "'>--</td>");
|
|
1514
|
+
html.push("<td id='average_", item.code, "'>--</td>");
|
|
1515
|
+
html.push("<td class='holder_", item.code, "'>--</td>");
|
|
1516
|
+
html.push("<td class='fund_", item.code, "'>--</td>");
|
|
1517
|
+
html.push("<td id='remark_", item.code, "'></td>");
|
|
1519
1518
|
}
|
|
1520
1519
|
html.push("</tr>");
|
|
1521
1520
|
}
|
|
@@ -1579,47 +1578,47 @@ const Util = {
|
|
|
1579
1578
|
$("#" + component_id + "_title").html(fund_code);
|
|
1580
1579
|
Util.post(Util.get_url("fund_public"), {action: "public_fund_detail", fund_code: fund_code}, function (j) {
|
|
1581
1580
|
let html = [];
|
|
1582
|
-
if (j
|
|
1583
|
-
$("#" + component_id + "_title").html(Util.pack_html_link("https://fundf10.eastmoney.com/jbgk_" + j
|
|
1581
|
+
if (j.fund_code) {
|
|
1582
|
+
$("#" + component_id + "_title").html(Util.pack_html_link("https://fundf10.eastmoney.com/jbgk_" + j.fund_code + ".html", j["fund_name"]));
|
|
1584
1583
|
let net = "--";
|
|
1585
1584
|
if (j["net"] > 0) {
|
|
1586
1585
|
net = j["net"];
|
|
1587
|
-
let net_cls = Util.text_color(j
|
|
1586
|
+
let net_cls = Util.text_color(j.change_percent);
|
|
1588
1587
|
if (net_cls !== "") {
|
|
1589
|
-
net = "<b class='" + net_cls + "'>" + net + "(" + Util.to_float(j
|
|
1588
|
+
net = "<b class='" + net_cls + "'>" + net + "(" + Util.to_float(j.change_percent, 2) + "%)</b>";
|
|
1590
1589
|
}
|
|
1591
1590
|
}
|
|
1592
1591
|
let assets = j["assets"] > 0 ? (j["assets"] + "亿") : "--";
|
|
1593
1592
|
let public_date = j["public_date"] > 0 ? Util.seconds_to_format(j["public_date"], "%Y-%m-%d") : "--";
|
|
1594
1593
|
let issue_date = j["issue_date"] > 0 ? Util.seconds_to_format(j["issue_date"], "%Y-%m-%d") : "--";
|
|
1595
|
-
html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j
|
|
1596
|
-
html.push("<tr><td colspan='3'>基金代码</td><td colspan='4'>", Util.pack_html_link('https://xueqiu.com/S/' + Util.code_to_fund_symbol(j
|
|
1597
|
-
html.push("<tr><td colspan='3'>基金类型</td><td colspan='4'>", (j
|
|
1594
|
+
html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j.update_time, "%Y-%m-%d"), "' class='info'><th colspan='15' style='text-align: center;'>基金概况</th></tr>");
|
|
1595
|
+
html.push("<tr><td colspan='3'>基金代码</td><td colspan='4'>", Util.pack_html_link('https://xueqiu.com/S/' + Util.code_to_fund_symbol(j.fund_code), j.fund_code), "</td><td colspan='3'>基金名</td><td colspan='5'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + j.fund_code + '.html', j["fund_name"]), "</td></tr>");
|
|
1596
|
+
html.push("<tr><td colspan='3'>基金类型</td><td colspan='4'>", (j.fund_type ? j.fund_type : "--"), "</td><td colspan='3'>投资类型</td><td colspan='5'>", (j["invest_type"] ? j["invest_type"] : "--"), "</td></tr>");
|
|
1598
1597
|
html.push("<tr><td colspan='3'>单位净值</td><td colspan='4'>", net, "</td><td colspan='3'>资产规模</td><td colspan='5'>", assets, "</td></tr>");
|
|
1599
1598
|
html.push("<tr><td colspan='3'>成立日期</td><td colspan='4'>", public_date, "</td><td colspan='3'>发行日期</td><td colspan='5'>", issue_date, "</td></tr>");
|
|
1600
1599
|
html.push("<tr><td colspan='3'>基金管理公司</td><td colspan='4'>", Util.pack_fund_administrator(j), "</td><td colspan='3'>基金经理</td><td colspan='5'>", Util.pack_fund_manager(j), "</td></tr>");
|
|
1601
1600
|
html.push("<tr><td colspan='3'>基金托管人</td><td colspan='4'>", (j["custodian"] ? j["custodian"] : "--"), "</td><td colspan='3'>经办律师事务所</td><td colspan='5'>", (j["lawyer"] ? j["lawyer"] : "--"), "</td></tr>");
|
|
1602
1601
|
html.push("<tr><td colspan='3'>会计师事务所</td><td colspan='4'>", (j["accounting"] ? j["accounting"] : "--"), "</td><td colspan='3'>注册地址</td><td colspan='5'>", Util.map_url(j["location"], j["location"]), "</td></tr>");
|
|
1603
1602
|
html.push("<tr><td colspan='3'>近一周</td><td colspan='4'>", Util.parse_ratio(j["one_week_change"]), "</td><td colspan='3'>近一月</td><td colspan='5'>", Util.parse_ratio(j["one_month_change"]), "</td></tr>");
|
|
1604
|
-
html.push("<tr><td colspan='3'>近一年</td><td colspan='4'>", Util.parse_ratio(j["one_year_change"]), "</td><td colspan='3'>年初至今</td><td colspan='5'>", Util.pack_html_link('https://fundf10.eastmoney.com/jdzf_' + j
|
|
1603
|
+
html.push("<tr><td colspan='3'>近一年</td><td colspan='4'>", Util.parse_ratio(j["one_year_change"]), "</td><td colspan='3'>年初至今</td><td colspan='5'>", Util.pack_html_link('https://fundf10.eastmoney.com/jdzf_' + j.fund_code + '.html', Util.parse_ratio(j["ytd_change"])), "</td></tr>");
|
|
1605
1604
|
html.push("<tr><td colspan='5'>成立以来</td><td colspan='10'>", Util.parse_ratio(j["establish_change"]), "</td></tr>");
|
|
1606
|
-
html.push("<tr class='info'><th colspan='15' style='text-align: center;'>", Util.pack_html_link("https://fund.eastmoney.com/f10/ccmx_" + j
|
|
1605
|
+
html.push("<tr class='info'><th colspan='15' style='text-align: center;'>", Util.pack_html_link("https://fund.eastmoney.com/f10/ccmx_" + j.fund_code + ".html", "持股明细"), " <span id='fund_stock_date_zone'></span></th></tr>");
|
|
1607
1606
|
html.push("<tr id='" + component_id + "_head'><th>序号</th><th>股票代码</th><th>股票名</th><th>PE</th><th>总市值</th><th>行业</th><th>地区</th><th>价格</th><th>年初至今</th><th>近5日</th><th>股东数</th><th>持有量</th><th class='info'>占比</th><th>占比变化</th><th>持仓市值</th></tr>");
|
|
1608
1607
|
html.push("<tr class='" + component_id + "_tr'><td colspan='15'>暂无数据</td></tr>");
|
|
1609
1608
|
Util.render_table_html(component_id + "_body_body", html);
|
|
1610
|
-
if (j
|
|
1609
|
+
if (j.date_list) {
|
|
1611
1610
|
html = [];
|
|
1612
1611
|
html.push("<select id='fund_stock_date'>");
|
|
1613
|
-
j
|
|
1612
|
+
j.date_list.forEach(function (date) {
|
|
1614
1613
|
html.push("<option value='", date, "'>", Util.seconds_to_format(date, "%Y-%m-%d"), "</option>");
|
|
1615
1614
|
});
|
|
1616
1615
|
html.push("</select>");
|
|
1617
1616
|
$("#fund_stock_date_zone").html(html.join(""));
|
|
1618
1617
|
let fsd_obj = $("#fund_stock_date");
|
|
1619
1618
|
fsd_obj.change(function () {
|
|
1620
|
-
Util.fetch_public_fund_stock(j
|
|
1619
|
+
Util.fetch_public_fund_stock(j.fund_code, $("#fund_stock_date").val(), component_id);
|
|
1621
1620
|
});
|
|
1622
|
-
Util.fetch_public_fund_stock(j
|
|
1621
|
+
Util.fetch_public_fund_stock(j.fund_code, fsd_obj.val(), component_id);
|
|
1623
1622
|
}
|
|
1624
1623
|
} else {
|
|
1625
1624
|
html.push("<tr><td colspan='15'>暂无数据</td></tr>");
|
|
@@ -1662,36 +1661,36 @@ const Util = {
|
|
|
1662
1661
|
$(this).remove();
|
|
1663
1662
|
});
|
|
1664
1663
|
let html = [];
|
|
1665
|
-
if (j
|
|
1666
|
-
j
|
|
1664
|
+
if (j.data) {
|
|
1665
|
+
j.data.forEach(function (item, index) {
|
|
1667
1666
|
html.push("<tr class='" + component_tr + "'>");
|
|
1668
1667
|
html.push("<td>", index + 1, "</td>");
|
|
1669
1668
|
html = Util.stock_basics_html(html, item);
|
|
1670
|
-
html.push("<td>", Util.year_price_rate(item
|
|
1671
|
-
html.push("<td>", Util.year_price_rate(item
|
|
1669
|
+
html.push("<td>", Util.year_price_rate(item.stock_price, item.year_price), "</td>");
|
|
1670
|
+
html.push("<td>", Util.year_price_rate(item.stock_price, item.d5_price), "</td>");
|
|
1672
1671
|
html.push("<td>", Util.pack_holder_num(item), "</td>");
|
|
1673
1672
|
let stock_num_tips = "";
|
|
1674
|
-
if (item
|
|
1675
|
-
let gap_stock_num = item
|
|
1673
|
+
if (item.stock_num > 0 && item.pre_stock_num > 0) {
|
|
1674
|
+
let gap_stock_num = item.stock_num - item.pre_stock_num;
|
|
1676
1675
|
if (gap_stock_num > 0) {
|
|
1677
1676
|
stock_num_tips = "<b class='text-danger'>(+" + Util.to_unit(gap_stock_num) + ")</b>";
|
|
1678
1677
|
} else if (gap_stock_num < 0) {
|
|
1679
1678
|
stock_num_tips = "<b class='text-success'>(" + Util.to_unit(gap_stock_num) + ")</b>";
|
|
1680
1679
|
}
|
|
1681
1680
|
}
|
|
1682
|
-
html.push("<td>", Util.to_unit(item
|
|
1681
|
+
html.push("<td>", Util.to_unit(item.stock_num), stock_num_tips, "</td>");
|
|
1683
1682
|
let rate_tips = "", rate_change = "--";
|
|
1684
|
-
if (item
|
|
1685
|
-
rate_tips = "<b class='text-danger'>(+" + Util.to_float(item
|
|
1686
|
-
} else if (item
|
|
1687
|
-
rate_tips = "<b class='text-success'>(" + Util.to_float(item
|
|
1683
|
+
if (item.rate > 0 && item.rate > item.pre_rate) {
|
|
1684
|
+
rate_tips = "<b class='text-danger'>(+" + Util.to_float(item.rate - item.pre_rate, 2) + "%)</b>";
|
|
1685
|
+
} else if (item.pre_rate > 0 && item.pre_rate > item.rate) {
|
|
1686
|
+
rate_tips = "<b class='text-success'>(" + Util.to_float(item.rate - item.pre_rate, 2) + "%)</b>";
|
|
1688
1687
|
}
|
|
1689
|
-
if (item
|
|
1690
|
-
rate_change = Util.year_price_rate(item
|
|
1688
|
+
if (item.pre_rate && item.pre_rate > 0) {
|
|
1689
|
+
rate_change = Util.year_price_rate(item.rate, item.pre_rate, 1);
|
|
1691
1690
|
}
|
|
1692
|
-
html.push("<td>", item
|
|
1691
|
+
html.push("<td>", item.rate, "%", rate_tips, "</td>");
|
|
1693
1692
|
html.push("<td>", rate_change, "</td>");
|
|
1694
|
-
html.push("<td>", Util.to_unit(item
|
|
1693
|
+
html.push("<td>", Util.to_unit(item.fund_market_capital), "</td>");
|
|
1695
1694
|
html.push("</tr>");
|
|
1696
1695
|
});
|
|
1697
1696
|
} else {
|
|
@@ -1699,7 +1698,7 @@ const Util = {
|
|
|
1699
1698
|
}
|
|
1700
1699
|
$(html.join("")).insertAfter("#" + component_id + "_head");
|
|
1701
1700
|
Util.hide_tips();
|
|
1702
|
-
if (j
|
|
1701
|
+
if (j.data) {
|
|
1703
1702
|
Util.refresh_price(component_id + "_body");
|
|
1704
1703
|
}
|
|
1705
1704
|
});
|
|
@@ -1711,17 +1710,17 @@ const Util = {
|
|
|
1711
1710
|
let html = [], index = 0;
|
|
1712
1711
|
let is_mobile = Util.is_mobile();
|
|
1713
1712
|
let is_speech_synthesis = $("#word_recite").length > 0 ? 1 : 0;
|
|
1714
|
-
j
|
|
1713
|
+
j.data.forEach(function (item) {
|
|
1715
1714
|
index++;
|
|
1716
1715
|
html.push("<tr>");
|
|
1717
|
-
html.push("<td>", Util.pack_html_link("https://api.mymemory.translated.net/get?langpair=en|zh-CN&q=" + item
|
|
1718
|
-
html.push("<td>", Util.pack_html_link("https://cn.bing.com/dict/search?q=" + item
|
|
1716
|
+
html.push("<td>", Util.pack_html_link("https://api.mymemory.translated.net/get?langpair=en|zh-CN&q=" + item.word, index), "</td>");
|
|
1717
|
+
html.push("<td>", Util.pack_html_link("https://cn.bing.com/dict/search?q=" + item.word, item.word), "</td>");
|
|
1719
1718
|
if (is_mobile) {
|
|
1720
|
-
html.push("<td class='text-left'>", item
|
|
1719
|
+
html.push("<td class='text-left'>", item.chinese, "</td>");
|
|
1721
1720
|
} else {
|
|
1722
|
-
html.push("<td>", item
|
|
1721
|
+
html.push("<td>", item.chinese, "</td>");
|
|
1723
1722
|
}
|
|
1724
|
-
html.push("<td>", Util.seconds_to_format(item
|
|
1723
|
+
html.push("<td>", Util.seconds_to_format(item.date), "</td>");
|
|
1725
1724
|
if (is_speech_synthesis === 1) {
|
|
1726
1725
|
html.push("<td class='word_utterance' style='cursor: pointer;'><i class='glyphicon glyphicon-volume-up'></i></td>");
|
|
1727
1726
|
}
|
|
@@ -1734,7 +1733,7 @@ const Util = {
|
|
|
1734
1733
|
let day_num_html = [];
|
|
1735
1734
|
day_num_html.push('<option value="">全部</option>');
|
|
1736
1735
|
j["day_num"].forEach(function (item) {
|
|
1737
|
-
day_num_html.push('<option value="', item
|
|
1736
|
+
day_num_html.push('<option value="', item.day, '">', item.day, '(', item.num, ')</option>');
|
|
1738
1737
|
});
|
|
1739
1738
|
let wdn_obj = $("#word_day_num");
|
|
1740
1739
|
wdn_obj.html(day_num_html.join(""));
|
|
@@ -1812,34 +1811,34 @@ const Util = {
|
|
|
1812
1811
|
let category_top_type = parseInt($("#category_top_type").val());
|
|
1813
1812
|
Util.post(location.pathname, {"action": "category_top_statistics", "type": category_top_type}, function (j) {
|
|
1814
1813
|
let html = [];
|
|
1815
|
-
j
|
|
1814
|
+
j.data.forEach(function (item) {
|
|
1816
1815
|
let date_data = [], cole_url = "";
|
|
1817
1816
|
html.push("<tr>");
|
|
1818
|
-
item
|
|
1817
|
+
item.name = item.name + "(" + item.code + ")";
|
|
1819
1818
|
if (category_top_type === 2) {
|
|
1820
|
-
cole_url = "https://q.10jqka.com.cn/thshy/detail/code/" + item
|
|
1819
|
+
cole_url = "https://q.10jqka.com.cn/thshy/detail/code/" + item.code;
|
|
1821
1820
|
} else if (category_top_type === 3) {
|
|
1822
|
-
cole_url = "https://www.swsresearch.com/institute_sw/allIndex/releasedIndex/releasedetail?code=" + item
|
|
1821
|
+
cole_url = "https://www.swsresearch.com/institute_sw/allIndex/releasedIndex/releasedetail?code=" + item.code + "&name=" + item.code;
|
|
1823
1822
|
} else {
|
|
1824
|
-
cole_url = "https://xueqiu.com/S/" + Util.code_to_fund_symbol(item
|
|
1823
|
+
cole_url = "https://xueqiu.com/S/" + Util.code_to_fund_symbol(item.code);
|
|
1825
1824
|
}
|
|
1826
|
-
html.push("<td>", Util.pack_html_link(cole_url, item
|
|
1827
|
-
html.push("<td>", item
|
|
1828
|
-
html.push("<td data-val='", item
|
|
1829
|
-
if (item
|
|
1830
|
-
html.push("<td data-val='", item
|
|
1825
|
+
html.push("<td>", Util.pack_html_link(cole_url, item.name), "</td>");
|
|
1826
|
+
html.push("<td>", item.num, "</td>");
|
|
1827
|
+
html.push("<td data-val='", item.interval_day, "'>", (item.interval_day < 10000 ? (item.interval_day + "天") : "--"), "</td>");
|
|
1828
|
+
if (item.dist_day < item.interval_day) {
|
|
1829
|
+
html.push("<td data-val='", item.dist_day, "'>", item.dist_day, "天</td>");
|
|
1831
1830
|
} else {
|
|
1832
|
-
html.push("<td class='danger' data-val='", item
|
|
1831
|
+
html.push("<td class='danger' data-val='", item.dist_day, "'>", item.dist_day, "天</td>");
|
|
1833
1832
|
}
|
|
1834
|
-
item
|
|
1835
|
-
let date_format = Util.seconds_to_format(d
|
|
1836
|
-
if (d
|
|
1833
|
+
item.data.forEach(function (d) {
|
|
1834
|
+
let date_format = Util.seconds_to_format(d.date, "%Y-%m-%d");
|
|
1835
|
+
if (d.date === j.latest_date) {
|
|
1837
1836
|
date_format = "<span class='label label-info'>" + date_format + " </span>";
|
|
1838
1837
|
}
|
|
1839
1838
|
date_data.push(date_format + "(" + Util.parse_ratio(d["p_change"]) + ") ");
|
|
1840
1839
|
});
|
|
1841
1840
|
date_data = date_data.join("")
|
|
1842
|
-
if (item
|
|
1841
|
+
if (item.num > 6) {
|
|
1843
1842
|
date_data += "...";
|
|
1844
1843
|
}
|
|
1845
1844
|
html.push("<td class='text-left'>", date_data, "</td>");
|
|
@@ -1904,33 +1903,33 @@ const Util = {
|
|
|
1904
1903
|
};
|
|
1905
1904
|
Util.post(Util.get_url("macro_currency"), payload, function (j) {
|
|
1906
1905
|
let html = [], low_exchange_rate = 0, high_exchange_rate = 0;
|
|
1907
|
-
j
|
|
1908
|
-
if (low_exchange_rate === 0 || item
|
|
1909
|
-
low_exchange_rate = item
|
|
1906
|
+
j.data.forEach(function (item) {
|
|
1907
|
+
if (low_exchange_rate === 0 || item.exchange_rate < low_exchange_rate) {
|
|
1908
|
+
low_exchange_rate = item.exchange_rate;
|
|
1910
1909
|
}
|
|
1911
|
-
high_exchange_rate = Math.max(high_exchange_rate, item
|
|
1910
|
+
high_exchange_rate = Math.max(high_exchange_rate, item.exchange_rate);
|
|
1912
1911
|
});
|
|
1913
|
-
j
|
|
1914
|
-
if (item
|
|
1912
|
+
j.data.forEach(function (item) {
|
|
1913
|
+
if (item.exchange_rate === high_exchange_rate) {
|
|
1915
1914
|
html.push("<tr class='danger'>");
|
|
1916
|
-
} else if (item
|
|
1915
|
+
} else if (item.exchange_rate === low_exchange_rate) {
|
|
1917
1916
|
html.push("<tr class='success'>");
|
|
1918
1917
|
} else {
|
|
1919
1918
|
html.push("<tr>");
|
|
1920
1919
|
}
|
|
1921
|
-
html.push("<td>", Util.seconds_to_format(item
|
|
1922
|
-
html.push("<td>", item
|
|
1923
|
-
html.push("<td>", item
|
|
1924
|
-
html.push("<td>", item
|
|
1920
|
+
html.push("<td>", Util.seconds_to_format(item.date, "%Y-%m-%d"), "</td>");
|
|
1921
|
+
html.push("<td>", item.exchange_rate, "</td>");
|
|
1922
|
+
html.push("<td>", item.low_exchange_rate, "</td>");
|
|
1923
|
+
html.push("<td>", item.high_exchange_rate, "</td>");
|
|
1925
1924
|
html.push("</tr>");
|
|
1926
1925
|
});
|
|
1927
1926
|
Util.render_table_html("currency_modal_body_body", html);
|
|
1928
1927
|
let currency_modal_summary = "历史最低:<span class='label label-success'>" + j["hist_low"] +
|
|
1929
1928
|
"</span> 历史最高:<span class='label label-danger'>" + j["hist_high"] +
|
|
1930
|
-
"</span> 年初至今:" + Util.digit_compare_trend1(j
|
|
1931
|
-
" 52周最高:" + Util.digit_compare_trend1(j
|
|
1932
|
-
" 52周最低:" + Util.digit_compare_trend1(j
|
|
1933
|
-
let title = j
|
|
1929
|
+
"</span> 年初至今:" + Util.digit_compare_trend1(j.exchange_rate, j["year_exchange_rate"]) +
|
|
1930
|
+
" 52周最高:" + Util.digit_compare_trend1(j.exchange_rate, j["week52high"]) +
|
|
1931
|
+
" 52周最低:" + Util.digit_compare_trend1(j.exchange_rate, j["week52low"]);
|
|
1932
|
+
let title = j.name !== currency ? (j.name + "(" + currency.toUpperCase() + ")") : j.name;
|
|
1934
1933
|
title = '<i class="fa fa-' + currency + '"></i> ' + title;
|
|
1935
1934
|
title = Util.pack_html_link("https://cn.investing.com/currencies/" + currency + "-cny", title);
|
|
1936
1935
|
$("#currency_modal_title").html(title + " " + currency_modal_summary);
|
|
@@ -1997,28 +1996,28 @@ const Util = {
|
|
|
1997
1996
|
};
|
|
1998
1997
|
Util.post(Util.get_url("coin_price"), payload, function (j) {
|
|
1999
1998
|
let html = [], low_price = 0, high_price = 0;
|
|
2000
|
-
j
|
|
2001
|
-
if (low_price === 0 || item
|
|
2002
|
-
low_price = item
|
|
1999
|
+
j.data.forEach(function (item) {
|
|
2000
|
+
if (low_price === 0 || item.price < low_price) {
|
|
2001
|
+
low_price = item.price;
|
|
2003
2002
|
}
|
|
2004
|
-
high_price = Math.max(high_price, item
|
|
2003
|
+
high_price = Math.max(high_price, item.price);
|
|
2005
2004
|
});
|
|
2006
|
-
j
|
|
2007
|
-
if (item
|
|
2005
|
+
j.data.forEach(function (item) {
|
|
2006
|
+
if (item.price === high_price) {
|
|
2008
2007
|
html.push("<tr class='danger'>");
|
|
2009
|
-
} else if (item
|
|
2008
|
+
} else if (item.price === low_price) {
|
|
2010
2009
|
html.push("<tr class='success'>");
|
|
2011
2010
|
} else {
|
|
2012
2011
|
html.push("<tr>");
|
|
2013
2012
|
}
|
|
2014
|
-
html.push("<td>", Util.seconds_to_format(item
|
|
2015
|
-
html.push("<td>", item
|
|
2016
|
-
html.push("<td>", item
|
|
2017
|
-
html.push("<td>", item
|
|
2018
|
-
html.push("<td>", item
|
|
2019
|
-
html.push("<td>", Util.parse_ratio(item
|
|
2020
|
-
html.push("<td>", Util.to_unit(item
|
|
2021
|
-
html.push("<td>", Util.to_unit(item
|
|
2013
|
+
html.push("<td>", Util.seconds_to_format(item.date, "%Y-%m-%d"), "</td>");
|
|
2014
|
+
html.push("<td>", item.open, "</td>");
|
|
2015
|
+
html.push("<td>", item.low, "</td>");
|
|
2016
|
+
html.push("<td>", item.high, "</td>");
|
|
2017
|
+
html.push("<td>", item.price, "</td>");
|
|
2018
|
+
html.push("<td>", Util.parse_ratio(item.p_change), "</td>");
|
|
2019
|
+
html.push("<td>", Util.to_unit(item.amount), "</td>");
|
|
2020
|
+
html.push("<td>", Util.to_unit(item.market_capital), "</td>");
|
|
2022
2021
|
html.push("</tr>");
|
|
2023
2022
|
});
|
|
2024
2023
|
Util.render_table_html("btc_modal_body_body", html);
|
|
@@ -2066,22 +2065,22 @@ const Util = {
|
|
|
2066
2065
|
let buy_times = 0;
|
|
2067
2066
|
let sell_times = 0;
|
|
2068
2067
|
let total_times = 0;
|
|
2069
|
-
j
|
|
2068
|
+
j.data.forEach(function (item) {
|
|
2070
2069
|
total_times += 1;
|
|
2071
|
-
if (item
|
|
2070
|
+
if (item.buy > item.sell) {
|
|
2072
2071
|
buy_times += 1;
|
|
2073
|
-
} else if (item
|
|
2072
|
+
} else if (item.buy < item.sell) {
|
|
2074
2073
|
sell_times += 1;
|
|
2075
2074
|
}
|
|
2076
|
-
let inflow = item
|
|
2075
|
+
let inflow = item.buy - item.sell;
|
|
2077
2076
|
summary_inflow += inflow;
|
|
2078
2077
|
html.push("<tr>");
|
|
2079
2078
|
html.push("<td>", total_times, "</td>");
|
|
2080
|
-
html.push("<td>", Util.seconds_to_format(item
|
|
2081
|
-
html.push("<td title='", item
|
|
2082
|
-
html.push("<td title='", item
|
|
2079
|
+
html.push("<td>", Util.seconds_to_format(item.date, "%Y-%m-%d"), "</td>");
|
|
2080
|
+
html.push("<td title='", item.buy, "'>", Util.to_unit(item.buy), "</td>");
|
|
2081
|
+
html.push("<td title='", item.sell, "'>", Util.to_unit(item.sell), "</td>");
|
|
2083
2082
|
html.push("<td title='", inflow, "'><b class='", Util.text_color(inflow), "'>", Util.to_unit(inflow), "</b></td>");
|
|
2084
|
-
html.push("<td>", Util.to_unit(item
|
|
2083
|
+
html.push("<td>", Util.to_unit(item.buy + item.sell), "</td>");
|
|
2085
2084
|
html.push("</tr>");
|
|
2086
2085
|
});
|
|
2087
2086
|
Util.render_table_html(component_id + "_body_body", html);
|
|
@@ -2182,8 +2181,8 @@ const Util = {
|
|
|
2182
2181
|
}
|
|
2183
2182
|
if (typeof IndexList != "undefined") {
|
|
2184
2183
|
IndexList.forEach(function (item) {
|
|
2185
|
-
if (index_type === 0 || (index_type === 1 && item
|
|
2186
|
-
html.push('<option ', ((item
|
|
2184
|
+
if (index_type === 0 || (index_type === 1 && item.is_industry === 1) || (index_type === 2 && item.is_key === 1)) {
|
|
2185
|
+
html.push('<option ', ((item.code === "SH000906" && is_select === 1) ? "selected" : ""), ' value="', item.code, '">', item.name, '</option>');
|
|
2187
2186
|
}
|
|
2188
2187
|
});
|
|
2189
2188
|
}
|
|
@@ -2202,7 +2201,7 @@ const Util = {
|
|
|
2202
2201
|
html.push('<label for="', element_id, '"></label>');
|
|
2203
2202
|
html.push('<select id="', element_id, '" class="form-control">');
|
|
2204
2203
|
data.forEach(function (item) {
|
|
2205
|
-
html.push('<option value="', item
|
|
2204
|
+
html.push('<option value="', item.val, '">', item.name, '</option>');
|
|
2206
2205
|
});
|
|
2207
2206
|
html.push('</select>');
|
|
2208
2207
|
$("#" + component_id).html(html.join(""));
|
|
@@ -2913,7 +2912,7 @@ const Util = {
|
|
|
2913
2912
|
request_arguments: function () {
|
|
2914
2913
|
let url = location.search; //获取url中"?"符后的字串
|
|
2915
2914
|
let obj = {};
|
|
2916
|
-
if (url.
|
|
2915
|
+
if (url.includes("?")) {
|
|
2917
2916
|
let query_array = url.substring(1).split("&");
|
|
2918
2917
|
for (let i = 0; i < query_array.length; i++) {
|
|
2919
2918
|
let query = query_array[i].split("=");
|
|
@@ -2973,7 +2972,7 @@ const Util = {
|
|
|
2973
2972
|
if (interval > 0) {
|
|
2974
2973
|
setTimeout(Util.hide_tips, interval);
|
|
2975
2974
|
}
|
|
2976
|
-
if (msg.
|
|
2975
|
+
if (msg.endsWith('.')) {
|
|
2977
2976
|
loading = msg.replace(/[^.]/g, '').length;
|
|
2978
2977
|
setTimeout(() => {
|
|
2979
2978
|
Util.show_tips(msg, interval, cls, loading);
|
|
@@ -3053,49 +3052,49 @@ const Util = {
|
|
|
3053
3052
|
let valid_code_list = [];
|
|
3054
3053
|
let total_change_percent = 0, total_year_change_percent = 0, total_d5_change_percent = 0;
|
|
3055
3054
|
$.each(j, function (code, item) {
|
|
3056
|
-
if (item
|
|
3057
|
-
valid_code_list.push(item
|
|
3058
|
-
total_change_percent += ((item
|
|
3059
|
-
if (item
|
|
3060
|
-
total_year_change_percent += ((item
|
|
3055
|
+
if (item.price && item.previous_price && item.price > 0 && item.previous_price > 0) {
|
|
3056
|
+
valid_code_list.push(item.code);
|
|
3057
|
+
total_change_percent += ((item.price - item.previous_price) / item.previous_price);
|
|
3058
|
+
if (item.year_price && item.year_price > 0) {
|
|
3059
|
+
total_year_change_percent += ((item.price - item.year_price) / item.year_price);
|
|
3061
3060
|
}
|
|
3062
|
-
if (item
|
|
3063
|
-
total_d5_change_percent += ((item
|
|
3061
|
+
if (item.d5_price && item.d5_price > 0) {
|
|
3062
|
+
total_d5_change_percent += ((item.price - item.d5_price) / item.d5_price);
|
|
3064
3063
|
}
|
|
3065
3064
|
}
|
|
3066
3065
|
Util.render_price(item);
|
|
3067
|
-
if (item
|
|
3066
|
+
if (item.holder_num && item.holder_num > 0) {
|
|
3068
3067
|
$(".holder_" + code).each(function () {
|
|
3069
3068
|
$(this).html(Util.pack_holder_num(item));
|
|
3070
|
-
$(this).attr("data-val", item
|
|
3069
|
+
$(this).attr("data-val", item.holder_num);
|
|
3071
3070
|
});
|
|
3072
3071
|
}
|
|
3073
|
-
if (item
|
|
3072
|
+
if (item.cur_fund_num && item.cur_fund_num > 0) {
|
|
3074
3073
|
$(".fund_" + code).each(function () {
|
|
3075
3074
|
$(this).html(Util.pack_fund_num(item));
|
|
3076
|
-
$(this).attr("data-val", item
|
|
3075
|
+
$(this).attr("data-val", item.cur_fund_num);
|
|
3077
3076
|
});
|
|
3078
3077
|
}
|
|
3079
|
-
if (item
|
|
3078
|
+
if (item.money_net_inflow && item.money_net_inflow !== 0) {
|
|
3080
3079
|
$(".money_inflow_" + code).each(function () {
|
|
3081
3080
|
Util.render_money_inflow($(this), item);
|
|
3082
3081
|
});
|
|
3083
3082
|
}
|
|
3084
3083
|
if ($("#remark_" + code).length) {
|
|
3085
3084
|
let remark = "";
|
|
3086
|
-
if (item
|
|
3085
|
+
if (item.is_bull_trend) {
|
|
3087
3086
|
remark += "<b>" + Util.pack_html_link(Util.get_url("trend_bull_trend"), "多头趋势") + "</b><br>";
|
|
3088
3087
|
}
|
|
3089
|
-
if (item
|
|
3088
|
+
if (item.is_kdj_cross) {
|
|
3090
3089
|
remark += "<b>" + Util.pack_html_link(Util.get_url("trend_kdj"), "KDJ金叉") + "</b><br>";
|
|
3091
3090
|
}
|
|
3092
|
-
if (item
|
|
3091
|
+
if (item.is_macd_cross) {
|
|
3093
3092
|
remark += "<b>" + Util.pack_html_link(Util.get_url("trend_macd_cross"), "MACD金叉") + "</b><br>";
|
|
3094
3093
|
}
|
|
3095
|
-
if (item
|
|
3094
|
+
if (item.kdj_trend && item.kdj_trend > 0) {
|
|
3096
3095
|
let kdj_name = "KDJ金叉";
|
|
3097
3096
|
let kdj_url = Util.get_url("trend_kdj");
|
|
3098
|
-
if (item
|
|
3097
|
+
if (item.kdj_trend === 2) {
|
|
3099
3098
|
kdj_name = "周" + kdj_name;
|
|
3100
3099
|
kdj_url += "?date_type=3";
|
|
3101
3100
|
} else {
|
|
@@ -3142,8 +3141,8 @@ const Util = {
|
|
|
3142
3141
|
let payload = {action: "index_price", index_list: index_list, code_list: code_list.join("-")};
|
|
3143
3142
|
Util.post("/action", payload, function (j) {
|
|
3144
3143
|
// 当前行情指数
|
|
3145
|
-
if (j
|
|
3146
|
-
let index_data_html = Util.parse_index_data(j
|
|
3144
|
+
if (j.index_data && $("#index_data").length) {
|
|
3145
|
+
let index_data_html = Util.parse_index_data(j.index_data);
|
|
3147
3146
|
$("#index_data").html(index_data_html);
|
|
3148
3147
|
}
|
|
3149
3148
|
code_list.forEach(function (code) {
|
|
@@ -3152,7 +3151,7 @@ const Util = {
|
|
|
3152
3151
|
} else {
|
|
3153
3152
|
$(".price_" + code).each(function () {
|
|
3154
3153
|
let price = $(this).text();
|
|
3155
|
-
if (price.
|
|
3154
|
+
if (!price.includes("(") && !price.includes(")")) {
|
|
3156
3155
|
price = parseFloat(price);
|
|
3157
3156
|
$(this).html(Util.digit_compare_trend(price, price));
|
|
3158
3157
|
}
|
|
@@ -3308,19 +3307,19 @@ const Util = {
|
|
|
3308
3307
|
if (index_data) {
|
|
3309
3308
|
let is_small = Util.is_small_screen();
|
|
3310
3309
|
index_data.forEach(function (item) {
|
|
3311
|
-
let short_name = item
|
|
3310
|
+
let short_name = item.name;
|
|
3312
3311
|
if (is_small) {
|
|
3313
3312
|
short_name = short_name.replace("指数", "").replace("成指", "").replace("板指", "");
|
|
3314
3313
|
}
|
|
3315
|
-
if (item
|
|
3316
|
-
short_name = "<a style='text-decoration: none;' href='" + item
|
|
3314
|
+
if (item.href) {
|
|
3315
|
+
short_name = "<a style='text-decoration: none;' href='" + item.href + "' target='_blank' rel='noopener noreferrer nofollow'>" + short_name + "</a>";
|
|
3317
3316
|
}
|
|
3318
|
-
let title = item
|
|
3319
|
-
if (item
|
|
3320
|
-
title = item
|
|
3317
|
+
let title = item.name;
|
|
3318
|
+
if (item.code) {
|
|
3319
|
+
title = item.name + "(" + item.code + ")";
|
|
3321
3320
|
}
|
|
3322
3321
|
html.push("<span title='", title, "'>", short_name, ":");
|
|
3323
|
-
html.push(Util.pack_index_data(item
|
|
3322
|
+
html.push(Util.pack_index_data(item.value, item.change_rate));
|
|
3324
3323
|
html.push("</span> ");
|
|
3325
3324
|
});
|
|
3326
3325
|
}
|
|
@@ -3369,17 +3368,17 @@ const Util = {
|
|
|
3369
3368
|
*/
|
|
3370
3369
|
pack_holder_num: function (item) {
|
|
3371
3370
|
let holder_info = "--";
|
|
3372
|
-
if (item
|
|
3371
|
+
if (item.code && !Util.is_cn(item.code)) {
|
|
3373
3372
|
return holder_info;
|
|
3374
3373
|
}
|
|
3375
|
-
if (item
|
|
3376
|
-
if (item
|
|
3377
|
-
holder_info = Util.digit_compare_trend(item
|
|
3374
|
+
if (item.holder_num && item.holder_num > 0) {
|
|
3375
|
+
if (item.pre_holder_num && item.pre_holder_num > 0) {
|
|
3376
|
+
holder_info = Util.digit_compare_trend(item.holder_num, item.pre_holder_num);
|
|
3378
3377
|
} else {
|
|
3379
|
-
holder_info = Util.digit_compare_trend(item
|
|
3378
|
+
holder_info = Util.digit_compare_trend(item.holder_num, 0);
|
|
3380
3379
|
}
|
|
3381
3380
|
}
|
|
3382
|
-
let holder_url = "/stock/" + item
|
|
3381
|
+
let holder_url = "/stock/" + item.code + "?tab=holder_data";
|
|
3383
3382
|
return Util.pack_html_link(holder_url, holder_info);
|
|
3384
3383
|
},
|
|
3385
3384
|
|
|
@@ -3390,13 +3389,13 @@ const Util = {
|
|
|
3390
3389
|
*/
|
|
3391
3390
|
pack_fund_num: function (item) {
|
|
3392
3391
|
let fund_num = "--";
|
|
3393
|
-
if (item
|
|
3392
|
+
if (item.code && !Util.is_cn(item.code)) {
|
|
3394
3393
|
return fund_num;
|
|
3395
3394
|
}
|
|
3396
|
-
if (item
|
|
3397
|
-
fund_num = Util.digit_compare_trend(item
|
|
3395
|
+
if (item.cur_fund_num && item.cur_fund_num > 0) {
|
|
3396
|
+
fund_num = Util.digit_compare_trend(item.cur_fund_num, item.pre_fund_num);
|
|
3398
3397
|
}
|
|
3399
|
-
return Util.pack_html_link("/stock/" + item
|
|
3398
|
+
return Util.pack_html_link("/stock/" + item.code + "?tab=public_fund", fund_num);
|
|
3400
3399
|
},
|
|
3401
3400
|
|
|
3402
3401
|
/**
|
|
@@ -3405,14 +3404,14 @@ const Util = {
|
|
|
3405
3404
|
* @returns {string}
|
|
3406
3405
|
*/
|
|
3407
3406
|
pack_fund_administrator: function (item) {
|
|
3408
|
-
if (item
|
|
3407
|
+
if (item.administrator && item.administrator !== "---") {
|
|
3409
3408
|
let url = "";
|
|
3410
|
-
if (item
|
|
3411
|
-
url = "https://fund.eastmoney.com/company/" + item
|
|
3409
|
+
if (item.administrator_code) {
|
|
3410
|
+
url = "https://fund.eastmoney.com/company/" + item.administrator_code + ".html";
|
|
3412
3411
|
} else {
|
|
3413
|
-
url = "https://baike.baidu.com/item/" + item
|
|
3412
|
+
url = "https://baike.baidu.com/item/" + item.administrator.replace("基金管理", "基金");
|
|
3414
3413
|
}
|
|
3415
|
-
return Util.pack_html_link(url, item
|
|
3414
|
+
return Util.pack_html_link(url, item.administrator);
|
|
3416
3415
|
}
|
|
3417
3416
|
return "--";
|
|
3418
3417
|
},
|
|
@@ -3423,9 +3422,9 @@ const Util = {
|
|
|
3423
3422
|
* @returns {string}
|
|
3424
3423
|
*/
|
|
3425
3424
|
pack_fund_manager: function (item) {
|
|
3426
|
-
if (item
|
|
3425
|
+
if (item.managers && item.managers !== "---") {
|
|
3427
3426
|
let html = [];
|
|
3428
|
-
let managers = item
|
|
3427
|
+
let managers = item.managers.replace(/、/g, " ").replace(/,/g, " ").replace(/,/g, " ").split(" ");
|
|
3429
3428
|
managers.forEach(function(manager) {
|
|
3430
3429
|
if (manager) {
|
|
3431
3430
|
html.push(Util.pack_html_link("https://www.howbuy.com/search/quicksearch.htm?skey=" + manager, manager));
|
|
@@ -3442,8 +3441,8 @@ const Util = {
|
|
|
3442
3441
|
* @returns {string}
|
|
3443
3442
|
*/
|
|
3444
3443
|
pack_fund_rating: function (item) {
|
|
3445
|
-
if (item
|
|
3446
|
-
let rating = item
|
|
3444
|
+
if (item.rating) {
|
|
3445
|
+
let rating = item.rating;
|
|
3447
3446
|
if (rating.includes("买入") || rating.includes("增持") || rating.includes("推荐")) {
|
|
3448
3447
|
return "<b class='text-danger'>" + rating + "</b>";
|
|
3449
3448
|
} else if (rating.includes("卖出") || rating.includes("减持")) {
|
|
@@ -3460,15 +3459,15 @@ const Util = {
|
|
|
3460
3459
|
* @returns {string}
|
|
3461
3460
|
*/
|
|
3462
3461
|
pack_snowball_follower: function (item) {
|
|
3463
|
-
if (item
|
|
3464
|
-
let snowball_follower_rank = Util.to_unit(item
|
|
3465
|
-
let market_type = Util.is_hk(item
|
|
3462
|
+
if (item.snowball_follower && item.snowball_follower > 0) {
|
|
3463
|
+
let snowball_follower_rank = Util.to_unit(item.snowball_follower) + "(" + item.snowball_follower_rank + ")";
|
|
3464
|
+
let market_type = Util.is_hk(item.code) ? "hk" : "cn";
|
|
3466
3465
|
let url = Util.get_url("rank_holder") + "?sort_type=snowball_follower&market_type=" + market_type;
|
|
3467
|
-
if (item
|
|
3468
|
-
url += "&code=" + item
|
|
3466
|
+
if (item.code) {
|
|
3467
|
+
url += "&code=" + item.code;
|
|
3469
3468
|
}
|
|
3470
3469
|
$("#snowball_follower").html(Util.pack_html_link(url, snowball_follower_rank));
|
|
3471
|
-
let tooltip = "雪球共有 " + item
|
|
3470
|
+
let tooltip = "雪球共有 " + item.snowball_follower + " 人关注,关注排名第 " + item.snowball_follower_rank + " 位";
|
|
3472
3471
|
$("#snowball_follower_info").attr("data-original-title", tooltip);
|
|
3473
3472
|
}
|
|
3474
3473
|
},
|
|
@@ -3480,12 +3479,12 @@ const Util = {
|
|
|
3480
3479
|
* @returns {string}
|
|
3481
3480
|
*/
|
|
3482
3481
|
render_money_inflow: function (obj, item) {
|
|
3483
|
-
if (item
|
|
3484
|
-
let money_net_inflow = "<b>" + Util.to_unit(item
|
|
3485
|
-
money_net_inflow = Util.pack_html_link("/stock/" + item
|
|
3486
|
-
obj.html(Util.pack_html_link("/stock/" + item
|
|
3487
|
-
obj.attr("data-val", item
|
|
3488
|
-
obj.find("span").first().addClass(Util.text_color(item
|
|
3482
|
+
if (item.money_net_inflow && item.money_net_inflow !== 0) {
|
|
3483
|
+
let money_net_inflow = "<b>" + Util.to_unit(item.money_net_inflow) + "</b>";
|
|
3484
|
+
money_net_inflow = Util.pack_html_link("/stock/" + item.code + "?tab=big_deal", money_net_inflow);
|
|
3485
|
+
obj.html(Util.pack_html_link("/stock/" + item.code + "?tab=big_deal", money_net_inflow));
|
|
3486
|
+
obj.attr("data-val", item.money_net_inflow);
|
|
3487
|
+
obj.find("span").first().addClass(Util.text_color(item.money_net_inflow));
|
|
3489
3488
|
}
|
|
3490
3489
|
},
|
|
3491
3490
|
|
|
@@ -3495,16 +3494,16 @@ const Util = {
|
|
|
3495
3494
|
* @param element_id
|
|
3496
3495
|
*/
|
|
3497
3496
|
render_ma_deduction: function (item, element_id) {
|
|
3498
|
-
if (item
|
|
3497
|
+
if (item.price && item.ma_deduction && item.ma_deduction.length > 0) {
|
|
3499
3498
|
let ma_deduction_html = [];
|
|
3500
|
-
item
|
|
3499
|
+
item.ma_deduction.forEach(function (ma) {
|
|
3501
3500
|
if (ma["deduction_price"] > 0) {
|
|
3502
3501
|
let day_ma_str = ma["day"] + "日均线";
|
|
3503
3502
|
if (ma["day"] === 20 || ma["day"] === 60 || ma["day"] === 120) {
|
|
3504
3503
|
day_ma_str = "<span class='label label-info'>" + day_ma_str + "</span>";
|
|
3505
3504
|
}
|
|
3506
|
-
let deduction_cls = Util.text_color(item
|
|
3507
|
-
let ma_cls = Util.text_color(item
|
|
3505
|
+
let deduction_cls = Util.text_color(item.price, ma["deduction_price"]);
|
|
3506
|
+
let ma_cls = Util.text_color(item.price, ma["ma"]);
|
|
3508
3507
|
ma_deduction_html.push(day_ma_str + ":<b class='" + ma_cls + "'>" + ma["ma"] + "</b>(<b class='" + deduction_cls + "'>" + ma["deduction_price"] + "</b>)");
|
|
3509
3508
|
}
|
|
3510
3509
|
});
|
|
@@ -3521,18 +3520,18 @@ const Util = {
|
|
|
3521
3520
|
let price_market_type = $("#price_market_type").val();
|
|
3522
3521
|
data.forEach(function (item) {
|
|
3523
3522
|
html.push("<tr>");
|
|
3524
|
-
html.push("<td>", Util.snowball_url(item
|
|
3525
|
-
let stock_name = item
|
|
3523
|
+
html.push("<td>", Util.snowball_url(item.code), "</td>");
|
|
3524
|
+
let stock_name = item.name;
|
|
3526
3525
|
if (price_market_type !== "cn") {
|
|
3527
3526
|
stock_name = Util.strip_bracket_string(stock_name);
|
|
3528
3527
|
stock_name = stock_name.substring(0, 6);
|
|
3529
3528
|
}
|
|
3530
|
-
html.push("<td>", Util.stock_url(item
|
|
3531
|
-
html.push("<td>", (item
|
|
3532
|
-
html.push("<td>", Util.industry_url(item
|
|
3533
|
-
let p_color = Util.text_color(item
|
|
3534
|
-
html.push("<td><b class='", p_color, "'>", Util.to_float(item
|
|
3535
|
-
let p_change_rate = Util.calc_change_rate(item
|
|
3529
|
+
html.push("<td>", Util.stock_url(item.code, stock_name), "</td>");
|
|
3530
|
+
html.push("<td>", (item.market_capital ? (item.market_capital + "亿") : "--"), "</td>");
|
|
3531
|
+
html.push("<td>", Util.industry_url(item.code, item.industry), "</td>");
|
|
3532
|
+
let p_color = Util.text_color(item.close, item.open);
|
|
3533
|
+
html.push("<td><b class='", p_color, "'>", Util.to_float(item.close, 2), "<b></td>");
|
|
3534
|
+
let p_change_rate = Util.calc_change_rate(item.close, item.open, 4);
|
|
3536
3535
|
p_change_rate = Util.to_float(p_change_rate * 100, 2)
|
|
3537
3536
|
if (p_change_rate > 0) {
|
|
3538
3537
|
p_change_rate = "+" + p_change_rate;
|
|
@@ -3552,10 +3551,10 @@ const Util = {
|
|
|
3552
3551
|
let industry_url = Util.get_url("summary_industry");
|
|
3553
3552
|
data.forEach(function (item) {
|
|
3554
3553
|
html.push("<tr>");
|
|
3555
|
-
html.push("<td>", Util.pack_html_link("https://q.10jqka.com.cn/thshy/detail/code/" + item
|
|
3556
|
-
html.push("<td>", Util.pack_html_link(industry_url + "?code=" + item
|
|
3557
|
-
html.push("<td>", Util.year_price_rate(item
|
|
3558
|
-
html.push("<td>", Util.year_price_rate(item
|
|
3554
|
+
html.push("<td>", Util.pack_html_link("https://q.10jqka.com.cn/thshy/detail/code/" + item.code, item.code), "</td>");
|
|
3555
|
+
html.push("<td>", Util.pack_html_link(industry_url + "?code=" + item.code, item.name), "</td>");
|
|
3556
|
+
html.push("<td>", Util.year_price_rate(item.current_close, item.year_close, 1), "</td>");
|
|
3557
|
+
html.push("<td>", Util.year_price_rate(item.current_close, item.start_close, 1), "</td>");
|
|
3559
3558
|
html.push("</tr>");
|
|
3560
3559
|
});
|
|
3561
3560
|
Util.render_table_html("industry_table_body", html);
|
|
@@ -3569,22 +3568,22 @@ const Util = {
|
|
|
3569
3568
|
let html = [];
|
|
3570
3569
|
data.forEach(function (item) {
|
|
3571
3570
|
html.push("<tr>");
|
|
3572
|
-
html.push("<td>", Util.pack_html_link("https://fund.eastmoney.com/" + item
|
|
3573
|
-
html.push("<td><a class='link_cls' data-toggle='modal' data-target='.public_fund_modal' data-val='", item
|
|
3571
|
+
html.push("<td>", Util.pack_html_link("https://fund.eastmoney.com/" + item.code + ".html", item.code), "</td>");
|
|
3572
|
+
html.push("<td><a class='link_cls' data-toggle='modal' data-target='.public_fund_modal' data-val='", item.code, "'>", item.name, "</a></td>");
|
|
3574
3573
|
let change_quotient = "--";
|
|
3575
|
-
if (item
|
|
3576
|
-
let title = Util.strip_html(Util.to_unit(item
|
|
3577
|
-
if (item
|
|
3578
|
-
change_quotient = "<b title='" + title + "' class='text-danger'>+" + Util.strip_html(Util.to_unit(item
|
|
3579
|
-
} else if (item
|
|
3580
|
-
change_quotient = "<b title='" + title + "' class='text-success'>" + Util.strip_html(Util.to_unit(item
|
|
3574
|
+
if (item.start_quotient && item.end_quotient) {
|
|
3575
|
+
let title = Util.strip_html(Util.to_unit(item.start_quotient, 3)) + " - " + Util.strip_html(Util.to_unit(item.end_quotient, 3));
|
|
3576
|
+
if (item.end_quotient > item.start_quotient) {
|
|
3577
|
+
change_quotient = "<b title='" + title + "' class='text-danger'>+" + Util.strip_html(Util.to_unit(item.end_quotient - item.start_quotient, 1)) + "</b>";
|
|
3578
|
+
} else if (item.end_quotient < item.start_quotient) {
|
|
3579
|
+
change_quotient = "<b title='" + title + "' class='text-success'>" + Util.strip_html(Util.to_unit(item.end_quotient - item.start_quotient, 1)) + "</b>";
|
|
3581
3580
|
} else {
|
|
3582
3581
|
change_quotient = "<b title='" + title + "'>0.00</b>";
|
|
3583
3582
|
}
|
|
3584
3583
|
}
|
|
3585
3584
|
html.push("<td>", change_quotient, "</td>");
|
|
3586
|
-
html.push("<td>", Util.year_price_rate(item
|
|
3587
|
-
html.push("<td>", Util.year_price_rate(item
|
|
3585
|
+
html.push("<td>", Util.year_price_rate(item.current_close, item.year_close, 1), "</td>");
|
|
3586
|
+
html.push("<td>", Util.year_price_rate(item.current_close, item.start_close, 1), "</td>");
|
|
3588
3587
|
html.push("</tr>");
|
|
3589
3588
|
});
|
|
3590
3589
|
Util.render_table_html("etf_table_body", html);
|
|
@@ -3599,11 +3598,11 @@ const Util = {
|
|
|
3599
3598
|
let index_url = Util.get_url("summary_index");
|
|
3600
3599
|
data.forEach(function (item) {
|
|
3601
3600
|
html.push("<tr>");
|
|
3602
|
-
html.push("<td>", Util.pack_html_link(item
|
|
3603
|
-
html.push("<td>", Util.pack_html_link(index_url + "?index_code=" + item
|
|
3604
|
-
html.push("<td><b class='", Util.text_color(item
|
|
3605
|
-
html.push("<td>", Util.year_price_rate(item
|
|
3606
|
-
html.push("<td>", Util.year_price_rate(item
|
|
3601
|
+
html.push("<td>", Util.pack_html_link(item.url, item.code.toUpperCase()), "</td>");
|
|
3602
|
+
html.push("<td>", Util.pack_html_link(index_url + "?index_code=" + item.code, item.name), "</td>");
|
|
3603
|
+
html.push("<td><b class='", Util.text_color(item.current_close, item.start_close), "'>", Util.to_float(item.current_close, 2), "</b></td>");
|
|
3604
|
+
html.push("<td>", Util.year_price_rate(item.current_close, item.year_close, 1), "</td>");
|
|
3605
|
+
html.push("<td>", Util.year_price_rate(item.current_close, item.start_close, 1), "</td>");
|
|
3607
3606
|
html.push("</tr>");
|
|
3608
3607
|
});
|
|
3609
3608
|
Util.render_table_html("index_table_body", html);
|
|
@@ -3655,7 +3654,7 @@ const Util = {
|
|
|
3655
3654
|
* @param end_date
|
|
3656
3655
|
*/
|
|
3657
3656
|
init_date_range_picker: function (element_id, Obj, callback_func, start_date = 0, end_date = 0) {
|
|
3658
|
-
let separator = element_id.
|
|
3657
|
+
let separator = element_id.includes("_start_end") ? "_start_end" : "_";
|
|
3659
3658
|
let element_array = element_id.split(separator);
|
|
3660
3659
|
let prefix = element_array[0];
|
|
3661
3660
|
let select_id = prefix + "_time_select";
|
|
@@ -3755,8 +3754,8 @@ const Util = {
|
|
|
3755
3754
|
let option_data = {};
|
|
3756
3755
|
data.forEach(function (item) {
|
|
3757
3756
|
if (item[type]) {
|
|
3758
|
-
if (item
|
|
3759
|
-
option_data[item[type]] = item
|
|
3757
|
+
if (item.num) {
|
|
3758
|
+
option_data[item[type]] = item.num;
|
|
3760
3759
|
} else {
|
|
3761
3760
|
if (option_data[item[type]]) {
|
|
3762
3761
|
option_data[item[type]] += 1;
|
|
@@ -3788,7 +3787,7 @@ const Util = {
|
|
|
3788
3787
|
* @returns {boolean}
|
|
3789
3788
|
*/
|
|
3790
3789
|
is_industry_area: function (item, industry, area) {
|
|
3791
|
-
return (industry === "" || industry === item
|
|
3790
|
+
return (industry === "" || industry === item.industry) && (area === "" || area === item.area)
|
|
3792
3791
|
},
|
|
3793
3792
|
|
|
3794
3793
|
/**
|