sbd-npm 1.1.2 → 1.1.6

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.1.2",
3
+ "version": "1.1.6",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/summary_daily.js CHANGED
@@ -131,7 +131,9 @@ $(document).ready(function () {
131
131
  stock_rate_html.push(_pack_stock_rate("-7% ~ -5%", pr["r7_5"], "bg-green"));
132
132
  stock_rate_html.push(_pack_stock_rate("-10% ~ -7%", pr["r10_7"], "bg-green"));
133
133
  $("#stock_rate_bar").html(stock_rate_html.join(""));
134
+ $("#rate_up").html(pr["r0_3"] + pr["r3_5"] + pr["r5_7"] + pr["r7_10"]);
134
135
  $("#rate_up_limit").html(pr["r10"]);
136
+ $("#rate_down").html(pr["r10_7"] + pr["r7_5"] + pr["r5_3"] + pr["r3_0"]);
135
137
  $("#rate_down_limit").html(pr["r_10"]);
136
138
  },
137
139
 
package/util.js CHANGED
@@ -209,15 +209,14 @@ let Util = {
209
209
  * @returns {string}
210
210
  */
211
211
  map_url: function (location, location_name = "") {
212
- if (location === "--") {
213
- return location;
214
- } else if (location) {
215
- location_name = location_name === "" ? location : location_name;
216
- if (location_name.length > 8) {
217
- return "<a title='" + location + "' target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name.substr(0, 8) + "</a>";
218
- } else {
219
- return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
212
+ if (location) {
213
+ if (location === "--") {
214
+ return location;
215
+ }
216
+ if (location_name === "") {
217
+ location_name = location.length > 8 ? location.substr(0, 8) : location;
220
218
  }
219
+ return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
221
220
  }
222
221
  return "--";
223
222
  },
@@ -284,6 +283,21 @@ let Util = {
284
283
  }
285
284
  $(this).html(price);
286
285
  });
286
+ $(".year_price_" + code).each(function () {
287
+ if (item["year_price"]) {
288
+ $(this).html(Util.year_price_rate(item["price"], item["year_price"]));
289
+ } else {
290
+ let year_price = $(this).attr("data-val");
291
+ if (year_price) {
292
+ $(this).html(Util.year_price_rate(item["price"], Util.to_float(year_price)));
293
+ }
294
+ }
295
+ });
296
+ if (item["high_52week"]) {
297
+ $(".high_52week_" + code).each(function () {
298
+ $(this).html(Util.year_price_rate(item["price"], item["high_52week"]));
299
+ });
300
+ }
287
301
  }
288
302
  if (item["high"]) {
289
303
  let high_price = Util.digit_compare_trend(item["high"], item["previous_price"]);