sbd-npm 1.1.80 → 1.1.83
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/menu.js +2 -1
- package/package.json +1 -1
- package/summary_daily.js +6 -4
- package/util.js +39 -2
package/menu.js
CHANGED
@@ -75,6 +75,7 @@ const MenuList = [
|
|
75
75
|
{'key': 'macro_pmi', 'name': '制造业采购经理指数(PMI)', 'url': '/6669696b194ae77d596371139e6b53a7'},
|
76
76
|
{'key': 'macro_new_investor', 'name': '新增投资者', 'url': '/2268c61c6d62cdc8c1c7143aa524e2f1'},
|
77
77
|
{'key': 'macro_gold', 'name': '黄金ETF(GLD)', 'url': '/584b9ceb0c85571831f7211903147d47'},
|
78
|
+
{'key': 'macro_crude', 'name': '原油', 'url': '/78f8b798631b52153ff029fd301f9b8a'},
|
78
79
|
]
|
79
80
|
},
|
80
81
|
{
|
@@ -131,8 +132,8 @@ const MenuList = [
|
|
131
132
|
{'key': 'concept_bellwether', 'name': '龙头股', 'url': '/2995afdea420471e00c536182e711bef'},
|
132
133
|
{'key': 'concept_market_situation', 'name': '市值风云', 'url': '/02fdaf4d66cdecb092bcd65f569aa493'},
|
133
134
|
{'key': 'concept_down_top', 'name': '15-21年的超跌股', 'url': '/ae3bbf97a358392cfaa0ceb35cb3fb57'},
|
134
|
-
{'key': 'concept_cannon', 'name': '黄家礼炮', 'url': '/d6128a3ad91d545f2920fa2e324c37e1'},
|
135
135
|
{'key': 'concept_cloud', 'name': '心似白云常自在', 'url': '/1d883188398a3a8c743748c5eb81fe7b'},
|
136
|
+
{'key': 'concept_cannon', 'name': '黄家礼炮', 'url': '/d6128a3ad91d545f2920fa2e324c37e1'},
|
136
137
|
{'key': 'concept_wen', 'name': '崇文不尚武', 'url': '/b6fd64a2c54250b8ac039123e74e9b7e'},
|
137
138
|
{'key': 'concept_niu', 'name': '老曾阿牛', 'url': '/0f4a2714971424024c1ddd8651c26569'},
|
138
139
|
{'key': 'concept_qian', 'name': '唐史主任司马迁', 'url': '/8b3e40fe74b4870244bc51125da7675a'},
|
package/package.json
CHANGED
package/summary_daily.js
CHANGED
@@ -149,10 +149,12 @@ $(document).ready(function () {
|
|
149
149
|
stock_rate_html.push(_pack_stock_rate("-7% ~ -5%", pr["r7_5"], "bg-green"));
|
150
150
|
stock_rate_html.push(_pack_stock_rate("-10% ~ -7%", pr["r10_7"], "bg-green"));
|
151
151
|
$("#stock_rate_bar").html(stock_rate_html.join(""));
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
152
|
+
let up_num = pr["r0_3"] + pr["r3_5"] + pr["r5_7"] + pr["r7_10"];
|
153
|
+
let down_num = pr["r10_7"] + pr["r7_5"] + pr["r5_3"] + pr["r3_0"];
|
154
|
+
let stock_rate_tips = '涨: <b style="color: #FFF;" class="label label-danger">' + up_num + '</b> (涨停:<b><a style="text-decoration: underline;" class="text-danger" href="#" data-toggle="modal" data-target=".stock-rate-modal" data-cp="10% ~ 10%">' + pr["r10"] + '</a></b>), ';
|
155
|
+
stock_rate_tips += '跌: <b style="color: #FFF;" class="label label-success">' + down_num + '</b> (跌停:<b><a style="text-decoration: underline;" class="text-success" href="#" data-toggle="modal" data-target=".stock-rate-modal" data-cp="-10% ~ -10%">' + pr["r_10"] + '</a></b>), ';
|
156
|
+
stock_rate_tips += '涨跌比: <b style="color: #FFF;" class="label label-info">' + Util.to_float(up_num / down_num, 2) + '</b>';
|
157
|
+
$("#stock_rate_tips").html(stock_rate_tips);
|
156
158
|
},
|
157
159
|
|
158
160
|
/**
|
package/util.js
CHANGED
@@ -764,7 +764,7 @@ const Util = {
|
|
764
764
|
* 表格加载状态
|
765
765
|
* @param element_id
|
766
766
|
*/
|
767
|
-
set_table_loading: function(element_id) {
|
767
|
+
set_table_loading: function (element_id) {
|
768
768
|
let obj = $("#" + element_id);
|
769
769
|
let td_num = obj.parent().find('thead td').length;
|
770
770
|
obj.html('<tr><td colspan="' + td_num + '">Loading...</td></tr>');
|
@@ -846,7 +846,7 @@ const Util = {
|
|
846
846
|
});
|
847
847
|
},
|
848
848
|
|
849
|
-
render_stock_category_html: function() {
|
849
|
+
render_stock_category_html: function () {
|
850
850
|
if (Util["stock_category_table_id"]) {
|
851
851
|
let _html = [];
|
852
852
|
let total_num = 0;
|
@@ -1888,7 +1888,17 @@ const Util = {
|
|
1888
1888
|
Util.show_tips("Loading...");
|
1889
1889
|
//获取股票详情数据
|
1890
1890
|
Util.post("/action", {action: "code_detail", code_list: code_list.join("-")}, function (j) {
|
1891
|
+
let valid_code_list = [];
|
1892
|
+
let total_change_percent = 0;
|
1893
|
+
let total_year_change_percent = 0;
|
1891
1894
|
$.each(j, function (code, item) {
|
1895
|
+
if (item["price"] && item["previous_price"] && item["price"] > 0 && item["previous_price"] > 0) {
|
1896
|
+
valid_code_list.push(item["code"]);
|
1897
|
+
total_change_percent += ((item["price"] - item["previous_price"]) / item["previous_price"]);
|
1898
|
+
if (item["year_price"] && item["year_price"] > 0) {
|
1899
|
+
total_year_change_percent += ((item["price"] - item["year_price"]) / item["year_price"]);
|
1900
|
+
}
|
1901
|
+
}
|
1892
1902
|
Util.render_price(item);
|
1893
1903
|
if (item["holder_num"] && item["holder_num"] > 0) {
|
1894
1904
|
$(".holder_" + code).each(function () {
|
@@ -1927,6 +1937,33 @@ const Util = {
|
|
1927
1937
|
} else {
|
1928
1938
|
Util.refresh_index_price(element_id, index_list.join("-"), is_us, 0);
|
1929
1939
|
}
|
1940
|
+
if (valid_code_list.length > 0) { // 涨跌统计
|
1941
|
+
if ($("#" + element_id + "_tips").length) {
|
1942
|
+
let total_num = valid_code_list.length;
|
1943
|
+
let average_change_percent = Math.round((total_change_percent / total_num) * 10000) / 100;
|
1944
|
+
let average_year_change_percent = Math.round((total_year_change_percent / total_num) * 10000) / 100;
|
1945
|
+
let week_tips_id = element_id + "week_tips";
|
1946
|
+
$("#" + element_id + "_tips").html('共 <span class="label label-info">' + total_num + '</span> 家 平均涨跌: ' + Util.parse_ratio(average_change_percent) + "<span id='" + week_tips_id + "'></span> 年初至今: " + Util.parse_ratio(average_year_change_percent));
|
1947
|
+
let code_price_dict = {};
|
1948
|
+
valid_code_list.forEach(function (code) {
|
1949
|
+
code_price_dict[code] = j[code]["price"];
|
1950
|
+
});
|
1951
|
+
Util.post("/action", {action: "code_5d_price", code_list: code_list.join("-")}, function (j) {
|
1952
|
+
let total_num = 0;
|
1953
|
+
let total_week_change_percent = 0;
|
1954
|
+
$.each(j, function (code, price_5d) {
|
1955
|
+
if (price_5d > 0 && code_price_dict[code]) {
|
1956
|
+
total_num += 1;
|
1957
|
+
total_week_change_percent += ((code_price_dict[code] - price_5d) / price_5d);
|
1958
|
+
}
|
1959
|
+
});
|
1960
|
+
if (total_num > 0) {
|
1961
|
+
let average_week_change_percent = Math.round((total_week_change_percent / total_num) * 10000) / 100;
|
1962
|
+
$("#" + week_tips_id).html(" 最近5日: " + Util.parse_ratio(average_week_change_percent));
|
1963
|
+
}
|
1964
|
+
});
|
1965
|
+
}
|
1966
|
+
}
|
1930
1967
|
Util.hide_tips();
|
1931
1968
|
});
|
1932
1969
|
}
|