新增历史订单页
This commit is contained in:
parent
ba75524ecd
commit
fac1f705e4
@ -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>
|
@ -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',
|
||||||
|
@ -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: '附加费格式不正确',
|
||||||
// 触发器可以同时用blur和change
|
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 || '';
|
||||||
},
|
this.init();
|
||||||
created() {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
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){
|
||||||
|
@ -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{
|
||||||
|
Loading…
Reference in New Issue
Block a user