|
@@ -1,6 +1,5 @@
|
|
|
-
|
|
|
-var goodsInfo = require('../data/goodsInfo.js');
|
|
|
var _ = require("../underscore/underscore.js")
|
|
|
+var lib = require("./lib.js")
|
|
|
const mapWidth = $("#map").width()
|
|
|
|
|
|
const BaseUrl = 'http://api-fn.duowan.com'
|
|
@@ -32,6 +31,7 @@ var app = new Vue({
|
|
|
el: '#app',
|
|
|
data() {
|
|
|
return {
|
|
|
+ curWeek : lib.getParam("w"),
|
|
|
weekTasks : taskInfo.weekData,
|
|
|
mapWeeks : {},
|
|
|
mapMarkers: null,
|
|
@@ -81,7 +81,7 @@ var app = new Vue({
|
|
|
|
|
|
// overLayer
|
|
|
let overlayMaps = {};
|
|
|
- let lastKey = _.last(_.keys(this.mapWeeks))
|
|
|
+ let lastKey = this.curWeek || _.last(_.keys(this.mapWeeks))
|
|
|
overlayMaps[weekNames[lastKey]] = L.layerGroup(this.mapWeeks[lastKey]).addTo(map)
|
|
|
for(let i in this.mapWeeks) {
|
|
|
if(i == lastKey) continue
|
|
@@ -93,8 +93,9 @@ var app = new Vue({
|
|
|
}).addTo(map);
|
|
|
},
|
|
|
getMapMarkers(data) {
|
|
|
- var season = data.challenges.season4
|
|
|
- var leafletCoords = []
|
|
|
+ let seasonKesys = _.keys(data.challenges)
|
|
|
+ let season = data.challenges[seasonKesys[seasonKesys.length-1]]
|
|
|
+ let leafletCoords = []
|
|
|
|
|
|
for(let i in season) {
|
|
|
this.mapWeeks[i] = []
|
|
@@ -109,17 +110,24 @@ var app = new Vue({
|
|
|
let weekNum = i.replace(/[^0-9]/ig,"")
|
|
|
|
|
|
if(!goodsInfo[j]) continue
|
|
|
- let iconName = j == `treasuremap` || j == `secret_treasuremap` || j == `killzone` ? `${goodsInfo[j]['icon']}_icon_${weekNum}` : `${goodsInfo[j]['icon']}_icon`
|
|
|
+ let iconName = j == 'treasuremap' || j == 'secret_treasuremap' || j == 'killzone' ? `${goodsInfo[j]['icon']}_icon_${weekNum}` : `${goodsInfo[j]['icon']}_icon`
|
|
|
let iconSize = window.screen.height >= 768 ? goodsInfo[j]['size'] : goodsInfo[j]['minSize']
|
|
|
|
|
|
- let image = `<a class="example-image-link" href="https://www.fortnitechests.info/assets/images/challenges/screenshots/treasures/${i}_${j}.png" data-lightbox="example-1">
|
|
|
- <img src="${BaseUrl}/assets/images/challenges/screenshots/chests/${srclng}_${srclat}.png" class="borderi example-image img-fluid" height="50px" width="90px">
|
|
|
+
|
|
|
+ let imageMessage = `<a class="example-image-link" href="http://api-fn.duowan.com/uploads/${srclng}_${srclat}.png" data-lightbox="example-1">
|
|
|
+ <img src="http://api-fn.duowan.com/uploads/${srclng}_${srclat}.png" class="borderi example-image img-fluid" height="50px" width="90px">
|
|
|
</a><br/>
|
|
|
<center>
|
|
|
<b>${weekNames[i]}</b><br/><b>任务类型:</b> ${goodsInfo[j]['tip']}
|
|
|
</center>`;
|
|
|
|
|
|
- leafletCoords.push({ "message": image,
|
|
|
+ let noImageMessage = `<center>
|
|
|
+ <b>${weekNames[i]}</b><br/><b>任务类型:</b> ${goodsInfo[j]['tip']}
|
|
|
+ </center>`;
|
|
|
+
|
|
|
+ let message = (j == 'junction' || j == 'treasuremap') ? imageMessage : noImageMessage
|
|
|
+
|
|
|
+ leafletCoords.push({ "message": message,
|
|
|
"lng":lng,
|
|
|
"lat":lat,
|
|
|
"layer":i,
|