sbd-npm 1.2.73 → 1.2.75

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 CHANGED
@@ -134,7 +134,6 @@ const MenuList = [
134
134
  'icon': 'retweet',
135
135
  'menu': [
136
136
  {'key': 'concept_recommend', 'name': '关注', 'url': '/27ca098faad33a8e4d109efe0112fd16'},
137
- {'key': 'concept_macd', 'name': 'MACD', 'url': '/3400774e910fb611625b31d049d571fb'},
138
137
  {'key': 'concept_cloud', 'name': '心似白云常自在', 'url': '/1d883188398a3a8c743748c5eb81fe7b'},
139
138
  {'key': 'concept_vegetable', 'name': 'Veget', 'url': '/b1769a58f0f3d4a92bad61c97a2232f0'},
140
139
  {'key': 'concept_zan', 'name': 'zangyn', 'url': '/860a3a9647efad436894b4aa3843da42'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.73",
3
+ "version": "1.2.75",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
- if (item["price"] && item["ma_deduction"] && item["ma_deduction"].length > 0) {
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("&nbsp;&nbsp;"));
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
  }
@@ -430,6 +416,18 @@ let Stock = {
430
416
 
431
417
  fetch_rps_data: function () {
432
418
  Util.show_loading();
419
+ Util.init_table_skeleton({
420
+ "element_id": "rps_table",
421
+ "head_cols": [
422
+ {"name": "时间"},
423
+ {"name": "RPS20", "tooltip": "20日股价相对强度,表示过去20个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去20日内的价格涨幅超过了市场上85%的股票"},
424
+ {"name": "20日涨跌"},
425
+ {"name": "RPS60", "tooltip": "60日股价相对强度,表示过去60个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去60日内的价格涨幅超过了市场上85%的股票"},
426
+ {"name": "60日涨跌"},
427
+ {"name": "RPS120", "tooltip": "120日股价相对强度,表示过去120个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去120日内的价格涨幅超过了市场上85%的股票"},
428
+ {"name": "120日涨跌"},
429
+ ]
430
+ });
433
431
  Util.post("/stock/" + Stock.code, {action: "rps"}, function (j) {
434
432
  let _html = [];
435
433
  j["data"].forEach(function (item) {
@@ -444,15 +442,15 @@ let Stock = {
444
442
  _html.push("</tr>");
445
443
  });
446
444
  if (_html.length > 0) {
447
- Util.render_table_html("rps_data", _html);
445
+ Util.render_table_html("rps_table_body", _html);
448
446
  } else {
449
447
  let now = Util.now();
450
448
  if ((now - Stock.ttm_second) < Util.one_year_second) {
451
- let obj = $("#rps_data");
449
+ let obj = $("#rps_table_body");
452
450
  let td_num = obj.parent().find('thead td').length;
453
451
  obj.html('<tr><td colspan="' + td_num + '">上市时间(' + Util.seconds_to_format(Stock.ttm_second, "%Y-%m-%d") + ')不足一年不做统计!</td></tr>');
454
452
  } else {
455
- Util.render_table_html("rps_data", []);
453
+ Util.render_table_html("rps_table_body", []);
456
454
  }
457
455
  }
458
456
  Util.hide_tips();
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("&nbsp;&nbsp;"));
2567
+ }
2568
+ },
2569
+
2547
2570
  /**
2548
2571
  * 设置 option 的第 nth 项为默认项
2549
2572
  * @param obj