对接小区、故障报修接口,更换图片地址

This commit is contained in:
zhouyanli
2026-05-13 17:49:02 +08:00
parent d45bb90c5e
commit 7e5ee9d4e0
28 changed files with 495 additions and 629 deletions

View File

@@ -53,7 +53,7 @@
<view class="upload-item" v-for="(img, index) in form.images" :key="index">
<image :src="img" mode="aspectFill" class="upload-img"></image>
<image
src="/static/imgs/delete.png"
src="http://47.104.199.163:9090/images/imgs/delete.png"
class="upload-delete"
@click="deleteImage(index)"
></image>
@@ -75,10 +75,12 @@
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
// import { onLoad, uniShowToast, uniNavigateBack, uniChooseImage, uniUploadFile } from '@dcloudio/uni-app'
import {addRepairList,uploadFile} from '../../api/api.js'
// 接收上个页面传的维修项目
const repairProject = ref('')
const repairId = ref('')
// 表单数据
const form = ref({
@@ -88,11 +90,15 @@ const form = ref({
images: [] // 图片列表
})
// ==========方法========
// 页面加载时获取传参
onLoad(options => {
if (options.category && options.project) {
repairProject.value = `${options.category}-${options.project}`
repairId.value = options.projectId
}
console.log('项目id',repairId.value)
})
// 选择项目页
@@ -124,14 +130,35 @@ const chooseImage = () => {
}
})
}
// 上传图片
const uploadImages = async () => {
const uploadedUrls = []
for (const path of form.value.images) {
if (path.startsWith('http')) {
uploadedUrls.push(path)
continue
}
try {
const res = await uploadFile(path)
// 根据后端实际返回结构调整字段名
uploadedUrls.push(res.url || '')
} catch (err) {
uni.showToast({
title:e.msg || '图片上传失败',
icon:'error'
})
}
}
return uploadedUrls
}
// 删除图片
const deleteImage = index => {
form.value.images.splice(index, 1)
}
// 表单提交
const submitForm = () => {
const submitForm = async () => {
// 表单校验
if (!repairProject.value) {
uni.showToast({ title: '请选择维修项目', icon: 'none' })
@@ -149,20 +176,41 @@ const submitForm = () => {
uni.showToast({ title: '请输入正确的手机号', icon: 'none' })
return
}
// 提交数据
uni.showLoading({ title: '提交中...' ,})
try {
// 先上传图片
const imageUrls = await uploadImages()
// 提交数据(替换成你的接口)
uni.showLoading({ title: '提交中...' })
const params = {
maintenanceItemId:repairId.value,
item: form.value.title,
problem: form.value.desc,
phone: form.value.phone,
problemImageUrl: imageUrls.join(','),
// projectType: '0',
problemStatus:'0'
}
// 模拟接口请求
setTimeout(() => {
const res = await addRepairList(params)
if (res.code === 200) {
uni.showToast({ title: '提交成功', icon: 'success' })
form.value = { title: '', desc: '', phone: '', images: [] }
repairProject.value = ''
// uni.navigateBack({ delta: 2 })
setTimeout(() => {
uni.switchTab({ url: '/pages/index/index' })
}, 1500)
} else {
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
}
} catch (e) {
uni.showToast({ title: e.msg || '网络异常', icon: 'none' })
} finally {
uni.hideLoading()
uni.showToast({ title: '提交成功', icon: 'success' })
}
// 提交成功后重置表单/返回上一页
form.value = { title: '', desc: '', phone: '', images: [] }
// 或返回上一页
uni.navigateBack({ delta: 3 })
}, 1000)
}
</script>

View File

@@ -17,7 +17,7 @@
v-for="item in categoryList"
:key="item.id"
>
{{ item.name }}
{{ item.projectName }}
</view>
</scroll-view>
@@ -29,7 +29,7 @@
v-for="item in currentProjectList"
:key="item.id"
>
{{ item.name }}
{{ item.projectName }}
</view>
</scroll-view>
</view>
@@ -38,20 +38,21 @@
<script setup>
import { ref, computed } from 'vue'
// import { uniNavigateTo } from '@dcloudio/uni-app'
import { onLoad } from '@dcloudio/uni-app'
import {getRepairOrder} from '../../api/api.js'
// 分类列表
const categoryList = ref([
{ id: 1, name: '基础设施' },
{ id: 2, name: '电子设施' }
// { id: 1, name: '基础设施' },
// { id: 2, name: '电子设施' }
])
// 所有项目数据
const projectList = ref([
{ id: 101, categoryId: 1, name: '路灯' },
{ id: 102, categoryId: 1, name: '楼层指示灯' },
{ id: 103, categoryId: 2, name: '应急出口灯' },
{ id: 104, categoryId: 1, name: '草坪灯' }
// { id: 101, categoryId: 1, name: '路灯' },
// { id: 102, categoryId: 1, name: '楼层指示灯' },
// { id: 103, categoryId: 2, name: '应急出口灯' },
// { id: 104, categoryId: 1, name: '草坪灯' }
])
// 选中的分类
@@ -72,14 +73,39 @@ const currentProjectList = computed(() => {
const selectCategory = (item) => {
activeCategory.value = item.id
}
// 获取维修项目
const fetchProjectList = async () => {
try {
const res = await getRepairOrder()
if (res.code === 200) {
const data = res.data || []
// 兼容后端嵌套格式 [{id, name, children: [{id, name}]}]
categoryList.value = data.map(item => ({ id: item.id, projectName: item.projectName }))
projectList.value = data.flatMap(item =>
(item.children || []).map(child => ({
id: child.id,
categoryId: item.id,
projectName: child.projectName
}))
)
activeCategory.value = categoryList.value[0]?.id || 1
}
} catch (e) {
uni.showToast({ title: '获取项目列表失败', icon: 'none' })
}
}
onLoad(() =>{
fetchProjectList()
})
// 选择项目并跳转到维修项目填写页
const selectProject = (item) => {
// 获取分类名称
const categoryName = categoryList.value.find(c => c.id === item.categoryId)?.name
const categoryName = categoryList.value.find(c => c.id === item.categoryId)?.projectName
// 跳转并传参
uni.navigateTo({
url: `/pageSubPack/fault-reporting/fault-reporting?category=${categoryName}&project=${item.name}`
url: `/pageSubPack/fault-reporting/fault-reporting?category=${categoryName}&project=${item.projectName}&projectId=${item.id}`
})
}
</script>

View File

@@ -1,562 +1,299 @@
<template>
<view class="container">
<!-- 搜索区域 -->
<view class="search-container">
<view class="search-input-wrapper">
<uni-icons class="search-icon" type="search" size="20" color="#999"></uni-icons>
<input class="search-input" placeholder="请输入关键字进行搜索" placeholder-class="placeholder" v-model="searchText"
@input="handleSearchInput" />
<view v-if="searchText" class="clear-icon" @tap="clearSearch">
<uni-icons type="clear" size="18" color="#999"></uni-icons>
</view>
</view>
<!-- <button class="search-btn" @tap="handleSearch">搜索</button> -->
</view>
<!-- 小区列表 -->
<scroll-view class="community-list" scroll-y :scroll-into-view="scrollIntoViewId" @scrolltolower="loadMoreData"
:lower-threshold="100">
<view v-for="item in displayedCommunities" :key="item.id" class="community-item" :id="'item-' + item.id"
@tap="selectCommunity(item)" :class="{active:selectedItem?.id === item.id}">
<view class="community-item-left">
<image src="/static/imgs/community.png" style="width: 48rpx;height: 48rpx;"></image>
<view class="community-info">
<text class="community-name">{{ item.name }}</text>
<template>
<view class="container">
<!-- 搜索区域 -->
<view class="search-container">
<view class="search-input-wrapper">
<uni-icons class="search-icon" type="search" size="20" color="#999"></uni-icons>
<input class="search-input" placeholder="请输入关键字进行搜索" placeholder-class="placeholder" v-model="searchText"
@input="handleSearchInput" />
<view v-if="searchText" class="clear-icon" @tap="clearSearch">
<uni-icons type="clear" size="18" color="#999"></uni-icons>
</view>
</view>
<view v-if="selectedItem && selectedItem.id === item.id" class="selected-icon">
<image src="/static/imgs/check.png" style="width: 48rpx;height: 48rpx;"></image>
</view>
<!-- 小区列表 -->
<scroll-view class="community-list" scroll-y>
<view v-for="item in displayedCommunities" :key="item.id" class="community-item"
@tap="selectCommunity(item)" :class="{active: selectedItem?.id === item.id}">
<view class="community-item-left">
<image src="http://47.104.199.163:9090/images/imgs/community.png" style="width: 48rpx;height: 48rpx;"></image>
<view class="community-info">
<text class="community-name">{{ item.villageName }}</text>
</view>
</view>
<view v-if="selectedItem && selectedItem.id === item.id" class="selected-icon">
<image src="http://47.104.199.163:9090/images/imgs/check.png" style="width: 48rpx;height: 48rpx;"></image>
</view>
</view>
</view>
<!-- 加载更多 -->
<view v-if="hasMoreData" class="load-more-container">
<view v-if="!isLoading" class="load-more-btn" @tap="loadMoreData">
<text>加载更多</text>
<uni-icons type="arrow-down" size="16" color="#007AFF"></uni-icons>
<!-- 空状态 -->
<view v-if="displayedCommunities.length === 0 && !isLoading" class="empty-state">
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
<text class="empty-text">暂无小区数据</text>
</view>
<view v-else class="loading-container">
<uni-icons type="spinner-cycle" size="20" color="#007AFF" class="loading-icon"></uni-icons>
<text>正在加载...</text>
</view>
<!-- <text class="page-info">第 {{ currentPage }} 页 / 共 {{ totalPages }} 页</text> -->
</view>
</scroll-view>
<!-- 没有更多数据 -->
<view v-if="!hasMoreData && displayedCommunities.length > 0" class="no-more-data">
<text>没有更多数据了</text>
<!-- 确认按钮 -->
<view class="confirm-area">
<button class="confirm-btn" :disabled="!selectedItem" :class="{ 'disabled-btn': !selectedItem }"
@tap="handleConfirm">
确认
</button>
</view>
<!-- 空状态 -->
<view v-if="displayedCommunities.length === 0 && !isSearching" class="empty-state">
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
<text class="empty-text">暂无小区数据</text>
</view>
<!-- 搜索无结果 -->
<view v-if="displayedCommunities.length === 0 && isSearching" class="empty-state">
<uni-icons type="search" size="60" color="#ccc"></uni-icons>
<text class="empty-text">未找到相关小区</text>
<!-- <text class="empty-tip">请尝试其他关键词</text> -->
</view>
</scroll-view>
<!-- 确认按钮 -->
<view class="confirm-area">
<button class="confirm-btn" :disabled="!selectedItem" :class="{ 'disabled-btn': !selectedItem }"
@tap="handleConfirm">
确认
</button>
</view>
</view>
</template>
</template>
<script setup>
import {
ref,
computed,
onMounted,
watch
} from 'vue'
<script setup>
import { ref, onMounted } from 'vue'
import {onLoad} from '@dcloudio/uni-app'
import { getVillageList,switchVillage} from '../../api/api.js'
// 响应式数据
const searchText = ref('')
const selectedItem = ref(null)
const scrollIntoViewId = ref('')
// 响应式数据
const searchText = ref('')
const selectedItem = ref(null)
const displayedCommunities = ref([])
const isLoading = ref(false)
let searchTimeout = null
const defaultVillageId = ref('')
// 分页相关
const currentPage = ref(1)
const pageSize = 5
const totalCommunities = ref([])
const displayedCommunities = ref([])
const hasMoreData = ref(true)
const isLoading = ref(false)
// 搜索状态
const isSearching = ref(false)
let searchTimeout = null
// 所有小区数据
const allCommunities = ref([{
id: 1,
name: '北境碧桂园小区',
address: '北境市光明区碧桂路1号'
},
{
id: 2,
name: '南湖花园小区',
address: '南湖市滨湖区湖滨路28号'
},
{
id: 3,
name: '东城国际社区',
address: '东城市新城区人民路156号'
},
{
id: 4,
name: '西湖雅苑',
address: '西湖市风景区梅灵路88号'
},
{
id: 5,
name: '北境锦绣家园',
address: '北境市朝阳区朝阳路56号'
},
{
id: 6,
name: '阳光100小区',
address: '阳光市高新区创业路100号'
},
{
id: 7,
name: '绿城玫瑰园',
address: '绿城市西湖区学院路188号'
},
{
id: 8,
name: '金地自在城',
address: '金城市江干区金沙大道200号'
},
{
id: 9,
name: '万科城市花园',
address: '万城市余杭区文一西路299号'
},
{
id: 10,
name: '保利中央公园',
address: '保利市拱墅区莫干山路500号'
},
{
id: 11,
name: '龙湖天街小区',
address: '龙湖市滨江区江南大道100号'
},
])
// 计算属性
const totalPages = computed(() => {
return Math.ceil(totalCommunities.value.length / pageSize)
})
// 方法
// 加载分页数据
const loadPageData = (pageNum) => {
isLoading.value = true
// 模拟网络请求延迟
setTimeout(() => {
const startIndex = (pageNum - 1) * pageSize
const endIndex = startIndex + pageSize
const pageData = totalCommunities.value.slice(startIndex, endIndex)
if (pageNum === 1) {
displayedCommunities.value = pageData
} else {
displayedCommunities.value = [...displayedCommunities.value, ...pageData]
}
currentPage.value = pageNum
hasMoreData.value = displayedCommunities.value.length < totalCommunities.value.length
isLoading.value = false
// 滚动到新加载的内容
if (pageNum > 1 && pageData.length > 0) {
setTimeout(() => {
scrollIntoViewId.value = 'item-' + pageData[0].id
}, 100)
}
}, 500)
}
// 加载更多数据
const loadMoreData = () => {
if (isLoading.value || !hasMoreData.value) return
loadPageData(currentPage.value + 1)
}
// 处理搜索输入
const handleSearchInput = () => {
// 防抖处理
if (searchTimeout) {
clearTimeout(searchTimeout)
}
searchTimeout = setTimeout(() => {
handleSearch()
}, 300)
}
// 处理搜索
const handleSearch = () => {
const keyword = searchText.value.trim().toLowerCase()
if (!keyword) {
isSearching.value = false
totalCommunities.value = [...allCommunities.value]
loadPageData(1)
return
}
isSearching.value = true
totalCommunities.value = allCommunities.value.filter(community =>
community.name.toLowerCase().includes(keyword) ||
community.address.toLowerCase().includes(keyword)
)
loadPageData(1)
}
// 清空搜索
const clearSearch = () => {
searchText.value = ''
isSearching.value = false
totalCommunities.value = [...allCommunities.value]
loadPageData(1)
}
// 选择小区
const selectCommunity = (item) => {
selectedItem.value = item
}
// 确认选择
const handleConfirm = () => {
if (!selectedItem.value) {
uni.showToast({
title: '请先选择小区',
icon: 'none',
duration: 2000
})
return
}
uni.showModal({
title: '确认选择',
content: `您已选择: ${selectedItem.value.name}`,
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '选择成功',
icon: 'success',
duration: 1500
})
// 在实际应用中,这里可以触发回调或页面跳转
// uni.navigateBack() 或 emit('confirm', selectedItem.value)
uni.$emit('confirm', selectedItem.value)
// 模拟2秒后返回上一页
setTimeout(() => {
uni.navigateBack()
}, 1500)
// 调用接口获取小区列表
const fetchVillageList = async (villageName = '') => {
isLoading.value = true
try {
const res = await getVillageList({ villageName })
if (res.code === 200) {
displayedCommunities.value = res.data
// 自动选中传入的小区
if (defaultVillageId.value) {
const found = displayedCommunities.value.find(
item => String(item.id) === String(defaultVillageId.value)
)
if (found) {
selectedItem.value = found
}
}
} else {
uni.showToast({ title: res.msg || '获取数据失败', icon: 'none' })
}
} catch (err) {
uni.showToast({ title: '网络错误', icon: 'none' })
} finally {
isLoading.value = false
}
}
// 接收传入的参数
onLoad((options) => {
if (options?.villageId) {
defaultVillageId.value = options.villageId
}
})
// 处理搜索输入(防抖)
const handleSearchInput = () => {
if (searchTimeout) clearTimeout(searchTimeout)
searchTimeout = setTimeout(() => {
fetchVillageList(searchText.value.trim())
}, 300)
}
// 清空搜索
const clearSearch = () => {
searchText.value = ''
fetchVillageList('')
}
// 选择小区
const selectCommunity = (item) => {
selectedItem.value = item
}
// 确认选择
const handleConfirm = () => {
if (!selectedItem.value) {
uni.showToast({ title: '请先选择小区', icon: 'none', duration: 2000 })
return
}
uni.showLoading({ title: '切换中...', mask: true })
switchVillage({ villageId: selectedItem.value.id }).then((res) =>{
if(res.code === 200){
uni.showToast({ title: '切换成功', icon: 'success', duration: 1500 })
uni.$emit('confirm', selectedItem.value)
setTimeout(() => {
uni.navigateBack()
}, 1500)
}else{
uni.showToast({ title: res.msg || '切换失败', icon: 'none' })
}
}).catch((err)=>{
uni.hideLoading()
uni.showToast({title:err.msg || '网络异常',icon:'none'})
})
// uni.showModal({
// title: '确认选择',
// content: `您已选择: ${selectedItem.value.villageName}`,
// success: (res) => {
// if (res.confirm) {
// uni.showToast({ title: '选择成功', icon: 'success', duration: 1500 })
// uni.$emit('confirm', selectedItem.value)
// setTimeout(() => {
// uni.navigateBack()
// }, 1500)
// }
// }
// })
}
// 初始化
onMounted(() => {
fetchVillageList()
})
}
</script>
// 监听搜索文本变化
watch(searchText, (newVal) => {
if (!newVal.trim()) {
clearSearch()
}
})
// 初始化
onMounted(() => {
// 初始化数据
totalCommunities.value = [...allCommunities.value]
loadPageData(1)
// 默认选中第一项
if (displayedCommunities.value.length > 0) {
selectedItem.value = displayedCommunities.value[0]
}
})
</script>
<style scoped>
/* 页面容器 */
.container {
min-height: 100vh;
background-color: #f5f5f5;
display: flex;
flex-direction: column;
padding: 0rpx 40rpx;
}
/* 搜索区域 */
.search-container {
padding: 20rpx 30rpx;
background-color: #ffffff;
display: flex;
align-items: center;
/* box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); */
z-index: 10;
position: sticky;
top: 0;
}
.search-input-wrapper {
flex: 1;
background-color: #f3f3f3;
border-radius: 10rpx;
padding: 8rpx 20rpx;
display: flex;
align-items: center;
height: 80rpx;
/* margin-right: 20rpx; */
}
.search-icon {
margin-right: 15rpx;
}
.search-input {
flex: 1;
height: 100%;
font-size: 28rpx;
color: #333;
}
.placeholder {
color: #999;
font-size: 28rpx;
text-align: center;
}
.clear-icon {
padding: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.search-btn {
background-color: #007AFF;
color: #fff;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 10rpx;
padding: 0 30rpx;
margin: 0;
white-space: nowrap;
}
/* 小区列表 */
.community-list {
flex: 1;
/* padding: 0 30rpx; */
margin-top: 20rpx;
margin-bottom: 180rpx;
}
.community-item {
background-color: #fff;
/* border-radius: 12rpx; */
padding: 30rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
/* box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); */
/* transition: all 0.2s; */
}
.community-item.active {
background-color: #F5FAFF;
border: 1px solid #2F77FD;
transform: translateY(2rpx);
}
.community-item-left {
display: flex;
align-items: center;
flex: 1;
}
.house-icon {
margin-right: 20rpx;
}
.community-info {
display: flex;
flex-direction: column;
flex: 1;
}
.community-name {
font-size: 32rpx;
color: #222;
font-weight: 500;
margin-bottom: 8rpx;
}
.community-address {
font-size: 24rpx;
color: #999;
margin-bottom: 5rpx;
}
.community-id {
font-size: 22rpx;
color: #ccc;
}
.selected-icon {
margin-left: 20rpx;
}
/* 加载更多容器 */
.load-more-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 40rpx 0;
color: #999;
}
.load-more-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 40rpx;
background-color: #f8f8f8;
border-radius: 50rpx;
color: #007AFF;
font-size: 28rpx;
margin-bottom: 20rpx;
}
.load-more-btn text {
margin-right: 10rpx;
}
.loading-container {
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 40rpx;
background-color: #f8f8f8;
border-radius: 50rpx;
color: #007AFF;
font-size: 28rpx;
margin-bottom: 20rpx;
}
.loading-icon {
margin-right: 10rpx;
animation: rotate 1s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.page-info {
font-size: 24rpx;
color: #999;
}
/* 没有更多数据 */
.no-more-data {
text-align: center;
padding: 40rpx 0;
color: #999;
font-size: 28rpx;
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.empty-text {
font-size: 32rpx;
color: #999;
margin-top: 20rpx;
margin-bottom: 10rpx;
}
.empty-tip {
font-size: 24rpx;
color: #ccc;
}
/* 确认区域 */
.confirm-area {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx 30rpx 40rpx;
background-color: #fff;
box-shadow: 0 -2rpx 20rpx rgba(0, 0, 0, 0.05);
}
.confirm-btn {
background-color: #4D5DFA;
color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 8rpx;
font-size: 28rpx;
width: 100%;
margin: 0;
}
.disabled-btn {
background-color: #ccc;
color: #fff;
}
.selected-info {
text-align: center;
font-size: 24rpx;
color: #666;
margin-top: 20rpx;
padding: 10rpx;
background-color: #f8f8f8;
border-radius: 8rpx;
}
/* 适配不同屏幕 */
@media (min-width: 768px) {
<style scoped>
.container {
max-width: 500px;
margin: 0 auto;
min-height: 100vh;
background-color: #f5f5f5;
display: flex;
flex-direction: column;
padding: 0rpx 40rpx;
}
}
</style>
.search-container {
padding: 20rpx 30rpx;
background-color: #ffffff;
display: flex;
align-items: center;
z-index: 10;
position: sticky;
top: 0;
}
.search-input-wrapper {
flex: 1;
background-color: #f3f3f3;
border-radius: 10rpx;
padding: 8rpx 20rpx;
display: flex;
align-items: center;
height: 80rpx;
}
.search-icon {
margin-right: 15rpx;
}
.search-input {
flex: 1;
height: 100%;
font-size: 28rpx;
color: #333;
}
.placeholder {
color: #999;
font-size: 28rpx;
text-align: center;
}
.clear-icon {
padding: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.community-list {
flex: 1;
margin-top: 20rpx;
margin-bottom: 180rpx;
}
.community-item {
background-color: #fff;
padding: 30rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.community-item.active {
background-color: #F5FAFF;
border: 1px solid #2F77FD;
transform: translateY(2rpx);
}
.community-item-left {
display: flex;
align-items: center;
flex: 1;
}
.community-info {
display: flex;
flex-direction: column;
flex: 1;
}
.community-name {
font-size: 32rpx;
color: #222;
font-weight: 500;
margin-bottom: 8rpx;
}
.selected-icon {
margin-left: 20rpx;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.empty-text {
font-size: 32rpx;
color: #999;
margin-top: 20rpx;
}
.confirm-area {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx 30rpx 40rpx;
background-color: #fff;
box-shadow: 0 -2rpx 20rpx rgba(0, 0, 0, 0.05);
}
.confirm-btn {
background-color: #4D5DFA;
color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 8rpx;
font-size: 28rpx;
width: 100%;
margin: 0;
}
.disabled-btn {
background-color: #ccc;
color: #fff;
}
@media (min-width: 768px) {
.container {
max-width: 500px;
margin: 0 auto;
}
}
</style>

View File

@@ -7,7 +7,7 @@
<uni-nav-bar left-icon="left" title="远程开门" backgroundColor ="none" :border="false" @clickLeft="narBack" />
</view>
<view class="top-img">
<image src="/static/imgs/xuancheng-bg.png" mode="" style="width: 100%;height: 100%;"></image>
<image src="http://47.104.199.163:9090/images/imgs/xuancheng-bg.png" mode="" style="width: 100%;height: 100%;"></image>
</view>
<!-- 提示文案 -->
@@ -49,6 +49,7 @@
<script setup>
import { ref } from 'vue'
// 响应式数据:选中的门索引、开门成功提示
const selectedDoor = ref(-1) // -1表示未选中
const showSuccess = ref(false)