sbd-npm 1.2.50 → 1.2.52

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.50",
3
+ "version": "1.2.52",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -288,19 +288,12 @@ let Stock = {
288
288
  };
289
289
  Util.post("/stock/" + Stock["code"], payload, function (j) {
290
290
  Stock.hist_type = "";
291
- let _html = [];
292
- let hist_low_price = 0;
293
- let hist_high_price = 0;
294
- let total_amount = 0;
295
- let total_volume = 0;
291
+ let _html = [], hist_low_price = 0, hist_high_price = 0, total_amount = 0, total_volume = 0;
296
292
  j["data"].forEach(function (item) {
297
293
  if (hist_low_price === 0 || hist_low_price > item["low"]) {
298
294
  hist_low_price = item["low"];
299
295
  }
300
296
  hist_high_price = Math.max(hist_high_price, item["high"]);
301
- if (hist_type === "week") {
302
- item["date"] += Util.one_day_second * 5 - 1;
303
- }
304
297
  total_amount += item["amount"];
305
298
  total_volume += item["volume"] * 100;
306
299
  _html.push("<tr>");
@@ -1125,16 +1118,8 @@ let Stock = {
1125
1118
  fetch_bias_data: function () {
1126
1119
  Util.show_loading();
1127
1120
  Util.post("/stock/" + Stock["code"], {action: "bias"}, function (j) {
1128
- let date_data = [];
1129
- let bias20_data = [];
1130
- let bias60_data = [];
1131
- let bias120_data = [];
1132
- let price_data = [];
1133
- let color_data = [];
1134
- let current_date = 0;
1135
- let current_bias20 = 0;
1136
- let current_bias60 = 0;
1137
- let current_bias120 = 0;
1121
+ let date_data = [], bias20_data = [], bias60_data = [], bias120_data = [], price_data = [], color_data = [];
1122
+ let current_date = 0, current_bias20 = 0, current_bias60 = 0, current_bias120 = 0;
1138
1123
  j["data"].forEach(function (item) {
1139
1124
  if (item["date"] > current_date) {
1140
1125
  current_date = item["date"];
@@ -1170,12 +1155,7 @@ let Stock = {
1170
1155
  };
1171
1156
  Util.post("/stock/" + Stock["code"], payload, function (j) {
1172
1157
  Stock["rzye_chart"].hideLoading();
1173
- let date_data = [];
1174
- let rzye_data = [];
1175
- let rqye_data = [];
1176
- let price_data = [];
1177
- let rzye_low = 0;
1178
- let rzye_high = 0;
1158
+ let date_data = [], rzye_data = [], rqye_data = [], price_data = [], rzye_low = 0, rzye_high = 0;
1179
1159
  j["data"].forEach(function (item) {
1180
1160
  if (rzye_low === 0 || item["rzye"] < rzye_low) {
1181
1161
  rzye_low = item["rzye"];
package/util.js CHANGED
@@ -566,6 +566,15 @@ const Util = {
566
566
  return false;
567
567
  },
568
568
 
569
+ /**
570
+ * 是否周末
571
+ * @returns {boolean}
572
+ */
573
+ is_weekend: function () {
574
+ let weekday = Util.get_weekday();
575
+ return weekday > 5;
576
+ },
577
+
569
578
  /**
570
579
  * 是否上证股票
571
580
  * @param code