info.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <style>
  2. </style>
  3. <template>
  4. <div class="equip-info-wrap">
  5. <div class="equip-info-head">
  6. <section class="equip-info-icon">
  7. <img :src="`http://static.lolbox.duowan.com/images/items/${equip.id}.png`" />
  8. </section>
  9. <section class="equip-name-price">
  10. <h3 class="equip-info-name">{{equip.name}}</h3>
  11. <p>
  12. <label class="equip-for-price">
  13. 价格
  14. </label>
  15. <span class="equip-price">
  16. {{equip.gold}}
  17. </span>
  18. </p>
  19. </section>
  20. </div>
  21. <div class="equip-info-describe">
  22. <h3>物品描述</h3>
  23. <ul>
  24. <li v-for="item in equip.description">{{item}}</li>
  25. </ul>
  26. </div>
  27. <div class="equip-info-parts">
  28. <h3>合成所需</h3>
  29. <ul>
  30. <li v-for="item in equip.from">
  31. <img :src="`http://static.lolbox.duowan.com/images/items/${item}_40x40.jpg`" />
  32. </ul>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import Vue from 'vue';
  38. import lib from 'lib';
  39. import BDY from '../../depend/BDY/BDY';
  40. export default {
  41. data () {
  42. return {
  43. equip_id : lib.getLocalData("equip_id"),
  44. equip : {} ,
  45. from :'',
  46. fromImgUrl : []
  47. }
  48. },
  49. mounted () {
  50. this.getData();
  51. },
  52. beforeDestroy () {
  53. },
  54. methods: {
  55. getData(){
  56. let self = this,
  57. url = `${lib.apiUrl}/v2/champion/item/search/?id_list=`;
  58. lib.get(url + self.equip_id,ret => {
  59. if(ret.champion_item_list&&ret.champion_item_list[0]){
  60. self.equip = ret.champion_item_list[0];
  61. self.formatData(self.equip);
  62. }
  63. })
  64. },
  65. formatData(data){
  66. data.description = data.description.split(" ");
  67. }
  68. }
  69. }
  70. </script>