chooseRoom.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view :class="$isEmpty(room_list)?'empty-wrap':''">
  3. <view class="bg-gray" style="padding: 16rpx 30rpx;">
  4. <text >当前选择楼栋:</text>
  5. </view>
  6. <view class="bg-white" style="padding:30rpx 30rpx 20rpx 30rpx;border-bottom: 1rpx solid #efefef;display: flex;justify-content: space-between;">
  7. <view class="text-blue">
  8. <text class="">{{unit_name}}</text>
  9. </view>
  10. <view class="cu-btn line-blue sm round" @tap="change">
  11. <text class="cuIcon-refresh padding-right-10"></text>
  12. <text>切换楼栋</text>
  13. </view>
  14. </view>
  15. <view class="bg-gray" style="padding: 12rpx 30rpx;">
  16. <text >选择房间:</text>
  17. </view>
  18. <view class="nav_section" v-if="room_list.length>0">
  19. <navigator open-type="redirect" v-for="(item, index) in room_list" :key="index" :url="'../../auth/auth?room_id=' + item.id + '&room_name=' + item.name + '&residential_name=' + residential_name + '&unit_name=' + unit_name">
  20. <view class="nav_section_items">
  21. <view class="section_cont">
  22. <view class="section_cont_tel">
  23. <text class="info">{{item.name}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </navigator>
  28. </view>
  29. <view class="default" v-if="$isEmpty(room_list)">
  30. <image src="/static/empty.png" mode="heightFix"></image>
  31. <view>
  32. <text>没有获取到房间信息</text>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. var app = getApp();
  39. export default {
  40. data() {
  41. return {
  42. city_county_name:"",
  43. //房间号
  44. room_list: null,
  45. //小区名字
  46. residential_name: null,
  47. //楼栋名字
  48. unit_name: null
  49. };
  50. },
  51. components: {},
  52. props: {},
  53. /**
  54. * 生命周期函数--监听页面加载
  55. */
  56. onLoad: function (options) {
  57. this.city_county_name=uni.getStorageSync("cityCountyName")
  58. //小区名字
  59. var residential_name = options.residential_name; //楼栋名字
  60. var unit_name = options.unit_name;
  61. this.setData({
  62. residential_name: residential_name,
  63. unit_name: unit_name
  64. });
  65. var unit_id = options.unit_id;
  66. this.getRoom(unit_id);
  67. },
  68. methods: {
  69. change(){
  70. uni.navigateBack({
  71. delta:1
  72. })
  73. },
  74. //根据楼栋信息查询房间
  75. getRoom: function (unit_id) {
  76. let that = this;
  77. let params = {};
  78. params['unit_id'] = unit_id;
  79. let operation = 'estate/getByUnitId';
  80. app.globalData.postRequest(params, operation, function (res) {
  81. //获取成功
  82. if (res.data.result_code == 1) {
  83. that.setData({
  84. room_list: res.data.list
  85. });
  86. } else {
  87. app.globalData.oneFailHint(res.data.result_msg);
  88. }
  89. });
  90. }
  91. }
  92. };
  93. </script>
  94. <style>
  95. /* pages/choosePlot/chooseUnit/chooseUnit.wxss */
  96. page{
  97. overflow-y: scroll
  98. }
  99. .nav_section {
  100. width: 100%;
  101. background:#fff;
  102. }
  103. .nav_section_items {
  104. display: flex;
  105. flex-direction: row;
  106. justify-content: space-between;
  107. padding: 30rpx;
  108. border-bottom: 2rpx solid #ddd;
  109. position: relative;
  110. }
  111. .nav_section_items:active {
  112. background: #ddd;
  113. }
  114. .nav_section_items .section_cont view {
  115. overflow: hidden;
  116. text-overflow: ellipsis;
  117. white-space: nowrap;
  118. display: block;
  119. }
  120. .nav_section_items .section_cont .section_cont_sub {
  121. font-size: 30rpx;
  122. line-height: 50rpx;
  123. color: #000;
  124. margin-bottom: 10rpx;
  125. }
  126. .section_cont_tel .info{
  127. width: 500rpx;
  128. overflow: hidden;
  129. white-space: nowrap;
  130. text-overflow: ellipsis;
  131. display: inline-block;
  132. }
  133. .default { text-align: center; position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); }
  134. .default text{
  135. color: #AAAAAA;
  136. } .default image { height: 250rpx; display: inline-block; } .empty-wrap{ background-color: #FFFFFF; min-height: 100vh; }
  137. </style>