sbd-npm 1.4.97 → 1.4.99
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 +30 -25
- package/stock_basics.js +105 -105
- package/summary_daily.js +12 -12
- package/util.js +74 -76
package/package.json
CHANGED
package/status.js
CHANGED
|
@@ -69,7 +69,7 @@ $(function () {
|
|
|
69
69
|
Status.handle_site_map();
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
|
-
Status
|
|
72
|
+
Status.data[active_div] = 1;
|
|
73
73
|
},
|
|
74
74
|
|
|
75
75
|
handle_status: function () {
|
|
@@ -777,12 +777,12 @@ $(function () {
|
|
|
777
777
|
$("#machine_refresh").click(function() {
|
|
778
778
|
if (confirm("是否确定要“ 刷新Machine ” ?")) {
|
|
779
779
|
Util.show_loading();
|
|
780
|
-
$("#machine_refresh").
|
|
780
|
+
$("#machine_refresh").prop("disabled", true).html("正在处理中...");
|
|
781
781
|
Util.post(location.pathname, {active_div: "machine_refresh"}, function (j) {
|
|
782
782
|
setTimeout(() => {
|
|
783
783
|
$('#machine_process_div').html('');
|
|
784
784
|
$('#machines').html('<option value="">暂无Machine</option>');
|
|
785
|
-
$("#machine_refresh").html("刷新Machine").
|
|
785
|
+
$("#machine_refresh").html("刷新Machine").prop("disabled", false);
|
|
786
786
|
Util.hide_tips();
|
|
787
787
|
Util.show_tips("刷新成功", 3456, "alert-success");
|
|
788
788
|
}, 2345);
|
|
@@ -1077,7 +1077,7 @@ $(function () {
|
|
|
1077
1077
|
|
|
1078
1078
|
init_machine_instruction_modal: function () {
|
|
1079
1079
|
Util.init_modal_skeleton("machine_instruction_modal");
|
|
1080
|
-
$("#machine_instruction_modal_title").html("
|
|
1080
|
+
$("#machine_instruction_modal_title").html("添加任务<span style='color: #BDBDBD;' id='machine_instruction_modal_title_tips'></span>");
|
|
1081
1081
|
let html = [];
|
|
1082
1082
|
html.push('<form data-parsley-validate class="form-horizontal form-label-left">');
|
|
1083
1083
|
html.push('<div class="form-group" id="action_machine_div">');
|
|
@@ -1115,12 +1115,12 @@ $(function () {
|
|
|
1115
1115
|
} else {
|
|
1116
1116
|
$("#action_machine_div").css("display", "block");
|
|
1117
1117
|
}
|
|
1118
|
-
|
|
1118
|
+
let machine_id = $("#machines").val();
|
|
1119
|
+
Util.post(location.pathname, {active_div: "machine_instruction", action_type: action_type, "machine_id": machine_id}, function (j) {
|
|
1119
1120
|
if (j.machines) {
|
|
1120
1121
|
Status.pack_machine_component("machine_instruction_machine", j.machines);
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
$("#machine_instruction_machine").val(machine);
|
|
1122
|
+
if (machine_id) {
|
|
1123
|
+
$("#machine_instruction_machine").val(machine_id);
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
1126
|
if (j.instructions) {
|
|
@@ -1130,11 +1130,14 @@ $(function () {
|
|
|
1130
1130
|
});
|
|
1131
1131
|
$("#machine_instruction_content").html(instruction_html.join(""));
|
|
1132
1132
|
}
|
|
1133
|
+
let handle_instruction = j.instruction ? (" (" + j.instruction + ")") : "";
|
|
1134
|
+
$("#machine_instruction_modal_title_tips").html(handle_instruction);
|
|
1133
1135
|
Util.hide_tips();
|
|
1134
1136
|
});
|
|
1135
1137
|
});
|
|
1136
1138
|
cam_obj.on('hidden.bs.modal', function () {
|
|
1137
1139
|
$("#machine_instruction_tips").html("");
|
|
1140
|
+
$("#machine_instruction_add").prop("disabled", false);
|
|
1138
1141
|
Util.hide_tips();
|
|
1139
1142
|
});
|
|
1140
1143
|
$("#machine_instruction_add").click(function() {
|
|
@@ -1148,11 +1151,12 @@ $(function () {
|
|
|
1148
1151
|
if (instruction) {
|
|
1149
1152
|
Util.show_loading();
|
|
1150
1153
|
$("#machine_instruction_tips").html("");
|
|
1151
|
-
$("#machine_instruction_add").
|
|
1154
|
+
$("#machine_instruction_add").prop("disabled", true);
|
|
1152
1155
|
Util.post(location.pathname, {active_div: "machine_instruction_add", "machine_id": machine_id, "instruction": instruction, action_type: action_type}, function (j) {
|
|
1153
|
-
$("#machine_instruction_add").
|
|
1156
|
+
$("#machine_instruction_add").prop("disabled", false);
|
|
1154
1157
|
if (j.code === 1) {
|
|
1155
1158
|
$("#machine_instruction_tips").html("<b class='text-success'>任务`" + instruction + "`添加成功!</b>");
|
|
1159
|
+
$("#machine_instruction_modal_title_tips").html(" (" + instruction + ")");
|
|
1156
1160
|
} else if (j.code === 2) {
|
|
1157
1161
|
$("#machine_instruction_tips").html("<b class='text-danger'>Machine 不存在!</b>");
|
|
1158
1162
|
} else if (j.code === 3) {
|
|
@@ -1207,9 +1211,9 @@ $(function () {
|
|
|
1207
1211
|
Util.post(location.pathname, {active_div: "machine_instruction", action_type: 2}, function (j) {
|
|
1208
1212
|
if (j.machines) {
|
|
1209
1213
|
Status.pack_machine_component("machine_cookie_machine", j.machines);
|
|
1210
|
-
let
|
|
1211
|
-
if (
|
|
1212
|
-
$("#machine_cookie_machine").val(
|
|
1214
|
+
let machine_id = $("#machines").val();
|
|
1215
|
+
if (machine_id) {
|
|
1216
|
+
$("#machine_cookie_machine").val(machine_id);
|
|
1213
1217
|
}
|
|
1214
1218
|
}
|
|
1215
1219
|
Util.hide_tips();
|
|
@@ -1218,6 +1222,7 @@ $(function () {
|
|
|
1218
1222
|
ccm_obj.on('hidden.bs.modal', function () {
|
|
1219
1223
|
$("#machine_cookie_content").val("");
|
|
1220
1224
|
$("#machine_cookie_tips").html("");
|
|
1225
|
+
$("#machine_cookie_add").prop("disabled", false);
|
|
1221
1226
|
Util.hide_tips();
|
|
1222
1227
|
});
|
|
1223
1228
|
$("#machine_cookie_add").click(function() {
|
|
@@ -1227,9 +1232,9 @@ $(function () {
|
|
|
1227
1232
|
if (machine_cookie) {
|
|
1228
1233
|
Util.show_loading();
|
|
1229
1234
|
$("#machine_cookie_tips").html("");
|
|
1230
|
-
$("#machine_cookie_add").
|
|
1235
|
+
$("#machine_cookie_add").prop("disabled", true);
|
|
1231
1236
|
Util.post(location.pathname, {active_div: "machine_cookie_add", "machine_id": machine_id, "cookie": machine_cookie}, function (j) {
|
|
1232
|
-
$("#machine_cookie_add").
|
|
1237
|
+
$("#machine_cookie_add").prop("disabled", false);
|
|
1233
1238
|
if (j.code === 1) {
|
|
1234
1239
|
$("#machine_cookie_tips").html("<b class='text-success'>Cookie添加成功!</b>");
|
|
1235
1240
|
} else if (j.code === 2) {
|
|
@@ -1374,10 +1379,10 @@ $(function () {
|
|
|
1374
1379
|
Util.show_loading();
|
|
1375
1380
|
ip = match_ip_data[0];
|
|
1376
1381
|
$("#ip").prop('disabled', true);
|
|
1377
|
-
$("#ip_query").
|
|
1382
|
+
$("#ip_query").prop("disabled", true);
|
|
1378
1383
|
Util.post("/action", {action: "ip_query", ip: ip}, function (j) {
|
|
1379
1384
|
$("#ip").prop('disabled', false);
|
|
1380
|
-
$("#ip_query").
|
|
1385
|
+
$("#ip_query").prop("disabled", false);
|
|
1381
1386
|
if (j.ip) {
|
|
1382
1387
|
if (j.domain) {
|
|
1383
1388
|
let domain = $("#ip").val().trim();
|
|
@@ -1418,10 +1423,10 @@ $(function () {
|
|
|
1418
1423
|
if (md5) {
|
|
1419
1424
|
Util.show_loading();
|
|
1420
1425
|
$("#md5").prop('disabled', true);
|
|
1421
|
-
$("#md5_encrypt").
|
|
1426
|
+
$("#md5_encrypt").prop("disabled", true);
|
|
1422
1427
|
Util.post("/action", {action: "md5", md5: md5}, function (md5_result) {
|
|
1423
1428
|
$("#md5").prop('disabled', false);
|
|
1424
|
-
$("#md5_encrypt").
|
|
1429
|
+
$("#md5_encrypt").prop("disabled", false);
|
|
1425
1430
|
$("#md5_result").html("<b class='text-success'>" + md5_result + "</b>");
|
|
1426
1431
|
Util.hide_tips();
|
|
1427
1432
|
}, "text");
|
|
@@ -1541,10 +1546,10 @@ $(function () {
|
|
|
1541
1546
|
if (phone && Util.is_phone(phone)) {
|
|
1542
1547
|
Util.show_loading();
|
|
1543
1548
|
$("#phone").prop('disabled', true);
|
|
1544
|
-
$("#phone_query").
|
|
1549
|
+
$("#phone_query").prop("disabled", true);
|
|
1545
1550
|
Util.post("/action", {action: "phone_query", phone: phone}, function (j) {
|
|
1546
1551
|
$("#phone").prop('disabled', false);
|
|
1547
|
-
$("#phone_query").
|
|
1552
|
+
$("#phone_query").prop("disabled", false);
|
|
1548
1553
|
if (j.belong) {
|
|
1549
1554
|
let phone_url = Util.pack_html_link("https://www.ip138.com/mobile.asp?mobile=" + phone + "&action=mobile", "<i class='glyphicon glyphicon-link'></i> ");
|
|
1550
1555
|
$("#phone_result").html(Status.convert_phone(j) + " " + phone_url);
|
|
@@ -1692,10 +1697,10 @@ $(function () {
|
|
|
1692
1697
|
});
|
|
1693
1698
|
|
|
1694
1699
|
let request_arguments = Util.request_arguments();
|
|
1695
|
-
if (request_arguments
|
|
1696
|
-
localStorage[Status.tab_token] = request_arguments
|
|
1697
|
-
if (request_arguments
|
|
1698
|
-
$("#phone").val(request_arguments
|
|
1700
|
+
if (request_arguments.tab) {
|
|
1701
|
+
localStorage[Status.tab_token] = request_arguments.tab;
|
|
1702
|
+
if (request_arguments.tab === "tool" && request_arguments.phone) {
|
|
1703
|
+
$("#phone").val(request_arguments.phone);
|
|
1699
1704
|
setTimeout(() => {
|
|
1700
1705
|
Status.phone_query();
|
|
1701
1706
|
}, 1234);
|
package/stock_basics.js
CHANGED
|
@@ -135,7 +135,7 @@ let Stock = {
|
|
|
135
135
|
Stock.fetch_hist_data();
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
|
-
Stock
|
|
138
|
+
Stock.data[active_div] = 1;
|
|
139
139
|
},
|
|
140
140
|
|
|
141
141
|
fetch_base: function () {
|
|
@@ -182,15 +182,15 @@ let Stock = {
|
|
|
182
182
|
high_52week.html(Util.digit_compare_trend(high_52week.text(), item.price));
|
|
183
183
|
let low_52week = $("#low_52week");
|
|
184
184
|
low_52week.html(Util.digit_compare_trend(low_52week.text(), item.price));
|
|
185
|
-
if (item
|
|
185
|
+
if (item.high_history.close) {
|
|
186
186
|
let high_history = $("#high_history");
|
|
187
|
-
high_history.html(Util.digit_compare_trend(item
|
|
188
|
-
high_history.attr("title", Util.seconds_to_format(item
|
|
187
|
+
high_history.html(Util.digit_compare_trend(item.high_history.close, item.price));
|
|
188
|
+
high_history.attr("title", Util.seconds_to_format(item.high_history.date, "%Y-%m-%d"))
|
|
189
189
|
}
|
|
190
|
-
if (item
|
|
190
|
+
if (item.low_history.close) {
|
|
191
191
|
let low_history = $("#low_history");
|
|
192
|
-
low_history.html(Util.digit_compare_trend(item
|
|
193
|
-
low_history.attr("title", Util.seconds_to_format(item
|
|
192
|
+
low_history.html(Util.digit_compare_trend(item.low_history.close, item.price));
|
|
193
|
+
low_history.attr("title", Util.seconds_to_format(item.low_history.date, "%Y-%m-%d"))
|
|
194
194
|
}
|
|
195
195
|
// 备注
|
|
196
196
|
let remark_html = [];
|
|
@@ -203,15 +203,15 @@ let Stock = {
|
|
|
203
203
|
if (item.is_macd_cross) {
|
|
204
204
|
remark_html.push("<a class='btn btn-xs btn-danger' href='" + Util.get_url("trend_macd_cross") + "'>MACD金叉</a>");
|
|
205
205
|
}
|
|
206
|
-
if (item
|
|
206
|
+
if (item.is_margin_minimum) {
|
|
207
207
|
remark_html.push("<a class='btn btn-xs btn-danger' href='" + Util.get_url("rank_margin_minimum") + "'>融资余额创新低</a>");
|
|
208
208
|
}
|
|
209
|
-
if (item
|
|
210
|
-
let xsg_date = Util.seconds_to_format(item
|
|
209
|
+
if (item.xsg_date > 0) {
|
|
210
|
+
let xsg_date = Util.seconds_to_format(item.xsg_date, "%Y-%m-%d");
|
|
211
211
|
remark_html.push("<b class='text-success'>最近解禁<a href='" + Util.get_url("holder_restricted") + "?tab=xsg_list&date=" + xsg_date + "'>" + xsg_date + "</a></b>, ");
|
|
212
212
|
}
|
|
213
|
-
if (item.price > 0 && item.price < item
|
|
214
|
-
remark_html.push("<b class='text-danger'>当前价小于最近<a href='" + Util.get_url("daily_block") + "?code=" + item.code + "&start_date=" + Util.seconds_to_format(Stock.ttm_second, "%Y-%m-%d") + "'>大宗交易价(" + item
|
|
213
|
+
if (item.price > 0 && item.price < item.block_trade_price) {
|
|
214
|
+
remark_html.push("<b class='text-danger'>当前价小于最近<a href='" + Util.get_url("daily_block") + "?code=" + item.code + "&start_date=" + Util.seconds_to_format(Stock.ttm_second, "%Y-%m-%d") + "'>大宗交易价(" + item.block_trade_price + ")</a></b>, ");
|
|
215
215
|
}
|
|
216
216
|
if (remark_html.length > 0) {
|
|
217
217
|
remark_html.push("<br>");
|
|
@@ -227,20 +227,20 @@ let Stock = {
|
|
|
227
227
|
}
|
|
228
228
|
remark_html += " <b>行业板块:</b> ";
|
|
229
229
|
item.industry_data.forEach(function (i_d) {
|
|
230
|
-
let url = Util.get_url("summary_industry") + "?code=" + i_d
|
|
231
|
-
remark_html += " <a href='" + url + "' class='btn btn-xs btn-warning'>" + i_d
|
|
230
|
+
let url = Util.get_url("summary_industry") + "?code=" + i_d.code + "&industry_type=" + i_d.industry_type;
|
|
231
|
+
remark_html += " <a href='" + url + "' class='btn btn-xs btn-warning'>" + i_d.name + "</a>";
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
if (item.is_sh50) {
|
|
235
235
|
remark_html += " <a href='" + (Util.get_url("summary_index") + "?index_code=SH000016") + "' class='btn btn-xs btn-warning'>上证50</a>";
|
|
236
236
|
}
|
|
237
|
-
if (item
|
|
237
|
+
if (item.is_star50) {
|
|
238
238
|
remark_html += " <a href='" + (Util.get_url("summary_index") + "?index_code=SH000688") + "' class='btn btn-xs btn-warning'>科创50</a>";
|
|
239
239
|
}
|
|
240
|
-
if (item
|
|
240
|
+
if (item.is_gem50) {
|
|
241
241
|
remark_html += " <a href='" + (Util.get_url("summary_index") + "?index_code=SZ399673") + "' class='btn btn-xs btn-warning'>创业板50</a>";
|
|
242
242
|
}
|
|
243
|
-
if (item
|
|
243
|
+
if (item.is_hs300) {
|
|
244
244
|
remark_html += " <a href='" + (Util.get_url("summary_index") + "?index_code=SH000300") + "' class='btn btn-xs btn-warning'>沪深300</a>";
|
|
245
245
|
}
|
|
246
246
|
if (item.etf_data) {
|
|
@@ -362,8 +362,8 @@ let Stock = {
|
|
|
362
362
|
if (j.high_amount && j.high_amount > 0) {
|
|
363
363
|
stock_hist_summary += "<b>历史最高成交额(<a class='hist_summary_link' href='#'>" + Util.seconds_to_format(j.high_amount_date, "%Y-%m-%d") + "</a>):<span class='label label-danger'>" + Util.to_unit(j.high_amount) + "</span></b>,";
|
|
364
364
|
}
|
|
365
|
-
if (j
|
|
366
|
-
stock_hist_summary += "<b>历史最高成交量(<a class='hist_summary_link' href='#'>" + Util.seconds_to_format(j
|
|
365
|
+
if (j.high_volume && j.high_volume > 0) {
|
|
366
|
+
stock_hist_summary += "<b>历史最高成交量(<a class='hist_summary_link' href='#'>" + Util.seconds_to_format(j.high_volume_date, "%Y-%m-%d") + "</a>):<span class='label label-danger'>" + Util.to_unit(j.high_volume) + "手</span></b>,";
|
|
367
367
|
}
|
|
368
368
|
stock_hist_summary += "<b>时间区间内总成交额: <span class='label label-info'>" + Util.to_unit(total_amount) + "</span>,总成交量: <span class='label label-info'>" + Util.to_unit(total_volume) + "</span> 股,平均成交价: <span class='label label-warning'>" + Util.to_float(total_amount / total_volume, 2) + "</span></b>";
|
|
369
369
|
$("#stock_hist_summary").html(stock_hist_summary);
|
|
@@ -382,7 +382,7 @@ let Stock = {
|
|
|
382
382
|
},
|
|
383
383
|
|
|
384
384
|
fetch_big_deal: function () {
|
|
385
|
-
if (
|
|
385
|
+
if (!document.getElementById("big_deal_table_body")) {
|
|
386
386
|
Util.show_loading();
|
|
387
387
|
let money_inflow_url = Util.get_url("trend_money_inflow");
|
|
388
388
|
Util.init_table_skeleton({
|
|
@@ -415,10 +415,10 @@ let Stock = {
|
|
|
415
415
|
let date = j.data["date"];
|
|
416
416
|
//Stock.pack_big_deal("big_deal1", j.data, "最近一天", date, date);
|
|
417
417
|
}
|
|
418
|
-
if (j
|
|
418
|
+
if (j.money_net_inflow) {
|
|
419
419
|
let html = [], i = 0, total_net_inflow = 0;
|
|
420
420
|
let day3_net_inflow = 0, day5_net_inflow = 0, day10_net_inflow = 0, day20_net_inflow = 0, day60_net_inflow = 0;
|
|
421
|
-
j
|
|
421
|
+
j.money_net_inflow.forEach(function (item) {
|
|
422
422
|
i++;
|
|
423
423
|
total_net_inflow += item.main_net_inflow;
|
|
424
424
|
if (i <= 3) {
|
|
@@ -440,10 +440,10 @@ let Stock = {
|
|
|
440
440
|
html.push("<td>", Util.seconds_to_format(item.date, "%Y-%m-%d"), "</td>");
|
|
441
441
|
html.push("<td><b class='", Util.text_color(item.price_change), "'>", item.price, "(", item.price_change, "%)</b></td>");
|
|
442
442
|
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>");
|
|
443
|
-
html.push("<td data-val='", item
|
|
444
|
-
html.push("<td data-val='", item
|
|
445
|
-
html.push("<td data-val='", item
|
|
446
|
-
html.push("<td data-val='", item
|
|
443
|
+
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>");
|
|
444
|
+
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>");
|
|
445
|
+
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>");
|
|
446
|
+
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>");
|
|
447
447
|
html.push("<td class='volume-td'>", Util.to_float(item.volume / 10000, 2), "万手</td>");
|
|
448
448
|
html.push("<td class='amount-td'>", Util.to_hundred_million(item.amount), "亿</td>");
|
|
449
449
|
html.push("</tr>");
|
|
@@ -541,7 +541,7 @@ let Stock = {
|
|
|
541
541
|
circulation_html.push("</tr>");
|
|
542
542
|
}
|
|
543
543
|
});
|
|
544
|
-
j
|
|
544
|
+
j.pre_data.forEach(function (item) {
|
|
545
545
|
if (parseInt(item.type) === 1) {
|
|
546
546
|
pre_main_volume += item.volume;
|
|
547
547
|
} else {
|
|
@@ -555,8 +555,8 @@ let Stock = {
|
|
|
555
555
|
circulation_tips += ", 上一季度是: <span class='label label-info'>" + Util.to_unit(pre_circulation_volume, 3) + "</span>,";
|
|
556
556
|
circulation_tips += " 持股数环比: " + Util.year_price_rate(circulation_volume, pre_circulation_volume, 1);
|
|
557
557
|
}
|
|
558
|
-
if (j
|
|
559
|
-
circulation_tips += ", 当时价: " + Util.digit_compare_trend1(Stock.price, j
|
|
558
|
+
if (j.date_price) {
|
|
559
|
+
circulation_tips += ", 当时价: " + Util.digit_compare_trend1(Stock.price, j.date_price);
|
|
560
560
|
}
|
|
561
561
|
circulation_tips += " ]";
|
|
562
562
|
}
|
|
@@ -652,18 +652,18 @@ let Stock = {
|
|
|
652
652
|
Util.post("/stock/" + Stock.code, {action: "finance"}, function (j) {
|
|
653
653
|
// 现金流量表
|
|
654
654
|
let html = [], total_ncf_from_oa = 0, total_cash_paid_for_assets = 0, total_free_cash_flow = 0, total_ncf_from_fa = 0;
|
|
655
|
-
j
|
|
656
|
-
total_ncf_from_oa += item
|
|
657
|
-
total_cash_paid_for_assets += item
|
|
658
|
-
let free_cash_flow = item
|
|
655
|
+
j.cash_flow_data.forEach(function (item) {
|
|
656
|
+
total_ncf_from_oa += item.ncf_from_oa;
|
|
657
|
+
total_cash_paid_for_assets += item.cash_paid_for_assets;
|
|
658
|
+
let free_cash_flow = item.ncf_from_oa - item.cash_paid_for_assets;
|
|
659
659
|
total_free_cash_flow += free_cash_flow;
|
|
660
|
-
total_ncf_from_fa += item
|
|
660
|
+
total_ncf_from_fa += item.ncf_from_fa;
|
|
661
661
|
html.push("<tr>");
|
|
662
662
|
html.push("<td>", Util.seconds_to_format(item.date, "%Y"), "</td>");
|
|
663
|
-
html.push("<td>", Util.to_unit(item
|
|
664
|
-
html.push("<td>", Util.to_unit(item
|
|
663
|
+
html.push("<td>", Util.to_unit(item.ncf_from_oa), "</td>");
|
|
664
|
+
html.push("<td>", Util.to_unit(item.cash_paid_for_assets), "</td>");
|
|
665
665
|
html.push("<td>", Util.to_unit(free_cash_flow), "</td>");
|
|
666
|
-
html.push("<td>", Util.to_unit(item
|
|
666
|
+
html.push("<td>", Util.to_unit(item.ncf_from_fa), "</td>");
|
|
667
667
|
html.push("</tr>");
|
|
668
668
|
});
|
|
669
669
|
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>");
|
|
@@ -674,7 +674,7 @@ let Stock = {
|
|
|
674
674
|
Util.render_table_html("cash_flow_table_body", html);
|
|
675
675
|
// 资产负债表
|
|
676
676
|
html = [];
|
|
677
|
-
j
|
|
677
|
+
j.assets_liabilities_data.forEach(function (item) {
|
|
678
678
|
let net_assets = item.total_assets - item.total_liabilities;
|
|
679
679
|
let goodwill = "--";
|
|
680
680
|
let goodwill_rate = "--";
|
|
@@ -683,8 +683,8 @@ let Stock = {
|
|
|
683
683
|
goodwill_rate = Util.to_float((item.goodwill / net_assets) * 100, 2) + "%";
|
|
684
684
|
}
|
|
685
685
|
let debt_asset_ratio = "--";
|
|
686
|
-
if (item
|
|
687
|
-
debt_asset_ratio = Util.to_float(item
|
|
686
|
+
if (item.debt_asset_ratio > 0) {
|
|
687
|
+
debt_asset_ratio = Util.to_float(item.debt_asset_ratio, 2) + "%";
|
|
688
688
|
}
|
|
689
689
|
html.push("<tr>");
|
|
690
690
|
html.push("<td>", item.year, "(", item.quarter, ")</td>");
|
|
@@ -692,12 +692,12 @@ let Stock = {
|
|
|
692
692
|
html.push("<td>", Util.to_unit(item.total_liabilities), "</td>");
|
|
693
693
|
html.push("<td>", Util.to_unit(net_assets), "</td>");
|
|
694
694
|
html.push("<td>", debt_asset_ratio, "</td>");
|
|
695
|
-
html.push("<td>", Util.to_unit(item
|
|
696
|
-
html.push("<td>", Util.to_unit(item
|
|
697
|
-
html.push("<td>", Util.to_unit(item
|
|
695
|
+
html.push("<td>", Util.to_unit(item.currency_funds), "</td>");
|
|
696
|
+
html.push("<td>", Util.to_unit(item.short_term_loan), "</td>");
|
|
697
|
+
html.push("<td>", Util.to_unit(item.noncurrent_liab_due_in1y), "</td>");
|
|
698
698
|
let flr = "--";
|
|
699
|
-
if (item
|
|
700
|
-
flr = Util.to_float(item
|
|
699
|
+
if (item.short_term_loan > 0 && item.noncurrent_liab_due_in1y > 0) {
|
|
700
|
+
flr = Util.to_float(item.currency_funds / (item.short_term_loan + item.noncurrent_liab_due_in1y), 2);
|
|
701
701
|
flr = flr >= 1 ? flr : ("<b class='text-danger'>" + flr + "</br>");
|
|
702
702
|
}
|
|
703
703
|
html.push("<td>", flr, "</td>");
|
|
@@ -706,7 +706,7 @@ let Stock = {
|
|
|
706
706
|
html.push("</tr>");
|
|
707
707
|
});
|
|
708
708
|
Util.render_table_html("assets_liabilities_table_body", html);
|
|
709
|
-
Stock.income_statement_data = j
|
|
709
|
+
Stock.income_statement_data = j.income_statement_data ? j.income_statement_data : [];
|
|
710
710
|
Stock.render_income_statement_data();
|
|
711
711
|
$("#quarter").change(function () {
|
|
712
712
|
Stock.render_income_statement_data();
|
|
@@ -734,48 +734,48 @@ let Stock = {
|
|
|
734
734
|
let total_revenue = Util.to_unit(item.total_revenue, 3);
|
|
735
735
|
html.push("<td>", total_revenue, "</td>");
|
|
736
736
|
let total_revenue_yoy_title = "", total_revenue_yoy_ratio = "--";
|
|
737
|
-
if (item
|
|
738
|
-
total_revenue_yoy_title = " title='" + Util.to_unit(item
|
|
739
|
-
total_revenue_yoy_ratio = Util.to_float(((item.total_revenue - item
|
|
737
|
+
if (item.yoy_total_revenue) {
|
|
738
|
+
total_revenue_yoy_title = " title='" + Util.to_unit(item.yoy_total_revenue, 2, 0) + " - " + Util.strip_html(total_revenue) + "'";
|
|
739
|
+
total_revenue_yoy_ratio = Util.to_float(((item.total_revenue - item.yoy_total_revenue) / item.yoy_total_revenue) * 100, 2);
|
|
740
740
|
total_revenue_yoy_ratio = Util.parse_ratio(total_revenue_yoy_ratio);
|
|
741
741
|
}
|
|
742
742
|
html.push("<td", total_revenue_yoy_title, ">", total_revenue_yoy_ratio, "</td>");
|
|
743
743
|
let total_revenue_qoq_title = "", total_revenue_qoq_ratio = "--";
|
|
744
|
-
if (item
|
|
745
|
-
total_revenue_qoq_title = " title='" + Util.to_unit(item
|
|
746
|
-
total_revenue_qoq_ratio = Util.to_float(((item
|
|
744
|
+
if (item.qoq_total_revenue) {
|
|
745
|
+
total_revenue_qoq_title = " title='" + Util.to_unit(item.qoq_total_revenue, 2, 0) + " - " + Util.to_unit(item.total_revenue_add, 2, 0) + "'";
|
|
746
|
+
total_revenue_qoq_ratio = Util.to_float(((item.total_revenue_add - item.qoq_total_revenue) / item.qoq_total_revenue) * 100, 2);
|
|
747
747
|
total_revenue_qoq_ratio = Util.parse_ratio(total_revenue_qoq_ratio);
|
|
748
748
|
}
|
|
749
749
|
html.push("<td", total_revenue_qoq_title, ">", total_revenue_qoq_ratio, "</td>");
|
|
750
750
|
let net_profit = Util.to_unit(item.net_profit, 3);
|
|
751
751
|
html.push("<td>", net_profit, "</td>");
|
|
752
752
|
let net_profit_yoy_title = "", net_profit_yoy_ratio = "--";
|
|
753
|
-
if (item
|
|
754
|
-
net_profit_yoy_title = " title='" + Util.to_unit(item
|
|
755
|
-
net_profit_yoy_ratio = Util.to_float(((item.net_profit - item
|
|
753
|
+
if (item.yoy_net_profit) {
|
|
754
|
+
net_profit_yoy_title = " title='" + Util.to_unit(item.yoy_net_profit, 2, 0) + " - " + Util.strip_html(net_profit) + "'";
|
|
755
|
+
net_profit_yoy_ratio = Util.to_float(((item.net_profit - item.yoy_net_profit) / item.yoy_net_profit) * 100, 2);
|
|
756
756
|
net_profit_yoy_ratio = Util.parse_ratio(net_profit_yoy_ratio);
|
|
757
757
|
}
|
|
758
758
|
html.push("<td", net_profit_yoy_title, ">", net_profit_yoy_ratio, "</td>");
|
|
759
759
|
let net_profit_qoq_title = "", net_profit_qoq_ratio = "--";
|
|
760
|
-
if (item
|
|
761
|
-
net_profit_qoq_title = " title='" + Util.to_unit(item
|
|
762
|
-
net_profit_qoq_ratio = Util.to_float(((item
|
|
760
|
+
if (item.qoq_net_profit) {
|
|
761
|
+
net_profit_qoq_title = " title='" + Util.to_unit(item.qoq_net_profit, 2, 0) + " - " + Util.to_unit(item.net_profit_add, 2, 0) + "'";
|
|
762
|
+
net_profit_qoq_ratio = Util.to_float(((item.net_profit_add - item.qoq_net_profit) / item.qoq_net_profit) * 100, 2);
|
|
763
763
|
net_profit_qoq_ratio = Util.parse_ratio(net_profit_qoq_ratio);
|
|
764
764
|
}
|
|
765
765
|
html.push("<td", net_profit_qoq_title, ">", net_profit_qoq_ratio, "</td>");
|
|
766
766
|
let adjusted_net_profit = Util.to_unit(item.adjusted_net_profit, 3);
|
|
767
767
|
html.push("<td>", adjusted_net_profit, "</td>");
|
|
768
768
|
let adjusted_net_profit_yoy_title = "", adjusted_net_profit_yoy_ratio = "--";
|
|
769
|
-
if (item
|
|
770
|
-
adjusted_net_profit_yoy_title = " title='" + Util.to_unit(item
|
|
771
|
-
adjusted_net_profit_yoy_ratio = Util.to_float(((item.adjusted_net_profit - item
|
|
769
|
+
if (item.yoy_adjusted_net_profit) {
|
|
770
|
+
adjusted_net_profit_yoy_title = " title='" + Util.to_unit(item.yoy_adjusted_net_profit, 2, 0) + " - " + Util.strip_html(adjusted_net_profit) + "'";
|
|
771
|
+
adjusted_net_profit_yoy_ratio = Util.to_float(((item.adjusted_net_profit - item.yoy_adjusted_net_profit) / item.yoy_adjusted_net_profit) * 100, 2);
|
|
772
772
|
adjusted_net_profit_yoy_ratio = Util.parse_ratio(adjusted_net_profit_yoy_ratio);
|
|
773
773
|
}
|
|
774
774
|
html.push("<td", adjusted_net_profit_yoy_title, ">", adjusted_net_profit_yoy_ratio, "</td>");
|
|
775
775
|
let adjusted_net_profit_qoq_title = "", adjusted_net_profit_qoq_ratio = "--";
|
|
776
|
-
if (item
|
|
777
|
-
adjusted_net_profit_qoq_title = " title='" + Util.to_unit(item
|
|
778
|
-
adjusted_net_profit_qoq_ratio = Util.to_float(((item
|
|
776
|
+
if (item.qoq_adjusted_net_profit) {
|
|
777
|
+
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) + "'";
|
|
778
|
+
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);
|
|
779
779
|
adjusted_net_profit_qoq_ratio = Util.parse_ratio(adjusted_net_profit_qoq_ratio);
|
|
780
780
|
}
|
|
781
781
|
html.push("<td", adjusted_net_profit_qoq_title, ">", adjusted_net_profit_qoq_ratio, "</td>");
|
|
@@ -829,22 +829,22 @@ let Stock = {
|
|
|
829
829
|
if (j.latest_date > latest_date) {
|
|
830
830
|
latest_date = latest_date_format;
|
|
831
831
|
date_data.unshift(latest_date);
|
|
832
|
-
holder_data.unshift(j
|
|
833
|
-
price_data.unshift(j
|
|
832
|
+
holder_data.unshift(j.latest_holder_num);
|
|
833
|
+
price_data.unshift(j.latest_day_price);
|
|
834
834
|
} else {
|
|
835
835
|
latest_date = Util.seconds_to_format(latest_date, "%Y-%m-%d");
|
|
836
836
|
}
|
|
837
|
-
if (j
|
|
838
|
-
max_holder_num = j
|
|
837
|
+
if (j.latest_holder_num > max_holder_num) {
|
|
838
|
+
max_holder_num = j.latest_holder_num;
|
|
839
839
|
max_holder_num_date = latest_date_format;
|
|
840
840
|
}
|
|
841
|
-
if (j
|
|
842
|
-
min_holder_num = j
|
|
841
|
+
if (j.latest_holder_num < min_holder_num) {
|
|
842
|
+
min_holder_num = j.latest_holder_num;
|
|
843
843
|
min_holder_num_date = latest_date_format;
|
|
844
844
|
}
|
|
845
|
-
max_holder_num = Math.max(max_holder_num, j
|
|
846
|
-
min_holder_num = Math.min(min_holder_num, j
|
|
847
|
-
holder_num_summary += "最新(" + latest_date + "):" + Util.digit_compare_trend(j
|
|
845
|
+
max_holder_num = Math.max(max_holder_num, j.latest_holder_num);
|
|
846
|
+
min_holder_num = Math.min(min_holder_num, j.latest_holder_num);
|
|
847
|
+
holder_num_summary += "最新(" + latest_date + "):" + Util.digit_compare_trend(j.latest_holder_num, j.previous_holder_num);
|
|
848
848
|
}
|
|
849
849
|
if (max_holder_num > 0) {
|
|
850
850
|
holder_num_summary += " 历史最多(" + max_holder_num_date + "):<b class='text-success'>" + max_holder_num + "</b> 历史最少(" + min_holder_num_date + "):<b class='text-danger'>" + min_holder_num + "<b>";
|
|
@@ -1028,8 +1028,8 @@ let Stock = {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
|
-
if (j
|
|
1032
|
-
$("#" + metrics + "_tips").html("<b class='text-success'>(创连续" + j
|
|
1031
|
+
if (j.interval_week) {
|
|
1032
|
+
$("#" + metrics + "_tips").html("<b class='text-success'>(创连续" + j.interval_week + "周成交额最低)<b>");
|
|
1033
1033
|
}
|
|
1034
1034
|
Util.hide_tips();
|
|
1035
1035
|
});
|
|
@@ -1055,7 +1055,7 @@ let Stock = {
|
|
|
1055
1055
|
color_data.push("#C9CBCF");
|
|
1056
1056
|
});
|
|
1057
1057
|
Stock["bias_chart"] = Util.bias_bar_line(Stock["bias_chart"], "bias_line_chart", date_data, bias120_data, color_data, bias20_data, bias60_data, price_data);
|
|
1058
|
-
$("#bias_summary").html("当前120日乖离率:" + Util.label_text_color(current_bias120) + ", 60日乖离率:" + Util.label_text_color(current_bias60) + ", 20日乖离率:" + Util.label_text_color(current_bias20) + ",20日最高乖离率:" + Util.label_text_color(j
|
|
1058
|
+
$("#bias_summary").html("当前120日乖离率:" + Util.label_text_color(current_bias120) + ", 60日乖离率:" + Util.label_text_color(current_bias60) + ", 20日乖离率:" + Util.label_text_color(current_bias20) + ",20日最高乖离率:" + Util.label_text_color(j.max_bias20) + "(" + Util.seconds_to_format(j.max_bias20_date, "%Y-%m-%d") + "),20日最低乖离率:" + Util.label_text_color(j.min_bias20) + "(" + Util.seconds_to_format(j.min_bias20_date, "%Y-%m-%d") + ")");
|
|
1059
1059
|
Util.hide_tips();
|
|
1060
1060
|
});
|
|
1061
1061
|
},
|
|
@@ -1092,12 +1092,12 @@ let Stock = {
|
|
|
1092
1092
|
});
|
|
1093
1093
|
latest_date = Util.seconds_to_format(latest_date, "%Y-%m-%d");
|
|
1094
1094
|
$("#stock_margin_url").attr("href", Util.get_url("trend_margin") + "?start_date=" + latest_date + "&end_date=" + latest_date);
|
|
1095
|
-
if (j
|
|
1096
|
-
if (j
|
|
1097
|
-
margin_summary = " 最新融资余额(" + Util.seconds_to_format(j
|
|
1098
|
-
rqye_summary = " 最新融券余额(" + Util.seconds_to_format(j
|
|
1099
|
-
} else if (j
|
|
1100
|
-
let d1 = j
|
|
1095
|
+
if (j.latest.length > 0) {
|
|
1096
|
+
if (j.latest.length === 1) {
|
|
1097
|
+
margin_summary = " 最新融资余额(" + Util.seconds_to_format(j.latest[0]["date"], "%Y-%m-%d") + "): " + Util.to_unit(j.latest[0]["rzye"], 3);
|
|
1098
|
+
rqye_summary = " 最新融券余额(" + Util.seconds_to_format(j.latest[0]["date"], "%Y-%m-%d") + "): " + Util.to_unit(j.latest[0]["rqye"], 3);
|
|
1099
|
+
} else if (j.latest.length === 2) {
|
|
1100
|
+
let d1 = j.latest[0], d2 = j.latest[1], rzye_dist_tips = "", rqye_dist_tips = "";
|
|
1101
1101
|
let rzye_difference = d1["rzye"] - d2["rzye"];
|
|
1102
1102
|
if (rzye_difference > 0) {
|
|
1103
1103
|
rzye_dist_tips = "(<b title='" + Util.to_unit(d2["rzye"], 3, 0) + "' style='color: #a94442;'>+" + Util.to_unit(rzye_difference, 3, 0) + "</b>)";
|
|
@@ -1115,29 +1115,29 @@ let Stock = {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
1117
|
margin_summary += ' 当前最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(rzye_high, 3, 0) + '</span> 当前最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(rzye_low, 3, 0) + "</span>";
|
|
1118
|
-
if (j
|
|
1119
|
-
margin_summary += ' 历史最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(j
|
|
1118
|
+
if (j.rzye_high && j.rzye_high.date && j.rzye_high.date > 0) {
|
|
1119
|
+
margin_summary += ' 历史最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(j.rzye_high.rzye, 3, 0) + '</span>(' + Util.seconds_to_format(j.rzye_high.date, "%Y-%m-%d") + ')';
|
|
1120
1120
|
}
|
|
1121
|
-
if (j
|
|
1122
|
-
margin_summary += ' 历史最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(j
|
|
1121
|
+
if (j.rzye_low && j.rzye_low.date && j.rzye_low.date > 0) {
|
|
1122
|
+
margin_summary += ' 历史最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(j.rzye_low.rzye, 3, 0) + '</span>(' + Util.seconds_to_format(j.rzye_low.date, "%Y-%m-%d") + ')';
|
|
1123
1123
|
}
|
|
1124
|
-
if (j
|
|
1125
|
-
margin_summary += ' 当前最新融资余额超过历史 <span style="color: #FFF;" class="label label-info">' + j
|
|
1124
|
+
if (j.less_rate) {
|
|
1125
|
+
margin_summary += ' 当前最新融资余额超过历史 <span style="color: #FFF;" class="label label-info">' + j.less_rate + '%</span> 分位水平';
|
|
1126
1126
|
}
|
|
1127
1127
|
$("#margin_summary").html(margin_summary);
|
|
1128
1128
|
Stock["rzye_chart"] = Util.multi_axis_line(Stock["rzye_chart"], "rzye_line_canvas", date_data, '融资余额(单位:亿)', rzye_data, '股价', price_data);
|
|
1129
1129
|
rqye_summary += ' 当前最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(rqye_high, 3, 0) + '</span> 当前最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(rqye_low, 3, 0) + "</span>";
|
|
1130
|
-
if (j
|
|
1131
|
-
rqye_summary += ' 历史最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(j
|
|
1130
|
+
if (j.rqye_high && j.rqye_high.date && j.rqye_high.date > 0) {
|
|
1131
|
+
rqye_summary += ' 历史最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(j.rqye_high.rqye, 3, 0) + '</span>(' + Util.seconds_to_format(j.rqye_high.date, "%Y-%m-%d") + ')';
|
|
1132
1132
|
}
|
|
1133
|
-
if (j
|
|
1134
|
-
rqye_summary += ' 历史最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(j
|
|
1133
|
+
if (j.rqye_low && j.rqye_low.date && j.rqye_low.date > 0) {
|
|
1134
|
+
rqye_summary += ' 历史最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(j.rqye_low.rqye, 3, 0) + '</span>(' + Util.seconds_to_format(j.rqye_low.date, "%Y-%m-%d") + ')';
|
|
1135
1135
|
}
|
|
1136
1136
|
$("#rqye_summary").html(" [" + rqye_summary + " ]");
|
|
1137
1137
|
Stock["rqye_chart"] = Util.chart_bar_line(Stock["rqye_chart"], "rqye_line_canvas", date_data, rqye_data, '融券余额(单位:万)', rqye_color_data, price_data, '股价');
|
|
1138
1138
|
let flow_data = [], color_data = [];
|
|
1139
1139
|
date_data = [];
|
|
1140
|
-
j
|
|
1140
|
+
j.flow_data.forEach(function (item) {
|
|
1141
1141
|
if (item.value !== 0) {
|
|
1142
1142
|
date_data.push(item.date);
|
|
1143
1143
|
flow_data.push(Util.to_ten_thousand(item.value, 2));
|
|
@@ -1145,7 +1145,7 @@ let Stock = {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
});
|
|
1147
1147
|
Stock["margin_month_flow_chart"] = Util.chart_basic_bar(Stock["margin_month_flow_chart"], "margin_month_flow_bar_chart", date_data, flow_data, "增幅(单位:万)", color_data);
|
|
1148
|
-
if (
|
|
1148
|
+
if (!document.getElementById("margin_modal_body")) {
|
|
1149
1149
|
Stock.fetch_margin_modal();
|
|
1150
1150
|
}
|
|
1151
1151
|
Util.hide_tips();
|
|
@@ -1238,12 +1238,12 @@ let Stock = {
|
|
|
1238
1238
|
price_data.push(item.price);
|
|
1239
1239
|
});
|
|
1240
1240
|
let hkex_holding_summary = "[" + Util.pack_html_link(j.url + "&code=" + Stock.code + "&name=" + Stock["name"], Stock["name"]) + "]";
|
|
1241
|
-
if (j
|
|
1242
|
-
let latest_html = "最新(" + Util.seconds_to_format(j
|
|
1241
|
+
if (j.latest.length > 0) {
|
|
1242
|
+
let latest_html = "最新(" + Util.seconds_to_format(j.latest[0]["date"], "%Y-%m-%d") + "): <span style='color: #FFF;' class='label label-info'>" + Util.to_hundred_million(j.latest[0]["volume"], 4) + "</span>亿股";
|
|
1243
1243
|
let dist_tips = "";
|
|
1244
|
-
if (j
|
|
1245
|
-
let d1 = j
|
|
1246
|
-
let d2 = j
|
|
1244
|
+
if (j.latest.length === 2) {
|
|
1245
|
+
let d1 = j.latest[0];
|
|
1246
|
+
let d2 = j.latest[1];
|
|
1247
1247
|
let difference = d1["volume"] - d2["volume"];
|
|
1248
1248
|
if (difference > 0) {
|
|
1249
1249
|
dist_tips = "(<b title='" + Util.to_unit(d2["volume"], 2, 0) + "股' style='color: #a94442;'>+" + Util.to_unit(difference, 2, 0) + "股</b>)";
|
|
@@ -1251,21 +1251,21 @@ let Stock = {
|
|
|
1251
1251
|
dist_tips = "(<b title='" + Util.to_unit(d2["volume"], 2, 0) + "股' style='color: #3c763d;'>" + Util.to_unit(difference, 2, 0) + "股</b>)";
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
latest_html += dist_tips + ", 占 <span style='color: #FFF;' class='label label-info'>" + j
|
|
1255
|
-
hkex_holding_summary += (latest_html + ' 最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(j
|
|
1256
|
-
') 最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(j
|
|
1254
|
+
latest_html += dist_tips + ", 占 <span style='color: #FFF;' class='label label-info'>" + j.latest[0]["ratio"] + "%</span> 流通股, ";
|
|
1255
|
+
hkex_holding_summary += (latest_html + ' 最高: <span style="color: #FFF;" class="label label-danger">' + Util.to_unit(j.high.volume, 2, 0) + '股</span>(' + Util.seconds_to_format(j.high.date, "%Y-%m-%d") +
|
|
1256
|
+
') 最低: <span style="color: #FFF;" class="label label-success">' + Util.to_unit(j.low.volume, 2, 0) + '股</span>(' + Util.seconds_to_format(j.low.date, "%Y-%m-%d") + ')');
|
|
1257
1257
|
}
|
|
1258
1258
|
$("#hkex_holding_summary").html(hkex_holding_summary);
|
|
1259
1259
|
Stock["hkex_holding_chart"] = Util.multi_axis_line(Stock["hkex_holding_chart"], "hkex_holding_line_canvas", date_data, '持股数', volume_data, '股价', price_data);
|
|
1260
1260
|
let flow_data = [], color_data = [];
|
|
1261
1261
|
date_data = [];
|
|
1262
|
-
j
|
|
1262
|
+
j.flow_data.forEach(function (item) {
|
|
1263
1263
|
date_data.push(item.date);
|
|
1264
1264
|
flow_data.push(item.value);
|
|
1265
1265
|
color_data.push(item.value > 0 ? "#E74C3C" : "#1ABB9C");
|
|
1266
1266
|
});
|
|
1267
1267
|
Stock["hkex_holding_month_flow_chart"] = Util.chart_basic_bar(Stock["hkex_holding_month_flow_chart"], "hkex_holding_month_flow_chart", date_data, flow_data, "增幅", color_data);
|
|
1268
|
-
if (
|
|
1268
|
+
if (!document.getElementById("hkex_holding_modal_body")) {
|
|
1269
1269
|
Stock.fetch_hkex_holding_modal();
|
|
1270
1270
|
}
|
|
1271
1271
|
Util.hide_tips();
|
|
@@ -1343,7 +1343,7 @@ let Stock = {
|
|
|
1343
1343
|
Util.init_public_fund_component("public_fund_modal");
|
|
1344
1344
|
|
|
1345
1345
|
let request_arguments = Util.request_arguments();
|
|
1346
|
-
localStorage[Stock.tab_token] = request_arguments
|
|
1346
|
+
localStorage[Stock.tab_token] = request_arguments.tab ? request_arguments.tab : "base";
|
|
1347
1347
|
Util.tab_switch(Stock.tab_token, Stock.fetch_data);
|
|
1348
1348
|
Stock.fetch_data();
|
|
1349
1349
|
|
package/summary_daily.js
CHANGED
|
@@ -74,7 +74,7 @@ $(function () {
|
|
|
74
74
|
}
|
|
75
75
|
Util.show_loading();
|
|
76
76
|
Util.post(location.pathname, {date: $("#trade_date").val(), action: "market_overview", is_init: Util.is_init}, function (j) {
|
|
77
|
-
DailySummary.pack_market_overview(j
|
|
77
|
+
DailySummary.pack_market_overview(j.market_overview);
|
|
78
78
|
DailySummary.fetch_statistics_daily();
|
|
79
79
|
if (j.date && !Util.is_mobile()) {
|
|
80
80
|
DailySummary.init_date_component(j.date);
|
|
@@ -117,7 +117,7 @@ $(function () {
|
|
|
117
117
|
$("#index_summary_data").html(html.join(""));
|
|
118
118
|
change_color_data.forEach(function (item) {
|
|
119
119
|
let change_rate_obj = $("#change_rate_" + item.key);
|
|
120
|
-
change_rate_obj.css("background-color", item
|
|
120
|
+
change_rate_obj.css("background-color", item.new);
|
|
121
121
|
change_rate_obj.animate({backgroundColor: item.origin}, 2000);
|
|
122
122
|
});
|
|
123
123
|
},
|
|
@@ -361,14 +361,14 @@ $(function () {
|
|
|
361
361
|
news_type: $("#news_type").val()
|
|
362
362
|
};
|
|
363
363
|
Util.post(location.pathname, payload, function (j) {
|
|
364
|
-
DailySummary.pack_index_summary_data(j
|
|
364
|
+
DailySummary.pack_index_summary_data(j.index);
|
|
365
365
|
DailySummary.pack_change_percent(j.change_percent);
|
|
366
|
-
DailySummary.pack_big_deal(j
|
|
367
|
-
DailySummary.pack_hsgt_money_flow(j
|
|
368
|
-
DailySummary.pack_news_data(j
|
|
369
|
-
DailySummary.set_cache("index", j
|
|
366
|
+
DailySummary.pack_big_deal(j.big_deal, j.big_deal_date);
|
|
367
|
+
DailySummary.pack_hsgt_money_flow(j.hmf);
|
|
368
|
+
DailySummary.pack_news_data(j.news);
|
|
369
|
+
DailySummary.set_cache("index", j.index);
|
|
370
370
|
DailySummary.set_cache("change_percent", j.change_percent);
|
|
371
|
-
DailySummary.set_cache("news", j
|
|
371
|
+
DailySummary.set_cache("news", j.news);
|
|
372
372
|
Util.hide_tips();
|
|
373
373
|
if (DailySummary.is_trade_time === 1) {
|
|
374
374
|
setTimeout(DailySummary.fetch_statistics_daily, 9876);
|
|
@@ -678,7 +678,7 @@ $(function () {
|
|
|
678
678
|
let mam_obj = $('#index_hist_modal');
|
|
679
679
|
mam_obj.on('shown.bs.modal', function (e) {
|
|
680
680
|
Util.set_table_loading("index_hist_modal_body_body");
|
|
681
|
-
if (
|
|
681
|
+
if (!document.getElementById("index_hist_modal_start_date")) {
|
|
682
682
|
Util.init_date_range_picker("index_hist_modal_start_end_date", DailySummary, "render_index_hist_modal");
|
|
683
683
|
}
|
|
684
684
|
$("#index_hist_modal_query").click(function () {
|
|
@@ -770,9 +770,9 @@ $(function () {
|
|
|
770
770
|
let news_type = parseInt($("#news_type").val());
|
|
771
771
|
let payload = {action: "news", limit_num: DailySummary.limit_num(), news_type: news_type};
|
|
772
772
|
Util.post(location.pathname, payload, function (j) {
|
|
773
|
-
DailySummary.pack_news_data(j
|
|
774
|
-
if (news_type === 2 && j
|
|
775
|
-
$("#news_type").attr("title", Util.seconds_to_format(j
|
|
773
|
+
DailySummary.pack_news_data(j.news_data);
|
|
774
|
+
if (news_type === 2 && j.news_time) {
|
|
775
|
+
$("#news_type").attr("title", Util.seconds_to_format(j.news_time));
|
|
776
776
|
} else {
|
|
777
777
|
$("#news_type").removeAttr("title");
|
|
778
778
|
}
|
package/util.js
CHANGED
|
@@ -294,10 +294,10 @@ const Util = {
|
|
|
294
294
|
* jsonpCallback:设置 JSONP 回调函数的名称
|
|
295
295
|
* @param url
|
|
296
296
|
* @param payload
|
|
297
|
-
* @param
|
|
297
|
+
* @param callback_func 回调函数
|
|
298
298
|
* @param data_type json | text
|
|
299
299
|
*/
|
|
300
|
-
post: function (url, payload,
|
|
300
|
+
post: function (url, payload, callback_func, data_type = "json") {
|
|
301
301
|
Util.is_load = true;
|
|
302
302
|
$.ajax({
|
|
303
303
|
url: url,
|
|
@@ -311,7 +311,7 @@ const Util = {
|
|
|
311
311
|
dataType: data_type,
|
|
312
312
|
data: payload,
|
|
313
313
|
success: function(data) {
|
|
314
|
-
|
|
314
|
+
callback_func(data);
|
|
315
315
|
Util.is_init = 1;
|
|
316
316
|
Util.is_load = false;
|
|
317
317
|
},
|
|
@@ -663,9 +663,9 @@ const Util = {
|
|
|
663
663
|
*/
|
|
664
664
|
rand_stock: function (rand_btn_id, stock_type) {
|
|
665
665
|
$("#" + rand_btn_id).click(function () {
|
|
666
|
-
$(this).
|
|
666
|
+
$(this).prop("disabled", true);
|
|
667
667
|
Util.post("/action", {action: "rand_stock", stock_type: stock_type}, function (j) {
|
|
668
|
-
$("#" + rand_btn_id).
|
|
668
|
+
$("#" + rand_btn_id).prop("disabled", false);
|
|
669
669
|
if (j.code) {
|
|
670
670
|
window.open("/stock/" + j.code, "_blank");
|
|
671
671
|
}
|
|
@@ -1094,11 +1094,8 @@ const Util = {
|
|
|
1094
1094
|
let html = [];
|
|
1095
1095
|
html.push('<option value="0">板块</option>');
|
|
1096
1096
|
classify_data.forEach(function (d) {
|
|
1097
|
-
let num = "";
|
|
1098
|
-
|
|
1099
|
-
num = "(" + d["num"] + ")";
|
|
1100
|
-
}
|
|
1101
|
-
html.push('<option value="', d["name"], '">', d["name"], num, '</option>');
|
|
1097
|
+
let num = d.num > 0 ? ("(" + d.num + ")") : "";
|
|
1098
|
+
html.push('<option value="', d.name, '">', d.name, num, '</option>');
|
|
1102
1099
|
});
|
|
1103
1100
|
let classify_obj = $("#" + classify_id);
|
|
1104
1101
|
classify_obj.html(html.join(""));
|
|
@@ -1135,7 +1132,7 @@ const Util = {
|
|
|
1135
1132
|
*/
|
|
1136
1133
|
fetch_rps_data: function (code, zone_id) {
|
|
1137
1134
|
Util.show_loading();
|
|
1138
|
-
if (
|
|
1135
|
+
if (!document.getElementById("rps_table")) {
|
|
1139
1136
|
let rps_html = [];
|
|
1140
1137
|
rps_html.push('<div class="x_panel">');
|
|
1141
1138
|
rps_html.push('<div class="x_title">');
|
|
@@ -1214,7 +1211,7 @@ const Util = {
|
|
|
1214
1211
|
}
|
|
1215
1212
|
});
|
|
1216
1213
|
}
|
|
1217
|
-
if (
|
|
1214
|
+
if (!document.getElementById("public_fund_date")) {
|
|
1218
1215
|
let fund_len = j.data ? j.data.length : 0;
|
|
1219
1216
|
let payload = {
|
|
1220
1217
|
action: "public_fund_date",
|
|
@@ -1308,9 +1305,9 @@ const Util = {
|
|
|
1308
1305
|
});
|
|
1309
1306
|
Util.render_table_html("public_fund_table_body", html);
|
|
1310
1307
|
let public_fund_tips = "";
|
|
1311
|
-
if (j
|
|
1312
|
-
total_public_fund = Util.pack_html_link(Util.get_url("trend_fund_hold"), '<span class="label label-info">' + j
|
|
1313
|
-
public_fund_tips = '共 ' + total_public_fund + ' 家(' + Util.year_price_rate(j
|
|
1308
|
+
if (j.cur_fund_num) {
|
|
1309
|
+
total_public_fund = Util.pack_html_link(Util.get_url("trend_fund_hold"), '<span class="label label-info">' + j.cur_fund_num + '</span>');
|
|
1310
|
+
public_fund_tips = '共 ' + total_public_fund + ' 家(' + Util.year_price_rate(j.cur_fund_num, j.pre_fund_num, 1) + '), <span class="label label-info">' + Util.to_unit(j.cur_stock_num, 3) + '</span> 股(' + Util.year_price_rate(j.cur_stock_num, j.pre_stock_num, 1) + '),<span class="label label-info">' + Util.to_unit(j.hold_value, 3) + '</span>市值';
|
|
1314
1311
|
} else {
|
|
1315
1312
|
total_public_fund = Util.pack_html_link(Util.get_url("trend_fund_hold"), '<span class="label label-info">' + total_public_fund + '</span>');
|
|
1316
1313
|
public_fund_tips = '共 ' + total_public_fund + ' 家, <span class="label label-info">' + Util.to_unit(total_stock_num, 3) + '</span> 股,<span class="label label-info">' + Util.to_unit(total_market_capital, 3) + '</span>市值';
|
|
@@ -1343,7 +1340,7 @@ const Util = {
|
|
|
1343
1340
|
*/
|
|
1344
1341
|
fetch_public_fund_change: function (code) {
|
|
1345
1342
|
Util["pfc_stock_chart"] = Util.show_chart_loading(Util["pfc_stock_chart"], "pfc_stock_line_canvas");
|
|
1346
|
-
if (
|
|
1343
|
+
if (!document.getElementById("pfc_fund_table_body")) {
|
|
1347
1344
|
Util.init_table_skeleton({
|
|
1348
1345
|
"element_id": "pfc_fund_table",
|
|
1349
1346
|
"head_columns": [
|
|
@@ -1355,7 +1352,7 @@ const Util = {
|
|
|
1355
1352
|
{"name": "持仓市值", "table_sort": 1, "title": "当时股价 * 持股总数"},
|
|
1356
1353
|
]
|
|
1357
1354
|
});
|
|
1358
|
-
if (
|
|
1355
|
+
if (document.getElementById("is_fund10_num")) {
|
|
1359
1356
|
$("#is_fund10_num").click(function() {
|
|
1360
1357
|
Util.fetch_public_fund_change(code);
|
|
1361
1358
|
});
|
|
@@ -1364,7 +1361,7 @@ const Util = {
|
|
|
1364
1361
|
Util.post("/stock/" + code, {action: "public_fund_change"}, function (j) {
|
|
1365
1362
|
Util["pfc_stock_chart"].hideLoading();
|
|
1366
1363
|
let date_data = [], fund_num_data = [], stock_num_data = [], value_data = [], price_data = [], html = [], is_fund10_num = 0;
|
|
1367
|
-
if (
|
|
1364
|
+
if (document.getElementById("is_fund10_num")) {
|
|
1368
1365
|
is_fund10_num = $("#is_fund10_num").prop("checked") ? 1 : 0;
|
|
1369
1366
|
}
|
|
1370
1367
|
j.data.forEach(function (item) {
|
|
@@ -1477,12 +1474,12 @@ const Util = {
|
|
|
1477
1474
|
Util["portfolio_table_id"] = table_id;
|
|
1478
1475
|
Util.post(location.pathname, {active_div: portfolio}, function (j) {
|
|
1479
1476
|
Util["portfolio_data"] = j.data ? j.data : [];
|
|
1480
|
-
Util["portfolio_index"] = j
|
|
1477
|
+
Util["portfolio_index"] = j.index_list ? j.index_list : [];
|
|
1481
1478
|
Util.render_type_option($("#portfolio_industry"), j.data, "industry", Util.render_portfolio_html);
|
|
1482
1479
|
Util.render_type_option($("#portfolio_area"), j.data, "area", Util.render_portfolio_html);
|
|
1483
1480
|
Util.render_portfolio_html();
|
|
1484
|
-
if (j
|
|
1485
|
-
$("#portfolio_remark_title").html(Util.pack_html_link(j
|
|
1481
|
+
if (j.portfolio_url) {
|
|
1482
|
+
$("#portfolio_remark_title").html(Util.pack_html_link(j.portfolio_url, "备注<i class='glyphicon glyphicon-link'></i>"));
|
|
1486
1483
|
}
|
|
1487
1484
|
Util.hide_tips();
|
|
1488
1485
|
});
|
|
@@ -1491,7 +1488,7 @@ const Util = {
|
|
|
1491
1488
|
render_portfolio_html: function () {
|
|
1492
1489
|
if (Util["portfolio_table_id"]) {
|
|
1493
1490
|
let html = [], total_num = 0;
|
|
1494
|
-
let is_us =
|
|
1491
|
+
let is_us = document.getElementById("portfolio_remark_title") ? 0 : 1;
|
|
1495
1492
|
if (Util["portfolio_data"]) {
|
|
1496
1493
|
let industry = $("#portfolio_industry").val();
|
|
1497
1494
|
let area = $("#portfolio_area").val();
|
|
@@ -1550,8 +1547,8 @@ const Util = {
|
|
|
1550
1547
|
Util.fetch_public_fund_detail(localStorage["modal_public_fund_code"], component_id);
|
|
1551
1548
|
} else {
|
|
1552
1549
|
let request_arguments = Util.request_arguments();
|
|
1553
|
-
if (request_arguments
|
|
1554
|
-
Util.fetch_public_fund_detail(request_arguments
|
|
1550
|
+
if (request_arguments.fund_code) {
|
|
1551
|
+
Util.fetch_public_fund_detail(request_arguments.fund_code, component_id);
|
|
1555
1552
|
}
|
|
1556
1553
|
}
|
|
1557
1554
|
}
|
|
@@ -1579,29 +1576,29 @@ const Util = {
|
|
|
1579
1576
|
Util.post(Util.get_url("fund_public"), {action: "public_fund_detail", fund_code: fund_code}, function (j) {
|
|
1580
1577
|
let html = [];
|
|
1581
1578
|
if (j.fund_code) {
|
|
1582
|
-
$("#" + component_id + "_title").html(Util.pack_html_link("https://fundf10.eastmoney.com/jbgk_" + j.fund_code + ".html", j
|
|
1579
|
+
$("#" + component_id + "_title").html(Util.pack_html_link("https://fundf10.eastmoney.com/jbgk_" + j.fund_code + ".html", j.fund_name));
|
|
1583
1580
|
let net = "--";
|
|
1584
|
-
if (j
|
|
1585
|
-
net = j
|
|
1581
|
+
if (j.net > 0) {
|
|
1582
|
+
net = j.net;
|
|
1586
1583
|
let net_cls = Util.text_color(j.change_percent);
|
|
1587
1584
|
if (net_cls !== "") {
|
|
1588
1585
|
net = "<b class='" + net_cls + "'>" + net + "(" + Util.to_float(j.change_percent, 2) + "%)</b>";
|
|
1589
1586
|
}
|
|
1590
1587
|
}
|
|
1591
|
-
let assets = j
|
|
1592
|
-
let public_date = j
|
|
1593
|
-
let issue_date = j
|
|
1588
|
+
let assets = j.assets > 0 ? (j.assets + "亿") : "--";
|
|
1589
|
+
let public_date = j.public_date > 0 ? Util.seconds_to_format(j.public_date, "%Y-%m-%d") : "--";
|
|
1590
|
+
let issue_date = j.issue_date > 0 ? Util.seconds_to_format(j.issue_date, "%Y-%m-%d") : "--";
|
|
1594
1591
|
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
|
|
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
|
|
1592
|
+
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>");
|
|
1593
|
+
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>");
|
|
1597
1594
|
html.push("<tr><td colspan='3'>单位净值</td><td colspan='4'>", net, "</td><td colspan='3'>资产规模</td><td colspan='5'>", assets, "</td></tr>");
|
|
1598
1595
|
html.push("<tr><td colspan='3'>成立日期</td><td colspan='4'>", public_date, "</td><td colspan='3'>发行日期</td><td colspan='5'>", issue_date, "</td></tr>");
|
|
1599
1596
|
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>");
|
|
1600
|
-
html.push("<tr><td colspan='3'>基金托管人</td><td colspan='4'>", (j
|
|
1601
|
-
html.push("<tr><td colspan='3'>会计师事务所</td><td colspan='4'>", (j
|
|
1602
|
-
html.push("<tr><td colspan='3'>近一周</td><td colspan='4'>", Util.parse_ratio(j
|
|
1603
|
-
html.push("<tr><td colspan='3'>近一年</td><td colspan='4'>", Util.parse_ratio(j
|
|
1604
|
-
html.push("<tr><td colspan='5'>成立以来</td><td colspan='10'>", Util.parse_ratio(j
|
|
1597
|
+
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>");
|
|
1598
|
+
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>");
|
|
1599
|
+
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>");
|
|
1600
|
+
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>");
|
|
1601
|
+
html.push("<tr><td colspan='5'>成立以来</td><td colspan='10'>", Util.parse_ratio(j.establish_change), "</td></tr>");
|
|
1605
1602
|
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>");
|
|
1606
1603
|
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>");
|
|
1607
1604
|
html.push("<tr class='" + component_id + "_tr'><td colspan='15'>暂无数据</td></tr>");
|
|
@@ -1709,7 +1706,7 @@ const Util = {
|
|
|
1709
1706
|
Util.post(location.pathname, {active_div: "word", is_init: is_init, specify_day: specify_day, search_key: search_key}, function (j) {
|
|
1710
1707
|
let html = [], index = 0;
|
|
1711
1708
|
let is_mobile = Util.is_mobile();
|
|
1712
|
-
let is_speech_synthesis =
|
|
1709
|
+
let is_speech_synthesis = document.getElementById("word_recite") ? 1 : 0;
|
|
1713
1710
|
j.data.forEach(function (item) {
|
|
1714
1711
|
index++;
|
|
1715
1712
|
html.push("<tr>");
|
|
@@ -1729,10 +1726,10 @@ const Util = {
|
|
|
1729
1726
|
});
|
|
1730
1727
|
Util.render_table_html("word_process_div_body", html);
|
|
1731
1728
|
$("#word_num").html(" 共 <span class='label label-info'>" + index + "</span> 条");
|
|
1732
|
-
if (j
|
|
1729
|
+
if (j.day_num) {
|
|
1733
1730
|
let day_num_html = [];
|
|
1734
1731
|
day_num_html.push('<option value="">全部</option>');
|
|
1735
|
-
j
|
|
1732
|
+
j.day_num.forEach(function (item) {
|
|
1736
1733
|
day_num_html.push('<option value="', item.day, '">', item.day, '(', item.num, ')</option>');
|
|
1737
1734
|
});
|
|
1738
1735
|
let wdn_obj = $("#word_day_num");
|
|
@@ -1869,7 +1866,7 @@ const Util = {
|
|
|
1869
1866
|
component_obj.on('shown.bs.modal', function (e) { // 此事件在模态框已经显示出来触发
|
|
1870
1867
|
let currency = $(e.relatedTarget).attr("data-code");
|
|
1871
1868
|
Util.set_table_loading(component_id + "_body_body");
|
|
1872
|
-
if (
|
|
1869
|
+
if (!document.getElementById("currency_modal_start_date")) {
|
|
1873
1870
|
Util.init_date_range_picker("currency_modal_start_end_date", Util, "render_currency_modal", 60);
|
|
1874
1871
|
}
|
|
1875
1872
|
let title_obj = $("#currency_modal_title");
|
|
@@ -1924,11 +1921,11 @@ const Util = {
|
|
|
1924
1921
|
html.push("</tr>");
|
|
1925
1922
|
});
|
|
1926
1923
|
Util.render_table_html("currency_modal_body_body", html);
|
|
1927
|
-
let currency_modal_summary = "历史最低:<span class='label label-success'>" + j
|
|
1928
|
-
"</span> 历史最高:<span class='label label-danger'>" + j
|
|
1929
|
-
"</span> 年初至今:" + Util.digit_compare_trend1(j.exchange_rate, j
|
|
1930
|
-
" 52周最高:" + Util.digit_compare_trend1(j.exchange_rate, j
|
|
1931
|
-
" 52周最低:" + Util.digit_compare_trend1(j.exchange_rate, j
|
|
1924
|
+
let currency_modal_summary = "历史最低:<span class='label label-success'>" + j.hist_low +
|
|
1925
|
+
"</span> 历史最高:<span class='label label-danger'>" + j.hist_high +
|
|
1926
|
+
"</span> 年初至今:" + Util.digit_compare_trend1(j.exchange_rate, j.year_exchange_rate) +
|
|
1927
|
+
" 52周最高:" + Util.digit_compare_trend1(j.exchange_rate, j.week52high) +
|
|
1928
|
+
" 52周最低:" + Util.digit_compare_trend1(j.exchange_rate, j.week52low);
|
|
1932
1929
|
let title = j.name !== currency ? (j.name + "(" + currency.toUpperCase() + ")") : j.name;
|
|
1933
1930
|
title = '<i class="fa fa-' + currency + '"></i> ' + title;
|
|
1934
1931
|
title = Util.pack_html_link("https://cn.investing.com/currencies/" + currency + "-cny", title);
|
|
@@ -1961,7 +1958,7 @@ const Util = {
|
|
|
1961
1958
|
component_obj.on('shown.bs.modal', function (e) { // 此事件在模态框已经显示出来触发
|
|
1962
1959
|
Util.set_table_loading(component_id + "_body_body");
|
|
1963
1960
|
let coin = $(e.relatedTarget).attr("data-coin");
|
|
1964
|
-
if (
|
|
1961
|
+
if (!document.getElementById(component_id + "_start_date")) {
|
|
1965
1962
|
Util.init_date_range_picker(component_id + "_start_end_date", Util, "render_btc_modal", 60);
|
|
1966
1963
|
}
|
|
1967
1964
|
let title_obj = $("#" + component_id + "_title");
|
|
@@ -2021,11 +2018,11 @@ const Util = {
|
|
|
2021
2018
|
html.push("</tr>");
|
|
2022
2019
|
});
|
|
2023
2020
|
Util.render_table_html("btc_modal_body_body", html);
|
|
2024
|
-
let btc_title = j
|
|
2025
|
-
btc_title += " <small>历史最低:<span class='label label-success'>" + j
|
|
2026
|
-
"</span> 年初至今:" + Util.digit_compare_trend1(j
|
|
2027
|
-
" 52周最高:" + Util.digit_compare_trend1(j
|
|
2028
|
-
" 52周最低:" + Util.digit_compare_trend1(j
|
|
2021
|
+
let btc_title = j.cn_name + "(" + Util.pack_html_link('https://www.binance.com/zh-CN/trade/' + j.short_name + '_USDT?theme=dark', j.short_name) + ", " + Util.pack_html_link("https://www.feixiaohao.com/currencies/" + j.coin, j.coin) + ")";
|
|
2022
|
+
btc_title += " <small>历史最低:<span class='label label-success'>" + j.hist_low + "</span> 历史最高:<span class='label label-danger'>" + j.hist_high +
|
|
2023
|
+
"</span> 年初至今:" + Util.digit_compare_trend1(j.price, j.year_price) +
|
|
2024
|
+
" 52周最高:" + Util.digit_compare_trend1(j.price, j.week52high) +
|
|
2025
|
+
" 52周最低:" + Util.digit_compare_trend1(j.price, j.week52low) + "</small>";
|
|
2029
2026
|
$("#btc_modal_title").html(btc_title);
|
|
2030
2027
|
Util.hide_tips();
|
|
2031
2028
|
});
|
|
@@ -2084,7 +2081,7 @@ const Util = {
|
|
|
2084
2081
|
html.push("</tr>");
|
|
2085
2082
|
});
|
|
2086
2083
|
Util.render_table_html(component_id + "_body_body", html);
|
|
2087
|
-
$("#" + component_id + "_title").html("[" + Util.stock_url(code, j
|
|
2084
|
+
$("#" + component_id + "_title").html("[" + Util.stock_url(code, j.stock_name) + "]资金流向明细(<span>净买入:<b title='" + summary_inflow + "' class='" + Util.text_color(summary_inflow) + "'>" + Util.to_unit(summary_inflow) + "</b>, 上榜次数:<b class='text-info'>" + total_times + "</b>, 买入次数:<b class='text-danger'>" + buy_times + "</b>, 卖出次数:<b class='text-success'>" + sell_times + "</b></span>)");
|
|
2088
2085
|
});
|
|
2089
2086
|
}
|
|
2090
2087
|
});
|
|
@@ -2422,8 +2419,8 @@ const Util = {
|
|
|
2422
2419
|
let select_val = $("#" + select_id).val();
|
|
2423
2420
|
let sd_obj = $('#' + start_id);
|
|
2424
2421
|
let ed_obj = $('#' + end_id);
|
|
2425
|
-
sd_obj.
|
|
2426
|
-
ed_obj.
|
|
2422
|
+
sd_obj.prop("disabled", false);
|
|
2423
|
+
ed_obj.prop("disabled", false);
|
|
2427
2424
|
let weekday = Util.get_weekday();
|
|
2428
2425
|
let date = new Date();
|
|
2429
2426
|
let year = date.getFullYear();
|
|
@@ -2491,8 +2488,8 @@ const Util = {
|
|
|
2491
2488
|
ed_obj.val(Util.seconds_to_format(midnight_second, "%Y-%m-%d"));
|
|
2492
2489
|
break;
|
|
2493
2490
|
case "99":
|
|
2494
|
-
sd_obj.
|
|
2495
|
-
ed_obj.
|
|
2491
|
+
sd_obj.prop("disabled", true);
|
|
2492
|
+
ed_obj.prop("disabled", true);
|
|
2496
2493
|
break;
|
|
2497
2494
|
case "100": // 还原
|
|
2498
2495
|
sd_obj.val(Obj.start_date);
|
|
@@ -2910,16 +2907,17 @@ const Util = {
|
|
|
2910
2907
|
* @returns {{}}
|
|
2911
2908
|
*/
|
|
2912
2909
|
request_arguments: function () {
|
|
2913
|
-
let url = location.search; //获取url中"?"符后的字串
|
|
2914
|
-
let obj = {};
|
|
2915
|
-
if (url.includes("?")) {
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
}
|
|
2922
|
-
return obj;
|
|
2910
|
+
// let url = location.search; //获取url中"?"符后的字串
|
|
2911
|
+
// let obj = {};
|
|
2912
|
+
// if (url.includes("?")) {
|
|
2913
|
+
// let query_array = url.substring(1).split("&");
|
|
2914
|
+
// for (let i = 0; i < query_array.length; i++) {
|
|
2915
|
+
// let query = query_array[i].split("=");
|
|
2916
|
+
// obj[query[0]] = query[1];
|
|
2917
|
+
// }
|
|
2918
|
+
// }
|
|
2919
|
+
// return obj;
|
|
2920
|
+
return Object.fromEntries(new URLSearchParams(location.search));
|
|
2923
2921
|
},
|
|
2924
2922
|
|
|
2925
2923
|
sleep: function (ms) {
|
|
@@ -3008,7 +3006,7 @@ const Util = {
|
|
|
3008
3006
|
* @returns {boolean}
|
|
3009
3007
|
*/
|
|
3010
3008
|
is_loading: function () {
|
|
3011
|
-
return
|
|
3009
|
+
return document.getElementById(Util.load_token) !== null;
|
|
3012
3010
|
},
|
|
3013
3011
|
|
|
3014
3012
|
tooltip: function (element_id, tip) {
|
|
@@ -3146,8 +3144,8 @@ const Util = {
|
|
|
3146
3144
|
$("#index_data").html(index_data_html);
|
|
3147
3145
|
}
|
|
3148
3146
|
code_list.forEach(function (code) {
|
|
3149
|
-
if (j
|
|
3150
|
-
Util.render_price(j
|
|
3147
|
+
if (j.price_data.hasOwnProperty(code)) {
|
|
3148
|
+
Util.render_price(j.price_data[code]);
|
|
3151
3149
|
} else {
|
|
3152
3150
|
$(".price_" + code).each(function () {
|
|
3153
3151
|
let price = $(this).text();
|
|
@@ -3169,7 +3167,7 @@ const Util = {
|
|
|
3169
3167
|
}, "text");
|
|
3170
3168
|
}
|
|
3171
3169
|
} else {
|
|
3172
|
-
if (is_refresh !== 0 && j
|
|
3170
|
+
if (is_refresh !== 0 && j.is_holiday === 0) {
|
|
3173
3171
|
if (Util.is_trade_time()) {
|
|
3174
3172
|
Util.countdown_refresh_index_price(5, element_id, index_list, is_us, is_refresh);
|
|
3175
3173
|
}
|
|
@@ -4023,7 +4021,7 @@ const Util = {
|
|
|
4023
4021
|
|
|
4024
4022
|
init_metrics_statistics: function (metrics, title, callback_func) {
|
|
4025
4023
|
let metrics_drop_down_id = metrics + "_time_drop_down";
|
|
4026
|
-
if (
|
|
4024
|
+
if (!document.getElementById(metrics_drop_down_id)) {
|
|
4027
4025
|
let html = [];
|
|
4028
4026
|
html.push('<div class="x_panel">');
|
|
4029
4027
|
html.push('<div class="x_title"><div class="form-inline">');
|
|
@@ -4237,7 +4235,7 @@ const Util = {
|
|
|
4237
4235
|
chart_instance.clear();
|
|
4238
4236
|
let series_data = [];
|
|
4239
4237
|
line_data.forEach(function (line) {
|
|
4240
|
-
let color = line
|
|
4238
|
+
let color = line.color ? line.color : "#4DC9F6";
|
|
4241
4239
|
let series = {
|
|
4242
4240
|
"type": "line",
|
|
4243
4241
|
"showSymbol": false,
|
|
@@ -4250,10 +4248,10 @@ const Util = {
|
|
|
4250
4248
|
"color": color
|
|
4251
4249
|
},
|
|
4252
4250
|
"markPoint": Util.chart_mark_point,
|
|
4253
|
-
"data": line
|
|
4251
|
+
"data": line.data
|
|
4254
4252
|
};
|
|
4255
|
-
if (line
|
|
4256
|
-
series["name"] = line
|
|
4253
|
+
if (line.label) {
|
|
4254
|
+
series["name"] = line.label;
|
|
4257
4255
|
}
|
|
4258
4256
|
series_data.push(series);
|
|
4259
4257
|
});
|