syeminfo.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <style lang="scss" scoped>
  2. .systeminfo {
  3. padding: 0 30rpx 0 30rpx;
  4. background: #fff;
  5. margin-bottom: 20rpx;
  6. .brand {
  7. font-family: DINCondensed-Bold;
  8. height: 300rpx;
  9. font-size: 100rpx;
  10. color: #40a7e7;
  11. display: flex;
  12. flex-direction: row;
  13. justify-content: center;
  14. align-items: center;
  15. &image {
  16. width: 100rpx;
  17. height: 100rpx;
  18. margin-right: 20rpx;
  19. }
  20. &text {
  21. line-height: 1em;
  22. }
  23. }
  24. .item {
  25. display: flex;
  26. flex-direction: column;
  27. justify-content: space-between;
  28. align-items: flex-start;
  29. font-size: 30rpx;
  30. color: #000;
  31. padding: 30rpx 15rpx;
  32. height: 62rpx;
  33. border-top: 1rpx solid #efefef;
  34. .key {
  35. line-height: 1em;
  36. }
  37. .value {
  38. font-size: 24rpx;
  39. line-height: 1em;
  40. color: #777;
  41. }
  42. }
  43. .item:last-child {
  44. border-bottom: none;
  45. }
  46. }
  47. </style>
  48. <template>
  49. <view class='systeminfo'>
  50. <view class='brand'>
  51. <image src='/static/mobile.png'></image>
  52. <text>{{systeminfo.brand}}</text>
  53. </view>
  54. <view class='item' v-for='(item, index) in systeminfoArr' :key='index'>
  55. <view class='key'>{{item.name}}</view>
  56. <view class='value'>{{systeminfo[item.key]}}</view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. mapState
  63. } from "vuex"
  64. export default {
  65. data() {
  66. return {
  67. systeminfoObj: {},
  68. systeminfoArr: [
  69. {
  70. key: 'brand',
  71. name: '手机品牌',
  72. },
  73. {
  74. key: 'model',
  75. name: '手机型号',
  76. },
  77. {
  78. key: 'pixelRatio',
  79. name: '设备像素比',
  80. },
  81. {
  82. key: 'screenWidth',
  83. name: '屏幕宽度',
  84. },
  85. {
  86. key: 'screenHeight',
  87. name: '屏幕高度',
  88. },
  89. {
  90. key: 'windowWidth',
  91. name: '可使用窗口宽度',
  92. },
  93. {
  94. key: 'windowHeight',
  95. name: '可使用窗口高度',
  96. },
  97. {
  98. key: 'statusBarHeight',
  99. name: '状态栏高度',
  100. },
  101. {
  102. key: 'language',
  103. name: '微信设置的语言',
  104. },
  105. {
  106. key: 'version',
  107. name: '微信版本号',
  108. },
  109. {
  110. key: 'system',
  111. name: '操作系统版本',
  112. },
  113. {
  114. key: 'platform',
  115. name: '客户端平台',
  116. },
  117. {
  118. key: 'fontSizeSetting',
  119. name: '用户字体大小设置(px)',
  120. },
  121. {
  122. key: 'SDKVersion',
  123. name: '客户端基础库版本',
  124. }
  125. ]
  126. };
  127. },
  128. computed: {
  129. ...mapState({
  130. systeminfo: state => state.global.systeminfo
  131. })
  132. },
  133. onShow () {
  134. console.log(this.systeminfo)
  135. },
  136. }
  137. </script>