对接一键开门 修改首页引导页自适应样式
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,8 +155,8 @@ const uploadImages = async () => {
|
||||
uploadedUrls.push(res.url || '')
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title:e.msg || '图片上传失败',
|
||||
icon:'error'
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user