chooseRoom.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. <u-cell-group v-if="!$isEmpty(room_list)">
  19. <u-cell-item @click="jump(item)" v-for="(item, index) in room_list" :key="index" :title="item.name" :arrow="false"></u-cell-item>
  20. </u-cell-group>
  21. <u-empty marginTop="200" icon-size="260" v-if="$isEmpty(room_list)" text="暂无房间信息" src="http://139.9.103.171:1888/miniofile/xlyq/empty/empty.png"></u-empty>
  22. <u-back-top :scroll-top="scrollTop"></u-back-top>
  23. </view>
  24. </template>
  25. <script>
  26. var app = getApp();
  27. export default {
  28. data() {
  29. return {
  30. city_county_name:"",
  31. //房间号
  32. room_list: null,
  33. //小区名字
  34. residential_name: null,
  35. //楼栋名字
  36. building_name:null,
  37. //楼栋id
  38. building_id:null,
  39. //单元名字
  40. unit_name: null ,
  41. loading:true,
  42. scrollTop:0
  43. };
  44. },
  45. onPageScroll(e) {
  46. this.scrollTop = e.scrollTop;
  47. },
  48. /**
  49. * 生命周期函数--监听页面加载
  50. */
  51. onLoad: function (options) {
  52. this.city_county_name=uni.getStorageSync("cityCountyName")
  53. //小区名字
  54. this.residential_name = options.residential_name;
  55. //楼栋名字
  56. this.building_name=options.building_name
  57. //楼栋id
  58. this.building_id=options.building_id
  59. //单元名字
  60. this.unit_name = options.unit_name;
  61. //单元id
  62. var unit_id = options.unit_id;
  63. this.getRoom(unit_id);
  64. },
  65. methods: {
  66. change(){
  67. uni.navigateBack({
  68. delta:1
  69. })
  70. },
  71. jump(item){
  72. let params={
  73. residential_name:this.residential_name,
  74. building_name:this.building_name,
  75. building_id:this.building_id,
  76. unit_name:this.unit_name,
  77. room_name:item.name,
  78. room_id:item.id
  79. }
  80. uni.redirectTo({
  81. url:'../../auth/auth'+this.$u.queryParams(params)
  82. })
  83. },
  84. //根据楼栋信息查询房间
  85. getRoom: function (unit_id) {
  86. uni.showLoading({
  87. title:'加载中..'
  88. })
  89. let that = this;
  90. let params = {};
  91. params['unit_id'] = unit_id;
  92. let operation = 'estate/getByUnitId';
  93. app.globalData.postRequest(params, operation, function (res) {
  94. //获取成功
  95. if (res.data.result_code == 1) {
  96. that.setData({
  97. room_list: res.data.list
  98. });
  99. } else {
  100. app.globalData.oneFailHint(res.data.result_msg);
  101. }
  102. uni.hideLoading()
  103. });
  104. }
  105. }
  106. };
  107. </script>
  108. <style>
  109. /* pages/choosePlot/chooseUnit/chooseUnit.wxss */
  110. page{
  111. overflow-y: scroll
  112. }
  113. .nav_section {
  114. width: 100%;
  115. background:#fff;
  116. }
  117. .nav_section_items {
  118. display: flex;
  119. flex-direction: row;
  120. justify-content: space-between;
  121. padding: 30rpx;
  122. border-bottom: 2rpx solid #ddd;
  123. position: relative;
  124. }
  125. .nav_section_items:active {
  126. background: #ddd;
  127. }
  128. .nav_section_items .section_cont view {
  129. overflow: hidden;
  130. text-overflow: ellipsis;
  131. white-space: nowrap;
  132. display: block;
  133. }
  134. .nav_section_items .section_cont .section_cont_sub {
  135. font-size: 30rpx;
  136. line-height: 50rpx;
  137. color: #000;
  138. margin-bottom: 10rpx;
  139. }
  140. .section_cont_tel .info{
  141. width: 500rpx;
  142. overflow: hidden;
  143. white-space: nowrap;
  144. text-overflow: ellipsis;
  145. display: inline-block;
  146. }
  147. .empty-wrap{ background-color: #FFFFFF; min-height: 100vh;}
  148. </style>