odf_new/odf-uniapp/pages/region/index.vue
zpc 7e260a1d57 feat(odf-uniapp): Refactor global background styling to use centralized page background
- Replace individual page background images with global page background in App.vue
- Update pages.json global styles to use transparent colors for navigation and backgrounds
- Remove redundant bg-image elements and styles from all page components
- Set global page background with login_bg.png image, cover sizing, and fixed attachment
- Simplify individual page styling by removing duplicate background color declarations
- Consolidate background management to single source of truth in App.vue for consistent theming
2026-04-04 00:20:24 +08:00

124 lines
2.3 KiB
Vue

<template>
<view class="region-page">
<view class="content">
<!-- 顶部导航栏 -->
<view class="nav-bar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="nav-bar-inner">
<image
class="nav-icon"
src="/static/images/ic_back.png"
mode="aspectFit"
@click="goBack"
/>
<text class="nav-title">地区列表</text>
<view class="nav-icon-placeholder" />
</view>
</view>
<!-- 地区列表 -->
<scroll-view class="region-list" scroll-y>
<view
class="region-card"
v-for="item in regionList"
:key="item.deptId"
@click="goRoom(item)"
>
<text class="region-name">{{ item.deptName }}</text>
</view>
</scroll-view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getRegionList } from '@/services/machine'
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0
const regionList = ref([])
async function loadRegionList(deptId) {
const res = await getRegionList(deptId)
if (res.code === 200) {
regionList.value = res.data || []
}
}
function goBack() {
uni.navigateBack()
}
function goRoom(item) {
uni.navigateTo({ url: '/pages/room/index?deptId=' + item.deptId })
}
onLoad((options) => {
if (options.deptId) {
loadRegionList(options.deptId)
}
})
</script>
<style scoped>
.region-page {
position: relative;
min-height: 100vh;
background-color: transparent;
}
.content {
position: relative;
z-index: 1;
}
.nav-bar {
width: 100%;
}
.nav-bar-inner {
display: flex;
align-items: center;
justify-content: space-between;
height: 88rpx;
padding: 0 24rpx;
}
.nav-icon {
width: 44rpx;
height: 44rpx;
}
.nav-icon-placeholder {
width: 44rpx;
height: 44rpx;
}
.nav-title {
font-size: 34rpx;
font-weight: 600;
color: #fff;
}
.region-list {
padding: 16rpx 24rpx;
height: calc(100vh - 300rpx);
}
.region-card {
display: flex;
align-items: center;
padding: 32rpx 24rpx;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 12rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.region-name {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
</style>