roomType.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="房型列表" :showIcon="true" :titleStyle="titleStyle"></c-nav-bar>
  4. <!-- 房型数量 -->
  5. <view class="typeNum">
  6. <text style="font-size: 24rpx; color: #777;">共{{roomType.length}}个房型</text>
  7. </view>
  8. <!-- 房型选择 -->
  9. <view class="type" v-for="item in roomType" :key="item.houseBaseId" @click="goEditTypeInfo(item.houseBaseId)">
  10. <view class="top">
  11. <text style="font-size: 30rpx; color: #333;">{{item.name}}</text>
  12. <u-icon name="arrow-right"></u-icon>
  13. </view>
  14. <view class="under">
  15. <text style="font-size: 24rpx; color: #777;">{{item.shortName}}</text>
  16. <text style="font-size: 24rpx; color: #777;">{{item.roomCount}}间</text>
  17. </view>
  18. </view>
  19. <!-- 新增按钮 -->
  20. <view class="btn-btn" @click="addType(id)">
  21. <view class="btn">
  22. 新增
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. homestayId: uni.getStorageSync('homestayId') || 0,
  32. roomType: []
  33. }
  34. },
  35. onLoad() {
  36. // console.log(this.homestayId)
  37. this.getHomestayId()
  38. },
  39. methods: {
  40. // 获取房型列表信息
  41. getHomestayId() {
  42. this.$api.get(`/merchant/hotel/mine/getHouseBaseList/${this.homestayId}`, {
  43. homestayId: this.homestayId
  44. }).then((res) => {
  45. // console.log(res)
  46. this.roomType = res.data.data
  47. // let roomSymbleName=this.roomType.name
  48. // console.log(roomSymbleName)
  49. // console.log(this.roomType)
  50. })
  51. },
  52. // 新增房型
  53. addType(id) {
  54. uni.navigateTo({
  55. url: `/pages/my/houseList?id=${this.homestayId}`
  56. })
  57. },
  58. // 修改房型信息
  59. goEditTypeInfo(houseBaseId) {
  60. uni.navigateTo({
  61. url: `/pages/my/houseList?houseBaseId=${houseBaseId}`
  62. })
  63. console.log(houseBaseId)
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .page {
  70. background: #F3F4F4;
  71. padding-bottom: 260rpx;
  72. box-sizing: border-box;
  73. overflow-y: auto;
  74. overflow-x: auto;
  75. }
  76. .typeNum {
  77. width: 100%;
  78. height: 73rpx;
  79. display: flex;
  80. justify-content: center;
  81. align-items: center;
  82. }
  83. .type {
  84. margin: 0 auto;
  85. border-radius: 10rpx 10rpx 10rpx 10rpx;
  86. width: 86%;
  87. height: 155rpx;
  88. background-color: #fff;
  89. padding: 30rpx;
  90. margin-bottom: 20rpx;
  91. }
  92. .top {
  93. display: flex;
  94. justify-content: space-between;
  95. }
  96. .under {
  97. margin-top: 40rpx;
  98. display: flex;
  99. justify-content: space-between;
  100. }
  101. .btn-btn {
  102. width: 100%;
  103. height: 136rpx;
  104. background-color: #fff;
  105. position: fixed;
  106. bottom: 0;
  107. padding: 30rpx 0 0;
  108. // margin: 0 auto;
  109. z-index: 999999;
  110. // margin-top: 30rpx;
  111. // margin-left: 30rpx;
  112. }
  113. .btn {
  114. margin: 0 auto;
  115. width: 690rpx;
  116. height: 96rpx;
  117. background-color: #1372FF;
  118. color: #fff;
  119. display: flex;
  120. justify-content: center;
  121. align-items: center;
  122. font-size: 34rpx;
  123. border-radius: 48rpx;
  124. }
  125. </style>