2025-07-02 14:58:38 +08:00
|
|
|
<template>
|
|
|
|
<view class="mobile-index">
|
2025-08-01 01:07:23 +08:00
|
|
|
<Topnav v-if="isPilot?aNavicationList[current].navTitle:bNavicationList[current].navTitle"
|
|
|
|
:topLevel="topLevel" :title="isPilot?aNavicationList[current].navTitle:bNavicationList[current].navTitle" />
|
2025-07-23 00:15:17 +08:00
|
|
|
<scroll-view :scroll-top="scrollTop" :scrollY="true" class="u-page upage"
|
2025-07-30 18:00:25 +08:00
|
|
|
scroll-with-animation @scroll="scroll" @refresherrefresh="refresh"
|
|
|
|
:refresher-enabled="(isPilot&¤t!==3)||(!isPilot&¤t!==1)"
|
|
|
|
:refresher-triggered="triggered" @refresherpulling="onPulling" lower-threshold="60">
|
2025-07-02 14:58:38 +08:00
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
2025-08-03 01:01:22 +08:00
|
|
|
<Order ref="pageRef" :isPilot="isPilot" v-if="current===0" />
|
2025-07-24 17:11:58 +08:00
|
|
|
<Equipment ref="pageRef" :topLevel="topLevel" v-if="isPilot&¤t===1" />
|
|
|
|
<Route ref="pageRef" :topLevel="topLevel" v-else-if="isPilot&¤t===2" />
|
2025-08-03 01:01:22 +08:00
|
|
|
<My ref="pageRef" :isPilot="isPilot" :isLogin="isLogin" @userLogOut="isLogin=''" v-else-if="isPilot&¤t===3||current===1" />
|
2025-07-02 14:58:38 +08:00
|
|
|
<!-- #endif -->
|
|
|
|
<!-- #ifndef MP-WEIXIN -->
|
2025-07-14 18:41:30 +08:00
|
|
|
<component ref="pageRef" :topLevel="topLevel" :is="refs[current]"
|
2025-07-02 14:58:38 +08:00
|
|
|
:isLogin="isLogin" @userLogOut="isLogin=''"></component>
|
|
|
|
<!-- #endif -->
|
2025-07-23 00:15:17 +08:00
|
|
|
</scroll-view>
|
2025-07-02 14:58:38 +08:00
|
|
|
<view class="navigation">
|
2025-07-22 20:32:35 +08:00
|
|
|
<view @click="changeCurrent(index)" class="nav-item"
|
|
|
|
:class="current===index?'nav-item-selected':''"
|
2025-07-24 17:11:58 +08:00
|
|
|
v-for="(item,index) in isPilot?aNavicationList:bNavicationList" :key="index">
|
2025-07-02 14:58:38 +08:00
|
|
|
<image :src="fileUrl+(current===index?item.select:item.icon)"></image>
|
2025-07-22 20:32:35 +08:00
|
|
|
<text>{{ item.name }}</text>
|
2025-07-02 14:58:38 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<Loading :show="loading" />
|
2025-07-23 00:15:17 +08:00
|
|
|
<view @click="goTop">
|
|
|
|
<u-back-top :scrollTop="oldScrollTop" zIndex="100" :duration="500"
|
2025-07-23 16:02:02 +08:00
|
|
|
:iconStyle="{ color: '#fff' }" :customStyle="{background: 'linear-gradient(180deg, #f8b500 0%, #fceabb 100%)',
|
|
|
|
boxShadow: '0rpx 0rpx 12rpx rgba(202,202,182,0.5)',
|
2025-07-23 00:15:17 +08:00
|
|
|
filter: 'opacity(0.96)'}"></u-back-top>
|
|
|
|
</view>
|
2025-08-03 01:01:22 +08:00
|
|
|
<Movable v-if="current === 0 && isPilot" :iconName="ordFileUrl+addIcon" />
|
2025-07-02 14:58:38 +08:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2025-07-14 18:41:30 +08:00
|
|
|
import Order from '@/aircraft/server/order/order.vue';
|
|
|
|
import Equipment from '@/aircraft/server/equipment/equipment.vue';
|
|
|
|
import Route from '@/aircraft/server/route/route.vue';
|
2025-07-02 14:58:38 +08:00
|
|
|
import My from '@/aircraft/server/my/my.vue';
|
|
|
|
import configService from '@/common/config.service.js';
|
2025-08-01 01:07:23 +08:00
|
|
|
import Topnav from '@/components/topnav/index.vue';
|
2025-08-01 18:07:48 +08:00
|
|
|
import Movable from '../order/components/movable.vue';
|
2025-07-02 14:58:38 +08:00
|
|
|
export default {
|
|
|
|
components: {
|
2025-08-01 18:07:48 +08:00
|
|
|
Order, Equipment, Route, My, Topnav, Movable
|
2025-07-02 14:58:38 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
current: uni.getStorageSync('current')||0,// 当前页码下标
|
|
|
|
loading: false,
|
2025-07-21 01:24:26 +08:00
|
|
|
fileUrl: configService.fileUrl + 'aerocraft/navigation/',//导航栏图标基础路径
|
2025-08-01 18:07:48 +08:00
|
|
|
ordFileUrl: configService.fileUrl + 'aerocraft/order/',//订单页图标基础路径
|
|
|
|
// 新增图标
|
|
|
|
addIcon: 'add.png',
|
2025-08-01 01:07:23 +08:00
|
|
|
// a端导航栏按钮
|
2025-07-24 17:11:58 +08:00
|
|
|
aNavicationList:[
|
2025-07-02 14:58:38 +08:00
|
|
|
{
|
2025-07-14 18:41:30 +08:00
|
|
|
name: '订单',
|
|
|
|
icon: 'order.png',
|
2025-08-01 01:07:23 +08:00
|
|
|
select: 'order-select.png',
|
|
|
|
navTitle: '爱尚云'
|
2025-07-02 14:58:38 +08:00
|
|
|
},
|
|
|
|
{
|
2025-07-14 18:41:30 +08:00
|
|
|
name: '设备',
|
|
|
|
icon: 'equipment.png',
|
2025-08-07 04:48:06 +08:00
|
|
|
select: 'equipment-select.png',
|
|
|
|
navTitle: '爱尚云'
|
2025-07-14 18:41:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: '路线',
|
|
|
|
icon: 'route.png',
|
2025-08-06 16:29:04 +08:00
|
|
|
select: 'route-select.png',
|
|
|
|
navTitle: '路线'
|
2025-07-02 14:58:38 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: '我的',
|
|
|
|
icon: 'my.png',
|
|
|
|
select: 'my-select.png'
|
|
|
|
}
|
|
|
|
],
|
2025-08-01 01:07:23 +08:00
|
|
|
// b端导航栏按钮
|
2025-07-24 17:11:58 +08:00
|
|
|
bNavicationList:[
|
|
|
|
{
|
|
|
|
name: '订单',
|
|
|
|
icon: 'order.png',
|
2025-08-01 01:07:23 +08:00
|
|
|
select: 'order-select.png',
|
|
|
|
navTitle: '爱尚云'
|
2025-07-24 17:11:58 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: '我的',
|
|
|
|
icon: 'my.png',
|
|
|
|
select: 'my-select.png'
|
|
|
|
}
|
|
|
|
],
|
2025-07-02 14:58:38 +08:00
|
|
|
topLevel: 0,// 页面是否滚动到顶
|
|
|
|
// 滚动顶部
|
|
|
|
scrollTop: 0,
|
2025-07-23 00:15:17 +08:00
|
|
|
oldScrollTop: 0,
|
2025-07-02 14:58:38 +08:00
|
|
|
// refs组件列表
|
2025-07-14 18:41:30 +08:00
|
|
|
refs: ['order','equipment','route','my'],
|
2025-07-02 14:58:38 +08:00
|
|
|
// 登录状态
|
|
|
|
isLogin: this.$store.state.vuex_token,
|
2025-07-24 17:11:58 +08:00
|
|
|
isPilot: this.$store.state.user_type == 1,
|
2025-07-30 18:00:25 +08:00
|
|
|
// 下拉刷新触发
|
|
|
|
triggered: false,
|
|
|
|
_freshing: false
|
2025-07-02 14:58:38 +08:00
|
|
|
}
|
|
|
|
},
|
2025-07-24 18:50:16 +08:00
|
|
|
mounted(){
|
2025-08-01 01:07:23 +08:00
|
|
|
},
|
|
|
|
onShow(){
|
2025-07-30 18:00:25 +08:00
|
|
|
this._freshing = false;
|
2025-07-02 14:58:38 +08:00
|
|
|
let index = uni.getStorageSync('current');
|
2025-07-24 18:50:16 +08:00
|
|
|
// B端没有设备和路线
|
|
|
|
this.current = (!index||(!this.isPilot&&(index===2||index===3)))?0:index;
|
2025-07-02 14:58:38 +08:00
|
|
|
this.isLogin = this.$store.state.vuex_token;
|
2025-07-24 17:11:58 +08:00
|
|
|
this.isPilot = this.$store.state.user_type;
|
2025-07-02 14:58:38 +08:00
|
|
|
this.changeCurrent(this.current);
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
// 切换页面
|
|
|
|
changeCurrent(index){
|
|
|
|
this.current = index;
|
|
|
|
uni.setStorageSync('current',index);
|
2025-07-23 00:15:17 +08:00
|
|
|
// if(this.current === 1 && !this.isLogin){
|
|
|
|
if(!this.isLogin){
|
2025-07-14 18:41:30 +08:00
|
|
|
const url = '/aircraft/server/index/index';
|
2025-07-02 14:58:38 +08:00
|
|
|
uni.navigateTo({
|
2025-07-14 18:41:30 +08:00
|
|
|
url: `/aircraft/server/my/child_pages/login?nextUrl=${url}`
|
2025-07-02 14:58:38 +08:00
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
this.$refs.pageRef.init();
|
|
|
|
})
|
|
|
|
},
|
2025-07-23 00:15:17 +08:00
|
|
|
// 滚动回顶部
|
|
|
|
goTop() {
|
|
|
|
this.scrollTop = this.oldScrollTop;
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
this.scrollTop = 0;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 滚动监听
|
|
|
|
scroll(e){
|
|
|
|
const level = e.detail.scrollTop/60;
|
|
|
|
if(level<=1) this.topLevel = level;
|
|
|
|
else this.topLevel = 1;
|
|
|
|
this.oldScrollTop = e.detail.scrollTop;
|
|
|
|
},
|
|
|
|
// 上拉刷新
|
2025-07-30 18:00:25 +08:00
|
|
|
async refresh(){
|
|
|
|
if (this._freshing) return;
|
|
|
|
this._freshing = true;
|
|
|
|
await this.changeCurrent(this.current);
|
|
|
|
this.triggered = false;
|
|
|
|
this._freshing = false;
|
2025-07-23 00:15:17 +08:00
|
|
|
},
|
2025-07-30 18:00:25 +08:00
|
|
|
// 拉动高度
|
|
|
|
onPulling(e) {
|
|
|
|
if (e.detail.deltaY < 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.triggered = true;
|
|
|
|
}
|
2025-07-02 14:58:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.mobile-index{
|
|
|
|
position: relative;
|
|
|
|
// width: 100%;
|
2025-07-22 20:32:35 +08:00
|
|
|
min-height: 100vh;
|
2025-07-02 14:58:38 +08:00
|
|
|
display: flex;
|
2025-07-22 20:32:35 +08:00
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
2025-07-02 14:58:38 +08:00
|
|
|
.upage{
|
2025-07-23 00:15:17 +08:00
|
|
|
background-color: #F5F5F5;
|
2025-07-02 14:58:38 +08:00
|
|
|
width: 100%;
|
2025-07-22 20:32:35 +08:00
|
|
|
height: calc(100vh - 114rpx - constant(safe-area-inset-bottom));
|
|
|
|
height: calc(100vh - 114rpx - env(safe-area-inset-bottom));
|
|
|
|
overflow-y: auto;
|
2025-07-02 14:58:38 +08:00
|
|
|
}
|
|
|
|
.navigation{
|
2025-07-22 20:32:35 +08:00
|
|
|
width: 100%;
|
|
|
|
// height: 126rpx;
|
2025-07-02 14:58:38 +08:00
|
|
|
position: fixed;
|
2025-07-22 20:32:35 +08:00
|
|
|
bottom: 0;
|
|
|
|
z-index: 90;
|
2025-07-02 14:58:38 +08:00
|
|
|
display: flex;
|
|
|
|
background-color: #ffffff;
|
|
|
|
justify-content: space-around;
|
2025-07-22 20:32:35 +08:00
|
|
|
padding-top: 18rpx;
|
|
|
|
padding-bottom: calc(10rpx + constant(safe-area-inset-bottom));
|
|
|
|
padding-bottom: calc(10rpx + env(safe-area-inset-bottom));
|
2025-07-02 14:58:38 +08:00
|
|
|
align-items: center;
|
2025-07-22 20:32:35 +08:00
|
|
|
border-top: 2rpx solid #E6E6E6;
|
|
|
|
.nav-item-selected{
|
2025-07-23 00:15:17 +08:00
|
|
|
color: #333333 !important;
|
2025-07-22 20:32:35 +08:00
|
|
|
}
|
2025-07-02 14:58:38 +08:00
|
|
|
.nav-item{
|
2025-07-22 20:32:35 +08:00
|
|
|
font-family: Source Han Sans SC;
|
|
|
|
font-size: 26rpx;
|
|
|
|
color: #666666;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
2025-07-02 14:58:38 +08:00
|
|
|
image{
|
2025-07-22 20:32:35 +08:00
|
|
|
width: 42rpx;
|
|
|
|
height: 42rpx;
|
|
|
|
margin-bottom: 10rpx;
|
2025-07-02 14:58:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|