This commit is contained in:
hr121 2025-08-08 16:12:04 +08:00
commit 1b7d340c5b
8 changed files with 214 additions and 240 deletions

View File

@ -1,115 +1,90 @@
<template> <template>
<view class="aircraft-equipment"> <view class="aircraft-equipment" :style="{backgroundImage: `url(${fileUrl+banner})`}">
<!-- 顶部区域 --> <view class="equipment-content">
<Topnav :topLevel="topLevel" title="爱尚云" /> <view class="top-abs" :style="{marginTop: CustomBar+'px'}">
<view class="header"> 我的设备
<view class="header-content">
<u-image width="100%" :src="fileUrl + banner" mode="widthFix" />
<view class="top-abs">
<view class="title">我的设备</view>
</view> </view>
</view> <view class="device-item" v-for="(item, index) in deviceList" :key="index">
</view> <u-image class="device-image" :src="item.deviceImg||(ordFileUrl+defaultIcon)"
mode="widthFix" @click="preview(item.image||(ordFileUrl+defaultIcon))" />
<!-- 设备列表区域 -->
<scroll-view scroll-y class="device-list">
<view
class="device-item"
v-for="(item, index) in deviceList"
:key="index"
>
<u-image
class="device-image"
:src="item.image"
mode="widthFix"
></u-image>
<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>
<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>
<u-empty text="暂无设备" mode="list"
src="/static/empty.png" icon-size="300" font-size="40"
margin-top="250"></u-empty>
</view>
</view> </view>
</scroll-view>
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
</view> </view>
</template> </template>
<script> <script>
import { tools } from "@/utils/utils.js"; import configService from '@/common/config.service.js';
import Topnav from "@/components/topnav/index.vue";
export default { export default {
// #ifdef MP // #ifdef MP
options: { options: {
styleIsolation: "shared" styleIsolation: "shared"
}, },
// #endif // #endif
components: { Topnav },
props: {
topLevel: {
type: Number,
default: 0
},
},
data() { data() {
return { return {
fileUrl: "/static/", // // #ifdef MP
//
StatusBar: this.StatusBar || 0,
CustomBar: this.CustomBar || 0,
// #endif
fileUrl: configService.fileUrl + 'aerocraft/equipment/', //
ordFileUrl: configService.fileUrl + 'aerocraft/order/',
//
defaultIcon: 'default.png',
banner: "devicebg.png", banner: "devicebg.png",
deviceList: [], deviceList: [],
}; //
form:{
current: 1,
size: 10,
// loadmoreloadingnomore
isFinish: 'nomore',
}, },
mounted() { };
this.init();
}, },
methods: { methods: {
// //
async init() { async init() {
// this.form = {size: 10,current: 1,isFinish: 'nomore'};
const devicesRes = await this.$api.getDevices(); await this.getDeviceList();
if (!devicesRes) { },
this.$refs.uToast.show({ async getDeviceList(){
type: 'error', this.form.isFinish = 'loading';
title: '设备列表获取失败!' let deviceRes = await this.$api.getDevices(this.form);
}); if(deviceRes){
return; const { records, size, total, current } = deviceRes;
} if(current == 1) this.deviceList = records || [];
else this.deviceList.push(...records);
// this.form.isFinish = size*current >= total ? 'nomore' : 'loadmore';
const deviceList = []; }else{
for (const device of devicesRes.records) { this.$refs.uToast.show({type:'error',title: "设备列表获取失败!"});
try { this.form.isFinish = 'loadmore';
const detailRes = await this.$api.getDevicesDetail(device.id); }
if (detailRes) { },
// 使 //
const image = detailRes.deviceImages && detailRes.deviceImages.length > 0 getMore(){
? detailRes.deviceImages[0].fileFullPath if(this.form.isFinish === 'nomore') return;
: '/static/drone.png'; this.form.current++;
this.getDeviceList();
deviceList.push({ },
id: device.id, //
name: device.name, preview(url){
model: device.model, console.log(url);
image: image this.$util.tools.methods.lookImage(0,[url]);
});
}
} catch(err) {
console.error('获取设备详情失败:', err);
// 使
deviceList.push({
id: device.id,
name: device.name,
model: device.model,
image: '/static/drone.png'
});
}
}
this.deviceList = deviceList;
}, },
// //
goToDetail(id) { goToDetail(id) {
uni.navigateTo({ uni.navigateTo({
@ -122,54 +97,37 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.aircraft-equipment { .aircraft-equipment {
min-height: 100vh;
background-color: #f5f5f5;
.header {
background: linear-gradient(180deg, #fff7e6 0%, #fff9ed 100%);
position: relative;
width: 100%;
height: 261rpx;
.header-content {
position: relative;
height: 100%; height: 100%;
background-color: #f5f5f5;
display: flex;
flex-direction: column;
background-size: contain;
background-repeat: no-repeat;
padding-bottom: 30rpx;
.equipment-content {
width: 100%;
position: relative;
padding: 0 24rpx 0;
.top-abs { .top-abs {
position: absolute; // position: absolute;
top: 72px;
.title {
margin-left: 34rpx;
font-family: Source Han Sans SC;
font-weight: 800;
font-size: 50rpx;
color: #333333;
}
}
.header-image {
position: absolute;
right: 0;
bottom: 0;
}
}
}
.device-list {
padding: 24rpx;
padding-top: 0;
height: calc(100vh - 160px);
box-sizing: border-box;
.device-item {
height: 200rpx;
background: #ffffff;
border-radius: 16rpx;
margin-bottom: 26rpx;
padding: 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
font-family: Source Han Sans SC;
font-weight: 800;
font-size: 44rpx;
color: #333333;
margin-bottom: 40rpx;
}
.device-item {
margin-top: 26rpx;
background: #ffffff;
border-radius: 16rpx;
display: flex;
align-items: center;
padding: 30rpx;
.device-image { .device-image {
width: 142rpx; width: 142rpx;
@ -177,12 +135,16 @@ export default {
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 {
flex: 1; flex: 1;
margin-left: 24rpx; margin-left: 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
.device-name { .device-name {
font-family: Source Han Sans SC; font-family: Source Han Sans SC;
font-weight: bold; font-weight: bold;
@ -199,17 +161,30 @@ export default {
color: #666666; color: #666666;
display: block; display: block;
} }
}
}
.detail-btn { .detail-btn {
&::v-deep .u-btn--warning{
border: none; border: none;
background: #fee547; background: #fee547;
border-radius: 12rpx; border-radius: 12rpx;
font-family: Source Han Sans SC; font-family: Source Han Sans SC;
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;
}
}
}
.device-empty{
width: 100%;
&::v-deep .u-icon__label{
margin-top: 24rpx !important;
font-weight: 500;
font-family: Source Han Sans SC;
} }
} }
} }

View File

@ -1,14 +1,9 @@
<template> <template>
<view class="equipment-detail"> <view class="equipment-detail">
<!-- 顶部导航区 --> <!-- 顶部导航区 -->
<Topnav <Topnav :topLevel="topLevel" title="设备详情" defaultBackColor="#333333"
:topLevel="topLevel" defaultNavTextColor="#333333" showBack />
title="设备详情" <view :style="{height: CustomBar + 'px'}" />
defaultBackColor="#333333"
defaultNavTextColor="#333333"
showBack
/>
<!-- 主要内容区域 --> <!-- 主要内容区域 -->
<view class="detail-container"> <view class="detail-container">
<!-- 设备图片展示区 --> <!-- 设备图片展示区 -->
@ -97,7 +92,7 @@
<view class="action-title">新增记录</view> <view class="action-title">新增记录</view>
<u-icon <u-icon
class="action-close" class="action-close"
:name="fileUrl + closeIcon" :name="ordFileUrl + closeIcon"
size="32" size="32"
@click="showRecordPopup = false" @click="showRecordPopup = false"
/> />
@ -166,13 +161,11 @@ export default {
// //
CustomBar: this.CustomBar || 0, CustomBar: this.CustomBar || 0,
// #endif // #endif
deviceId: "", deviceId: '',
equipmentImages: [ equipmentImages: [{
{ image: this.fileUrl + "drone.png",
image: "/static/drone.png", title: "默认图片"
title: "默认图片", }],
},
],
currentImageIndex: 0, currentImageIndex: 0,
// //
topLevel: 0, topLevel: 0,
@ -181,8 +174,9 @@ export default {
// //
equipmentDetail: {}, equipmentDetail: {},
maintenanceRecords: [], maintenanceRecords: [],
fileUrl: configService.fileUrl + 'aerocraft/equipment/', //
// //
fileUrl: configService.fileUrl + "aerocraft/order/", ordFileUrl: configService.fileUrl + "aerocraft/order/",
// //
triangle: "triangle.png", triangle: "triangle.png",
// //
@ -224,12 +218,10 @@ export default {
title: img.sourceFileName, title: img.sourceFileName,
})); }));
} else { } else {
this.equipmentImages = [ this.equipmentImages = [{
{ image: this.fileUrl+"drone.png",
image: "/static/drone.png", title: "默认图片"
title: "默认图片", }];
},
];
} }
} }
} catch (err) { } catch (err) {
@ -400,7 +392,7 @@ export default {
.equipment-images { .equipment-images {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
padding-top: 180rpx; // padding-top:144rpx;
background-color: #ebebf0; background-color: #ebebf0;
// margin-bottom: 20rpx; // margin-bottom: 20rpx;
} }

View File

@ -74,7 +74,7 @@ export default {
name: '路线', name: '路线',
icon: 'route.png', icon: 'route.png',
select: 'route-select.png', select: 'route-select.png',
navTitle: '路线' navTitle: '爱尚云'
}, },
{ {
name: '我的', name: '我的',

View File

@ -220,7 +220,7 @@ export default {
return orderId&&(!mainOrderStatus||mainOrderStatus!=='未进行')&& return orderId&&(!mainOrderStatus||mainOrderStatus!=='未进行')&&
(this.isPilot&&orderInitiatorId==this.userMessage.id&&mainOrderStatus!=='待确认'|| (this.isPilot&&orderInitiatorId==this.userMessage.id&&mainOrderStatus!=='待确认'||
!this.isPilot&&customerId==userMessage.id)&&(!orderTaskDetailList|| !this.isPilot&&customerId==userMessage.id)&&(!orderTaskDetailList||
orderTaskDetailList.some(item=>item.orderItemStatus!=='未进行'||item.orderItemStatus!=='进行中')); orderTaskDetailList.some(item=>item.orderItemStatus!=='未进行'&&item.orderItemStatus!=='进行中'));
}, },
// //
canDelete(){ canDelete(){

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;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB