sbd-npm 1.2.51 → 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.51",
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,11 +288,7 @@ 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"];
@@ -1122,16 +1118,8 @@ let Stock = {
1122
1118
  fetch_bias_data: function () {
1123
1119
  Util.show_loading();
1124
1120
  Util.post("/stock/" + Stock["code"], {action: "bias"}, function (j) {
1125
- let date_data = [];
1126
- let bias20_data = [];
1127
- let bias60_data = [];
1128
- let bias120_data = [];
1129
- let price_data = [];
1130
- let color_data = [];
1131
- let current_date = 0;
1132
- let current_bias20 = 0;
1133
- let current_bias60 = 0;
1134
- 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;
1135
1123
  j["data"].forEach(function (item) {
1136
1124
  if (item["date"] > current_date) {
1137
1125
  current_date = item["date"];
@@ -1167,12 +1155,7 @@ let Stock = {
1167
1155
  };
1168
1156
  Util.post("/stock/" + Stock["code"], payload, function (j) {
1169
1157
  Stock["rzye_chart"].hideLoading();
1170
- let date_data = [];
1171
- let rzye_data = [];
1172
- let rqye_data = [];
1173
- let price_data = [];
1174
- let rzye_low = 0;
1175
- let rzye_high = 0;
1158
+ let date_data = [], rzye_data = [], rqye_data = [], price_data = [], rzye_low = 0, rzye_high = 0;
1176
1159
  j["data"].forEach(function (item) {
1177
1160
  if (rzye_low === 0 || item["rzye"] < rzye_low) {
1178
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