sbd-npm 1.2.73 → 1.2.74
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/stock_basics.js +2 -16
- package/util.js +23 -0
package/package.json
CHANGED
package/stock_basics.js
CHANGED
@@ -238,22 +238,8 @@ let Stock = {
|
|
238
238
|
$(this).attr("target", "_blank");
|
239
239
|
$(this).attr("rel", "noopener noreferrer nofollow");
|
240
240
|
});
|
241
|
-
//
|
242
|
-
|
243
|
-
let ma_deduction_html = [];
|
244
|
-
item["ma_deduction"].forEach(function (ma) {
|
245
|
-
if (ma["deduction_price"] > 0) {
|
246
|
-
let day_ma_str = ma["day"] + "日均线";
|
247
|
-
if (ma["day"] === 20 || ma["day"] === 60 || ma["day"] === 120) {
|
248
|
-
day_ma_str = "<span class='label label-info'>" + day_ma_str + "</span>";
|
249
|
-
}
|
250
|
-
let deduction_cls = Util.text_color(item["price"], ma["deduction_price"]);
|
251
|
-
let ma_cls = Util.text_color(item["price"], ma["ma"]);
|
252
|
-
ma_deduction_html.push(day_ma_str + ":<b class='" + ma_cls + "'>" + ma["ma"] + "</b>(<b class='" + deduction_cls + "'>" + ma["deduction_price"] + "</b>)");
|
253
|
-
}
|
254
|
-
});
|
255
|
-
$("#ma_deduction").html(ma_deduction_html.join(" "));
|
256
|
-
}
|
241
|
+
// 日均线/抵扣价数据
|
242
|
+
Util.render_ma_deduction(item, "ma_deduction");
|
257
243
|
if (item["boll_up"] && item["boll_up"] > 0 && item["boll_down"] && item["boll_down"] > 0) {
|
258
244
|
$("#boll").html("<a title='当前上轨线 / 当前下轨线' target='_blank' rel='noopener noreferrer nofollow' href='" + Util.get_url("trend_boll") + "'><b class='text-danger'>" + Util.to_float(item["boll_up"], 2) + "</b> / <b class='text-success'>" + Util.to_float(item["boll_down"], 2) + "</b></a>");
|
259
245
|
}
|
package/util.js
CHANGED
@@ -2544,6 +2544,29 @@ const Util = {
|
|
2544
2544
|
}
|
2545
2545
|
},
|
2546
2546
|
|
2547
|
+
/**
|
2548
|
+
* 组装日均线/抵扣价数据
|
2549
|
+
* @param item
|
2550
|
+
* @param element_id
|
2551
|
+
*/
|
2552
|
+
render_ma_deduction: function (item, element_id) {
|
2553
|
+
if (item["price"] && item["ma_deduction"] && item["ma_deduction"].length > 0) {
|
2554
|
+
let ma_deduction_html = [];
|
2555
|
+
item["ma_deduction"].forEach(function (ma) {
|
2556
|
+
if (ma["deduction_price"] > 0) {
|
2557
|
+
let day_ma_str = ma["day"] + "日均线";
|
2558
|
+
if (ma["day"] === 20 || ma["day"] === 60 || ma["day"] === 120) {
|
2559
|
+
day_ma_str = "<span class='label label-info'>" + day_ma_str + "</span>";
|
2560
|
+
}
|
2561
|
+
let deduction_cls = Util.text_color(item["price"], ma["deduction_price"]);
|
2562
|
+
let ma_cls = Util.text_color(item["price"], ma["ma"]);
|
2563
|
+
ma_deduction_html.push(day_ma_str + ":<b class='" + ma_cls + "'>" + ma["ma"] + "</b>(<b class='" + deduction_cls + "'>" + ma["deduction_price"] + "</b>)");
|
2564
|
+
}
|
2565
|
+
});
|
2566
|
+
$("#" + element_id).html(ma_deduction_html.join(" "));
|
2567
|
+
}
|
2568
|
+
},
|
2569
|
+
|
2547
2570
|
/**
|
2548
2571
|
* 设置 option 的第 nth 项为默认项
|
2549
2572
|
* @param obj
|