displayCell.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="label">
  5. 基本信息
  6. </view>
  7. <view class="content">
  8. 仅显示已填信息<text style="padding: 0 2.5px;" /> <u-switch activeColor="#C40C24" v-model="unShowAll" />
  9. </view>
  10. </view>
  11. <view style="padding-left: 10px;background-color: #fff;" v-for="item in showList" :key="item.key"
  12. hover-class="navigator-hover" @click="onClick(item)">
  13. <view class="item" v-if="!unShowAll || detail[item.key] || item.value">
  14. <view class="content">
  15. <view class="label">
  16. {{ item.label }}:
  17. </view>
  18. <view class="value">
  19. {{ detail[item.key] || item.value || '--' }}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. props: {
  29. showList: {
  30. type: Array
  31. },
  32. detail: {
  33. type: Object
  34. }
  35. },
  36. data() {
  37. return {
  38. unShowAll: false,
  39. }
  40. },
  41. methods: {
  42. onClick(item) {
  43. if (!item.funName) return;
  44. switch (item.funName) {
  45. case 'callPhone':
  46. if (this.detail[item.key] || item.value) this.callPhone(this.detail[item.key] || item.value)
  47. break;
  48. }
  49. }
  50. },
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .head {
  55. display: flex;
  56. align-items: center;
  57. justify-content: space-between;
  58. width: 100vw;
  59. height: 45px;
  60. background: #F7F7F7;
  61. padding: 0 10px;
  62. box-sizing: border-box;
  63. .label {
  64. font-family: PingFang SC, PingFang SC;
  65. font-weight: bold;
  66. font-size: 15px;
  67. color: #333333;
  68. line-height: 22px;
  69. }
  70. .content {
  71. display: flex;
  72. align-items: center;
  73. font-family: PingFang SC, PingFang SC;
  74. font-size: 14px;
  75. color: #999999;
  76. }
  77. }
  78. .item {
  79. width: 100%;
  80. box-sizing: border-box;
  81. border-bottom: 0.5px solid #ddd;
  82. .content {
  83. display: flex;
  84. width: 100%;
  85. padding: 15px 0;
  86. padding-right: 10px;
  87. box-sizing: border-box;
  88. border-bottom: 0.5px solid #F2F2F2;
  89. .label {
  90. width: 100px;
  91. margin-right: 10px;
  92. line-height: 20px;
  93. font-family: Source Han Sans SC, Source Han Sans SC;
  94. font-size: 14px;
  95. color: #666666;
  96. flex-shrink: 0;
  97. }
  98. .value {
  99. flex: 1;
  100. line-height: 20px;
  101. font-family: Source Han Sans SC, Source Han Sans SC;
  102. font-size: 14px;
  103. color: #333333;
  104. }
  105. }
  106. .content:last-child {
  107. border-bottom: 0;
  108. }
  109. }
  110. </style>