card.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="">
  3. <view class="data" v-for="(item, index) in list" :key="index">
  4. <view class="top">
  5. <view class="left">
  6. <view class="title">
  7. <u-icon name="fangjian" custom-prefix="custom-icon" size="30" color="#50baca"></u-icon>
  8. <text class="padding-left-20">房间名称:{{item.name}}</text>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="item">
  13. <view class="left">
  14. <view style="padding: 0 30rpx;">
  15. <!-- <view class="content flex">
  16. <u-icon name="menpaihao" custom-prefix="custom-icon" size="30" color="#fdb524"></u-icon>
  17. <text class="text-bold padding-left-10">门牌号:</text>
  18. <text>{{item.houseNumber}}</text>
  19. </view> -->
  20. <view class="content flex">
  21. <u-icon name="xiaoqu" custom-prefix="custom-icon" size="30" color="#2fc500"></u-icon>
  22. <text class="text-bold padding-left-10">所属小区:</text>
  23. <text v-text="item.residentialName?item.residentialName:'未知'"></text>
  24. </view>
  25. <view class="content flex">
  26. <u-icon name="zhuhuzongshu" custom-prefix="custom-icon" size="30" color="#d4237a"></u-icon>
  27. <text class="text-bold padding-left-10">所属楼栋:</text>
  28. <text v-text="item.buildingName" ></text>
  29. </view>
  30. <view class="content flex">
  31. <u-icon name="danyuan" custom-prefix="custom-icon" size="30" color="#5ca8f0"></u-icon>
  32. <text class="text-bold padding-left-10">所属单元:</text>
  33. <text v-text="item.unitName?item.unitName:'未知'" ></text>
  34. </view>
  35. <!-- <view class="content flex">
  36. <u-icon name="zhuhuzongshu" custom-prefix="custom-icon" size="30" color="#d4237a"></u-icon>
  37. <text class="text-bold padding-left-10">住户总数:</text>
  38. <text class="text-bold" v-text="item.userNumber" ></text>
  39. </view> -->
  40. </view>
  41. </view>
  42. </view>
  43. <view class="bottom flex" >
  44. <view @click.stop="edit(item)" class="cu-btn sm round line-blue" style="margin: 0 10rpx;">
  45. 修改房间
  46. </view>
  47. <!-- <view @click.stop="delItem(item)" class="cu-btn sm round bg-red" style="margin: 0 10rpx;">
  48. 删除房间
  49. </view> -->
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. name: 'card',
  57. props:{
  58. list:{
  59. type:Array,
  60. default:()=>{
  61. []
  62. }
  63. }
  64. },
  65. data() {
  66. return {
  67. loading:false
  68. };
  69. },
  70. created() {
  71. },
  72. methods:{
  73. copy(data){
  74. uni.setClipboardData({
  75. data:data
  76. })
  77. },
  78. goDetail(item){
  79. uni.navigateTo({
  80. url:"/pages/room/detail?id="+item.id
  81. })
  82. },
  83. edit(item){
  84. uni.navigateTo({
  85. url:"/pages/room/add?id="+item.id
  86. })
  87. },
  88. delItem(item){
  89. this.$emit('delItem',item)
  90. }
  91. }
  92. };
  93. </script>
  94. <style lang="scss">
  95. .data {
  96. background-color: #ffffff;
  97. margin: 10rpx ;
  98. border-radius: 6rpx;
  99. box-sizing: border-box;
  100. padding: 20rpx 10rpx;
  101. font-size: 28rpx;
  102. .top {
  103. display: flex;
  104. justify-content: space-between;
  105. padding-bottom: 20rpx;
  106. border-bottom: 1rpx solid #dedede;
  107. .left {
  108. display: flex;
  109. align-items: center;
  110. .title {
  111. margin: 0 10rpx;
  112. font-size: 30rpx;
  113. }
  114. }
  115. .right{
  116. margin-right: 10rpx;
  117. }
  118. }
  119. .item {
  120. margin: 5rpx 0 20rpx 0;
  121. .content {
  122. border-bottom: 1rpx dashed #DDDDDD;
  123. padding: 30rpx 0;
  124. }
  125. }
  126. .bottom {
  127. display: flex;
  128. margin-top: 30rpx;
  129. justify-content: flex-end;
  130. align-items: center;
  131. }
  132. }
  133. </style>