diff --git a/aircraft/server/index/index.vue b/aircraft/server/index/index.vue
index b1cf15f..005eabc 100644
--- a/aircraft/server/index/index.vue
+++ b/aircraft/server/index/index.vue
@@ -1,7 +1,9 @@
+ scroll-with-animation @scroll="scroll" @refresherrefresh="refresh"
+ :refresher-enabled="(isPilot&¤t!==3)||(!isPilot&¤t!==1)"
+ :refresher-triggered="triggered" @refresherpulling="onPulling" lower-threshold="60">
@@ -90,9 +92,13 @@ export default {
// 登录状态
isLogin: this.$store.state.vuex_token,
isPilot: this.$store.state.user_type == 1,
+ // 下拉刷新触发
+ triggered: false,
+ _freshing: false
}
},
mounted(){
+ this._freshing = false;
let index = uni.getStorageSync('current');
// B端没有设备和路线
this.current = (!index||(!this.isPilot&&(index===2||index===3)))?0:index;
@@ -141,9 +147,20 @@ export default {
this.oldScrollTop = e.detail.scrollTop;
},
// 上拉刷新
- refresh(){
- this.changeCurrent(this.current);
+ async refresh(){
+ if (this._freshing) return;
+ this._freshing = true;
+ await this.changeCurrent(this.current);
+ this.triggered = false;
+ this._freshing = false;
},
+ // 拉动高度
+ onPulling(e) {
+ if (e.detail.deltaY < 0) {
+ return;
+ }
+ this.triggered = true;
+ }
}
}
diff --git a/aircraft/server/my/child_pages/history.vue b/aircraft/server/my/child_pages/history.vue
index e1671e5..d5c9676 100644
--- a/aircraft/server/my/child_pages/history.vue
+++ b/aircraft/server/my/child_pages/history.vue
@@ -8,18 +8,19 @@
@@ -275,6 +369,14 @@ export default {
margin-left: -80rpx;
z-index: 1;
}
+ .field-btns{
+ width: 100%;
+ margin-top: auto;
+ margin-bottom: 30rpx;
+ padding-top: 30rpx;
+ display: flex;
+ align-items: center;
+ }
}
}
}
diff --git a/aircraft/server/order/detail.vue b/aircraft/server/order/detail.vue
index 777637d..9f8d9fc 100644
--- a/aircraft/server/order/detail.vue
+++ b/aircraft/server/order/detail.vue
@@ -6,8 +6,8 @@
- 待接单
- 请尽快执行任务
+ {{ orderDetail.mainOrderStatus }}
+ {{ orderDetail.mainOrderStatus === '已完成' ? '已完成飞行任务' : '请尽快执行任务'}}
@@ -20,23 +20,23 @@
订单类型
- 载人
+ {{ orderDetail.orderType.slice(0, 2) }}
景区
- 白云山
+ {{ orderDetail.scenicName }}
路线
- 南门→山顶广场
+ {{ orderDetail.routeName }}
货物重量
- 56 KG
+ {{ orderDetail.cargoWeight }} KG
附加费
- 100元
+ {{ orderDetail.surchargeAmount }}元
@@ -49,23 +49,23 @@
发起人
- 李晓霞
+ {{ orderDetail.orderInitiator }}
客户名称
- 李晓霞
+ {{ orderDetail.customerName }}
手机号
- 13624566325
+ {{ orderDetail.phone }}
操作员
- 陈新生
+ {{ orderDetail.operatorName }}
下单时间
- 2025-07-06 14:02:08
+ {{ orderDetail.orderCreateTime }}
@@ -75,7 +75,29 @@
-
+
+
+
+
+ {{ item.deviceName }}
+ 重量: {{ item.cargoWeight }}KG
+ 操作员: {{ item.operatorName }}
+
+
+ {{ item.orderItemStatus }}
+
+
+
+ 删除
+ 更改状态
+
+
+
+
~暂无任务~
@@ -83,7 +105,7 @@
-
+
新增任务
@@ -174,6 +196,7 @@
: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)'}">
+
@@ -206,6 +229,29 @@ export default {
uploadFileHeader: {
'Authorization':this.$store.state.vuex_token,
},
+ // 执行任务按钮样式
+ customStyle: {
+ backgroundColor: '#FEE547',
+ color: '#333333',
+ fontSize: '30rpx',
+ fontWeight: 'bold',
+ fontFamily: 'Source Han Sans SC',
+ width: '160rpx',
+ height: '72rpx',
+ borderRadius: '12rpx',
+ border: 'none'
+ },
+ deleteCustomStyle:{
+ backgroundColor: '#FFFFFF',
+ color: '#333333',
+ fontSize: '30rpx',
+ fontWeight: 'bold',
+ fontFamily: 'Source Han Sans SC',
+ width: '160rpx',
+ height: '70rpx',
+ borderRadius: '10rpx',
+ border: '2rpx solid #999999'
+ },
// 上传文件
fileList: [],
//我的页图标基础路径
@@ -224,6 +270,10 @@ export default {
closeIcon: 'close.png',
// 上传图片图标
uploadIcon: 'upload.png',
+ // 蒙层
+ mask: 'mask.png',
+ // 飞行任务默认图片
+ defaultIcon: 'default.png',
// 页面是否滚动到顶
topLevel: 0,
// 滚动顶部
@@ -241,8 +291,10 @@ export default {
weight: '',
photo: ''
},
+ // 订单详情
+ orderDetail: {},
// 当前页
- current: 0
+ current: 0,
}
},
onPageScroll(e) {
@@ -251,7 +303,17 @@ export default {
else this.topLevel = 1;
this.scrollTop = e.scrollTop;
},
+ onLoad(e) {
+ this.init(e.id);
+ },
methods:{
+ // 初始化
+ async init(id){
+ if(!id) return;
+ let res = await this.$api.orderDetail(id);
+ if(res) this.orderDetail = res;
+ else this.$refs.uToast.show({type: 'error',title: "订单详情获取失败!"});
+ },
// 设备选择
handleClickPick(){
this.showEquipment = true;
@@ -277,6 +339,14 @@ export default {
this.current = 0;
}
this.current += 1;
+ },
+ // 删除任务
+ handleDeleteAction(item){
+
+ },
+ // 更改任务状态
+ handleChangeAction(item){
+
}
}
}
@@ -339,6 +409,54 @@ export default {
margin-top: 24rpx;
}
}
+ &-content{
+ background-size: contain;
+ margin-top: 16rpx;
+ background-repeat: no-repeat;
+ // background: linear-gradient(0deg, #FFF6BD, #FFFDF1);
+ background-color: #FFFFFF;
+ box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(200,199,193,0.3);
+ border-radius: 16rpx;
+ margin-bottom: 26rpx;
+ .action-detail{
+ margin: 40rpx 20rpx 0;
+ display: flex;
+ &-photo{
+ margin-right: 20rpx;
+ }
+ &-content{
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ font-family: Source Han Sans SC;
+ font-weight: 400;
+ font-size: 28rpx;
+ color: #666666;
+ .action-device{
+ font-weight: bold;
+ font-size: 32rpx;
+ color: #333333;
+ margin-bottom: 16rpx;
+ }
+ .action-operator{
+ margin-top: 12rpx;
+ }
+ }
+ &-status{
+ font-family: Source Han Sans SC;
+ font-weight: 500;
+ font-size: 28rpx;
+ color: #F8B500;
+ margin-right: 10rpx;
+ }
+ }
+ .action-btns{
+ margin-top: 18rpx;
+ display: flex;
+ align-items: center;
+ margin-bottom: 30rpx;
+ }
+ }
.message-empty{
margin-top: 16rpx;
padding: 90rpx 30rpx;
diff --git a/aircraft/server/order/order.vue b/aircraft/server/order/order.vue
index dec2377..df75523 100644
--- a/aircraft/server/order/order.vue
+++ b/aircraft/server/order/order.vue
@@ -3,14 +3,14 @@
-
+
- {{ item.mainOrderStatus }}
- 订单类型:{{ item.orderType }}
+ {{ orderStatus[item.mainOrderStatus] }}
+ 订单类型:{{ orderTypes[item.orderType] }}
- 景区:{{ item.attractionId }}
+ 景区:{{ scenics[item.attractionId] }}
路线:{{ item.routeName }}
@@ -19,19 +19,20 @@
+ :src="fileUrl+(customers[item.customerId].gender === '男' ? boyIcon : girlIcon)" />
- {{ item.customerName }}
+ {{ customers[item.customerId].name }}
{{ item.customerPhone }}
执行任务
+ :hair-line="false" @click.stop="handleDoAction(item)">执行任务
-
+
+
@@ -70,44 +71,20 @@ export default {
girlIcon: 'girl.png',
// 男生头像
boyIcon: 'boy.png',
+ // 订单状态
+ orderStatus: {
+ 0:'未进行',
+ 1:'进行中',
+ 2:'已完成',
+ 3:'已取消'
+ },
+ // 订单类型
+ orderTypes: {
+ 1: '载物',
+ 2: '载人'
+ },
// 订单列表
- orders: [{
- id: 1,
- mainOrderStatus: '待接单',
- orderType: '载物',
- attractionId: '白云山',
- customerPhone: '13624566325',
- routeName: '南门→山顶广场',
- gender: 1,
- customerName: '李晓霞'
- },{
- id: 2,
- mainOrderStatus: '待接单',
- orderType: '载人',
- attractionId: '白云山',
- customerPhone: '13624566325',
- routeName: '南门→山顶广场',
- gender: 0,
- customerName: '李道明'
- },{
- id: 3,
- mainOrderStatus: '待接单',
- orderType: '载物',
- attractionId: '白云山',
- customerPhone: '13624566325',
- routeName: '南门→山顶广场',
- gender: 1,
- customerName: '李晓霞'
- },{
- id: 4,
- mainOrderStatus: '待接单',
- orderType: '载物',
- attractionId: '白云山',
- customerPhone: '13624566325',
- routeName: '南门→山顶广场',
- gender: 1,
- customerName: '李晓霞'
- }],
+ orders: [],
// 执行任务按钮样式
customStyle: {
backgroundColor: '#FEE547',
@@ -119,20 +96,76 @@ export default {
height: '72rpx',
borderRadius: '12rpx',
border: 'none'
- }
+ },
+ // 用户信息
+ userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message),
+ // 翻页参数
+ form:{
+ current: 1,
+ size: 10,
+ // 是否结束——loadmore加载更多,loading加载中,nomore无更多
+ isFinish: 'nomore',
+ },
+ // 用户列表
+ customers: {},
+ // 景区列表
+ scenics: {}
}
},
+ onLoad() {
+ this.$nextTick(()=>{
+ this.init();
+ })
+ },
methods:{
// 初始化
async init(){
-
+ this.form = {size: 10,current: 1,isFinish: 'nomore'};
+ // 查询订单列表
+ await this.getOrderList();
+ // 查询全部客户
+ let cusRes = await this.$api.allCustomers();
+ if(!cusRes){
+ this.$refs.uToast.show({type: 'error',title: "客户获取失败!"});
+ }else this.customers = await cusRes.reduce((obj, item) => ({...obj,[item.id]: item}), {})||{};
+ // 查询全部景区
+ let scenRes = await this.$api.allScenic();
+ if(!scenRes)
+ this.$refs.uToast.show({type: 'error',title: "景区列表获取失败!"});
+ else this.scenics = await scenRes.reduce((obj, item) => ({...obj,[item.id]: item.name}), {})||{};
+ },
+ // 查询订单列表
+ async getOrderList(){
+ this.form.isFinish = 'loading';
+ let ordRes = await this.$api.getOrders(this.form);
+ if(ordRes){
+ const { records, size, total, current } = ordRes;
+ if(current === 1) this.orders = records || [];
+ else this.orders.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.getOrderList();
},
// 执行任务
handleDoAction(item){
uni.navigateTo({
url: `/aircraft/server/order/detail?id=${item.id}`
})
- }
+ },
+ // 查看详情
+ showDetail(item){
+ uni.navigateTo({
+ url: `/aircraft/server/order/add?id=${item.id}`
+ })
+ },
}
}
diff --git a/common/http.api.js b/common/http.api.js
index d779094..3832e63 100644
--- a/common/http.api.js
+++ b/common/http.api.js
@@ -11,10 +11,18 @@ const install = (Vue, vm) => {
vm.$api.aUpdatePass = async (params = {}) => await vm.$u.post(`/api/emEmployees/updatePass`,params);// 修改飞行员密码
vm.$api.bUpdatePass = async (params = {}) => await vm.$u.post(`/cnCustomer/updatePass`,params);// 修改客户密码
- // 区域管理
+ // 区域/景区管理
vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域
vm.$api.allScenicsByAreaId = async (params = {}) => await vm.$u.get('/emScenic/all',params);// 获取区域下全部景区
+ vm.$api.allRoutesByScenicId = async (scenicId) => await vm.$u.get(`/api/dataDropdown/obtainRouteListByScenicId/${scenicId}`);// 根据景区获取对应的线路
+ vm.$api.allScenic = async () => await vm.$u.get('/emScenic/all');// 获取全部景区
+ vm.$api.singleScenic = async (id) => await vm.$u.get(`/emScenic/${id}`);// 查询单个景区
+ // 订单管理
+ vm.$api.completeOrder = async (orderId) => await vm.$u.get(`/api/order/completeOrder/${orderId}`);// 完成订单
+ vm.$api.getOrders = async (params = {}) => await vm.$u.get('/api/order/allOrder',params);// 获取订单列表
+ vm.$api.orderDetail = async (id) => await vm.$u.get(`/api/order/queryOrderDetail/${id}`);// 查询单个订单
+
// 客户管理
vm.$api.allCustomers = async () => await vm.$u.get('/cnCustomer/all');// 获取全部客户