| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <template>
- <view class="container">
- <view class="gap"></view>
- <view class="body">
- <!-- 左边区域 -->
- <view class="left">
- <view class="left_item" :class="{ active: active_left === index }" v-for="(item, index) in leftList" :key="index" @click="handleChange(index)">
- {{ item }}
- </view>
- </view>
- <!-- 右边区域 -->
- <view class="right">
- <view class="right_item" :class="{ active: active_right === index }" v-for="(item, index) in rightList" :key="index" @click="handleChange2(index)">
- {{ item }}
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- active_left: 0,
- active_right: 0,
- leftList: ['其他', '水电'],
- rightList: ['下水道', '安全指示牌', '消费应急灯', '排水管道', '吊顶', '风扇', '没电']
- }
- },
- methods: {
- handleChange(index) {
- this.active_left = index
- },
- handleChange2(index) {
- this.active_right = index
- uni.navigateBack(1)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- width: 100vw;
- height: 100vh;
- .gap {
- height: 10rpx;
- background-color: #f2f2f2;
- }
- .body {
- display: flex;
- height: calc(100vh - 10rpx);
- .left {
- box-sizing: border-box;
- padding: 15rpx;
- width: 198rpx;
- border-right: 1rpx solid #ccc;
- overflow-y: auto;
- .left_item {
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- font-size: 28rpx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .active {
- color: #6fb6b8;
- }
- }
- .right {
- box-sizing: border-box;
- padding: 30rpx 40rpx;
- width: 552rpx;
- overflow-y: auto;
- .right_item {
- float: left;
- box-sizing: border-box;
- padding: 10rpx 30rpx;
- margin: 0 32rpx 37rpx 0;
- height: 50rpx;
- line-height: 30rpx;
- text-align: center;
- color: #808080;
- font-size: 28rpx;
- border-radius: 53rpx;
- background-color: #e6e6e6;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .active {
- color: #fff;
- background-color: #6fb6b8;
- }
- }
- }
- }
- </style>
|