aircraft-pilot/aircraft/server/order/detail.vue

461 lines
12 KiB
Vue
Raw Normal View History

<!-- 订单详情 -->
<template>
<view class="order-detail">
<Topnav :topLevel="topLevel" title="订单详情" defaultBackColor="#333333"
defaultNavTextColor="#333333" showBack />
<view class="order-top">
<u-image width="100%" :src="myFileUrl+topBg" mode="widthFix" />
<view class="top-abs" :style="{top: CustomBar+'px'}">
<view class="order-status">待接单</view>
<view class="order-tips">请尽快执行任务</view>
</view>
</view>
<view class="order-content">
2025-07-25 00:38:34 +08:00
<view class="fly-message">
<view class="message-title">
<view class="text-content">飞行信息</view>
<u-image class="text-bg" width="148" height="28"
:src="fileUrl+textBg" />
</view>
<view class="message-content">
<view class="mc-lam">
<text class="lam-title">订单类型</text>
<text class="lam-value">载人</text>
</view>
<view class="mc-lam">
<text class="lam-title">景区</text>
<text class="lam-value">白云山</text>
</view>
<view class="mc-lam">
<text class="lam-title">路线</text>
<text class="lam-value">南门山顶广场</text>
</view>
<view class="mc-lam">
<text class="lam-title">货物重量</text>
<text class="lam-value">56 KG</text>
</view>
<view class="mc-lam">
<text class="lam-title">附加费</text>
<text class="lam-value"><text>100</text></text>
</view>
</view>
</view>
<view class="fly-message">
<view class="message-title">
<view class="text-content">订单信息</view>
<u-image class="text-bg" width="148" height="28"
:src="fileUrl+textBg" />
</view>
<view class="message-content">
<view class="mc-lam">
<text class="lam-title">发起人</text>
<text class="lam-value">李晓霞</text>
</view>
<view class="mc-lam">
<text class="lam-title">客户名称</text>
<text class="lam-value">李晓霞</text>
</view>
<view class="mc-lam">
<text class="lam-title">手机号</text>
<text class="lam-value">13624566325</text>
</view>
<view class="mc-lam">
<text class="lam-title">操作员</text>
<text class="lam-value">陈新生</text>
</view>
<view class="mc-lam">
<text class="lam-title">下单时间</text>
<text class="lam-value">2025-07-06 14:02:08</text>
</view>
</view>
</view>
<view class="fly-message">
<view class="message-title">
<view class="text-content">飞行任务</view>
<u-image class="text-bg" width="148" height="28"
:src="fileUrl+textBg" />
</view>
<view class="message-empty">
<u-image width="200rpx" height="130rpx" :src="fileUrl+empty" />
<view class="empty-text">
~暂无任务~
</view>
</view>
</view>
</view>
<view class="order-bottom">
2025-07-25 11:04:04 +08:00
<view class="add-action" @click="showAddAction=true">
2025-07-25 00:38:34 +08:00
新增任务
</view>
</view>
2025-07-25 11:04:04 +08:00
<u-popup v-model="showAddAction" mode="bottom" border-radius="40">
<view class="action-popup">
<view class="action-top">
<view class="action-close" />
<view class="action-title">新增任务</view>
<u-icon class="action-close" :name="fileUrl+closeIcon" size="32" @click="showAddAction=false" />
</view>
<view class="action-lam" style="margin-top: 72rpx;">
<view class="lam-title">执行设备</view>
2025-07-28 01:20:29 +08:00
<u-input class="lam-input" placeholder-style="font-size:32rpx;color:#B3B3B3;"
custom-style="font-size:32rpx;"
v-model="form.equipmentName" @click="handleClickPick"
2025-07-25 11:04:04 +08:00
placeholder="请选择设备" type="select" :clearable="false" />
</view>
<view class="action-lam">
<view class="lam-title">载货重量</view>
2025-07-28 01:20:29 +08:00
<u-input class="lam-input" placeholder-style="font-size:32rpx;color:#B3B3B3;"
custom-style="font-size:32rpx;" v-model.number="form.weight"
2025-07-25 11:04:04 +08:00
placeholder="请填写重量" type="number" :clearable="false" />
2025-07-28 01:20:29 +08:00
<view class="lam-input-right">KG</view>
</view>
<view class="action-lamx">
<view class="lam-title">货物图片</view>
<view class="lam-upload">
<u-upload :action="uploadApi" max-count="1" :file-list="fileList"
width="200" height="200" custom-btn :multiple="false" :header="uploadFileHeader"
@on-success="uploadFile" @on-remove="removeFile" name="file">
<view slot="addBtn" class="lam-upload-btn">
<u-icon :name="fileUrl+uploadIcon" size="60"></u-icon>
<view class="lam-upload-btn-text">上传图片</view>
</view>
</u-upload>
</view>
</view>
<view class="action-save">
保存
2025-07-25 11:04:04 +08:00
</view>
</view>
</u-popup>
2025-07-28 01:20:29 +08:00
<u-picker mode="selector" v-model="showEquipment" :default-selector="getDefaultSelector" :range="equipments"
range-key="name" confirm-color="#f7c04d" title="执行设备选择" @confirm="handleChangePick"></u-picker>
2025-07-25 00:38:34 +08:00
<u-back-top :scrollTop="scrollTop" zIndex="100" :duration="500"
:iconStyle="{ color: '#fff' }" :customStyle="{background: 'linear-gradient(180deg, #f8b500 0%, #fceabb 100%)',
boxShadow: '0rpx 0rpx 12rpx rgba(202,202,182,0.5)',
filter: 'opacity(0.96)'}"></u-back-top>
</view>
</template>
<script>
import Topnav from '@/components/topnav/index.vue';
import configService from '@/common/config.service.js';
export default {
// #ifdef MP
options: {
styleIsolation: 'shared'
},
// #endif
components: { Topnav },
2025-07-28 01:20:29 +08:00
computed:{
// 获取选择器默认值
getDefaultSelector(){
const index = this.form.equipmentId;
return index?[this.equipments.findIndex(item=>item.id === index)]:[0];
}
},
data(){
return{
// #ifdef MP
// 微信小程序自定义导航栏参数
CustomBar: this.CustomBar || 0,
// #endif
2025-07-28 01:20:29 +08:00
// 上传api
uploadApi: configService.apiUrl+'/api/s3Storage',
// 上传请求头
uploadFileHeader: {
'Authorization':this.$store.state.vuex_token,
},
// 上传文件
fileList: [],
//我的页图标基础路径
myFileUrl: configService.fileUrl + 'aerocraft/my/',
2025-07-25 00:38:34 +08:00
// 订单页图标基础路径
fileUrl: configService.fileUrl + 'aerocraft/order/',
// 轮播图
topBg: 'top-bg.png',
2025-07-25 00:38:34 +08:00
// 文字背景图
textBg: 'text-bg.png',
// 飞行任务空图标
empty: 'action-empty.png',
2025-07-25 11:04:04 +08:00
// 下拉三角
triangle: 'triangle.png',
// 弹窗关闭图标
closeIcon: 'close.png',
// 上传图片图标
uploadIcon: 'upload.png',
// 页面是否滚动到顶
topLevel: 0,
2025-07-25 00:38:34 +08:00
// 滚动顶部
scrollTop: 0,
2025-07-25 11:04:04 +08:00
// 展示任务新增弹窗
showAddAction: false,
2025-07-28 01:20:29 +08:00
// 执行设备列表
equipments:[],
// 显示设备选择器
showEquipment: false,
2025-07-25 11:04:04 +08:00
// 任务form
form:{
2025-07-28 01:20:29 +08:00
equipmentName: '',
equipmentId: '',
2025-07-25 11:04:04 +08:00
weight: '',
photo: ''
}
}
},
onPageScroll(e) {
2025-07-25 00:38:34 +08:00
const level = e.scrollTop/60;
if(level<=1) this.topLevel = level;
else this.topLevel = 1;
this.scrollTop = e.scrollTop;
},
2025-07-25 11:04:04 +08:00
methods:{
// 设备选择
handleClickPick(){
2025-07-28 01:20:29 +08:00
this.showEquipment = true;
},
// 上传图片
uploadFile({fileFullPath}){
this.form.photo = fileFullPath;
},
// 删除图片
removeFile(index){
this.form.photo = "";
},
// 选择器值改变
handleChangePick(index){
const val = this.equipments[index[0]];
this.form.equipmentId = val?.id || '';
this.form.equipmentName = val?.name || '';
2025-07-25 11:04:04 +08:00
}
}
}
</script>
<style scoped lang="scss">
.order-detail{
display: flex;
flex-direction: column;
min-height: 100vh;
.order-top{
width: 100%;
position: relative;
.top-abs{
position: absolute;
.order-status{
2025-07-25 00:38:34 +08:00
margin-top: 54rpx;
margin-left: 32rpx;
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 42rpx;
color: #333333;
}
.order-tips{
margin-top: 28rpx;
margin-left: 32rpx;
font-family: Source Han Sans SC;
font-weight: 400;
font-size: 28rpx;
color: #666666;
}
}
}
.order-content{
flex: 1;
z-index: 1;
margin-top: -230rpx;
background: #FFFFFF;
border-radius: 20rpx;
2025-07-25 00:38:34 +08:00
padding: 40rpx 30rpx calc(150rpx + env(safe-area-inset-bottom));
.fly-message{
display: flex;
flex-direction: column;
margin-bottom: 40rpx;
.message-title{
position: relative;
height: 52rpx;
.text-content{
z-index: 1;
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 36rpx;
color: #333333;
position: absolute;
}
.text-bg{
z-index: 0;
top: 0;position: absolute;
left: 0;
margin-top: 24rpx;
}
}
.message-empty{
margin-top: 16rpx;
padding: 90rpx 30rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.empty-text{
font-family: Source Han Sans SC;
font-weight: 400;
font-size: 30rpx;
color: #999999;
margin-top: 30rpx;
}
}
.message-content{
margin-top: 16rpx;
background: #F7F7F7;
border-radius: 30rpx;
display: flex;
flex-direction: column;
padding: 0 30rpx;
overflow: hidden;
.mc-lam{
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx 0;
border-bottom: 2rpx solid #E6E6E6;
font-family: Source Han Sans SC;
font-weight: 400;
font-size: 32rpx;
&:nth-last-child(1){
border-bottom: none;
}
.lam-title{
color: #5E5E5E;
}
.lam-value{
color: #333333;
text{
margin-right: 12rpx;
color: #FA6400;
font-family: Arial;
font-weight: bold;
font-size: 34rpx;
}
}
}
}
}
}
.order-bottom{
z-index: 2;
position: fixed;
bottom: -2rpx;
width: 100%;
background-color: #FFFFFF;
padding: 16rpx 24rpx calc(24rpx + env(safe-area-inset-bottom));
.add-action{
background: #FEE547;
border-radius: 12rpx;
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 30rpx;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
padding: 30rpx 0;
&:active{
margin: 4rpx 0;
font-size: 26rpx;
opacity: 0.8;
}
}
}
2025-07-25 11:04:04 +08:00
.action-popup{
padding: 30rpx 34rpx;
.action-top{
display: flex;
align-items: center;
justify-content: space-between;
.action-title{
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
.action-close{
margin-top: -10rpx;
}
}
2025-07-28 01:20:29 +08:00
.action-lamx{
margin-top: 16rpx;
display: flex;
padding-bottom: 30rpx;
margin-bottom: 124rpx;
.lam-title{
font-family: Source Han Sans SC;
font-weight: 400;
font-size: 32rpx;
color: #1A1A1A;
margin-right: 52rpx;
}
}
2025-07-25 11:04:04 +08:00
.action-lam{
border-bottom: 2rpx solid #D9D9D9;
margin-bottom: 34rpx;
display: flex;
align-items: center;
2025-07-28 01:20:29 +08:00
padding-bottom: 30rpx;
2025-07-25 11:04:04 +08:00
.lam-title{
font-family: Source Han Sans SC;
font-weight: 400;
font-size: 32rpx;
color: #1A1A1A;
margin-right: 50rpx;
}
2025-07-28 01:20:29 +08:00
.lam-input{
flex: 1;
&::v-deep .u-icon__icon{
color: #333333 !important;
}
}
.lam-input-right{
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
}
.action-save{
display: flex;
justify-content: center;
align-items: center;
background: #FEE547;
border-radius: 12rpx;
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 30rpx;
color: #333333;
padding: 30rpx 0;
margin-bottom: 44rpx;
&:active{
opacity: 0.8;
}
}
}
}
.lam-upload{
&-btn{
width: 200rpx;
height: 200rpx;
background: #FFFFFF;
border-radius: 20rpx;
border: 2rpx solid #CCCCCC;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
&-text{
margin-top: 14rpx;
font-family: Source Han Sans SC;
font-weight: 400;
font-size: 28rpx;
color: #1A1A1A;
2025-07-25 11:04:04 +08:00
}
}
}
</style>