sbd-npm 1.2.41 → 1.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constant.js +3 -2
- package/package.json +1 -1
- package/stock_basics.js +3 -7
- package/util.js +41 -2
package/constant.js
CHANGED
@@ -40,6 +40,7 @@ const MenuList = [
|
|
40
40
|
{'key': 'trend_money_inflow', 'name': '资金流入历史最高', 'url': '/dc1303ba221de0c4fb85cd3cb513c547'},
|
41
41
|
{'key': 'trend_month', 'name': '月线趋势', 'url': '/218cd8e3c5ea55629cac28ee0e543233'},
|
42
42
|
{'key': 'trend_boll', 'name': '布林线', 'url': '/0c9b231a72e40475d6f985fd67bdb718'},
|
43
|
+
{'key': 'trend_bull_trend', 'name': '多头趋势', 'url': '/11c801537253fbfc175fadf8f645721d'},
|
43
44
|
{'key': 'trend_ma20_60', 'name': '20、60日均线交叉', 'url': '/4bf72713d83469ad6ec1d9fc3be8886f'},
|
44
45
|
{'key': 'trend_macd_down', 'name': 'MACD下行', 'url': '/ff97a31b4ffbabe71315e75c4fd62047'},
|
45
46
|
{'key': 'trend_doji', 'name': '十字星', 'url': '/718eac2cccaef1c7968f2d121b5f3070'},
|
@@ -136,11 +137,11 @@ const MenuList = [
|
|
136
137
|
{'key': 'concept_recommend', 'name': '关注', 'url': '/27ca098faad33a8e4d109efe0112fd16'},
|
137
138
|
{'key': 'concept_bellwether', 'name': '龙头股', 'url': '/2995afdea420471e00c536182e711bef'},
|
138
139
|
{'key': 'concept_market_situation', 'name': '市值风云', 'url': '/02fdaf4d66cdecb092bcd65f569aa493'},
|
140
|
+
{'key': 'concept_wen', 'name': '崇文不尚武', 'url': '/b6fd64a2c54250b8ac039123e74e9b7e'},
|
141
|
+
{'key': 'concept_dao', 'name': '成长股事(大道)', 'url': '/7b7ea877f6793752e2b981d82da81e1b'},
|
139
142
|
{'key': 'concept_down_top', 'name': '15-21年的超跌股', 'url': '/ae3bbf97a358392cfaa0ceb35cb3fb57'},
|
140
143
|
{'key': 'concept_cloud', 'name': '心似白云常自在', 'url': '/1d883188398a3a8c743748c5eb81fe7b'},
|
141
|
-
{'key': 'concept_wen', 'name': '崇文不尚武', 'url': '/b6fd64a2c54250b8ac039123e74e9b7e'},
|
142
144
|
{'key': 'concept_niu', 'name': '老曾阿牛', 'url': '/0f4a2714971424024c1ddd8651c26569'},
|
143
|
-
{'key': 'concept_dao', 'name': '成长股事(大道)', 'url': '/7b7ea877f6793752e2b981d82da81e1b'},
|
144
145
|
{'key': 'concept_qian', 'name': '唐史主任司马迁', 'url': '/8b3e40fe74b4870244bc51125da7675a'},
|
145
146
|
{'key': 'concept_dan', 'name': '但斌', 'url': '/3ac0a5857b1d9a111497c0e817e647a1'},
|
146
147
|
{'key': 'concept_auto_intelligent', 'name': '智能电动车', 'url': '/cd7be404357809849d267f24fceebcd2'},
|
package/package.json
CHANGED
package/stock_basics.js
CHANGED
@@ -495,16 +495,12 @@ let Stock = {
|
|
495
495
|
payload["date"] = date;
|
496
496
|
}
|
497
497
|
Util.post("/stock/" + Stock["code"], payload, function (j) {
|
498
|
-
let main_html = [];
|
499
|
-
let
|
500
|
-
let main_volume = 0;
|
501
|
-
let pre_main_volume = 0;
|
502
|
-
let circulation_volume = 0;
|
503
|
-
let pre_circulation_volume = 0;
|
498
|
+
let main_html = [], circulation_html = [];
|
499
|
+
let main_volume = 0, pre_main_volume = 0, circulation_volume = 0, pre_circulation_volume = 0;
|
504
500
|
j["data"].forEach(function (item) {
|
505
501
|
let change = item["change"];
|
506
502
|
if (change === "None") {
|
507
|
-
change = "
|
503
|
+
change = "<b class='text-danger'>新增</b>";
|
508
504
|
} else if (parseInt(change) === 0) {
|
509
505
|
change = "不变";
|
510
506
|
} else if (parseFloat(change) > 0) {
|
package/util.js
CHANGED
@@ -251,7 +251,25 @@ const Util = {
|
|
251
251
|
*/
|
252
252
|
stock_basics_html: function (html, item) {
|
253
253
|
let symbol = Util.is_alpha(item["code"]) ? item["code"].toUpperCase() : item["code"];
|
254
|
-
let name =
|
254
|
+
let name = symbol;
|
255
|
+
if (item["cname"]) {
|
256
|
+
if (Util.is_us(item["code"])) {
|
257
|
+
name = item["cname"].replace("公司", "");
|
258
|
+
} else {
|
259
|
+
name = item["cname"];
|
260
|
+
}
|
261
|
+
} else if (item["name"]) {
|
262
|
+
name = item["name"];
|
263
|
+
if (Util.is_us(item["code"])) {
|
264
|
+
if (name.indexOf(' ') !== -1) {
|
265
|
+
let name_arr = name.split(' ');
|
266
|
+
name = name_arr[0] ? name_arr[0] : name;
|
267
|
+
} else {
|
268
|
+
name = name.replace("公司", "");
|
269
|
+
}
|
270
|
+
}
|
271
|
+
name = name.substr(0, 10);
|
272
|
+
}
|
255
273
|
html.push("<td>", Util.snowball_url(symbol), "</td>");
|
256
274
|
html.push("<td>", Util.stock_url(item["code"], name), "</td>");
|
257
275
|
html.push("<td>", Util.to_float((item["pe_ttm"] ? item["pe_ttm"] : item["pe"]), 2), "</td>");
|
@@ -2712,7 +2730,10 @@ const Util = {
|
|
2712
2730
|
} else if (digit >= 10000 || digit <= -10000) {
|
2713
2731
|
return "<span title='" + digit + "'>" + Util.to_float(digit / 10000, fraction) + "万</span>";
|
2714
2732
|
}
|
2715
|
-
|
2733
|
+
if (Util.is_float(digit)) {
|
2734
|
+
return Util.to_float(digit, fraction);
|
2735
|
+
}
|
2736
|
+
return digit;
|
2716
2737
|
},
|
2717
2738
|
|
2718
2739
|
/**
|
@@ -2740,6 +2761,24 @@ const Util = {
|
|
2740
2761
|
return 0;
|
2741
2762
|
},
|
2742
2763
|
|
2764
|
+
/**
|
2765
|
+
* 是否浮点数
|
2766
|
+
* @param n
|
2767
|
+
* @returns {boolean}
|
2768
|
+
*/
|
2769
|
+
is_float: function (n) {
|
2770
|
+
return Number(n) === n && n % 1 !== 0;
|
2771
|
+
},
|
2772
|
+
|
2773
|
+
/**
|
2774
|
+
* 是否整数
|
2775
|
+
* @param n
|
2776
|
+
* @returns {boolean}
|
2777
|
+
*/
|
2778
|
+
is_int: function (n) {
|
2779
|
+
return Number(n) === n && n % 1 === 0;
|
2780
|
+
},
|
2781
|
+
|
2743
2782
|
/**
|
2744
2783
|
* 触发事件的对象的引用
|
2745
2784
|
* https://developer.mozilla.org/zh-CN/docs/Web/API/Event/target
|