sbd-npm 1.4.17 → 1.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constant.js +2 -5
- package/package.json +1 -1
- package/util.js +22 -5
package/constant.js
CHANGED
@@ -143,16 +143,13 @@ const MenuList = [
|
|
143
143
|
'icon': 'retweet',
|
144
144
|
'menu': [
|
145
145
|
{'key': 'portfolio_recommend', 'name': '关注', 'url': '/0x2da99e58e28de94b670c4200657ac7e26dd8dceb'},
|
146
|
-
{'key': 'portfolio_week', 'name': '周观察股', 'url': '/0xa97a3f551b5fddd48384952bbd0eb63b7c4636d0'},
|
147
146
|
{'key': 'portfolio_chen', 'name': '陈营长极品投资', 'url': '/0x3f8cbeeeb38138a626e935017a4cc25f47ce3dbe'},
|
147
|
+
{'key': 'portfolio_zeng', 'name': '老曾阿牛', 'url': '/0x2cf53b473b916e1d8b9998de00bb782171bb2630'},
|
148
|
+
{'key': 'portfolio_dao', 'name': '专注成长的股事笔记', 'url': '/0xf9d3664538c43bf7f886674abe7af9710aab82ec'},
|
148
149
|
{'key': 'portfolio_vegetable', 'name': 'Veget', 'url': '/0x671dd9dcfca7dbc220c8164c92a74d2c561c6464'},
|
149
150
|
{'key': 'portfolio_follow', 'name': '跟我走吧14', 'url': '/0x4aa68e74a66297c0ece1bb05fad20c32ee1db9e4'},
|
150
151
|
{'key': 'portfolio_cloud', 'name': '心似白云常自在', 'url': '/0x9ea6081b57418a7f987775631043f7f924e25cff'},
|
151
|
-
{'key': 'portfolio_tianjin', 'name': '天津股侠', 'url': '/0xb8428e42237a7485a787e2ab1b5ae0f057258f18'},
|
152
|
-
{'key': 'portfolio_zan', 'name': 'zangyn', 'url': '/0xccb07ddaf4f1219b7b5ae64780e7905206927873'},
|
153
152
|
{'key': 'portfolio_peng', 'name': '吴小朋同学', 'url': '/0x4f1a316c05731e365ec1b7ef454d98206fa973f6'},
|
154
|
-
{'key': 'portfolio_wen', 'name': '李健2013', 'url': '/0xe09c047550390159bda66d6315743427dd7ccae4'},
|
155
|
-
{'key': 'portfolio_patience', 'name': '耐力投资', 'url': '/0x55ecbeeabd7ad78dba8c38a9325b2889798622b3'},
|
156
153
|
{'key': 'portfolio_star50', 'name': '科创50', 'url': '/0x378b2601d83c467f81f1d4e323c8bfbc72f6cc0d'},
|
157
154
|
{'key': 'portfolio_bellwether', 'name': '龙头股', 'url': '/0x7cdfb14131c3693c439a90333790eeb5fce70a12'},
|
158
155
|
{'key': 'portfolio_market_situation', 'name': '市值风云', 'url': '/0x3720c6de05378152ef0e758b56199bfcbc15274b'},
|
package/package.json
CHANGED
package/util.js
CHANGED
@@ -1135,19 +1135,28 @@ const Util = {
|
|
1135
1135
|
{"name": ""},
|
1136
1136
|
]
|
1137
1137
|
});
|
1138
|
-
|
1138
|
+
let payload = {
|
1139
|
+
action: "public_fund",
|
1140
|
+
public_fund_date: $("#public_fund_date").val(),
|
1141
|
+
is_fund_rank10: $("#is_fund_rank10").prop("checked") ? 1 : 0
|
1142
|
+
};
|
1143
|
+
Util.post("/stock/" + code, payload, function (j) {
|
1139
1144
|
Util.render_public_fund(j);
|
1140
1145
|
if (j["date"] && j["date"] > 0) {
|
1141
1146
|
$("#public_fund_title").find("a").each(function() {
|
1142
1147
|
let t_text = $(this).text();
|
1143
|
-
if (t_text.indexOf("
|
1148
|
+
if (t_text.indexOf("基金明细") > -1) {
|
1144
1149
|
$(this).attr("href", "https://data.eastmoney.com/zlsj/detail/" + Util.seconds_to_format(j["date"], "%Y-%m-%d") + "-1-" + code + ".html");
|
1145
1150
|
}
|
1146
1151
|
});
|
1147
1152
|
}
|
1148
1153
|
if ($("#public_fund_date").length === 0) {
|
1149
1154
|
let fund_len = j["data"] ? j["data"].length : 0;
|
1150
|
-
|
1155
|
+
let payload = {
|
1156
|
+
action: "public_fund_date",
|
1157
|
+
is_fund_rank10: $("#is_fund_rank10").prop("checked") ? 1 : 0
|
1158
|
+
};
|
1159
|
+
Util.post("/stock/" + code, payload, function (j) {
|
1151
1160
|
let html = [], date_len = 0;
|
1152
1161
|
html.push('<select id="public_fund_date">');
|
1153
1162
|
j["data"].forEach(function (item) {
|
@@ -1160,6 +1169,12 @@ const Util = {
|
|
1160
1169
|
$("#public_fund_date").change(function () {
|
1161
1170
|
Util.fetch_public_fund(code);
|
1162
1171
|
});
|
1172
|
+
$("[data-toggle='tooltip']").tooltip();
|
1173
|
+
$("#is_fund_rank10").click(function () {
|
1174
|
+
$("#public_fund_date").remove();
|
1175
|
+
$("#public_fund_tips").html("Loading...");
|
1176
|
+
Util.fetch_public_fund(code);
|
1177
|
+
});
|
1163
1178
|
if (fund_len === 0 && date_len > 0) {
|
1164
1179
|
Util.fetch_public_fund(code);
|
1165
1180
|
}
|
@@ -3796,14 +3811,16 @@ const Util = {
|
|
3796
3811
|
|
3797
3812
|
/**
|
3798
3813
|
* 字符串按长度截断( substr 方法已被标记为过时(deprecated),建议使用 substring() 或者字符串切片语法(str.slice())来代替)
|
3814
|
+
* substring(start, end) 接受两个参数,分别是起始位置和结束位置;substring() 方法会将负数参数视为 0。
|
3815
|
+
* slice(start, end) 也接受两个参数,但是同样是起始位置和结束位置,其中结束位置可以为负数,表示从末尾开始计算;slice() 方法会将负数参数视为从末尾开始的索引。
|
3799
3816
|
* @param str
|
3800
3817
|
* @param len
|
3801
3818
|
* @returns {*}
|
3802
3819
|
*/
|
3803
3820
|
substring: function (str, len) {
|
3804
3821
|
if (str.length > len) {
|
3805
|
-
|
3806
|
-
str = str.substring(0, len) + "...";
|
3822
|
+
str = str.slice(0, len) + "...";
|
3823
|
+
//str = str.substring(0, len) + "...";
|
3807
3824
|
}
|
3808
3825
|
return str
|
3809
3826
|
},
|