index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <view class="list" v-for="(item,index) in list" :key="index">
  6. <view class="other">
  7. <view class="other_1">
  8. <text>磁盘名称:</text>
  9. <text>{{item.mounted}}</text>
  10. </view>
  11. <view class="other_1">
  12. <text>磁盘所占空间:</text>
  13. <text>{{item.capacity}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="two">
  19. <button type="default" size="mini" @click="toCommon('pages/dir/index')">进入目录</button>
  20. </view>
  21. </view>
  22. </mobile-frame>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. list: []
  29. };
  30. },
  31. onShow: function() {
  32. const that = this;
  33. that.searc();
  34. },
  35. methods: {
  36. async searc() {
  37. const that = this;
  38. let res = await that.$api(`/diskInfo`, 'GET');
  39. if (res.errcode == '0') {
  40. that.$set(that, `list`, res.data)
  41. }
  42. },
  43. toCommon(e) {
  44. uni.navigateTo({
  45. url: `/${e}`
  46. })
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .main {
  53. padding: 2vw 0;
  54. .one {
  55. padding: 0 2vw;
  56. margin: 0 0 2vw 0;
  57. .list {
  58. border: 1px solid var(--ff0Color);
  59. padding: 2vw;
  60. margin: 0 0 2vw 0;
  61. border-radius: 5px;
  62. .other {
  63. margin: 0 0 2vw 0;
  64. .other_1 {
  65. margin: 0 0 1vw 0;
  66. font-size: var(--font16Size);
  67. color: var(--f85Color);
  68. text:last-child {
  69. color: var(--f00Color);
  70. font-weight: bold;
  71. }
  72. }
  73. }
  74. }
  75. }
  76. .two {
  77. padding: 0 2vw;
  78. text-align: center;
  79. button {
  80. margin: 0 2vw;
  81. background-color: var(--f35BColor);
  82. color: var(--fffColor);
  83. }
  84. }
  85. }
  86. </style>