roomType.vue 2.7 KB

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