selectRoomType.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view class="page-container">
  3. <view class="room-type-item" v-for="item in roomTypeList">
  4. <view class="room-type-item-left">
  5. <u-image :src="item.src" width="200rpx" height="200rpx" radius="10"></u-image>
  6. </view>
  7. <view class="room-type-item-middle">
  8. <view class="room-type-item-middle-text">
  9. <text>{{roomTypeMap.get(item.roomType)}}</text>
  10. </view>
  11. <view class="room-type-item-middle-bottom">
  12. <text>{{item.breakfirst}} </text>
  13. <text>{{item.area}}㎡ </text>
  14. <!-- <text>剩余{{item.remaining}}间</text> -->
  15. </view>
  16. </view>
  17. <view class="room-type-item-right">
  18. <view class="room-type-item-right-text">
  19. <text>¥{{item.price}}</text>
  20. </view>
  21. <u-button text="选房" @click="gotoSelectRoom(item.roomType)"></u-button>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. mapState,
  29. mapMutations
  30. } from 'vuex'
  31. export default {
  32. data() {
  33. return {
  34. roomTypeList: [{
  35. src: '/static/room_type.png',
  36. roomType: 1,
  37. star: 4,
  38. breakfirst: '双早',
  39. area: 10,
  40. remaining: 4,
  41. price: 699,
  42. }, {
  43. src: '/static/room_type.png',
  44. roomType: 2,
  45. star: 4,
  46. breakfirst: '双早',
  47. area: 10,
  48. remaining: 4,
  49. price: 699,
  50. }, {
  51. src: '/static/room_type.png',
  52. roomType: 3,
  53. star: 4,
  54. breakfirst: '双早',
  55. area: 10,
  56. remaining: 4,
  57. price: 699,
  58. }, {
  59. src: '/static/room_type.png',
  60. roomType: 4,
  61. star: 4,
  62. breakfirst: '双早',
  63. area: 10,
  64. remaining: 4,
  65. price: 699,
  66. }],
  67. roomTypeMap: {}
  68. };
  69. },
  70. computed: {
  71. ...mapState('m_business', ['roomType']),
  72. },
  73. methods: {
  74. ...mapMutations('m_business', ['updateRoomType']),
  75. gotoSelectRoom(roomType) {
  76. this.updateRoomType(roomType)
  77. uni.navigateTo({
  78. url: '/subpkg/selectRoom/selectRoom'
  79. });
  80. }
  81. },
  82. created() {
  83. this.roomTypeMap = new Map();
  84. this.roomTypeMap.set(1, "豪华大床房");
  85. this.roomTypeMap.set(2, "商务标间");
  86. this.roomTypeMap.set(3, "行政套房");
  87. this.roomTypeMap.set(4, "特价房");
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. .page-container {
  93. background-color: #F5F5F5;
  94. .room-type-item {
  95. border-radius: 30rpx;
  96. background-color: #FFFFFF;
  97. margin: 20rpx 20rpx;
  98. padding: 40rpx 20rpx;
  99. display: flex;
  100. .room-type-item-middle {
  101. margin-left: 30rpx;
  102. display: flex;
  103. flex-direction: column;
  104. width: 200rpx;
  105. .room-type-item-middle-text {
  106. font-size: 40rpx;
  107. font-weight: bold;
  108. color: #333333;
  109. }
  110. .room-type-item-middle-bottom {
  111. margin-top: 40rpx;
  112. font-size: 25rpx;
  113. text {
  114. margin-right: 20rpx;
  115. color: #666666
  116. }
  117. }
  118. }
  119. .room-type-item-right {
  120. width: 25%;
  121. margin-left: 20rpx;
  122. .room-type-item-right-text {
  123. margin-top: 30rpx;
  124. margin-bottom: 20rpx;
  125. }
  126. text {
  127. font-size: 40rpx;
  128. font-weight: bold;
  129. color: #FF5C58
  130. }
  131. button {
  132. background-color: #F69B49;
  133. height: 60rpx;
  134. width: 100%;
  135. text {
  136. color: white
  137. }
  138. }
  139. }
  140. }
  141. }
  142. </style>