Explorar el Código

堡垒之夜-工具页面

baichun hace 6 años
padre
commit
5a9452b415

+ 2 - 1
web/1807-工具页面/fis-conf.js

@@ -122,7 +122,8 @@ fis.media('prod').match('*.{jpg,png,jpeg,gif,css,scss,js,woff,ttf,svg,eot}', {
         mangle: {
             except: 'exports, module, require, define'
         }
-    })
+    }),
+    useHash: true
 }).match(/^\/src\/sass\/((.*)\.(css|less|scss|sass))$/i, {
     url: version + 'css/$1',
     optimizer: fis.plugin('clean-css'),

+ 13 - 13
web/1807-工具页面/src/arsenal.html

@@ -22,13 +22,13 @@
 <body data-topnav="3">
     <div class="page-tool page-arsenal">
         <link rel="import" href="./toolNav.html?__inline">
-        <div class="tool-section" id="app" v-cloak>
+        <div class="tool-section">
             <div class="zt-inner">
                 <h1>武器库</h1>
                 <div class="zt-crumbs">
                     <a href="http://fn.duowan.com/">专区首页</a> &gt; <a href="#">武器库</a> &gt; 枪械分类
                 </div>
-                <div class="tool-box">
+                <div class="tool-box"  id="app" v-cloak>
                     <div class="ku-tab">
                         <div class="ku-tab_hd">
                             <ul data-switchable-role="nav">
@@ -46,7 +46,7 @@
                                     </table>
                                     <div class="box-tab_cont" data-switchable-role="content">
                                         <div :class="['box-tab_pannel',{'u-hide':typeIndex!=0}]" v-for="(weaponsType,typeIndex) in weaponsTypeArr">
-                                            <table class="table-ku" v-for="(weapons,index) in weaponsType.list">
+                                            <table class="table-ku" v-for="(tabWeapons,tabWeaponsIndex) in weaponsType.list" :key="tabWeaponsIndex">
                                                 <thead>
                                                     <tr>
                                                         <td class="col-name">枪械名</td>
@@ -59,7 +59,7 @@
                                                     </tr>
                                                 </thead>
                                                 <tbody>
-                                                    <tr v-for="(item,index) in weapons" :key="index">
+                                                    <tr v-for="(item,index) in tabWeapons" :key="index">
                                                         <td class="col-name col-rows" :rowspan="weaponsType['listNum'][item.name]" v-if="index==0">
                                                             <a :href="'./arsenalDetail.html?w='+item.name+'-'+item.rarity">{{item.nameCN || item.name}}</a>
                                                         </td>
@@ -89,22 +89,22 @@
                                         <tr>
                                             <td>枪械名</td>
                                             <td>品质</td>
-                                            <td class="sort-up">秒伤<i></i></td>
-                                            <td class="sort-down">伤害<i></i></td>
-                                            <td>射速<i></i></td>
-                                            <td>弹匣容量<i></i></td>
-                                            <td>装填时间<i></i></td>
-                                            <td>垂直后坐力<i></i></td>
+                                            <td class="btn-sort" @click="sortWeapons('dps',$event)">秒伤<i></i></td>
+                                            <td class="btn-sort" @click="sortWeapons('damage',$event)">伤害<i></i></td>
+                                            <td class="btn-sort" @click="sortWeapons('fire-rate',$event)">射速<i></i></td>
+                                            <td class="btn-sort" @click="sortWeapons('magazine-size',$event)">弹匣容量<i></i></td>
+                                            <td class="btn-sort" @click="sortWeapons('reload-time',$event)">装填时间<i></i></td>
+                                            <td class="btn-sort" @click="sortWeapons('vertical',$event)">垂直后坐力<i></i></td>
                                         </tr>
                                     </thead>
                                     <tbody>
                                         <tr v-for="(item,index) in weapons" :key="index">
                                             <td class="col-imgtxt">
-                                                <a :href="'./arsenalDetail.html?id='+index"><img src="//pub.dwstatic.com/common/img/blank.png" :data-src="'//api-fn.duowan.com/'+item.image" alt=""></a>
-                                                <a :href="'./arsenalDetail.html?id='+index">{{item.nameCN || item.name}}</a>
+                                                <a :href="'./arsenalDetail.html?w='+item.name+'-'+item.rarity"><img src="//pub.dwstatic.com/common/img/blank.png" :data-src="'//api-fn.duowan.com/'+item.image" alt=""></a>
+                                                <a :href="'./arsenalDetail.html?w='+item.name+'-'+item.rarity">{{item.nameCN || item.name}}</a>
                                             </td>
                                             <td>
-                                                <span :class="'color-'+item.rarity">{{item['rarityCN'] || item['rarity']}}</span>
+                                                <a :href="'./arsenalDetail.html?w='+item.name+'-'+item.rarity" :class="'color-'+item.rarity">{{item['rarityCN'] || item['rarity']}}</a>
                                             </td>
                                             <td>{{item['dps']}}</td>
                                             <td>{{item['quick-information']['damage']}}</td>

+ 4 - 3
web/1807-工具页面/src/challenges.html

@@ -28,9 +28,9 @@
                 <div class="map-wrap fl" id="map"></div>
                 <div class="task-wrap fr" id="app" v-cloak>
                     <ul class="list-task">
-                        <li :class="'task-item task-item_'+weekIndex" v-for="(weekItem,weekIndex) in weekTasks" :key="weekIndex">
+                        <li :class="'task-item task-item_'+weekIndex" v-for="(weekItem,weekIndex) in weekTasks" :key="weekIndex" v-if="weekItem.taskStaus==1">
                             <div class="task-hd" @click="changeTabWeek(weekIndex)">{{weekItem.weekCN}}</div>
-                            <div class="task-bd">
+                            <div :class="['task-bd',{'u-hide': curWeek!=weekIndex}]">
                                 <table class="table-task"> 
                                     <thead>
                                         <tr>
@@ -63,7 +63,8 @@
     <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />
     <script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
     <script>
-        var taskInfo = require('modules/data/taskInfo.js');
+        // var goodsInfo = require('modules/data/goodsInfo.js');
+        // var taskInfo = require('modules/data/taskInfo.js');
         require('modules/page/challenges');
     </script>
 </body>

+ 6 - 5
web/1807-工具页面/src/lootDetail.html

@@ -33,7 +33,7 @@
                             </div>
                             <div class="chance-bd">
                                 <block v-for="(typeItem,typeIndex) in chanceItme.data" :key="typeIndex">
-                                    <h3>{{typeIndex}}</h3>
+                                    <h3>{{lootNavCn[typeIndex]}}</h3>
                                     <table class="table-loot">
                                         <thead>
                                             <tr>
@@ -46,11 +46,11 @@
                                             <tr v-for="(item,index) in typeItem" :key="index">
                                                 <td class="col-imgtxt">
                                                     <a :href="'./arsenalDetail.html?w='+item.name" v-if="item.isWeapon==1">
-                                                        <img :src="'//api-fn.duowan.com/'+item.img" :class="item.name | getRarity">{{item.nameCN || item.name}}
+                                                        <img :src="'//api-fn.duowan.com/'+item.img" :class="item.rarity">{{item.nameCN || item.name}}
                                                     </a>
-                                                    <block v-else>
-                                                        <img :src="'//api-fn.duowan.com/'+item.img" :class="item.name | getRarity">{{item.nameCN || item.name}}
-                                                    </block>
+                                                    <template v-else>
+                                                        <img :src="'//api-fn.duowan.com/'+item.img" :class="item.rarity">{{item.nameCN || item.name}}
+                                                    </template>
                                                 </td>
                                                 <td>{{item.amount}}</td>
                                                 <td>{{item.chance}}</td>
@@ -70,6 +70,7 @@
     <script src="lib/mod.js"></script>
     <script src="//pub.dwstatic.com/zt2018/qjjx05/js/vue.js"></script>
     <script>
+        // var lootNavCn = require('modules/data/lootNavCn')
         require('modules/page/loot');
     </script>
 </body>

+ 47 - 0
web/1807-工具页面/src/modules/data/lootNavCn.js

@@ -0,0 +1,47 @@
+var lootNavCn = {
+  "light-ammo-1x": "轻型子弹", 
+  "light-ammo-7x": "轻型子弹", 
+  "high-consumables-1x": "消耗品", 
+  "heavy-ammo-2x": "重型子弹", 
+  "traps-3x": "陷阱", 
+  "high-consumables-3x": "消耗品", 
+  "resources-1x": "物资", 
+  "rockets-ammo-1x": "火箭弹", 
+  "shells-ammo-2x": "铅弹", 
+  "revolver-1x": "左轮手枪", 
+  "hand-cannon-1x": "加农手枪", 
+  "sniper-1x": "狙击枪", 
+  "wood-1x": "木材", 
+  "stone-1x": "石材", 
+  "dual-pistol-1x": "双枪", 
+  "light-ammo-5x": "轻型子弹", 
+  "assault-auto-1x": "全自动突击步枪", 
+  "assault-1x": "突击步枪", 
+  "metal-1x": "金属", 
+  "shells-ammo-10x": "铅弹", 
+  "heavy-ammo-1x": "重型子弹", 
+  "medium-ammo-1x": "中型子弹", 
+  "slug-shotgun-1x": "重型霰弹枪", 
+  "shotgun-1x": "霰弹枪", 
+  "heavy-ammo-10x": "重型子弹", 
+  "medium-ammo-2x": "中型子弹", 
+  "resources-2x": "物资", 
+  "medium-revolver-ammo-1x": "中型子弹", 
+  "high-consumables-2x": "消耗品", 
+  "shells-ammo-1x": "铅弹", 
+  "smg-1x": "冲锋枪", 
+  "consumables-1x": "消耗品", 
+  "ammo-1x": "子弹", 
+  "suppressed-handgun-1x": "消音手枪", 
+  "rockets-ammo-2x": "火箭弹", 
+  "empty-1x": "空旷无物", 
+  "medium-ammo-10x": "中型子弹", 
+  "light-ammo-10x": "轻型子弹", 
+  "lmg-1x": "机关枪", 
+  "traps-1x": "陷阱", 
+  "rocket-1x": "火箭弹", 
+  "pump-shotgun-1x": "泵动式霰弹枪", 
+  "handgun-1x": "手枪"
+}
+
+module.exports = lootNavCn

+ 37 - 0
web/1807-工具页面/src/modules/page/arsenal.js

@@ -34,6 +34,43 @@ var app = new Vue({
     };
   },
   methods: {
+    //武器排序
+    sortWeapons(key,e){
+      let $btn = $(e.target),x=-1
+
+      $btn.siblings().removeClass("sort-up").removeClass("sort-down")
+      if($btn.hasClass("sort-down")) {
+        x=-1
+        $btn.removeClass("sort-down").addClass("sort-up")
+      } else {
+        x=1
+        $btn.removeClass("sort-up").addClass("sort-down")
+      }
+
+      this.weapons = _.sortBy(this.weapons,function(item){
+        switch(key) {
+          case "dps" :
+              return item[key] * x
+              break;
+          case "damage" :
+              return item['quick-information'][key] * x
+              break;
+          case "fire-rate" :
+              return item['quick-information'][key] * x
+              break;
+          case "magazine-size" :
+              return item['quick-information'][key] * x
+              break;
+          case "reload-time" :
+              return item['quick-information'][key].replace(/[a-z]/g,"") * x
+              break;
+          case "vertical" :
+              return item['recoil'][key] * x
+              break;
+        }
+      });
+    },
+    //处理武器类型
     handleWeaponstype(list){
       let weaponsType = {}
 

+ 17 - 9
web/1807-工具页面/src/modules/page/challenges.js

@@ -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,

+ 2 - 1
web/1807-工具页面/src/modules/page/loot.js

@@ -11,7 +11,8 @@ var app = new Vue({
     return {
       loots : [],
       curLoot : {}, //详情页
-      curLootList : []
+      curLootList : [],
+      lootNavCn : lootNavCn
     };
   },
   methods: {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 166 - 1180
web/1807-工具页面/src/sass/global.scss


+ 0 - 1
web/1807-工具页面/src/store.html

@@ -81,7 +81,6 @@
     <script src="lib/mod.js"></script>
     <script src="//pub.dwstatic.com/zt2018/qjjx05/js/vue.js"></script>
     <script>
-        var storeInfo = require('modules/data/storeInfo.js');
         require('modules/page/store');
     </script>
 </body>

+ 1 - 1
web/1807-工具页面/src/task.html

@@ -154,7 +154,7 @@
     <script src="lib/mod.js"></script>
     <script src="//pub.dwstatic.com/zt2018/qjjx05/js/vue.js"></script>
     <script>
-        var taskInfo = require('modules/data/taskInfo.js');
+        // var taskInfo = require('modules/data/taskInfo.js');
         require('modules/page/task');
     </script>
 </body>

+ 1 - 1
web/1807-工具页面/src/taskDetail.html

@@ -98,7 +98,7 @@
     <script src="lib/mod.js"></script>
     <script src="//pub.dwstatic.com/zt2018/qjjx05/js/vue.js"></script>
     <script>
-        var taskInfo = require('modules/data/taskInfo.js');
+        // var taskInfo = require('modules/data/taskInfo.js');
         require('modules/page/task');
     </script>
 </body>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio