123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <template>
- <view class="page-container">
- <view class="room-type-item" v-for="item in roomTypeList">
- <view class="room-type-item-left">
- <u-image :src="item.roomPicPath" width="200rpx" height="200rpx" radius="10"></u-image>
- </view>
- <view class="room-type-item-middle">
- <view class="room-type-item-middle-text">
- <text>{{item.roomTypeName}}</text>
- </view>
- <view class="room-type-item-middle-bottom">
- <!-- <text>{{item.breakfirst}} </text> -->
- <text>{{item.roomArea}}㎡ </text>
- </view>
- </view>
- <view class="room-type-item-right">
- <view class="room-type-item-right-text">
- <text>¥{{item.unitPrice}}</text>
- </view>
- <u-button text="选房" @click="gotoSelectRoom(item)"></u-button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- IMG_BASE_URL
- } from "../../config.js"
- import {
- mapState,
- mapMutations
- } from 'vuex'
- export default {
- data() {
- return {
- roomTypeList: {},
- roomTypeMap: {},
- };
- },
- computed: {
- ...mapState('m_business', ['currentHotelId', 'reservationInfo']),
- ...mapState('m_user', ['userInfo'])
- },
- methods: {
- ...mapMutations('m_business', ['updateRoomType', 'updateReservationInfo']),
- async gotoSelectRoom(item) {
- let res = await uni.$http.post('/hotelOrder', {
- name: this.userInfo.name,
- phone: this.userInfo.phone,
- hotelId: this.currentHotelId,
- roomType: item.roomType,
- startTime: this.reservationInfo.startTime,
- endTime: this.reservationInfo.endTime
- })
- this.reservationInfo.orderInfo = res.data.data
- this.reservationInfo.price = item.unitPrice
- this.reservationInfo.roomType = item.roomType
- this.reservationInfo.roomTypeName = item.roomTypeName
- this.updateReservationInfo(this.reservationInfo)
- uni.navigateTo({
- url: '/subpkg_checkin/submitOrder/submitOrder'
- });
- },
- async getRoomTypeList() {
- let res = await uni.$http.post('/roomType', {
- hotelId: this.currentHotelId,
- pageNo: 1,
- pageSize: 10
- })
- this.roomTypeList = res.data.data.records
- this.roomTypeList.forEach((item) => {
- item.roomPicPath = IMG_BASE_URL + '/' + item.roomPicPath
- })
- }
- },
- onLoad() {
- this.getRoomTypeList()
- }
- }
- </script>
- <style lang="scss">
- .page-container {
- background-color: #F5F5F5;
- .room-type-item {
- border-radius: 30rpx;
- background-color: #FFFFFF;
- margin: 20rpx 20rpx;
- padding: 40rpx 20rpx;
- display: flex;
- background: #FFFFFF;
- box-shadow: 0rpx 10rpx 6rpx 1rpx rgba(75, 75, 75, 0.1);
- border-radius: 10rpx;
- .room-type-item-middle {
- margin-left: 30rpx;
- display: flex;
- flex-direction: column;
- width: 200rpx;
- .room-type-item-middle-text {
- font-size: 40rpx;
- font-weight: bold;
- color: #333333;
- }
- .room-type-item-middle-bottom {
- margin-top: 40rpx;
- font-size: 25rpx;
- text {
- margin-right: 20rpx;
- color: #666666
- }
- }
- }
- .room-type-item-right {
- width: 25%;
- margin-left: 20rpx;
- .room-type-item-right-text {
- margin-top: 30rpx;
- margin-bottom: 20rpx;
- }
- text {
- font-size: 40rpx;
- font-weight: bold;
- color: #FF5C58
- }
- button {
- background-color: #F69B49;
- height: 60rpx;
- width: 100%;
- text {
- color: white
- }
- }
- }
- }
- }
- </style>
|