list.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view>
  3. <My_listbox ref="List" :pullDown="false" :empty='empty'>
  4. <navigator v-for="item in list" :key="item.w_deviceid" class="item"
  5. :url="'/pages/facility/detail?id=' + item.w_deviceid">
  6. <view class="name u-line-1">设备:{{ item.devicename || ' --' }}</view>
  7. <view class="row u-line-1">产品名称:<text>{{ item.prodname || ' --' }}</text></view>
  8. <view class="row u-line-1">设备编号:<text>{{ item.serialnumber || ' --' }}</text></view>
  9. <view class="row u-line-1">设备地址:<text>{{ (item.province + item.city + item.county + item.address) || ' --'
  10. }}</text>
  11. </view>
  12. <view class="status" :style="{ background: item.bgColor }">{{ item.status }}</view>
  13. </navigator>
  14. <view style="height: 20px;" />
  15. </My_listbox>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. list: Array,
  22. empty: Boolean
  23. },
  24. name: "list",
  25. data() {
  26. return {
  27. uninitialized: true
  28. }
  29. },
  30. methods: {
  31. init() {
  32. this.uninitialized = false;
  33. this.$refs.List.setHeight();
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .item {
  40. position: relative;
  41. width: 355px;
  42. background: #FFFFFF;
  43. border-radius: 4px;
  44. margin: 5px auto;
  45. margin-bottom: 10px;
  46. padding: 10px;
  47. box-sizing: border-box;
  48. overflow: hidden;
  49. .name {
  50. width: 300px;
  51. line-height: 21px;
  52. font-size: 15px;
  53. font-family: PingFang SC-Medium, PingFang SC;
  54. font-weight: bold;
  55. color: #333333;
  56. margin-bottom: 10px;
  57. }
  58. .row {
  59. line-height: 17px;
  60. font-size: 12px;
  61. color: #666666;
  62. margin-bottom: 5px;
  63. text {
  64. line-height: 17px;
  65. font-size: 12px;
  66. color: #0A3971;
  67. }
  68. }
  69. .status {
  70. position: absolute;
  71. right: 0;
  72. top: 0;
  73. border-radius: 0px 4px 0px 4px;
  74. background: red;
  75. text-align: center;
  76. line-height: 24px;
  77. padding: 0 10px;
  78. font-size: 12px;
  79. font-family: PingFang SC-Regular, PingFang SC;
  80. color: #FFFFFF;
  81. }
  82. }
  83. </style>