对接一键开门 修改首页引导页自适应样式
This commit is contained in:
@@ -100,14 +100,14 @@ onLoad((options) => {
|
||||
repairId.value = options.projectId
|
||||
}
|
||||
|
||||
// ✅ 监听返回选择的项目
|
||||
// 监听返回选择的项目
|
||||
uni.$on('selectRepairProject', (data) => {
|
||||
repairProject.value = `${data.category}-${data.project}`
|
||||
repairId.value = data.projectId
|
||||
})
|
||||
})
|
||||
|
||||
// ✅ 页面卸载时移除监听(必须加)
|
||||
// 页面卸载时移除监听
|
||||
onUnload(() => {
|
||||
uni.$off('selectRepairProject')
|
||||
})
|
||||
@@ -155,7 +155,7 @@ const uploadImages = async () => {
|
||||
uploadedUrls.push(res.url || '')
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title:e.msg || '图片上传失败',
|
||||
title:err.msg || '图片上传失败',
|
||||
icon:'error'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,18 +42,10 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
import {getRepairOrder} from '../../api/api.js'
|
||||
|
||||
// 分类列表
|
||||
const categoryList = ref([
|
||||
// { id: 1, name: '基础设施' },
|
||||
// { id: 2, name: '电子设施' }
|
||||
])
|
||||
const categoryList = ref([])
|
||||
|
||||
// 所有项目数据
|
||||
const projectList = ref([
|
||||
// { id: 101, categoryId: 1, name: '路灯' },
|
||||
// { id: 102, categoryId: 1, name: '楼层指示灯' },
|
||||
// { id: 103, categoryId: 2, name: '应急出口灯' },
|
||||
// { id: 104, categoryId: 1, name: '草坪灯' }
|
||||
])
|
||||
const projectList = ref([])
|
||||
|
||||
// 选中的分类
|
||||
const activeCategory = ref(1)
|
||||
@@ -91,7 +83,7 @@ const fetchProjectList = async () => {
|
||||
activeCategory.value = categoryList.value[0]?.id || 1
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '获取项目列表失败', icon: 'none' })
|
||||
uni.showToast({ title: e.msg ||'获取项目列表失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> -->
|
||||
<image
|
||||
src="https://wuyeadmin.bugtc.com/images/login/phone.png"
|
||||
mode=""
|
||||
mode="aspectFit"
|
||||
style="height: 100%; width: 100%"
|
||||
></image>
|
||||
</view>
|
||||
@@ -31,7 +31,7 @@
|
||||
<view class="input-icon">
|
||||
<image
|
||||
src="https://wuyeadmin.bugtc.com/images/login/code.png"
|
||||
mode=""
|
||||
mode="aspectFit"
|
||||
style="height: 100%; width: 100%"
|
||||
>
|
||||
</image>
|
||||
@@ -269,7 +269,6 @@ onUnmounted(() => {
|
||||
/* 页面容器 */
|
||||
.login-page {
|
||||
padding: 80rpx 40rpx 40rpx;
|
||||
/* background-color: #f8f9fa; */
|
||||
min-height: 100vh;
|
||||
background: repeating-linear-gradient(to bottom, #e2f0ff, #f6faff);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ const noticeList = ref([])
|
||||
|
||||
// 分页相关
|
||||
const pageNum = ref(1) // 当前页
|
||||
const pageSize = ref(5) // 每页条数
|
||||
const pageSize = ref(10) // 每页条数
|
||||
const total = ref(0) // 总条数
|
||||
const loading = ref(false) // 加载状态
|
||||
const noMore = ref(false) // 是否没有更多
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<!-- 页面主容器 -->
|
||||
<view class="door-open-page">
|
||||
<view class="status_bar"></view>
|
||||
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||
<!-- 顶部标题栏 -->
|
||||
<view class="top-bar">
|
||||
<uni-nav-bar left-icon="left" title="远程开门" backgroundColor ="none" :border="false" @clickLeft="narBack" />
|
||||
@@ -59,6 +59,7 @@ import { getOpenDoorList, switchOpenDoor } from '../../api/api.js'
|
||||
// 响应式数据:选中的门索引、开门成功提示
|
||||
const selectedDoor = ref(-1) // -1表示未选中
|
||||
const showSuccess = ref(false)
|
||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||
|
||||
// 门列表数据
|
||||
const doorList = ref([])
|
||||
@@ -130,8 +131,10 @@ const openDoor = () => {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.status_bar {
|
||||
height: 32px;
|
||||
/* height: 32px; */
|
||||
width: 100%;
|
||||
/* height: var(--status-bar-height); */
|
||||
flex-shrink: 0;
|
||||
}
|
||||
/* 顶部标题 */
|
||||
.top-bar {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="guide-page">
|
||||
<view class="status_bar"></view>
|
||||
<view class="status-bar"></view>
|
||||
<!-- 引导内容滑动容器 -->
|
||||
<swiper
|
||||
class="guide-swiper"
|
||||
@@ -14,36 +14,39 @@
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<view class="guide-img">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide1.png" style="width: 100%;height: 100%;"></image>
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide1.png" mode="aspectFit" class="img-content"></image>
|
||||
</view>
|
||||
<view style="height: 200rpx;width: 100%;"></view>
|
||||
<view class="guide-text">
|
||||
<view class="guide-title">精准服务</view>
|
||||
<view class="guide-subtitle">需求深度洞察,资源优化配置</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
<!-- 高效管理 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<view class="guide-img">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide2.png" style="width: 100%;height: 100%;"></image>
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide2.png" mode="aspectFit" class="img-content"></image>
|
||||
</view>
|
||||
<view style="height: 200rpx;width: 100%;"></view>
|
||||
<view class="guide-text">
|
||||
<view class="guide-title">高效沟通</view>
|
||||
<view class="guide-subtitle">反馈即时响应,流程无缝衔接</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
<!--安全保障 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<view class="guide-img">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide3.png" style="width: 100%;height: 100%;"></image>
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/guide3.png" mode="aspectFit" class="img-content"></image>
|
||||
</view>
|
||||
<view style="height: 200rpx;width: 100%;"></view>
|
||||
<view class="guide-text">
|
||||
<view class="guide-title">智能管理</view>
|
||||
<view class="guide-subtitle">数据驱动决策,风险提前预警</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
@@ -106,40 +109,61 @@ const handleBtnClick = () => {
|
||||
.guide-page {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
/* background-color: #f8f9ff; */
|
||||
background: linear-gradient(to bottom, #E2F0FF, #F6FAFF);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 120rpx 40rpx 80rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.status_bar {
|
||||
height: 140px;
|
||||
|
||||
/* 状态栏 - 自适应设备状态栏高度 */
|
||||
.status-bar {
|
||||
height: var(--status-bar-height);
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 滑动容器 */
|
||||
.guide-swiper {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 单个引导项 */
|
||||
/* 单个引导项 - 全屏自适应 */
|
||||
.guide-item {
|
||||
width: 360px;
|
||||
height: 480px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
/* 图片区域 - 自适应 */
|
||||
.guide-img {
|
||||
width: 77%;
|
||||
height: 50%;
|
||||
margin-bottom: 80rpx;
|
||||
width: 80%;
|
||||
max-width: 600rpx;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.img-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
/* 文字区域 */
|
||||
.guide-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
/* 引导标题 */
|
||||
@@ -161,7 +185,8 @@ const handleBtnClick = () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 60rpx;
|
||||
margin-bottom: 40rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 单个进度点 */
|
||||
@@ -171,6 +196,7 @@ const handleBtnClick = () => {
|
||||
border-radius: 8rpx;
|
||||
background-color: #ddd;
|
||||
margin: 0 8rpx;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* 激活的进度点 */
|
||||
@@ -182,6 +208,9 @@ const handleBtnClick = () => {
|
||||
/* 按钮容器 */
|
||||
.guide-btn-wrap {
|
||||
width: 80%;
|
||||
max-width: 600rpx;
|
||||
margin-bottom: 80rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 引导按钮 */
|
||||
@@ -210,7 +239,7 @@ const handleBtnClick = () => {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* 按钮禁用态 */
|
||||
/* 按钮禁用态(可选) */
|
||||
.guide-btn:disabled {
|
||||
background-color: #ccc;
|
||||
color: #fff;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="content-class">
|
||||
<view class="nar-top">
|
||||
<!-- 这里是状态栏占位 -->
|
||||
<view class="status_bar"></view>
|
||||
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||
<!-- 导航栏 -->
|
||||
<view class="nav-bar">
|
||||
<text class="nav-title">首页</text>
|
||||
@@ -134,6 +134,7 @@ const noticeText = ref('暂无公告')
|
||||
const allCount = ref(0) // 全部巡检
|
||||
const pendingCount = ref(0) //待巡检
|
||||
const InspectedCount = ref(0) //已巡检
|
||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||
|
||||
|
||||
// =======方法=======
|
||||
@@ -214,7 +215,7 @@ const getInspectionData = () =>{
|
||||
getTodayInspection().then(res =>{
|
||||
if(res.code === 200){
|
||||
if(res.data){
|
||||
allCount.value = res.data.unfinishedPoints
|
||||
allCount.value = res.data.totalTasks
|
||||
pendingCount.value = res.data.unfinishedTasks
|
||||
InspectedCount.value = res.data.completedTasks
|
||||
}else{
|
||||
@@ -288,8 +289,8 @@ const clickItem = index => {
|
||||
}
|
||||
|
||||
.status_bar {
|
||||
height: 46px;
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 导航栏 */
|
||||
@@ -300,7 +301,7 @@ const clickItem = index => {
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 14px;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<template>
|
||||
<view class="contentStyle" style="">
|
||||
<view class="status-bar"></view>
|
||||
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||
<uni-nav-bar title="我的" backgroundColor="transparent" :border="false"> </uni-nav-bar>
|
||||
<scroll-view class="page" scroll-y>
|
||||
<view class="topBox">
|
||||
<view class="name">
|
||||
<image :src="avatar" class="img" />
|
||||
<span
|
||||
style="padding: 5rpx 5rpx; display: flex; flex-direction: column; line-height: 60rpx"
|
||||
>
|
||||
<span style="padding: 5rpx 5rpx; display: flex; flex-direction: column; line-height: 60rpx">
|
||||
<span style="font-size: 36rpx; font-weight: 600">
|
||||
{{ loginName }}
|
||||
</span>
|
||||
@@ -21,20 +19,10 @@
|
||||
<view class="contentBox">
|
||||
<div class="page-container">
|
||||
<view class="list-container">
|
||||
<view
|
||||
class="list-item"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
@click="onItemClick(item)"
|
||||
>
|
||||
<view class="list-item" v-for="(item, index) in list" :key="index" @click="onItemClick(item)">
|
||||
<image :src="item.icon" class="item-icon" />
|
||||
<view class="item-content">
|
||||
<text class="item-title">{{ item.title }}</text>
|
||||
<span class="item-desc" v-if="item.desc"
|
||||
><span style="align-self: flex-end; font-size: 24rpx; vertical-align: baseline">{{
|
||||
item.desc
|
||||
}}</span></span
|
||||
>
|
||||
</view>
|
||||
<view class="item-arrow"></view>
|
||||
<!-- <image src="https://wuyeadmin.bugtc.com/images/propertyImgs/arrow-right.png" class="arrow-icon" /> -->
|
||||
@@ -46,24 +34,27 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { getSettingInfo } from '../../api/api.js'
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
getSettingInfo
|
||||
} from '../../api/api.js'
|
||||
|
||||
const list = ref([
|
||||
{
|
||||
const list = ref([{
|
||||
icon: 'https://wuyeadmin.bugtc.com/images/imgs/shangbao.png',
|
||||
title: '上报记录'
|
||||
},
|
||||
{
|
||||
icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
|
||||
title: '巡检记录'
|
||||
// desc: "您可以在这里添加家人、朋友、租客~"
|
||||
},
|
||||
{
|
||||
icon: 'https://wuyeadmin.bugtc.com/images/imgs/xunjian.png',
|
||||
title: '仪表换新'
|
||||
// desc: "您可以在这里添加家人、朋友、租客~"
|
||||
},
|
||||
{
|
||||
icon: 'https://wuyeadmin.bugtc.com/images/propertyImgs/setting.png',
|
||||
@@ -73,6 +64,7 @@ const list = ref([
|
||||
const loginName = ref('')
|
||||
const phoneNum = ref('')
|
||||
const avatar = ref('')
|
||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||
|
||||
// 获取管家信息
|
||||
const fetchUserInfo = () => {
|
||||
@@ -85,7 +77,7 @@ const fetchUserInfo = () => {
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || '获取失败',
|
||||
icon: 'error'
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -174,9 +166,15 @@ const onItemClick = item => {
|
||||
.contentBox {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.status-bar {
|
||||
width: 100vw;
|
||||
height: 46px;
|
||||
// height: 46px;
|
||||
height: var(--status-bar-height);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
::v-deep .uni-nav-bar-text{
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
|
||||
Reference in New Issue
Block a user