This commit is contained in:
Double-_-Z 2025-08-08 11:14:30 +08:00
parent 4f8e5f3771
commit d38321ec69
3 changed files with 34 additions and 20 deletions

View File

@ -5,15 +5,14 @@
我的设备 我的设备
</view> </view>
<view class="device-item" v-for="(item, index) in deviceList" :key="index"> <view class="device-item" v-for="(item, index) in deviceList" :key="index">
<u-image class="device-image" :src="item.image||(ordFileUrl+defaultIcon)" <u-image class="device-image" :src="item.deviceImg||(ordFileUrl+defaultIcon)"
mode="widthFix" @click="preview(item.image||(ordFileUrl+defaultIcon))" /> mode="widthFix" @click="preview(item.image||(ordFileUrl+defaultIcon))" />
<view class="device-info"> <view class="device-info">
<text class="device-name">{{ item.name }}</text> <text class="device-name">{{ item.name }}</text>
<text class="device-model">{{ item.model }}</text> <text class="device-model">{{ item.model }}</text>
</view> </view>
<button class="detail-btn" @click="goToDetail(item.id)"> <u-button class="detail-btn" type="warning" :custom-style="customStyle"
查看详情 :hair-line="false" @click="goToDetail(item.id)">查看详情</u-button>
</button>
</view> </view>
<u-loadmore v-if="deviceList.length>0" @loadmore="getMore" :status="form.isFinish" color="#333333" marginTop="30" marginBottom="20" /> <u-loadmore v-if="deviceList.length>0" @loadmore="getMore" :status="form.isFinish" color="#333333" marginTop="30" marginBottom="20" />
<view class="device-empty" :style="{marginTop: CustomBar+100+'px'}" v-else> <view class="device-empty" :style="{marginTop: CustomBar+100+'px'}" v-else>
@ -136,6 +135,9 @@
background: #f3f3f3; background: #f3f3f3;
border-radius: 12rpx; border-radius: 12rpx;
border: 2rpx solid #cccccc; border: 2rpx solid #cccccc;
&::v-deep .u-image__image{
border-radius: 12rpx !important;
}
} }
.device-info { .device-info {
@ -162,6 +164,7 @@
} }
.detail-btn { .detail-btn {
&::v-deep .u-btn--warning{
border: none; border: none;
background: #fee547; background: #fee547;
border-radius: 12rpx; border-radius: 12rpx;
@ -169,6 +172,10 @@
font-weight: bold; font-weight: bold;
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
height: 72rpx !important;
line-height: 72rpx !important;
padding: 0 22rpx !important;
}
} }
} }

View File

@ -216,7 +216,7 @@ export default {
})); }));
} else { } else {
this.equipmentImages = [{ this.equipmentImages = [{
image: "/static/drone.png", image: this.fileUrl+"drone.png",
title: "默认图片" title: "默认图片"
}]; }];
} }

View File

@ -1,14 +1,14 @@
<template> <template>
<view class=""> <!-- <view class="">
路线 路线 -->
<!-- <view class="aircraft-route" :style="{backgroundImage: `url(${fileUrl+bgIcon})`}"> <view class="aircraft-route" :style="{backgroundImage: `url(${fileUrl+bgIcon})`}">
<view class="route-content"> <view class="route-content">
<view class="top-abs" :style="{top: StatusBar+'px',height: CustomBar-StatusBar+'px'}"> <view class="top-abs" :style="{top: StatusBar+'px',height: CustomBar-StatusBar+'px'}">
路线 路线
</view> </view>
<view :style="{height: CustomBar + 'px'}" /> <view :style="{height: CustomBar + 'px'}" />
<view class="route-search"> <view class="route-search">
<u-icon :name="fileUrl+searchIcon" size="36" /> <u-icon class="route-search-icon" :name="fileUrl+searchIcon" size="36" @click="search" />
<searchCombox style="flex: 1;margin: 0 10rpx;" :candidates="scenics" :isJSON="true" keyName="name" placeholder="搜索景区" <searchCombox style="flex: 1;margin: 0 10rpx;" :candidates="scenics" :isJSON="true" keyName="name" placeholder="搜索景区"
v-model="query" @select="handleSearchSelect" selectedColor="#F8B500" /> v-model="query" @select="handleSearchSelect" selectedColor="#F8B500" />
<u-icon class="triangle" :name="fileUrl+triangleIcon" size="24" /> <u-icon class="triangle" :name="fileUrl+triangleIcon" size="24" />
@ -41,7 +41,7 @@
src="/static/empty.png" icon-size="300" font-size="40" src="/static/empty.png" icon-size="300" font-size="40"
margin-top="250"></u-empty> margin-top="250"></u-empty>
</view> </view>
</view> --> </view>
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
</view> </view>
</template> </template>
@ -88,14 +88,14 @@ export default {
size: 10, size: 10,
// loadmoreloadingnomore // loadmoreloadingnomore
isFinish: 'nomore', isFinish: 'nomore',
routeId: '' scenicId: ''
}, },
} }
}, },
methods:{ methods:{
// //
async init(){ async init(){
this.form = {size: 10,current: 1,isFinish: 'nomore',routeId: ''}; this.form = {size: 10,current: 1,isFinish: 'nomore',scenicId: ''};
await this.getRouteList(); await this.getRouteList();
// //
let scenRes = await this.$api.allScenic(); let scenRes = await this.$api.allScenic();
@ -106,6 +106,7 @@ export default {
// //
search(){ search(){
this.form = { ...this.form, current: 1, isFinish: 'nomore' }; this.form = { ...this.form, current: 1, isFinish: 'nomore' };
if(!this.query) this.form.scenicId = '';
this.getRouteList(); this.getRouteList();
}, },
// //
@ -130,7 +131,8 @@ export default {
}, },
// //
handleSearchSelect(e){ handleSearchSelect(e){
console.log('触发搜索:',e.id); this.form.scenicId = e.id;
this.search();
}, },
// //
showDetail(item){ showDetail(item){
@ -177,6 +179,11 @@ export default {
.triangle{ .triangle{
animation: spinBack 0.1s linear; animation: spinBack 0.1s linear;
} }
&-icon{
&:active{
opacity: 0.7;
}
}
} }
.route-item{ .route-item{
margin-top: 26rpx; margin-top: 26rpx;