card.vue 3.5 KB

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