| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <template>
- <view class="container">
- <!-- 分段器区域 -->
- <view class="segmented">
- <uni-segmented-control :current="activeCurrent" :values="headerList" style-type="text" active-color="#096562" @clickItem="onClickItem" />
- </view>
- <!-- 列表区域 -->
- <scroll-view class="body" scroll-y @scrolltolower="handlePull">
- <!-- 每一个盒子区域 -->
- <view class="box" v-for="item in list" :key="item.id">
- <!-- 头部区域 -->
- <view class="box_top">
- <img mode="aspectFill" src="../../static/my/hotel.png" />
- <view class="top_name">{{ item.name }}</view>
- <view class="box_type">{{ item.type }}</view>
- </view>
- <!-- 房间信息区域 -->
- <view class="box_center">
- <img mode="aspectFill" :src="item.imgUrl" />
- <view class="center_info">
- <view>{{ item.count }}间,{{ item.roomType }}</view>
- <view>{{ item.time }}</view>
- <view>总价:¥{{ item.total }}</view>
- </view>
- </view>
- <!-- 按钮区域 -->
- <view class="box_btn">
- <view class="btn_eva">去评价</view>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 分段器当前激活索引
- activeCurrent: 0,
- // 分段器数组
- headerList: ['待评价', '已评价'],
- // 列表数据
- list: [
- {
- id: 1,
- name: '民宿名称',
- type: '已消费',
- imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
- count: 1,
- roomType: '大床房',
- time: '2023-07-26 - 2023-07-27',
- total: 229
- },
- {
- id: 2,
- name: '开心民宿',
- type: '已消费',
- imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
- count: 2,
- roomType: '双人房',
- time: '2023-07-27 - 2023-07-27',
- total: 299
- },
- {
- id: 3,
- name: '开心民宿',
- type: '已消费',
- imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
- count: 2,
- roomType: '双人房',
- time: '2023-07-27 - 2023-07-27',
- total: 299
- },
- {
- id: 4,
- name: '开心民宿',
- type: '已消费',
- imgUrl: 'https://img1.baidu.com/it/u=4085584268,3308739054&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375',
- count: 2,
- roomType: '双人房',
- time: '2023-07-27 - 2023-07-27',
- total: 299
- }
- ]
- }
- },
- methods: {
- // 切换分段器回调
- onClickItem(e) {
- if (this.current !== e.currentIndex) {
- this.current = e.currentIndex
- }
- },
- // 列表下拉到底部回调
- handlePull() {
- console.log(111)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- height: 100vh;
- background-color: #f2f3f5;
- overflow: hidden;
- .segmented {
- box-sizing: border-box;
- padding-bottom: 28rpx;
- height: 100rpx;
- background-color: #fff;
- }
- .body {
- box-sizing: border-box;
- padding: 20rpx 0;
- height: calc(100vh - 100rpx);
- overflow-y: auto;
- .box {
- padding: 0 20rpx;
- margin-bottom: 20rpx;
- height: 341rpx;
- background-color: #fff;
- .box_top {
- display: flex;
- align-items: center;
- height: 94rpx;
- img {
- width: 47rpx;
- height: 47rpx;
- border-radius: 50%;
- }
- .top_name {
- margin-left: 18rpx;
- font-size: 32rpx;
- font-weight: bold;
- }
- .box_type {
- margin-left: auto;
- color: #808080;
- font-size: 28rpx;
- }
- }
- .box_center {
- display: flex;
- img {
- width: 100rpx;
- height: 100rpx;
- border-radius: 10rpx;
- }
- .center_info {
- margin-top: -5rpx;
- margin-left: 18rpx;
- color: #808080;
- font-size: 28rpx;
- }
- }
- .box_btn {
- display: flex;
- justify-content: flex-end;
- margin-top: 35rpx;
- .btn_eva {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-left: 20rpx;
- width: 178rpx;
- height: 68rpx;
- color: #808080;
- font-size: 28rpx;
- border-radius: 64rpx;
- border: 1rpx solid #808080;
- }
- }
- }
- }
- }
- </style>
|