123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
- <c-nav-bar title="房型列表" :showIcon="true" :titleStyle="titleStyle"></c-nav-bar>
- <!-- 房型数量 -->
- <view class="typeNum">
- <text style="font-size: 24rpx; color: #777;">共{{roomType.length}}个房型</text>
- </view>
- <!-- 房型选择 -->
- <view class="type" v-for="item in roomType" :key="item.houseBaseId" @click="goEditTypeInfo(item.houseBaseId)">
- <view class="top">
- <text style="font-size: 30rpx; color: #333;">{{item.name}}</text>
- <u-icon name="arrow-right"></u-icon>
- </view>
- <view class="under">
- <text style="font-size: 24rpx; color: #777;">{{item.shortName}}</text>
- <text style="font-size: 24rpx; color: #777;">{{item.roomCount}}间</text>
- </view>
- </view>
- <!-- 新增按钮 -->
- <view class="btn-btn" @click="addType(id)">
- <view class="btn">
- 新增
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- homestayId: uni.getStorageSync('homestayId') || 0,
- roomType: []
- }
- },
- onLoad() {
- // console.log(this.homestayId)
- this.getHomestayId()
- },
- methods: {
- // 获取房型列表信息
- getHomestayId() {
- this.$api.get(`/merchant/hotel/mine/getHouseBaseList/${this.homestayId}`, {
- homestayId: this.homestayId
- }).then((res) => {
- // console.log(res)
- this.roomType = res.data.data
- // let roomSymbleName=this.roomType.name
- // console.log(roomSymbleName)
- // console.log(this.roomType)
- })
- },
- // 新增房型
- addType(id) {
- uni.navigateTo({
- url: `/pages/my/houseList?id=${this.homestayId}`
- })
- },
- // 修改房型信息
- goEditTypeInfo(houseBaseId) {
- uni.navigateTo({
- url: `/pages/my/houseList?houseBaseId=${houseBaseId}`
- })
- console.log(houseBaseId)
- }
- }
- }
- </script>
- <style lang="scss">
- .page {
- background: #F3F4F4;
- padding-bottom: 260rpx;
- box-sizing: border-box;
- overflow-y: auto;
- overflow-x: auto;
- }
- .typeNum {
- width: 100%;
- height: 73rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .type {
- margin: 0 auto;
- border-radius: 10rpx 10rpx 10rpx 10rpx;
- width: 86%;
- height: 155rpx;
- background-color: #fff;
- padding: 30rpx;
- margin-bottom: 20rpx;
- }
- .top {
- display: flex;
- justify-content: space-between;
- }
- .under {
- margin-top: 40rpx;
- display: flex;
- justify-content: space-between;
- }
- .btn-btn {
- width: 100%;
- height: 136rpx;
- background-color: #fff;
- position: fixed;
- bottom: 0;
- padding: 30rpx 0 0;
- // margin: 0 auto;
- z-index: 999999;
- // margin-top: 30rpx;
- // margin-left: 30rpx;
- }
- .btn {
- margin: 0 auto;
- width: 690rpx;
- height: 96rpx;
- background-color: #1372FF;
- color: #fff;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 34rpx;
- border-radius: 48rpx;
- }
- </style>
|