Merge branch 'main' of http://129.211.33.98:3210/hjq/aircraft-pilot
This commit is contained in:
commit
1b7d340c5b
@ -1,217 +1,192 @@
|
||||
<template>
|
||||
<view class="aircraft-equipment">
|
||||
<!-- 顶部区域 -->
|
||||
<Topnav :topLevel="topLevel" title="爱尚云" />
|
||||
<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>
|
||||
|
||||
<!-- 设备列表区域 -->
|
||||
<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">
|
||||
<text class="device-name">{{ item.name }}</text>
|
||||
<text class="device-model">{{ item.model }}</text>
|
||||
</view>
|
||||
<button class="detail-btn" @click="goToDetail(item.id)">
|
||||
查看详情
|
||||
</button>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
<view class="aircraft-equipment" :style="{backgroundImage: `url(${fileUrl+banner})`}">
|
||||
<view class="equipment-content">
|
||||
<view class="top-abs" :style="{marginTop: CustomBar+'px'}">
|
||||
我的设备
|
||||
</view>
|
||||
<view class="device-item" v-for="(item, index) in deviceList" :key="index">
|
||||
<u-image class="device-image" :src="item.deviceImg||(ordFileUrl+defaultIcon)"
|
||||
mode="widthFix" @click="preview(item.image||(ordFileUrl+defaultIcon))" />
|
||||
<view class="device-info">
|
||||
<text class="device-name">{{ item.name }}</text>
|
||||
<text class="device-model">{{ item.model }}</text>
|
||||
</view>
|
||||
<u-button class="detail-btn" type="warning" :custom-style="customStyle"
|
||||
:hair-line="false" @click="goToDetail(item.id)">查看详情</u-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>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tools } from "@/utils/utils.js";
|
||||
import Topnav from "@/components/topnav/index.vue";
|
||||
|
||||
export default {
|
||||
// #ifdef MP
|
||||
options: {
|
||||
styleIsolation: "shared"
|
||||
},
|
||||
// #endif
|
||||
components: { Topnav },
|
||||
props: {
|
||||
topLevel: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileUrl: "/static/", //静态资源基础路径
|
||||
banner: "devicebg.png",
|
||||
deviceList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
// 初始化
|
||||
async init() {
|
||||
// 获取设备列表
|
||||
const devicesRes = await this.$api.getDevices();
|
||||
if (!devicesRes) {
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
title: '设备列表获取失败!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 为每个设备获取详情
|
||||
const deviceList = [];
|
||||
for (const device of devicesRes.records) {
|
||||
try {
|
||||
const detailRes = await this.$api.getDevicesDetail(device.id);
|
||||
if (detailRes) {
|
||||
// 使用第一张图片作为设备图片
|
||||
const image = detailRes.deviceImages && detailRes.deviceImages.length > 0
|
||||
? detailRes.deviceImages[0].fileFullPath
|
||||
: '/static/drone.png';
|
||||
|
||||
deviceList.push({
|
||||
id: device.id,
|
||||
name: device.name,
|
||||
model: device.model,
|
||||
image: image
|
||||
});
|
||||
}
|
||||
} 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) {
|
||||
uni.navigateTo({
|
||||
url: `/aircraft/server/equipment/equipmentDetail?id=${id}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
import configService from '@/common/config.service.js';
|
||||
export default {
|
||||
// #ifdef MP
|
||||
options: {
|
||||
styleIsolation: "shared"
|
||||
},
|
||||
// #endif
|
||||
data() {
|
||||
return {
|
||||
// #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",
|
||||
deviceList: [],
|
||||
// 翻页参数
|
||||
form:{
|
||||
current: 1,
|
||||
size: 10,
|
||||
// 是否结束——loadmore加载更多,loading加载中,nomore无更多
|
||||
isFinish: 'nomore',
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化
|
||||
async init() {
|
||||
this.form = {size: 10,current: 1,isFinish: 'nomore'};
|
||||
await this.getDeviceList();
|
||||
},
|
||||
async getDeviceList(){
|
||||
this.form.isFinish = 'loading';
|
||||
let deviceRes = await this.$api.getDevices(this.form);
|
||||
if(deviceRes){
|
||||
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';
|
||||
}else{
|
||||
this.$refs.uToast.show({type:'error',title: "设备列表获取失败!"});
|
||||
this.form.isFinish = 'loadmore';
|
||||
}
|
||||
},
|
||||
// 加载更多
|
||||
getMore(){
|
||||
if(this.form.isFinish === 'nomore') return;
|
||||
this.form.current++;
|
||||
this.getDeviceList();
|
||||
},
|
||||
// 预览
|
||||
preview(url){
|
||||
console.log(url);
|
||||
this.$util.tools.methods.lookImage(0,[url]);
|
||||
},
|
||||
// 跳转到设备详情
|
||||
goToDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: `/aircraft/server/equipment/equipmentDetail?id=${id}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.aircraft-equipment {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
height: 100%;
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 30rpx;
|
||||
|
||||
.header {
|
||||
background: linear-gradient(180deg, #fff7e6 0%, #fff9ed 100%);
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 261rpx;
|
||||
.equipment-content {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding: 0 24rpx 0;
|
||||
|
||||
.header-content {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
.top-abs {
|
||||
// position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 800;
|
||||
font-size: 44rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.top-abs {
|
||||
position: absolute;
|
||||
top: 72px;
|
||||
.device-item {
|
||||
margin-top: 26rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
|
||||
.device-image {
|
||||
width: 142rpx;
|
||||
height: 142rpx;
|
||||
background: #f3f3f3;
|
||||
border-radius: 12rpx;
|
||||
border: 2rpx solid #cccccc;
|
||||
&::v-deep .u-image__image{
|
||||
border-radius: 12rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.device-info {
|
||||
flex: 1;
|
||||
margin-left: 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.device-name {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
display: block;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.device-model {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #666666;
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
.detail-btn {
|
||||
&::v-deep .u-btn--warning{
|
||||
border: none;
|
||||
background: #fee547;
|
||||
border-radius: 12rpx;
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
height: 72rpx !important;
|
||||
line-height: 72rpx !important;
|
||||
padding: 0 22rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
align-items: center;
|
||||
|
||||
.device-image {
|
||||
width: 142rpx;
|
||||
height: 142rpx;
|
||||
background: #f3f3f3;
|
||||
border-radius: 12rpx;
|
||||
border: 2rpx solid #cccccc;
|
||||
}
|
||||
|
||||
.device-info {
|
||||
flex: 1;
|
||||
margin-left: 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
.device-name {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
display: block;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.device-model {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #666666;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-btn {
|
||||
border: none;
|
||||
background: #fee547;
|
||||
border-radius: 12rpx;
|
||||
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
.device-empty{
|
||||
width: 100%;
|
||||
&::v-deep .u-icon__label{
|
||||
margin-top: 24rpx !important;
|
||||
font-weight: 500;
|
||||
font-family: Source Han Sans SC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -1,14 +1,9 @@
|
||||
<template>
|
||||
<view class="equipment-detail">
|
||||
<!-- 顶部导航区 -->
|
||||
<Topnav
|
||||
:topLevel="topLevel"
|
||||
title="设备详情"
|
||||
defaultBackColor="#333333"
|
||||
defaultNavTextColor="#333333"
|
||||
showBack
|
||||
/>
|
||||
|
||||
<Topnav :topLevel="topLevel" title="设备详情" defaultBackColor="#333333"
|
||||
defaultNavTextColor="#333333" showBack />
|
||||
<view :style="{height: CustomBar + 'px'}" />
|
||||
<!-- 主要内容区域 -->
|
||||
<view class="detail-container">
|
||||
<!-- 设备图片展示区 -->
|
||||
@ -97,7 +92,7 @@
|
||||
<view class="action-title">新增记录</view>
|
||||
<u-icon
|
||||
class="action-close"
|
||||
:name="fileUrl + closeIcon"
|
||||
:name="ordFileUrl + closeIcon"
|
||||
size="32"
|
||||
@click="showRecordPopup = false"
|
||||
/>
|
||||
@ -166,13 +161,11 @@ export default {
|
||||
// 微信小程序自定义导航栏参数
|
||||
CustomBar: this.CustomBar || 0,
|
||||
// #endif
|
||||
deviceId: "",
|
||||
equipmentImages: [
|
||||
{
|
||||
image: "/static/drone.png",
|
||||
title: "默认图片",
|
||||
},
|
||||
],
|
||||
deviceId: '',
|
||||
equipmentImages: [{
|
||||
image: this.fileUrl + "drone.png",
|
||||
title: "默认图片"
|
||||
}],
|
||||
currentImageIndex: 0,
|
||||
// 页面是否滚动到顶
|
||||
topLevel: 0,
|
||||
@ -181,8 +174,9 @@ export default {
|
||||
// 设备详情
|
||||
equipmentDetail: {},
|
||||
maintenanceRecords: [],
|
||||
fileUrl: configService.fileUrl + 'aerocraft/equipment/', //静态资源基础路径
|
||||
// 订单页图标基础路径
|
||||
fileUrl: configService.fileUrl + "aerocraft/order/",
|
||||
ordFileUrl: configService.fileUrl + "aerocraft/order/",
|
||||
// 下拉三角
|
||||
triangle: "triangle.png",
|
||||
// 弹窗关闭图标
|
||||
@ -224,12 +218,10 @@ export default {
|
||||
title: img.sourceFileName,
|
||||
}));
|
||||
} else {
|
||||
this.equipmentImages = [
|
||||
{
|
||||
image: "/static/drone.png",
|
||||
title: "默认图片",
|
||||
},
|
||||
];
|
||||
this.equipmentImages = [{
|
||||
image: this.fileUrl+"drone.png",
|
||||
title: "默认图片"
|
||||
}];
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
@ -400,8 +392,8 @@ export default {
|
||||
.equipment-images {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
padding-top: 180rpx;
|
||||
background-color: #ebebf0;
|
||||
// padding-top:144rpx;
|
||||
background-color: #ebebf0;
|
||||
// margin-bottom: 20rpx;
|
||||
}
|
||||
::v-deep .u-indicator-item-dot {
|
||||
|
@ -74,7 +74,7 @@ export default {
|
||||
name: '路线',
|
||||
icon: 'route.png',
|
||||
select: 'route-select.png',
|
||||
navTitle: '路线'
|
||||
navTitle: '爱尚云'
|
||||
},
|
||||
{
|
||||
name: '我的',
|
||||
|
@ -220,7 +220,7 @@ export default {
|
||||
return orderId&&(!mainOrderStatus||mainOrderStatus!=='未进行')&&
|
||||
(this.isPilot&&orderInitiatorId==this.userMessage.id&&mainOrderStatus!=='待确认'||
|
||||
!this.isPilot&&customerId==userMessage.id)&&(!orderTaskDetailList||
|
||||
orderTaskDetailList.some(item=>item.orderItemStatus!=='未进行'||item.orderItemStatus!=='进行中'));
|
||||
orderTaskDetailList.some(item=>item.orderItemStatus!=='未进行'&&item.orderItemStatus!=='进行中'));
|
||||
},
|
||||
// 判断是否可以删除
|
||||
canDelete(){
|
||||
|
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<view class="">
|
||||
路线
|
||||
<!-- <view class="aircraft-route" :style="{backgroundImage: `url(${fileUrl+bgIcon})`}">
|
||||
<!-- <view class="">
|
||||
路线 -->
|
||||
<view class="aircraft-route" :style="{backgroundImage: `url(${fileUrl+bgIcon})`}">
|
||||
<view class="route-content">
|
||||
<view class="top-abs" :style="{top: StatusBar+'px',height: CustomBar-StatusBar+'px'}">
|
||||
路线
|
||||
</view>
|
||||
<view :style="{height: CustomBar + 'px'}" />
|
||||
<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="搜索景区"
|
||||
v-model="query" @select="handleSearchSelect" selectedColor="#F8B500" />
|
||||
<u-icon class="triangle" :name="fileUrl+triangleIcon" size="24" />
|
||||
@ -41,7 +41,7 @@
|
||||
src="/static/empty.png" icon-size="300" font-size="40"
|
||||
margin-top="250"></u-empty>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
@ -88,14 +88,14 @@ export default {
|
||||
size: 10,
|
||||
// 是否结束——loadmore加载更多,loading加载中,nomore无更多
|
||||
isFinish: 'nomore',
|
||||
routeId: ''
|
||||
scenicId: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 初始化
|
||||
async init(){
|
||||
this.form = {size: 10,current: 1,isFinish: 'nomore',routeId: ''};
|
||||
this.form = {size: 10,current: 1,isFinish: 'nomore',scenicId: ''};
|
||||
await this.getRouteList();
|
||||
// 查询全部景区
|
||||
let scenRes = await this.$api.allScenic();
|
||||
@ -106,6 +106,7 @@ export default {
|
||||
// 搜索
|
||||
search(){
|
||||
this.form = { ...this.form, current: 1, isFinish: 'nomore' };
|
||||
if(!this.query) this.form.scenicId = '';
|
||||
this.getRouteList();
|
||||
},
|
||||
// 查询订单列表
|
||||
@ -130,7 +131,8 @@ export default {
|
||||
},
|
||||
// 搜索
|
||||
handleSearchSelect(e){
|
||||
console.log('触发搜索:',e.id);
|
||||
this.form.scenicId = e.id;
|
||||
this.search();
|
||||
},
|
||||
// 查看详情
|
||||
showDetail(item){
|
||||
@ -177,6 +179,11 @@ export default {
|
||||
.triangle{
|
||||
animation: spinBack 0.1s linear;
|
||||
}
|
||||
&-icon{
|
||||
&:active{
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
.route-item{
|
||||
margin-top: 26rpx;
|
||||
|
@ -38,7 +38,7 @@ const install = (Vue, vm) => {
|
||||
// 设备管理
|
||||
vm.$api.obtainDeviceList = async (params = {}) => await vm.$u.get('/api/dataDropdown/obtainDeviceList',params);// 获取设备下拉列表
|
||||
vm.$api.getDevices = async (params = {}) => await vm.$u.get('/aircraft/device/page',params);// 获取设备列表
|
||||
vm.$api.getDevicesDetail = async (id) => await vm.$u.get(`/aircraft/device/${id}`);// 获取设备详情
|
||||
vm.$api.getDevicesDetail = async (id) => await vm.$u.get(`/aircraft/device/${id}`);// 获取设备详情
|
||||
vm.$api.getMaintenanceRecords = async (params = {}) => await vm.$u.get('/aircraft/maintenance/page',params);// 获取设备维保记录
|
||||
vm.$api.addMaintenanceRecord = async (params = {}) => await vm.$u.post('/aircraft/maintenance',params);// 新增设备维保记录
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 729 KiB |
BIN
static/drone.png
BIN
static/drone.png
Binary file not shown.
Before Width: | Height: | Size: 1.3 MiB |
Loading…
Reference in New Issue
Block a user