power.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view>
  3. <view class="user" v-for="item in powers" :key="item.code">
  4. <text class="title">{{item.name}}</text>
  5. <view class="content">
  6. <text>标识:{{item.flag}}</text>
  7. <text>类型:{{item.type}}</text>
  8. <text>描述:{{item.description}}</text>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. powers: [],
  18. }
  19. },
  20. onLoad() {
  21. uni.request({
  22. url: 'http://127.0.0.1:9999/power/list',
  23. method: 'GET',
  24. data: {},
  25. success: res => {
  26. this.powers = res.data.data.powers;
  27. console.log(res.data.data.powers);
  28. },
  29. })
  30. },
  31. methods: {
  32. }
  33. }
  34. </script>
  35. <style>
  36. .anniu {
  37. width: 116rpx;
  38. height: 116rpx;
  39. float: right;
  40. margin-top: 10rpx;
  41. margin-right: 4rpx;
  42. }
  43. .user {
  44. width: 702rpx;
  45. height: 280rpx;
  46. background-color: white;
  47. margin-top: 30rpx;
  48. margin-left: 24rpx;
  49. border-radius: 10rpx;
  50. padding-top: 30rpx;
  51. }
  52. .content {
  53. display: flex;
  54. flex-direction: column;
  55. margin-top: 30rpx;
  56. margin-left: 30rpx;
  57. line-height: 55rpx;
  58. font-size: 28rpx;
  59. color: #444546;
  60. }
  61. .title {
  62. font-size: 36rpx;
  63. margin-left: 30rpx;
  64. color: #282828;
  65. font-weight: 600;
  66. }
  67. </style>