新增历史订单页

This commit is contained in:
Double-_-Z 2025-07-31 01:06:16 +08:00
parent ba75524ecd
commit fac1f705e4
4 changed files with 74 additions and 35 deletions

View File

@ -1,6 +1,14 @@
<!-- 历史订单 --> <!-- 历史订单 -->
<template> <template>
<view class="aircraft-history"> <view class="aircraft-history">
<Topnav :topLevel="topLevel" title="历史订单" defaultBackColor="#333333"
defaultNavTextColor="#333333" showBack />
<view class="history-content">
<u-image width="100%" :src="fileUrl+topBg" mode="widthFix" />
<view class="order-history" :style="{top: CustomBar+'px'}">
123
</view>
</view>
<u-toast ref="uToast"></u-toast> <u-toast ref="uToast"></u-toast>
<Loading :show="loading" /> <Loading :show="loading" />
</view> </view>
@ -22,9 +30,25 @@ export default {
// //
CustomBar: this.CustomBar || 0, CustomBar: this.CustomBar || 0,
// #endif // #endif
//
fileUrl: configService.fileUrl + 'aerocraft/order/',
//
topBg: 'bg.png',
//
manned: 'manned.png',
//
goods: 'goods.png',
loading: true, // loading: true, //
//
topLevel: 0,
} }
}, },
onPageScroll(e) {
const level = e.scrollTop/60;
if(level<=1) this.topLevel = level;
else this.topLevel = 1;
this.scrollTop = e.scrollTop;
},
onLoad(options) { onLoad(options) {
this.loading = false; this.loading = false;
}, },
@ -39,5 +63,16 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.aircraft-history { .aircraft-history {
display: flex;
flex-direction: column;
min-height: 100vh;
background: #F5F5F5;
.history-content{
width: 100%;
position: relative;
.order-history{
position: absolute;
}
}
} }
</style> </style>

View File

@ -50,7 +50,7 @@ export default {
// //
fileUrl: configService.fileUrl + 'aerocraft/my/', fileUrl: configService.fileUrl + 'aerocraft/my/',
// //
topBg: 'top-bg.png', topBg: 'top-bg-a.png',
// //
// userMessage:{} // userMessage:{}
userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message), userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message),
@ -58,7 +58,7 @@ export default {
functions: [{ functions: [{
name: '历史订单', name: '历史订单',
icon: 'history.png', icon: 'history.png',
url: '' url: '/aircraft/server/my/child_pages/history'
},{ },{
name: '个人信息', name: '个人信息',
icon: 'self.png', icon: 'self.png',

View File

@ -54,7 +54,7 @@
<u-input disabled class="field-ninput" placeholder="下单时间" v-model="form.orderCreateTime" /> <u-input disabled class="field-ninput" placeholder="下单时间" v-model="form.orderCreateTime" />
</u-form-item> </u-form-item>
<u-form-item v-if="form.orderId" label="订单确认人:" :border-bottom="false"> <u-form-item v-if="form.orderId" label="订单确认人:" :border-bottom="false">
<u-input disabled class="field-ninput" placeholder="订单确认人" v-model="form.orderCreateTime" /> <u-input disabled class="field-ninput" placeholder="订单确认人" v-model="form.customerName" />
</u-form-item> </u-form-item>
<view class="field-btns"> <view class="field-btns">
<u-button type="warning" :custom-style="customStyle" style="width: 100%;" <u-button type="warning" :custom-style="customStyle" style="width: 100%;"
@ -125,11 +125,6 @@ export default {
trigger: ['change','blur'] trigger: ['change','blur']
}], }],
cargoWeight: [{ cargoWeight: [{
required: true,
message: '请输入货物重量',
trigger: ['change','blur']
},
{
// //
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
return this.$u.test.amount(value); return this.$u.test.amount(value);
@ -140,24 +135,11 @@ export default {
}], }],
surchargeAmount: [{ surchargeAmount: [{
required: true, required: true,
message: '请输入附加费', type: 'float',
trigger: ['change','blur']
},
{
//
validator: (rule, value, callback) => {
return this.$u.test.amount(value);
},
message: '附加费格式不正确', message: '附加费格式不正确',
// blurchange trigger: ['change','blur']
trigger: ['change','blur'],
}], }],
routeIds: [{ routeIds: [{
require: true,
message: '请至少选择一条路线',
trigger: ['change','blur']
},
{
// //
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
return value&&value.length>0; return value&&value.length>0;
@ -167,11 +149,6 @@ export default {
trigger: ['change','blur'], trigger: ['change','blur'],
}], }],
operatorIds: [{ operatorIds: [{
require: true,
message: '请至少选择一位操作员',
trigger: ['change','blur']
},
{
// //
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
return value&&value.length>0; return value&&value.length>0;
@ -223,23 +200,20 @@ export default {
}, },
onLoad(e) { onLoad(e) {
this.form.orderId = e.id || ''; this.form.orderId = e.id || '';
},
created() {
this.$nextTick(()=>{
this.init(); this.init();
});
}, },
methods: { methods: {
// //
async init(){ async init(){
//
let cusRes = await this.$api.allCustomers(); let cusRes = await this.$api.allCustomers();
// let opeRes = await this.$api.all
let selfRes = await this.$api.aSelfDetail(this.userMessage.id);
if(!cusRes){ if(!cusRes){
this.$refs.uToast.show({type: 'error',title: "客户获取失败!"}); this.$refs.uToast.show({type: 'error',title: "客户获取失败!"});
}else{ }else{
this.customers = cusRes || []; this.customers = cusRes || [];
} }
//
let selfRes = await this.$api.aSelfDetail(this.userMessage.id);
if(!selfRes){ if(!selfRes){
this.$refs.uToast.show({type: 'error',title: "个人信息获取失败!"}); this.$refs.uToast.show({type: 'error',title: "个人信息获取失败!"});
}else{ }else{
@ -248,6 +222,34 @@ export default {
this.scenics = scenRes || []; this.scenics = scenRes || [];
} }
} }
//
// let opeRes = await this.$api.all
//
if(this.form.orderId) this.getOrderDetail();
},
//
async getOrderDetail(){
let res = await this.$api.orderDetail(this.form.orderId);
if(res){
const { id, customerName, phone, scenicName, surchargeAmount, cargoWeight, orderNo, orderCreateTime } = res;
this.form = {
orderId: id,
orderNo: orderNo,
orderType: 1,
orderTypeName: '载物订单',
customerName: customerName,
customerId: '',//
phone: phone,
attractionName: scenicName,
attractionId: '',//
surchargeAmount: surchargeAmount,
cargoWeight: cargoWeight,
operatorIds: [],
routeIds: [],
orderCreateTime: orderCreateTime,
}
} else
this.$refs.uToast.show({type: 'error',title: "订单详情获取失败!"});
}, },
// 线 // 线
changeRoute(e){ changeRoute(e){

View File

@ -493,6 +493,8 @@ export default {
border-bottom: none; border-bottom: none;
} }
.lam-title{ .lam-title{
white-space: nowrap;
margin-right: 40rpx;
color: #5E5E5E; color: #5E5E5E;
} }
.lam-value{ .lam-value{